@qwen-code/qwen-code 0.27.2-preview.0 → 0.27.2

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 (302) hide show
  1. package/chunks/{MaxSizedBox-XGJBXFET.js → MaxSizedBox-QRQEXRXW.js} +1 -1
  2. package/chunks/{StandaloneSessionPicker-BNFJWFLQ.js → StandaloneSessionPicker-X274Q6BX.js} +1 -1
  3. package/chunks/{acp-subagent-executor-P5FBYPD5.js → acp-subagent-executor-YIFQD4LJ.js} +1 -1
  4. package/chunks/{acpAgent-J6G57ZCE.js → acpAgent-NW4XNW7P.js} +3 -3
  5. package/chunks/{advisor-3O63GFOM.js → advisor-W7KCVPBR.js} +1 -1
  6. package/chunks/{agent-ALZEISY2.js → agent-FGDWPNXW.js} +1 -1
  7. package/chunks/{agent-headless-XAKKB6OT.js → agent-headless-7KA3VVAB.js} +1 -1
  8. package/chunks/{agent-host-client-DIV2XAL5.js → agent-host-client-YZJLSOLB.js} +1 -1
  9. package/chunks/{agent-host-connections-ZQUMCO2F.js → agent-host-connections-5JGDPG3L.js} +1 -1
  10. package/chunks/{anthropicContentGenerator-ZE7TAQPO.js → anthropicContentGenerator-QUXJVJ3I.js} +1 -1
  11. package/chunks/{autofix-pr-RZ4PWQ46.js → autofix-pr-UDRPJC7L.js} +1 -1
  12. package/chunks/{batch-AIMBHUMX.js → batch-GCEHGR5P.js} +1 -1
  13. package/chunks/{bridge-A3RRGPEI.js → bridge-JY2JXNVV.js} +1 -1
  14. package/chunks/{channel-settings-store-P3KM5GTN.js → channel-settings-store-EX6ZU6R3.js} +1 -1
  15. package/chunks/{chunk-P22U5UQR.js → chunk-27MJJU2I.js} +1 -1
  16. package/chunks/{chunk-RYRMDOIX.js → chunk-2LDABIAY.js} +3 -3
  17. package/chunks/{chunk-MYPEVUKI.js → chunk-2QZDPMIH.js} +1 -1
  18. package/chunks/{chunk-TW2REHPX.js → chunk-2SGTJMSU.js} +1 -1
  19. package/chunks/{chunk-NCW3NPS5.js → chunk-3BHXPXCC.js} +1 -1
  20. package/chunks/{chunk-XUB4JKSR.js → chunk-3NR3JBMA.js} +6 -6
  21. package/chunks/{chunk-NRJOUWP4.js → chunk-3QCFMVI6.js} +1 -1
  22. package/chunks/{chunk-EGMV4S6D.js → chunk-3YOERSU5.js} +1 -1
  23. package/chunks/{chunk-WXKD4L4A.js → chunk-4NIUXYUF.js} +1 -1
  24. package/chunks/{chunk-YHC27L5W.js → chunk-5FS5OQHO.js} +1 -1
  25. package/chunks/{chunk-L76RFQKW.js → chunk-5MGG2BGT.js} +1 -1
  26. package/chunks/{chunk-HHDQ5JAA.js → chunk-66LFVQJP.js} +1 -1
  27. package/chunks/{chunk-RJPELYUW.js → chunk-6KU7LHBT.js} +1 -1
  28. package/chunks/{chunk-SKU5J7Q7.js → chunk-6O7CARPF.js} +1 -1
  29. package/chunks/{chunk-CPOFE42B.js → chunk-6Z3TBTUS.js} +1 -1
  30. package/chunks/{chunk-HRRQHZQE.js → chunk-73TSS7KS.js} +1 -1
  31. package/chunks/{chunk-BSGONILH.js → chunk-776L3HAN.js} +1 -1
  32. package/chunks/{chunk-MZNZYCAC.js → chunk-7BL2OTHX.js} +1 -1
  33. package/chunks/{chunk-5DPLJQUC.js → chunk-7GYFDPEP.js} +1 -1
  34. package/chunks/{chunk-OD44AOSX.js → chunk-7KGCNYE4.js} +1 -1
  35. package/chunks/{chunk-4JLLFT6S.js → chunk-7SX547WS.js} +1 -1
  36. package/chunks/{chunk-5Q6POUDM.js → chunk-7VIES3RW.js} +1 -1
  37. package/chunks/{chunk-NMK72ZA4.js → chunk-ABEBQNYK.js} +1 -1
  38. package/chunks/{chunk-QZ5JBF3E.js → chunk-AD7JBW6R.js} +2 -2
  39. package/chunks/{chunk-E6XRNALG.js → chunk-AEX3XSTE.js} +1 -1
  40. package/chunks/{chunk-B7CYUTAO.js → chunk-AKDODQCI.js} +1 -1
  41. package/chunks/{chunk-EEARSY3D.js → chunk-B3I5LFFK.js} +1 -1
  42. package/chunks/{chunk-YSGVX6LT.js → chunk-B5Y56PDI.js} +1 -1
  43. package/chunks/{chunk-MEFN5DY3.js → chunk-BEBKKJP3.js} +1 -1
  44. package/chunks/{chunk-GYCGVZ32.js → chunk-BFPP7X4E.js} +1 -1
  45. package/chunks/{chunk-GNWPYWGQ.js → chunk-BY5GX6DQ.js} +1 -1
  46. package/chunks/{chunk-6W5ZZSQF.js → chunk-CUX3C6QV.js} +1 -1
  47. package/chunks/{chunk-HXYHIEMH.js → chunk-CXPRHT3E.js} +1 -1
  48. package/chunks/{chunk-53CWA7N2.js → chunk-D5H5GARR.js} +1 -1
  49. package/chunks/{chunk-DV67DRNT.js → chunk-DLY7QJ5Y.js} +1 -1
  50. package/chunks/{chunk-SFDOJ2FF.js → chunk-DN4QKOFL.js} +1 -1
  51. package/chunks/{chunk-VOAIDOUV.js → chunk-DP4YE24V.js} +1 -1
  52. package/chunks/{chunk-D2X6A5FH.js → chunk-DQLI7HH7.js} +1 -1
  53. package/chunks/{chunk-ET7ADS4X.js → chunk-DS2FKATN.js} +1 -1
  54. package/chunks/{chunk-FRSSRLIO.js → chunk-E6EW43WZ.js} +1 -1
  55. package/chunks/{chunk-F4AWT5LV.js → chunk-EEBFFC76.js} +1 -1
  56. package/chunks/{chunk-B7PJ5TNK.js → chunk-EGKUF5NS.js} +2 -2
  57. package/chunks/{chunk-B2YLVSQE.js → chunk-ERMAKXS3.js} +2 -2
  58. package/chunks/{chunk-PEZZTKPM.js → chunk-FB73O3E5.js} +1 -1
  59. package/chunks/{chunk-36DBNBTF.js → chunk-FEIUMWFA.js} +1 -1
  60. package/chunks/{chunk-YE3LA3U4.js → chunk-FWJKQA2H.js} +1 -1
  61. package/chunks/{chunk-VDNPMX5W.js → chunk-FZQJOSHD.js} +1 -1
  62. package/chunks/{chunk-YYSMMFK7.js → chunk-GNI5J2ON.js} +1 -1
  63. package/chunks/{chunk-6OCKLRQC.js → chunk-H3VGRICV.js} +1 -1
  64. package/chunks/{chunk-OSLFWRV2.js → chunk-HRTWLOGK.js} +1 -1
  65. package/chunks/{chunk-XZYQKCTU.js → chunk-IGIZ6AZE.js} +1 -1
  66. package/chunks/{chunk-RIBVEHUG.js → chunk-IHB7CDQ2.js} +1 -1
  67. package/chunks/{chunk-LO6OFMFC.js → chunk-IHEGGZBE.js} +1 -1
  68. package/chunks/{chunk-N5S6SIRO.js → chunk-IMTHBYJP.js} +1 -1
  69. package/chunks/{chunk-I5F24CVP.js → chunk-IP3K5SRR.js} +1 -1
  70. package/chunks/{chunk-2FYWJVGW.js → chunk-ISA4MFNT.js} +1 -1
  71. package/chunks/{chunk-GV3E2RHX.js → chunk-JGF3ND5D.js} +1 -1
  72. package/chunks/{chunk-ASQ7BSJ4.js → chunk-JJ4UPR4A.js} +1 -1
  73. package/chunks/{chunk-HOCNE2LO.js → chunk-JTUWFGEB.js} +1 -1
  74. package/chunks/{chunk-FDQFJFO5.js → chunk-KAN5KUJD.js} +1 -1
  75. package/chunks/{chunk-K7GCWWTI.js → chunk-KU4F6SSJ.js} +2 -2
  76. package/chunks/{chunk-QDQQFQB4.js → chunk-LBAINHIN.js} +1 -1
  77. package/chunks/{chunk-BAPIZCC7.js → chunk-LTJLPYFS.js} +1 -1
  78. package/chunks/{chunk-ZOUMCSDW.js → chunk-MSNPEQ2I.js} +1 -1
  79. package/chunks/{chunk-MPDGSR2S.js → chunk-N3YWQWSR.js} +5 -5
  80. package/chunks/{chunk-VEVQB4CI.js → chunk-NDTPBVER.js} +1 -1
  81. package/chunks/{chunk-L4WG2XDS.js → chunk-NJ77L3GS.js} +1 -1
  82. package/chunks/{chunk-U2DX235N.js → chunk-NL62UQDW.js} +1 -1
  83. package/chunks/{chunk-QASJXL5B.js → chunk-NYXR2655.js} +1 -1
  84. package/chunks/{chunk-5SPQ5V35.js → chunk-OEPXWKZL.js} +1 -1
  85. package/chunks/{chunk-EOR7AP7Z.js → chunk-OIKWJN7E.js} +1 -1
  86. package/chunks/{chunk-BT7V3O75.js → chunk-OIQKVWR7.js} +1 -1
  87. package/chunks/{chunk-ESXBBANA.js → chunk-OPBSEVFC.js} +1 -1
  88. package/chunks/{chunk-NW3H676V.js → chunk-P5RBFVMP.js} +1 -1
  89. package/chunks/{chunk-F7KVMGGZ.js → chunk-QD4KNY2J.js} +1 -1
  90. package/chunks/{chunk-2ZE6CAZV.js → chunk-RSLBGXPB.js} +1 -1
  91. package/chunks/{chunk-3R7NEEW7.js → chunk-S542WTV7.js} +1 -1
  92. package/chunks/{chunk-KXAZ2Z5M.js → chunk-SEK234IM.js} +1 -1
  93. package/chunks/{chunk-5DPXLL3H.js → chunk-TM6IVXAM.js} +1 -1
  94. package/chunks/{chunk-KMJLEAS3.js → chunk-TPTV6HPU.js} +1 -1
  95. package/chunks/{chunk-DCUBMMWG.js → chunk-TQ6FKWSC.js} +1 -1
  96. package/chunks/{chunk-JK2S74SA.js → chunk-TUBHG6EI.js} +1 -1
  97. package/chunks/{chunk-FMZ5U7J5.js → chunk-UBPC3F32.js} +1 -1
  98. package/chunks/{chunk-XB7DJWOJ.js → chunk-UG5B4UOQ.js} +6 -6
  99. package/chunks/{chunk-36S57YYW.js → chunk-UGWTN5IK.js} +1 -1
  100. package/chunks/{chunk-SK2DTYBZ.js → chunk-URMRX2MG.js} +1 -1
  101. package/chunks/{chunk-VB4DB57C.js → chunk-UY6J5CHF.js} +1 -1
  102. package/chunks/{chunk-STQ3TEZW.js → chunk-VSTQT667.js} +2 -2
  103. package/chunks/{chunk-SGUUOXLH.js → chunk-WDO33SWR.js} +1 -1
  104. package/chunks/{chunk-IVXR5JO2.js → chunk-WFJHBU7B.js} +1 -1
  105. package/chunks/{chunk-BINJRUHZ.js → chunk-XSRHGC5R.js} +1 -1
  106. package/chunks/{chunk-HN7EGFIP.js → chunk-XVF3FMTM.js} +1 -1
  107. package/chunks/{chunk-C5X6K67T.js → chunk-XYRNYCRQ.js} +1 -1
  108. package/chunks/{chunk-HZOPWFFL.js → chunk-YAMLF3SM.js} +1 -1
  109. package/chunks/{chunk-CMW64XU2.js → chunk-ZEZCRRQC.js} +1 -1
  110. package/chunks/{chunk-J5W6P7QD.js → chunk-ZF56DRDP.js} +1 -1
  111. package/chunks/{chunk-LHIEE3A2.js → chunk-ZSPOFXP3.js} +1 -1
  112. package/chunks/{chunk-Q6CXEN4H.js → chunk-ZZXAOGUV.js} +1 -1
  113. package/chunks/{codex-subagent-executor-HB3MUCY4.js → codex-subagent-executor-7RAVQBYA.js} +1 -1
  114. package/chunks/{config-utils-F7OF5UR2.js → config-utils-JFD4RJK3.js} +1 -1
  115. package/chunks/{contextCommand-Y3KO2FY6.js → contextCommand-U6CD3CW7.js} +1 -1
  116. package/chunks/{core-runtime-D7DAA5NY.js → core-runtime-ORCZRJ4O.js} +1 -1
  117. package/chunks/{create-sub-session-2HTWYAP4.js → create-sub-session-57WMU2AE.js} +1 -1
  118. package/chunks/{cron-create-Y5I6E2X4.js → cron-create-V466MOUE.js} +1 -1
  119. package/chunks/{daemon-git-worktree-guard-UOBMXOUC.js → daemon-git-worktree-guard-ATD77XOF.js} +1 -1
  120. package/chunks/{daemon-status-provider-L2225KDS.js → daemon-status-provider-5FVRNMAZ.js} +1 -1
  121. package/chunks/{daemon-trust-policy-5D52N5GL.js → daemon-trust-policy-6YRQV4ZM.js} +1 -1
  122. package/chunks/{daemon-trust-policy-monitor-RUE25K7A.js → daemon-trust-policy-monitor-QRUOWZQP.js} +1 -1
  123. package/chunks/{deferred-core-runtime-6BO5DI5B.js → deferred-core-runtime-TXIXMDDH.js} +1 -1
  124. package/chunks/{edit-B6DKSK3O.js → edit-FNXBINJ3.js} +1 -1
  125. package/chunks/{enterPlanMode-WVJ3XC3P.js → enterPlanMode-YMLAOTTS.js} +1 -1
  126. package/chunks/{environment-7WMACN3E.js → environment-RFNJLRF7.js} +1 -1
  127. package/chunks/{errors-BN73QF2O.js → errors-NHGSZ2BV.js} +1 -1
  128. package/chunks/{execution-tool-IGDH3MQT.js → execution-tool-L2BF6ZKP.js} +1 -1
  129. package/chunks/{execution-worker-WWP3JZGV.js → execution-worker-F5B2BI2W.js} +1 -1
  130. package/chunks/{exitPlanMode-7WHKOTS7.js → exitPlanMode-ZZVBF5V4.js} +1 -1
  131. package/chunks/{fast-path-B37HGFQO.js → fast-path-TOJYOAD3.js} +1 -1
  132. package/chunks/{glob-ZRXU5G5X.js → glob-SYPMYU4V.js} +1 -1
  133. package/chunks/{goal-tools-DQ5IZXCM.js → goal-tools-NOXNXZFR.js} +1 -1
  134. package/chunks/{handleAutoUpdate-FD7QAG2R.js → handleAutoUpdate-RS6Y2IWS.js} +1 -1
  135. package/chunks/{i18n-TI3ZCEHR.js → i18n-WWZD25J5.js} +1 -1
  136. package/chunks/{initializer-SB7P3LRU.js → initializer-YGR4YXAM.js} +1 -1
  137. package/chunks/{installationInfo-B337C7R4.js → installationInfo-EPURVILN.js} +1 -1
  138. package/chunks/{interactive-mod-session-OWRMETPP.js → interactive-mod-session-2VSTTHPA.js} +1 -1
  139. package/chunks/{list-2QKQIEOB.js → list-6JAKVRMZ.js} +1 -1
  140. package/chunks/{llm-GQ76E4DL.js → llm-V272EOVL.js} +4 -4
  141. package/chunks/{llm-content-generator-2A23HFLD.js → llm-content-generator-EXMC3NYS.js} +1 -1
  142. package/chunks/{loadedSettingsAdapter-RGQOA5BG.js → loadedSettingsAdapter-T6W2CKFA.js} +1 -1
  143. package/chunks/{local-OEBLERSJ.js → local-NUBKA3T2.js} +1 -1
  144. package/chunks/{local-execution-environment-FT5J4SUH.js → local-execution-environment-WO62QDKJ.js} +1 -1
  145. package/chunks/{loggingContentGenerator-WC23RZYM.js → loggingContentGenerator-KHRN6S3S.js} +1 -1
  146. package/chunks/{loop-wakeup-GIIIDUNG.js → loop-wakeup-TTAZMOYH.js} +1 -1
  147. package/chunks/{manage-memory-E2OAR2RV.js → manage-memory-BKA7QM4N.js} +1 -1
  148. package/chunks/{managed-execution-engine-CYYNVVP5.js → managed-execution-engine-32BLALNC.js} +1 -1
  149. package/chunks/{managed-local-serve-TUVNNY7K.js → managed-local-serve-UTJFLZI6.js} +1 -1
  150. package/chunks/{managed-npm-update-IDRZ32UK.js → managed-npm-update-XPIRAQ47.js} +1 -1
  151. package/chunks/{managed-runtime-attestation-worker-HON7TGY2.js → managed-runtime-attestation-worker-DDU4HUGS.js} +1 -1
  152. package/chunks/{managed-runtime-bootstrap-OMLX5CTV.js → managed-runtime-bootstrap-7TTCLDQJ.js} +1 -1
  153. package/chunks/{managed-runtime-session-worker-J3P7WMDW.js → managed-runtime-session-worker-WBYLRXU3.js} +1 -1
  154. package/chunks/{managed-runtime-ssh-worker-LPFPOBTL.js → managed-runtime-ssh-worker-X2U2OK2E.js} +1 -1
  155. package/chunks/{managed-session-authority-I5OHOM7N.js → managed-session-authority-U76OGS6U.js} +1 -1
  156. package/chunks/{mcp-CGDIDRDI.js → mcp-UROGTJ3U.js} +1 -1
  157. package/chunks/{memory-VKXOH5UM.js → memory-M4OF6FV7.js} +1 -1
  158. package/chunks/{model-call-collection-ZTYFDFBB.js → model-call-collection-TW6Q7SXP.js} +1 -1
  159. package/chunks/{model-configuration-EXLM4SD3.js → model-configuration-4PJUBAYR.js} +1 -1
  160. package/chunks/{modelConfigUtils-XDMB6XPY.js → modelConfigUtils-ARMBTDAK.js} +1 -1
  161. package/chunks/{monitor-LKKCC6MQ.js → monitor-URMSEGAJ.js} +1 -1
  162. package/chunks/{nonInteractiveCli-J3Z3IZIF.js → nonInteractiveCli-YHOC5KZF.js} +1 -1
  163. package/chunks/{nonInteractiveToolExecutor-UQTMGYN2.js → nonInteractiveToolExecutor-DM5IGBP7.js} +1 -1
  164. package/chunks/{notebook-edit-JFD2KDI6.js → notebook-edit-3YSG73BK.js} +1 -1
  165. package/chunks/{omni-CI5JTMPR.js → omni-J6YYWKII.js} +1 -1
  166. package/chunks/{openaiContentGenerator-YZOV2TQX.js → openaiContentGenerator-UIFSPMTE.js} +1 -1
  167. package/chunks/{openaiResponsesContentGenerator-AHL7V6TE.js → openaiResponsesContentGenerator-U6Q536RZ.js} +1 -1
  168. package/chunks/{pidfile-ULOUTG67.js → pidfile-WCZE5ONH.js} +1 -1
  169. package/chunks/{processUtils-XX62FVFO.js → processUtils-3CDEN2GV.js} +1 -1
  170. package/chunks/{prompt-terminal-ledger-L6CWXBAW.js → prompt-terminal-ledger-VAQC6TC3.js} +1 -1
  171. package/chunks/{qwenContentGenerator-ZDXJW7EM.js → qwenContentGenerator-RWBGMON6.js} +1 -1
  172. package/chunks/{reactive-degrade-4OJ7XKSJ.js → reactive-degrade-GOTSVZKO.js} +1 -1
  173. package/chunks/{read-file-H6I32UZS.js → read-file-WNNTTHL5.js} +1 -1
  174. package/chunks/{resumeHistoryUtils-CTRMXPKQ.js → resumeHistoryUtils-UAGV4TC3.js} +1 -1
  175. package/chunks/{review-7SV2M7EL.js → review-JETUJT7N.js} +1 -1
  176. package/chunks/{ripGrep-Y2TGCQH5.js → ripGrep-OJNMOYPD.js} +1 -1
  177. package/chunks/{run-qwen-serve-6SWKYY6I.js → run-qwen-serve-BVNSBOLL.js} +1 -1
  178. package/chunks/{runtime-ITZIIC6D.js → runtime-CERVMTEG.js} +1 -1
  179. package/chunks/{sandboxConfig-FF2YF3RY.js → sandboxConfig-ZHW3GTMH.js} +1 -1
  180. package/chunks/{scheduled-tasks-WWPWNM3Y.js → scheduled-tasks-AAB5OESY.js} +1 -1
  181. package/chunks/{scheduler-ELSUH4GZ.js → scheduler-4ZZA357S.js} +1 -1
  182. package/chunks/{search-memory-465ZSHKG.js → search-memory-USJ3D7WQ.js} +1 -1
  183. package/chunks/{send-message-M5JFT3VH.js → send-message-QE2YZZ6M.js} +1 -1
  184. package/chunks/{serve-VTR7PTK2.js → serve-SX2PK3OZ.js} +1 -1
  185. package/chunks/{server-5NHPPEPR.js → server-OGTIIX65.js} +3 -3
  186. package/chunks/{session-HZLRQKEB.js → session-DXORIQDK.js} +1 -1
  187. package/chunks/{session-attachments-root-LS5Q4OT3.js → session-attachments-root-VHH2OZF6.js} +1 -1
  188. package/chunks/{session-execution-engine-selector-GS4LJPUU.js → session-execution-engine-selector-5WKZ6WXX.js} +1 -1
  189. package/chunks/{session-pr-refresh-FKYCCTWD.js → session-pr-refresh-MHXNT44I.js} +1 -1
  190. package/chunks/{sessionService-XUBKN4CM.js → sessionService-QDDGXOB7.js} +1 -1
  191. package/chunks/{settings-BFTTGWJN.js → settings-W3ALYJZM.js} +1 -1
  192. package/chunks/{shell-YEUMIQVE.js → shell-YROF2KXZ.js} +1 -1
  193. package/chunks/{skill-2MJ7S5SK.js → skill-CBEQAUIQ.js} +1 -1
  194. package/chunks/{skill-settings-DP7A2GMB.js → skill-settings-YRN4SHJO.js} +1 -1
  195. package/chunks/{spawnChannel-3IZ7S6U7.js → spawnChannel-M7Q6URLT.js} +1 -1
  196. package/chunks/{standalone-update-NAI3OI3P.js → standalone-update-WIRHMWE6.js} +1 -1
  197. package/chunks/{start-opentui-ui-D6ETKJSG.js → start-opentui-ui-OLHWNKCY.js} +1 -1
  198. package/chunks/{startInteractiveUI-FR5ZT72L.js → startInteractiveUI-KCHCIQWO.js} +1 -1
  199. package/chunks/{subscription-content-generator-JHU5YG2L.js → subscription-content-generator-YQLQKG6S.js} +1 -1
  200. package/chunks/{team-create-ZW3NXJ2M.js → team-create-I432CHIX.js} +1 -1
  201. package/chunks/{team-plan-approval-GPFOKUEV.js → team-plan-approval-APMPMLXS.js} +1 -1
  202. package/chunks/{terminal-image-renderer-WTEEKRMJ.js → terminal-image-renderer-3BNICGAX.js} +1 -1
  203. package/chunks/{theme-manager-STF74SF2.js → theme-manager-6KY7Q4ZR.js} +1 -1
  204. package/chunks/{tool-call-TVX5UHRJ.js → tool-call-QGOVXOVJ.js} +1 -1
  205. package/chunks/{tool-result-media-QALAETZ4.js → tool-result-media-LRSYJOND.js} +1 -1
  206. package/chunks/{tool-search-ZGJEYTBI.js → tool-search-HXP25AWV.js} +1 -1
  207. package/chunks/{total-session-admission-BOYLCRYA.js → total-session-admission-ISTRHUQ7.js} +1 -1
  208. package/chunks/{trustedFolders-65OZWLQO.js → trustedFolders-5BXMWMYB.js} +1 -1
  209. package/chunks/{update-relaunch-4LJ3SY6L.js → update-relaunch-NYGYYLSC.js} +1 -1
  210. package/chunks/{updateCheck-2QOAKEIH.js → updateCheck-UBLS3LUD.js} +1 -1
  211. package/chunks/{upload-config-5N7UDWC6.js → upload-config-Y372LVXX.js} +1 -1
  212. package/chunks/{useAutoAcceptIndicator-V37CGGMF.js → useAutoAcceptIndicator-RXZJRU74.js} +1 -1
  213. package/chunks/{validateNonInterActiveAuth-6ZTVWZ6W.js → validateNonInterActiveAuth-2GJ4ICJ3.js} +1 -1
  214. package/chunks/{version-EO3VIRH6.js → version-XRSNVEB2.js} +1 -1
  215. package/chunks/{web-fetch-B6LNZ2YK.js → web-fetch-B4VFVGWW.js} +1 -1
  216. package/chunks/{web-search-VIPZWUJX.js → web-search-3DSQWMAV.js} +1 -1
  217. package/chunks/{workflow-W5QEAOGN.js → workflow-RCCH5FPV.js} +1 -1
  218. package/chunks/{workflow-ancestor-trust-VE7B4RD2.js → workflow-ancestor-trust-N3QYH3OL.js} +1 -1
  219. package/chunks/{workspace-agents-D32D3K5S.js → workspace-agents-KEV4VBZD.js} +1 -1
  220. package/chunks/{workspace-providers-status-BOH7RJPV.js → workspace-providers-status-HW4VI4T7.js} +1 -1
  221. package/chunks/{workspace-recovery-worker-53GJWYJ5.js → workspace-recovery-worker-C3SSJ64A.js} +1 -1
  222. package/chunks/{workspace-registration-store-BMX2NT45.js → workspace-registration-store-K7VEBHIU.js} +1 -1
  223. package/chunks/{workspace-registry-SS2NKLEL.js → workspace-registry-C5ZPYT4P.js} +1 -1
  224. package/chunks/{workspace-runtime-coordinator-7ZKVLJDC.js → workspace-runtime-coordinator-ALWOLW3N.js} +1 -1
  225. package/chunks/{workspace-service-GIUD3D25.js → workspace-service-TNZJAC7M.js} +1 -1
  226. package/chunks/{workspace-skills-status-36A76TDX.js → workspace-skills-status-TI763F5M.js} +1 -1
  227. package/chunks/{workspace-trust-reconciler-VKKSY2AR.js → workspace-trust-reconciler-6UQ7HSUG.js} +1 -1
  228. package/chunks/{write-file-43JOGU55.js → write-file-2XXEHBZR.js} +1 -1
  229. package/chunks/{zoom-image-USUXATDM.js → zoom-image-P3E3V6PQ.js} +1 -1
  230. package/cli.js +2 -2
  231. package/execution-worker.js +1 -1
  232. package/export-transcript-document.js +1 -1
  233. package/package.json +3 -3
  234. package/web-shell/assets/{PierreFilePreview-Dx075_VT.js → PierreFilePreview-DtTOu9VE.js} +1 -1
  235. package/web-shell/assets/{SpreadsheetPreview-l2R-Y1o6.js → SpreadsheetPreview-C21imJIX.js} +1 -1
  236. package/web-shell/assets/{WorkspaceFileBrowser-CGi_eR1a.js → WorkspaceFileBrowser-DIWHfhtl.js} +1 -1
  237. package/web-shell/assets/{abnfDiagram-VCTEODGH-DZPHyWbH.js → abnfDiagram-VCTEODGH-qffA9juk.js} +1 -1
  238. package/web-shell/assets/{agents-route-Bp0Yjhm4.js → agents-route-4f6fKJaY.js} +1 -1
  239. package/web-shell/assets/{arc-BAS_Ct0z.js → arc-BOZg4dn0.js} +1 -1
  240. package/web-shell/assets/{architectureDiagram-5GKGNRK7-C5a7ooE1.js → architectureDiagram-5GKGNRK7-BOYWC6dJ.js} +1 -1
  241. package/web-shell/assets/{blockDiagram-NRAW4CY4-D-Wzzi9Z.js → blockDiagram-NRAW4CY4-CiN_IMJ7.js} +1 -1
  242. package/web-shell/assets/{c4Diagram-UCG6FXSJ-BiYnmYkI.js → c4Diagram-UCG6FXSJ-WYLA0JW0.js} +1 -1
  243. package/web-shell/assets/channel-DtcoR96T.js +1 -0
  244. package/web-shell/assets/{chunk-2Q5K7J3B-DHi3a_yf.js → chunk-2Q5K7J3B-BZUPB745.js} +1 -1
  245. package/web-shell/assets/{chunk-5VM5RSS4-DKgiHWPM.js → chunk-5VM5RSS4-BHfjsu8x.js} +1 -1
  246. package/web-shell/assets/{chunk-F27PBJKO-qvFMzdl_.js → chunk-F27PBJKO-DHtQsOyA.js} +1 -1
  247. package/web-shell/assets/{chunk-G27WJ6UU-C9Apl4Df.js → chunk-G27WJ6UU-DvEX_QHY.js} +1 -1
  248. package/web-shell/assets/{chunk-JWPE2WC7-ManrSgDL.js → chunk-JWPE2WC7-CwQJmw1a.js} +1 -1
  249. package/web-shell/assets/{chunk-LCL6LL3I-DNZqkjQu.js → chunk-LCL6LL3I-Cv7bRuRV.js} +1 -1
  250. package/web-shell/assets/{chunk-POPQ4Y6H-CxineRE8.js → chunk-POPQ4Y6H-zGw4PzDB.js} +1 -1
  251. package/web-shell/assets/{chunk-SVP7TREG-BzmCQ6Bh.js → chunk-SVP7TREG-DZMGVnJg.js} +1 -1
  252. package/web-shell/assets/{chunk-XXDRQBXY-Dm6Ascgd.js → chunk-XXDRQBXY-Dg5_qrTq.js} +1 -1
  253. package/web-shell/assets/classDiagram-DTDB5LWJ-CBq-DXYQ.js +1 -0
  254. package/web-shell/assets/classDiagram-v2-JRS7N3AN-CBq-DXYQ.js +1 -0
  255. package/web-shell/assets/{cose-bilkent-JH36ORCC-Cs-vIewG.js → cose-bilkent-JH36ORCC-D07aXZdD.js} +1 -1
  256. package/web-shell/assets/{cynefin-OW5HDTMX-CrxyzLrG.js → cynefin-OW5HDTMX-B4txjD0l.js} +1 -1
  257. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-Bf7RdtX4.js → cynefinDiagram-5FMLGOSQ-zFtLauJ6.js} +1 -1
  258. package/web-shell/assets/{dagre-3AP2YEHR-jN7qDhRR.js → dagre-3AP2YEHR-CKZj9zbB.js} +1 -1
  259. package/web-shell/assets/{diagram-S7CK7UJ4-KcNQ38Ue.js → diagram-S7CK7UJ4-DIsLTku6.js} +1 -1
  260. package/web-shell/assets/{diagram-UQ7AKVKN-9VmCS0SV.js → diagram-UQ7AKVKN-60CC00CO.js} +1 -1
  261. package/web-shell/assets/{diagram-VSXAHHWV-D-MA8NCD.js → diagram-VSXAHHWV-BCfHqY7L.js} +1 -1
  262. package/web-shell/assets/{diagram-VX7I27RA-323tLIBS.js → diagram-VX7I27RA-BbTOx9qC.js} +1 -1
  263. package/web-shell/assets/{diagram-Z3DM3KII-C547h61H.js → diagram-Z3DM3KII-DLjgnodz.js} +1 -1
  264. package/web-shell/assets/{docx-preview-DHO0seXT.js → docx-preview-CfGqg6IJ.js} +1 -1
  265. package/web-shell/assets/{ebnfDiagram-PWID7BFC-DfB8wLF5.js → ebnfDiagram-PWID7BFC-Cf1IQbGo.js} +1 -1
  266. package/web-shell/assets/{erDiagram-SSCWMZ5O-tzqYkCjp.js → erDiagram-SSCWMZ5O-BTVNpu1y.js} +1 -1
  267. package/web-shell/assets/{flowDiagram-A5DVABFB-Dsw6uHjD.js → flowDiagram-A5DVABFB-BC404IkJ.js} +1 -1
  268. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-D1SaF3O0.js → ganttDiagram-EL5Y4UJY-BHP58V1Y.js} +1 -1
  269. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-D0EzECMT.js → gitGraphDiagram-WWUBYQGX-s1PkjMd4.js} +1 -1
  270. package/web-shell/assets/{index-ob2Iut7D.js → index-DZnv4pXI.js} +6 -6
  271. package/web-shell/assets/{index-C-YHF5xI.js → index-YpdTDWts.js} +1 -1
  272. package/web-shell/assets/{infoDiagram-RXCK75RN-6NnYMmcC.js → infoDiagram-RXCK75RN-DDaQbbGu.js} +1 -1
  273. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-BnxsfuuS.js → ishikawaDiagram-5VMMS53U-FpQWCzWS.js} +1 -1
  274. package/web-shell/assets/{journeyDiagram-EYS64GPL-DduswigY.js → journeyDiagram-EYS64GPL-CC5YG1zk.js} +1 -1
  275. package/web-shell/assets/{kanban-definition-3QL26DDD-D0trNRAQ.js → kanban-definition-3QL26DDD-CsitCmSH.js} +1 -1
  276. package/web-shell/assets/{layout-nP-pCdd_.js → layout-DR8LNzXS.js} +1 -1
  277. package/web-shell/assets/{linear-DCw4lqG9.js → linear-Dt61H2xY.js} +1 -1
  278. package/web-shell/assets/{mermaid.core-DYjTp4Sk.js → mermaid.core-C3SdL30W.js} +6 -6
  279. package/web-shell/assets/{mindmap-definition-FBJOCRG2-BK9iSa2V.js → mindmap-definition-FBJOCRG2-BjxTLs9R.js} +1 -1
  280. package/web-shell/assets/{pegDiagram-XKGWAZYB-Dg0TQ1Ty.js → pegDiagram-XKGWAZYB-eBurSwq6.js} +1 -1
  281. package/web-shell/assets/{pieDiagram-E7YTZNPT-DKeqeVkg.js → pieDiagram-E7YTZNPT-BFWkbtZz.js} +1 -1
  282. package/web-shell/assets/{quadrantDiagram-AXDQQJYC-C4zBeQXd.js → quadrantDiagram-AXDQQJYC-SThzXP6T.js} +1 -1
  283. package/web-shell/assets/{railroadDiagram-O6MQD6OU-jDnAGU3z.js → railroadDiagram-O6MQD6OU-D73YId-T.js} +1 -1
  284. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-D0sIdHq4.js → requirementDiagram-EFPCY7ZU-YecInWjM.js} +1 -1
  285. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-BFz_QzXx.js → sankeyDiagram-P5KCCOFB-D4Gl35cC.js} +1 -1
  286. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-DhDmjiCT.js → sequenceDiagram-WJ2MYXX4-C1JdJSRH.js} +1 -1
  287. package/web-shell/assets/{sizeCapture-X5ZJPWSS-D8Ov3K_0.js → sizeCapture-X5ZJPWSS-D3mHX34v.js} +1 -1
  288. package/web-shell/assets/{stateDiagram-HBIQ2CUA-Bb4f1ILo.js → stateDiagram-HBIQ2CUA-BR05d7ll.js} +1 -1
  289. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-BBhqVmOU.js +1 -0
  290. package/web-shell/assets/{swimlanes-XN3QIQJK-CQyilPoS.js → swimlanes-XN3QIQJK-CENq9EQ7.js} +1 -1
  291. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-DI8ON7to.js +8 -0
  292. package/web-shell/assets/{timeline-definition-24CTP7MA-B_CntdLT.js → timeline-definition-24CTP7MA-DFhKdLgc.js} +1 -1
  293. package/web-shell/assets/{vennDiagram-4TSXK5OY-BbuHkADM.js → vennDiagram-4TSXK5OY-C-p5h-ue.js} +1 -1
  294. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-0mNKcB-T.js → wardleyDiagram-VM6X3IG4-BCWSjHZH.js} +1 -1
  295. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-BL-rMOQs.js → xychartDiagram-S5SC5T6Z-DBvE_Y0y.js} +1 -1
  296. package/web-shell/index.html +1 -1
  297. package/web-shell/sw.js +1 -1
  298. package/web-shell/assets/channel-B31dxYCL.js +0 -1
  299. package/web-shell/assets/classDiagram-DTDB5LWJ-CxU_Ty2M.js +0 -1
  300. package/web-shell/assets/classDiagram-v2-JRS7N3AN-CxU_Ty2M.js +0 -1
  301. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-xbht8Czs.js +0 -1
  302. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Dz34bASJ.js +0 -8
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{JsonOutputAdapter}from"./chunk-OD44AOSX.js";import{normalizePartList}from"./chunk-HIO3M52C.js";import{formatLoopDetectedMessage,settleChatRecording,subscribeToHeadlessChatRecordingFailures}from"./chunk-BINJRUHZ.js";import{StreamJsonOutputAdapter}from"./chunk-CMW64XU2.js";import{handleAtCommand,runAgentLoop}from"./chunk-B2YLVSQE.js";import{buildInitialSystemReminders,buildSystemMessage,computeUsageFromMetrics,createAgentToolProgressHandler,createToolProgressHandler,extractPartsFromUserMessage,handleSlashCommand,insertAfterFunctionResponses,isSlashCommand}from"./chunk-RYRMDOIX.js";import{formatDuration}from"./chunk-SKU5J7Q7.js";import{ModSession}from"./chunk-HOCNE2LO.js";import{frameModPrompt}from"./chunk-5KRYBTZV.js";import{cleanupReviewWorktreeLeases}from"./chunk-Q6CXEN4H.js";import{RunBudgetEnforcer}from"./chunk-MPDGSR2S.js";import{sanitizeTerminalText}from"./chunk-64CA3W6G.js";import{AlreadyReportedError,handleBudgetExceededError,handleCancellationError,handleError,handleMaxTurnsExceededError,handleToolError}from"./chunk-L76RFQKW.js";import{t}from"./chunk-HRRQHZQE.js";import{isInlineModelOverrideAllowed}from"./chunk-DV4KH2GE.js";import{buildGoalContinuationParts,buildSessionRecoveryPlanFromApiHistory,detectAutonomousSentinel,detectLoopSentinel}from"./chunk-HXYHIEMH.js";import{restoreWorktreeContext}from"./chunk-NGQDWVC6.js";import{executeToolCall}from"./chunk-SK2DTYBZ.js";import{GoalPersistenceUnavailableError,PLAN_MODE_ENTRY_SIBLING_SKIP_MESSAGE,createDuplicateProviderToolCallResponse,finalizeToolResponses,findPlanModeEntryBatchBoundaryIndex,findRepeatedDuplicateProviderToolCall,getCachedToolCallFingerprint,getLastApiPromptCancellation,goalToolResultProvenance,isReplayOfHandledToolCall,isToolCallConcurrencySafe,markDuplicateProviderToolCallResponseSent,partitionByConcurrencySafety,recordHandledToolCall}from"./chunk-XUB4JKSR.js";import{shellResultText}from"./chunk-T7CHK6C2.js";import{parsePositiveIntegerEnv}from"./chunk-BG67XABA.js";import{GOAL_PAUSE_REASON_HEADLESS_RUN_ENDED,GOAL_PAUSE_REASON_USER_INTERRUPT,addAgentOutputMessageAttributes,goalPauseReasonForHeadlessFailure,goalPauseReasonForRunBudget}from"./chunk-6NQMNEZN.js";import{promptIdContext}from"./chunk-MWGB5RCF.js";import{parseAndFormatApiError}from"./chunk-5AORBHSX.js";import{formatFullTurnVisionNotice,formatVisionBridgeNotice,getFullTurnVisionModelSelector,hasImageParts,runVisionBridge,shouldRunVisionBridge,splitImageParts,uiTelemetryService}from"./chunk-R5AA46IX.js";import{clampInlineMediaPart}from"./chunk-Q6UAOTP3.js";import{endInteractionSpan,getActiveInteractionSpan,isTelemetrySdkInitialized,shutdownTelemetry}from"./chunk-UFRESHR3.js";import{registerCleanup}from"./chunk-LHIEE3A2.js";import{isWrappedSystemReminderPart}from"./chunk-AAMQ5CMG.js";import{ToolNames,canonicalToolName}from"./chunk-SBZFGYYS.js";import{createDebugLogger}from"./chunk-46KPDLFH.js";import{FatalInputError,getErrorType}from"./chunk-E7MYPQGV.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();init_esbuild_shims();var debugLogger=createDebugLogger("NON_INTERACTIVE_CLI");async function waitForPendingMemoryTasks(client,signal,memoryWaitStopSignal){const promises=client.getPendingMemoryTaskPromises();if(promises.length===0)return;const pending=new Set(promises);const settled=Promise.allSettled(promises.map(promise=>promise.then(()=>{pending.delete(promise)},()=>{pending.delete(promise)})));let stopWaiting;const stopped=new Promise(resolve=>{stopWaiting=resolve});signal.addEventListener("abort",stopWaiting,{once:true});memoryWaitStopSignal?.addEventListener("abort",stopWaiting,{once:true});try{if(signal.aborted||memoryWaitStopSignal?.aborted){stopWaiting()}else{debugLogger.debug(`[runNonInteractive] Waiting for ${promises.length} tracked memory task(s)`)}await Promise.race([settled,stopped])}finally{signal.removeEventListener("abort",stopWaiting);memoryWaitStopSignal?.removeEventListener("abort",stopWaiting);client.removePendingMemoryTaskPromises(promises.filter(promise=>!pending.has(promise)))}if(signal.aborted){debugLogger.debug("[runNonInteractive] Abandoned memory wait after abort; tasks may still be running");signal.throwIfAborted()}if(pending.size>0&&memoryWaitStopSignal?.aborted){debugLogger.debug(`[runNonInteractive] Stopped waiting at the session EOF deadline; ${pending.size} tracked memory task(s) may still be running`);return}debugLogger.debug("[runNonInteractive] Tracked memory tasks settled")}__name(waitForPendingMemoryTasks,"waitForPendingMemoryTasks");var debugLogger2=createDebugLogger("NON_INTERACTIVE_CLI");var TurnInterruptedError=class extends Error{static{__name(this,"TurnInterruptedError")}constructor(){super("Operation cancelled.");this.name="TurnInterruptedError"}};var ModTurnAbortedError=class extends TurnInterruptedError{static{__name(this,"ModTurnAbortedError")}constructor(){super();this.message="A Mod ended the turn."}};var restoredBackgroundAgentSessions=new WeakMap;var STRUCTURED_SHUTDOWN_HOLDBACK_MS=500;var ONE_SHOT_MEMORY_WAIT_TIMEOUT_MS=5e3;function isHeadlessLoopSentinel(prompt){return detectLoopSentinel(prompt)!==null||detectAutonomousSentinel(prompt)!==null}__name(isHeadlessLoopSentinel,"isHeadlessLoopSentinel");var SUPPRESSED_OUTPUT_SUCCESS="Skipped: this turn's structured_output contract took precedence as the terminal output.";var SUPPRESSED_OUTPUT_RETRY=`${SUPPRESSED_OUTPUT_SUCCESS} Re-issue this call in a separate turn if needed.`;function suppressedOutputBody(structuredCaptured){return structuredCaptured?SUPPRESSED_OUTPUT_SUCCESS:SUPPRESSED_OUTPUT_RETRY}__name(suppressedOutputBody,"suppressedOutputBody");function sameGoalPermit(left,right){return left?.goalId===right.goalId&&left.revision===right.revision&&left.turnId===right.turnId}__name(sameGoalPermit,"sameGoalPermit");function formatGoalState(snapshot,operation){const goal=snapshot.goal;if(!goal){return operation==="clear"?"Goal cleared.":"No Goal is set."}const status=goal.status==="usage_limited"?"usage limited":goal.status;const summary=`Goal ${status}: ${goal.objective}`;const usage=[];if(goal.turnCount>0){const turns=goal.turnBudget??goal.turnCount;usage.push(`${goal.turnCount}${goal.turnBudget===void 0?"":` of ${goal.turnBudget}`} ${turns===1?"turn":"turns"}`)}if(goal.activeTimeMs>0&&goal.activeTimeBudgetMs!==void 0){usage.push(`${formatDuration(goal.activeTimeMs,{hideTrailingZeros:true})} of ${formatDuration(goal.activeTimeBudgetMs,{hideTrailingZeros:true})} active`)}if(goal.tokensUsed>0){const used=goal.tokensUsed.toLocaleString("en-US");usage.push(goal.tokenBudget===void 0?`${used} tokens`:`${used} of ${goal.tokenBudget.toLocaleString("en-US")} tokens`)}const lines=[summary];if(usage.length>0)lines.push(`Usage: ${usage.join(" \xB7 ")}`);if(goal.status!=="active"&&goal.lastReason){lines.push(`Reason: ${sanitizeTerminalText(goal.lastReason)}`)}return lines.join("\n")}__name(formatGoalState,"formatGoalState");async function claimUserGoalTurn(runtime,turnKey,signal){const immediate=runtime.permitForTurn(turnKey)??runtime.beginTurn(turnKey);if(immediate||runtime.getSnapshot().goal?.status!=="active"){return immediate}return new Promise((resolve,reject)=>{let settled=false;let unsubscribe=__name(()=>{},"unsubscribe");const finish=__name((permit,error)=>{if(settled)return;settled=true;unsubscribe();signal.removeEventListener("abort",onAbort);if(error!==void 0)reject(error);else resolve(permit)},"finish");const inspect=__name(()=>{try{const permit=runtime.permitForTurn(turnKey);if(permit||runtime.getSnapshot().goal?.status!=="active"){finish(permit)}}catch(error){finish(void 0,error)}},"inspect");const onAbort=__name(()=>finish(void 0),"onAbort");unsubscribe=runtime.subscribe(inspect);signal.addEventListener("abort",onAbort,{once:true});if(signal.aborted)onAbort();else inspect()})}__name(claimUserGoalTurn,"claimUserGoalTurn");function skipHeadlessLoopSentinel(scheduler,job){if(!isHeadlessLoopSentinel(job.prompt)){return false}if(job.recurring&&!job.durable){debugLogger2.debug("skipHeadlessLoopSentinel: cleaning up recurring session loop.md cron in headless mode",{jobId:job.id});void scheduler.delete(job.id).catch(()=>{})}return true}__name(skipHeadlessLoopSentinel,"skipHeadlessLoopSentinel");var PROVIDER_DUPLICATE_ID_LOOP_STOP={loopType:"global_tool_call_duplicate",loopReason:"provider_duplicate_id"};function emitLoopDetectedMessage(config,stop){const message=formatLoopDetectedMessage(stop);if(config.getOutputFormat()!=="text"){return message}process.stderr.write(`${message}
3
+ import{JsonOutputAdapter}from"./chunk-7KGCNYE4.js";import{normalizePartList}from"./chunk-HIO3M52C.js";import{formatLoopDetectedMessage,settleChatRecording,subscribeToHeadlessChatRecordingFailures}from"./chunk-XSRHGC5R.js";import{StreamJsonOutputAdapter}from"./chunk-ZEZCRRQC.js";import{handleAtCommand,runAgentLoop}from"./chunk-ERMAKXS3.js";import{buildInitialSystemReminders,buildSystemMessage,computeUsageFromMetrics,createAgentToolProgressHandler,createToolProgressHandler,extractPartsFromUserMessage,handleSlashCommand,insertAfterFunctionResponses,isSlashCommand}from"./chunk-2LDABIAY.js";import{formatDuration}from"./chunk-6O7CARPF.js";import{ModSession}from"./chunk-JTUWFGEB.js";import{frameModPrompt}from"./chunk-5KRYBTZV.js";import{cleanupReviewWorktreeLeases}from"./chunk-ZZXAOGUV.js";import{RunBudgetEnforcer}from"./chunk-N3YWQWSR.js";import{sanitizeTerminalText}from"./chunk-64CA3W6G.js";import{AlreadyReportedError,handleBudgetExceededError,handleCancellationError,handleError,handleMaxTurnsExceededError,handleToolError}from"./chunk-5MGG2BGT.js";import{t}from"./chunk-73TSS7KS.js";import{isInlineModelOverrideAllowed}from"./chunk-DV4KH2GE.js";import{buildGoalContinuationParts,buildSessionRecoveryPlanFromApiHistory,detectAutonomousSentinel,detectLoopSentinel}from"./chunk-CXPRHT3E.js";import{restoreWorktreeContext}from"./chunk-NGQDWVC6.js";import{executeToolCall}from"./chunk-URMRX2MG.js";import{GoalPersistenceUnavailableError,PLAN_MODE_ENTRY_SIBLING_SKIP_MESSAGE,createDuplicateProviderToolCallResponse,finalizeToolResponses,findPlanModeEntryBatchBoundaryIndex,findRepeatedDuplicateProviderToolCall,getCachedToolCallFingerprint,getLastApiPromptCancellation,goalToolResultProvenance,isReplayOfHandledToolCall,isToolCallConcurrencySafe,markDuplicateProviderToolCallResponseSent,partitionByConcurrencySafety,recordHandledToolCall}from"./chunk-3NR3JBMA.js";import{shellResultText}from"./chunk-T7CHK6C2.js";import{parsePositiveIntegerEnv}from"./chunk-BG67XABA.js";import{GOAL_PAUSE_REASON_HEADLESS_RUN_ENDED,GOAL_PAUSE_REASON_USER_INTERRUPT,addAgentOutputMessageAttributes,goalPauseReasonForHeadlessFailure,goalPauseReasonForRunBudget}from"./chunk-6NQMNEZN.js";import{promptIdContext}from"./chunk-MWGB5RCF.js";import{parseAndFormatApiError}from"./chunk-5AORBHSX.js";import{formatFullTurnVisionNotice,formatVisionBridgeNotice,getFullTurnVisionModelSelector,hasImageParts,runVisionBridge,shouldRunVisionBridge,splitImageParts,uiTelemetryService}from"./chunk-R5AA46IX.js";import{clampInlineMediaPart}from"./chunk-Q6UAOTP3.js";import{endInteractionSpan,getActiveInteractionSpan,isTelemetrySdkInitialized,shutdownTelemetry}from"./chunk-UFRESHR3.js";import{registerCleanup}from"./chunk-ZSPOFXP3.js";import{isWrappedSystemReminderPart}from"./chunk-AAMQ5CMG.js";import{ToolNames,canonicalToolName}from"./chunk-SBZFGYYS.js";import{createDebugLogger}from"./chunk-46KPDLFH.js";import{FatalInputError,getErrorType}from"./chunk-E7MYPQGV.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();init_esbuild_shims();var debugLogger=createDebugLogger("NON_INTERACTIVE_CLI");async function waitForPendingMemoryTasks(client,signal,memoryWaitStopSignal){const promises=client.getPendingMemoryTaskPromises();if(promises.length===0)return;const pending=new Set(promises);const settled=Promise.allSettled(promises.map(promise=>promise.then(()=>{pending.delete(promise)},()=>{pending.delete(promise)})));let stopWaiting;const stopped=new Promise(resolve=>{stopWaiting=resolve});signal.addEventListener("abort",stopWaiting,{once:true});memoryWaitStopSignal?.addEventListener("abort",stopWaiting,{once:true});try{if(signal.aborted||memoryWaitStopSignal?.aborted){stopWaiting()}else{debugLogger.debug(`[runNonInteractive] Waiting for ${promises.length} tracked memory task(s)`)}await Promise.race([settled,stopped])}finally{signal.removeEventListener("abort",stopWaiting);memoryWaitStopSignal?.removeEventListener("abort",stopWaiting);client.removePendingMemoryTaskPromises(promises.filter(promise=>!pending.has(promise)))}if(signal.aborted){debugLogger.debug("[runNonInteractive] Abandoned memory wait after abort; tasks may still be running");signal.throwIfAborted()}if(pending.size>0&&memoryWaitStopSignal?.aborted){debugLogger.debug(`[runNonInteractive] Stopped waiting at the session EOF deadline; ${pending.size} tracked memory task(s) may still be running`);return}debugLogger.debug("[runNonInteractive] Tracked memory tasks settled")}__name(waitForPendingMemoryTasks,"waitForPendingMemoryTasks");var debugLogger2=createDebugLogger("NON_INTERACTIVE_CLI");var TurnInterruptedError=class extends Error{static{__name(this,"TurnInterruptedError")}constructor(){super("Operation cancelled.");this.name="TurnInterruptedError"}};var ModTurnAbortedError=class extends TurnInterruptedError{static{__name(this,"ModTurnAbortedError")}constructor(){super();this.message="A Mod ended the turn."}};var restoredBackgroundAgentSessions=new WeakMap;var STRUCTURED_SHUTDOWN_HOLDBACK_MS=500;var ONE_SHOT_MEMORY_WAIT_TIMEOUT_MS=5e3;function isHeadlessLoopSentinel(prompt){return detectLoopSentinel(prompt)!==null||detectAutonomousSentinel(prompt)!==null}__name(isHeadlessLoopSentinel,"isHeadlessLoopSentinel");var SUPPRESSED_OUTPUT_SUCCESS="Skipped: this turn's structured_output contract took precedence as the terminal output.";var SUPPRESSED_OUTPUT_RETRY=`${SUPPRESSED_OUTPUT_SUCCESS} Re-issue this call in a separate turn if needed.`;function suppressedOutputBody(structuredCaptured){return structuredCaptured?SUPPRESSED_OUTPUT_SUCCESS:SUPPRESSED_OUTPUT_RETRY}__name(suppressedOutputBody,"suppressedOutputBody");function sameGoalPermit(left,right){return left?.goalId===right.goalId&&left.revision===right.revision&&left.turnId===right.turnId}__name(sameGoalPermit,"sameGoalPermit");function formatGoalState(snapshot,operation){const goal=snapshot.goal;if(!goal){return operation==="clear"?"Goal cleared.":"No Goal is set."}const status=goal.status==="usage_limited"?"usage limited":goal.status;const summary=`Goal ${status}: ${goal.objective}`;const usage=[];if(goal.turnCount>0){const turns=goal.turnBudget??goal.turnCount;usage.push(`${goal.turnCount}${goal.turnBudget===void 0?"":` of ${goal.turnBudget}`} ${turns===1?"turn":"turns"}`)}if(goal.activeTimeMs>0&&goal.activeTimeBudgetMs!==void 0){usage.push(`${formatDuration(goal.activeTimeMs,{hideTrailingZeros:true})} of ${formatDuration(goal.activeTimeBudgetMs,{hideTrailingZeros:true})} active`)}if(goal.tokensUsed>0){const used=goal.tokensUsed.toLocaleString("en-US");usage.push(goal.tokenBudget===void 0?`${used} tokens`:`${used} of ${goal.tokenBudget.toLocaleString("en-US")} tokens`)}const lines=[summary];if(usage.length>0)lines.push(`Usage: ${usage.join(" \xB7 ")}`);if(goal.status!=="active"&&goal.lastReason){lines.push(`Reason: ${sanitizeTerminalText(goal.lastReason)}`)}return lines.join("\n")}__name(formatGoalState,"formatGoalState");async function claimUserGoalTurn(runtime,turnKey,signal){const immediate=runtime.permitForTurn(turnKey)??runtime.beginTurn(turnKey);if(immediate||runtime.getSnapshot().goal?.status!=="active"){return immediate}return new Promise((resolve,reject)=>{let settled=false;let unsubscribe=__name(()=>{},"unsubscribe");const finish=__name((permit,error)=>{if(settled)return;settled=true;unsubscribe();signal.removeEventListener("abort",onAbort);if(error!==void 0)reject(error);else resolve(permit)},"finish");const inspect=__name(()=>{try{const permit=runtime.permitForTurn(turnKey);if(permit||runtime.getSnapshot().goal?.status!=="active"){finish(permit)}}catch(error){finish(void 0,error)}},"inspect");const onAbort=__name(()=>finish(void 0),"onAbort");unsubscribe=runtime.subscribe(inspect);signal.addEventListener("abort",onAbort,{once:true});if(signal.aborted)onAbort();else inspect()})}__name(claimUserGoalTurn,"claimUserGoalTurn");function skipHeadlessLoopSentinel(scheduler,job){if(!isHeadlessLoopSentinel(job.prompt)){return false}if(job.recurring&&!job.durable){debugLogger2.debug("skipHeadlessLoopSentinel: cleaning up recurring session loop.md cron in headless mode",{jobId:job.id});void scheduler.delete(job.id).catch(()=>{})}return true}__name(skipHeadlessLoopSentinel,"skipHeadlessLoopSentinel");var PROVIDER_DUPLICATE_ID_LOOP_STOP={loopType:"global_tool_call_duplicate",loopReason:"provider_duplicate_id"};function emitLoopDetectedMessage(config,stop){const message=formatLoopDetectedMessage(stop);if(config.getOutputFormat()!=="text"){return message}process.stderr.write(`${message}
4
4
  `);return message}__name(emitLoopDetectedMessage,"emitLoopDetectedMessage");function emitNonInteractiveAssistantText(adapter,message){adapter.startAssistantMessage();adapter.processEvent({type:"content",value:message});adapter.finalizeAssistantMessage()}__name(emitNonInteractiveAssistantText,"emitNonInteractiveAssistantText");async function emitNonInteractiveFinalMessage(params){const{message,isError,adapter,config}=params;emitNonInteractiveAssistantText(adapter,message);const metrics=uiTelemetryService.getMetrics();const usage=computeUsageFromMetrics(metrics);const outputFormat=config.getOutputFormat();const stats=outputFormat==="json"?uiTelemetryService.getMetrics():void 0;await params.beforeEmit();adapter.emitResult({isError,durationMs:Date.now()-params.startTimeMs,apiDurationMs:0,numTurns:0,errorMessage:isError?message:void 0,usage,stats,summary:message})}__name(emitNonInteractiveFinalMessage,"emitNonInteractiveFinalMessage");function partitionHeadlessToolCalls(requests,config){let skillBefore=false;return partitionByConcurrencySafety(requests,request=>{const executionRequest=getHeadlessExecutionRequest(request,config);const canonicalName=canonicalToolName(executionRequest.name);const kind=config.getToolRegistry().getTool(canonicalName)?.kind;const inputMayChange=kind==="execute"&&(skillBefore||!config.getDisableAllHooks()&&(config.hasHooksForEvent("PreToolUse")||config.hasHooksForEvent("PermissionRequest")));skillBefore||=canonicalName===ToolNames.SKILL;return!inputMayChange&&isToolCallConcurrencySafe(executionRequest.name,kind,executionRequest.args)})}__name(partitionHeadlessToolCalls,"partitionHeadlessToolCalls");function getHeadlessExecutionRequest(request,config){if(canonicalToolName(request.name)!==ToolNames.TOOL_CALL){return request}const targetName=request.args["name"];let targetArgs=request.args["arguments"];if(typeof targetArgs==="string"){try{targetArgs=JSON.parse(targetArgs)}catch{return request}}if(typeof targetName!=="string"||typeof targetArgs!=="object"||targetArgs===null||Array.isArray(targetArgs)){return request}const registry=config.getToolRegistry();const target=registry.getTool(canonicalToolName(targetName));if(!target||!registry.isDeferredAndHidden(target.name)){return request}return{...request,name:target.name,args:targetArgs}}__name(getHeadlessExecutionRequest,"getHeadlessExecutionRequest");async function runNonInteractive(config,settings,input,prompt_id,options={}){return promptIdContext.run(prompt_id,async()=>{let adapter;const outputFormat=config.getOutputFormat();if(options.adapter){adapter=options.adapter}else if(outputFormat==="stream-json"){adapter=new StreamJsonOutputAdapter(config,config.getIncludePartialMessages())}else{adapter=new JsonOutputAdapter(config)}const ownsAdapter=options.adapter===void 0;const modSession=options.modSession??ModSession.create(config,settings,adapter);const ownsModSession=options.modSession===void 0;let modTurn;const unsubscribeRecordingFailure=ownsAdapter?subscribeToHeadlessChatRecordingFailures(config,adapter):void 0;let chatRecordingSettlement;const settleBeforeTerminalOutput=__name(()=>{chatRecordingSettlement??=(async()=>{await modTurn?.complete(abortController.signal.aborted&&!budgetEnforcer.getExceeded()?"aborted":"error");if(ownsModSession)await modSession?.close();modSession?.flushLogs();await settleChatRecording(config,{finalize:ownsAdapter})})();return chatRecordingSettlement},"settleBeforeTerminalOutput");const drainPendingMemoryTasks=__name((successTerminal=false)=>{const client=config.getLlmClient();if(options.memoryWaitStopSignal){return waitForPendingMemoryTasks(client,abortController.signal,options.memoryWaitStopSignal)}if(successTerminal){return waitForPendingMemoryTasks(client,abortController.signal)}const oneShotMemoryWindow=new AbortController;const oneShotMemoryWindowTimer=setTimeout(()=>oneShotMemoryWindow.abort(),ONE_SHOT_MEMORY_WAIT_TIMEOUT_MS);return waitForPendingMemoryTasks(client,abortController.signal,oneShotMemoryWindow.signal).finally(()=>clearTimeout(oneShotMemoryWindowTimer))},"drainPendingMemoryTasks");let resultEmitted=false;const emitResult=__name(async result=>{try{await settleBeforeTerminalOutput();adapter.emitResult(result);resultEmitted=true;options.onResultEmitted?.();await modSession?.flushOutput()}finally{await drainPendingMemoryTasks(!result.isError)}},"emitResult");const sessionId=config.getSessionId();const permissionMode=config.getApprovalMode();const cleanupReviewWorktrees=__name(gitTimeout=>{if(config.getShellExecutionSandbox?.())return;cleanupReviewWorktreeLeases({sessionId,promptId:prompt_id,repositoryRoot:config.getProjectRoot(),gitTimeout})},"cleanupReviewWorktrees");const unregisterReviewWorktreeCleanup=registerCleanup(()=>cleanupReviewWorktrees(1e3));let turnCount=0;let limitedTurnCount=0;let totalApiDurationMs=0;const startTime=Date.now();let activeInteractionPromptId=prompt_id;let activeInteractionOwner;const selectActiveInteraction=__name((promptId,startsInteraction=false)=>{if(startsInteraction||activeInteractionPromptId!==promptId){activeInteractionOwner=void 0}activeInteractionPromptId=promptId},"selectActiveInteraction");const captureActiveInteractionOwner=__name(()=>{activeInteractionOwner??=getActiveInteractionSpan(activeInteractionPromptId);return activeInteractionOwner},"captureActiveInteractionOwner");const endActiveInteraction=__name((status,metadata={})=>{const owner=captureActiveInteractionOwner();if(!owner||getActiveInteractionSpan(activeInteractionPromptId)!==owner){return}endInteractionSpan(status,{promptId:activeInteractionPromptId,...metadata})},"endActiveInteraction");const llmClient=config.getLlmClient();const abortController=options.abortController??new AbortController;const queuedGoalTurns=[];let activeGoalTurn;let goalRuntimeUnsubscribe;const emitGoalSnapshot=__name(snapshot=>{adapter.processEvent({type:"goal_state",value:snapshot})},"emitGoalSnapshot");const observeGoalRuntime=__name(runtime=>{goalRuntimeUnsubscribe??=runtime.subscribe(emitGoalSnapshot)},"observeGoalRuntime");const enforceSessionTurnLimit=__name(async isRuntimeGoalTurn=>{if(isRuntimeGoalTurn)return;limitedTurnCount++;const maxSessionTurns=config.getMaxSessionTurns();if(maxSessionTurns>=0&&limitedTurnCount>maxSessionTurns){await failClosedActiveGoalTurn("Headless Goal stopped after the session turn limit");await settleBeforeTerminalOutput();await handleMaxTurnsExceededError(config)}},"enforceSessionTurnLimit");let goalHostUnbind;const goalHost={startGoalTurn:__name(async input2=>{if(queuedGoalTurns.some(({permit:permit2})=>permit2.turnId===input2.permit.turnId)){return}const{permit,...continuation}=input2;queuedGoalTurns.push({permit:{...permit},turnKey:`goal-runtime:${permit.turnId}`,controller:new AbortController,origin:"runtime",...continuation})},"startGoalTurn"),preemptGoalTurn:__name(reason=>{for(const turn of queuedGoalTurns.splice(0)){turn.controller.abort(reason)}activeGoalTurn?.controller.abort(reason)},"preemptGoalTurn")};const bindGoalHost=__name(()=>{goalHostUnbind??=config.bindGoalTurnHost(goalHost)},"bindGoalHost");const markGoalTurnDelivered=__name(turn=>{try{config.getGoalRuntime().markTurnDelivered(turn.turnKey)}catch{}},"markGoalTurnDelivered");let settlingGoalTurn;let goalTurnSettlement;const failClosedActiveGoalTurn=__name((reason,pauseReason)=>{const turn=activeGoalTurn;if(!turn)return Promise.resolve();if(settlingGoalTurn===turn&&goalTurnSettlement){return goalTurnSettlement}settlingGoalTurn=turn;goalTurnSettlement=(async()=>{if(!turn.controller.signal.aborted){turn.controller.abort(reason)}try{const runtime=await config.getGoalRuntimeReady();if(!sameGoalPermit(runtime.permitForTurn(turn.turnKey),turn.permit)){return}if(runtime.getSnapshot().goal?.status==="active"){try{await runtime.dispatch({action:"pause",expectedGoalId:turn.permit.goalId,expectedRevision:turn.permit.revision,reason:pauseReason??goalPauseReasonForHeadlessFailure(reason)})}catch(error){debugLogger2.warn("Failed to pause terminal headless Goal",error)}}try{await config.getChatRecordingService?.()?.flush()}catch(error){debugLogger2.warn("Failed to flush terminal headless Goal",error)}if(sameGoalPermit(runtime.permitForTurn(turn.turnKey),turn.permit)){await runtime.finishTurn(turn.permit)}}catch(error){debugLogger2.warn("Failed to close terminal headless Goal",error)}finally{if(activeGoalTurn===turn){activeGoalTurn=void 0}if(settlingGoalTurn===turn){settlingGoalTurn=void 0;goalTurnSettlement=void 0}}})();return goalTurnSettlement},"failClosedActiveGoalTurn");const finishGoalTurn=__name(async turn=>{const runtime=await config.getGoalRuntimeReady();if(!sameGoalPermit(runtime.permitForTurn(turn.turnKey),turn.permit)){return}let abortSettlement;const pauseOnAbort=__name(()=>{const exceeded=budgetEnforcer.getExceeded();abortSettlement??=runtime.dispatch({action:"pause",expectedGoalId:turn.permit.goalId,expectedRevision:turn.permit.revision,reason:exceeded?goalPauseReasonForRunBudget(exceeded.kind):GOAL_PAUSE_REASON_USER_INTERRUPT}).then(()=>void 0).catch(error=>{debugLogger2.warn("Failed to pause aborted headless Goal",error)})},"pauseOnAbort");abortController.signal.addEventListener("abort",pauseOnAbort,{once:true});if(abortController.signal.aborted)pauseOnAbort();try{if(!abortController.signal.aborted){await runtime.finishTurn(turn.permit)}}finally{abortController.signal.removeEventListener("abort",pauseOnAbort);await abortSettlement}},"finishGoalTurn");const budgetEnforcer=new RunBudgetEnforcer({maxWallTimeSeconds:config.getMaxWallTimeSeconds(),maxToolCalls:config.getMaxToolCalls()},abortController);const stampBudgetAbort=__name(()=>{const exceeded=budgetEnforcer.getExceeded();if(!exceeded)return;endActiveInteraction("error",{errorMessage:exceeded.message,errorType:"run_budget_exceeded"})},"stampBudgetAbort");abortController.signal.addEventListener("abort",stampBudgetAbort,{once:true});budgetEnforcer.start();let abortExitCommitted=false;const markAbortExitCommitted=__name(()=>{abortExitCommitted=true},"markAbortExitCommitted");const routeAbort=__name(async()=>{const exceeded=budgetEnforcer.getExceeded();endActiveInteraction(exceeded?"error":"cancelled",{...exceeded?{errorMessage:exceeded.message,errorType:"run_budget_exceeded"}:{}});await failClosedActiveGoalTurn(exceeded?.message??"Headless Goal execution was cancelled",exceeded?goalPauseReasonForRunBudget(exceeded.kind):GOAL_PAUSE_REASON_USER_INTERRUPT);await settleBeforeTerminalOutput();if(exceeded){await handleBudgetExceededError(config,exceeded,markAbortExitCommitted);throw new Error(exceeded.message)}const reason=abortController.signal.reason;if(reason instanceof TurnInterruptedError&&(options.recoverableCancellation===true||reason instanceof ModTurnAbortedError)){throw reason}await handleCancellationError(config,markAbortExitCommitted);throw new Error("Operation cancelled.")},"routeAbort");const localQueue=[];const pullModPrompts=__name(()=>{for(let prompt=modSession?.takeSubmittedPrompt();prompt;prompt=modSession?.takeSubmittedPrompt())localQueue.push({displayText:prompt.text,modelText:frameModPrompt(prompt),sendMessageType:"userQuery",modPrompt:prompt})},"pullModPrompts");const sdkOnlyMonitorQueue=[];const isCancelledMonitorEvent=__name(item=>Boolean(item.monitorId&&item.sdkNotification?.status==="running"&&config.getMonitorRegistry().get(item.monitorId)?.status==="cancelled"),"isCancelledMonitorEvent");const emitNotificationToSdk=__name(item=>{if(item.sendMessageType!=="notification")return;adapter.emitUserMessage([{text:item.displayText}]);if(item.sdkNotification){adapter.emitSystemMessage("task_notification",item.sdkNotification)}},"emitNotificationToSdk");const emitModPromptToSdk=__name(prompt=>{adapter.emitUserMessage([{text:prompt.text}]);adapter.emitSystemMessage("mod_prompt",{mod:prompt.plugin})},"emitModPromptToSdk");const flushQueuedNotificationsToSdk=__name(queue=>{while(queue.length>0){const item=queue.shift();if(!isCancelledMonitorEvent(item)){emitNotificationToSdk(item)}}},"flushQueuedNotificationsToSdk");let captureMonitorTurnsInLocalQueue=true;let oneShotMonitorsFinalized=false;const finalizeOneShotMonitors=__name(()=>{if(options.captureMonitorNotifications===false||oneShotMonitorsFinalized)return;oneShotMonitorsFinalized=true;captureMonitorTurnsInLocalQueue=false;config.getMonitorRegistry().abortAll();flushQueuedNotificationsToSdk(sdkOnlyMonitorQueue)},"finalizeOneShotMonitors");let pipeBroken=false;let workflowApprovalChannelRegistered=false;const stdoutErrorHandler=__name(err=>{if(err.code==="EPIPE"&&!pipeBroken){pipeBroken=true;process.stdout.destroy()}},"stdoutErrorHandler");const shutdownHandler=__name(()=>{debugLogger2.debug("[runNonInteractive] Shutdown signal received");abortController.abort()},"shutdownHandler");const pendingTeammateMessages=[];let boundManager=null;let approvalListener=null;const detachFromManager=__name(m=>{m.setLeaderMessageCallback(null);if(approvalListener){m.getEventEmitter().off("teammate_approval_request",approvalListener);approvalListener=null}},"detachFromManager");const onTeamManagerChangeHandler=__name(manager=>{if(boundManager&&boundManager!==manager){detachFromManager(boundManager)}boundManager=manager;if(manager){manager.setLeaderMessageCallback(formatted=>{pendingTeammateMessages.push(formatted)});if(options.controlService){approvalListener=__name(event=>{options.controlService.permission.handleTeammateApproval(event).catch(err=>{debugLogger2.warn("Teammate approval handling failed:",err)})},"approvalListener")}else{approvalListener=__name(event=>{const mode=config.getApprovalMode();const confirmationDetails=event.confirmationDetails;const requiresExplicitHostApproval=confirmationDetails?.type!=="plan"&&confirmationDetails!==void 0&&"hideAlwaysAllow"in confirmationDetails&&confirmationDetails.hideAlwaysAllow===true;if(mode==="yolo"&&!requiresExplicitHostApproval){event.respond("proceed_once").catch(err=>{debugLogger2.warn("Teammate approval ProceedOnce failed:",err)});return}const reason=requiresExplicitHostApproval?mode==="yolo"?`Auto-cancelling tool ${event.toolName} requested by teammate "${event.teammateName}": this request requires an explicit interactive approval surface and cannot be bypassed by YOLO mode.`:`Auto-cancelling tool ${event.toolName} requested by teammate "${event.teammateName}": this request requires an explicit interactive approval surface, which is unavailable in non-stream-json mode with the current approval mode (${mode}). Use --input-format stream-json --output-format stream-json to review it.`:`Auto-cancelling tool ${event.toolName} requested by teammate "${event.teammateName}": current approval mode (${mode}) cannot prompt in non-stream-json mode. Use --yolo or stream-json to allow teammate tool calls.`;process.stderr.write(`[team] ${reason}
