@sinm/kai 1.10.2 → 1.10.3

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 (133) hide show
  1. package/dist-cli/kai-cli.js +1608 -1010
  2. package/dist-electron/renderer/assets/{_baseUniq-DXQms1uJ.js → _baseUniq-Dt9qXP29.js} +1 -1
  3. package/dist-electron/renderer/assets/_baseUniq-Dt9qXP29.js.gz +0 -0
  4. package/dist-electron/renderer/assets/{arc-BzUtcsT6.js → arc-RsiBQoWi.js} +1 -1
  5. package/dist-electron/renderer/assets/arc-RsiBQoWi.js.gz +0 -0
  6. package/dist-electron/renderer/assets/{architectureDiagram-Q4EWVU46-DWhLXXBB.js → architectureDiagram-Q4EWVU46-JhFDZdkM.js} +5 -5
  7. package/dist-electron/renderer/assets/architectureDiagram-Q4EWVU46-JhFDZdkM.js.gz +0 -0
  8. package/dist-electron/renderer/assets/{blockDiagram-DXYQGD6D-4chZr0B3.js → blockDiagram-DXYQGD6D-B86rt-OM.js} +6 -6
  9. package/dist-electron/renderer/assets/blockDiagram-DXYQGD6D-B86rt-OM.js.gz +0 -0
  10. package/dist-electron/renderer/assets/{c4Diagram-AHTNJAMY-B57DWDB5.js → c4Diagram-AHTNJAMY-BQCHj6of.js} +2 -2
  11. package/dist-electron/renderer/assets/c4Diagram-AHTNJAMY-BQCHj6of.js.gz +0 -0
  12. package/dist-electron/renderer/assets/{channel-CK8jbeS3.js → channel-CC4z4GJI.js} +1 -1
  13. package/dist-electron/renderer/assets/{chunk-4BX2VUAB-DJhRXS5K.js → chunk-4BX2VUAB-BVP9T2Dh.js} +1 -1
  14. package/dist-electron/renderer/assets/{chunk-4TB4RGXK-BaFYK52i.js → chunk-4TB4RGXK-CiPR4mxA.js} +5 -5
  15. package/dist-electron/renderer/assets/chunk-4TB4RGXK-CiPR4mxA.js.gz +0 -0
  16. package/dist-electron/renderer/assets/{chunk-55IACEB6-DjaH1FL_.js → chunk-55IACEB6-DFn516zY.js} +1 -1
  17. package/dist-electron/renderer/assets/{chunk-EDXVE4YY-K-LdDCd1.js → chunk-EDXVE4YY-CGRKmQT3.js} +1 -1
  18. package/dist-electron/renderer/assets/chunk-EDXVE4YY-CGRKmQT3.js.gz +0 -0
  19. package/dist-electron/renderer/assets/{chunk-FMBD7UC4-DzGM7STk.js → chunk-FMBD7UC4-BmRxbPzV.js} +1 -1
  20. package/dist-electron/renderer/assets/{chunk-OYMX7WX6-CLJ8M1Y6.js → chunk-OYMX7WX6-Dk-Q7zf7.js} +3 -3
  21. package/dist-electron/renderer/assets/chunk-OYMX7WX6-Dk-Q7zf7.js.gz +0 -0
  22. package/dist-electron/renderer/assets/{chunk-QZHKN3VN-CbcXgYrp.js → chunk-QZHKN3VN-CZqi7zia.js} +1 -1
  23. package/dist-electron/renderer/assets/{chunk-YZCP3GAM-DG6A2gPT.js → chunk-YZCP3GAM-BTonv1NP.js} +1 -1
  24. package/dist-electron/renderer/assets/chunk-YZCP3GAM-BTonv1NP.js.gz +0 -0
  25. package/dist-electron/renderer/assets/{classDiagram-6PBFFD2Q-C516x-2x.js → classDiagram-6PBFFD2Q-CLrLTGbu.js} +6 -6
  26. package/dist-electron/renderer/assets/{classDiagram-v2-HSJHXN6E-C516x-2x.js → classDiagram-v2-HSJHXN6E-CLrLTGbu.js} +6 -6
  27. package/dist-electron/renderer/assets/{clone-BZsfBfGE.js → clone-_36aVKDg.js} +1 -1
  28. package/dist-electron/renderer/assets/{cose-bilkent-S5V4N54A-Wa-FYjHx.js → cose-bilkent-S5V4N54A-C3iQr7P0.js} +1 -1
  29. package/dist-electron/renderer/assets/cose-bilkent-S5V4N54A-C3iQr7P0.js.gz +0 -0
  30. package/dist-electron/renderer/assets/{dagre-KV5264BT-Df-HS0DT.js → dagre-KV5264BT-C5t353zi.js} +6 -6
  31. package/dist-electron/renderer/assets/dagre-KV5264BT-C5t353zi.js.gz +0 -0
  32. package/dist-electron/renderer/assets/{diagram-5BDNPKRD-CaZsWnM2.js → diagram-5BDNPKRD-BeuTiBNY.js} +6 -6
  33. package/dist-electron/renderer/assets/diagram-5BDNPKRD-BeuTiBNY.js.gz +0 -0
  34. package/dist-electron/renderer/assets/{diagram-G4DWMVQ6-0B-U8e4R.js → diagram-G4DWMVQ6-BNAzh5ef.js} +6 -6
  35. package/dist-electron/renderer/assets/diagram-G4DWMVQ6-BNAzh5ef.js.gz +0 -0
  36. package/dist-electron/renderer/assets/{diagram-MMDJMWI5-Byvl-KNj.js → diagram-MMDJMWI5-ByaaDyoH.js} +5 -5
  37. package/dist-electron/renderer/assets/diagram-MMDJMWI5-ByaaDyoH.js.gz +0 -0
  38. package/dist-electron/renderer/assets/{diagram-TYMM5635-Dgy-yPsr.js → diagram-TYMM5635-DAsU-q28.js} +5 -5
  39. package/dist-electron/renderer/assets/diagram-TYMM5635-DAsU-q28.js.gz +0 -0
  40. package/dist-electron/renderer/assets/{erDiagram-SMLLAGMA-CkzvnQaU.js → erDiagram-SMLLAGMA-D0srSDPs.js} +4 -4
  41. package/dist-electron/renderer/assets/erDiagram-SMLLAGMA-D0srSDPs.js.gz +0 -0
  42. package/dist-electron/renderer/assets/{flowDiagram-DWJPFMVM-B5k0WctR.js → flowDiagram-DWJPFMVM-Br3VuPsd.js} +6 -6
  43. package/dist-electron/renderer/assets/flowDiagram-DWJPFMVM-Br3VuPsd.js.gz +0 -0
  44. package/dist-electron/renderer/assets/{ganttDiagram-T4ZO3ILL-C2pFdr_b.js → ganttDiagram-T4ZO3ILL-D09E8Ld2.js} +2 -2
  45. package/dist-electron/renderer/assets/ganttDiagram-T4ZO3ILL-D09E8Ld2.js.gz +0 -0
  46. package/dist-electron/renderer/assets/{gitGraphDiagram-UUTBAWPF-CJdXKPsy.js → gitGraphDiagram-UUTBAWPF-CKplsNll.js} +6 -6
  47. package/dist-electron/renderer/assets/gitGraphDiagram-UUTBAWPF-CKplsNll.js.gz +0 -0
  48. package/dist-electron/renderer/assets/{graph-_80OeAYU.js → graph-BTPzdQjH.js} +2 -2
  49. package/dist-electron/renderer/assets/graph-BTPzdQjH.js.gz +0 -0
  50. package/dist-electron/renderer/assets/{index-DCzIql_d.css → index-B2vb2ykm.css} +244 -207
  51. package/dist-electron/renderer/assets/index-B2vb2ykm.css.gz +0 -0
  52. package/dist-electron/renderer/assets/{index-Cs0m4pX4.js → index-D4EitlLm.js} +920 -388
  53. package/dist-electron/renderer/assets/index-D4EitlLm.js.gz +0 -0
  54. package/dist-electron/renderer/assets/{infoDiagram-42DDH7IO-CUBNnXNy.js → infoDiagram-42DDH7IO-VNZjK26Z.js} +4 -4
  55. package/dist-electron/renderer/assets/{ishikawaDiagram-UXIWVN3A-Blfv83uV.js → ishikawaDiagram-UXIWVN3A-DNQZ_EJr.js} +1 -1
  56. package/dist-electron/renderer/assets/ishikawaDiagram-UXIWVN3A-DNQZ_EJr.js.gz +0 -0
  57. package/dist-electron/renderer/assets/{journeyDiagram-VCZTEJTY-CTytCzzg.js → journeyDiagram-VCZTEJTY-4mieWisO.js} +4 -4
  58. package/dist-electron/renderer/assets/journeyDiagram-VCZTEJTY-4mieWisO.js.gz +0 -0
  59. package/dist-electron/renderer/assets/{kanban-definition-6JOO6SKY-CJ9BZQW-.js → kanban-definition-6JOO6SKY-Cm91R9mn.js} +2 -2
  60. package/dist-electron/renderer/assets/kanban-definition-6JOO6SKY-Cm91R9mn.js.gz +0 -0
  61. package/dist-electron/renderer/assets/{layout-sSswHT98.js → layout-sDMER76e.js} +4 -4
  62. package/dist-electron/renderer/assets/layout-sDMER76e.js.gz +0 -0
  63. package/dist-electron/renderer/assets/{linear-BglvYbbf.js → linear-BJZxaeHe.js} +1 -1
  64. package/dist-electron/renderer/assets/linear-BJZxaeHe.js.gz +0 -0
  65. package/dist-electron/renderer/assets/{min-Bzyu3TW9.js → min-CihovUOT.js} +2 -2
  66. package/dist-electron/renderer/assets/min-CihovUOT.js.gz +0 -0
  67. package/dist-electron/renderer/assets/{mindmap-definition-QFDTVHPH-Dvudei3d.js → mindmap-definition-QFDTVHPH-BWSrGBRN.js} +3 -3
  68. package/dist-electron/renderer/assets/mindmap-definition-QFDTVHPH-BWSrGBRN.js.gz +0 -0
  69. package/dist-electron/renderer/assets/{pieDiagram-DEJITSTG-LipgyJMA.js → pieDiagram-DEJITSTG-5w5tVLFj.js} +6 -6
  70. package/dist-electron/renderer/assets/pieDiagram-DEJITSTG-5w5tVLFj.js.gz +0 -0
  71. package/dist-electron/renderer/assets/{quadrantDiagram-34T5L4WZ-BsvYEtIZ.js → quadrantDiagram-34T5L4WZ-B5GobzTO.js} +2 -2
  72. package/dist-electron/renderer/assets/quadrantDiagram-34T5L4WZ-B5GobzTO.js.gz +0 -0
  73. package/dist-electron/renderer/assets/{requirementDiagram-MS252O5E-BnabpcqK.js → requirementDiagram-MS252O5E-EEt0fiRz.js} +3 -3
  74. package/dist-electron/renderer/assets/requirementDiagram-MS252O5E-EEt0fiRz.js.gz +0 -0
  75. package/dist-electron/renderer/assets/{sankeyDiagram-XADWPNL6-BuCgq17Q.js → sankeyDiagram-XADWPNL6-Osa6Eix6.js} +1 -1
  76. package/dist-electron/renderer/assets/sankeyDiagram-XADWPNL6-Osa6Eix6.js.gz +0 -0
  77. package/dist-electron/renderer/assets/{sequenceDiagram-FGHM5R23-CtGBoKet.js → sequenceDiagram-FGHM5R23-0i-4BqN-.js} +3 -3
  78. package/dist-electron/renderer/assets/sequenceDiagram-FGHM5R23-0i-4BqN-.js.gz +0 -0
  79. package/dist-electron/renderer/assets/{stateDiagram-FHFEXIEX-DYwbJ7V6.js → stateDiagram-FHFEXIEX-DX08_hh3.js} +8 -8
  80. package/dist-electron/renderer/assets/stateDiagram-FHFEXIEX-DX08_hh3.js.gz +0 -0
  81. package/dist-electron/renderer/assets/{stateDiagram-v2-QKLJ7IA2-CtQIhDqi.js → stateDiagram-v2-QKLJ7IA2-CP3UU-ar.js} +4 -4
  82. package/dist-electron/renderer/assets/{timeline-definition-GMOUNBTQ-Dg1mahK3.js → timeline-definition-GMOUNBTQ-Bn7U0euE.js} +2 -2
  83. package/dist-electron/renderer/assets/timeline-definition-GMOUNBTQ-Bn7U0euE.js.gz +0 -0
  84. package/dist-electron/renderer/assets/{vennDiagram-DHZGUBPP-CdFh8oWQ.js → vennDiagram-DHZGUBPP-ChvNdQSo.js} +1 -1
  85. package/dist-electron/renderer/assets/vennDiagram-DHZGUBPP-ChvNdQSo.js.gz +0 -0
  86. package/dist-electron/renderer/assets/{wardley-RL74JXVD-CQzndBZX.js → wardley-RL74JXVD-BF3DE4pq.js} +3 -3
  87. package/dist-electron/renderer/assets/wardley-RL74JXVD-BF3DE4pq.js.gz +0 -0
  88. package/dist-electron/renderer/assets/{wardleyDiagram-NUSXRM2D-BUhyPKXM.js → wardleyDiagram-NUSXRM2D-BoIeDdfp.js} +5 -5
  89. package/dist-electron/renderer/assets/wardleyDiagram-NUSXRM2D-BoIeDdfp.js.gz +0 -0
  90. package/dist-electron/renderer/assets/{xychartDiagram-5P7HB3ND-CwTHSfES.js → xychartDiagram-5P7HB3ND-D5C0kytw.js} +2 -2
  91. package/dist-electron/renderer/assets/xychartDiagram-5P7HB3ND-D5C0kytw.js.gz +0 -0
  92. package/dist-electron/renderer/index.html +2 -2
  93. package/package.json +3 -3
  94. package/dist-electron/renderer/assets/_baseUniq-DXQms1uJ.js.gz +0 -0
  95. package/dist-electron/renderer/assets/arc-BzUtcsT6.js.gz +0 -0
  96. package/dist-electron/renderer/assets/architectureDiagram-Q4EWVU46-DWhLXXBB.js.gz +0 -0
  97. package/dist-electron/renderer/assets/blockDiagram-DXYQGD6D-4chZr0B3.js.gz +0 -0
  98. package/dist-electron/renderer/assets/c4Diagram-AHTNJAMY-B57DWDB5.js.gz +0 -0
  99. package/dist-electron/renderer/assets/chunk-4TB4RGXK-BaFYK52i.js.gz +0 -0
  100. package/dist-electron/renderer/assets/chunk-EDXVE4YY-K-LdDCd1.js.gz +0 -0
  101. package/dist-electron/renderer/assets/chunk-OYMX7WX6-CLJ8M1Y6.js.gz +0 -0
  102. package/dist-electron/renderer/assets/chunk-YZCP3GAM-DG6A2gPT.js.gz +0 -0
  103. package/dist-electron/renderer/assets/cose-bilkent-S5V4N54A-Wa-FYjHx.js.gz +0 -0
  104. package/dist-electron/renderer/assets/dagre-KV5264BT-Df-HS0DT.js.gz +0 -0
  105. package/dist-electron/renderer/assets/diagram-5BDNPKRD-CaZsWnM2.js.gz +0 -0
  106. package/dist-electron/renderer/assets/diagram-G4DWMVQ6-0B-U8e4R.js.gz +0 -0
  107. package/dist-electron/renderer/assets/diagram-MMDJMWI5-Byvl-KNj.js.gz +0 -0
  108. package/dist-electron/renderer/assets/diagram-TYMM5635-Dgy-yPsr.js.gz +0 -0
  109. package/dist-electron/renderer/assets/erDiagram-SMLLAGMA-CkzvnQaU.js.gz +0 -0
  110. package/dist-electron/renderer/assets/flowDiagram-DWJPFMVM-B5k0WctR.js.gz +0 -0
  111. package/dist-electron/renderer/assets/ganttDiagram-T4ZO3ILL-C2pFdr_b.js.gz +0 -0
  112. package/dist-electron/renderer/assets/gitGraphDiagram-UUTBAWPF-CJdXKPsy.js.gz +0 -0
  113. package/dist-electron/renderer/assets/graph-_80OeAYU.js.gz +0 -0
  114. package/dist-electron/renderer/assets/index-Cs0m4pX4.js.gz +0 -0
  115. package/dist-electron/renderer/assets/index-DCzIql_d.css.gz +0 -0
  116. package/dist-electron/renderer/assets/ishikawaDiagram-UXIWVN3A-Blfv83uV.js.gz +0 -0
  117. package/dist-electron/renderer/assets/journeyDiagram-VCZTEJTY-CTytCzzg.js.gz +0 -0
  118. package/dist-electron/renderer/assets/kanban-definition-6JOO6SKY-CJ9BZQW-.js.gz +0 -0
  119. package/dist-electron/renderer/assets/layout-sSswHT98.js.gz +0 -0
  120. package/dist-electron/renderer/assets/linear-BglvYbbf.js.gz +0 -0
  121. package/dist-electron/renderer/assets/min-Bzyu3TW9.js.gz +0 -0
  122. package/dist-electron/renderer/assets/mindmap-definition-QFDTVHPH-Dvudei3d.js.gz +0 -0
  123. package/dist-electron/renderer/assets/pieDiagram-DEJITSTG-LipgyJMA.js.gz +0 -0
  124. package/dist-electron/renderer/assets/quadrantDiagram-34T5L4WZ-BsvYEtIZ.js.gz +0 -0
  125. package/dist-electron/renderer/assets/requirementDiagram-MS252O5E-BnabpcqK.js.gz +0 -0
  126. package/dist-electron/renderer/assets/sankeyDiagram-XADWPNL6-BuCgq17Q.js.gz +0 -0
  127. package/dist-electron/renderer/assets/sequenceDiagram-FGHM5R23-CtGBoKet.js.gz +0 -0
  128. package/dist-electron/renderer/assets/stateDiagram-FHFEXIEX-DYwbJ7V6.js.gz +0 -0
  129. package/dist-electron/renderer/assets/timeline-definition-GMOUNBTQ-Dg1mahK3.js.gz +0 -0
  130. package/dist-electron/renderer/assets/vennDiagram-DHZGUBPP-CdFh8oWQ.js.gz +0 -0
  131. package/dist-electron/renderer/assets/wardley-RL74JXVD-CQzndBZX.js.gz +0 -0
  132. package/dist-electron/renderer/assets/wardleyDiagram-NUSXRM2D-BUhyPKXM.js.gz +0 -0
  133. package/dist-electron/renderer/assets/xychartDiagram-5P7HB3ND-CwTHSfES.js.gz +0 -0
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dagre-KV5264BT-Df-HS0DT.js","./graph-_80OeAYU.js","./_baseUniq-DXQms1uJ.js","./layout-sSswHT98.js","./min-Bzyu3TW9.js","./clone-BZsfBfGE.js","./cose-bilkent-S5V4N54A-Wa-FYjHx.js","./cytoscape.esm-D6E6cAed.js","./c4Diagram-AHTNJAMY-B57DWDB5.js","./chunk-YZCP3GAM-DG6A2gPT.js","./flowDiagram-DWJPFMVM-B5k0WctR.js","./chunk-FMBD7UC4-DzGM7STk.js","./chunk-55IACEB6-DjaH1FL_.js","./chunk-EDXVE4YY-K-LdDCd1.js","./channel-CK8jbeS3.js","./erDiagram-SMLLAGMA-CkzvnQaU.js","./gitGraphDiagram-UUTBAWPF-CJdXKPsy.js","./chunk-4BX2VUAB-DJhRXS5K.js","./chunk-QZHKN3VN-CbcXgYrp.js","./wardley-RL74JXVD-CQzndBZX.js","./ganttDiagram-T4ZO3ILL-C2pFdr_b.js","./linear-BglvYbbf.js","./init-ZxktEp_H.js","./defaultLocale-B2RvLBDe.js","./infoDiagram-42DDH7IO-CUBNnXNy.js","./pieDiagram-DEJITSTG-LipgyJMA.js","./arc-BzUtcsT6.js","./ordinal-CxptdPJm.js","./quadrantDiagram-34T5L4WZ-BsvYEtIZ.js","./xychartDiagram-5P7HB3ND-CwTHSfES.js","./requirementDiagram-MS252O5E-BnabpcqK.js","./sequenceDiagram-FGHM5R23-CtGBoKet.js","./classDiagram-6PBFFD2Q-C516x-2x.js","./chunk-4TB4RGXK-BaFYK52i.js","./classDiagram-v2-HSJHXN6E-C516x-2x.js","./stateDiagram-FHFEXIEX-DYwbJ7V6.js","./chunk-OYMX7WX6-CLJ8M1Y6.js","./stateDiagram-v2-QKLJ7IA2-CtQIhDqi.js","./journeyDiagram-VCZTEJTY-CTytCzzg.js","./timeline-definition-GMOUNBTQ-Dg1mahK3.js","./mindmap-definition-QFDTVHPH-Dvudei3d.js","./kanban-definition-6JOO6SKY-CJ9BZQW-.js","./sankeyDiagram-XADWPNL6-BuCgq17Q.js","./diagram-TYMM5635-Dgy-yPsr.js","./diagram-MMDJMWI5-Byvl-KNj.js","./blockDiagram-DXYQGD6D-4chZr0B3.js","./diagram-5BDNPKRD-CaZsWnM2.js","./architectureDiagram-Q4EWVU46-DWhLXXBB.js","./diagram-G4DWMVQ6-0B-U8e4R.js","./wardleyDiagram-NUSXRM2D-BUhyPKXM.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dagre-KV5264BT-C5t353zi.js","./graph-BTPzdQjH.js","./_baseUniq-Dt9qXP29.js","./layout-sDMER76e.js","./min-CihovUOT.js","./clone-_36aVKDg.js","./cose-bilkent-S5V4N54A-C3iQr7P0.js","./cytoscape.esm-D6E6cAed.js","./c4Diagram-AHTNJAMY-BQCHj6of.js","./chunk-YZCP3GAM-BTonv1NP.js","./flowDiagram-DWJPFMVM-Br3VuPsd.js","./chunk-FMBD7UC4-BmRxbPzV.js","./chunk-55IACEB6-DFn516zY.js","./chunk-EDXVE4YY-CGRKmQT3.js","./channel-CC4z4GJI.js","./erDiagram-SMLLAGMA-D0srSDPs.js","./gitGraphDiagram-UUTBAWPF-CKplsNll.js","./chunk-4BX2VUAB-BVP9T2Dh.js","./chunk-QZHKN3VN-CZqi7zia.js","./wardley-RL74JXVD-BF3DE4pq.js","./ganttDiagram-T4ZO3ILL-D09E8Ld2.js","./linear-BJZxaeHe.js","./init-ZxktEp_H.js","./defaultLocale-B2RvLBDe.js","./infoDiagram-42DDH7IO-VNZjK26Z.js","./pieDiagram-DEJITSTG-5w5tVLFj.js","./arc-RsiBQoWi.js","./ordinal-CxptdPJm.js","./quadrantDiagram-34T5L4WZ-B5GobzTO.js","./xychartDiagram-5P7HB3ND-D5C0kytw.js","./requirementDiagram-MS252O5E-EEt0fiRz.js","./sequenceDiagram-FGHM5R23-0i-4BqN-.js","./classDiagram-6PBFFD2Q-CLrLTGbu.js","./chunk-4TB4RGXK-CiPR4mxA.js","./classDiagram-v2-HSJHXN6E-CLrLTGbu.js","./stateDiagram-FHFEXIEX-DX08_hh3.js","./chunk-OYMX7WX6-Dk-Q7zf7.js","./stateDiagram-v2-QKLJ7IA2-CP3UU-ar.js","./journeyDiagram-VCZTEJTY-4mieWisO.js","./timeline-definition-GMOUNBTQ-Bn7U0euE.js","./mindmap-definition-QFDTVHPH-BWSrGBRN.js","./kanban-definition-6JOO6SKY-Cm91R9mn.js","./sankeyDiagram-XADWPNL6-Osa6Eix6.js","./diagram-TYMM5635-DAsU-q28.js","./diagram-MMDJMWI5-ByaaDyoH.js","./blockDiagram-DXYQGD6D-B86rt-OM.js","./diagram-5BDNPKRD-BeuTiBNY.js","./architectureDiagram-Q4EWVU46-JhFDZdkM.js","./diagram-G4DWMVQ6-BNAzh5ef.js","./wardleyDiagram-NUSXRM2D-BoIeDdfp.js"])))=>i.map(i=>d[i]);
2
2
  function _mergeNamespaces(n2, m2) {
3
3
  for (var i2 = 0; i2 < m2.length; i2++) {
4
4
  const e2 = m2[i2];
@@ -17243,6 +17243,19 @@ function withBlockPending(block, isPending) {
17243
17243
  isPending
17244
17244
  };
17245
17245
  }
17246
+ function deriveMessageStatus(message2) {
17247
+ if (message2.senderRole !== "agent") return "completed";
17248
+ if (message2.status) return message2.status;
17249
+ if (message2.error) return "failed";
17250
+ if (message2.isStreaming) return "streaming";
17251
+ return "completed";
17252
+ }
17253
+ function isMessageStreaming(message2) {
17254
+ return deriveMessageStatus(message2) === "streaming";
17255
+ }
17256
+ function isMessageFailed(message2) {
17257
+ return deriveMessageStatus(message2) === "failed";
17258
+ }
17246
17259
  const BUFFER_TIMEOUT_MS = 3e4;
17247
17260
  const MAX_SEQ_GAP = 100;
17248
17261
  const state$2 = {
@@ -17812,11 +17825,20 @@ function projectSingleEvent(event, messagesMap, state2) {
17812
17825
  function projectSnapshot(event, messagesMap, state2) {
17813
17826
  const cid = event.sessionId;
17814
17827
  const current = messagesMap.get(cid) ?? /* @__PURE__ */ new Map();
17815
- const msgMap = mergeMessageMaps(current, event.messages);
17816
- const activeRunId = event.queue.activeRunId;
17828
+ const activeRun = event.runtime?.activeRun;
17829
+ const msgMap = mergeSnapshotMessages(current, event.messages, activeRun);
17830
+ const activeRunId = activeRun?.runId ?? event.queue.activeRunId;
17817
17831
  const existingMetrics = state2.runMetricsMap.get(cid);
17818
17832
  const runMetricsMap = /* @__PURE__ */ new Map();
17819
- if (activeRunId) {
17833
+ if (activeRun) {
17834
+ runMetricsMap.set(cid, {
17835
+ startedAt: activeRun.startedAt,
17836
+ ...activeRun.model !== void 0 ? { model: activeRun.model } : {},
17837
+ ...activeRun.fallback !== void 0 ? { fallback: activeRun.fallback } : {},
17838
+ ...activeRun.fallbackTransition !== void 0 ? { fallbackTransition: activeRun.fallbackTransition } : {},
17839
+ ...activeRun.usage !== void 0 ? { usage: activeRun.usage } : {}
17840
+ });
17841
+ } else if (activeRunId) {
17820
17842
  runMetricsMap.set(cid, existingMetrics ?? { startedAt: Date.now() });
17821
17843
  } else if (existingMetrics) {
17822
17844
  runMetricsMap.set(cid, void 0);
@@ -17829,11 +17851,47 @@ function projectSnapshot(event, messagesMap, state2) {
17829
17851
  sendingMap: /* @__PURE__ */ new Map([[cid, event.queue.running]]),
17830
17852
  loadingMap: /* @__PURE__ */ new Map([[cid, false]]),
17831
17853
  hasMoreMap: /* @__PURE__ */ new Map([[cid, event.hasMore]]),
17832
- activeRunIdMap: /* @__PURE__ */ new Map([[cid, event.queue.activeRunId]]),
17854
+ activeRunIdMap: /* @__PURE__ */ new Map([[cid, activeRunId]]),
17833
17855
  retryingMap: /* @__PURE__ */ new Map([[cid, null]]),
17834
17856
  runMetricsMap
17835
17857
  };
17836
17858
  }
17859
+ function mergeSnapshotMessages(current, incomingMessages, activeRun) {
17860
+ const normalizedMessages = incomingMessages.map((message2) => normalizeSnapshotMessage(message2, activeRun));
17861
+ const merged = mergeMessageMaps(current, normalizedMessages);
17862
+ for (const message2 of normalizedMessages) {
17863
+ const existing = current.get(message2.id);
17864
+ if (!shouldKeepRuntimeBlocks(existing, message2)) continue;
17865
+ merged.set(message2.id, {
17866
+ ...message2,
17867
+ blocks: existing.blocks,
17868
+ isStreaming: isRuntimeMessage(existing),
17869
+ status: mergeSnapshotStatus(existing, message2),
17870
+ runId: existing.runId ?? message2.runId,
17871
+ updatedAt: Math.max(existing.updatedAt, message2.updatedAt)
17872
+ });
17873
+ }
17874
+ return merged;
17875
+ }
17876
+ function normalizeSnapshotMessage(message2, activeRun) {
17877
+ if (!activeRun || message2.id !== activeRun.messageId) return message2;
17878
+ return withStreamingLifecycle({
17879
+ ...message2,
17880
+ runId: message2.runId ?? activeRun.runId
17881
+ });
17882
+ }
17883
+ function shouldKeepRuntimeBlocks(existing, incoming) {
17884
+ if (!existing) return false;
17885
+ if (!isRuntimeMessage(existing)) return false;
17886
+ return incoming.blocks.length === 0 || incoming.updatedAt < existing.updatedAt;
17887
+ }
17888
+ function isRuntimeMessage(message2) {
17889
+ return isMessageStreaming(message2) || hasPendingBlocks(message2.blocks);
17890
+ }
17891
+ function mergeSnapshotStatus(existing, incoming) {
17892
+ if (incoming.status === "streaming") return "streaming";
17893
+ return incoming.status;
17894
+ }
17837
17895
  function projectMessageAccepted(event, messagesMap, state2) {
17838
17896
  const cid = event.sessionId;
17839
17897
  const current = new Map(messagesMap.get(cid) ?? []);
@@ -17853,8 +17911,11 @@ function projectRunStarted(event, messagesMap) {
17853
17911
  const cid = event.sessionId;
17854
17912
  const current = new Map(messagesMap.get(cid) ?? []);
17855
17913
  const existing = current.get(event.messageId);
17914
+ if (existing && isStaleRunEventForTerminalMessage(existing, event.runId)) {
17915
+ return {};
17916
+ }
17856
17917
  if (!existing) {
17857
- current.set(event.messageId, {
17918
+ current.set(event.messageId, withStreamingLifecycle({
17858
17919
  id: event.messageId,
17859
17920
  sessionId: cid,
17860
17921
  senderId: event.agentId,
@@ -17862,17 +17923,21 @@ function projectRunStarted(event, messagesMap) {
17862
17923
  blocks: [],
17863
17924
  createdAt: event.createdAt,
17864
17925
  updatedAt: event.createdAt,
17865
- isStreaming: true,
17866
17926
  runId: event.runId
17867
- });
17927
+ }));
17868
17928
  } else {
17869
- current.set(event.messageId, { ...existing, isStreaming: true, runId: event.runId });
17929
+ current.set(event.messageId, withStreamingLifecycle({
17930
+ ...existing,
17931
+ runId: event.runId,
17932
+ error: void 0,
17933
+ updatedAt: event.createdAt
17934
+ }));
17870
17935
  }
17871
17936
  return {
17872
17937
  messagesMap: /* @__PURE__ */ new Map([[cid, current]]),
17873
17938
  activeRunIdMap: /* @__PURE__ */ new Map([[cid, event.runId]]),
17874
17939
  retryingMap: /* @__PURE__ */ new Map([[cid, null]]),
17875
- runMetricsMap: /* @__PURE__ */ new Map([[cid, { startedAt: Date.now() }]])
17940
+ runMetricsMap: /* @__PURE__ */ new Map([[cid, { startedAt: event.createdAt }]])
17876
17941
  };
17877
17942
  }
17878
17943
  function projectRunProgress(event, state2) {
@@ -17937,12 +18002,11 @@ function projectBlockUpdated(event, messagesMap, state2) {
17937
18002
  }
17938
18003
  const nextBlocks = applyBlockUpdate(previous2.blocks, event.block);
17939
18004
  const hasActiveRun = !!state2.activeRunIdMap.get(cid);
17940
- current.set(event.messageId, {
18005
+ current.set(event.messageId, withLegacyStreamingFlag({
17941
18006
  ...previous2,
17942
18007
  blocks: nextBlocks,
17943
- isStreaming: hasActiveRun || hasPendingBlocks(nextBlocks),
17944
18008
  updatedAt: Date.now()
17945
- });
18009
+ }, hasActiveRun || hasPendingBlocks(nextBlocks)));
17946
18010
  const newRevision = (state2.streamRevisionMap.get(cid) ?? 0) + 1;
17947
18011
  const newRevisionMap = new Map(state2.streamRevisionMap);
17948
18012
  newRevisionMap.set(cid, newRevision);
@@ -17972,12 +18036,11 @@ function projectNestedBlockUpdated(event, messagesMap, state2) {
17972
18036
  }
17973
18037
  const nextBlocks = applyNestedBlockUpdate(previous2.blocks, event.path, event.block);
17974
18038
  const hasActiveRun = !!state2.activeRunIdMap.get(cid);
17975
- current.set(event.messageId, {
18039
+ current.set(event.messageId, withLegacyStreamingFlag({
17976
18040
  ...previous2,
17977
18041
  blocks: nextBlocks,
17978
- isStreaming: hasActiveRun || hasPendingBlocks(nextBlocks),
17979
18042
  updatedAt: Date.now()
17980
- });
18043
+ }, hasActiveRun || hasPendingBlocks(nextBlocks)));
17981
18044
  const newRevision = (state2.streamRevisionMap.get(cid) ?? 0) + 1;
17982
18045
  const newRevisionMap = new Map(state2.streamRevisionMap);
17983
18046
  newRevisionMap.set(cid, newRevision);
@@ -17995,12 +18058,11 @@ function projectBroadcastResponseUpdated(event, messagesMap, state2) {
17995
18058
  }
17996
18059
  const nextBlocks = applyBroadcastResponsePatch(previous2.blocks, event.broadcastId, event.agentId, event.patch);
17997
18060
  const hasActiveRun = !!state2.activeRunIdMap.get(cid);
17998
- current.set(event.messageId, {
18061
+ current.set(event.messageId, withLegacyStreamingFlag({
17999
18062
  ...previous2,
18000
18063
  blocks: nextBlocks,
18001
- isStreaming: hasActiveRun || hasPendingBlocks(nextBlocks),
18002
18064
  updatedAt: Date.now()
18003
- });
18065
+ }, hasActiveRun || hasPendingBlocks(nextBlocks)));
18004
18066
  const newRevision = (state2.streamRevisionMap.get(cid) ?? 0) + 1;
18005
18067
  const newRevisionMap = new Map(state2.streamRevisionMap);
18006
18068
  newRevisionMap.set(cid, newRevision);
@@ -18013,13 +18075,16 @@ function projectRunRetrying(event, messagesMap, state2) {
18013
18075
  const cid = event.sessionId;
18014
18076
  const current = new Map(messagesMap.get(cid) ?? []);
18015
18077
  const previous2 = current.get(event.messageId);
18078
+ if (previous2 && isEventForDifferentRun(previous2, event.runId)) {
18079
+ return {};
18080
+ }
18016
18081
  if (previous2) {
18017
- current.set(event.messageId, {
18082
+ current.set(event.messageId, withStreamingLifecycle({
18018
18083
  ...previous2,
18019
18084
  blocks: [],
18020
- isStreaming: true,
18085
+ error: void 0,
18021
18086
  updatedAt: Date.now()
18022
- });
18087
+ }));
18023
18088
  }
18024
18089
  const newMetricsMap = new Map(state2.runMetricsMap);
18025
18090
  newMetricsMap.set(cid, { startedAt: Date.now() });
@@ -18033,19 +18098,22 @@ function projectRunTerminal(event, messagesMap, state2) {
18033
18098
  const cid = event.sessionId;
18034
18099
  const current = new Map(messagesMap.get(cid) ?? []);
18035
18100
  const previous2 = current.get(event.messageId);
18101
+ if (previous2 && isEventForDifferentRun(previous2, event.runId)) {
18102
+ return {};
18103
+ }
18036
18104
  if (previous2) {
18037
18105
  const nextBlocks = clearPendingBlocks(previous2.blocks);
18038
- current.set(event.messageId, {
18106
+ const status2 = statusForTerminalEvent(event);
18107
+ current.set(event.messageId, withTerminalLifecycle({
18039
18108
  ...previous2,
18040
18109
  blocks: nextBlocks,
18041
- ...event.type === "run.failed" ? { error: event.error } : {},
18110
+ ...event.type === "run.failed" ? { error: event.error } : { error: void 0 },
18042
18111
  ...event.type === "run.completed" && event.usage ? { usage: event.usage } : {},
18043
18112
  ..."durationMs" in event && event.durationMs !== void 0 ? { durationMs: event.durationMs } : {},
18044
18113
  ..."model" in event && event.model !== void 0 ? { model: event.model } : {},
18045
18114
  ..."fallback" in event && event.fallback !== void 0 ? { fallback: event.fallback } : {},
18046
- isStreaming: hasPendingBlocks(nextBlocks),
18047
18115
  updatedAt: Date.now()
18048
- });
18116
+ }, status2));
18049
18117
  }
18050
18118
  const newMetricsMap = new Map(state2.runMetricsMap);
18051
18119
  newMetricsMap.set(cid, void 0);
@@ -18056,6 +18124,43 @@ function projectRunTerminal(event, messagesMap, state2) {
18056
18124
  runMetricsMap: newMetricsMap
18057
18125
  };
18058
18126
  }
18127
+ function statusForTerminalEvent(event) {
18128
+ switch (event.type) {
18129
+ case "run.completed":
18130
+ return "completed";
18131
+ case "run.failed":
18132
+ return "failed";
18133
+ case "run.stopped":
18134
+ return "cancelled";
18135
+ }
18136
+ }
18137
+ function withStreamingLifecycle(message2) {
18138
+ return {
18139
+ ...message2,
18140
+ status: "streaming",
18141
+ isStreaming: true
18142
+ };
18143
+ }
18144
+ function withTerminalLifecycle(message2, status2) {
18145
+ return {
18146
+ ...message2,
18147
+ status: status2,
18148
+ isStreaming: false
18149
+ };
18150
+ }
18151
+ function withLegacyStreamingFlag(message2, isStreaming) {
18152
+ return {
18153
+ ...message2,
18154
+ isStreaming
18155
+ };
18156
+ }
18157
+ function isEventForDifferentRun(message2, runId) {
18158
+ return message2.runId !== void 0 && message2.runId !== runId;
18159
+ }
18160
+ function isStaleRunEventForTerminalMessage(message2, runId) {
18161
+ if (!isEventForDifferentRun(message2, runId)) return false;
18162
+ return message2.status === "completed" || message2.status === "failed" || message2.status === "cancelled";
18163
+ }
18059
18164
  function projectQueueUpdated(event, state2) {
18060
18165
  const wasRunning = state2.sendingMap.get(event.sessionId) ?? false;
18061
18166
  const isRunning = event.queue.running;
@@ -18125,6 +18230,10 @@ function setArrayMapValueIfChanged(map2, key, value2) {
18125
18230
  return new Map(map2).set(key, value2);
18126
18231
  }
18127
18232
  const pendingFetchBlocks = /* @__PURE__ */ new Map();
18233
+ const inFlightMessageFetches = /* @__PURE__ */ new Set();
18234
+ function getPendingFetchKey(sessionId, messageId) {
18235
+ return `${sessionId}::${messageId}`;
18236
+ }
18128
18237
  const useMessageStore = create$3((set2, get2) => ({
18129
18238
  // ─────────────────── 状态 ───────────────────
18130
18239
  messagesMap: /* @__PURE__ */ new Map(),
@@ -18164,7 +18273,7 @@ const useMessageStore = create$3((set2, get2) => ({
18164
18273
  const msgMap = state2.messagesMap.get(cid);
18165
18274
  if (msgMap) {
18166
18275
  for (const msg of msgMap.values()) {
18167
- if (msg.isStreaming || hasPendingBlocks(msg.blocks)) return "streaming";
18276
+ if (isMessageStreaming(msg)) return "streaming";
18168
18277
  }
18169
18278
  }
18170
18279
  return "idle";
@@ -18600,35 +18709,51 @@ function mapBroadcastStatus(status2) {
18600
18709
  }
18601
18710
  }
18602
18711
  function accumulatePendingBlock(params) {
18603
- const key = params.messageId;
18712
+ const key = getPendingFetchKey(params.sessionId, params.messageId);
18604
18713
  const blocks = pendingFetchBlocks.get(key) ?? [];
18605
18714
  blocks.push(params.block);
18606
18715
  pendingFetchBlocks.set(key, blocks);
18607
18716
  }
18608
18717
  function triggerFetch(sessionId, messageId) {
18609
- const blocks = pendingFetchBlocks.get(messageId);
18610
- if (blocks && blocks.length > 1) {
18611
- return;
18612
- }
18613
- fetchAndApplyMessage(sessionId, messageId);
18718
+ const key = getPendingFetchKey(sessionId, messageId);
18719
+ if (inFlightMessageFetches.has(key)) return;
18720
+ inFlightMessageFetches.add(key);
18721
+ void fetchAndApplyMessage(sessionId, messageId, key);
18614
18722
  }
18615
- async function fetchAndApplyMessage(sessionId, messageId) {
18616
- await new Promise((resolve) => requestAnimationFrame(resolve));
18617
- const blocks = pendingFetchBlocks.get(messageId);
18618
- if (!blocks || blocks.length === 0) return;
18619
- pendingFetchBlocks.delete(messageId);
18723
+ async function fetchAndApplyMessage(sessionId, messageId, key) {
18620
18724
  try {
18621
- const message2 = await getTransport().getMessage(messageId);
18622
- if (message2) {
18623
- let finalBlocks = message2.blocks;
18624
- for (const block of blocks) {
18625
- finalBlocks = applyBlockUpdate(finalBlocks, block);
18725
+ while (true) {
18726
+ await new Promise((resolve) => requestAnimationFrame(resolve));
18727
+ const blocks = pendingFetchBlocks.get(key);
18728
+ if (!blocks || blocks.length === 0) return;
18729
+ pendingFetchBlocks.delete(key);
18730
+ const message2 = await getTransport().getMessage(messageId);
18731
+ if (message2) {
18732
+ const currentMessage = useMessageStore.getState().messagesMap.get(sessionId)?.get(messageId);
18733
+ let finalBlocks = chooseFetchedBlockBase(currentMessage, message2);
18734
+ for (const block of blocks) {
18735
+ finalBlocks = applyBlockUpdate(finalBlocks, block);
18736
+ }
18737
+ useMessageStore.getState().addFetchedMessage(sessionId, { ...message2, blocks: finalBlocks });
18626
18738
  }
18627
- useMessageStore.getState().addFetchedMessage(sessionId, { ...message2, blocks: finalBlocks });
18628
18739
  }
18629
18740
  } catch (error2) {
18630
18741
  log$s.error("Failed to fetch message:", error2);
18742
+ } finally {
18743
+ inFlightMessageFetches.delete(key);
18744
+ if ((pendingFetchBlocks.get(key)?.length ?? 0) > 0) {
18745
+ triggerFetch(sessionId, messageId);
18746
+ }
18747
+ }
18748
+ }
18749
+ function chooseFetchedBlockBase(currentMessage, fetchedMessage) {
18750
+ if (!currentMessage) return fetchedMessage.blocks;
18751
+ const currentIsRuntime = isMessageStreaming(currentMessage) || hasPendingBlocks(currentMessage.blocks);
18752
+ const fetchedIsStale = fetchedMessage.blocks.length === 0 || fetchedMessage.updatedAt < currentMessage.updatedAt;
18753
+ if (currentIsRuntime && fetchedIsStale) {
18754
+ return currentMessage.blocks;
18631
18755
  }
18756
+ return fetchedMessage.blocks;
18632
18757
  }
18633
18758
  function mergeProjectionUpdate(state2, result) {
18634
18759
  const merged = {};
@@ -65158,12 +65283,12 @@ var registerDefaultLayoutLoaders = /* @__PURE__ */ __name(() => {
65158
65283
  registerLayoutLoaders([
65159
65284
  {
65160
65285
  name: "dagre",
65161
- loader: /* @__PURE__ */ __name(async () => await __vitePreload(() => import("./dagre-KV5264BT-Df-HS0DT.js"), true ? __vite__mapDeps([0,1,2,3,4,5]) : void 0, import.meta.url), "loader")
65286
+ loader: /* @__PURE__ */ __name(async () => await __vitePreload(() => import("./dagre-KV5264BT-C5t353zi.js"), true ? __vite__mapDeps([0,1,2,3,4,5]) : void 0, import.meta.url), "loader")
65162
65287
  },
65163
65288
  ...[
65164
65289
  {
65165
65290
  name: "cose-bilkent",
65166
- loader: /* @__PURE__ */ __name(async () => await __vitePreload(() => import("./cose-bilkent-S5V4N54A-Wa-FYjHx.js"), true ? __vite__mapDeps([6,7]) : void 0, import.meta.url), "loader")
65291
+ loader: /* @__PURE__ */ __name(async () => await __vitePreload(() => import("./cose-bilkent-S5V4N54A-C3iQr7P0.js"), true ? __vite__mapDeps([6,7]) : void 0, import.meta.url), "loader")
65167
65292
  }
65168
65293
  ]
65169
65294
  ]);
@@ -65619,7 +65744,7 @@ var detector = /* @__PURE__ */ __name((txt) => {
65619
65744
  }, "detector");
65620
65745
  var loader = /* @__PURE__ */ __name(async () => {
65621
65746
  const { diagram: diagram2 } = await __vitePreload(async () => {
65622
- const { diagram: diagram22 } = await import("./c4Diagram-AHTNJAMY-B57DWDB5.js");
65747
+ const { diagram: diagram22 } = await import("./c4Diagram-AHTNJAMY-BQCHj6of.js");
65623
65748
  return { diagram: diagram22 };
65624
65749
  }, true ? __vite__mapDeps([8,9]) : void 0, import.meta.url);
65625
65750
  return { id, diagram: diagram2 };
@@ -65639,7 +65764,7 @@ var detector2 = /* @__PURE__ */ __name((txt, config2) => {
65639
65764
  }, "detector");
65640
65765
  var loader2 = /* @__PURE__ */ __name(async () => {
65641
65766
  const { diagram: diagram2 } = await __vitePreload(async () => {
65642
- const { diagram: diagram22 } = await import("./flowDiagram-DWJPFMVM-B5k0WctR.js");
65767
+ const { diagram: diagram22 } = await import("./flowDiagram-DWJPFMVM-Br3VuPsd.js");
65643
65768
  return { diagram: diagram22 };
65644
65769
  }, true ? __vite__mapDeps([10,11,9,12,13,14]) : void 0, import.meta.url);
65645
65770
  return { id: id2, diagram: diagram2 };
@@ -65665,7 +65790,7 @@ var detector3 = /* @__PURE__ */ __name((txt, config2) => {
65665
65790
  }, "detector");
65666
65791
  var loader3 = /* @__PURE__ */ __name(async () => {
65667
65792
  const { diagram: diagram2 } = await __vitePreload(async () => {
65668
- const { diagram: diagram22 } = await import("./flowDiagram-DWJPFMVM-B5k0WctR.js");
65793
+ const { diagram: diagram22 } = await import("./flowDiagram-DWJPFMVM-Br3VuPsd.js");
65669
65794
  return { diagram: diagram22 };
65670
65795
  }, true ? __vite__mapDeps([10,11,9,12,13,14]) : void 0, import.meta.url);
65671
65796
  return { id: id3, diagram: diagram2 };
@@ -65682,7 +65807,7 @@ var detector4 = /* @__PURE__ */ __name((txt) => {
65682
65807
  }, "detector");
65683
65808
  var loader4 = /* @__PURE__ */ __name(async () => {
65684
65809
  const { diagram: diagram2 } = await __vitePreload(async () => {
65685
- const { diagram: diagram22 } = await import("./erDiagram-SMLLAGMA-CkzvnQaU.js");
65810
+ const { diagram: diagram22 } = await import("./erDiagram-SMLLAGMA-D0srSDPs.js");
65686
65811
  return { diagram: diagram22 };
65687
65812
  }, true ? __vite__mapDeps([15,12,13,14]) : void 0, import.meta.url);
65688
65813
  return { id: id4, diagram: diagram2 };
@@ -65699,7 +65824,7 @@ var detector5 = /* @__PURE__ */ __name((txt) => {
65699
65824
  }, "detector");
65700
65825
  var loader5 = /* @__PURE__ */ __name(async () => {
65701
65826
  const { diagram: diagram2 } = await __vitePreload(async () => {
65702
- const { diagram: diagram22 } = await import("./gitGraphDiagram-UUTBAWPF-CJdXKPsy.js");
65827
+ const { diagram: diagram22 } = await import("./gitGraphDiagram-UUTBAWPF-CKplsNll.js");
65703
65828
  return { diagram: diagram22 };
65704
65829
  }, true ? __vite__mapDeps([16,17,18,19,4,2]) : void 0, import.meta.url);
65705
65830
  return { id: id5, diagram: diagram2 };
@@ -65716,7 +65841,7 @@ var detector6 = /* @__PURE__ */ __name((txt) => {
65716
65841
  }, "detector");
65717
65842
  var loader6 = /* @__PURE__ */ __name(async () => {
65718
65843
  const { diagram: diagram2 } = await __vitePreload(async () => {
65719
- const { diagram: diagram22 } = await import("./ganttDiagram-T4ZO3ILL-C2pFdr_b.js");
65844
+ const { diagram: diagram22 } = await import("./ganttDiagram-T4ZO3ILL-D09E8Ld2.js");
65720
65845
  return { diagram: diagram22 };
65721
65846
  }, true ? __vite__mapDeps([20,21,22,23]) : void 0, import.meta.url);
65722
65847
  return { id: id6, diagram: diagram2 };
@@ -65733,7 +65858,7 @@ var detector7 = /* @__PURE__ */ __name((txt) => {
65733
65858
  }, "detector");
65734
65859
  var loader7 = /* @__PURE__ */ __name(async () => {
65735
65860
  const { diagram: diagram2 } = await __vitePreload(async () => {
65736
- const { diagram: diagram22 } = await import("./infoDiagram-42DDH7IO-CUBNnXNy.js");
65861
+ const { diagram: diagram22 } = await import("./infoDiagram-42DDH7IO-VNZjK26Z.js");
65737
65862
  return { diagram: diagram22 };
65738
65863
  }, true ? __vite__mapDeps([24,19,4,2]) : void 0, import.meta.url);
65739
65864
  return { id: id7, diagram: diagram2 };
@@ -65749,7 +65874,7 @@ var detector8 = /* @__PURE__ */ __name((txt) => {
65749
65874
  }, "detector");
65750
65875
  var loader8 = /* @__PURE__ */ __name(async () => {
65751
65876
  const { diagram: diagram2 } = await __vitePreload(async () => {
65752
- const { diagram: diagram22 } = await import("./pieDiagram-DEJITSTG-LipgyJMA.js");
65877
+ const { diagram: diagram22 } = await import("./pieDiagram-DEJITSTG-5w5tVLFj.js");
65753
65878
  return { diagram: diagram22 };
65754
65879
  }, true ? __vite__mapDeps([25,17,19,4,2,26,27,22]) : void 0, import.meta.url);
65755
65880
  return { id: id8, diagram: diagram2 };
@@ -65765,7 +65890,7 @@ var detector9 = /* @__PURE__ */ __name((txt) => {
65765
65890
  }, "detector");
65766
65891
  var loader9 = /* @__PURE__ */ __name(async () => {
65767
65892
  const { diagram: diagram2 } = await __vitePreload(async () => {
65768
- const { diagram: diagram22 } = await import("./quadrantDiagram-34T5L4WZ-BsvYEtIZ.js");
65893
+ const { diagram: diagram22 } = await import("./quadrantDiagram-34T5L4WZ-B5GobzTO.js");
65769
65894
  return { diagram: diagram22 };
65770
65895
  }, true ? __vite__mapDeps([28,21,22,23]) : void 0, import.meta.url);
65771
65896
  return { id: id9, diagram: diagram2 };
@@ -65782,7 +65907,7 @@ var detector10 = /* @__PURE__ */ __name((txt) => {
65782
65907
  }, "detector");
65783
65908
  var loader10 = /* @__PURE__ */ __name(async () => {
65784
65909
  const { diagram: diagram2 } = await __vitePreload(async () => {
65785
- const { diagram: diagram22 } = await import("./xychartDiagram-5P7HB3ND-CwTHSfES.js");
65910
+ const { diagram: diagram22 } = await import("./xychartDiagram-5P7HB3ND-D5C0kytw.js");
65786
65911
  return { diagram: diagram22 };
65787
65912
  }, true ? __vite__mapDeps([29,22,27,21,23]) : void 0, import.meta.url);
65788
65913
  return { id: id10, diagram: diagram2 };
@@ -65799,7 +65924,7 @@ var detector11 = /* @__PURE__ */ __name((txt) => {
65799
65924
  }, "detector");
65800
65925
  var loader11 = /* @__PURE__ */ __name(async () => {
65801
65926
  const { diagram: diagram2 } = await __vitePreload(async () => {
65802
- const { diagram: diagram22 } = await import("./requirementDiagram-MS252O5E-BnabpcqK.js");
65927
+ const { diagram: diagram22 } = await import("./requirementDiagram-MS252O5E-EEt0fiRz.js");
65803
65928
  return { diagram: diagram22 };
65804
65929
  }, true ? __vite__mapDeps([30,12,13]) : void 0, import.meta.url);
65805
65930
  return { id: id11, diagram: diagram2 };
@@ -65816,7 +65941,7 @@ var detector12 = /* @__PURE__ */ __name((txt) => {
65816
65941
  }, "detector");
65817
65942
  var loader12 = /* @__PURE__ */ __name(async () => {
65818
65943
  const { diagram: diagram2 } = await __vitePreload(async () => {
65819
- const { diagram: diagram22 } = await import("./sequenceDiagram-FGHM5R23-CtGBoKet.js");
65944
+ const { diagram: diagram22 } = await import("./sequenceDiagram-FGHM5R23-0i-4BqN-.js");
65820
65945
  return { diagram: diagram22 };
65821
65946
  }, true ? __vite__mapDeps([31,9,18]) : void 0, import.meta.url);
65822
65947
  return { id: id12, diagram: diagram2 };
@@ -65836,7 +65961,7 @@ var detector13 = /* @__PURE__ */ __name((txt, config2) => {
65836
65961
  }, "detector");
65837
65962
  var loader13 = /* @__PURE__ */ __name(async () => {
65838
65963
  const { diagram: diagram2 } = await __vitePreload(async () => {
65839
- const { diagram: diagram22 } = await import("./classDiagram-6PBFFD2Q-C516x-2x.js");
65964
+ const { diagram: diagram22 } = await import("./classDiagram-6PBFFD2Q-CLrLTGbu.js");
65840
65965
  return { diagram: diagram22 };
65841
65966
  }, true ? __vite__mapDeps([32,33,11,9,12,13]) : void 0, import.meta.url);
65842
65967
  return { id: id13, diagram: diagram2 };
@@ -65856,7 +65981,7 @@ var detector14 = /* @__PURE__ */ __name((txt, config2) => {
65856
65981
  }, "detector");
65857
65982
  var loader14 = /* @__PURE__ */ __name(async () => {
65858
65983
  const { diagram: diagram2 } = await __vitePreload(async () => {
65859
- const { diagram: diagram22 } = await import("./classDiagram-v2-HSJHXN6E-C516x-2x.js");
65984
+ const { diagram: diagram22 } = await import("./classDiagram-v2-HSJHXN6E-CLrLTGbu.js");
65860
65985
  return { diagram: diagram22 };
65861
65986
  }, true ? __vite__mapDeps([34,33,11,9,12,13]) : void 0, import.meta.url);
65862
65987
  return { id: id14, diagram: diagram2 };
@@ -65876,7 +66001,7 @@ var detector15 = /* @__PURE__ */ __name((txt, config2) => {
65876
66001
  }, "detector");
65877
66002
  var loader15 = /* @__PURE__ */ __name(async () => {
65878
66003
  const { diagram: diagram2 } = await __vitePreload(async () => {
65879
- const { diagram: diagram22 } = await import("./stateDiagram-FHFEXIEX-DYwbJ7V6.js");
66004
+ const { diagram: diagram22 } = await import("./stateDiagram-FHFEXIEX-DX08_hh3.js");
65880
66005
  return { diagram: diagram22 };
65881
66006
  }, true ? __vite__mapDeps([35,36,12,13,1,2,3,4]) : void 0, import.meta.url);
65882
66007
  return { id: id15, diagram: diagram2 };
@@ -65899,7 +66024,7 @@ var detector16 = /* @__PURE__ */ __name((txt, config2) => {
65899
66024
  }, "detector");
65900
66025
  var loader16 = /* @__PURE__ */ __name(async () => {
65901
66026
  const { diagram: diagram2 } = await __vitePreload(async () => {
65902
- const { diagram: diagram22 } = await import("./stateDiagram-v2-QKLJ7IA2-CtQIhDqi.js");
66027
+ const { diagram: diagram22 } = await import("./stateDiagram-v2-QKLJ7IA2-CP3UU-ar.js");
65903
66028
  return { diagram: diagram22 };
65904
66029
  }, true ? __vite__mapDeps([37,36,12,13]) : void 0, import.meta.url);
65905
66030
  return { id: id16, diagram: diagram2 };
@@ -65916,7 +66041,7 @@ var detector17 = /* @__PURE__ */ __name((txt) => {
65916
66041
  }, "detector");
65917
66042
  var loader17 = /* @__PURE__ */ __name(async () => {
65918
66043
  const { diagram: diagram2 } = await __vitePreload(async () => {
65919
- const { diagram: diagram22 } = await import("./journeyDiagram-VCZTEJTY-CTytCzzg.js");
66044
+ const { diagram: diagram22 } = await import("./journeyDiagram-VCZTEJTY-4mieWisO.js");
65920
66045
  return { diagram: diagram22 };
65921
66046
  }, true ? __vite__mapDeps([38,11,9,26]) : void 0, import.meta.url);
65922
66047
  return { id: id17, diagram: diagram2 };
@@ -65986,7 +66111,7 @@ var detector18 = /* @__PURE__ */ __name((txt, config2 = {}) => {
65986
66111
  }, "detector");
65987
66112
  var loader18 = /* @__PURE__ */ __name(async () => {
65988
66113
  const { diagram: diagram2 } = await __vitePreload(async () => {
65989
- const { diagram: diagram22 } = await import("./flowDiagram-DWJPFMVM-B5k0WctR.js");
66114
+ const { diagram: diagram22 } = await import("./flowDiagram-DWJPFMVM-Br3VuPsd.js");
65990
66115
  return { diagram: diagram22 };
65991
66116
  }, true ? __vite__mapDeps([10,11,9,12,13,14]) : void 0, import.meta.url);
65992
66117
  return { id: id18, diagram: diagram2 };
@@ -66003,7 +66128,7 @@ var detector19 = /* @__PURE__ */ __name((txt) => {
66003
66128
  }, "detector");
66004
66129
  var loader19 = /* @__PURE__ */ __name(async () => {
66005
66130
  const { diagram: diagram2 } = await __vitePreload(async () => {
66006
- const { diagram: diagram22 } = await import("./timeline-definition-GMOUNBTQ-Dg1mahK3.js");
66131
+ const { diagram: diagram22 } = await import("./timeline-definition-GMOUNBTQ-Bn7U0euE.js");
66007
66132
  return { diagram: diagram22 };
66008
66133
  }, true ? __vite__mapDeps([39,26]) : void 0, import.meta.url);
66009
66134
  return { id: id19, diagram: diagram2 };
@@ -66020,7 +66145,7 @@ var detector20 = /* @__PURE__ */ __name((txt) => {
66020
66145
  }, "detector");
66021
66146
  var loader20 = /* @__PURE__ */ __name(async () => {
66022
66147
  const { diagram: diagram2 } = await __vitePreload(async () => {
66023
- const { diagram: diagram22 } = await import("./mindmap-definition-QFDTVHPH-Dvudei3d.js");
66148
+ const { diagram: diagram22 } = await import("./mindmap-definition-QFDTVHPH-BWSrGBRN.js");
66024
66149
  return { diagram: diagram22 };
66025
66150
  }, true ? __vite__mapDeps([40,12,13]) : void 0, import.meta.url);
66026
66151
  return { id: id20, diagram: diagram2 };
@@ -66037,7 +66162,7 @@ var detector21 = /* @__PURE__ */ __name((txt) => {
66037
66162
  }, "detector");
66038
66163
  var loader21 = /* @__PURE__ */ __name(async () => {
66039
66164
  const { diagram: diagram2 } = await __vitePreload(async () => {
66040
- const { diagram: diagram22 } = await import("./kanban-definition-6JOO6SKY-CJ9BZQW-.js");
66165
+ const { diagram: diagram22 } = await import("./kanban-definition-6JOO6SKY-Cm91R9mn.js");
66041
66166
  return { diagram: diagram22 };
66042
66167
  }, true ? __vite__mapDeps([41,11]) : void 0, import.meta.url);
66043
66168
  return { id: id21, diagram: diagram2 };
@@ -66054,7 +66179,7 @@ var detector22 = /* @__PURE__ */ __name((txt) => {
66054
66179
  }, "detector");
66055
66180
  var loader22 = /* @__PURE__ */ __name(async () => {
66056
66181
  const { diagram: diagram2 } = await __vitePreload(async () => {
66057
- const { diagram: diagram22 } = await import("./sankeyDiagram-XADWPNL6-BuCgq17Q.js");
66182
+ const { diagram: diagram22 } = await import("./sankeyDiagram-XADWPNL6-Osa6Eix6.js");
66058
66183
  return { diagram: diagram22 };
66059
66184
  }, true ? __vite__mapDeps([42,27,22]) : void 0, import.meta.url);
66060
66185
  return { id: id22, diagram: diagram2 };
@@ -66071,7 +66196,7 @@ var detector23 = /* @__PURE__ */ __name((txt) => {
66071
66196
  }, "detector");
66072
66197
  var loader23 = /* @__PURE__ */ __name(async () => {
66073
66198
  const { diagram: diagram2 } = await __vitePreload(async () => {
66074
- const { diagram: diagram22 } = await import("./diagram-TYMM5635-Dgy-yPsr.js");
66199
+ const { diagram: diagram22 } = await import("./diagram-TYMM5635-DAsU-q28.js");
66075
66200
  return { diagram: diagram22 };
66076
66201
  }, true ? __vite__mapDeps([43,17,19,4,2]) : void 0, import.meta.url);
66077
66202
  return { id: id23, diagram: diagram2 };
@@ -66087,7 +66212,7 @@ var detector24 = /* @__PURE__ */ __name((txt) => {
66087
66212
  }, "detector");
66088
66213
  var loader24 = /* @__PURE__ */ __name(async () => {
66089
66214
  const { diagram: diagram2 } = await __vitePreload(async () => {
66090
- const { diagram: diagram22 } = await import("./diagram-MMDJMWI5-Byvl-KNj.js");
66215
+ const { diagram: diagram22 } = await import("./diagram-MMDJMWI5-ByaaDyoH.js");
66091
66216
  return { diagram: diagram22 };
66092
66217
  }, true ? __vite__mapDeps([44,17,19,4,2]) : void 0, import.meta.url);
66093
66218
  return { id: id24, diagram: diagram2 };
@@ -66103,7 +66228,7 @@ var detector25 = /* @__PURE__ */ __name((txt) => {
66103
66228
  }, "detector");
66104
66229
  var loader25 = /* @__PURE__ */ __name(async () => {
66105
66230
  const { diagram: diagram2 } = await __vitePreload(async () => {
66106
- const { diagram: diagram22 } = await import("./blockDiagram-DXYQGD6D-4chZr0B3.js");
66231
+ const { diagram: diagram22 } = await import("./blockDiagram-DXYQGD6D-B86rt-OM.js");
66107
66232
  return { diagram: diagram22 };
66108
66233
  }, true ? __vite__mapDeps([45,11,5,1,2,14]) : void 0, import.meta.url);
66109
66234
  return { id: id25, diagram: diagram2 };
@@ -66120,7 +66245,7 @@ var detector26 = /* @__PURE__ */ __name((txt) => {
66120
66245
  }, "detector");
66121
66246
  var loader26 = /* @__PURE__ */ __name(async () => {
66122
66247
  const { diagram: diagram2 } = await __vitePreload(async () => {
66123
- const { diagram: diagram22 } = await import("./diagram-5BDNPKRD-CaZsWnM2.js");
66248
+ const { diagram: diagram22 } = await import("./diagram-5BDNPKRD-BeuTiBNY.js");
66124
66249
  return { diagram: diagram22 };
66125
66250
  }, true ? __vite__mapDeps([46,17,18,19,4,2]) : void 0, import.meta.url);
66126
66251
  return { id: id26, diagram: diagram2 };
@@ -66137,7 +66262,7 @@ var detector27 = /* @__PURE__ */ __name((txt) => {
66137
66262
  }, "detector");
66138
66263
  var loader27 = /* @__PURE__ */ __name(async () => {
66139
66264
  const { diagram: diagram2 } = await __vitePreload(async () => {
66140
- const { diagram: diagram22 } = await import("./architectureDiagram-Q4EWVU46-DWhLXXBB.js");
66265
+ const { diagram: diagram22 } = await import("./architectureDiagram-Q4EWVU46-JhFDZdkM.js");
66141
66266
  return { diagram: diagram22 };
66142
66267
  }, true ? __vite__mapDeps([47,17,19,4,2,7]) : void 0, import.meta.url);
66143
66268
  return { id: id27, diagram: diagram2 };
@@ -66154,7 +66279,7 @@ var detector28 = /* @__PURE__ */ __name((txt) => {
66154
66279
  }, "detector");
66155
66280
  var loader28 = /* @__PURE__ */ __name(async () => {
66156
66281
  const { diagram: diagram2 } = await __vitePreload(async () => {
66157
- const { diagram: diagram22 } = await import("./ishikawaDiagram-UXIWVN3A-Blfv83uV.js");
66282
+ const { diagram: diagram22 } = await import("./ishikawaDiagram-UXIWVN3A-DNQZ_EJr.js");
66158
66283
  return { diagram: diagram22 };
66159
66284
  }, true ? [] : void 0, import.meta.url);
66160
66285
  return { id: id28, diagram: diagram2 };
@@ -66170,7 +66295,7 @@ var detector29 = /* @__PURE__ */ __name((txt) => {
66170
66295
  }, "detector");
66171
66296
  var loader29 = /* @__PURE__ */ __name(async () => {
66172
66297
  const { diagram: diagram2 } = await __vitePreload(async () => {
66173
- const { diagram: diagram22 } = await import("./vennDiagram-DHZGUBPP-CdFh8oWQ.js");
66298
+ const { diagram: diagram22 } = await import("./vennDiagram-DHZGUBPP-ChvNdQSo.js");
66174
66299
  return { diagram: diagram22 };
66175
66300
  }, true ? [] : void 0, import.meta.url);
66176
66301
  return { id: id29, diagram: diagram2 };
@@ -66187,7 +66312,7 @@ var detector30 = /* @__PURE__ */ __name((txt) => {
66187
66312
  }, "detector");
66188
66313
  var loader30 = /* @__PURE__ */ __name(async () => {
66189
66314
  const { diagram: diagram2 } = await __vitePreload(async () => {
66190
- const { diagram: diagram22 } = await import("./diagram-G4DWMVQ6-0B-U8e4R.js");
66315
+ const { diagram: diagram22 } = await import("./diagram-G4DWMVQ6-BNAzh5ef.js");
66191
66316
  return { diagram: diagram22 };
66192
66317
  }, true ? __vite__mapDeps([48,13,17,19,4,2,23,27,22]) : void 0, import.meta.url);
66193
66318
  return { id: id30, diagram: diagram2 };
@@ -66203,7 +66328,7 @@ var detector31 = /* @__PURE__ */ __name((text2) => {
66203
66328
  }, "detector");
66204
66329
  var loader31 = /* @__PURE__ */ __name(async () => {
66205
66330
  const { diagram: diagram2 } = await __vitePreload(async () => {
66206
- const { diagram: diagram22 } = await import("./wardleyDiagram-NUSXRM2D-BUhyPKXM.js");
66331
+ const { diagram: diagram22 } = await import("./wardleyDiagram-NUSXRM2D-BoIeDdfp.js");
66207
66332
  return { diagram: diagram22 };
66208
66333
  }, true ? __vite__mapDeps([49,17,19,4,2]) : void 0, import.meta.url);
66209
66334
  return { id: id31, diagram: diagram2 };
@@ -76757,7 +76882,7 @@ const rowButton = "_rowButton_1qzmy_51";
76757
76882
  const statusIcon$3 = "_statusIcon_1qzmy_76";
76758
76883
  const chevron$3 = "_chevron_1qzmy_77";
76759
76884
  const executor = "_executor_1qzmy_85";
76760
- const taskSummary = "_taskSummary_1qzmy_99";
76885
+ const taskSummary$1 = "_taskSummary_1qzmy_99";
76761
76886
  const jumpButton = "_jumpButton_1qzmy_109";
76762
76887
  const content$9 = "_content_1qzmy_116";
76763
76888
  const contentOpen = "_contentOpen_1qzmy_122";
@@ -76777,7 +76902,7 @@ const styles$10 = {
76777
76902
  statusIcon: statusIcon$3,
76778
76903
  chevron: chevron$3,
76779
76904
  executor,
76780
- taskSummary,
76905
+ taskSummary: taskSummary$1,
76781
76906
  jumpButton,
76782
76907
  content: content$9,
76783
76908
  contentOpen,
@@ -77213,6 +77338,29 @@ function formatDurationMs(durationMs) {
77213
77338
  const remainingSeconds = totalSeconds % 60;
77214
77339
  return remainingSeconds > 0 ? `${minutes}m${remainingSeconds}s` : `${minutes}m`;
77215
77340
  }
77341
+ function useElapsedTime({
77342
+ startedAt,
77343
+ enabled,
77344
+ intervalMs = 1e3
77345
+ }) {
77346
+ const [elapsedMs, setElapsedMs] = reactExports.useState(() => {
77347
+ if (!enabled || !startedAt) return void 0;
77348
+ return Math.max(0, Date.now() - startedAt);
77349
+ });
77350
+ reactExports.useEffect(() => {
77351
+ if (!enabled || !startedAt) {
77352
+ setElapsedMs(void 0);
77353
+ return;
77354
+ }
77355
+ const update2 = () => {
77356
+ setElapsedMs(Math.max(0, Date.now() - startedAt));
77357
+ };
77358
+ update2();
77359
+ const timer2 = window.setInterval(update2, intervalMs);
77360
+ return () => window.clearInterval(timer2);
77361
+ }, [enabled, startedAt, intervalMs]);
77362
+ return elapsedMs;
77363
+ }
77216
77364
  function useRuntimeMetricsVisibility() {
77217
77365
  return !useIsMobile();
77218
77366
  }
@@ -77563,6 +77711,11 @@ function unwrapTaskResult(raw) {
77563
77711
  }
77564
77712
  return obj;
77565
77713
  }
77714
+ function stabilizeStreamingSummary(previous2, next2) {
77715
+ if (!next2) return previous2;
77716
+ if (!previous2) return next2;
77717
+ return next2.length >= previous2.length ? next2 : previous2;
77718
+ }
77566
77719
  function renderWaitTaskArgLinks(taskIds) {
77567
77720
  if (taskIds.length === 0) return null;
77568
77721
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$Z.section, children: [
@@ -77626,7 +77779,6 @@ const ToolCallCard = reactExports.memo(function ToolCallCard2({ toolCall, varian
77626
77779
  const showRuntimeMetrics = useRuntimeMetricsVisibility();
77627
77780
  const [showDiff, setShowDiff] = reactExports.useState(true);
77628
77781
  const [pathCopied, setPathCopied] = reactExports.useState(false);
77629
- const isPatchTool = toolCall.name === "applyPatch" || toolCall.name === "patch";
77630
77782
  const diff = toolCall.status === "success" ? extractDiff(toolCall.name, toolCall.result) : null;
77631
77783
  const isWaitTaskResult = toolCall.name === "waitTask" && toolCall.status === "success" && !!toolCall.result?.results;
77632
77784
  const waitTaskResults = isWaitTaskResult ? toolCall.result.results : null;
@@ -77666,25 +77818,25 @@ const ToolCallCard = reactExports.memo(function ToolCallCard2({ toolCall, varian
77666
77818
  }[toolCall.status];
77667
77819
  const ToolIcon = toolIconMap[toolCall.name] || Wrench;
77668
77820
  const computedArgSummary = getToolArgSummary(toolCall.name, toolCall.args);
77669
- const lastStablePatchSummaryRef = reactExports.useRef(isPatchTool ? computedArgSummary : null);
77670
- const lastStablePatchToolCallIdRef = reactExports.useRef(isPatchTool ? toolCall.id : null);
77671
- reactExports.useEffect(() => {
77672
- if (!isPatchTool) {
77673
- lastStablePatchSummaryRef.current = null;
77674
- lastStablePatchToolCallIdRef.current = null;
77675
- return;
77676
- }
77677
- if (lastStablePatchToolCallIdRef.current !== toolCall.id) {
77678
- lastStablePatchToolCallIdRef.current = toolCall.id;
77679
- lastStablePatchSummaryRef.current = computedArgSummary ?? null;
77680
- return;
77681
- }
77682
- if (computedArgSummary) {
77683
- lastStablePatchSummaryRef.current = computedArgSummary;
77684
- }
77685
- }, [toolCall.id, isPatchTool, computedArgSummary]);
77686
- const patchSummaryForCurrentTool = lastStablePatchToolCallIdRef.current === toolCall.id ? lastStablePatchSummaryRef.current : null;
77687
- const displayedArgSummary = isPatchTool ? computedArgSummary ?? patchSummaryForCurrentTool : computedArgSummary;
77821
+ const stableArgSummaryRef = reactExports.useRef(computedArgSummary ?? null);
77822
+ const stableArgSummaryToolCallIdRef = reactExports.useRef(toolCall.id);
77823
+ const shouldStabilizeArgSummary = toolCall.status === "pending";
77824
+ const displayedArgSummary = reactExports.useMemo(() => {
77825
+ if (stableArgSummaryToolCallIdRef.current !== toolCall.id) {
77826
+ return computedArgSummary;
77827
+ }
77828
+ if (!shouldStabilizeArgSummary) {
77829
+ return computedArgSummary;
77830
+ }
77831
+ return stabilizeStreamingSummary(
77832
+ stableArgSummaryRef.current,
77833
+ computedArgSummary ?? null
77834
+ );
77835
+ }, [toolCall.id, computedArgSummary, shouldStabilizeArgSummary]);
77836
+ reactExports.useLayoutEffect(() => {
77837
+ stableArgSummaryToolCallIdRef.current = toolCall.id;
77838
+ stableArgSummaryRef.current = displayedArgSummary ?? null;
77839
+ }, [toolCall.id, displayedArgSummary]);
77688
77840
  const argTooltip = reactExports.useMemo(() => {
77689
77841
  return displayedArgSummary ? getFullArgText(toolCall.name, toolCall.args) ?? displayedArgSummary : null;
77690
77842
  }, [toolCall.name, toolCall.args, displayedArgSummary]);
@@ -77704,7 +77856,11 @@ const ToolCallCard = reactExports.memo(function ToolCallCard2({ toolCall, varian
77704
77856
  window.setTimeout(() => setPathCopied(false), 1500);
77705
77857
  };
77706
77858
  const readContent = toolCall.status === "success" ? extractReadContent(toolCall.result) : null;
77707
- const durationMs = toolCall.durationMs ?? (toolCall.startedAt && toolCall.endedAt ? toolCall.endedAt - toolCall.startedAt : void 0);
77859
+ const runningElapsedMs = useElapsedTime({
77860
+ startedAt: toolCall.startedAt,
77861
+ enabled: showRuntimeMetrics && toolCall.status === "pending"
77862
+ });
77863
+ const durationMs = toolCall.status === "pending" ? runningElapsedMs : toolCall.durationMs ?? (toolCall.startedAt && toolCall.endedAt ? toolCall.endedAt - toolCall.startedAt : void 0);
77708
77864
  const duration2 = showRuntimeMetrics && durationMs != null ? formatDurationMs(durationMs) : null;
77709
77865
  const readFilePath = toolCall.name === "readFile" || toolCall.name === "read" ? getToolArgSummary(toolCall.name, toolCall.args) : null;
77710
77866
  const readLanguage = getReadFileLanguage(readFilePath);
@@ -77853,29 +78009,6 @@ const styles$Y = {
77853
78009
  dots: dots$1,
77854
78010
  text
77855
78011
  };
77856
- function useElapsedTime({
77857
- startedAt,
77858
- enabled,
77859
- intervalMs = 1e3
77860
- }) {
77861
- const [elapsedMs, setElapsedMs] = reactExports.useState(() => {
77862
- if (!enabled || !startedAt) return void 0;
77863
- return Math.max(0, Date.now() - startedAt);
77864
- });
77865
- reactExports.useEffect(() => {
77866
- if (!enabled || !startedAt) {
77867
- setElapsedMs(void 0);
77868
- return;
77869
- }
77870
- const update2 = () => {
77871
- setElapsedMs(Math.max(0, Date.now() - startedAt));
77872
- };
77873
- update2();
77874
- const timer2 = window.setInterval(update2, intervalMs);
77875
- return () => window.clearInterval(timer2);
77876
- }, [enabled, startedAt, intervalMs]);
77877
- return elapsedMs;
77878
- }
77879
78012
  const ReasoningBlock = reactExports.memo(function ReasoningBlock2({ content: content2, isStreaming, variant = "default", startedAt, durationMs }) {
77880
78013
  const { t: t2 } = useTranslation();
77881
78014
  const showRuntimeMetrics = useRuntimeMetricsVisibility();
@@ -78463,70 +78596,70 @@ function TabBlocksRenderer({ blocks, agentId }) {
78463
78596
  isUser: false
78464
78597
  } });
78465
78598
  }
78466
- const message$4 = "_message_185wk_1";
78467
- const fullWidth = "_fullWidth_185wk_8";
78468
- const user = "_user_185wk_12";
78469
- const agent$2 = "_agent_185wk_17";
78470
- const groupLayout = "_groupLayout_185wk_25";
78471
- const agentShellCompact = "_agentShellCompact_185wk_33";
78472
- const avatarCol$1 = "_avatarCol_185wk_38";
78473
- const senderHeader = "_senderHeader_185wk_52";
78474
- const contentCol = "_contentCol_185wk_58";
78475
- const senderLabel = "_senderLabel_185wk_79";
78476
- const senderName = "_senderName_185wk_96";
78477
- const bubble = "_bubble_185wk_102";
78478
- const hasUsage = "_hasUsage_185wk_128";
78479
- const embeddedBubble = "_embeddedBubble_185wk_132";
78480
- const textBubble = "_textBubble_185wk_138";
78481
- const textSection = "_textSection_185wk_154";
78482
- const embeddedBubbleContent = "_embeddedBubbleContent_185wk_173";
78483
- const content$8 = "_content_185wk_58";
78484
- const messageFooter = "_messageFooter_185wk_199";
78485
- const groupMetaFooter = "_groupMetaFooter_185wk_207";
78486
- const messageFooterActions = "_messageFooterActions_185wk_233";
78487
- const timestamp = "_timestamp_185wk_245";
78488
- const copyButton$1 = "_copyButton_185wk_256";
78489
- const errorBlock = "_errorBlock_185wk_285";
78490
- const errorHeader = "_errorHeader_185wk_293";
78491
- const errorType = "_errorType_185wk_301";
78492
- const errorMessage$1 = "_errorMessage_185wk_306";
78493
- const errorDetails = "_errorDetails_185wk_312";
78494
- const errorDetailsSummary = "_errorDetailsSummary_185wk_318";
78495
- const errorDetailsSummaryRow = "_errorDetailsSummaryRow_185wk_326";
78496
- const errorDetailsCopyButton = "_errorDetailsCopyButton_185wk_333";
78497
- const errorDetailsContent = "_errorDetailsContent_185wk_355";
78498
- const collapsedContent = "_collapsedContent_185wk_368";
78499
- const expandedContent = "_expandedContent_185wk_386";
78500
- const conclusionStrip = "_conclusionStrip_185wk_391";
78501
- const conclusionLabel = "_conclusionLabel_185wk_405";
78502
- const conclusionText = "_conclusionText_185wk_413";
78503
- const expandButton$1 = "_expandButton_185wk_419";
78504
- const messageMetrics = "_messageMetrics_185wk_446";
78505
- const embeddedMessageMetrics = "_embeddedMessageMetrics_185wk_461";
78506
- const fallbackTransitionBanner = "_fallbackTransitionBanner_185wk_474";
78507
- const messageMetricsPrimary = "_messageMetricsPrimary_185wk_478";
78508
- const embeddedMessageMetricsPrimary = "_embeddedMessageMetricsPrimary_185wk_486";
78509
- const messageMetricsMeta = "_messageMetricsMeta_185wk_491";
78510
- const metricsStreaming = "_metricsStreaming_185wk_519";
78511
- const fallbackTransitionIcon = "_fallbackTransitionIcon_185wk_551";
78512
- const fallbackTransitionText = "_fallbackTransitionText_185wk_556";
78513
- const tokenUsage = "_tokenUsage_185wk_573";
78514
- const duration = "_duration_185wk_582";
78515
- const modelLabel = "_modelLabel_185wk_592";
78516
- const modelLabelFallback = "_modelLabelFallback_185wk_602";
78517
- const system = "_system_185wk_614";
78518
- const systemBubble = "_systemBubble_185wk_621";
78519
- const systemContent = "_systemContent_185wk_633";
78520
- const loadingSpinner = "_loadingSpinner_185wk_640";
78521
- const supervisorTag = "_supervisorTag_185wk_656";
78522
- const memoryWriteButton = "_memoryWriteButton_185wk_690";
78523
- const statusArea = "_statusArea_185wk_697";
78524
- const statusDot$1 = "_statusDot_185wk_705";
78525
- const dot$2 = "_dot_185wk_714";
78526
- const dotSending = "_dotSending_185wk_722";
78527
- const dotError = "_dotError_185wk_726";
78528
- const retryButton = "_retryButton_185wk_731";
78529
- const recallButton = "_recallButton_185wk_741";
78599
+ const message$4 = "_message_1lr2c_1";
78600
+ const fullWidth = "_fullWidth_1lr2c_8";
78601
+ const user = "_user_1lr2c_12";
78602
+ const agent$2 = "_agent_1lr2c_17";
78603
+ const groupLayout = "_groupLayout_1lr2c_25";
78604
+ const agentShellCompact = "_agentShellCompact_1lr2c_33";
78605
+ const avatarCol$1 = "_avatarCol_1lr2c_38";
78606
+ const senderHeader = "_senderHeader_1lr2c_52";
78607
+ const contentCol = "_contentCol_1lr2c_58";
78608
+ const senderLabel = "_senderLabel_1lr2c_79";
78609
+ const senderName = "_senderName_1lr2c_96";
78610
+ const bubble = "_bubble_1lr2c_102";
78611
+ const hasUsage = "_hasUsage_1lr2c_128";
78612
+ const embeddedBubble = "_embeddedBubble_1lr2c_132";
78613
+ const textBubble = "_textBubble_1lr2c_138";
78614
+ const textSection = "_textSection_1lr2c_154";
78615
+ const embeddedBubbleContent = "_embeddedBubbleContent_1lr2c_173";
78616
+ const content$8 = "_content_1lr2c_58";
78617
+ const messageFooter = "_messageFooter_1lr2c_199";
78618
+ const groupMetaFooter = "_groupMetaFooter_1lr2c_207";
78619
+ const messageFooterActions = "_messageFooterActions_1lr2c_233";
78620
+ const timestamp = "_timestamp_1lr2c_245";
78621
+ const copyButton$1 = "_copyButton_1lr2c_256";
78622
+ const errorBlock = "_errorBlock_1lr2c_285";
78623
+ const errorHeader = "_errorHeader_1lr2c_293";
78624
+ const errorType = "_errorType_1lr2c_301";
78625
+ const errorMessage$1 = "_errorMessage_1lr2c_306";
78626
+ const errorDetails = "_errorDetails_1lr2c_312";
78627
+ const errorDetailsSummary = "_errorDetailsSummary_1lr2c_318";
78628
+ const errorDetailsSummaryRow = "_errorDetailsSummaryRow_1lr2c_326";
78629
+ const errorDetailsCopyButton = "_errorDetailsCopyButton_1lr2c_333";
78630
+ const errorDetailsContent = "_errorDetailsContent_1lr2c_355";
78631
+ const collapsedContent = "_collapsedContent_1lr2c_368";
78632
+ const expandedContent = "_expandedContent_1lr2c_386";
78633
+ const conclusionStrip = "_conclusionStrip_1lr2c_391";
78634
+ const conclusionLabel = "_conclusionLabel_1lr2c_405";
78635
+ const conclusionText = "_conclusionText_1lr2c_413";
78636
+ const expandButton$1 = "_expandButton_1lr2c_419";
78637
+ const messageMetrics = "_messageMetrics_1lr2c_446";
78638
+ const embeddedMessageMetrics = "_embeddedMessageMetrics_1lr2c_461";
78639
+ const fallbackTransitionBanner = "_fallbackTransitionBanner_1lr2c_474";
78640
+ const messageMetricsPrimary = "_messageMetricsPrimary_1lr2c_478";
78641
+ const embeddedMessageMetricsPrimary = "_embeddedMessageMetricsPrimary_1lr2c_486";
78642
+ const messageMetricsMeta = "_messageMetricsMeta_1lr2c_491";
78643
+ const metricsStreaming = "_metricsStreaming_1lr2c_519";
78644
+ const fallbackTransitionIcon = "_fallbackTransitionIcon_1lr2c_551";
78645
+ const fallbackTransitionText = "_fallbackTransitionText_1lr2c_556";
78646
+ const tokenUsage = "_tokenUsage_1lr2c_573";
78647
+ const duration = "_duration_1lr2c_582";
78648
+ const modelLabel = "_modelLabel_1lr2c_592";
78649
+ const modelLabelFallback = "_modelLabelFallback_1lr2c_602";
78650
+ const system = "_system_1lr2c_614";
78651
+ const systemBubble = "_systemBubble_1lr2c_621";
78652
+ const systemContent = "_systemContent_1lr2c_633";
78653
+ const loadingSpinner = "_loadingSpinner_1lr2c_640";
78654
+ const supervisorTag = "_supervisorTag_1lr2c_656";
78655
+ const memoryWriteButton = "_memoryWriteButton_1lr2c_690";
78656
+ const statusArea = "_statusArea_1lr2c_697";
78657
+ const statusDot$1 = "_statusDot_1lr2c_705";
78658
+ const dot$2 = "_dot_1lr2c_714";
78659
+ const dotSending = "_dotSending_1lr2c_722";
78660
+ const dotError = "_dotError_1lr2c_726";
78661
+ const retryButton = "_retryButton_1lr2c_731";
78662
+ const recallButton = "_recallButton_1lr2c_741";
78530
78663
  const styles$S = {
78531
78664
  message: message$4,
78532
78665
  fullWidth,
@@ -78630,7 +78763,7 @@ function renderNonTextBlock(block, index2, context, variant) {
78630
78763
  {
78631
78764
  toolCall: block.toolCall,
78632
78765
  variant: variant === "embedded" ? "embedded" : "default",
78633
- isOutputStreaming: !!context.message.isStreaming
78766
+ isOutputStreaming: isMessageStreaming(context.message)
78634
78767
  },
78635
78768
  block.toolCall.id
78636
78769
  ) : null;
@@ -78958,7 +79091,9 @@ const MessageBubble = reactExports.memo(reactExports.forwardRef(function Message
78958
79091
  return extractConclusion(textContent);
78959
79092
  }, [isCollapsed, isUser, textContent]);
78960
79093
  const isEmbedded = variant === "embedded";
78961
- const showToolLoading = !!message2.isStreaming && message2.senderRole === "agent" && isLastAgentMessage && sending;
79094
+ const messageStreaming = isMessageStreaming(message2);
79095
+ const messageFailed = isMessageFailed(message2);
79096
+ const showToolLoading = messageStreaming && message2.senderRole === "agent" && isLastAgentMessage && sending;
78962
79097
  const blockContext = reactExports.useMemo(() => ({ message: message2, isUser }), [message2, isUser]);
78963
79098
  const blockVariant = isEmbedded ? "embedded" : "default";
78964
79099
  const runMetrics = useMessageStore(
@@ -78986,8 +79121,8 @@ const MessageBubble = reactExports.memo(reactExports.forwardRef(function Message
78986
79121
  }, [runMetrics?.startedAt]);
78987
79122
  const displayModel = runMetrics?.model ?? message2.model;
78988
79123
  const displayUsage = runMetrics?.usage ?? message2.usage;
78989
- const fallbackTransition = message2.isStreaming ? runMetrics?.fallbackTransition : void 0;
78990
- const displayDurationMs = message2.isStreaming && runMetrics ? elapsedMs : message2.durationMs;
79124
+ const fallbackTransition = messageStreaming ? runMetrics?.fallbackTransition : void 0;
79125
+ const displayDurationMs = messageStreaming && runMetrics ? elapsedMs : message2.durationMs;
78991
79126
  const hasMetrics = showRuntimeMetrics && !!(displayModel || displayUsage || displayDurationMs != null && !isNaN(displayDurationMs));
78992
79127
  const embeddedRuntimeStatusVisible = embedRuntimeStatusInBubble && (showToolLoading || !!fallbackTransition);
78993
79128
  const bubbleHasMetrics = !isEmbedded ? hasMetrics : embeddedRuntimeStatusVisible;
@@ -79014,7 +79149,7 @@ const MessageBubble = reactExports.memo(reactExports.forwardRef(function Message
79014
79149
  variant: blockVariant
79015
79150
  }
79016
79151
  ),
79017
- message2.error && /* @__PURE__ */ jsxRuntimeExports.jsx(MessageErrorBlock, { error: message2.error })
79152
+ messageFailed && message2.error && /* @__PURE__ */ jsxRuntimeExports.jsx(MessageErrorBlock, { error: message2.error })
79018
79153
  ] }),
79019
79154
  isCollapsed && conclusion && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$S.conclusionStrip, children: [
79020
79155
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$S.conclusionLabel, children: "💡" }),
@@ -79110,24 +79245,24 @@ function ModelLabel({ model, fallback: fallback2 }) {
79110
79245
  const shortName = shortModelName(model);
79111
79246
  return /* @__PURE__ */ jsxRuntimeExports.jsx(AppTooltip, { content: model, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx(styles$S.modelLabel, fallback2 ? styles$S.modelLabelFallback : ""), children: shortName }) });
79112
79247
  }
79113
- function formatTokenCount(n2, t2) {
79248
+ function formatTokenCount(n2) {
79114
79249
  if (!n2) return "0";
79115
- if (n2 >= 1e6) return t2("message.mTokens", { count: parseFloat((n2 / 1e6).toFixed(1)) });
79116
- if (n2 >= 1e3) return t2("message.kTokens", { count: parseFloat((n2 / 1e3).toFixed(1)) });
79117
- return `${n2} ${t2("message.tokens")}`;
79250
+ if (n2 >= 1e6) return `${parseFloat((n2 / 1e6).toFixed(1))}M`;
79251
+ if (n2 >= 1e3) return `${parseFloat((n2 / 1e3).toFixed(1))}K`;
79252
+ return String(n2);
79118
79253
  }
79119
79254
  function TokenUsage({ usage }) {
79120
79255
  const { t: t2 } = useTranslation();
79121
79256
  const cached = usage.cachedInputTokens;
79122
79257
  const tooltip = cached ? t2("message.tokenUsageWithCache", {
79123
- input: formatTokenCount(usage.inputTokens, t2),
79124
- output: formatTokenCount(usage.outputTokens, t2),
79125
- cached: formatTokenCount(cached, t2)
79258
+ input: formatTokenCount(usage.inputTokens),
79259
+ output: formatTokenCount(usage.outputTokens),
79260
+ cached: formatTokenCount(cached)
79126
79261
  }) : t2("message.tokenUsage", {
79127
- input: formatTokenCount(usage.inputTokens, t2),
79128
- output: formatTokenCount(usage.outputTokens, t2)
79262
+ input: formatTokenCount(usage.inputTokens),
79263
+ output: formatTokenCount(usage.outputTokens)
79129
79264
  });
79130
- return /* @__PURE__ */ jsxRuntimeExports.jsx(AppTooltip, { content: tooltip, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$S.tokenUsage, children: formatTokenCount(usage.totalTokens, t2) }) });
79265
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(AppTooltip, { content: tooltip, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$S.tokenUsage, children: formatTokenCount(usage.totalTokens) }) });
79131
79266
  }
79132
79267
  function Duration({ durationMs }) {
79133
79268
  const text2 = formatDurationMs(durationMs);
@@ -79267,7 +79402,8 @@ const MessageItem = reactExports.memo(function MessageItem2({
79267
79402
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$S.systemContent, children: displayText })
79268
79403
  ] }) });
79269
79404
  }
79270
- if (blocks.length === 0 && !message2.error) {
79405
+ const messageFailed = isMessageFailed(message2);
79406
+ if (blocks.length === 0 && !(messageFailed && message2.error)) {
79271
79407
  return null;
79272
79408
  }
79273
79409
  const displaySenderId = message2.senderId || "";
@@ -79390,7 +79526,9 @@ function AgentBlockMessage({
79390
79526
  const displayModel = runMetrics?.model ?? message2.model;
79391
79527
  const displayFallback = runMetrics?.fallback ?? message2.fallback;
79392
79528
  const displayUsage = runMetrics?.usage ?? message2.usage;
79393
- const displayDurationMs = message2.isStreaming && runMetrics ? elapsedMs : message2.durationMs;
79529
+ const messageStreaming = isMessageStreaming(message2);
79530
+ const messageFailed = isMessageFailed(message2);
79531
+ const displayDurationMs = messageStreaming && runMetrics ? elapsedMs : message2.durationMs;
79394
79532
  const showFooterMetrics = showRuntimeMetrics && !!(displayModel || displayUsage || displayDurationMs != null && !isNaN(displayDurationMs));
79395
79533
  const [manuallyExpanded, setManuallyExpanded] = reactExports.useState(false);
79396
79534
  const isExpanded = !autoCollapsed || manuallyExpanded;
@@ -79495,7 +79633,7 @@ function AgentBlockMessage({
79495
79633
  embedRuntimeStatusInBubble: true,
79496
79634
  onExpandChange: setManuallyExpanded
79497
79635
  }
79498
- ) : message2.error ? /* @__PURE__ */ jsxRuntimeExports.jsx(MessageErrorBlock, { error: message2.error }) : null,
79636
+ ) : messageFailed && message2.error ? /* @__PURE__ */ jsxRuntimeExports.jsx(MessageErrorBlock, { error: message2.error }) : null,
79499
79637
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$S.messageFooter, styles$S.groupMetaFooter), children: [
79500
79638
  showFooterMetrics ? /* @__PURE__ */ jsxRuntimeExports.jsx(
79501
79639
  MessageMetrics,
@@ -79870,7 +80008,7 @@ const MessageList = reactExports.forwardRef(function MessageList2({ sessionId, o
79870
80008
  const agentIndices = [];
79871
80009
  for (let i2 = 0; i2 < messages.length; i2++) {
79872
80010
  const msg = messages[i2];
79873
- if (msg.senderRole === "agent" && !(msg.isStreaming && msg.blocks.length === 0)) {
80011
+ if (msg.senderRole === "agent" && !(isMessageStreaming(msg) && msg.blocks.length === 0)) {
79874
80012
  agentIndices.push(i2);
79875
80013
  }
79876
80014
  }
@@ -80859,7 +80997,7 @@ function SessionTabItem({
80859
80997
  const msgMap = s2.messagesMap.get(session2.id);
80860
80998
  if (msgMap) {
80861
80999
  for (const msg of msgMap.values()) {
80862
- if (msg.isStreaming) return "streaming";
81000
+ if (isMessageStreaming(msg)) return "streaming";
80863
81001
  }
80864
81002
  }
80865
81003
  return "idle";
@@ -83365,7 +83503,7 @@ const MessageInput = reactExports.forwardRef(function MessageInput2({
83365
83503
  const isDropdownOpen = showCommandDropdown || showMentionDropdown || showSupervisorMenu || showQuickReplyPicker;
83366
83504
  useRepositionWhileOpen(isDropdownOpen, updateDropdownPosition, [input2, attachments.length, supervisionMode]);
83367
83505
  const hasDraft = input2.trim().length > 0 || attachments.length > 0;
83368
- const sendButtonActsAsStop = isLoading && !hasDraft;
83506
+ const sendButtonActsAsStop = Boolean(isLoading);
83369
83507
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$F.container, isDropdownOpen && styles$F.containerDropdownOpen, className), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$F.wrapper, children: [
83370
83508
  attachments.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$F.attachmentSection, children: attachments.map((file, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
83371
83509
  AttachmentItem,
@@ -83682,6 +83820,7 @@ function normalizeFallbackEntries(entries2) {
83682
83820
  }));
83683
83821
  }
83684
83822
  function normalizeReasoningEffort(enableThinking, reasoningEffort) {
83823
+ if (reasoningEffort === "off" && enableThinking === true) return "medium";
83685
83824
  if (reasoningEffort) return reasoningEffort;
83686
83825
  return enableThinking === true ? "medium" : DEFAULT_REASONING_EFFORT;
83687
83826
  }
@@ -85088,7 +85227,7 @@ function buildAgentConfigPayload(form2, existingConfig) {
85088
85227
  form2.maxTokens !== void 0 ? form2.maxTokens : existingConfig?.models.requestDefaults.maxTokens ?? null
85089
85228
  );
85090
85229
  const enableThinking = form2.enableThinking ?? existingConfig?.models.requestDefaults.enableThinking ?? true;
85091
- const reasoningEffort = form2.reasoningEffort ?? existingConfig?.models.requestDefaults.reasoningEffort;
85230
+ const reasoningEffort = form2.reasoningEffort === "off" && enableThinking ? "medium" : form2.reasoningEffort ?? existingConfig?.models.requestDefaults.reasoningEffort;
85092
85231
  const skillNames = form2.skillNames.length > 0 ? form2.skillNames : existingConfig?.capabilities.skillNames ?? [];
85093
85232
  const mcpServerIds = form2.mcpServerIds.length > 0 ? form2.mcpServerIds : existingConfig?.capabilities.mcpServerIds ?? [];
85094
85233
  const disabledTools = form2.disabledTools.length > 0 ? form2.disabledTools : existingConfig?.capabilities.disabledTools ?? [];
@@ -93036,43 +93175,50 @@ const useScheduledTaskStore = create$3((set2, get2) => ({
93036
93175
  }
93037
93176
  }
93038
93177
  }));
93039
- const container$7 = "_container_nzwow_1";
93040
- const progress$1 = "_progress_nzwow_8";
93041
- const empty$3 = "_empty_nzwow_18";
93042
- const hint$1 = "_hint_nzwow_33";
93043
- const taskList = "_taskList_nzwow_41";
93044
- const taskItem = "_taskItem_nzwow_50";
93045
- const disabled = "_disabled_nzwow_72";
93046
- const taskHeader = "_taskHeader_nzwow_78";
93047
- const taskName = "_taskName_nzwow_85";
93048
- const taskMeta = "_taskMeta_nzwow_97";
93049
- const typeTag = "_typeTag_nzwow_106";
93050
- const target = "_target_nzwow_118";
93051
- const cronBadge = "_cronBadge_nzwow_127";
93052
- const taskMessage = "_taskMessage_nzwow_136";
93053
- const taskFooter = "_taskFooter_nzwow_147";
93054
- const taskTime = "_taskTime_nzwow_154";
93055
- const taskActions = "_taskActions_nzwow_159";
93056
- const historyHeader = "_historyHeader_nzwow_167";
93057
- const backButton = "_backButton_nzwow_176";
93058
- const historyTitleBlock = "_historyTitleBlock_nzwow_197";
93059
- const historyLabel = "_historyLabel_nzwow_201";
93060
- const executionList$1 = "_executionList_nzwow_217";
93061
- const executionItem$1 = "_executionItem_nzwow_226";
93062
- const executionHeader$1 = "_executionHeader_nzwow_233";
93063
- const executionSummary$1 = "_executionSummary_nzwow_240";
93064
- const executionStatus = "_executionStatus_nzwow_250";
93065
- const runningDot = "_runningDot_nzwow_275";
93066
- const executionTime$1 = "_executionTime_nzwow_283";
93067
- const executionDuration = "_executionDuration_nzwow_284";
93068
- const expandButton = "_expandButton_nzwow_288";
93069
- const executionBlock = "_executionBlock_nzwow_302";
93070
- const executionBlockTitle = "_executionBlockTitle_nzwow_306";
93071
- const outputText = "_outputText_nzwow_313";
93072
- const errorText = "_errorText_nzwow_314";
93073
- const dialog$1 = "_dialog_nzwow_351";
93074
- const dialogContent = "_dialogContent_nzwow_364";
93075
- const dialogActions = "_dialogActions_nzwow_410";
93178
+ const container$7 = "_container_1b7uv_1";
93179
+ const progress$1 = "_progress_1b7uv_8";
93180
+ const empty$3 = "_empty_1b7uv_18";
93181
+ const hint$1 = "_hint_1b7uv_33";
93182
+ const taskList = "_taskList_1b7uv_41";
93183
+ const taskItem = "_taskItem_1b7uv_50";
93184
+ const disabled = "_disabled_1b7uv_72";
93185
+ const taskHeader = "_taskHeader_1b7uv_78";
93186
+ const taskName = "_taskName_1b7uv_85";
93187
+ const taskMeta = "_taskMeta_1b7uv_97";
93188
+ const typeTag = "_typeTag_1b7uv_106";
93189
+ const target = "_target_1b7uv_118";
93190
+ const cronBadge = "_cronBadge_1b7uv_127";
93191
+ const taskMessage = "_taskMessage_1b7uv_136";
93192
+ const taskFooter = "_taskFooter_1b7uv_147";
93193
+ const taskTime = "_taskTime_1b7uv_154";
93194
+ const taskActions = "_taskActions_1b7uv_159";
93195
+ const historyHeader = "_historyHeader_1b7uv_167";
93196
+ const backButton = "_backButton_1b7uv_176";
93197
+ const historyTitleBlock = "_historyTitleBlock_1b7uv_197";
93198
+ const historyLabel = "_historyLabel_1b7uv_201";
93199
+ const executionList$1 = "_executionList_1b7uv_217";
93200
+ const executionItem$1 = "_executionItem_1b7uv_226";
93201
+ const executionHeader$1 = "_executionHeader_1b7uv_233";
93202
+ const executionSummary$1 = "_executionSummary_1b7uv_240";
93203
+ const executionStatus = "_executionStatus_1b7uv_250";
93204
+ const runningDot = "_runningDot_1b7uv_275";
93205
+ const executionTime$1 = "_executionTime_1b7uv_283";
93206
+ const executionDuration = "_executionDuration_1b7uv_284";
93207
+ const expandButton = "_expandButton_1b7uv_288";
93208
+ const executionBlock = "_executionBlock_1b7uv_302";
93209
+ const executionBlockTitle = "_executionBlockTitle_1b7uv_306";
93210
+ const outputText = "_outputText_1b7uv_313";
93211
+ const errorText = "_errorText_1b7uv_314";
93212
+ const dialog$1 = "_dialog_1b7uv_351";
93213
+ const dialogContent = "_dialogContent_1b7uv_364";
93214
+ const taskSummary = "_taskSummary_1b7uv_387";
93215
+ const fieldGroup = "_fieldGroup_1b7uv_409";
93216
+ const fieldGroupCompact = "_fieldGroupCompact_1b7uv_421";
93217
+ const scheduleGrid = "_scheduleGrid_1b7uv_434";
93218
+ const targetGrid = "_targetGrid_1b7uv_440";
93219
+ const scheduleHint = "_scheduleHint_1b7uv_446";
93220
+ const legacyNotice = "_legacyNotice_1b7uv_455";
93221
+ const dialogActions = "_dialogActions_1b7uv_488";
93076
93222
  const styles$d = {
93077
93223
  container: container$7,
93078
93224
  progress: progress$1,
@@ -93110,10 +93256,339 @@ const styles$d = {
93110
93256
  errorText,
93111
93257
  dialog: dialog$1,
93112
93258
  dialogContent,
93259
+ taskSummary,
93260
+ fieldGroup,
93261
+ fieldGroupCompact,
93262
+ scheduleGrid,
93263
+ targetGrid,
93264
+ scheduleHint,
93265
+ legacyNotice,
93113
93266
  dialogActions
93114
93267
  };
93115
93268
  const log$8 = createLogger("SchedulerPanel");
93116
- function SchedulerPanel({}) {
93269
+ const DEFAULT_SCHEDULE = {
93270
+ kind: "daily",
93271
+ hour: "09",
93272
+ minute: "00",
93273
+ weekday: "1",
93274
+ monthDay: "1",
93275
+ customCron: "0 9 * * *"
93276
+ };
93277
+ const WEEKDAY_LABELS = ["日", "一", "二", "三", "四", "五", "六"];
93278
+ function formatSessionOption(session2) {
93279
+ return `${session2.title}${session2.isDefault ? " · 默认" : ""}${session2.status === "archived" ? " · 已归档" : ""}`;
93280
+ }
93281
+ function padTime(value2) {
93282
+ return String(value2).padStart(2, "0");
93283
+ }
93284
+ function parseCronExpression(cronExpression) {
93285
+ const parts = cronExpression.trim().split(/\s+/);
93286
+ if (parts.length !== 5) return { ...DEFAULT_SCHEDULE, kind: "custom", customCron: cronExpression };
93287
+ const [minute, hour, dayOfMonth, month, dayOfWeek] = parts;
93288
+ const minuteNumber = Number(minute);
93289
+ const hourNumber = Number(hour);
93290
+ const hasSimpleTime = Number.isInteger(minuteNumber) && Number.isInteger(hourNumber) && minuteNumber >= 0 && minuteNumber <= 59 && hourNumber >= 0 && hourNumber <= 23;
93291
+ if (!hasSimpleTime || month !== "*") {
93292
+ return { ...DEFAULT_SCHEDULE, kind: "custom", customCron: cronExpression };
93293
+ }
93294
+ const base = {
93295
+ ...DEFAULT_SCHEDULE,
93296
+ hour: padTime(hourNumber),
93297
+ minute: padTime(minuteNumber),
93298
+ customCron: cronExpression
93299
+ };
93300
+ if (dayOfMonth === "*" && dayOfWeek === "*") return { ...base, kind: "daily" };
93301
+ if (dayOfMonth === "*" && dayOfWeek === "1-5") return { ...base, kind: "workday" };
93302
+ const weekdayNumber = Number(dayOfWeek);
93303
+ if (dayOfMonth === "*" && isPlainIntegerCronField(dayOfWeek) && weekdayNumber >= 0 && weekdayNumber <= 7) {
93304
+ return { ...base, kind: "weekly", weekday: String(weekdayNumber === 7 ? 0 : weekdayNumber) };
93305
+ }
93306
+ const monthDayNumber = Number(dayOfMonth);
93307
+ if (dayOfWeek === "*" && isPlainIntegerCronField(dayOfMonth) && monthDayNumber >= 1 && monthDayNumber <= 28) {
93308
+ return { ...base, kind: "monthly", monthDay: String(monthDayNumber) };
93309
+ }
93310
+ return { ...base, kind: "custom" };
93311
+ }
93312
+ function isPlainIntegerCronField(field2) {
93313
+ return /^\d+$/.test(field2);
93314
+ }
93315
+ function buildCronExpression(schedule2) {
93316
+ if (schedule2.kind === "custom") return schedule2.customCron.trim();
93317
+ const hour = Math.min(23, Math.max(0, Number(schedule2.hour) || 0));
93318
+ const minute = Math.min(59, Math.max(0, Number(schedule2.minute) || 0));
93319
+ const time2 = `${minute} ${hour}`;
93320
+ if (schedule2.kind === "workday") return `${time2} * * 1-5`;
93321
+ if (schedule2.kind === "weekly") return `${time2} * * ${schedule2.weekday}`;
93322
+ if (schedule2.kind === "monthly") return `${time2} ${schedule2.monthDay} * *`;
93323
+ return `${time2} * * *`;
93324
+ }
93325
+ function describeCronExpression(cronExpression) {
93326
+ const schedule2 = parseCronExpression(cronExpression);
93327
+ const time2 = `${schedule2.hour}:${schedule2.minute}`;
93328
+ if (schedule2.kind === "daily") return `每天 ${time2}`;
93329
+ if (schedule2.kind === "workday") return `工作日 ${time2}`;
93330
+ if (schedule2.kind === "weekly") return `每周${WEEKDAY_LABELS[Number(schedule2.weekday)]} ${time2}`;
93331
+ if (schedule2.kind === "monthly") return `每月 ${schedule2.monthDay} 日 ${time2}`;
93332
+ return `自定义 Cron:${cronExpression}`;
93333
+ }
93334
+ function cronFieldMatches(field2, value2) {
93335
+ if (field2 === "*") return true;
93336
+ return field2.split(",").some((part) => {
93337
+ if (part.includes("-")) {
93338
+ const [start2, end] = part.split("-").map(Number);
93339
+ return Number.isInteger(start2) && Number.isInteger(end) && value2 >= start2 && value2 <= end;
93340
+ }
93341
+ const exact = Number(part);
93342
+ if (!Number.isInteger(exact)) return false;
93343
+ return exact === value2 || exact === 7 && value2 === 0;
93344
+ });
93345
+ }
93346
+ function matchesCron(cronExpression, date) {
93347
+ const parts = cronExpression.trim().split(/\s+/);
93348
+ if (parts.length !== 5) return false;
93349
+ const [minute, hour, dayOfMonth, month, dayOfWeek] = parts;
93350
+ return cronFieldMatches(minute, date.getMinutes()) && cronFieldMatches(hour, date.getHours()) && cronFieldMatches(dayOfMonth, date.getDate()) && cronFieldMatches(month, date.getMonth() + 1) && cronFieldMatches(dayOfWeek, date.getDay());
93351
+ }
93352
+ function getNextRunDate(cronExpression) {
93353
+ const current = /* @__PURE__ */ new Date();
93354
+ const cursor = new Date(current.getTime());
93355
+ cursor.setSeconds(0, 0);
93356
+ cursor.setMinutes(cursor.getMinutes() + 1);
93357
+ const maxChecks = 366 * 24 * 60;
93358
+ for (let i2 = 0; i2 < maxChecks; i2 += 1) {
93359
+ if (matchesCron(cronExpression, cursor)) return new Date(cursor);
93360
+ cursor.setMinutes(cursor.getMinutes() + 1);
93361
+ }
93362
+ return null;
93363
+ }
93364
+ function formatNextRun(cronExpression) {
93365
+ if (parseCronExpression(cronExpression).kind === "custom") return "自定义规则";
93366
+ const next2 = getNextRunDate(cronExpression);
93367
+ if (!next2) return "无法计算";
93368
+ const now2 = /* @__PURE__ */ new Date();
93369
+ const tomorrow = new Date(now2);
93370
+ tomorrow.setDate(now2.getDate() + 1);
93371
+ const sameDay = next2.toDateString() === now2.toDateString();
93372
+ const nextDay = next2.toDateString() === tomorrow.toDateString();
93373
+ const time2 = `${padTime(next2.getHours())}:${padTime(next2.getMinutes())}`;
93374
+ if (sameDay) return `今天 ${time2}`;
93375
+ if (nextDay) return `明天 ${time2}`;
93376
+ return `${next2.toLocaleDateString()} ${time2}`;
93377
+ }
93378
+ function getDefaultOwnerId(type2, agents, groups, currentGroupContext) {
93379
+ if (type2 === "agent") return agents[0]?.id ?? "";
93380
+ return currentGroupContext?.groupId ?? groups[0]?.id ?? "";
93381
+ }
93382
+ function findPreferredSession(sessions, preferredSessionId) {
93383
+ if (preferredSessionId) {
93384
+ const preferred = sessions.find((session2) => session2.id === preferredSessionId);
93385
+ if (preferred) return preferred;
93386
+ }
93387
+ return sessions.find((session2) => session2.status !== "archived" && session2.isDefault) ?? sessions.find((session2) => session2.status !== "archived") ?? sessions[0];
93388
+ }
93389
+ function ScheduleEditor({
93390
+ idPrefix,
93391
+ value: value2,
93392
+ onChange
93393
+ }) {
93394
+ const cronExpression = buildCronExpression(value2);
93395
+ const nextRun = formatNextRun(cronExpression);
93396
+ const frequencyLabelId = `${idPrefix}-frequency-label`;
93397
+ const timeInputId = `${idPrefix}-time`;
93398
+ const customCronId = `${idPrefix}-custom-cron`;
93399
+ const weekdayLabelId = `${idPrefix}-weekday-label`;
93400
+ const monthDayLabelId = `${idPrefix}-month-day-label`;
93401
+ const update2 = (patch2) => {
93402
+ onChange({ ...value2, ...patch2 });
93403
+ };
93404
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.fieldGroup, children: [
93405
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { children: "触发时间" }),
93406
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.scheduleGrid, children: [
93407
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.fieldGroupCompact, children: [
93408
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { id: frequencyLabelId, children: "频率" }),
93409
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
93410
+ Select,
93411
+ {
93412
+ value: value2.kind,
93413
+ onChange: (kind) => update2({ kind }),
93414
+ "aria-labelledby": frequencyLabelId,
93415
+ children: [
93416
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "daily", children: "每天" }),
93417
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "workday", children: "工作日" }),
93418
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "weekly", children: "每周" }),
93419
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "monthly", children: "每月" }),
93420
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "custom", children: "自定义 Cron" })
93421
+ ]
93422
+ }
93423
+ )
93424
+ ] }),
93425
+ value2.kind !== "custom" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.fieldGroupCompact, children: [
93426
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: timeInputId, children: "时间" }),
93427
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
93428
+ "input",
93429
+ {
93430
+ id: timeInputId,
93431
+ type: "time",
93432
+ value: `${value2.hour}:${value2.minute}`,
93433
+ onChange: (event) => {
93434
+ const [hour, minute] = event.target.value.split(":");
93435
+ update2({ hour, minute });
93436
+ },
93437
+ required: true
93438
+ }
93439
+ )
93440
+ ] })
93441
+ ] }),
93442
+ value2.kind === "weekly" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.fieldGroupCompact, children: [
93443
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { id: weekdayLabelId, children: "星期" }),
93444
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
93445
+ Select,
93446
+ {
93447
+ value: value2.weekday,
93448
+ onChange: (weekday) => update2({ weekday }),
93449
+ "aria-labelledby": weekdayLabelId,
93450
+ children: [
93451
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "1", children: "周一" }),
93452
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "2", children: "周二" }),
93453
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "3", children: "周三" }),
93454
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "4", children: "周四" }),
93455
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "5", children: "周五" }),
93456
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "6", children: "周六" }),
93457
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "0", children: "周日" })
93458
+ ]
93459
+ }
93460
+ )
93461
+ ] }),
93462
+ value2.kind === "monthly" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.fieldGroupCompact, children: [
93463
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { id: monthDayLabelId, children: "日期" }),
93464
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
93465
+ Select,
93466
+ {
93467
+ value: value2.monthDay,
93468
+ onChange: (monthDay) => update2({ monthDay }),
93469
+ "aria-labelledby": monthDayLabelId,
93470
+ children: Array.from({ length: 28 }, (_2, index2) => String(index2 + 1)).map((day) => /* @__PURE__ */ jsxRuntimeExports.jsxs("option", { value: day, children: [
93471
+ "每月 ",
93472
+ day,
93473
+ " 日"
93474
+ ] }, day))
93475
+ }
93476
+ )
93477
+ ] }),
93478
+ value2.kind === "custom" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.fieldGroupCompact, children: [
93479
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: customCronId, children: "Cron 表达式" }),
93480
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
93481
+ "input",
93482
+ {
93483
+ id: customCronId,
93484
+ type: "text",
93485
+ value: value2.customCron,
93486
+ onChange: (event) => update2({ customCron: event.target.value }),
93487
+ placeholder: "15 22 * * *",
93488
+ required: true
93489
+ }
93490
+ )
93491
+ ] }),
93492
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.scheduleHint, children: [
93493
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: value2.kind === "custom" ? describeCronExpression(cronExpression) : `生成:${cronExpression}` }),
93494
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
93495
+ "下一次运行:",
93496
+ nextRun
93497
+ ] })
93498
+ ] })
93499
+ ] });
93500
+ }
93501
+ function TaskTargetEditor({
93502
+ idPrefix,
93503
+ value: value2,
93504
+ onChange,
93505
+ agents,
93506
+ groups,
93507
+ currentGroupContext
93508
+ }) {
93509
+ const typeLabelId = `${idPrefix}-target-type-label`;
93510
+ const ownerLabelId = `${idPrefix}-owner-label`;
93511
+ const sessionLabelId = `${idPrefix}-session-label`;
93512
+ const [sessions, setSessions] = reactExports.useState([]);
93513
+ const [loadingSessions, setLoadingSessions] = reactExports.useState(false);
93514
+ const updateType = (type2) => {
93515
+ const ownerId = getDefaultOwnerId(type2, agents, groups, currentGroupContext);
93516
+ onChange({ type: type2, ownerId, sessionId: "" });
93517
+ };
93518
+ const updateOwner = (ownerId) => {
93519
+ onChange({ ...value2, ownerId, sessionId: "" });
93520
+ };
93521
+ reactExports.useEffect(() => {
93522
+ let cancelled = false;
93523
+ if (!value2.ownerId) {
93524
+ setSessions([]);
93525
+ return;
93526
+ }
93527
+ setLoadingSessions(true);
93528
+ const load2 = value2.type === "agent" ? getTransport().listDirectSessions(value2.ownerId) : getTransport().listSessionsByGroupId(value2.ownerId);
93529
+ load2.then((result) => {
93530
+ if (cancelled) return;
93531
+ setSessions(result);
93532
+ if (!value2.sessionId) {
93533
+ const preferredSessionId = value2.type === "group" && currentGroupContext?.groupId === value2.ownerId ? currentGroupContext.sessionId : void 0;
93534
+ const preferred = findPreferredSession(result, preferredSessionId);
93535
+ if (preferred) onChange({ ...value2, sessionId: preferred.id });
93536
+ }
93537
+ }).catch(() => {
93538
+ if (!cancelled) setSessions([]);
93539
+ }).finally(() => {
93540
+ if (!cancelled) setLoadingSessions(false);
93541
+ });
93542
+ return () => {
93543
+ cancelled = true;
93544
+ };
93545
+ }, [onChange, value2.ownerId, value2.sessionId, value2.type]);
93546
+ reactExports.useEffect(() => {
93547
+ if (value2.ownerId) return;
93548
+ const fallbackOwnerId = value2.type === "agent" ? agents[0]?.id : currentGroupContext?.groupId ?? groups[0]?.id;
93549
+ if (fallbackOwnerId) updateOwner(fallbackOwnerId);
93550
+ }, [agents, currentGroupContext, groups, value2.ownerId, value2.type]);
93551
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.fieldGroup, children: [
93552
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { children: "执行位置" }),
93553
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.targetGrid, children: [
93554
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.fieldGroupCompact, children: [
93555
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { id: typeLabelId, children: "类型" }),
93556
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
93557
+ Select,
93558
+ {
93559
+ value: value2.type,
93560
+ onChange: (type2) => updateType(type2),
93561
+ "aria-labelledby": typeLabelId,
93562
+ children: [
93563
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "agent", children: "智能体" }),
93564
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "group", children: "群组" })
93565
+ ]
93566
+ }
93567
+ )
93568
+ ] }),
93569
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.fieldGroupCompact, children: [
93570
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { id: ownerLabelId, children: value2.type === "agent" ? "智能体" : "群组" }),
93571
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Select, { value: value2.ownerId, onChange: updateOwner, "aria-labelledby": ownerLabelId, children: value2.type === "agent" ? agents.map((agent2) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: agent2.id, children: agent2.name }, agent2.id)) : groups.map((group2) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: group2.id, children: group2.name }, group2.id)) })
93572
+ ] })
93573
+ ] }),
93574
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.fieldGroupCompact, children: [
93575
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { id: sessionLabelId, children: "Session" }),
93576
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
93577
+ Select,
93578
+ {
93579
+ value: value2.sessionId,
93580
+ onChange: (sessionId) => onChange({ ...value2, sessionId }),
93581
+ "aria-labelledby": sessionLabelId,
93582
+ disabled: !value2.ownerId || loadingSessions || sessions.length === 0,
93583
+ placeholder: loadingSessions ? "加载 Session..." : "选择 Session",
93584
+ children: sessions.map((session2) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: session2.id, children: formatSessionOption(session2) }, session2.id))
93585
+ }
93586
+ )
93587
+ ] }),
93588
+ !value2.sessionId && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$d.scheduleHint, children: "请选择具体 Session,定时任务会发送到这里。" })
93589
+ ] });
93590
+ }
93591
+ function SchedulerPanel({ sessionId }) {
93117
93592
  const { t: t2 } = useTranslation();
93118
93593
  const { showToast } = useToast();
93119
93594
  const { tasks, loading: loading2, loadTasks, deleteTask, toggleTask, createTask, updateTask } = useScheduledTaskStore();
@@ -93123,13 +93598,20 @@ function SchedulerPanel({}) {
93123
93598
  const [selectedTaskId, setSelectedTaskId] = reactExports.useState(null);
93124
93599
  const [memoryUpdateProgress, setMemoryUpdateProgress] = reactExports.useState(null);
93125
93600
  const [nameMap, setNameMap] = reactExports.useState({});
93601
+ const [agents, setAgents] = reactExports.useState([]);
93602
+ const [groups, setGroups] = reactExports.useState([]);
93603
+ const [currentGroupContext, setCurrentGroupContext] = reactExports.useState(null);
93126
93604
  reactExports.useEffect(() => {
93127
93605
  loadTasks();
93128
93606
  Promise.all([
93129
- getTransport().listAgents().catch(() => [])
93130
- ]).then(([agents]) => {
93607
+ getTransport().listAgents().catch(() => []),
93608
+ getTransport().listGroups().catch(() => [])
93609
+ ]).then(([agents2, groups2]) => {
93131
93610
  const map2 = {};
93132
- for (const a2 of agents) map2[a2.id] = a2.name;
93611
+ for (const a2 of agents2) map2[a2.id] = a2.name;
93612
+ for (const g2 of groups2) map2[g2.id] = g2.name;
93613
+ setAgents(agents2);
93614
+ setGroups(groups2);
93133
93615
  setNameMap(map2);
93134
93616
  });
93135
93617
  let cancelled = false;
@@ -93150,22 +93632,69 @@ function SchedulerPanel({}) {
93150
93632
  dispose?.();
93151
93633
  };
93152
93634
  }, [loadTasks]);
93153
- const allTasks = tasks.filter((t22) => t22.type !== "memory-update");
93154
- const selectedTask = selectedTaskId ? allTasks.find((task) => task.id === selectedTaskId) : null;
93155
93635
  reactExports.useEffect(() => {
93156
- const groupTasks = allTasks.filter(
93636
+ let cancelled = false;
93637
+ const loadCurrentGroupContext = async () => {
93638
+ if (!sessionId) {
93639
+ setCurrentGroupContext(null);
93640
+ return;
93641
+ }
93642
+ const session2 = await getTransport().getSession(sessionId).catch(() => null);
93643
+ const groupId = session2?.groupId ?? (session2?.owner?.type === "group" ? session2.owner.groupId : void 0);
93644
+ if (!session2 || !groupId) {
93645
+ if (!cancelled) setCurrentGroupContext(null);
93646
+ return;
93647
+ }
93648
+ const group2 = await getTransport().getGroup(groupId).catch(() => null);
93649
+ if (!cancelled) {
93650
+ setCurrentGroupContext({
93651
+ groupId,
93652
+ groupName: group2?.name || groupId,
93653
+ sessionId: session2.id,
93654
+ sessionName: session2.title
93655
+ });
93656
+ setNameMap((prev2) => ({
93657
+ ...prev2,
93658
+ [groupId]: group2?.name || groupId,
93659
+ [session2.id]: session2.title
93660
+ }));
93661
+ }
93662
+ };
93663
+ void loadCurrentGroupContext();
93664
+ return () => {
93665
+ cancelled = true;
93666
+ };
93667
+ }, [sessionId]);
93668
+ const visibleTasks = reactExports.useMemo(
93669
+ () => tasks.filter((t22) => t22.type !== "memory-update" && t22.type !== "group-memory-update"),
93670
+ [tasks]
93671
+ );
93672
+ const selectedTask = selectedTaskId ? visibleTasks.find((task) => task.id === selectedTaskId) : null;
93673
+ reactExports.useEffect(() => {
93674
+ const groupTasks = visibleTasks.filter(
93157
93675
  (t22) => t22.type === "group"
93158
93676
  );
93677
+ const agentTasks = visibleTasks.filter(
93678
+ (t22) => t22.type === "agent"
93679
+ );
93159
93680
  const missingGroupIds = groupTasks.map((t22) => t22.groupId).filter((id32) => !nameMap[id32]);
93160
- const missingSessionIds = groupTasks.map((t22) => t22.sessionId).filter(Boolean).filter((id32) => !nameMap[id32]);
93161
- if (missingGroupIds.length === 0 && missingSessionIds.length === 0) return;
93681
+ const missingAgentIds = agentTasks.map((t22) => t22.agentId).filter((id32) => !nameMap[id32]);
93682
+ const missingGroupSessionIds = groupTasks.map((t22) => t22.sessionId).filter(Boolean).filter((id32) => !nameMap[id32]);
93683
+ const missingAgentSessionIds = agentTasks.map((t22) => t22.sessionId).filter(Boolean).filter((id32) => !nameMap[id32]);
93684
+ if (missingGroupIds.length === 0 && missingAgentIds.length === 0 && missingGroupSessionIds.length === 0 && missingAgentSessionIds.length === 0) return;
93162
93685
  const fetchGroupNames = missingGroupIds.map(
93163
93686
  (id32) => getTransport().getGroup(id32).then((g2) => g2 ? { id: id32, name: g2.name } : null).catch(() => null)
93164
93687
  );
93165
- const fetchSessionNames = missingSessionIds.map(
93688
+ const fetchAgentNames = missingAgentIds.map(
93689
+ (id32) => getTransport().getAgent(id32).then((a2) => a2 ? { id: id32, name: a2.name } : null).catch(() => null)
93690
+ );
93691
+ const fetchGroupSessionNames = missingGroupSessionIds.map(
93166
93692
  (id32) => getTransport().getSession(id32).then((t22) => t22 ? { id: t22.id, name: t22.title } : null).catch(() => null)
93167
93693
  );
93168
- Promise.all([...fetchGroupNames, ...fetchSessionNames]).then((results) => {
93694
+ const fetchAgentSessionNames = missingAgentSessionIds.map(
93695
+ (id32) => getTransport().getDirectSession(id32).then((t22) => t22 ? { id: t22.id, name: t22.title } : null).catch(() => null)
93696
+ );
93697
+ Promise.all([...fetchGroupNames, ...fetchAgentNames, ...fetchGroupSessionNames, ...fetchAgentSessionNames]).then((results) => {
93169
93698
  const additions = {};
93170
93699
  for (const r2 of results) {
93171
93700
  if (r2) additions[r2.id] = r2.name;
@@ -93174,7 +93703,7 @@ function SchedulerPanel({}) {
93174
93703
  setNameMap((prev2) => ({ ...prev2, ...additions }));
93175
93704
  }
93176
93705
  });
93177
- }, [allTasks, nameMap]);
93706
+ }, [visibleTasks, nameMap]);
93178
93707
  const handleToggle = async (taskId, enabled) => {
93179
93708
  try {
93180
93709
  await toggleTask(taskId, enabled);
@@ -93217,7 +93746,11 @@ function SchedulerPanel({}) {
93217
93746
  };
93218
93747
  const getTaskTarget = (task) => {
93219
93748
  if (task.type === "memory-update") return t2("scheduler.allAgents");
93220
- if (task.type === "agent") return nameMap[task.agentId] || task.agentId;
93749
+ if (task.type === "agent") {
93750
+ const agentName2 = nameMap[task.agentId] || task.agentId;
93751
+ const sessionName = task.sessionId ? nameMap[task.sessionId] || task.sessionId : void 0;
93752
+ return sessionName && sessionName !== agentName2 ? `${agentName2} / ${sessionName}` : agentName2;
93753
+ }
93221
93754
  if (task.type === "group") {
93222
93755
  const groupName2 = nameMap[task.groupId] || task.groupId;
93223
93756
  const sessionName = task.sessionId ? nameMap[task.sessionId] || task.sessionId : void 0;
@@ -93263,19 +93796,31 @@ function SchedulerPanel({}) {
93263
93796
  ")"
93264
93797
  ] })
93265
93798
  ] }),
93266
- showCreateDialog && /* @__PURE__ */ jsxRuntimeExports.jsx(CreateTaskDialog, { onClose: () => setShowCreateDialog(false), onCreate: handleCreate }),
93799
+ showCreateDialog && /* @__PURE__ */ jsxRuntimeExports.jsx(
93800
+ CreateTaskDialog,
93801
+ {
93802
+ currentGroupContext,
93803
+ agents,
93804
+ groups,
93805
+ onClose: () => setShowCreateDialog(false),
93806
+ onCreate: handleCreate
93807
+ }
93808
+ ),
93267
93809
  editingTask && /* @__PURE__ */ jsxRuntimeExports.jsx(
93268
93810
  EditTaskDialog,
93269
93811
  {
93270
93812
  task: editingTask,
93813
+ agents,
93814
+ groups,
93815
+ currentGroupContext,
93271
93816
  onClose: () => setEditingTask(null),
93272
93817
  onSave: handleEdit
93273
93818
  }
93274
93819
  ),
93275
- allTasks.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.empty, children: [
93820
+ visibleTasks.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.empty, children: [
93276
93821
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: t2("scheduler.noTasks") }),
93277
93822
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: styles$d.hint, children: t2("scheduler.createFirst") })
93278
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$d.taskList, children: allTasks.map((task) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
93823
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$d.taskList, children: visibleTasks.map((task) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
93279
93824
  "div",
93280
93825
  {
93281
93826
  role: "button",
@@ -93306,7 +93851,7 @@ function SchedulerPanel({}) {
93306
93851
  ] }),
93307
93852
  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$d.cronBadge, children: [
93308
93853
  /* @__PURE__ */ jsxRuntimeExports.jsx(Clock, { size: 10, style: { marginRight: 3, verticalAlign: -1 } }),
93309
- task.cronExpression
93854
+ describeCronExpression(task.cronExpression)
93310
93855
  ] }),
93311
93856
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$d.target, children: getTaskTarget(task) })
93312
93857
  ] }),
@@ -93321,6 +93866,11 @@ function SchedulerPanel({}) {
93321
93866
  task.message
93322
93867
  ] }),
93323
93868
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.taskFooter, children: [
93869
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$d.taskTime, children: [
93870
+ t2("scheduler.nextRunAt"),
93871
+ ": ",
93872
+ formatNextRun(task.cronExpression)
93873
+ ] }),
93324
93874
  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$d.taskTime, children: [
93325
93875
  t2("scheduler.lastRunAt"),
93326
93876
  ": ",
@@ -93494,17 +94044,21 @@ function ExecutionHistoryView({
93494
94044
  ] });
93495
94045
  }
93496
94046
  function CreateTaskDialog({
94047
+ currentGroupContext,
94048
+ agents,
94049
+ groups,
93497
94050
  onClose,
93498
94051
  onCreate
93499
94052
  }) {
93500
94053
  const { t: t2 } = useTranslation();
93501
94054
  const [name2, setName] = reactExports.useState("");
93502
- const [type2, setType] = reactExports.useState("agent");
93503
- const [cronExpression, setCronExpression] = reactExports.useState("0 9 * * *");
93504
- const [agentId, setAgentId] = reactExports.useState("");
93505
- const [groupId, setGroupId] = reactExports.useState("");
93506
- const [sessionId, setSessionId] = reactExports.useState("");
94055
+ const initialTarget = currentGroupContext ? { type: "group", ownerId: currentGroupContext.groupId, sessionId: currentGroupContext.sessionId ?? "" } : { type: "agent", ownerId: agents[0]?.id ?? "", sessionId: "" };
94056
+ const [schedule2, setSchedule] = reactExports.useState(DEFAULT_SCHEDULE);
94057
+ const [target2, setTarget] = reactExports.useState(initialTarget);
93507
94058
  const [message2, setMessage] = reactExports.useState("");
94059
+ const cronExpression = buildCronExpression(schedule2);
94060
+ const nameInputId = "scheduler-create-name";
94061
+ const messageInputId = "scheduler-create-message";
93508
94062
  reactExports.useEffect(() => {
93509
94063
  const handleKeyDown = (e2) => {
93510
94064
  if (e2.key === "Escape") onClose();
@@ -93514,90 +94068,65 @@ function CreateTaskDialog({
93514
94068
  }, [onClose]);
93515
94069
  const handleSubmit = (e2) => {
93516
94070
  e2.preventDefault();
93517
- if (type2 === "agent") {
93518
- onCreate({ type: "agent", name: name2, cronExpression, enabled: true, agentId, message: message2 });
93519
- } else if (type2 === "group") {
94071
+ if (!target2.ownerId || !target2.sessionId) {
94072
+ alert("请选择执行位置和 Session");
94073
+ return;
94074
+ }
94075
+ if (target2.type === "agent") {
94076
+ onCreate({ type: "agent", name: name2, cronExpression, enabled: true, agentId: target2.ownerId, sessionId: target2.sessionId, message: message2 });
94077
+ } else {
93520
94078
  onCreate({
93521
94079
  type: "group",
93522
94080
  name: name2,
93523
94081
  cronExpression,
93524
94082
  enabled: true,
93525
- groupId,
93526
- sessionId: sessionId || void 0,
94083
+ groupId: target2.ownerId,
94084
+ sessionId: target2.sessionId,
93527
94085
  message: message2
93528
94086
  });
93529
- } else {
93530
- onCreate({ type: "memory-update", name: name2, cronExpression, enabled: true });
93531
94087
  }
93532
94088
  };
93533
94089
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$d.dialog, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.dialogContent, children: [
93534
94090
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: t2("scheduler.createTask") }),
93535
94091
  /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: handleSubmit, children: [
93536
- /* @__PURE__ */ jsxRuntimeExports.jsx(
93537
- "input",
93538
- {
93539
- type: "text",
93540
- placeholder: t2("scheduler.taskName"),
93541
- value: name2,
93542
- onChange: (e2) => setName(e2.target.value),
93543
- required: true
93544
- }
93545
- ),
93546
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, { value: type2, onChange: (v2) => setType(v2), children: [
93547
- /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "agent", children: t2("scheduler.agent", "Agent") }),
93548
- /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "group", children: t2("scheduler.group", "Group") }),
93549
- /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "memory-update", children: t2("scheduler.review") })
93550
- ] }),
93551
- /* @__PURE__ */ jsxRuntimeExports.jsx(
93552
- "input",
93553
- {
93554
- type: "text",
93555
- placeholder: "Cron (e.g., 0 9 * * *)",
93556
- value: cronExpression,
93557
- onChange: (e2) => setCronExpression(e2.target.value),
93558
- required: true
93559
- }
93560
- ),
93561
- type2 === "agent" && /* @__PURE__ */ jsxRuntimeExports.jsx(
93562
- "input",
93563
- {
93564
- type: "text",
93565
- placeholder: t2("scheduler.agentId", "Agent ID"),
93566
- value: agentId,
93567
- onChange: (e2) => setAgentId(e2.target.value),
93568
- required: true
93569
- }
93570
- ),
93571
- type2 === "group" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
94092
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.fieldGroup, children: [
94093
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: nameInputId, children: t2("scheduler.taskName") }),
93572
94094
  /* @__PURE__ */ jsxRuntimeExports.jsx(
93573
94095
  "input",
93574
94096
  {
94097
+ id: nameInputId,
93575
94098
  type: "text",
93576
- placeholder: t2("scheduler.groupId", "Group ID"),
93577
- value: groupId,
93578
- onChange: (e2) => setGroupId(e2.target.value),
94099
+ value: name2,
94100
+ onChange: (e2) => setName(e2.target.value),
93579
94101
  required: true
93580
94102
  }
93581
- ),
93582
- /* @__PURE__ */ jsxRuntimeExports.jsx(
93583
- "input",
93584
- {
93585
- type: "text",
93586
- placeholder: t2("scheduler.sessionIdOptional", "Session ID (optional)"),
93587
- value: sessionId,
93588
- onChange: (e2) => setSessionId(e2.target.value)
93589
- }
93590
94103
  )