5
5
  `);pendingTeammateMessages.push(`<team_notice>
6
6
  ${reason}
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{functionResponsePartsToString}from"./chunk-RYRMDOIX.js";import{observeHeadlessToolResultProjection,observeHeadlessToolResultWire}from"./chunk-XB7DJWOJ.js";import{projectJsonStringToByteBudget}from"./chunk-WQUA4G2X.js";import{createNotStartedToolErrorResponse,toolResultBoundaryArtifact}from"./chunk-XUB4JKSR.js";import{shellResultText}from"./chunk-T7CHK6C2.js";import{parseAndFormatApiError}from"./chunk-5AORBHSX.js";import{formatVisionBridgeNoticeDisplay,isVisionBridgeNoticeDisplay}from"./chunk-R5AA46IX.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{randomUUID as randomUUID2}from"node:crypto";init_esbuild_shims();import{randomUUID}from"node:crypto";init_esbuild_shims();var HEADLESS_TOOL_RESULT_TEXT_JSON_BYTE_BUDGET=65536;var HEADLESS_TOOL_RESULT_TEXT_TRUNCATION_MARKER="\n[... truncated for Headless transport ...]\n";function projectHeadlessToolResultContent(value){return projectJsonStringToByteBudget(value,HEADLESS_TOOL_RESULT_TEXT_JSON_BYTE_BUDGET,HEADLESS_TOOL_RESULT_TEXT_TRUNCATION_MARKER)}__name(projectHeadlessToolResultContent,"projectHeadlessToolResultContent");var BaseJsonOutputAdapter=class{static{__name(this,"BaseJsonOutputAdapter")}config;mainAgentMessageState;subagentMessageStates=new Map;lastAssistantMessage=null;permissionDenials=[];constructor(config){this.config=config;this.mainAgentMessageState=this.createMessageState()}createMessageState(){return{messageId:null,blocks:[],openBlocks:new Set,usage:this.createUsage(),messageStarted:false,finalized:false,currentBlockType:null}}getMessageState(parentToolUseId){if(parentToolUseId===null){return this.mainAgentMessageState}let state=this.subagentMessageStates.get(parentToolUseId);if(!state){state=this.createMessageState();this.subagentMessageStates.set(parentToolUseId,state)}return state}createUsage(metadata){const usage={input_tokens:0,output_tokens:0};if(!metadata){return usage}if(typeof metadata.promptTokenCount==="number"){usage.input_tokens=metadata.promptTokenCount}if(typeof metadata.candidatesTokenCount==="number"){usage.output_tokens=metadata.candidatesTokenCount}if(typeof metadata.cachedContentTokenCount==="number"){usage.cache_read_input_tokens=metadata.cachedContentTokenCount}if(typeof metadata.totalTokenCount==="number"){usage.total_tokens=metadata.totalTokenCount}return usage}buildMessage(parentToolUseId){const state=this.getMessageState(parentToolUseId);if(!state.messageId){throw new Error("Message not started")}if(state.blocks.length>0){const blockTypes=new Set(state.blocks.map(block=>block.type));if(blockTypes.size>1){throw new Error(`Assistant message must contain only one type of ContentBlock, found: ${Array.from(blockTypes).join(", ")}`)}}const stopReason=state.blocks.length>0&&state.blocks.every(block=>block.type==="tool_use")?"tool_use":null;return{type:"assistant",uuid:state.messageId,session_id:this.config.getSessionId(),parent_tool_use_id:parentToolUseId,message:{id:state.messageId,type:"message",role:"assistant",model:this.config.getModel(),content:state.blocks,stop_reason:stopReason,usage:state.usage}}}finalizePendingBlocks(state,parentToolUseId){const actualParentToolUseId=parentToolUseId??null;const lastBlock=state.blocks[state.blocks.length-1];if(!lastBlock){return}const index=state.blocks.length-1;if(!state.openBlocks.has(index)){return}if(lastBlock.type==="text"||lastBlock.type==="thinking"){this.onBlockClosed(state,index,actualParentToolUseId);this.closeBlock(state,index)}}openBlock(state,index,_block){state.openBlocks.add(index)}closeBlock(state,index){if(!state.openBlocks.has(index)){return}state.openBlocks.delete(index)}ensureBlockTypeConsistency(state,targetType,parentToolUseId){if(state.currentBlockType===targetType){return}if(state.currentBlockType===null){state.currentBlockType=targetType;return}this.finalizeAssistantMessageInternal(state,parentToolUseId);this.startAssistantMessageInternal(state);state.currentBlockType=targetType}startAssistantMessageInternal(state){state.messageId=randomUUID();state.blocks=[];state.openBlocks=new Set;state.usage=this.createUsage();state.messageStarted=false;state.finalized=false;state.currentBlockType=null}finalizeAssistantMessageInternal(state,parentToolUseId){if(state.finalized){return this.buildMessage(parentToolUseId)}state.finalized=true;this.finalizePendingBlocks(state,parentToolUseId);const orderedOpenBlocks=Array.from(state.openBlocks).sort((a,b)=>a-b);for(const index of orderedOpenBlocks){this.onBlockClosed(state,index,parentToolUseId);this.closeBlock(state,index)}const message=this.buildMessage(parentToolUseId);if(state.messageStarted){this.emitMessageImpl(message)}return message}emitControlMessageImpl(_message){}onTextBlockCreated(_state,_index,_block,_parentToolUseId){}onTextAppended(_state,_index,_fragment,_parentToolUseId){}onThinkingBlockCreated(_state,_index,_block,_parentToolUseId){}onThinkingAppended(_state,_index,_fragment,_parentToolUseId){}onToolUseBlockCreated(_state,_index,_block,_parentToolUseId){}onToolUseInputSet(_state,_index,_input,_parentToolUseId){}onBlockClosed(_state,_index,_parentToolUseId){}onEnsureMessageStarted(_state,_parentToolUseId){}getSessionId(){return this.config.getSessionId()}getModel(){return this.config.getModel()}startAssistantMessage(){this.startAssistantMessageInternal(this.mainAgentMessageState)}restartAttempt(preserveText,discardedToolCalls){if(preserveText){const discardedIds=new Set(discardedToolCalls.map(request=>request.callId));if(discardedIds.size>0){const state=this.mainAgentMessageState;const retainedBlocks=[];const retainedOpenBlocks=new Set;for(const[index,block]of state.blocks.entries()){if(block.type==="tool_use"&&discardedIds.has(block.id)){continue}const retainedIndex=retainedBlocks.length;retainedBlocks.push(block);if(state.openBlocks.has(index)){retainedOpenBlocks.add(retainedIndex)}}state.blocks=retainedBlocks;state.openBlocks=retainedOpenBlocks;state.currentBlockType=retainedBlocks.at(-1)?.type??null;state.messageStarted=retainedBlocks.length>0}return}this.startAssistantMessageInternal(this.mainAgentMessageState)}emitDiscardedAttemptToolResults(discardedToolCalls){const message="Skipped because the provider attempt was retried before execution.";for(const request of discardedToolCalls){this.emitToolResult(request,createNotStartedToolErrorResponse(request,message))}}processEvent(event){const state=this.mainAgentMessageState;if(state.finalized){return}switch(event.type){case"content":this.appendText(state,event.value,null);break;case"citation":if(typeof event.value==="string"){this.appendText(state,`
3
+ import{functionResponsePartsToString}from"./chunk-2LDABIAY.js";import{observeHeadlessToolResultProjection,observeHeadlessToolResultWire}from"./chunk-UG5B4UOQ.js";import{projectJsonStringToByteBudget}from"./chunk-WQUA4G2X.js";import{createNotStartedToolErrorResponse,toolResultBoundaryArtifact}from"./chunk-3NR3JBMA.js";import{shellResultText}from"./chunk-T7CHK6C2.js";import{parseAndFormatApiError}from"./chunk-5AORBHSX.js";import{formatVisionBridgeNoticeDisplay,isVisionBridgeNoticeDisplay}from"./chunk-R5AA46IX.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{randomUUID as randomUUID2}from"node:crypto";init_esbuild_shims();import{randomUUID}from"node:crypto";init_esbuild_shims();var HEADLESS_TOOL_RESULT_TEXT_JSON_BYTE_BUDGET=65536;var HEADLESS_TOOL_RESULT_TEXT_TRUNCATION_MARKER="\n[... truncated for Headless transport ...]\n";function projectHeadlessToolResultContent(value){return projectJsonStringToByteBudget(value,HEADLESS_TOOL_RESULT_TEXT_JSON_BYTE_BUDGET,HEADLESS_TOOL_RESULT_TEXT_TRUNCATION_MARKER)}__name(projectHeadlessToolResultContent,"projectHeadlessToolResultContent");var BaseJsonOutputAdapter=class{static{__name(this,"BaseJsonOutputAdapter")}config;mainAgentMessageState;subagentMessageStates=new Map;lastAssistantMessage=null;permissionDenials=[];constructor(config){this.config=config;this.mainAgentMessageState=this.createMessageState()}createMessageState(){return{messageId:null,blocks:[],openBlocks:new Set,usage:this.createUsage(),messageStarted:false,finalized:false,currentBlockType:null}}getMessageState(parentToolUseId){if(parentToolUseId===null){return this.mainAgentMessageState}let state=this.subagentMessageStates.get(parentToolUseId);if(!state){state=this.createMessageState();this.subagentMessageStates.set(parentToolUseId,state)}return state}createUsage(metadata){const usage={input_tokens:0,output_tokens:0};if(!metadata){return usage}if(typeof metadata.promptTokenCount==="number"){usage.input_tokens=metadata.promptTokenCount}if(typeof metadata.candidatesTokenCount==="number"){usage.output_tokens=metadata.candidatesTokenCount}if(typeof metadata.cachedContentTokenCount==="number"){usage.cache_read_input_tokens=metadata.cachedContentTokenCount}if(typeof metadata.totalTokenCount==="number"){usage.total_tokens=metadata.totalTokenCount}return usage}buildMessage(parentToolUseId){const state=this.getMessageState(parentToolUseId);if(!state.messageId){throw new Error("Message not started")}if(state.blocks.length>0){const blockTypes=new Set(state.blocks.map(block=>block.type));if(blockTypes.size>1){throw new Error(`Assistant message must contain only one type of ContentBlock, found: ${Array.from(blockTypes).join(", ")}`)}}const stopReason=state.blocks.length>0&&state.blocks.every(block=>block.type==="tool_use")?"tool_use":null;return{type:"assistant",uuid:state.messageId,session_id:this.config.getSessionId(),parent_tool_use_id:parentToolUseId,message:{id:state.messageId,type:"message",role:"assistant",model:this.config.getModel(),content:state.blocks,stop_reason:stopReason,usage:state.usage}}}finalizePendingBlocks(state,parentToolUseId){const actualParentToolUseId=parentToolUseId??null;const lastBlock=state.blocks[state.blocks.length-1];if(!lastBlock){return}const index=state.blocks.length-1;if(!state.openBlocks.has(index)){return}if(lastBlock.type==="text"||lastBlock.type==="thinking"){this.onBlockClosed(state,index,actualParentToolUseId);this.closeBlock(state,index)}}openBlock(state,index,_block){state.openBlocks.add(index)}closeBlock(state,index){if(!state.openBlocks.has(index)){return}state.openBlocks.delete(index)}ensureBlockTypeConsistency(state,targetType,parentToolUseId){if(state.currentBlockType===targetType){return}if(state.currentBlockType===null){state.currentBlockType=targetType;return}this.finalizeAssistantMessageInternal(state,parentToolUseId);this.startAssistantMessageInternal(state);state.currentBlockType=targetType}startAssistantMessageInternal(state){state.messageId=randomUUID();state.blocks=[];state.openBlocks=new Set;state.usage=this.createUsage();state.messageStarted=false;state.finalized=false;state.currentBlockType=null}finalizeAssistantMessageInternal(state,parentToolUseId){if(state.finalized){return this.buildMessage(parentToolUseId)}state.finalized=true;this.finalizePendingBlocks(state,parentToolUseId);const orderedOpenBlocks=Array.from(state.openBlocks).sort((a,b)=>a-b);for(const index of orderedOpenBlocks){this.onBlockClosed(state,index,parentToolUseId);this.closeBlock(state,index)}const message=this.buildMessage(parentToolUseId);if(state.messageStarted){this.emitMessageImpl(message)}return message}emitControlMessageImpl(_message){}onTextBlockCreated(_state,_index,_block,_parentToolUseId){}onTextAppended(_state,_index,_fragment,_parentToolUseId){}onThinkingBlockCreated(_state,_index,_block,_parentToolUseId){}onThinkingAppended(_state,_index,_fragment,_parentToolUseId){}onToolUseBlockCreated(_state,_index,_block,_parentToolUseId){}onToolUseInputSet(_state,_index,_input,_parentToolUseId){}onBlockClosed(_state,_index,_parentToolUseId){}onEnsureMessageStarted(_state,_parentToolUseId){}getSessionId(){return this.config.getSessionId()}getModel(){return this.config.getModel()}startAssistantMessage(){this.startAssistantMessageInternal(this.mainAgentMessageState)}restartAttempt(preserveText,discardedToolCalls){if(preserveText){const discardedIds=new Set(discardedToolCalls.map(request=>request.callId));if(discardedIds.size>0){const state=this.mainAgentMessageState;const retainedBlocks=[];const retainedOpenBlocks=new Set;for(const[index,block]of state.blocks.entries()){if(block.type==="tool_use"&&discardedIds.has(block.id)){continue}const retainedIndex=retainedBlocks.length;retainedBlocks.push(block);if(state.openBlocks.has(index)){retainedOpenBlocks.add(retainedIndex)}}state.blocks=retainedBlocks;state.openBlocks=retainedOpenBlocks;state.currentBlockType=retainedBlocks.at(-1)?.type??null;state.messageStarted=retainedBlocks.length>0}return}this.startAssistantMessageInternal(this.mainAgentMessageState)}emitDiscardedAttemptToolResults(discardedToolCalls){const message="Skipped because the provider attempt was retried before execution.";for(const request of discardedToolCalls){this.emitToolResult(request,createNotStartedToolErrorResponse(request,message))}}processEvent(event){const state=this.mainAgentMessageState;if(state.finalized){return}switch(event.type){case"content":this.appendText(state,event.value,null);break;case"citation":if(typeof event.value==="string"){this.appendText(state,`
4
4
  ${event.value}`,null)}break;case"thought":this.appendThinking(state,event.value.subject,event.value.description,null);break;case"tool_call_request":this.appendToolUse(state,event.value,null);break;case"finished":if(event.value?.usageMetadata){state.usage=this.createUsage(event.value.usageMetadata)}this.finalizePendingBlocks(state,null);break;case"error":{const errorText=parseAndFormatApiError(event.value.error,this.config.getContentGeneratorConfig()?.authType);this.appendText(state,errorText,null);break}case"model_fallback":this.emitSystemMessage("model_fallback",{fromModel:event.fromModel,toModel:event.toModel,statusCode:event.statusCode,fallbackIndex:event.fallbackIndex});break;default:break}}startSubagentAssistantMessage(parentToolUseId){const state=this.getMessageState(parentToolUseId);this.startAssistantMessageInternal(state)}finalizeSubagentAssistantMessage(parentToolUseId){const state=this.getMessageState(parentToolUseId);return this.finalizeAssistantMessageInternal(state,parentToolUseId)}emitSubagentErrorResult(errorMessage,numTurns,parentToolUseId){const state=this.getMessageState(parentToolUseId);if(state.messageStarted&&!state.finalized){this.finalizeSubagentAssistantMessage(parentToolUseId)}const errorResult=this.buildSubagentErrorResult(errorMessage,numTurns);this.emitMessageImpl(errorResult)}processSubagentToolCall(toolCall,parentToolUseId){const state=this.getMessageState(parentToolUseId);const hasText=state.blocks.some(b=>b.type==="text")||state.currentBlockType==="text"&&state.blocks.length>0;if(hasText){this.finalizeSubagentAssistantMessage(parentToolUseId);this.startSubagentAssistantMessage(parentToolUseId)}if(!state.messageId||!state.messageStarted){this.startAssistantMessageInternal(state)}this.ensureBlockTypeConsistency(state,"tool_use",parentToolUseId);this.ensureMessageStarted(state,parentToolUseId);this.finalizePendingBlocks(state,parentToolUseId);const{index}=this.createSubagentToolUseBlock(state,toolCall,parentToolUseId);this.processSubagentToolUseBlock(state,index,toolCall,parentToolUseId);this.finalizeSubagentAssistantMessage(parentToolUseId);this.startSubagentAssistantMessage(parentToolUseId)}processSubagentToolUseBlock(state,index,toolCall,parentToolUseId){const startBlock={type:"tool_use",id:toolCall.callId,name:toolCall.name,input:{}};this.onToolUseBlockCreated(state,index,startBlock,parentToolUseId);this.onToolUseInputSet(state,index,toolCall.args??{},parentToolUseId);this.onBlockClosed(state,index,parentToolUseId);this.closeBlock(state,index)}updateLastAssistantMessage(message){this.lastAssistantMessage=message}appendText(state,fragment,parentToolUseId){if(fragment.length===0){return}this.ensureBlockTypeConsistency(state,"text",parentToolUseId);this.ensureMessageStarted(state,parentToolUseId);let current=state.blocks[state.blocks.length-1];const isNewBlock=!current||current.type!=="text";if(isNewBlock){current={type:"text",text:""};const index2=state.blocks.length;state.blocks.push(current);this.openBlock(state,index2,current);this.onTextBlockCreated(state,index2,current,parentToolUseId)}current.text+=fragment;const index=state.blocks.length-1;this.onTextAppended(state,index,fragment,parentToolUseId)}appendThinking(state,subject,description,parentToolUseId){const actualParentToolUseId=parentToolUseId??null;const parts=[];if(subject&&subject.length>0){parts.push(subject)}if(description&&description.length>0){parts.push(description)}const fragment=parts.join(": ");if(!fragment){return}this.ensureBlockTypeConsistency(state,"thinking",actualParentToolUseId);this.ensureMessageStarted(state,actualParentToolUseId);let current=state.blocks[state.blocks.length-1];const isNewBlock=!current||current.type!=="thinking";if(isNewBlock){current={type:"thinking",thinking:"",signature:subject};const index2=state.blocks.length;state.blocks.push(current);this.openBlock(state,index2,current);this.onThinkingBlockCreated(state,index2,current,actualParentToolUseId)}current.thinking=`${current.thinking??""}${fragment}`;const index=state.blocks.length-1;this.onThinkingAppended(state,index,fragment,actualParentToolUseId)}appendToolUse(state,request,parentToolUseId){this.ensureBlockTypeConsistency(state,"tool_use",parentToolUseId);this.ensureMessageStarted(state,parentToolUseId);this.finalizePendingBlocks(state,parentToolUseId);const index=state.blocks.length;const block={type:"tool_use",id:request.callId,name:request.name,input:request.args};state.blocks.push(block);this.openBlock(state,index,block);const startBlock={type:"tool_use",id:request.callId,name:request.name,input:{}};this.onToolUseBlockCreated(state,index,startBlock,parentToolUseId);this.onToolUseInputSet(state,index,request.args??{},parentToolUseId);this.onBlockClosed(state,index,parentToolUseId);this.closeBlock(state,index)}ensureMessageStarted(state,parentToolUseId){if(state.messageStarted){return}state.messageStarted=true;this.onEnsureMessageStarted(state,parentToolUseId)}createSubagentToolUseBlock(state,toolCall,_parentToolUseId){const index=state.blocks.length;const block={type:"tool_use",id:toolCall.callId,name:toolCall.name,input:toolCall.args||{}};state.blocks.push(block);this.openBlock(state,index,block);return{block,index}}emitUserMessage(parts,parentToolUseId){const content=partsToContentBlock(parts);const message={type:"user",uuid:randomUUID(),session_id:this.getSessionId(),parent_tool_use_id:parentToolUseId??null,message:{role:"user",content}};this.emitMessageImpl(message)}checkResponsePartsForError(responseParts){return checkResponsePartsForError(responseParts)}emitToolResult(request,response,parentToolUseId=null){const responsePartsError=this.checkResponsePartsForError(response.responseParts);const hasError=Boolean(response.error)||Boolean(responsePartsError);if(response.error&&response.errorType==="execution_denied"){const denial={tool_name:request.name,tool_use_id:request.callId,tool_input:request.args};this.permissionDenials.push(denial)}const block={type:"tool_result",tool_use_id:request.callId,is_error:hasError};const content=toolResultContent(response);let projectedContent;if(content!==void 0){projectedContent=projectHeadlessToolResultContent(content);block.content=projectedContent}const message={type:"user",uuid:randomUUID(),session_id:this.getSessionId(),parent_tool_use_id:parentToolUseId,message:{role:"user",content:[block]}};if(content!==void 0&&projectedContent!==void 0){observeHeadlessToolResultProjection(message,content,projectedContent,request.callId,response.boundaryArtifact??toolResultBoundaryArtifact(response.persistedOutputFiles,response.artifacts))}this.emitMessageImpl(message)}emitSystemMessage(subtype,data){const systemMessage={type:"system",subtype,uuid:randomUUID(),session_id:this.getSessionId(),parent_tool_use_id:null,data};this.emitMessageImpl(systemMessage)}emitPermissionRequest(requestId,toolName,toolUseId,input,blockedPath=null,permissionSuggestions=null){const message={type:"control_request",request_id:requestId,request:{subtype:"can_use_tool",tool_name:toolName,tool_use_id:toolUseId,input,permission_suggestions:permissionSuggestions,blocked_path:blockedPath}};this.emitControlMessageImpl(message)}emitControlResponse(requestId,allowed){const message={type:"control_response",response:{subtype:"success",request_id:requestId,response:{allowed}}};this.emitControlMessageImpl(message)}emitControlError(requestId,errorMessage){const message={type:"control_response",response:{subtype:"error",request_id:requestId,error:errorMessage}};this.emitControlMessageImpl(message)}emitToolProgress(_request,_progress){}buildResultMessage(options,lastAssistantMessage){const usage=options.usage??createExtendedUsage();const resultText=options.summary??(lastAssistantMessage?extractTextFromBlocks(lastAssistantMessage.message.content):"");const baseUuid=randomUUID();const baseSessionId=this.getSessionId();if(options.isError){const errorMessage=options.errorMessage??"Unknown error";return{type:"result",subtype:options.subtype??"error_during_execution",uuid:baseUuid,session_id:baseSessionId,is_error:true,duration_ms:options.durationMs,duration_api_ms:options.apiDurationMs,num_turns:options.numTurns,usage,permission_denials:[...this.permissionDenials],error:{message:errorMessage}}}else{const hasStructured="structuredResult"in options;const normalizedStructured=hasStructured?options.structuredResult??null:void 0;const finalResult=hasStructured?JSON.stringify(normalizedStructured):resultText;const success={type:"result",subtype:options.subtype??"success",uuid:baseUuid,session_id:baseSessionId,is_error:false,duration_ms:options.durationMs,duration_api_ms:options.apiDurationMs,num_turns:options.numTurns,result:finalResult,usage,permission_denials:[...this.permissionDenials]};if(options.stats){success.stats=options.stats}if(hasStructured){success.structured_result=normalizedStructured}return success}}buildSubagentErrorResult(errorMessage,numTurns){const usage={input_tokens:0,output_tokens:0};return{type:"result",subtype:"error_during_execution",uuid:randomUUID(),session_id:this.getSessionId(),is_error:true,duration_ms:0,duration_api_ms:0,num_turns:numTurns,usage,permission_denials:[],error:{message:errorMessage}}}};function partsToContentBlock(parts){const blocks=[];let currentTextBlock=null;for(const part of parts){let textContent=null;if("text"in part&&typeof part.text==="string"){textContent=part.text}else if("functionResponse"in part&&part.functionResponse){const output=part.functionResponse.response?.["output"]??part.functionResponse.response?.["content"]??"";textContent=typeof output==="string"?output:JSON.stringify(output)}else{textContent=JSON.stringify(part)}if(textContent!==null&&textContent.length>0){if(currentTextBlock===null){currentTextBlock={type:"text",text:textContent};blocks.push(currentTextBlock)}else{currentTextBlock.text+=textContent}}}return blocks}__name(partsToContentBlock,"partsToContentBlock");function checkResponsePartsForError(responseParts){if(!responseParts||responseParts.length===0){return void 0}for(const part of responseParts){if("functionResponse"in part&&part.functionResponse?.response&&typeof part.functionResponse.response==="object"&&"error"in part.functionResponse.response&&part.functionResponse.response["error"]){const error=part.functionResponse.response["error"];return typeof error==="string"?error:String(error)}}return void 0}__name(checkResponsePartsForError,"checkResponsePartsForError");function mcpAppFallbackText(display){if(!display||typeof display!=="object"||!("type"in display)||display.type!=="mcp_app"||!("fallbackText"in display)||typeof display.fallbackText!=="string"){return void 0}const text=display.fallbackText.trim();return text.length>0?display.fallbackText:void 0}__name(mcpAppFallbackText,"mcpAppFallbackText");function toolResultContent(response){if(response.visionBridgeNotice){const content=toolResultContent({...response,visionBridgeNotice:void 0});return content?`${response.visionBridgeNotice}
5
5
  ${content}`:response.visionBridgeNotice}if(isVisionBridgeNoticeDisplay(response.resultDisplay)){const notice=formatVisionBridgeNoticeDisplay(response.resultDisplay);if(response.error){return`${notice}
6
6
  ${response.error.message}`}const responsePartsError2=checkResponsePartsForError(response.responseParts);if(responsePartsError2){return`${notice}
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{parseCallerSuppliedSessionId}from"./chunk-LGFF5PJA.js";import{isInternalWorkspaceRuntime}from"./chunk-M5KJJE2X.js";import{canonicalizeWorkspace}from"./chunk-L5UULTGF.js";import{isWithinRoot}from"./chunk-IDXJIDME.js";import{SessionService}from"./chunk-XUB4JKSR.js";import{WORKTREE_SESSION_FILE,gitEnv}from"./chunk-B4ZATWBT.js";import{Storage}from"./chunk-5VB4YX3Z.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();function runWithWorkspaceRuntimeStorage(runtime,fn){return Storage.runWithResolvedRuntimeBaseDir(runtime.sessionRuntimeBaseDir,fn)}__name(runWithWorkspaceRuntimeStorage,"runWithWorkspaceRuntimeStorage");function createWorkspaceRuntimeSessionService(runtime,options={}){return new SessionService(runtime.workspaceCwd,{...options,runtimeBaseDir:runtime.sessionRuntimeBaseDir})}__name(createWorkspaceRuntimeSessionService,"createWorkspaceRuntimeSessionService");init_esbuild_shims();import*as fs from"node:fs";import*as fsPromises from"node:fs/promises";import path from"node:path";import{execFile}from"node:child_process";import{promisify}from"node:util";var execFileAsync=promisify(execFile);function isGitProbeInfrastructureError(error){const failure=error;return failure.killed===true||typeof failure.code==="string"&&["ENOENT","EACCES","EAGAIN","ENOMEM","ETIMEDOUT"].includes(failure.code)}__name(isGitProbeInfrastructureError,"isGitProbeInfrastructureError");async function isGitInfrastructureFault(error,cwd){if(!isGitProbeInfrastructureError(error))return false;const code=error.code;if(code!=="ENOENT"&&code!=="EACCES")return true;try{await fsPromises.access(cwd,fs.constants.X_OK);return true}catch{return false}}__name(isGitInfrastructureFault,"isGitInfrastructureFault");function resolveWorkspaceEntryFromParam(registry,req,res,paramName="workspace"){const selector=req.params[paramName]??"";const entry=resolveWorkspaceEntryBySelector(registry,selector);if(entry)return entry;if(!isPortableAbsolutePath(selector)){res.status(400).json({error:`\`:${paramName}\` must decode to a workspace id or absolute path`,code:"workspace_mismatch"});return null}sendWorkspaceMismatch(res,registry);return null}__name(resolveWorkspaceEntryFromParam,"resolveWorkspaceEntryFromParam");function resolveWorkspaceEntryBySelector(registry,selector){const byId=registry.getEntryByWorkspaceId(selector);if(byId)return byId;if(!isPortableAbsolutePath(selector))return void 0;const exact=registry.getEntryByWorkspaceCwd(selector);if(exact)return exact;if(path.isAbsolute(selector)&&!isUncPath(selector)){try{const canonicalSelector=canonicalizeWorkspace(selector);const canonicalMatch=registry.getEntryByWorkspaceCwd(canonicalSelector);if(canonicalMatch)return canonicalMatch;for(const candidate of registry.listEntries()){if(canonicalizeWorkspace(candidate.workspaceCwd)===canonicalSelector){return candidate}}}catch{}}const normalizedSelector=normalizePortableAbsolutePath(selector);return registry.listEntries().find(candidate=>normalizePortableAbsolutePath(candidate.workspaceCwd)===normalizedSelector)}__name(resolveWorkspaceEntryBySelector,"resolveWorkspaceEntryBySelector");function isPortableAbsolutePath(value){return path.isAbsolute(value)||/^[A-Za-z]:[\\/]/.test(value)||/^\\\\[^\\]+\\[^\\]+/.test(value)}__name(isPortableAbsolutePath,"isPortableAbsolutePath");function isUncPath(value){return/^\\\\[^\\]+\\[^\\]+/.test(value)}__name(isUncPath,"isUncPath");function normalizePortableAbsolutePath(value){if(/^[A-Za-z]:[\\/]/.test(value)||/^\\\\[^\\]+\\[^\\]+/.test(value)){return path.win32.normalize(value).toLowerCase()}return path.resolve(value)}__name(normalizePortableAbsolutePath,"normalizePortableAbsolutePath");function resolveRegisteredWorkspaceRuntimeByPathSelector(registry,selector){const exact=registry.getByWorkspaceCwd(selector);if(exact)return exact;if(path.isAbsolute(selector)&&!isUncPath(selector)){try{const canonicalSelector=canonicalizeWorkspace(selector);const canonicalMatch=registry.getByWorkspaceCwd(canonicalSelector);if(canonicalMatch)return canonicalMatch;for(const runtime of registry.list()){if(canonicalizeWorkspace(runtime.workspaceCwd)===canonicalSelector){return runtime}}}catch{}}const normalizedSelector=normalizePortableAbsolutePath(selector);return registry.list().find(runtime=>normalizePortableAbsolutePath(runtime.workspaceCwd)===normalizedSelector)}__name(resolveRegisteredWorkspaceRuntimeByPathSelector,"resolveRegisteredWorkspaceRuntimeByPathSelector");function resolveManagedWorkspaceRuntimeByPathSelector(registry,selector){const exact=registry.getManagedByWorkspaceCwd(selector);if(exact&&!isInternalWorkspaceRuntime(exact))return exact;if(path.isAbsolute(selector)&&!isUncPath(selector)){try{const canonicalSelector=canonicalizeWorkspace(selector);const canonicalMatch=registry.getManagedByWorkspaceCwd(canonicalSelector);if(canonicalMatch&&!isInternalWorkspaceRuntime(canonicalMatch)){return canonicalMatch}for(const runtime of registry.listManaged()){if(isInternalWorkspaceRuntime(runtime))continue;if(canonicalizeWorkspace(runtime.workspaceCwd)===canonicalSelector){return runtime}}}catch{}}const normalizedSelector=normalizePortableAbsolutePath(selector);return registry.listManaged().find(runtime=>!isInternalWorkspaceRuntime(runtime)&&normalizePortableAbsolutePath(runtime.workspaceCwd)===normalizedSelector)}__name(resolveManagedWorkspaceRuntimeByPathSelector,"resolveManagedWorkspaceRuntimeByPathSelector");function resolveWorkspaceRuntimeFromParam(registry,req,res,paramName="workspace"){const entry=resolveWorkspaceEntryFromParam(registry,req,res,paramName);if(!entry)return null;const runtime=entry.state==="active"?entry.current?.runtime:void 0;if(!runtime){sendWorkspaceRuntimeUnavailable(res,entry);return null}return runtime}__name(resolveWorkspaceRuntimeFromParam,"resolveWorkspaceRuntimeFromParam");function resolveTrustedRuntime(registry,req,res,paramName="workspace"){const runtime=resolveWorkspaceRuntimeFromParam(registry,req,res,paramName);if(!runtime)return null;return requireTrustedWorkspaceRuntime(runtime,res)?runtime:null}__name(resolveTrustedRuntime,"resolveTrustedRuntime");function resolveWorkspaceRuntimeWithLiveCompatibilityFromParam(registry,req,res,paramName="workspace"){if(typeof registry.getManagedEntryByWorkspaceId!=="function"||typeof registry.getManagedEntryByWorkspaceCwd!=="function"){return resolveWorkspaceRuntimeFromParam(registry,req,res,paramName)}const selector=req.params[paramName]??"";let entry=registry.getManagedEntryByWorkspaceId(selector);if(!entry&&isPortableAbsolutePath(selector)){entry=registry.getManagedEntryByWorkspaceCwd(selector)}if(!entry?.internal){return resolveWorkspaceRuntimeFromParam(registry,req,res,paramName)}const runtime=entry.state==="active"?entry.current?.runtime:void 0;if(!runtime){sendConversationRuntimeUnavailable(res);return null}return runtime}__name(resolveWorkspaceRuntimeWithLiveCompatibilityFromParam,"resolveWorkspaceRuntimeWithLiveCompatibilityFromParam");function sendConversationRuntimeUnavailable(res){res.set("Retry-After","1");res.status(503).json({error:"The Conversations runtime is temporarily unavailable.",code:"conversation_runtime_unavailable",retryable:true})}__name(sendConversationRuntimeUnavailable,"sendConversationRuntimeUnavailable");function sendWorkspaceRuntimeUnavailable(res,entry){res.set("Retry-After","1");res.status(503).json({error:"Workspace runtime is not active.",code:"workspace_runtime_unavailable",...entry?{workspaceCwd:entry.workspaceCwd,workspaceId:entry.workspaceId}:{}})}__name(sendWorkspaceRuntimeUnavailable,"sendWorkspaceRuntimeUnavailable");var MAX_BATCH_WORKSPACES=20;var MAX_SELECTOR_CHARS=4096;var MAX_MEMBER_BYTES=512*1024;function failedBatchMember(workspace,entry,status,code,message){return{workspace,...entry?{workspaceId:entry.workspaceId,cwd:entry.workspaceCwd}:{},error:{code,message,status}}}__name(failedBatchMember,"failedBatchMember");function captureWorkspaceEntryCurrency(registry,entry){const generation=entry.current;return{generation,isCurrent:__name(()=>registry.getEntryByWorkspaceId(entry.workspaceId)===entry&&entry.state==="active"&&entry.current?.generationId===generation?.generationId&&generation!==void 0&&!generation.guard.closed,"isCurrent")}}__name(captureWorkspaceEntryCurrency,"captureWorkspaceEntryCurrency");function isGenerationClosedError(error){return Boolean(error&&typeof error==="object"&&"code"in error&&error.code==="workspace_generation_closed")}__name(isGenerationClosedError,"isGenerationClosedError");function sendGenerationClosedError(res,error){if(!isGenerationClosedError(error))return false;sendWorkspaceRuntimeUnavailable(res);return true}__name(sendGenerationClosedError,"sendGenerationClosedError");function resolveManagedWorkspaceRuntimeFromParam(registry,req,res,paramName="workspace"){const selector=req.params[paramName]??"";const byId=registry.getManagedByWorkspaceId(selector);if(byId&&!isInternalWorkspaceRuntime(byId))return byId;if(!isPortableAbsolutePath(selector)){res.status(400).json({error:`\`:${paramName}\` must decode to a workspace id or absolute path`,code:"workspace_mismatch"});return null}const runtime=resolveManagedWorkspaceRuntimeByPathSelector(registry,selector);if(!runtime){res.status(400).json({error:"Workspace mismatch: the requested workspace is not registered with this daemon.",code:"workspace_mismatch"});return null}return runtime}__name(resolveManagedWorkspaceRuntimeFromParam,"resolveManagedWorkspaceRuntimeFromParam");function requireTrustedWorkspaceRuntime(runtime,res){if(runtime.trusted)return true;sendUntrustedWorkspaceResponse(res);return false}__name(requireTrustedWorkspaceRuntime,"requireTrustedWorkspaceRuntime");function sendUntrustedWorkspaceResponse(res,extra){res.status(403).json({error:"Workspace is not trusted.",code:"untrusted_workspace",...extra})}__name(sendUntrustedWorkspaceResponse,"sendUntrustedWorkspaceResponse");function getWorkspaceRouteContext(req){return req.workspaceRouteContext}__name(getWorkspaceRouteContext,"getWorkspaceRouteContext");function setWorkspaceRouteContext(req,context){req.workspaceRouteContext=context}__name(setWorkspaceRouteContext,"setWorkspaceRouteContext");function sendWorkspaceMismatch(res,registry){res.status(400).json({error:"Workspace mismatch: the requested workspace is not registered with this daemon.",code:"workspace_mismatch",workspaceCount:registry.listEntries().length})}__name(sendWorkspaceMismatch,"sendWorkspaceMismatch");function resolveContainedCwd(req,workspaceCwd){const rawCwd=req.query["cwd"];if(typeof rawCwd!=="string"||rawCwd.length===0){return workspaceCwd}try{const resolved=fs.realpathSync(path.resolve(rawCwd));const root=fs.realpathSync(workspaceCwd);if(isWithinRoot(resolved,root)){return resolved}}catch{}return workspaceCwd}__name(resolveContainedCwd,"resolveContainedCwd");function resolveContainedCwdOrFail(req,workspaceCwd){const rawCwd=req.query["cwd"];if(rawCwd===void 0){return workspaceCwd}if(typeof rawCwd!=="string"||rawCwd.length===0){return null}try{const resolved=fs.realpathSync(path.resolve(rawCwd));const root=fs.realpathSync(workspaceCwd);if(isWithinRoot(resolved,root)){return resolved}}catch{}return null}__name(resolveContainedCwdOrFail,"resolveContainedCwdOrFail");async function resolveGitCommonDir(cwd){let stdout;try{({stdout}=await execFileAsync("git",["rev-parse","--git-common-dir"],{cwd,encoding:"utf8",timeout:3e4,env:gitEnv()}))}catch(error){if(await isGitInfrastructureFault(error,cwd))throw error;return null}return fsPromises.realpath(path.resolve(cwd,stdout.trim())).catch(()=>null)}__name(resolveGitCommonDir,"resolveGitCommonDir");async function resolveAbsoluteGitDir(cwd){let stdout;try{({stdout}=await execFileAsync("git",["rev-parse","--absolute-git-dir"],{cwd,encoding:"utf8",timeout:3e4,env:gitEnv()}))}catch(error){if(await isGitInfrastructureFault(error,cwd))throw error;return null}return fsPromises.realpath(stdout.trim()).catch(()=>null)}__name(resolveAbsoluteGitDir,"resolveAbsoluteGitDir");async function readBoundedRegularFile(filePath,maxBytes,options){const pathStat=await fsPromises.lstat(filePath);if(!pathStat.isFile()||!options?.allowHardLinks&&pathStat.nlink!==1||pathStat.size>maxBytes){return null}const handle=await fsPromises.open(filePath,fs.constants.O_RDONLY|(fs.constants.O_NOFOLLOW??0));try{const openedStat=await handle.stat();if(!openedStat.isFile()||!options?.allowHardLinks&&openedStat.nlink!==1||openedStat.dev!==pathStat.dev||openedStat.ino!==pathStat.ino||openedStat.size>maxBytes){return null}const buffer=Buffer.alloc(maxBytes+1);let bytesRead=0;while(bytesRead<buffer.length){const chunk=await handle.read(buffer,bytesRead,buffer.length-bytesRead,bytesRead);if(chunk.bytesRead===0)break;bytesRead+=chunk.bytesRead}if(bytesRead>maxBytes)return null;const finalStat=await fsPromises.lstat(filePath);if(!finalStat.isFile()||!options?.allowHardLinks&&finalStat.nlink!==1||finalStat.dev!==openedStat.dev||finalStat.ino!==openedStat.ino){return null}return buffer.subarray(0,bytesRead).toString("utf8")}finally{await handle.close()}}__name(readBoundedRegularFile,"readBoundedRegularFile");async function markerIsOwnedBy(markerPath,sessionId){try{return(await readBoundedRegularFile(markerPath,256))?.trim()===sessionId}catch{return false}}__name(markerIsOwnedBy,"markerIsOwnedBy");async function isLinkedWorktreeOrUnknown(cwd){let stdout;try{({stdout}=await execFileAsync("git",["rev-parse","--git-common-dir","--absolute-git-dir"],{cwd,encoding:"utf8",timeout:3e4,env:gitEnv()}))}catch(error){if(await isGitInfrastructureFault(error,cwd))throw error;const stderr=error.stderr;return!(typeof stderr==="string"&&/not a git repository/i.test(stderr))}const[common,absolute]=stdout.trim().split("\n");if(!common||!absolute)return true;try{const[commonDir,gitDir]=await Promise.all([fsPromises.realpath(path.resolve(cwd,common)),fsPromises.realpath(absolute)]);return commonDir!==gitDir}catch{return true}}__name(isLinkedWorktreeOrUnknown,"isLinkedWorktreeOrUnknown");async function resolveSessionManagedGitCwd(req,runtime){const rawCwd=req.query["cwd"];if(rawCwd===void 0)return runtime.workspaceCwd;if(typeof rawCwd!=="string"||rawCwd.length===0)return null;let requested;let workspace;try{requested=await fsPromises.realpath(path.resolve(rawCwd));workspace=await fsPromises.realpath(runtime.workspaceCwd)}catch{return null}let stdout;try{({stdout}=await execFileAsync("git",["rev-parse","--show-toplevel"],{cwd:workspace,encoding:"utf8",timeout:3e4,env:gitEnv()}))}catch(error){if(isGitProbeInfrastructureError(error))throw error;const stderr=error.stderr;if(typeof stderr==="string"&&/not a git repository/i.test(stderr)&&isWithinRoot(requested,workspace)&&!await isLinkedWorktreeOrUnknown(requested)){return requested}return null}const repoTop=await fsPromises.realpath(stdout.trim()).catch(()=>null);if(repoTop===null)return null;if(requested===workspace)return requested;const managedRoot=path.join(repoTop,".qwen","worktrees");if(isWithinRoot(requested,workspace)&&!isWithinRoot(requested,managedRoot)){if(!await isLinkedWorktreeOrUnknown(requested)){return requested}const[workspaceGitDir,requestedGitDir]=await Promise.all([resolveAbsoluteGitDir(workspace),resolveAbsoluteGitDir(requested)]);if(workspaceGitDir!==null&&requestedGitDir===workspaceGitDir){return requested}}if(!isWithinRoot(requested,managedRoot))return null;const[workspaceCommonDir,requestedCommonDir]=await Promise.all([resolveGitCommonDir(workspace),resolveGitCommonDir(requested)]);if(workspaceCommonDir===null||requestedCommonDir===null||requestedCommonDir!==workspaceCommonDir){return null}try{let rawSessionId=req.query["sessionId"];if(rawSessionId===void 0){const[slug]=path.relative(managedRoot,requested).split(path.sep);if(!slug)return null;rawSessionId=(await readBoundedRegularFile(path.join(managedRoot,slug,WORKTREE_SESSION_FILE),256))?.trim()}const parsedSessionId=parseCallerSuppliedSessionId(rawSessionId);if(parsedSessionId.kind!=="valid")return null;const sessionId=parsedSessionId.sessionId;let snapshot;try{snapshot=runtime.bridge.getSessionExecutionSnapshot(sessionId)}catch{return null}if(await fsPromises.realpath(snapshot.workspaceCwd)!==workspace||!snapshot.worktree){return null}const worktreeRoot=await fsPromises.realpath(snapshot.worktree.path);if(path.dirname(worktreeRoot)!==managedRoot||!isWithinRoot(requested,worktreeRoot)){return null}const sidecarPath=createWorkspaceRuntimeSessionService(runtime).getWorktreeSessionPath(sessionId);const sidecarRaw=await readBoundedRegularFile(sidecarPath,64*1024,{allowHardLinks:true});if(sidecarRaw===null)return null;let sidecar;try{sidecar=JSON.parse(sidecarRaw)}catch{return null}if(!sidecar||typeof sidecar!=="object"||Array.isArray(sidecar)||typeof sidecar["worktreePath"]!=="string"||await fsPromises.realpath(sidecar.worktreePath)!==worktreeRoot){return null}const markerPath=path.join(worktreeRoot,WORKTREE_SESSION_FILE);if(!await markerIsOwnedBy(markerPath,sessionId)){return null}const requestedGitDir=await resolveAbsoluteGitDir(requested);if(requestedGitDir===null)return null;const metadataRoot=await fsPromises.realpath(path.join(workspaceCommonDir,"worktrees"));if(path.dirname(requestedGitDir)!==metadataRoot)return null;const backpointer=await readBoundedRegularFile(path.join(requestedGitDir,"gitdir"),4096);if(backpointer===null)return null;const actualGitFile=await fsPromises.realpath(path.resolve(requestedGitDir,backpointer.trim()));const expectedGitFile=await fsPromises.realpath(path.join(worktreeRoot,".git"));if(actualGitFile!==expectedGitFile)return null;return requested}catch(error){const code=error.code;if(code==="ENOENT"||code==="EACCES"||code==="EPERM"||code==="ELOOP"||code==="ENOTDIR"){return null}throw error}}__name(resolveSessionManagedGitCwd,"resolveSessionManagedGitCwd");async function resolveSessionManagedGitCwdForRoute(req,res,runtime,route,sendBridgeError){let cwd;try{cwd=await resolveSessionManagedGitCwd(req,runtime);runtime.generationGuard?.assertOpen()}catch(error){sendBridgeError(res,error,{route});return void 0}if(cwd===null){res.status(400).json({error:"invalid_cwd",message:"The supplied cwd is invalid or outside the workspace"});return void 0}return cwd}__name(resolveSessionManagedGitCwdForRoute,"resolveSessionManagedGitCwdForRoute");export{runWithWorkspaceRuntimeStorage,createWorkspaceRuntimeSessionService,resolveWorkspaceEntryFromParam,resolveWorkspaceEntryBySelector,isPortableAbsolutePath,resolveRegisteredWorkspaceRuntimeByPathSelector,resolveManagedWorkspaceRuntimeByPathSelector,resolveWorkspaceRuntimeFromParam,resolveTrustedRuntime,resolveWorkspaceRuntimeWithLiveCompatibilityFromParam,sendConversationRuntimeUnavailable,sendWorkspaceRuntimeUnavailable,MAX_BATCH_WORKSPACES,MAX_SELECTOR_CHARS,MAX_MEMBER_BYTES,failedBatchMember,captureWorkspaceEntryCurrency,isGenerationClosedError,sendGenerationClosedError,resolveManagedWorkspaceRuntimeFromParam,requireTrustedWorkspaceRuntime,sendUntrustedWorkspaceResponse,getWorkspaceRouteContext,setWorkspaceRouteContext,resolveContainedCwd,resolveContainedCwdOrFail,resolveSessionManagedGitCwdForRoute};
3
+ import{parseCallerSuppliedSessionId}from"./chunk-LGFF5PJA.js";import{isInternalWorkspaceRuntime}from"./chunk-M5KJJE2X.js";import{canonicalizeWorkspace}from"./chunk-L5UULTGF.js";import{isWithinRoot}from"./chunk-IDXJIDME.js";import{SessionService}from"./chunk-3NR3JBMA.js";import{WORKTREE_SESSION_FILE,gitEnv}from"./chunk-B4ZATWBT.js";import{Storage}from"./chunk-5VB4YX3Z.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();function runWithWorkspaceRuntimeStorage(runtime,fn){return Storage.runWithResolvedRuntimeBaseDir(runtime.sessionRuntimeBaseDir,fn)}__name(runWithWorkspaceRuntimeStorage,"runWithWorkspaceRuntimeStorage");function createWorkspaceRuntimeSessionService(runtime,options={}){return new SessionService(runtime.workspaceCwd,{...options,runtimeBaseDir:runtime.sessionRuntimeBaseDir})}__name(createWorkspaceRuntimeSessionService,"createWorkspaceRuntimeSessionService");init_esbuild_shims();import*as fs from"node:fs";import*as fsPromises from"node:fs/promises";import path from"node:path";import{execFile}from"node:child_process";import{promisify}from"node:util";var execFileAsync=promisify(execFile);function isGitProbeInfrastructureError(error){const failure=error;return failure.killed===true||typeof failure.code==="string"&&["ENOENT","EACCES","EAGAIN","ENOMEM","ETIMEDOUT"].includes(failure.code)}__name(isGitProbeInfrastructureError,"isGitProbeInfrastructureError");async function isGitInfrastructureFault(error,cwd){if(!isGitProbeInfrastructureError(error))return false;const code=error.code;if(code!=="ENOENT"&&code!=="EACCES")return true;try{await fsPromises.access(cwd,fs.constants.X_OK);return true}catch{return false}}__name(isGitInfrastructureFault,"isGitInfrastructureFault");function resolveWorkspaceEntryFromParam(registry,req,res,paramName="workspace"){const selector=req.params[paramName]??"";const entry=resolveWorkspaceEntryBySelector(registry,selector);if(entry)return entry;if(!isPortableAbsolutePath(selector)){res.status(400).json({error:`\`:${paramName}\` must decode to a workspace id or absolute path`,code:"workspace_mismatch"});return null}sendWorkspaceMismatch(res,registry);return null}__name(resolveWorkspaceEntryFromParam,"resolveWorkspaceEntryFromParam");function resolveWorkspaceEntryBySelector(registry,selector){const byId=registry.getEntryByWorkspaceId(selector);if(byId)return byId;if(!isPortableAbsolutePath(selector))return void 0;const exact=registry.getEntryByWorkspaceCwd(selector);if(exact)return exact;if(path.isAbsolute(selector)&&!isUncPath(selector)){try{const canonicalSelector=canonicalizeWorkspace(selector);const canonicalMatch=registry.getEntryByWorkspaceCwd(canonicalSelector);if(canonicalMatch)return canonicalMatch;for(const candidate of registry.listEntries()){if(canonicalizeWorkspace(candidate.workspaceCwd)===canonicalSelector){return candidate}}}catch{}}const normalizedSelector=normalizePortableAbsolutePath(selector);return registry.listEntries().find(candidate=>normalizePortableAbsolutePath(candidate.workspaceCwd)===normalizedSelector)}__name(resolveWorkspaceEntryBySelector,"resolveWorkspaceEntryBySelector");function isPortableAbsolutePath(value){return path.isAbsolute(value)||/^[A-Za-z]:[\\/]/.test(value)||/^\\\\[^\\]+\\[^\\]+/.test(value)}__name(isPortableAbsolutePath,"isPortableAbsolutePath");function isUncPath(value){return/^\\\\[^\\]+\\[^\\]+/.test(value)}__name(isUncPath,"isUncPath");function normalizePortableAbsolutePath(value){if(/^[A-Za-z]:[\\/]/.test(value)||/^\\\\[^\\]+\\[^\\]+/.test(value)){return path.win32.normalize(value).toLowerCase()}return path.resolve(value)}__name(normalizePortableAbsolutePath,"normalizePortableAbsolutePath");function resolveRegisteredWorkspaceRuntimeByPathSelector(registry,selector){const exact=registry.getByWorkspaceCwd(selector);if(exact)return exact;if(path.isAbsolute(selector)&&!isUncPath(selector)){try{const canonicalSelector=canonicalizeWorkspace(selector);const canonicalMatch=registry.getByWorkspaceCwd(canonicalSelector);if(canonicalMatch)return canonicalMatch;for(const runtime of registry.list()){if(canonicalizeWorkspace(runtime.workspaceCwd)===canonicalSelector){return runtime}}}catch{}}const normalizedSelector=normalizePortableAbsolutePath(selector);return registry.list().find(runtime=>normalizePortableAbsolutePath(runtime.workspaceCwd)===normalizedSelector)}__name(resolveRegisteredWorkspaceRuntimeByPathSelector,"resolveRegisteredWorkspaceRuntimeByPathSelector");function resolveManagedWorkspaceRuntimeByPathSelector(registry,selector){const exact=registry.getManagedByWorkspaceCwd(selector);if(exact&&!isInternalWorkspaceRuntime(exact))return exact;if(path.isAbsolute(selector)&&!isUncPath(selector)){try{const canonicalSelector=canonicalizeWorkspace(selector);const canonicalMatch=registry.getManagedByWorkspaceCwd(canonicalSelector);if(canonicalMatch&&!isInternalWorkspaceRuntime(canonicalMatch)){return canonicalMatch}for(const runtime of registry.listManaged()){if(isInternalWorkspaceRuntime(runtime))continue;if(canonicalizeWorkspace(runtime.workspaceCwd)===canonicalSelector){return runtime}}}catch{}}const normalizedSelector=normalizePortableAbsolutePath(selector);return registry.listManaged().find(runtime=>!isInternalWorkspaceRuntime(runtime)&&normalizePortableAbsolutePath(runtime.workspaceCwd)===normalizedSelector)}__name(resolveManagedWorkspaceRuntimeByPathSelector,"resolveManagedWorkspaceRuntimeByPathSelector");function resolveWorkspaceRuntimeFromParam(registry,req,res,paramName="workspace"){const entry=resolveWorkspaceEntryFromParam(registry,req,res,paramName);if(!entry)return null;const runtime=entry.state==="active"?entry.current?.runtime:void 0;if(!runtime){sendWorkspaceRuntimeUnavailable(res,entry);return null}return runtime}__name(resolveWorkspaceRuntimeFromParam,"resolveWorkspaceRuntimeFromParam");function resolveTrustedRuntime(registry,req,res,paramName="workspace"){const runtime=resolveWorkspaceRuntimeFromParam(registry,req,res,paramName);if(!runtime)return null;return requireTrustedWorkspaceRuntime(runtime,res)?runtime:null}__name(resolveTrustedRuntime,"resolveTrustedRuntime");function resolveWorkspaceRuntimeWithLiveCompatibilityFromParam(registry,req,res,paramName="workspace"){if(typeof registry.getManagedEntryByWorkspaceId!=="function"||typeof registry.getManagedEntryByWorkspaceCwd!=="function"){return resolveWorkspaceRuntimeFromParam(registry,req,res,paramName)}const selector=req.params[paramName]??"";let entry=registry.getManagedEntryByWorkspaceId(selector);if(!entry&&isPortableAbsolutePath(selector)){entry=registry.getManagedEntryByWorkspaceCwd(selector)}if(!entry?.internal){return resolveWorkspaceRuntimeFromParam(registry,req,res,paramName)}const runtime=entry.state==="active"?entry.current?.runtime:void 0;if(!runtime){sendConversationRuntimeUnavailable(res);return null}return runtime}__name(resolveWorkspaceRuntimeWithLiveCompatibilityFromParam,"resolveWorkspaceRuntimeWithLiveCompatibilityFromParam");function sendConversationRuntimeUnavailable(res){res.set("Retry-After","1");res.status(503).json({error:"The Conversations runtime is temporarily unavailable.",code:"conversation_runtime_unavailable",retryable:true})}__name(sendConversationRuntimeUnavailable,"sendConversationRuntimeUnavailable");function sendWorkspaceRuntimeUnavailable(res,entry){res.set("Retry-After","1");res.status(503).json({error:"Workspace runtime is not active.",code:"workspace_runtime_unavailable",...entry?{workspaceCwd:entry.workspaceCwd,workspaceId:entry.workspaceId}:{}})}__name(sendWorkspaceRuntimeUnavailable,"sendWorkspaceRuntimeUnavailable");var MAX_BATCH_WORKSPACES=20;var MAX_SELECTOR_CHARS=4096;var MAX_MEMBER_BYTES=512*1024;function failedBatchMember(workspace,entry,status,code,message){return{workspace,...entry?{workspaceId:entry.workspaceId,cwd:entry.workspaceCwd}:{},error:{code,message,status}}}__name(failedBatchMember,"failedBatchMember");function captureWorkspaceEntryCurrency(registry,entry){const generation=entry.current;return{generation,isCurrent:__name(()=>registry.getEntryByWorkspaceId(entry.workspaceId)===entry&&entry.state==="active"&&entry.current?.generationId===generation?.generationId&&generation!==void 0&&!generation.guard.closed,"isCurrent")}}__name(captureWorkspaceEntryCurrency,"captureWorkspaceEntryCurrency");function isGenerationClosedError(error){return Boolean(error&&typeof error==="object"&&"code"in error&&error.code==="workspace_generation_closed")}__name(isGenerationClosedError,"isGenerationClosedError");function sendGenerationClosedError(res,error){if(!isGenerationClosedError(error))return false;sendWorkspaceRuntimeUnavailable(res);return true}__name(sendGenerationClosedError,"sendGenerationClosedError");function resolveManagedWorkspaceRuntimeFromParam(registry,req,res,paramName="workspace"){const selector=req.params[paramName]??"";const byId=registry.getManagedByWorkspaceId(selector);if(byId&&!isInternalWorkspaceRuntime(byId))return byId;if(!isPortableAbsolutePath(selector)){res.status(400).json({error:`\`:${paramName}\` must decode to a workspace id or absolute path`,code:"workspace_mismatch"});return null}const runtime=resolveManagedWorkspaceRuntimeByPathSelector(registry,selector);if(!runtime){res.status(400).json({error:"Workspace mismatch: the requested workspace is not registered with this daemon.",code:"workspace_mismatch"});return null}return runtime}__name(resolveManagedWorkspaceRuntimeFromParam,"resolveManagedWorkspaceRuntimeFromParam");function requireTrustedWorkspaceRuntime(runtime,res){if(runtime.trusted)return true;sendUntrustedWorkspaceResponse(res);return false}__name(requireTrustedWorkspaceRuntime,"requireTrustedWorkspaceRuntime");function sendUntrustedWorkspaceResponse(res,extra){res.status(403).json({error:"Workspace is not trusted.",code:"untrusted_workspace",...extra})}__name(sendUntrustedWorkspaceResponse,"sendUntrustedWorkspaceResponse");function getWorkspaceRouteContext(req){return req.workspaceRouteContext}__name(getWorkspaceRouteContext,"getWorkspaceRouteContext");function setWorkspaceRouteContext(req,context){req.workspaceRouteContext=context}__name(setWorkspaceRouteContext,"setWorkspaceRouteContext");function sendWorkspaceMismatch(res,registry){res.status(400).json({error:"Workspace mismatch: the requested workspace is not registered with this daemon.",code:"workspace_mismatch",workspaceCount:registry.listEntries().length})}__name(sendWorkspaceMismatch,"sendWorkspaceMismatch");function resolveContainedCwd(req,workspaceCwd){const rawCwd=req.query["cwd"];if(typeof rawCwd!=="string"||rawCwd.length===0){return workspaceCwd}try{const resolved=fs.realpathSync(path.resolve(rawCwd));const root=fs.realpathSync(workspaceCwd);if(isWithinRoot(resolved,root)){return resolved}}catch{}return workspaceCwd}__name(resolveContainedCwd,"resolveContainedCwd");function resolveContainedCwdOrFail(req,workspaceCwd){const rawCwd=req.query["cwd"];if(rawCwd===void 0){return workspaceCwd}if(typeof rawCwd!=="string"||rawCwd.length===0){return null}try{const resolved=fs.realpathSync(path.resolve(rawCwd));const root=fs.realpathSync(workspaceCwd);if(isWithinRoot(resolved,root)){return resolved}}catch{}return null}__name(resolveContainedCwdOrFail,"resolveContainedCwdOrFail");async function resolveGitCommonDir(cwd){let stdout;try{({stdout}=await execFileAsync("git",["rev-parse","--git-common-dir"],{cwd,encoding:"utf8",timeout:3e4,env:gitEnv()}))}catch(error){if(await isGitInfrastructureFault(error,cwd))throw error;return null}return fsPromises.realpath(path.resolve(cwd,stdout.trim())).catch(()=>null)}__name(resolveGitCommonDir,"resolveGitCommonDir");async function resolveAbsoluteGitDir(cwd){let stdout;try{({stdout}=await execFileAsync("git",["rev-parse","--absolute-git-dir"],{cwd,encoding:"utf8",timeout:3e4,env:gitEnv()}))}catch(error){if(await isGitInfrastructureFault(error,cwd))throw error;return null}return fsPromises.realpath(stdout.trim()).catch(()=>null)}__name(resolveAbsoluteGitDir,"resolveAbsoluteGitDir");async function readBoundedRegularFile(filePath,maxBytes,options){const pathStat=await fsPromises.lstat(filePath);if(!pathStat.isFile()||!options?.allowHardLinks&&pathStat.nlink!==1||pathStat.size>maxBytes){return null}const handle=await fsPromises.open(filePath,fs.constants.O_RDONLY|(fs.constants.O_NOFOLLOW??0));try{const openedStat=await handle.stat();if(!openedStat.isFile()||!options?.allowHardLinks&&openedStat.nlink!==1||openedStat.dev!==pathStat.dev||openedStat.ino!==pathStat.ino||openedStat.size>maxBytes){return null}const buffer=Buffer.alloc(maxBytes+1);let bytesRead=0;while(bytesRead<buffer.length){const chunk=await handle.read(buffer,bytesRead,buffer.length-bytesRead,bytesRead);if(chunk.bytesRead===0)break;bytesRead+=chunk.bytesRead}if(bytesRead>maxBytes)return null;const finalStat=await fsPromises.lstat(filePath);if(!finalStat.isFile()||!options?.allowHardLinks&&finalStat.nlink!==1||finalStat.dev!==openedStat.dev||finalStat.ino!==openedStat.ino){return null}return buffer.subarray(0,bytesRead).toString("utf8")}finally{await handle.close()}}__name(readBoundedRegularFile,"readBoundedRegularFile");async function markerIsOwnedBy(markerPath,sessionId){try{return(await readBoundedRegularFile(markerPath,256))?.trim()===sessionId}catch{return false}}__name(markerIsOwnedBy,"markerIsOwnedBy");async function isLinkedWorktreeOrUnknown(cwd){let stdout;try{({stdout}=await execFileAsync("git",["rev-parse","--git-common-dir","--absolute-git-dir"],{cwd,encoding:"utf8",timeout:3e4,env:gitEnv()}))}catch(error){if(await isGitInfrastructureFault(error,cwd))throw error;const stderr=error.stderr;return!(typeof stderr==="string"&&/not a git repository/i.test(stderr))}const[common,absolute]=stdout.trim().split("\n");if(!common||!absolute)return true;try{const[commonDir,gitDir]=await Promise.all([fsPromises.realpath(path.resolve(cwd,common)),fsPromises.realpath(absolute)]);return commonDir!==gitDir}catch{return true}}__name(isLinkedWorktreeOrUnknown,"isLinkedWorktreeOrUnknown");async function resolveSessionManagedGitCwd(req,runtime){const rawCwd=req.query["cwd"];if(rawCwd===void 0)return runtime.workspaceCwd;if(typeof rawCwd!=="string"||rawCwd.length===0)return null;let requested;let workspace;try{requested=await fsPromises.realpath(path.resolve(rawCwd));workspace=await fsPromises.realpath(runtime.workspaceCwd)}catch{return null}let stdout;try{({stdout}=await execFileAsync("git",["rev-parse","--show-toplevel"],{cwd:workspace,encoding:"utf8",timeout:3e4,env:gitEnv()}))}catch(error){if(isGitProbeInfrastructureError(error))throw error;const stderr=error.stderr;if(typeof stderr==="string"&&/not a git repository/i.test(stderr)&&isWithinRoot(requested,workspace)&&!await isLinkedWorktreeOrUnknown(requested)){return requested}return null}const repoTop=await fsPromises.realpath(stdout.trim()).catch(()=>null);if(repoTop===null)return null;if(requested===workspace)return requested;const managedRoot=path.join(repoTop,".qwen","worktrees");if(isWithinRoot(requested,workspace)&&!isWithinRoot(requested,managedRoot)){if(!await isLinkedWorktreeOrUnknown(requested)){return requested}const[workspaceGitDir,requestedGitDir]=await Promise.all([resolveAbsoluteGitDir(workspace),resolveAbsoluteGitDir(requested)]);if(workspaceGitDir!==null&&requestedGitDir===workspaceGitDir){return requested}}if(!isWithinRoot(requested,managedRoot))return null;const[workspaceCommonDir,requestedCommonDir]=await Promise.all([resolveGitCommonDir(workspace),resolveGitCommonDir(requested)]);if(workspaceCommonDir===null||requestedCommonDir===null||requestedCommonDir!==workspaceCommonDir){return null}try{let rawSessionId=req.query["sessionId"];if(rawSessionId===void 0){const[slug]=path.relative(managedRoot,requested).split(path.sep);if(!slug)return null;rawSessionId=(await readBoundedRegularFile(path.join(managedRoot,slug,WORKTREE_SESSION_FILE),256))?.trim()}const parsedSessionId=parseCallerSuppliedSessionId(rawSessionId);if(parsedSessionId.kind!=="valid")return null;const sessionId=parsedSessionId.sessionId;let snapshot;try{snapshot=runtime.bridge.getSessionExecutionSnapshot(sessionId)}catch{return null}if(await fsPromises.realpath(snapshot.workspaceCwd)!==workspace||!snapshot.worktree){return null}const worktreeRoot=await fsPromises.realpath(snapshot.worktree.path);if(path.dirname(worktreeRoot)!==managedRoot||!isWithinRoot(requested,worktreeRoot)){return null}const sidecarPath=createWorkspaceRuntimeSessionService(runtime).getWorktreeSessionPath(sessionId);const sidecarRaw=await readBoundedRegularFile(sidecarPath,64*1024,{allowHardLinks:true});if(sidecarRaw===null)return null;let sidecar;try{sidecar=JSON.parse(sidecarRaw)}catch{return null}if(!sidecar||typeof sidecar!=="object"||Array.isArray(sidecar)||typeof sidecar["worktreePath"]!=="string"||await fsPromises.realpath(sidecar.worktreePath)!==worktreeRoot){return null}const markerPath=path.join(worktreeRoot,WORKTREE_SESSION_FILE);if(!await markerIsOwnedBy(markerPath,sessionId)){return null}const requestedGitDir=await resolveAbsoluteGitDir(requested);if(requestedGitDir===null)return null;const metadataRoot=await fsPromises.realpath(path.join(workspaceCommonDir,"worktrees"));if(path.dirname(requestedGitDir)!==metadataRoot)return null;const backpointer=await readBoundedRegularFile(path.join(requestedGitDir,"gitdir"),4096);if(backpointer===null)return null;const actualGitFile=await fsPromises.realpath(path.resolve(requestedGitDir,backpointer.trim()));const expectedGitFile=await fsPromises.realpath(path.join(worktreeRoot,".git"));if(actualGitFile!==expectedGitFile)return null;return requested}catch(error){const code=error.code;if(code==="ENOENT"||code==="EACCES"||code==="EPERM"||code==="ELOOP"||code==="ENOTDIR"){return null}throw error}}__name(resolveSessionManagedGitCwd,"resolveSessionManagedGitCwd");async function resolveSessionManagedGitCwdForRoute(req,res,runtime,route,sendBridgeError){let cwd;try{cwd=await resolveSessionManagedGitCwd(req,runtime);runtime.generationGuard?.assertOpen()}catch(error){sendBridgeError(res,error,{route});return void 0}if(cwd===null){res.status(400).json({error:"invalid_cwd",message:"The supplied cwd is invalid or outside the workspace"});return void 0}return cwd}__name(resolveSessionManagedGitCwdForRoute,"resolveSessionManagedGitCwdForRoute");export{runWithWorkspaceRuntimeStorage,createWorkspaceRuntimeSessionService,resolveWorkspaceEntryFromParam,resolveWorkspaceEntryBySelector,isPortableAbsolutePath,resolveRegisteredWorkspaceRuntimeByPathSelector,resolveManagedWorkspaceRuntimeByPathSelector,resolveWorkspaceRuntimeFromParam,resolveTrustedRuntime,resolveWorkspaceRuntimeWithLiveCompatibilityFromParam,sendConversationRuntimeUnavailable,sendWorkspaceRuntimeUnavailable,MAX_BATCH_WORKSPACES,MAX_SELECTOR_CHARS,MAX_MEMBER_BYTES,failedBatchMember,captureWorkspaceEntryCurrency,isGenerationClosedError,sendGenerationClosedError,resolveManagedWorkspaceRuntimeFromParam,requireTrustedWorkspaceRuntime,sendUntrustedWorkspaceResponse,getWorkspaceRouteContext,setWorkspaceRouteContext,resolveContainedCwd,resolveContainedCwdOrFail,resolveSessionManagedGitCwdForRoute};
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2026 Qwen Team
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{promises as fs}from"node:fs";import{join}from"node:path";var cleanupFunctions=[];var exitCleanupPromise;function registerCleanup(fn,options={}){if(options.first)cleanupFunctions.unshift(fn);else cleanupFunctions.push(fn);return()=>{const index=cleanupFunctions.indexOf(fn);if(index!==-1)cleanupFunctions.splice(index,1)}}__name(registerCleanup,"registerCleanup");var PER_CLEANUP_TIMEOUT_MS=2e3;var OVERALL_CLEANUP_TIMEOUT_MS=5e3;function withTimeout(promise,ms){return new Promise(resolve=>{const timer=setTimeout(()=>resolve(void 0),ms);timer.unref?.();promise.then(value=>{clearTimeout(timer);resolve(value)},()=>{clearTimeout(timer);resolve(void 0)})})}__name(withTimeout,"withTimeout");function runExitCleanup(options={}){if(exitCleanupPromise)return exitCleanupPromise;const cleanup=runExitCleanupPass(options).finally(()=>{if(exitCleanupPromise===cleanup)exitCleanupPromise=void 0});exitCleanupPromise=cleanup;return cleanup}__name(runExitCleanup,"runExitCleanup");async function runExitCleanupPass(options){const perFn=options._testPerFnTimeoutMs??PER_CLEANUP_TIMEOUT_MS;const overall=options._testOverallTimeoutMs??OVERALL_CLEANUP_TIMEOUT_MS;const drain=(async()=>{for(const fn of cleanupFunctions){try{await withTimeout(Promise.resolve().then(fn),perFn)}catch(_){}}})();let wallClockTimer;const wallClock=new Promise(resolve=>{wallClockTimer=setTimeout(()=>resolve(),overall);wallClockTimer.unref?.()});try{await Promise.race([drain,wallClock])}finally{if(wallClockTimer)clearTimeout(wallClockTimer);cleanupFunctions.length=0}}__name(runExitCleanupPass,"runExitCleanupPass");async function cleanupCheckpoints(){const{Storage}=await import("./deferred-core-runtime-6BO5DI5B.js");const storage=new Storage(process.cwd());const tempDir=storage.getProjectTempDir();const checkpointsDir=join(tempDir,"checkpoints");try{await fs.rm(checkpointsDir,{recursive:true,force:true})}catch{}}__name(cleanupCheckpoints,"cleanupCheckpoints");export{registerCleanup,runExitCleanup,cleanupCheckpoints};
3
+ import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{promises as fs}from"node:fs";import{join}from"node:path";var cleanupFunctions=[];var exitCleanupPromise;function registerCleanup(fn,options={}){if(options.first)cleanupFunctions.unshift(fn);else cleanupFunctions.push(fn);return()=>{const index=cleanupFunctions.indexOf(fn);if(index!==-1)cleanupFunctions.splice(index,1)}}__name(registerCleanup,"registerCleanup");var PER_CLEANUP_TIMEOUT_MS=2e3;var OVERALL_CLEANUP_TIMEOUT_MS=5e3;function withTimeout(promise,ms){return new Promise(resolve=>{const timer=setTimeout(()=>resolve(void 0),ms);timer.unref?.();promise.then(value=>{clearTimeout(timer);resolve(value)},()=>{clearTimeout(timer);resolve(void 0)})})}__name(withTimeout,"withTimeout");function runExitCleanup(options={}){if(exitCleanupPromise)return exitCleanupPromise;const cleanup=runExitCleanupPass(options).finally(()=>{if(exitCleanupPromise===cleanup)exitCleanupPromise=void 0});exitCleanupPromise=cleanup;return cleanup}__name(runExitCleanup,"runExitCleanup");async function runExitCleanupPass(options){const perFn=options._testPerFnTimeoutMs??PER_CLEANUP_TIMEOUT_MS;const overall=options._testOverallTimeoutMs??OVERALL_CLEANUP_TIMEOUT_MS;const drain=(async()=>{for(const fn of cleanupFunctions){try{await withTimeout(Promise.resolve().then(fn),perFn)}catch(_){}}})();let wallClockTimer;const wallClock=new Promise(resolve=>{wallClockTimer=setTimeout(()=>resolve(),overall);wallClockTimer.unref?.()});try{await Promise.race([drain,wallClock])}finally{if(wallClockTimer)clearTimeout(wallClockTimer);cleanupFunctions.length=0}}__name(runExitCleanupPass,"runExitCleanupPass");async function cleanupCheckpoints(){const{Storage}=await import("./deferred-core-runtime-TXIXMDDH.js");const storage=new Storage(process.cwd());const tempDir=storage.getProjectTempDir();const checkpointsDir=join(tempDir,"checkpoints");try{await fs.rm(checkpointsDir,{recursive:true,force:true})}catch{}}__name(cleanupCheckpoints,"cleanupCheckpoints");export{registerCleanup,runExitCleanup,cleanupCheckpoints};
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2025 Google LLC
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{LEASE_PREFIX,REVIEW_TMP_DIR,inertPath,reviewBranch,reviewTrustStateDir}from"./chunk-5DPLJQUC.js";import{writeStderrLineSafe}from"./chunk-M4ECEHLX.js";import{createDebugLogger}from"./chunk-46KPDLFH.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{execFileSync}from"node:child_process";import{randomBytes}from"node:crypto";import{existsSync,lstatSync,mkdirSync,readFileSync,readdirSync,renameSync,rmdirSync,rmSync,writeFileSync}from"node:fs";import{basename,dirname,isAbsolute,join,relative,resolve}from"node:path";var GIT_TIMEOUT_MS=12e4;var debugLogger=createDebugLogger("REVIEW_WORKTREE_LEASE");function gitOptions(timeout){return{stdio:"ignore",timeout,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}}}__name(gitOptions,"gitOptions");function validTarget(target){return/^pr-\d+$/.test(target)}__name(validTarget,"validTarget");function isReviewLeaseFile(fileName){if(!fileName.startsWith(LEASE_PREFIX)||!fileName.endsWith(".json")){return false}const target=fileName.slice(LEASE_PREFIX.length,fileName.length-".json".length);return validTarget(target)}__name(isReviewLeaseFile,"isReviewLeaseFile");function leaseDirectory(repositoryRoot){return reviewTrustStateDir(repositoryRoot)}__name(leaseDirectory,"leaseDirectory");function legacyLeasePath(repositoryRoot,target){return join(repositoryRoot,REVIEW_TMP_DIR,`${LEASE_PREFIX}${target}.json`)}__name(legacyLeasePath,"legacyLeasePath");function leasePath(repositoryRoot,target){return join(leaseDirectory(repositoryRoot),`${LEASE_PREFIX}${target}.json`)}__name(leasePath,"leasePath");function clearReviewWorktreeLease(repositoryRoot,target){if(!validTarget(target))return;const root=resolve(repositoryRoot);rmSync(leasePath(root,target),{force:true});reclaimBaseTreeTrust(root,target);const legacy=legacyLeasePath(root,target);try{rmSync(legacy,{force:true,recursive:true})}catch(error){writeStderrLineSafe(`warning: could not remove the pre-move review lease at ${legacy} (${error.code??error}); the trusted lease for ${target} is released, but a build from before the lease move will keep seeing this one until it is deleted by hand.`)}}__name(clearReviewWorktreeLease,"clearReviewWorktreeLease");function clearReviewWorktreeLeaseIfOwned(repositoryRoot,target,owner){const lease=readReviewWorktreeLease(repositoryRoot,target);if(!lease||lease.sessionId!==owner.sessionId||lease.promptId!==owner.promptId){return}clearReviewWorktreeLease(repositoryRoot,target)}__name(clearReviewWorktreeLeaseIfOwned,"clearReviewWorktreeLeaseIfOwned");function mintIdentity(){return Math.floor(Date.now()/1e3)*2**20+randomBytes(3).readUIntBE(0,3)%2**20}__name(mintIdentity,"mintIdentity");function recordReviewWorktreeLeaseMergeBase(repositoryRoot,target,mergeBaseSha,sessionId,options={}){if(!validTarget(target)||!mergeBaseSha)return;const stale=options.stale===true;const root=resolve(repositoryRoot);const path=leasePath(root,target);const existing=readLease(path);if(!existing)return;if(sessionId!==void 0&&existing.sessionId!==sessionId)return;if(existing.mergeBaseSha===mergeBaseSha&&existing.mergeBaseStale===true===stale){return}const previous=existing.mergeBaseSha??existing.priorMergeBaseSha;const next={...existing,mergeBaseSha,mergeBaseStale:stale,priorMergeBaseSha:mergeBaseSha,priorMergeBaseStale:stale,priorMergeBaseCurrent:true,identity:previous===void 0||previous===mergeBaseSha?existing.identity??mintIdentity():mintIdentity()};try{atomicWriteLease(path,`${JSON.stringify(next,null,2)}
3
+ import{LEASE_PREFIX,REVIEW_TMP_DIR,inertPath,reviewBranch,reviewTrustStateDir}from"./chunk-7GYFDPEP.js";import{writeStderrLineSafe}from"./chunk-M4ECEHLX.js";import{createDebugLogger}from"./chunk-46KPDLFH.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{execFileSync}from"node:child_process";import{randomBytes}from"node:crypto";import{existsSync,lstatSync,mkdirSync,readFileSync,readdirSync,renameSync,rmdirSync,rmSync,writeFileSync}from"node:fs";import{basename,dirname,isAbsolute,join,relative,resolve}from"node:path";var GIT_TIMEOUT_MS=12e4;var debugLogger=createDebugLogger("REVIEW_WORKTREE_LEASE");function gitOptions(timeout){return{stdio:"ignore",timeout,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}}}__name(gitOptions,"gitOptions");function validTarget(target){return/^pr-\d+$/.test(target)}__name(validTarget,"validTarget");function isReviewLeaseFile(fileName){if(!fileName.startsWith(LEASE_PREFIX)||!fileName.endsWith(".json")){return false}const target=fileName.slice(LEASE_PREFIX.length,fileName.length-".json".length);return validTarget(target)}__name(isReviewLeaseFile,"isReviewLeaseFile");function leaseDirectory(repositoryRoot){return reviewTrustStateDir(repositoryRoot)}__name(leaseDirectory,"leaseDirectory");function legacyLeasePath(repositoryRoot,target){return join(repositoryRoot,REVIEW_TMP_DIR,`${LEASE_PREFIX}${target}.json`)}__name(legacyLeasePath,"legacyLeasePath");function leasePath(repositoryRoot,target){return join(leaseDirectory(repositoryRoot),`${LEASE_PREFIX}${target}.json`)}__name(leasePath,"leasePath");function clearReviewWorktreeLease(repositoryRoot,target){if(!validTarget(target))return;const root=resolve(repositoryRoot);rmSync(leasePath(root,target),{force:true});reclaimBaseTreeTrust(root,target);const legacy=legacyLeasePath(root,target);try{rmSync(legacy,{force:true,recursive:true})}catch(error){writeStderrLineSafe(`warning: could not remove the pre-move review lease at ${legacy} (${error.code??error}); the trusted lease for ${target} is released, but a build from before the lease move will keep seeing this one until it is deleted by hand.`)}}__name(clearReviewWorktreeLease,"clearReviewWorktreeLease");function clearReviewWorktreeLeaseIfOwned(repositoryRoot,target,owner){const lease=readReviewWorktreeLease(repositoryRoot,target);if(!lease||lease.sessionId!==owner.sessionId||lease.promptId!==owner.promptId){return}clearReviewWorktreeLease(repositoryRoot,target)}__name(clearReviewWorktreeLeaseIfOwned,"clearReviewWorktreeLeaseIfOwned");function mintIdentity(){return Math.floor(Date.now()/1e3)*2**20+randomBytes(3).readUIntBE(0,3)%2**20}__name(mintIdentity,"mintIdentity");function recordReviewWorktreeLeaseMergeBase(repositoryRoot,target,mergeBaseSha,sessionId,options={}){if(!validTarget(target)||!mergeBaseSha)return;const stale=options.stale===true;const root=resolve(repositoryRoot);const path=leasePath(root,target);const existing=readLease(path);if(!existing)return;if(sessionId!==void 0&&existing.sessionId!==sessionId)return;if(existing.mergeBaseSha===mergeBaseSha&&existing.mergeBaseStale===true===stale){return}const previous=existing.mergeBaseSha??existing.priorMergeBaseSha;const next={...existing,mergeBaseSha,mergeBaseStale:stale,priorMergeBaseSha:mergeBaseSha,priorMergeBaseStale:stale,priorMergeBaseCurrent:true,identity:previous===void 0||previous===mergeBaseSha?existing.identity??mintIdentity():mintIdentity()};try{atomicWriteLease(path,`${JSON.stringify(next,null,2)}
4
4
  `)}catch(error){debugLogger.debug(`Failed to record the merge base in ${path}:`,error)}}__name(recordReviewWorktreeLeaseMergeBase,"recordReviewWorktreeLeaseMergeBase");function atomicWriteLease(path,data){const tmp=`${path}.${process.pid}.${randomBytes(6).toString("hex")}.tmp`;try{writeFileSync(tmp,data,{encoding:"utf8",flag:"wx"});renameSync(tmp,path)}catch(error){try{rmSync(tmp,{force:true})}catch{}throw error}}__name(atomicWriteLease,"atomicWriteLease");function reclaimBaseTreeTrust(root,target){const dir=join(leaseDirectory(root),"base-tree",target);let entries;try{entries=readdirSync(dir)}catch(error){if(error.code!=="ENOENT"){debugLogger.debug(`Failed to reclaim base-tree trust state for ${target}:`,error)}return}for(const name of entries){if(name.endsWith(".lock"))continue;try{rmSync(join(dir,name),{recursive:true,force:true})}catch(error){debugLogger.debug(`Failed to reclaim base-tree trust state ${name} for ${target}:`,error)}}try{rmdirSync(dir)}catch{}}__name(reclaimBaseTreeTrust,"reclaimBaseTreeTrust");function restoreReviewWorktreeLeaseMergeBase(repositoryRoot,target,sessionId){if(!validTarget(target)||!sessionId)return;const path=leasePath(resolve(repositoryRoot),target);const existing=readLease(path);if(!existing||existing.sessionId!==sessionId)return;if(existing.mergeBaseSha!==void 0)return;if(existing.priorMergeBaseResumable!==true)return;const next={...existing,mergeBaseSha:existing.priorMergeBaseSha,mergeBaseStale:existing.priorMergeBaseStale===true,priorMergeBaseCurrent:true};try{atomicWriteLease(path,`${JSON.stringify(next,null,2)}