93591
94104
  ] }),
93592
- type2 !== "memory-update" && /* @__PURE__ */ jsxRuntimeExports.jsx(
93593
- "textarea",
94105
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
94106
+ TaskTargetEditor,
93594
94107
  {
93595
- placeholder: t2("scheduler.message"),
93596
- value: message2,
93597
- onChange: (e2) => setMessage(e2.target.value),
93598
- required: true
94108
+ idPrefix: "scheduler-create",
94109
+ value: target2,
94110
+ onChange: setTarget,
94111
+ agents,
94112
+ groups,
94113
+ currentGroupContext
93599
94114
  }
93600
94115
  ),
94116
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ScheduleEditor, { idPrefix: "scheduler-create", value: schedule2, onChange: setSchedule }),
94117
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.fieldGroup, children: [
94118
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: messageInputId, children: "执行内容" }),
94119
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
94120
+ "textarea",
94121
+ {
94122
+ id: messageInputId,
94123
+ placeholder: "告诉 Agent 要做什么……",
94124
+ value: message2,
94125
+ onChange: (e2) => setMessage(e2.target.value),
94126
+ required: true
94127
+ }
94128
+ )
94129
+ ] }),
93601
94130
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.dialogActions, children: [
93602
94131
  /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "button", variant: "ghost", onClick: onClose, children: t2("common.cancel") }),