5
5
  `)}catch(error){debugLogger.debug(`Failed to restore the merge base in ${path}:`,error)}}__name(restoreReviewWorktreeLeaseMergeBase,"restoreReviewWorktreeLeaseMergeBase");function createReviewWorktreeLease(params){if(!params.sessionId||!params.promptId||!validTarget(params.target)){return}const repositoryRoot=resolve(params.repositoryRoot);const path=leasePath(repositoryRoot,params.target);const leaseFor=__name((identity,prior)=>{const lease={sessionId:params.sessionId,promptId:params.promptId,target:params.target,repositoryRoot,worktreePath:resolve(repositoryRoot,params.worktreePath),branch:params.branch,identity,...prior===void 0?{}:{priorMergeBaseSha:prior.sha,priorMergeBaseStale:prior.stale,priorMergeBaseResumable:prior.resumable}};return`${JSON.stringify(lease,null,2)}
6
6
  `},"leaseFor");let data=leaseFor(mintIdentity());mkdirSync(leaseDirectory(repositoryRoot),{recursive:true,mode:448});const legacy=legacyLeasePath(repositoryRoot,params.target);try{writeFileSync(path,data,{encoding:"utf8",flag:"wx"})}catch(error){if(error.code!=="EEXIST")throw error;const existing=readLease(path);if(existing&&existing.sessionId!==params.sessionId){throw new Error(`review worktree lease for ${params.target} is held by another session (session ${existing.sessionId}) at ${path}; it was acquired between the gate read and the lease write \u2014 retry`)}if(existing){data=leaseFor(typeof existing.identity==="number"&&Number.isFinite(existing.identity)?existing.identity:mintIdentity(),existing.mergeBaseSha!==void 0?{sha:existing.mergeBaseSha,stale:existing.mergeBaseStale===true,resumable:existing.priorMergeBaseCurrent===true}:existing.priorMergeBaseSha!==void 0?{sha:existing.priorMergeBaseSha,stale:existing.priorMergeBaseStale===true,resumable:existing.priorMergeBaseCurrent===true}:void 0)}atomicWriteLease(path,data)}mirrorLeaseAtLegacyPath(legacy,data,params.sessionId,params.target)}__name(createReviewWorktreeLease,"createReviewWorktreeLease");function mirrorLeaseAtLegacyPath(legacy,data,sessionId,target){try{mkdirSync(dirname(legacy),{recursive:true});writeFileSync(legacy,data,{encoding:"utf8",flag:"wx"});return}catch(error){if(error.code!=="EEXIST"){warnMirrorSkipped(legacy,error);return}}const displaced=readLease(legacy);const tmp=`${legacy}.${process.pid}.${randomBytes(6).toString("hex")}.tmp`;try{writeFileSync(tmp,data,{encoding:"utf8",flag:"wx"});renameSync(tmp,legacy)}catch(error){try{rmSync(tmp,{force:true})}catch{}warnMirrorSkipped(legacy,error);return}if(displaced&&displaced.sessionId!==sessionId){writeStderrLineSafe(`warning: replaced the pre-move review lease for ${target} at ${legacy} (recorded session ${inertSessionId(displaced.sessionId)}) \u2014 if a pre-move build is still reviewing ${target} on this machine, its worktree is no longer protected; otherwise this was residue or a plant, and it is gone.`)}}__name(mirrorLeaseAtLegacyPath,"mirrorLeaseAtLegacyPath");function inertSessionId(id){const inert=inertPath(id);return inert.length>120?`${inert.slice(0,120)}\u2026`:inert}__name(inertSessionId,"inertSessionId");function warnMirrorSkipped(legacy,error){writeStderrLineSafe(`warning: could not mirror the review worktree lease to the pre-move path ${legacy} (${error.code??error}); the acquisition stands on the new-path lease, but builds from before the lease move will not see this lock.`)}__name(warnMirrorSkipped,"warnMirrorSkipped");function readLease(path){try{if(!lstatSync(path).isFile()){rmSync(path,{force:true,recursive:true});return null}}catch(error){if(error.code!=="ENOENT"){debugLogger.debug(`Failed to inspect review lease ${path}:`,error)}return null}try{const value=JSON.parse(readFileSync(path,"utf8"));if(typeof value.sessionId!=="string"||typeof value.promptId!=="string"||typeof value.target!=="string"||typeof value.repositoryRoot!=="string"||typeof value.worktreePath!=="string"||typeof value.branch!=="string"||value.identity!==void 0&&(typeof value.identity!=="number"||!Number.isFinite(value.identity))||value.mergeBaseSha!==void 0&&typeof value.mergeBaseSha!=="string"||value.priorMergeBaseSha!==void 0&&typeof value.priorMergeBaseSha!=="string"||value.mergeBaseStale!==void 0&&typeof value.mergeBaseStale!=="boolean"||value.priorMergeBaseStale!==void 0&&typeof value.priorMergeBaseStale!=="boolean"||value.priorMergeBaseCurrent!==void 0&&typeof value.priorMergeBaseCurrent!=="boolean"||value.priorMergeBaseResumable!==void 0&&typeof value.priorMergeBaseResumable!=="boolean"){return null}return value}catch(error){debugLogger.debug(`Failed to read review lease ${path}:`,error);return null}}__name(readLease,"readLease");function readReviewWorktreeLease(repositoryRoot,target){return readReviewWorktreeLeaseAt(repositoryRoot,target)?.lease??null}__name(readReviewWorktreeLease,"readReviewWorktreeLease");function readReviewWorktreeLeaseAt(repositoryRoot,target){if(!validTarget(target))return null;const root=resolve(repositoryRoot);const current=leasePath(root,target);const lease=readLease(current);return lease?{lease,path:current}:null}__name(readReviewWorktreeLeaseAt,"readReviewWorktreeLeaseAt");function reviewLeaseHeldByAnotherSession(lease){if(!lease)return false;const sessionId=process.env["QWEN_CODE_SESSION_ID"]?.trim();return!sessionId||lease.sessionId!==sessionId}__name(reviewLeaseHeldByAnotherSession,"reviewLeaseHeldByAnotherSession");function sameLease(a,b){return b!==null&&a.sessionId===b.sessionId&&a.promptId===b.promptId&&a.target===b.target&&a.repositoryRoot===b.repositoryRoot&&a.worktreePath===b.worktreePath&&a.branch===b.branch}__name(sameLease,"sameLease");function removeLeaseWorktree(lease,gitTimeout){const prMatch=/^pr-(\d+)$/.exec(lease.target);if(!prMatch||lease.branch!==reviewBranch(prMatch[1])){debugLogger.debug(`Rejected invalid review lease ${lease.target}`);return false}const repositoryRoot=resolve(lease.repositoryRoot);const worktreePath=resolve(lease.worktreePath);const reviewTmpRoot=resolve(repositoryRoot,REVIEW_TMP_DIR);const worktreeRelative=relative(reviewTmpRoot,worktreePath);if(worktreeRelative===""||worktreeRelative.startsWith("..")||isAbsolute(worktreeRelative)){debugLogger.debug(`Rejected review lease outside ${REVIEW_TMP_DIR}: ${worktreePath}`);return false}try{execFileSync("git",["-C",repositoryRoot,"worktree","remove",worktreePath,"--force"],gitOptions(gitTimeout))}catch(error){debugLogger.debug(`Git failed to remove review worktree ${lease.target}:`,error);try{rmSync(worktreePath,{recursive:true,force:true});execFileSync("git",["-C",repositoryRoot,"worktree","prune"],gitOptions(gitTimeout))}catch(fallbackError){debugLogger.debug(`Fallback failed to remove review worktree ${lease.target}:`,fallbackError);return false}}let branchExists=true;try{execFileSync("git",["-C",repositoryRoot,"show-ref","--verify","--quiet",`refs/heads/${lease.branch}`],gitOptions(gitTimeout))}catch(error){if(error.status!==1){debugLogger.debug(`Failed to inspect review branch ${lease.branch}:`,error);return false}branchExists=false}if(branchExists){try{execFileSync("git",["-C",repositoryRoot,"branch","-D",lease.branch],gitOptions(gitTimeout))}catch(error){debugLogger.debug(`Failed to delete review branch ${lease.branch}:`,error);return false}}return!existsSync(worktreePath)}__name(removeLeaseWorktree,"removeLeaseWorktree");function cleanupReviewWorktreeLeases(params){try{const repositoryRoot=resolve(params.repositoryRoot);const newLeaseDirectory=leaseDirectory(repositoryRoot);if(!existsSync(newLeaseDirectory))return;let entries;try{entries=readdirSync(newLeaseDirectory)}catch(error){debugLogger.debug(`Failed to list ${newLeaseDirectory} for lease cleanup:`,error);return}for(const entry of entries){if(!isReviewLeaseFile(entry))continue;const path=join(newLeaseDirectory,basename(entry));const lease=readLease(path);if(!lease||lease.sessionId!==params.sessionId||lease.promptId!==params.promptId||resolve(lease.repositoryRoot)!==repositoryRoot){continue}if(!removeLeaseWorktree(lease,params.gitTimeout??GIT_TIMEOUT_MS)){continue}rmSync(path,{force:true});reclaimBaseTreeTrust(repositoryRoot,lease.target);const twin=join(repositoryRoot,REVIEW_TMP_DIR,basename(entry));try{if(sameLease(lease,readLease(twin))){rmSync(twin,{force:true})}}catch(error){debugLogger.debug(`Failed to remove legacy lease twin ${twin}:`,error)}}}catch(error){debugLogger.debug("Failed to clean up review worktree leases:",error)}}__name(cleanupReviewWorktreeLeases,"cleanupReviewWorktreeLeases");export{isReviewLeaseFile,clearReviewWorktreeLease,clearReviewWorktreeLeaseIfOwned,recordReviewWorktreeLeaseMergeBase,restoreReviewWorktreeLeaseMergeBase,createReviewWorktreeLease,readReviewWorktreeLease,readReviewWorktreeLeaseAt,reviewLeaseHeldByAnotherSession,cleanupReviewWorktreeLeases};
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{assertExternalAgentSpawnPlatformSupported,isExpectedExternalAgentCleanupExit,isUnprovenExternalAgentTreeExit}from"./chunk-BT7V3O75.js";import{ProcessRegistry}from"./chunk-ESSOEHTE.js";import"./chunk-QDSIJTQB.js";import"./chunk-3Y4UVTLL.js";import"./chunk-2QYDBHYZ.js";import"./chunk-YCAEGUZI.js";import"./chunk-CVMEBFLL.js";import"./chunk-L5UULTGF.js";import"./chunk-CFTFKWPW.js";import"./chunk-NIEO2TBE.js";import"./chunk-7JDZEB77.js";import"./chunk-HXYHIEMH.js";import"./chunk-QS2ZMQIS.js";import"./chunk-S7IKHQ6I.js";import"./chunk-NKU3HS2G.js";import"./chunk-MD3ZEOBX.js";import"./chunk-J6X2K3AT.js";import"./chunk-QWGJ6NGH.js";import"./chunk-NGQDWVC6.js";import"./chunk-46VUDNCL.js";import"./chunk-UNDRWCST.js";import"./chunk-RJPELYUW.js";import"./chunk-N5S6SIRO.js";import"./chunk-VDNPMX5W.js";import"./chunk-W3GNV72O.js";import"./chunk-MUNBJIEX.js";import"./chunk-A4CHYJUQ.js";import"./chunk-6PNWMPY4.js";import"./chunk-VEVQB4CI.js";import"./chunk-KMAE5NUB.js";import"./chunk-SK2DTYBZ.js";import"./chunk-XWYUQMLN.js";import"./chunk-RKDS7A4H.js";import"./chunk-IVXR5JO2.js";import"./chunk-ROE5VZOU.js";import"./chunk-UGDAT4C4.js";import"./chunk-DECUAM3U.js";import"./chunk-LWVY42EK.js";import"./chunk-QXEU5WPV.js";import"./chunk-6EDEOERB.js";import{AgentEventEmitter,renderSubagentSystemPrompt}from"./chunk-XUB4JKSR.js";import"./chunk-R2EHHA2C.js";import"./chunk-SJYPUHXE.js";import"./chunk-ZIXAINJY.js";import"./chunk-HAALYXUJ.js";import"./chunk-ZOTKZI2P.js";import"./chunk-A6G5TAIF.js";import"./chunk-I7KO7V6B.js";import"./chunk-FIXDX63I.js";import"./chunk-T7CHK6C2.js";import"./chunk-R7YLOR6I.js";import"./chunk-QVPT37XZ.js";import"./chunk-BPDVCOZ5.js";import"./chunk-DXUYBMFK.js";import"./chunk-MVGHVNW2.js";import"./chunk-MYPKMC5U.js";import"./chunk-B4ZATWBT.js";import"./chunk-PSKT6KWO.js";import"./chunk-KNIWP2YB.js";import"./chunk-UHJUDWBV.js";import"./chunk-BG67XABA.js";import"./chunk-ZQMSIRJV.js";import"./chunk-VMRQ6FA2.js";import"./chunk-OMBCQ6CU.js";import"./chunk-JB3XRNK7.js";import"./chunk-KTNQXX2N.js";import"./chunk-CV2UAEZA.js";import"./chunk-6RGS6DOB.js";import"./chunk-6NQMNEZN.js";import"./chunk-PNF77EBK.js";import"./chunk-QEF4EGUP.js";import"./chunk-6XLIEJP5.js";import"./chunk-RGUKFSBS.js";import"./chunk-PHIPLV2I.js";import"./chunk-G5PYYZMM.js";import"./chunk-OBOU4ZZM.js";import"./chunk-D7XCQWP2.js";import"./chunk-AE5OMKRY.js";import"./chunk-PWOLGVA3.js";import"./chunk-FYFNRJO5.js";import"./chunk-CL2RUJMN.js";import"./chunk-2SU7MN4F.js";import"./chunk-JZK2WGXA.js";import"./chunk-MPHSE7M4.js";import"./chunk-S2ZKZXHX.js";import"./chunk-NNRKBCOC.js";import"./chunk-QL74SOQ5.js";import"./chunk-LMM27XGW.js";import"./chunk-CZI6AF2S.js";import"./chunk-744VRMDB.js";import"./chunk-GJ67UOXA.js";import"./chunk-IWT6YN3M.js";import"./chunk-7UK4WJWS.js";import"./chunk-UYYKHWZ6.js";import"./chunk-CJ24OR2E.js";import"./chunk-KBDJRE76.js";import"./chunk-4ZRCV3JY.js";import"./chunk-MTPKKEGR.js";import"./chunk-INLKQF24.js";import"./chunk-YGLM5XPP.js";import"./chunk-WGNF7FPC.js";import"./chunk-4NPYOXJO.js";import"./chunk-MWGB5RCF.js";import"./chunk-NTRFETZB.js";import{sanitizeChildEnv}from"./chunk-LMJPU2JM.js";import"./chunk-LMUYQBL7.js";import"./chunk-3YWXKSOI.js";import"./chunk-2W7KMUTJ.js";import"./chunk-33P4RB6G.js";import"./chunk-RQHIWFQL.js";import"./chunk-BSFNCIBS.js";import"./chunk-DLFX4M6C.js";import"./chunk-5AORBHSX.js";import"./chunk-66UTCJN2.js";import"./chunk-WXQQVXYN.js";import"./chunk-AGEDDL7Z.js";import"./chunk-BN4FIQ77.js";import"./chunk-2TT7GTWH.js";import"./chunk-VFB6Q74I.js";import"./chunk-NSZJIBK7.js";import"./chunk-KLC75CL4.js";import"./chunk-N3AKLLXG.js";import"./chunk-KZSUHQLD.js";import"./chunk-476F6QIM.js";import"./chunk-A6LYTPBP.js";import"./chunk-R5AA46IX.js";import"./chunk-KNXXVHVG.js";import"./chunk-JEV36CS7.js";import"./chunk-W5NWIGKO.js";import"./chunk-CQGP2BAW.js";import"./chunk-PWOQASXT.js";import"./chunk-7XUYVD4W.js";import"./chunk-TQGZS3WN.js";import"./chunk-Z6AR5XE5.js";import"./chunk-NGXC4Y5Y.js";import"./chunk-JWTMTDHE.js";import"./chunk-EFTJIDS3.js";import"./chunk-SFDOJ2FF.js";import"./chunk-AZ4Q2ZWQ.js";import"./chunk-4ZBZL23U.js";import"./chunk-LNYY7GOJ.js";import"./chunk-E5XJBLSO.js";import"./chunk-RXKUQONJ.js";import"./chunk-2GF3E5MI.js";import"./chunk-2NJJHZ52.js";import"./chunk-X64RXJQQ.js";import"./chunk-Q6UAOTP3.js";import"./chunk-ZBWKMYJX.js";import"./chunk-XMANRGPK.js";import"./chunk-UFRESHR3.js";import"./chunk-KQX4H2D3.js";import"./chunk-I7L2TX4M.js";import"./chunk-MK3OONRA.js";import"./chunk-COGTQ5KZ.js";import"./chunk-4JNHUZ7M.js";import"./chunk-SW54YEPK.js";import"./chunk-HJKG5VPJ.js";import"./chunk-RP57XAJ2.js";import"./chunk-7DOOXUDG.js";import"./chunk-HETUGUHE.js";import"./chunk-4DIWAQ5G.js";import"./chunk-EW6HVTD5.js";import"./chunk-DBRQGEEI.js";import"./chunk-AAMQ5CMG.js";import"./chunk-ZQMVXHGH.js";import"./chunk-4WFJ5OPA.js";import"./chunk-Y2OCBVI6.js";import"./chunk-TL3SF2GA.js";import"./chunk-LPUWZZK2.js";import"./chunk-LWVCLDHV.js";import"./chunk-JOJLS3IB.js";import"./chunk-5KGH76NL.js";import"./chunk-TM6ZCBR7.js";import"./chunk-I6S7NGX3.js";import"./chunk-SBZFGYYS.js";import"./chunk-XKCXQPE7.js";import"./chunk-3KUHQGOS.js";import{createDebugLogger}from"./chunk-46KPDLFH.js";import"./chunk-I4H7NUVP.js";import"./chunk-5VB4YX3Z.js";import"./chunk-2ZK2FGZQ.js";import"./chunk-E7MYPQGV.js";import"./chunk-2UOMCYQG.js";import"./chunk-YIW3H46P.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{spawn}from"node:child_process";import{createInterface}from"node:readline";var debugLogger=createDebugLogger("EXTERNAL_AGENT");var CodexInterruption=class extends Error{constructor(mode){super(mode==="TIMEOUT"?"Codex task exceeded its time limit.":"Codex task cancelled.");this.mode=mode}static{__name(this,"CodexInterruption")}};function object(value){if(!value||typeof value!=="object"||Array.isArray(value)){throw new Error("Codex returned an invalid protocol object.")}return value}__name(object,"object");function id(value){if(typeof value!=="string"||!value){throw new Error("Codex returned an invalid thread or turn ID.")}return value}__name(id,"id");async function runCodex(params,prompt,sandbox,signal){if(signal.aborted)throw new CodexInterruption("CANCELLED");const env=sanitizeChildEnv(process.env);delete env["CODEX_THREAD_ID"];delete env["CLAUDECODE"];delete env["NODE_OPTIONS"];const child=spawn(params.spec.command,params.spec.args??["app-server","--stdio"],{cwd:params.runtimeContext.getTargetDir(),env,stdio:"pipe",detached:process.platform!=="win32",windowsHide:true});const tracked=new ProcessRegistry().reserve().attach(child,{ownsProcessTree:true});child.stderr.resume();const lines=createInterface({input:child.stdout,crlfDelay:Infinity});const pending=new Map;let sequence=0;let threadId;let turnId;let finalAnswer;let unphasedAnswer;let terminal=false;let exitDrainTimer;let fail;const failure=new Promise((_resolve,reject)=>{fail=reject});let complete;const completed=new Promise(resolve=>{complete=resolve});const write=__name(frame=>{child.stdin.write(`${JSON.stringify(frame)}
3
+ import{assertExternalAgentSpawnPlatformSupported,isExpectedExternalAgentCleanupExit,isUnprovenExternalAgentTreeExit}from"./chunk-OIQKVWR7.js";import{ProcessRegistry}from"./chunk-ESSOEHTE.js";import"./chunk-QDSIJTQB.js";import"./chunk-3Y4UVTLL.js";import"./chunk-2QYDBHYZ.js";import"./chunk-YCAEGUZI.js";import"./chunk-CVMEBFLL.js";import"./chunk-L5UULTGF.js";import"./chunk-CFTFKWPW.js";import"./chunk-NIEO2TBE.js";import"./chunk-7JDZEB77.js";import"./chunk-CXPRHT3E.js";import"./chunk-QS2ZMQIS.js";import"./chunk-S7IKHQ6I.js";import"./chunk-NKU3HS2G.js";import"./chunk-MD3ZEOBX.js";import"./chunk-J6X2K3AT.js";import"./chunk-QWGJ6NGH.js";import"./chunk-NGQDWVC6.js";import"./chunk-46VUDNCL.js";import"./chunk-UNDRWCST.js";import"./chunk-6KU7LHBT.js";import"./chunk-IMTHBYJP.js";import"./chunk-FZQJOSHD.js";import"./chunk-W3GNV72O.js";import"./chunk-MUNBJIEX.js";import"./chunk-A4CHYJUQ.js";import"./chunk-6PNWMPY4.js";import"./chunk-NDTPBVER.js";import"./chunk-KMAE5NUB.js";import"./chunk-URMRX2MG.js";import"./chunk-XWYUQMLN.js";import"./chunk-RKDS7A4H.js";import"./chunk-WFJHBU7B.js";import"./chunk-ROE5VZOU.js";import"./chunk-UGDAT4C4.js";import"./chunk-DECUAM3U.js";import"./chunk-LWVY42EK.js";import"./chunk-QXEU5WPV.js";import"./chunk-6EDEOERB.js";import{AgentEventEmitter,renderSubagentSystemPrompt}from"./chunk-3NR3JBMA.js";import"./chunk-R2EHHA2C.js";import"./chunk-SJYPUHXE.js";import"./chunk-ZIXAINJY.js";import"./chunk-HAALYXUJ.js";import"./chunk-ZOTKZI2P.js";import"./chunk-A6G5TAIF.js";import"./chunk-I7KO7V6B.js";import"./chunk-FIXDX63I.js";import"./chunk-T7CHK6C2.js";import"./chunk-R7YLOR6I.js";import"./chunk-QVPT37XZ.js";import"./chunk-BPDVCOZ5.js";import"./chunk-DXUYBMFK.js";import"./chunk-MVGHVNW2.js";import"./chunk-MYPKMC5U.js";import"./chunk-B4ZATWBT.js";import"./chunk-PSKT6KWO.js";import"./chunk-KNIWP2YB.js";import"./chunk-UHJUDWBV.js";import"./chunk-BG67XABA.js";import"./chunk-ZQMSIRJV.js";import"./chunk-VMRQ6FA2.js";import"./chunk-OMBCQ6CU.js";import"./chunk-JB3XRNK7.js";import"./chunk-KTNQXX2N.js";import"./chunk-CV2UAEZA.js";import"./chunk-6RGS6DOB.js";import"./chunk-6NQMNEZN.js";import"./chunk-PNF77EBK.js";import"./chunk-QEF4EGUP.js";import"./chunk-6XLIEJP5.js";import"./chunk-RGUKFSBS.js";import"./chunk-PHIPLV2I.js";import"./chunk-G5PYYZMM.js";import"./chunk-OBOU4ZZM.js";import"./chunk-D7XCQWP2.js";import"./chunk-AE5OMKRY.js";import"./chunk-PWOLGVA3.js";import"./chunk-FYFNRJO5.js";import"./chunk-CL2RUJMN.js";import"./chunk-2SU7MN4F.js";import"./chunk-JZK2WGXA.js";import"./chunk-MPHSE7M4.js";import"./chunk-S2ZKZXHX.js";import"./chunk-NNRKBCOC.js";import"./chunk-QL74SOQ5.js";import"./chunk-LMM27XGW.js";import"./chunk-CZI6AF2S.js";import"./chunk-744VRMDB.js";import"./chunk-GJ67UOXA.js";import"./chunk-IWT6YN3M.js";import"./chunk-7UK4WJWS.js";import"./chunk-UYYKHWZ6.js";import"./chunk-CJ24OR2E.js";import"./chunk-KBDJRE76.js";import"./chunk-4ZRCV3JY.js";import"./chunk-MTPKKEGR.js";import"./chunk-INLKQF24.js";import"./chunk-YGLM5XPP.js";import"./chunk-WGNF7FPC.js";import"./chunk-4NPYOXJO.js";import"./chunk-MWGB5RCF.js";import"./chunk-NTRFETZB.js";import{sanitizeChildEnv}from"./chunk-LMJPU2JM.js";import"./chunk-LMUYQBL7.js";import"./chunk-3YWXKSOI.js";import"./chunk-2W7KMUTJ.js";import"./chunk-33P4RB6G.js";import"./chunk-RQHIWFQL.js";import"./chunk-BSFNCIBS.js";import"./chunk-DLFX4M6C.js";import"./chunk-5AORBHSX.js";import"./chunk-66UTCJN2.js";import"./chunk-WXQQVXYN.js";import"./chunk-AGEDDL7Z.js";import"./chunk-BN4FIQ77.js";import"./chunk-2TT7GTWH.js";import"./chunk-VFB6Q74I.js";import"./chunk-NSZJIBK7.js";import"./chunk-KLC75CL4.js";import"./chunk-N3AKLLXG.js";import"./chunk-KZSUHQLD.js";import"./chunk-476F6QIM.js";import"./chunk-A6LYTPBP.js";import"./chunk-R5AA46IX.js";import"./chunk-KNXXVHVG.js";import"./chunk-JEV36CS7.js";import"./chunk-W5NWIGKO.js";import"./chunk-CQGP2BAW.js";import"./chunk-PWOQASXT.js";import"./chunk-7XUYVD4W.js";import"./chunk-TQGZS3WN.js";import"./chunk-Z6AR5XE5.js";import"./chunk-NGXC4Y5Y.js";import"./chunk-JWTMTDHE.js";import"./chunk-EFTJIDS3.js";import"./chunk-DN4QKOFL.js";import"./chunk-AZ4Q2ZWQ.js";import"./chunk-4ZBZL23U.js";import"./chunk-LNYY7GOJ.js";import"./chunk-E5XJBLSO.js";import"./chunk-RXKUQONJ.js";import"./chunk-2GF3E5MI.js";import"./chunk-2NJJHZ52.js";import"./chunk-X64RXJQQ.js";import"./chunk-Q6UAOTP3.js";import"./chunk-ZBWKMYJX.js";import"./chunk-XMANRGPK.js";import"./chunk-UFRESHR3.js";import"./chunk-KQX4H2D3.js";import"./chunk-I7L2TX4M.js";import"./chunk-MK3OONRA.js";import"./chunk-COGTQ5KZ.js";import"./chunk-4JNHUZ7M.js";import"./chunk-SW54YEPK.js";import"./chunk-HJKG5VPJ.js";import"./chunk-RP57XAJ2.js";import"./chunk-7DOOXUDG.js";import"./chunk-HETUGUHE.js";import"./chunk-4DIWAQ5G.js";import"./chunk-EW6HVTD5.js";import"./chunk-DBRQGEEI.js";import"./chunk-AAMQ5CMG.js";import"./chunk-ZQMVXHGH.js";import"./chunk-4WFJ5OPA.js";import"./chunk-Y2OCBVI6.js";import"./chunk-TL3SF2GA.js";import"./chunk-LPUWZZK2.js";import"./chunk-LWVCLDHV.js";import"./chunk-JOJLS3IB.js";import"./chunk-5KGH76NL.js";import"./chunk-TM6ZCBR7.js";import"./chunk-I6S7NGX3.js";import"./chunk-SBZFGYYS.js";import"./chunk-XKCXQPE7.js";import"./chunk-3KUHQGOS.js";import{createDebugLogger}from"./chunk-46KPDLFH.js";import"./chunk-I4H7NUVP.js";import"./chunk-5VB4YX3Z.js";import"./chunk-2ZK2FGZQ.js";import"./chunk-E7MYPQGV.js";import"./chunk-2UOMCYQG.js";import"./chunk-YIW3H46P.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{spawn}from"node:child_process";import{createInterface}from"node:readline";var debugLogger=createDebugLogger("EXTERNAL_AGENT");var CodexInterruption=class extends Error{constructor(mode){super(mode==="TIMEOUT"?"Codex task exceeded its time limit.":"Codex task cancelled.");this.mode=mode}static{__name(this,"CodexInterruption")}};function object(value){if(!value||typeof value!=="object"||Array.isArray(value)){throw new Error("Codex returned an invalid protocol object.")}return value}__name(object,"object");function id(value){if(typeof value!=="string"||!value){throw new Error("Codex returned an invalid thread or turn ID.")}return value}__name(id,"id");async function runCodex(params,prompt,sandbox,signal){if(signal.aborted)throw new CodexInterruption("CANCELLED");const env=sanitizeChildEnv(process.env);delete env["CODEX_THREAD_ID"];delete env["CLAUDECODE"];delete env["NODE_OPTIONS"];const child=spawn(params.spec.command,params.spec.args??["app-server","--stdio"],{cwd:params.runtimeContext.getTargetDir(),env,stdio:"pipe",detached:process.platform!=="win32",windowsHide:true});const tracked=new ProcessRegistry().reserve().attach(child,{ownsProcessTree:true});child.stderr.resume();const lines=createInterface({input:child.stdout,crlfDelay:Infinity});const pending=new Map;let sequence=0;let threadId;let turnId;let finalAnswer;let unphasedAnswer;let terminal=false;let exitDrainTimer;let fail;const failure=new Promise((_resolve,reject)=>{fail=reject});let complete;const completed=new Promise(resolve=>{complete=resolve});const write=__name(frame=>{child.stdin.write(`${JSON.stringify(frame)}
4
4
  `)},"write");const request=__name((method,parameters)=>{const requestId=++sequence;return new Promise((resolve,reject)=>{pending.set(requestId,{resolve,reject});write({id:requestId,method,params:parameters})})},"request");const abort=__name(()=>{if(threadId&&turnId){void request("turn/interrupt",{threadId,turnId}).catch(()=>{})}fail(new CodexInterruption("CANCELLED"))},"abort");signal.addEventListener("abort",abort,{once:true});child.once("error",error=>{fail(new Error(error.code==="ENOENT"?`Cannot start ${params.spec.command}. Install Codex and make it available on PATH.`:`Cannot start Codex: ${error.code??"process error"}`))});const onExit=__name((code,exitSignal)=>{exitDrainTimer=setTimeout(()=>fail(new Error(`Codex exited before completion (${exitSignal??code}).`)),1e4)},"onExit");child.once("exit",onExit);child.stdin.on("error",()=>fail(new Error("Codex input stream closed.")));child.stdout.on("error",()=>fail(new Error("Codex output stream failed.")));const associateTurn=__name(value=>{const observed=id(value);if(turnId&&observed!==turnId)throw new Error("Codex returned another turn.");turnId=observed},"associateTurn");lines.on("line",line=>{if(terminal&&pending.size===0)return;try{let frame;try{frame=object(JSON.parse(line))}catch(error){if(terminal)return;throw error}if(typeof frame["method"]!=="string"){const reply=pending.get(frame["id"]);if(!reply)return;pending.delete(frame["id"]);if(frame["error"])reply.reject(new Error("Codex rejected an app-server request."));else reply.resolve(object(frame["result"]));return}if(terminal)return;const method=frame["method"];const parameters=object(frame["params"]??{});if(frame["id"]!==void 0){let result;switch(method){case"item/commandExecution/requestApproval":case"item/fileChange/requestApproval":{const available=parameters["availableDecisions"];const decision=Array.isArray(available)?available.includes("decline")?"decline":available.includes("cancel")?"cancel":void 0:"decline";if(!decision)throw new Error("Codex offered no unattended rejection.");result={decision};break}case"item/permissions/requestApproval":result={permissions:{},scope:"turn"};break;case"item/tool/requestUserInput":result={answers:{}};break;case"mcpServer/elicitation/request":result={action:"decline",content:null,_meta:null};break;default:write({id:frame["id"],error:{code:-32601,message:"Unsupported unattended request."}});throw new Error(`Codex requested unsupported interaction: ${method}`)}write({id:frame["id"],result});return}if(!threadId||parameters["threadId"]!==threadId)return;if(method==="turn/started"||method==="turn/completed"){const turn=object(parameters["turn"]);associateTurn(turn["id"]);if(method==="turn/completed"){terminal=true;complete(turn)}}else if(method==="item/completed"){associateTurn(parameters["turnId"]);const item=object(parameters["item"]);if(item["type"]!=="agentMessage")return;if(typeof item["text"]!=="string")throw new Error("Codex returned an invalid message.");if(item["phase"]==="final_answer")finalAnswer=item["text"];else if(item["phase"]==null)unphasedAnswer=item["text"]}}catch(error){fail(error instanceof Error?error:new Error("Invalid Codex protocol frame."))}});lines.on("close",()=>{if(!terminal||pending.size>0)fail(new Error("Codex protocol closed before completion."))});const initTimer=setTimeout(()=>fail(new Error("Codex initialization timed out.")),1e4);const minutes=params.runConfig.max_time_minutes;const executionTimer=minutes===void 0?void 0:setTimeout(()=>fail(new CodexInterruption("TIMEOUT")),minutes*6e4);const run=__name(async()=>{await request("initialize",{clientInfo:{name:"qwen-code",version:"1.0.0"},capabilities:{experimentalApi:false}});write({method:"initialized"});const started=await request("thread/start",{cwd:params.runtimeContext.getTargetDir(),ephemeral:true,approvalPolicy:"never",sandbox});const thread=object(started["thread"]);threadId=id(thread["id"]);if(thread["ephemeral"]!==true)throw new Error("Codex did not create an ephemeral thread.");clearTimeout(initTimer);const startedTurn=await request("turn/start",{threadId,input:[{type:"text",text:prompt,text_elements:[]}]});associateTurn(object(startedTurn["turn"])["id"]);const turn=await completed;if(turn["status"]!=="completed")throw new Error(`Codex turn ended with status ${String(turn["status"])}.`);const answer=finalAnswer??unphasedAnswer;if(!answer?.trim())throw new Error("Codex completed without a final answer.");return answer},"run");let completedAnswer;let interruption;try{completedAnswer=await Promise.race([run(),failure]);return completedAnswer}catch(error){if(error instanceof CodexInterruption)interruption=error;throw error}finally{clearTimeout(initTimer);clearTimeout(executionTimer);clearTimeout(exitDrainTimer);child.removeListener("exit",onExit);signal.removeEventListener("abort",abort);lines.close();for(const reply of pending.values())reply.reject(new Error("Codex connection closed."));pending.clear();await tracked.terminate().catch(error=>{const detail=error instanceof Error?error.message:String(error);if(isUnprovenExternalAgentTreeExit(error)){const diagnostic=`Codex process tree not proven gone after cleanup: ${detail}`;debugLogger.warn(diagnostic);if(params.eventEmitter?.rawListeners("error").length){params.eventEmitter.emit("error",{subagentId:params.subagentId??params.name,error:diagnostic,timestamp:Date.now()})}}else if(!isExpectedExternalAgentCleanupExit(error)){if(interruption){interruption.message+=`
5
5
 
6
6
  Codex cleanup failed: ${detail}`;throw interruption}throw new Error(`Codex cleanup failed: ${detail}`+(completedAnswer===void 0?"":`
@@ -1,3 +1,3 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{effectiveSessionScope,multiSessionCompatibilityError,parseChannelConfig,parseChannelWebhookConfig,parseChannelWebhookConfigLenient,parseMessageRoutingConfig,parseSessionRotationConfig,resolveEnvVars}from"./chunk-BZDIZVGB.js";import"./chunk-Y7HZQ7GB.js";import"./chunk-QSICYIOC.js";import{findCliEntryPath}from"./chunk-W7V6J2VV.js";import"./chunk-6WGM7K6B.js";import"./chunk-7JDZEB77.js";import"./chunk-HXYHIEMH.js";import"./chunk-QS2ZMQIS.js";import"./chunk-S7IKHQ6I.js";import"./chunk-NKU3HS2G.js";import"./chunk-MD3ZEOBX.js";import"./chunk-J6X2K3AT.js";import"./chunk-QWGJ6NGH.js";import"./chunk-NGQDWVC6.js";import"./chunk-46VUDNCL.js";import"./chunk-UNDRWCST.js";import"./chunk-RJPELYUW.js";import"./chunk-N5S6SIRO.js";import"./chunk-VDNPMX5W.js";import"./chunk-W3GNV72O.js";import"./chunk-MUNBJIEX.js";import"./chunk-A4CHYJUQ.js";import"./chunk-6PNWMPY4.js";import"./chunk-VEVQB4CI.js";import"./chunk-KMAE5NUB.js";import"./chunk-SK2DTYBZ.js";import"./chunk-XWYUQMLN.js";import"./chunk-RKDS7A4H.js";import"./chunk-IVXR5JO2.js";import"./chunk-ROE5VZOU.js";import"./chunk-UGDAT4C4.js";import"./chunk-DECUAM3U.js";import"./chunk-LWVY42EK.js";import"./chunk-QXEU5WPV.js";import"./chunk-6EDEOERB.js";import"./chunk-XUB4JKSR.js";import"./chunk-R2EHHA2C.js";import"./chunk-SJYPUHXE.js";import"./chunk-ZIXAINJY.js";import"./chunk-HAALYXUJ.js";import"./chunk-ZOTKZI2P.js";import"./chunk-A6G5TAIF.js";import"./chunk-I7KO7V6B.js";import"./chunk-FIXDX63I.js";import"./chunk-T7CHK6C2.js";import"./chunk-R7YLOR6I.js";import"./chunk-QVPT37XZ.js";import"./chunk-BPDVCOZ5.js";import"./chunk-DXUYBMFK.js";import"./chunk-MVGHVNW2.js";import"./chunk-MYPKMC5U.js";import"./chunk-B4ZATWBT.js";import"./chunk-PSKT6KWO.js";import"./chunk-KNIWP2YB.js";import"./chunk-UHJUDWBV.js";import"./chunk-BG67XABA.js";import"./chunk-ZQMSIRJV.js";import"./chunk-VMRQ6FA2.js";import"./chunk-OMBCQ6CU.js";import"./chunk-JB3XRNK7.js";import"./chunk-KTNQXX2N.js";import"./chunk-CV2UAEZA.js";import"./chunk-6RGS6DOB.js";import"./chunk-6NQMNEZN.js";import"./chunk-PNF77EBK.js";import"./chunk-QEF4EGUP.js";import"./chunk-6XLIEJP5.js";import"./chunk-RGUKFSBS.js";import"./chunk-PHIPLV2I.js";import"./chunk-G5PYYZMM.js";import"./chunk-OBOU4ZZM.js";import"./chunk-D7XCQWP2.js";import"./chunk-AE5OMKRY.js";import"./chunk-PWOLGVA3.js";import"./chunk-FYFNRJO5.js";import"./chunk-CL2RUJMN.js";import"./chunk-2SU7MN4F.js";import"./chunk-JZK2WGXA.js";import"./chunk-MPHSE7M4.js";import"./chunk-S2ZKZXHX.js";import"./chunk-NNRKBCOC.js";import"./chunk-QL74SOQ5.js";import"./chunk-LMM27XGW.js";import"./chunk-CZI6AF2S.js";import"./chunk-744VRMDB.js";import"./chunk-GJ67UOXA.js";import"./chunk-IWT6YN3M.js";import"./chunk-7UK4WJWS.js";import"./chunk-UYYKHWZ6.js";import"./chunk-CJ24OR2E.js";import"./chunk-KBDJRE76.js";import"./chunk-4ZRCV3JY.js";import"./chunk-MTPKKEGR.js";import"./chunk-INLKQF24.js";import"./chunk-YGLM5XPP.js";import"./chunk-WGNF7FPC.js";import"./chunk-4NPYOXJO.js";import"./chunk-MWGB5RCF.js";import"./chunk-NTRFETZB.js";import"./chunk-LMJPU2JM.js";import"./chunk-LMUYQBL7.js";import"./chunk-3YWXKSOI.js";import"./chunk-2W7KMUTJ.js";import"./chunk-33P4RB6G.js";import"./chunk-RQHIWFQL.js";import"./chunk-BSFNCIBS.js";import"./chunk-DLFX4M6C.js";import"./chunk-5AORBHSX.js";import"./chunk-66UTCJN2.js";import"./chunk-WXQQVXYN.js";import"./chunk-AGEDDL7Z.js";import"./chunk-BN4FIQ77.js";import"./chunk-2TT7GTWH.js";import"./chunk-VFB6Q74I.js";import"./chunk-NSZJIBK7.js";import"./chunk-KLC75CL4.js";import"./chunk-N3AKLLXG.js";import"./chunk-KZSUHQLD.js";import"./chunk-476F6QIM.js";import"./chunk-A6LYTPBP.js";import"./chunk-R5AA46IX.js";import"./chunk-KNXXVHVG.js";import"./chunk-JEV36CS7.js";import"./chunk-W5NWIGKO.js";import"./chunk-CQGP2BAW.js";import"./chunk-PWOQASXT.js";import"./chunk-7XUYVD4W.js";import"./chunk-TQGZS3WN.js";import"./chunk-Z6AR5XE5.js";import"./chunk-NGXC4Y5Y.js";import"./chunk-JWTMTDHE.js";import"./chunk-EFTJIDS3.js";import"./chunk-SFDOJ2FF.js";import"./chunk-AZ4Q2ZWQ.js";import"./chunk-4ZBZL23U.js";import"./chunk-LNYY7GOJ.js";import"./chunk-E5XJBLSO.js";import"./chunk-RXKUQONJ.js";import"./chunk-2GF3E5MI.js";import"./chunk-2NJJHZ52.js";import"./chunk-X64RXJQQ.js";import"./chunk-Q6UAOTP3.js";import"./chunk-ZBWKMYJX.js";import"./chunk-XMANRGPK.js";import"./chunk-UFRESHR3.js";import"./chunk-KQX4H2D3.js";import"./chunk-I7L2TX4M.js";import"./chunk-MK3OONRA.js";import"./chunk-COGTQ5KZ.js";import"./chunk-4JNHUZ7M.js";import"./chunk-SW54YEPK.js";import"./chunk-HJKG5VPJ.js";import"./chunk-RP57XAJ2.js";import"./chunk-7DOOXUDG.js";import"./chunk-HETUGUHE.js";import"./chunk-4DIWAQ5G.js";import"./chunk-EW6HVTD5.js";import"./chunk-DBRQGEEI.js";import"./chunk-AAMQ5CMG.js";import"./chunk-ZQMVXHGH.js";import"./chunk-4WFJ5OPA.js";import"./chunk-Y2OCBVI6.js";import"./chunk-TL3SF2GA.js";import"./chunk-LPUWZZK2.js";import"./chunk-LWVCLDHV.js";import"./chunk-JOJLS3IB.js";import"./chunk-5KGH76NL.js";import"./chunk-TM6ZCBR7.js";import"./chunk-I6S7NGX3.js";import"./chunk-SBZFGYYS.js";import"./chunk-XKCXQPE7.js";import"./chunk-3KUHQGOS.js";import"./chunk-46KPDLFH.js";import"./chunk-I4H7NUVP.js";import"./chunk-5VB4YX3Z.js";import"./chunk-2ZK2FGZQ.js";import"./chunk-E7MYPQGV.js";import"./chunk-2UOMCYQG.js";import"./chunk-YIW3H46P.js";import"./chunk-VKDAXTCZ.js";import"./chunk-KBWJGX7I.js";export{effectiveSessionScope,findCliEntryPath,multiSessionCompatibilityError,parseChannelConfig,parseChannelWebhookConfig,parseChannelWebhookConfigLenient,parseMessageRoutingConfig,parseSessionRotationConfig,resolveEnvVars};
3
+ import{effectiveSessionScope,multiSessionCompatibilityError,parseChannelConfig,parseChannelWebhookConfig,parseChannelWebhookConfigLenient,parseMessageRoutingConfig,parseSessionRotationConfig,resolveEnvVars}from"./chunk-BZDIZVGB.js";import"./chunk-Y7HZQ7GB.js";import"./chunk-QSICYIOC.js";import{findCliEntryPath}from"./chunk-W7V6J2VV.js";import"./chunk-6WGM7K6B.js";import"./chunk-7JDZEB77.js";import"./chunk-CXPRHT3E.js";import"./chunk-QS2ZMQIS.js";import"./chunk-S7IKHQ6I.js";import"./chunk-NKU3HS2G.js";import"./chunk-MD3ZEOBX.js";import"./chunk-J6X2K3AT.js";import"./chunk-QWGJ6NGH.js";import"./chunk-NGQDWVC6.js";import"./chunk-46VUDNCL.js";import"./chunk-UNDRWCST.js";import"./chunk-6KU7LHBT.js";import"./chunk-IMTHBYJP.js";import"./chunk-FZQJOSHD.js";import"./chunk-W3GNV72O.js";import"./chunk-MUNBJIEX.js";import"./chunk-A4CHYJUQ.js";import"./chunk-6PNWMPY4.js";import"./chunk-NDTPBVER.js";import"./chunk-KMAE5NUB.js";import"./chunk-URMRX2MG.js";import"./chunk-XWYUQMLN.js";import"./chunk-RKDS7A4H.js";import"./chunk-WFJHBU7B.js";import"./chunk-ROE5VZOU.js";import"./chunk-UGDAT4C4.js";import"./chunk-DECUAM3U.js";import"./chunk-LWVY42EK.js";import"./chunk-QXEU5WPV.js";import"./chunk-6EDEOERB.js";import"./chunk-3NR3JBMA.js";import"./chunk-R2EHHA2C.js";import"./chunk-SJYPUHXE.js";import"./chunk-ZIXAINJY.js";import"./chunk-HAALYXUJ.js";import"./chunk-ZOTKZI2P.js";import"./chunk-A6G5TAIF.js";import"./chunk-I7KO7V6B.js";import"./chunk-FIXDX63I.js";import"./chunk-T7CHK6C2.js";import"./chunk-R7YLOR6I.js";import"./chunk-QVPT37XZ.js";import"./chunk-BPDVCOZ5.js";import"./chunk-DXUYBMFK.js";import"./chunk-MVGHVNW2.js";import"./chunk-MYPKMC5U.js";import"./chunk-B4ZATWBT.js";import"./chunk-PSKT6KWO.js";import"./chunk-KNIWP2YB.js";import"./chunk-UHJUDWBV.js";import"./chunk-BG67XABA.js";import"./chunk-ZQMSIRJV.js";import"./chunk-VMRQ6FA2.js";import"./chunk-OMBCQ6CU.js";import"./chunk-JB3XRNK7.js";import"./chunk-KTNQXX2N.js";import"./chunk-CV2UAEZA.js";import"./chunk-6RGS6DOB.js";import"./chunk-6NQMNEZN.js";import"./chunk-PNF77EBK.js";import"./chunk-QEF4EGUP.js";import"./chunk-6XLIEJP5.js";import"./chunk-RGUKFSBS.js";import"./chunk-PHIPLV2I.js";import"./chunk-G5PYYZMM.js";import"./chunk-OBOU4ZZM.js";import"./chunk-D7XCQWP2.js";import"./chunk-AE5OMKRY.js";import"./chunk-PWOLGVA3.js";import"./chunk-FYFNRJO5.js";import"./chunk-CL2RUJMN.js";import"./chunk-2SU7MN4F.js";import"./chunk-JZK2WGXA.js";import"./chunk-MPHSE7M4.js";import"./chunk-S2ZKZXHX.js";import"./chunk-NNRKBCOC.js";import"./chunk-QL74SOQ5.js";import"./chunk-LMM27XGW.js";import"./chunk-CZI6AF2S.js";import"./chunk-744VRMDB.js";import"./chunk-GJ67UOXA.js";import"./chunk-IWT6YN3M.js";import"./chunk-7UK4WJWS.js";import"./chunk-UYYKHWZ6.js";import"./chunk-CJ24OR2E.js";import"./chunk-KBDJRE76.js";import"./chunk-4ZRCV3JY.js";import"./chunk-MTPKKEGR.js";import"./chunk-INLKQF24.js";import"./chunk-YGLM5XPP.js";import"./chunk-WGNF7FPC.js";import"./chunk-4NPYOXJO.js";import"./chunk-MWGB5RCF.js";import"./chunk-NTRFETZB.js";import"./chunk-LMJPU2JM.js";import"./chunk-LMUYQBL7.js";import"./chunk-3YWXKSOI.js";import"./chunk-2W7KMUTJ.js";import"./chunk-33P4RB6G.js";import"./chunk-RQHIWFQL.js";import"./chunk-BSFNCIBS.js";import"./chunk-DLFX4M6C.js";import"./chunk-5AORBHSX.js";import"./chunk-66UTCJN2.js";import"./chunk-WXQQVXYN.js";import"./chunk-AGEDDL7Z.js";import"./chunk-BN4FIQ77.js";import"./chunk-2TT7GTWH.js";import"./chunk-VFB6Q74I.js";import"./chunk-NSZJIBK7.js";import"./chunk-KLC75CL4.js";import"./chunk-N3AKLLXG.js";import"./chunk-KZSUHQLD.js";import"./chunk-476F6QIM.js";import"./chunk-A6LYTPBP.js";import"./chunk-R5AA46IX.js";import"./chunk-KNXXVHVG.js";import"./chunk-JEV36CS7.js";import"./chunk-W5NWIGKO.js";import"./chunk-CQGP2BAW.js";import"./chunk-PWOQASXT.js";import"./chunk-7XUYVD4W.js";import"./chunk-TQGZS3WN.js";import"./chunk-Z6AR5XE5.js";import"./chunk-NGXC4Y5Y.js";import"./chunk-JWTMTDHE.js";import"./chunk-EFTJIDS3.js";import"./chunk-DN4QKOFL.js";import"./chunk-AZ4Q2ZWQ.js";import"./chunk-4ZBZL23U.js";import"./chunk-LNYY7GOJ.js";import"./chunk-E5XJBLSO.js";import"./chunk-RXKUQONJ.js";import"./chunk-2GF3E5MI.js";import"./chunk-2NJJHZ52.js";import"./chunk-X64RXJQQ.js";import"./chunk-Q6UAOTP3.js";import"./chunk-ZBWKMYJX.js";import"./chunk-XMANRGPK.js";import"./chunk-UFRESHR3.js";import"./chunk-KQX4H2D3.js";import"./chunk-I7L2TX4M.js";import"./chunk-MK3OONRA.js";import"./chunk-COGTQ5KZ.js";import"./chunk-4JNHUZ7M.js";import"./chunk-SW54YEPK.js";import"./chunk-HJKG5VPJ.js";import"./chunk-RP57XAJ2.js";import"./chunk-7DOOXUDG.js";import"./chunk-HETUGUHE.js";import"./chunk-4DIWAQ5G.js";import"./chunk-EW6HVTD5.js";import"./chunk-DBRQGEEI.js";import"./chunk-AAMQ5CMG.js";import"./chunk-ZQMVXHGH.js";import"./chunk-4WFJ5OPA.js";import"./chunk-Y2OCBVI6.js";import"./chunk-TL3SF2GA.js";import"./chunk-LPUWZZK2.js";import"./chunk-LWVCLDHV.js";import"./chunk-JOJLS3IB.js";import"./chunk-5KGH76NL.js";import"./chunk-TM6ZCBR7.js";import"./chunk-I6S7NGX3.js";import"./chunk-SBZFGYYS.js";import"./chunk-XKCXQPE7.js";import"./chunk-3KUHQGOS.js";import"./chunk-46KPDLFH.js";import"./chunk-I4H7NUVP.js";import"./chunk-5VB4YX3Z.js";import"./chunk-2ZK2FGZQ.js";import"./chunk-E7MYPQGV.js";import"./chunk-2UOMCYQG.js";import"./chunk-YIW3H46P.js";import"./chunk-VKDAXTCZ.js";import"./chunk-KBWJGX7I.js";export{effectiveSessionScope,findCliEntryPath,multiSessionCompatibilityError,parseChannelConfig,parseChannelWebhookConfig,parseChannelWebhookConfigLenient,parseMessageRoutingConfig,parseSessionRotationConfig,resolveEnvVars};
@@ -1,3 +1,3 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{collectContextData,contextCommand,formatContextUsageText}from"./chunk-FDQFJFO5.js";import"./chunk-EVBKKQ7Y.js";import"./chunk-4TZUKLPC.js";import"./chunk-HRRQHZQE.js";import"./chunk-YE3LA3U4.js";import"./chunk-HXYHIEMH.js";import"./chunk-QS2ZMQIS.js";import"./chunk-S7IKHQ6I.js";import"./chunk-NKU3HS2G.js";import"./chunk-MD3ZEOBX.js";import"./chunk-J6X2K3AT.js";import"./chunk-QWGJ6NGH.js";import"./chunk-NGQDWVC6.js";import"./chunk-46VUDNCL.js";import"./chunk-UNDRWCST.js";import"./chunk-RJPELYUW.js";import"./chunk-N5S6SIRO.js";import"./chunk-VDNPMX5W.js";import"./chunk-W3GNV72O.js";import"./chunk-MUNBJIEX.js";import"./chunk-A4CHYJUQ.js";import"./chunk-6PNWMPY4.js";import"./chunk-VEVQB4CI.js";import"./chunk-KMAE5NUB.js";import"./chunk-SK2DTYBZ.js";import"./chunk-XWYUQMLN.js";import"./chunk-RKDS7A4H.js";import"./chunk-IVXR5JO2.js";import"./chunk-ROE5VZOU.js";import"./chunk-UGDAT4C4.js";import"./chunk-DECUAM3U.js";import"./chunk-LWVY42EK.js";import"./chunk-QXEU5WPV.js";import"./chunk-6EDEOERB.js";import"./chunk-XUB4JKSR.js";import"./chunk-R2EHHA2C.js";import"./chunk-SJYPUHXE.js";import"./chunk-ZIXAINJY.js";import"./chunk-HAALYXUJ.js";import"./chunk-ZOTKZI2P.js";import"./chunk-A6G5TAIF.js";import"./chunk-I7KO7V6B.js";import"./chunk-FIXDX63I.js";import"./chunk-T7CHK6C2.js";import"./chunk-R7YLOR6I.js";import"./chunk-QVPT37XZ.js";import"./chunk-BPDVCOZ5.js";import"./chunk-DXUYBMFK.js";import"./chunk-MVGHVNW2.js";import"./chunk-MYPKMC5U.js";import"./chunk-B4ZATWBT.js";import"./chunk-PSKT6KWO.js";import"./chunk-KNIWP2YB.js";import"./chunk-UHJUDWBV.js";import"./chunk-BG67XABA.js";import"./chunk-ZQMSIRJV.js";import"./chunk-VMRQ6FA2.js";import"./chunk-OMBCQ6CU.js";import"./chunk-JB3XRNK7.js";import"./chunk-KTNQXX2N.js";import"./chunk-CV2UAEZA.js";import"./chunk-6RGS6DOB.js";import"./chunk-6NQMNEZN.js";import"./chunk-PNF77EBK.js";import"./chunk-QEF4EGUP.js";import"./chunk-6XLIEJP5.js";import"./chunk-RGUKFSBS.js";import"./chunk-PHIPLV2I.js";import"./chunk-G5PYYZMM.js";import"./chunk-OBOU4ZZM.js";import"./chunk-D7XCQWP2.js";import"./chunk-AE5OMKRY.js";import"./chunk-PWOLGVA3.js";import"./chunk-FYFNRJO5.js";import"./chunk-CL2RUJMN.js";import"./chunk-2SU7MN4F.js";import"./chunk-JZK2WGXA.js";import"./chunk-MPHSE7M4.js";import"./chunk-S2ZKZXHX.js";import"./chunk-NNRKBCOC.js";import"./chunk-QL74SOQ5.js";import"./chunk-LMM27XGW.js";import"./chunk-CZI6AF2S.js";import"./chunk-744VRMDB.js";import"./chunk-GJ67UOXA.js";import"./chunk-IWT6YN3M.js";import"./chunk-7UK4WJWS.js";import"./chunk-UYYKHWZ6.js";import"./chunk-CJ24OR2E.js";import"./chunk-KBDJRE76.js";import"./chunk-4ZRCV3JY.js";import"./chunk-MTPKKEGR.js";import"./chunk-INLKQF24.js";import"./chunk-YGLM5XPP.js";import"./chunk-WGNF7FPC.js";import"./chunk-4NPYOXJO.js";import"./chunk-MWGB5RCF.js";import"./chunk-NTRFETZB.js";import"./chunk-LMJPU2JM.js";import"./chunk-LMUYQBL7.js";import"./chunk-3YWXKSOI.js";import"./chunk-2W7KMUTJ.js";import"./chunk-33P4RB6G.js";import"./chunk-RQHIWFQL.js";import"./chunk-BSFNCIBS.js";import"./chunk-DLFX4M6C.js";import"./chunk-5AORBHSX.js";import"./chunk-66UTCJN2.js";import"./chunk-WXQQVXYN.js";import"./chunk-AGEDDL7Z.js";import"./chunk-BN4FIQ77.js";import"./chunk-2TT7GTWH.js";import"./chunk-VFB6Q74I.js";import"./chunk-NSZJIBK7.js";import"./chunk-KLC75CL4.js";import"./chunk-N3AKLLXG.js";import"./chunk-KZSUHQLD.js";import"./chunk-476F6QIM.js";import"./chunk-A6LYTPBP.js";import"./chunk-R5AA46IX.js";import"./chunk-KNXXVHVG.js";import"./chunk-JEV36CS7.js";import"./chunk-W5NWIGKO.js";import"./chunk-CQGP2BAW.js";import"./chunk-PWOQASXT.js";import"./chunk-7XUYVD4W.js";import"./chunk-TQGZS3WN.js";import"./chunk-Z6AR5XE5.js";import"./chunk-NGXC4Y5Y.js";import"./chunk-JWTMTDHE.js";import"./chunk-EFTJIDS3.js";import"./chunk-SFDOJ2FF.js";import"./chunk-AZ4Q2ZWQ.js";import"./chunk-4ZBZL23U.js";import"./chunk-LNYY7GOJ.js";import"./chunk-E5XJBLSO.js";import"./chunk-RXKUQONJ.js";import"./chunk-2GF3E5MI.js";import"./chunk-2NJJHZ52.js";import"./chunk-X64RXJQQ.js";import"./chunk-Q6UAOTP3.js";import"./chunk-ZBWKMYJX.js";import"./chunk-XMANRGPK.js";import"./chunk-UFRESHR3.js";import"./chunk-KQX4H2D3.js";import"./chunk-I7L2TX4M.js";import"./chunk-MK3OONRA.js";import"./chunk-COGTQ5KZ.js";import"./chunk-4JNHUZ7M.js";import"./chunk-SW54YEPK.js";import"./chunk-HJKG5VPJ.js";import"./chunk-RP57XAJ2.js";import"./chunk-7DOOXUDG.js";import"./chunk-HETUGUHE.js";import"./chunk-4DIWAQ5G.js";import"./chunk-EW6HVTD5.js";import"./chunk-M4ECEHLX.js";import"./chunk-DBRQGEEI.js";import"./chunk-AAMQ5CMG.js";import"./chunk-ZQMVXHGH.js";import"./chunk-4WFJ5OPA.js";import"./chunk-Y2OCBVI6.js";import"./chunk-TL3SF2GA.js";import"./chunk-LPUWZZK2.js";import"./chunk-LWVCLDHV.js";import"./chunk-JOJLS3IB.js";import"./chunk-5KGH76NL.js";import"./chunk-TM6ZCBR7.js";import"./chunk-I6S7NGX3.js";import"./chunk-SBZFGYYS.js";import"./chunk-XKCXQPE7.js";import"./chunk-3KUHQGOS.js";import"./chunk-46KPDLFH.js";import"./chunk-I4H7NUVP.js";import"./chunk-5VB4YX3Z.js";import"./chunk-2ZK2FGZQ.js";import"./chunk-E7MYPQGV.js";import"./chunk-2UOMCYQG.js";import"./chunk-YIW3H46P.js";import"./chunk-VKDAXTCZ.js";import"./chunk-KBWJGX7I.js";export{collectContextData,contextCommand,formatContextUsageText};
3
+ import{collectContextData,contextCommand,formatContextUsageText}from"./chunk-KAN5KUJD.js";import"./chunk-EVBKKQ7Y.js";import"./chunk-4TZUKLPC.js";import"./chunk-73TSS7KS.js";import"./chunk-FWJKQA2H.js";import"./chunk-CXPRHT3E.js";import"./chunk-QS2ZMQIS.js";import"./chunk-S7IKHQ6I.js";import"./chunk-NKU3HS2G.js";import"./chunk-MD3ZEOBX.js";import"./chunk-J6X2K3AT.js";import"./chunk-QWGJ6NGH.js";import"./chunk-NGQDWVC6.js";import"./chunk-46VUDNCL.js";import"./chunk-UNDRWCST.js";import"./chunk-6KU7LHBT.js";import"./chunk-IMTHBYJP.js";import"./chunk-FZQJOSHD.js";import"./chunk-W3GNV72O.js";import"./chunk-MUNBJIEX.js";import"./chunk-A4CHYJUQ.js";import"./chunk-6PNWMPY4.js";import"./chunk-NDTPBVER.js";import"./chunk-KMAE5NUB.js";import"./chunk-URMRX2MG.js";import"./chunk-XWYUQMLN.js";import"./chunk-RKDS7A4H.js";import"./chunk-WFJHBU7B.js";import"./chunk-ROE5VZOU.js";import"./chunk-UGDAT4C4.js";import"./chunk-DECUAM3U.js";import"./chunk-LWVY42EK.js";import"./chunk-QXEU5WPV.js";import"./chunk-6EDEOERB.js";import"./chunk-3NR3JBMA.js";import"./chunk-R2EHHA2C.js";import"./chunk-SJYPUHXE.js";import"./chunk-ZIXAINJY.js";import"./chunk-HAALYXUJ.js";import"./chunk-ZOTKZI2P.js";import"./chunk-A6G5TAIF.js";import"./chunk-I7KO7V6B.js";import"./chunk-FIXDX63I.js";import"./chunk-T7CHK6C2.js";import"./chunk-R7YLOR6I.js";import"./chunk-QVPT37XZ.js";import"./chunk-BPDVCOZ5.js";import"./chunk-DXUYBMFK.js";import"./chunk-MVGHVNW2.js";import"./chunk-MYPKMC5U.js";import"./chunk-B4ZATWBT.js";import"./chunk-PSKT6KWO.js";import"./chunk-KNIWP2YB.js";import"./chunk-UHJUDWBV.js";import"./chunk-BG67XABA.js";import"./chunk-ZQMSIRJV.js";import"./chunk-VMRQ6FA2.js";import"./chunk-OMBCQ6CU.js";import"./chunk-JB3XRNK7.js";import"./chunk-KTNQXX2N.js";import"./chunk-CV2UAEZA.js";import"./chunk-6RGS6DOB.js";import"./chunk-6NQMNEZN.js";import"./chunk-PNF77EBK.js";import"./chunk-QEF4EGUP.js";import"./chunk-6XLIEJP5.js";import"./chunk-RGUKFSBS.js";import"./chunk-PHIPLV2I.js";import"./chunk-G5PYYZMM.js";import"./chunk-OBOU4ZZM.js";import"./chunk-D7XCQWP2.js";import"./chunk-AE5OMKRY.js";import"./chunk-PWOLGVA3.js";import"./chunk-FYFNRJO5.js";import"./chunk-CL2RUJMN.js";import"./chunk-2SU7MN4F.js";import"./chunk-JZK2WGXA.js";import"./chunk-MPHSE7M4.js";import"./chunk-S2ZKZXHX.js";import"./chunk-NNRKBCOC.js";import"./chunk-QL74SOQ5.js";import"./chunk-LMM27XGW.js";import"./chunk-CZI6AF2S.js";import"./chunk-744VRMDB.js";import"./chunk-GJ67UOXA.js";import"./chunk-IWT6YN3M.js";import"./chunk-7UK4WJWS.js";import"./chunk-UYYKHWZ6.js";import"./chunk-CJ24OR2E.js";import"./chunk-KBDJRE76.js";import"./chunk-4ZRCV3JY.js";import"./chunk-MTPKKEGR.js";import"./chunk-INLKQF24.js";import"./chunk-YGLM5XPP.js";import"./chunk-WGNF7FPC.js";import"./chunk-4NPYOXJO.js";import"./chunk-MWGB5RCF.js";import"./chunk-NTRFETZB.js";import"./chunk-LMJPU2JM.js";import"./chunk-LMUYQBL7.js";import"./chunk-3YWXKSOI.js";import"./chunk-2W7KMUTJ.js";import"./chunk-33P4RB6G.js";import"./chunk-RQHIWFQL.js";import"./chunk-BSFNCIBS.js";import"./chunk-DLFX4M6C.js";import"./chunk-5AORBHSX.js";import"./chunk-66UTCJN2.js";import"./chunk-WXQQVXYN.js";import"./chunk-AGEDDL7Z.js";import"./chunk-BN4FIQ77.js";import"./chunk-2TT7GTWH.js";import"./chunk-VFB6Q74I.js";import"./chunk-NSZJIBK7.js";import"./chunk-KLC75CL4.js";import"./chunk-N3AKLLXG.js";import"./chunk-KZSUHQLD.js";import"./chunk-476F6QIM.js";import"./chunk-A6LYTPBP.js";import"./chunk-R5AA46IX.js";import"./chunk-KNXXVHVG.js";import"./chunk-JEV36CS7.js";import"./chunk-W5NWIGKO.js";import"./chunk-CQGP2BAW.js";import"./chunk-PWOQASXT.js";import"./chunk-7XUYVD4W.js";import"./chunk-TQGZS3WN.js";import"./chunk-Z6AR5XE5.js";import"./chunk-NGXC4Y5Y.js";import"./chunk-JWTMTDHE.js";import"./chunk-EFTJIDS3.js";import"./chunk-DN4QKOFL.js";import"./chunk-AZ4Q2ZWQ.js";import"./chunk-4ZBZL23U.js";import"./chunk-LNYY7GOJ.js";import"./chunk-E5XJBLSO.js";import"./chunk-RXKUQONJ.js";import"./chunk-2GF3E5MI.js";import"./chunk-2NJJHZ52.js";import"./chunk-X64RXJQQ.js";import"./chunk-Q6UAOTP3.js";import"./chunk-ZBWKMYJX.js";import"./chunk-XMANRGPK.js";import"./chunk-UFRESHR3.js";import"./chunk-KQX4H2D3.js";import"./chunk-I7L2TX4M.js";import"./chunk-MK3OONRA.js";import"./chunk-COGTQ5KZ.js";import"./chunk-4JNHUZ7M.js";import"./chunk-SW54YEPK.js";import"./chunk-HJKG5VPJ.js";import"./chunk-RP57XAJ2.js";import"./chunk-7DOOXUDG.js";import"./chunk-HETUGUHE.js";import"./chunk-4DIWAQ5G.js";import"./chunk-EW6HVTD5.js";import"./chunk-M4ECEHLX.js";import"./chunk-DBRQGEEI.js";import"./chunk-AAMQ5CMG.js";import"./chunk-ZQMVXHGH.js";import"./chunk-4WFJ5OPA.js";import"./chunk-Y2OCBVI6.js";import"./chunk-TL3SF2GA.js";import"./chunk-LPUWZZK2.js";import"./chunk-LWVCLDHV.js";import"./chunk-JOJLS3IB.js";import"./chunk-5KGH76NL.js";import"./chunk-TM6ZCBR7.js";import"./chunk-I6S7NGX3.js";import"./chunk-SBZFGYYS.js";import"./chunk-XKCXQPE7.js";import"./chunk-3KUHQGOS.js";import"./chunk-46KPDLFH.js";import"./chunk-I4H7NUVP.js";import"./chunk-5VB4YX3Z.js";import"./chunk-2ZK2FGZQ.js";import"./chunk-E7MYPQGV.js";import"./chunk-2UOMCYQG.js";import"./chunk-YIW3H46P.js";import"./chunk-VKDAXTCZ.js";import"./chunk-KBWJGX7I.js";export{collectContextData,contextCommand,formatContextUsageText};
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import"./chunk-HXYHIEMH.js";import"./chunk-QS2ZMQIS.js";import"./chunk-S7IKHQ6I.js";import"./chunk-NKU3HS2G.js";import"./chunk-MD3ZEOBX.js";import"./chunk-J6X2K3AT.js";import"./chunk-QWGJ6NGH.js";import"./chunk-NGQDWVC6.js";import"./chunk-46VUDNCL.js";import"./chunk-UNDRWCST.js";import"./chunk-RJPELYUW.js";import"./chunk-N5S6SIRO.js";import"./chunk-VDNPMX5W.js";import"./chunk-W3GNV72O.js";import"./chunk-MUNBJIEX.js";import"./chunk-A4CHYJUQ.js";import"./chunk-6PNWMPY4.js";import"./chunk-VEVQB4CI.js";import"./chunk-KMAE5NUB.js";import"./chunk-SK2DTYBZ.js";import"./chunk-XWYUQMLN.js";import"./chunk-RKDS7A4H.js";import"./chunk-IVXR5JO2.js";import"./chunk-ROE5VZOU.js";import"./chunk-UGDAT4C4.js";import"./chunk-DECUAM3U.js";import"./chunk-LWVY42EK.js";import"./chunk-QXEU5WPV.js";import"./chunk-6EDEOERB.js";import"./chunk-XUB4JKSR.js";import"./chunk-R2EHHA2C.js";import"./chunk-SJYPUHXE.js";import"./chunk-ZIXAINJY.js";import"./chunk-HAALYXUJ.js";import"./chunk-ZOTKZI2P.js";import"./chunk-A6G5TAIF.js";import"./chunk-I7KO7V6B.js";import"./chunk-FIXDX63I.js";import"./chunk-T7CHK6C2.js";import"./chunk-R7YLOR6I.js";import"./chunk-QVPT37XZ.js";import"./chunk-BPDVCOZ5.js";import{readCronTasks}from"./chunk-DXUYBMFK.js";import"./chunk-MVGHVNW2.js";import"./chunk-MYPKMC5U.js";import"./chunk-B4ZATWBT.js";import"./chunk-PSKT6KWO.js";import"./chunk-KNIWP2YB.js";import"./chunk-UHJUDWBV.js";import"./chunk-BG67XABA.js";import"./chunk-ZQMSIRJV.js";import"./chunk-VMRQ6FA2.js";import"./chunk-OMBCQ6CU.js";import"./chunk-JB3XRNK7.js";import"./chunk-KTNQXX2N.js";import"./chunk-CV2UAEZA.js";import"./chunk-6RGS6DOB.js";import{DEFAULT_OTLP_ENDPOINT,DEFAULT_TELEMETRY_TARGET,initializeDaemonMetrics,recordDaemonCancel,recordDaemonChannelLifecycle,recordDaemonPipeMessage,recordDaemonPromptDuration,recordDaemonPromptQueueWait,recordDaemonSessionLifecycle,registerDaemonEventLoopLagGauge,registerDaemonGaugeCallbacks,resolveTelemetrySettings,startEventLoopLagMonitor}from"./chunk-6NQMNEZN.js";import"./chunk-PNF77EBK.js";import"./chunk-QEF4EGUP.js";import"./chunk-6XLIEJP5.js";import"./chunk-RGUKFSBS.js";import"./chunk-PHIPLV2I.js";import"./chunk-G5PYYZMM.js";import"./chunk-OBOU4ZZM.js";import"./chunk-D7XCQWP2.js";import"./chunk-AE5OMKRY.js";import"./chunk-PWOLGVA3.js";import"./chunk-FYFNRJO5.js";import"./chunk-CL2RUJMN.js";import"./chunk-2SU7MN4F.js";import"./chunk-JZK2WGXA.js";import"./chunk-MPHSE7M4.js";import"./chunk-S2ZKZXHX.js";import"./chunk-NNRKBCOC.js";import"./chunk-QL74SOQ5.js";import"./chunk-LMM27XGW.js";import"./chunk-CZI6AF2S.js";import"./chunk-744VRMDB.js";import"./chunk-GJ67UOXA.js";import"./chunk-IWT6YN3M.js";import"./chunk-7UK4WJWS.js";import"./chunk-UYYKHWZ6.js";import"./chunk-CJ24OR2E.js";import"./chunk-KBDJRE76.js";import"./chunk-4ZRCV3JY.js";import"./chunk-MTPKKEGR.js";import"./chunk-INLKQF24.js";import"./chunk-YGLM5XPP.js";import"./chunk-WGNF7FPC.js";import"./chunk-4NPYOXJO.js";import"./chunk-MWGB5RCF.js";import"./chunk-NTRFETZB.js";import"./chunk-LMJPU2JM.js";import"./chunk-LMUYQBL7.js";import"./chunk-3YWXKSOI.js";import"./chunk-2W7KMUTJ.js";import"./chunk-33P4RB6G.js";import"./chunk-RQHIWFQL.js";import"./chunk-BSFNCIBS.js";import"./chunk-DLFX4M6C.js";import"./chunk-5AORBHSX.js";import"./chunk-66UTCJN2.js";import"./chunk-WXQQVXYN.js";import"./chunk-AGEDDL7Z.js";import"./chunk-BN4FIQ77.js";import"./chunk-2TT7GTWH.js";import"./chunk-VFB6Q74I.js";import"./chunk-NSZJIBK7.js";import"./chunk-KLC75CL4.js";import{applyProviderInstallPlan,buildInstallPlan,findProviderById,getDefaultModelIds,getModelsForProviderProtocol,resolveBaseUrl}from"./chunk-N3AKLLXG.js";import"./chunk-KZSUHQLD.js";import"./chunk-476F6QIM.js";import"./chunk-A6LYTPBP.js";import"./chunk-R5AA46IX.js";import"./chunk-KNXXVHVG.js";import"./chunk-JEV36CS7.js";import"./chunk-W5NWIGKO.js";import"./chunk-CQGP2BAW.js";import"./chunk-PWOQASXT.js";import"./chunk-7XUYVD4W.js";import"./chunk-TQGZS3WN.js";import"./chunk-Z6AR5XE5.js";import"./chunk-NGXC4Y5Y.js";import"./chunk-JWTMTDHE.js";import"./chunk-EFTJIDS3.js";import"./chunk-SFDOJ2FF.js";import"./chunk-AZ4Q2ZWQ.js";import"./chunk-4ZBZL23U.js";import"./chunk-LNYY7GOJ.js";import"./chunk-E5XJBLSO.js";import"./chunk-RXKUQONJ.js";import"./chunk-2GF3E5MI.js";import"./chunk-2NJJHZ52.js";import"./chunk-X64RXJQQ.js";import"./chunk-Q6UAOTP3.js";import{createDaemonBridgeTelemetry,emitDaemonLog,hashDaemonWorkspace}from"./chunk-ZBWKMYJX.js";import"./chunk-XMANRGPK.js";import{forceFlushMetrics,initializeTelemetry,shutdownTelemetry}from"./chunk-UFRESHR3.js";import"./chunk-KQX4H2D3.js";import"./chunk-I7L2TX4M.js";import"./chunk-MK3OONRA.js";import"./chunk-COGTQ5KZ.js";import"./chunk-4JNHUZ7M.js";import"./chunk-SW54YEPK.js";import"./chunk-HJKG5VPJ.js";import"./chunk-RP57XAJ2.js";import"./chunk-7DOOXUDG.js";import"./chunk-HETUGUHE.js";import"./chunk-4DIWAQ5G.js";import"./chunk-EW6HVTD5.js";import"./chunk-DBRQGEEI.js";import"./chunk-AAMQ5CMG.js";import"./chunk-ZQMVXHGH.js";import"./chunk-4WFJ5OPA.js";import"./chunk-Y2OCBVI6.js";import"./chunk-TL3SF2GA.js";import"./chunk-LPUWZZK2.js";import"./chunk-LWVCLDHV.js";import"./chunk-JOJLS3IB.js";import"./chunk-5KGH76NL.js";import"./chunk-TM6ZCBR7.js";import"./chunk-I6S7NGX3.js";import"./chunk-SBZFGYYS.js";import"./chunk-XKCXQPE7.js";import"./chunk-3KUHQGOS.js";import"./chunk-46KPDLFH.js";import"./chunk-I4H7NUVP.js";import{Storage}from"./chunk-5VB4YX3Z.js";import"./chunk-2ZK2FGZQ.js";import{FatalConfigError}from"./chunk-E7MYPQGV.js";import"./chunk-2UOMCYQG.js";import"./chunk-YIW3H46P.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import"./chunk-KBWJGX7I.js";init_esbuild_shims();export{DEFAULT_OTLP_ENDPOINT,DEFAULT_TELEMETRY_TARGET,FatalConfigError,Storage,applyProviderInstallPlan,buildInstallPlan,createDaemonBridgeTelemetry,emitDaemonLog,findProviderById,forceFlushMetrics,getDefaultModelIds,getModelsForProviderProtocol,hashDaemonWorkspace,initializeDaemonMetrics,initializeTelemetry,readCronTasks,recordDaemonCancel,recordDaemonChannelLifecycle,recordDaemonPipeMessage,recordDaemonPromptDuration,recordDaemonPromptQueueWait,recordDaemonSessionLifecycle,registerDaemonEventLoopLagGauge,registerDaemonGaugeCallbacks,resolveBaseUrl,resolveTelemetrySettings,shutdownTelemetry,startEventLoopLagMonitor};
3
+ import"./chunk-CXPRHT3E.js";import"./chunk-QS2ZMQIS.js";import"./chunk-S7IKHQ6I.js";import"./chunk-NKU3HS2G.js";import"./chunk-MD3ZEOBX.js";import"./chunk-J6X2K3AT.js";import"./chunk-QWGJ6NGH.js";import"./chunk-NGQDWVC6.js";import"./chunk-46VUDNCL.js";import"./chunk-UNDRWCST.js";import"./chunk-6KU7LHBT.js";import"./chunk-IMTHBYJP.js";import"./chunk-FZQJOSHD.js";import"./chunk-W3GNV72O.js";import"./chunk-MUNBJIEX.js";import"./chunk-A4CHYJUQ.js";import"./chunk-6PNWMPY4.js";import"./chunk-NDTPBVER.js";import"./chunk-KMAE5NUB.js";import"./chunk-URMRX2MG.js";import"./chunk-XWYUQMLN.js";import"./chunk-RKDS7A4H.js";import"./chunk-WFJHBU7B.js";import"./chunk-ROE5VZOU.js";import"./chunk-UGDAT4C4.js";import"./chunk-DECUAM3U.js";import"./chunk-LWVY42EK.js";import"./chunk-QXEU5WPV.js";import"./chunk-6EDEOERB.js";import"./chunk-3NR3JBMA.js";import"./chunk-R2EHHA2C.js";import"./chunk-SJYPUHXE.js";import"./chunk-ZIXAINJY.js";import"./chunk-HAALYXUJ.js";import"./chunk-ZOTKZI2P.js";import"./chunk-A6G5TAIF.js";import"./chunk-I7KO7V6B.js";import"./chunk-FIXDX63I.js";import"./chunk-T7CHK6C2.js";import"./chunk-R7YLOR6I.js";import"./chunk-QVPT37XZ.js";import"./chunk-BPDVCOZ5.js";import{readCronTasks}from"./chunk-DXUYBMFK.js";import"./chunk-MVGHVNW2.js";import"./chunk-MYPKMC5U.js";import"./chunk-B4ZATWBT.js";import"./chunk-PSKT6KWO.js";import"./chunk-KNIWP2YB.js";import"./chunk-UHJUDWBV.js";import"./chunk-BG67XABA.js";import"./chunk-ZQMSIRJV.js";import"./chunk-VMRQ6FA2.js";import"./chunk-OMBCQ6CU.js";import"./chunk-JB3XRNK7.js";import"./chunk-KTNQXX2N.js";import"./chunk-CV2UAEZA.js";import"./chunk-6RGS6DOB.js";import{DEFAULT_OTLP_ENDPOINT,DEFAULT_TELEMETRY_TARGET,initializeDaemonMetrics,recordDaemonCancel,recordDaemonChannelLifecycle,recordDaemonPipeMessage,recordDaemonPromptDuration,recordDaemonPromptQueueWait,recordDaemonSessionLifecycle,registerDaemonEventLoopLagGauge,registerDaemonGaugeCallbacks,resolveTelemetrySettings,startEventLoopLagMonitor}from"./chunk-6NQMNEZN.js";import"./chunk-PNF77EBK.js";import"./chunk-QEF4EGUP.js";import"./chunk-6XLIEJP5.js";import"./chunk-RGUKFSBS.js";import"./chunk-PHIPLV2I.js";import"./chunk-G5PYYZMM.js";import"./chunk-OBOU4ZZM.js";import"./chunk-D7XCQWP2.js";import"./chunk-AE5OMKRY.js";import"./chunk-PWOLGVA3.js";import"./chunk-FYFNRJO5.js";import"./chunk-CL2RUJMN.js";import"./chunk-2SU7MN4F.js";import"./chunk-JZK2WGXA.js";import"./chunk-MPHSE7M4.js";import"./chunk-S2ZKZXHX.js";import"./chunk-NNRKBCOC.js";import"./chunk-QL74SOQ5.js";import"./chunk-LMM27XGW.js";import"./chunk-CZI6AF2S.js";import"./chunk-744VRMDB.js";import"./chunk-GJ67UOXA.js";import"./chunk-IWT6YN3M.js";import"./chunk-7UK4WJWS.js";import"./chunk-UYYKHWZ6.js";import"./chunk-CJ24OR2E.js";import"./chunk-KBDJRE76.js";import"./chunk-4ZRCV3JY.js";import"./chunk-MTPKKEGR.js";import"./chunk-INLKQF24.js";import"./chunk-YGLM5XPP.js";import"./chunk-WGNF7FPC.js";import"./chunk-4NPYOXJO.js";import"./chunk-MWGB5RCF.js";import"./chunk-NTRFETZB.js";import"./chunk-LMJPU2JM.js";import"./chunk-LMUYQBL7.js";import"./chunk-3YWXKSOI.js";import"./chunk-2W7KMUTJ.js";import"./chunk-33P4RB6G.js";import"./chunk-RQHIWFQL.js";import"./chunk-BSFNCIBS.js";import"./chunk-DLFX4M6C.js";import"./chunk-5AORBHSX.js";import"./chunk-66UTCJN2.js";import"./chunk-WXQQVXYN.js";import"./chunk-AGEDDL7Z.js";import"./chunk-BN4FIQ77.js";import"./chunk-2TT7GTWH.js";import"./chunk-VFB6Q74I.js";import"./chunk-NSZJIBK7.js";import"./chunk-KLC75CL4.js";import{applyProviderInstallPlan,buildInstallPlan,findProviderById,getDefaultModelIds,getModelsForProviderProtocol,resolveBaseUrl}from"./chunk-N3AKLLXG.js";import"./chunk-KZSUHQLD.js";import"./chunk-476F6QIM.js";import"./chunk-A6LYTPBP.js";import"./chunk-R5AA46IX.js";import"./chunk-KNXXVHVG.js";import"./chunk-JEV36CS7.js";import"./chunk-W5NWIGKO.js";import"./chunk-CQGP2BAW.js";import"./chunk-PWOQASXT.js";import"./chunk-7XUYVD4W.js";import"./chunk-TQGZS3WN.js";import"./chunk-Z6AR5XE5.js";import"./chunk-NGXC4Y5Y.js";import"./chunk-JWTMTDHE.js";import"./chunk-EFTJIDS3.js";import"./chunk-DN4QKOFL.js";import"./chunk-AZ4Q2ZWQ.js";import"./chunk-4ZBZL23U.js";import"./chunk-LNYY7GOJ.js";import"./chunk-E5XJBLSO.js";import"./chunk-RXKUQONJ.js";import"./chunk-2GF3E5MI.js";import"./chunk-2NJJHZ52.js";import"./chunk-X64RXJQQ.js";import"./chunk-Q6UAOTP3.js";import{createDaemonBridgeTelemetry,emitDaemonLog,hashDaemonWorkspace}from"./chunk-ZBWKMYJX.js";import"./chunk-XMANRGPK.js";import{forceFlushMetrics,initializeTelemetry,shutdownTelemetry}from"./chunk-UFRESHR3.js";import"./chunk-KQX4H2D3.js";import"./chunk-I7L2TX4M.js";import"./chunk-MK3OONRA.js";import"./chunk-COGTQ5KZ.js";import"./chunk-4JNHUZ7M.js";import"./chunk-SW54YEPK.js";import"./chunk-HJKG5VPJ.js";import"./chunk-RP57XAJ2.js";import"./chunk-7DOOXUDG.js";import"./chunk-HETUGUHE.js";import"./chunk-4DIWAQ5G.js";import"./chunk-EW6HVTD5.js";import"./chunk-DBRQGEEI.js";import"./chunk-AAMQ5CMG.js";import"./chunk-ZQMVXHGH.js";import"./chunk-4WFJ5OPA.js";import"./chunk-Y2OCBVI6.js";import"./chunk-TL3SF2GA.js";import"./chunk-LPUWZZK2.js";import"./chunk-LWVCLDHV.js";import"./chunk-JOJLS3IB.js";import"./chunk-5KGH76NL.js";import"./chunk-TM6ZCBR7.js";import"./chunk-I6S7NGX3.js";import"./chunk-SBZFGYYS.js";import"./chunk-XKCXQPE7.js";import"./chunk-3KUHQGOS.js";import"./chunk-46KPDLFH.js";import"./chunk-I4H7NUVP.js";import{Storage}from"./chunk-5VB4YX3Z.js";import"./chunk-2ZK2FGZQ.js";import{FatalConfigError}from"./chunk-E7MYPQGV.js";import"./chunk-2UOMCYQG.js";import"./chunk-YIW3H46P.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import"./chunk-KBWJGX7I.js";init_esbuild_shims();export{DEFAULT_OTLP_ENDPOINT,DEFAULT_TELEMETRY_TARGET,FatalConfigError,Storage,applyProviderInstallPlan,buildInstallPlan,createDaemonBridgeTelemetry,emitDaemonLog,findProviderById,forceFlushMetrics,getDefaultModelIds,getModelsForProviderProtocol,hashDaemonWorkspace,initializeDaemonMetrics,initializeTelemetry,readCronTasks,recordDaemonCancel,recordDaemonChannelLifecycle,recordDaemonPipeMessage,recordDaemonPromptDuration,recordDaemonPromptQueueWait,recordDaemonSessionLifecycle,registerDaemonEventLoopLagGauge,registerDaemonGaugeCallbacks,resolveBaseUrl,resolveTelemetrySettings,shutdownTelemetry,startEventLoopLagMonitor};
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2026 Qwen Team