93603
94132
  /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "submit", children: t2("common.create") })
@@ -93607,18 +94136,27 @@ function CreateTaskDialog({
93607
94136
  }
93608
94137
  function EditTaskDialog({
93609
94138
  task,
94139
+ agents,
94140
+ groups,
94141
+ currentGroupContext,
93610
94142
  onClose,
93611
94143
  onSave
93612
94144
  }) {
93613
94145
  const { t: t2 } = useTranslation();
93614
94146
  const [name2, setName] = reactExports.useState(task.name);
93615
- const [cronExpression, setCronExpression] = reactExports.useState(task.cronExpression);
93616
- const [agentId, setAgentId] = reactExports.useState(task.type === "agent" ? task.agentId : "");
93617
- const [groupId, setGroupId] = reactExports.useState(task.type === "group" ? task.groupId : "");
93618
- const [sessionId, setSessionId] = reactExports.useState(task.type === "group" ? task.sessionId || "" : "");
94147
+ const [schedule2, setSchedule] = reactExports.useState(() => parseCronExpression(task.cronExpression));
94148
+ const [target2, setTarget] = reactExports.useState(() => {
94149
+ if (task.type === "group") return { type: "group", ownerId: task.groupId, sessionId: task.sessionId ?? "" };
94150
+ if (task.type === "agent") return { type: "agent", ownerId: task.agentId, sessionId: task.sessionId ?? "" };
94151
+ return { type: "agent", ownerId: agents[0]?.id ?? "", sessionId: "" };
94152
+ });
93619
94153
  const [message2, setMessage] = reactExports.useState(
93620
94154
  task.type === "agent" || task.type === "group" ? task.message : ""
93621
94155
  );
94156
+ const cronExpression = buildCronExpression(schedule2);
94157
+ const nextRun = formatNextRun(cronExpression);
94158
+ const nameInputId = `scheduler-edit-${task.id}-name`;
94159
+ const messageInputId = `scheduler-edit-${task.id}-message`;
93622
94160
  reactExports.useEffect(() => {
93623
94161
  const handleKeyDown = (e2) => {
93624
94162
  if (e2.key === "Escape") onClose();
@@ -93628,82 +94166,76 @@ function EditTaskDialog({
93628
94166
  }, [onClose]);
93629
94167
  const handleSubmit = (e2) => {
93630
94168
  e2.preventDefault();
93631
- if (task.type === "agent") {
93632
- onSave({ type: "agent", name: name2, cronExpression, enabled: task.enabled, agentId, message: message2 });
93633
- } else if (task.type === "group") {
94169
+ if (!target2.ownerId || !target2.sessionId) {
94170
+ alert("请选择执行位置和 Session");
94171
+ return;
94172
+ }
94173
+ if (target2.type === "agent") {
94174
+ onSave({ type: "agent", name: name2, cronExpression, enabled: task.enabled, agentId: target2.ownerId, sessionId: target2.sessionId, message: message2 });
94175
+ } else {
93634
94176
  onSave({
93635
94177
  type: "group",
93636
94178
  name: name2,
93637
94179
  cronExpression,
93638
94180
  enabled: task.enabled,
93639
- groupId,
93640
- sessionId: sessionId || void 0,
94181
+ groupId: target2.ownerId,
94182
+ sessionId: target2.sessionId,
93641
94183
  message: message2
93642
94184
  });
93643
- } else {
93644
- onSave({ type: "memory-update", name: name2, cronExpression, enabled: task.enabled });
93645
94185
  }
93646
94186
  };
93647
94187
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$d.dialog, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.dialogContent, children: [
93648
94188
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: t2("scheduler.editTask") }),
94189
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.taskSummary, children: [
94190
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("strong", { children: [
94191
+ "这个任务将",
94192
+ describeCronExpression(cronExpression),
94193
+ "运行"
94194
+ ] }),
94195
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
94196
+ "下一次运行:",
94197
+ nextRun
94198
+ ] })
94199
+ ] }),
93649
94200
  /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: handleSubmit, children: [
93650
- /* @__PURE__ */ jsxRuntimeExports.jsx(
93651
- "input",
93652
- {
93653
- type: "text",
93654
- placeholder: t2("scheduler.taskName"),
93655
- value: name2,
93656
- onChange: (e2) => setName(e2.target.value),
93657
- required: true
93658
- }
93659
- ),
93660
- /* @__PURE__ */ jsxRuntimeExports.jsx(
93661
- "input",
93662
- {
93663
- type: "text",
93664
- placeholder: "Cron",
93665
- value: cronExpression,
93666
- onChange: (e2) => setCronExpression(e2.target.value),
93667
- required: true
93668
- }
93669
- ),
93670
- task.type === "agent" && /* @__PURE__ */ jsxRuntimeExports.jsx(
93671
- "input",
93672
- {
93673
- type: "text",
93674
- placeholder: t2("scheduler.agentId", "Agent ID"),
93675
- value: agentId,
93676
- onChange: (e2) => setAgentId(e2.target.value)
93677
- }
93678
- ),
93679
- task.type === "group" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
94201
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.fieldGroup, children: [
94202
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: nameInputId, children: t2("scheduler.taskName") }),
93680
94203
  /* @__PURE__ */ jsxRuntimeExports.jsx(
93681
94204
  "input",
93682
94205
  {
94206
+ id: nameInputId,
93683
94207
  type: "text",
93684
- placeholder: t2("scheduler.groupId", "Group ID"),
93685
- value: groupId,
93686
- onChange: (e2) => setGroupId(e2.target.value)
93687
- }
93688
- ),
93689
- /* @__PURE__ */ jsxRuntimeExports.jsx(
93690
- "input",
93691
- {
93692
- type: "text",
93693
- placeholder: t2("scheduler.sessionIdOptional", "Session ID (optional)"),
93694
- value: sessionId,
93695
- onChange: (e2) => setSessionId(e2.target.value)
94208
+ value: name2,
94209
+ onChange: (e2) => setName(e2.target.value),
94210
+ required: true
93696
94211
  }
93697
94212
  )
93698
94213
  ] }),
93699
- task.type !== "memory-update" && /* @__PURE__ */ jsxRuntimeExports.jsx(
93700
- "textarea",
94214
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
94215
+ TaskTargetEditor,
93701
94216
  {
93702
- placeholder: t2("scheduler.message"),
93703
- value: message2,
93704
- onChange: (e2) => setMessage(e2.target.value)
94217
+ idPrefix: `scheduler-edit-${task.id}`,
94218
+ value: target2,
94219
+ onChange: setTarget,
94220
+ agents,
94221
+ groups,
94222
+ currentGroupContext
93705
94223
  }
93706
94224
  ),
94225
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ScheduleEditor, { idPrefix: `scheduler-edit-${task.id}`, value: schedule2, onChange: setSchedule }),
94226
+ (task.type === "agent" || task.type === "group") && !task.sessionId && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$d.legacyNotice, children: "旧任务未指定 Session,保存后将固定到当前选择的 Session。" }),
94227
+ task.type !== "memory-update" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.fieldGroup, children: [
94228
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: messageInputId, children: "执行内容" }),
94229
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
94230
+ "textarea",
94231
+ {
94232
+ id: messageInputId,
94233
+ placeholder: "告诉 Agent 要做什么……",
94234
+ value: message2,
94235
+ onChange: (e2) => setMessage(e2.target.value)
94236
+ }
94237
+ )
94238
+ ] }),
93707
94239
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$d.dialogActions, children: [
93708
94240
  /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "button", variant: "ghost", onClick: onClose, children: t2("common.cancel") }),
93709
94241
  /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "submit", children: t2("common.save") })
@@ -97985,7 +98517,7 @@ function useSidebarSearch() {
97985
98517
  searchInputRef
97986
98518
  };
97987
98519
  }
97988
- const version = "1.10.2";
98520
+ const version = "1.10.3";
97989
98521
  const pkg = {
97990
98522
  version
97991
98523
  };