@kingsoftcloud/ksadk-web 0.3.17 → 0.3.19

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 (204) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +2 -2
  3. package/RELEASE_PROVENANCE.json +2 -2
  4. package/dist-ksadk/assets/{ArtifactsPanel-DYzXIPnl.js → ArtifactsPanel-cjsDWTLW.js} +1 -1
  5. package/dist-ksadk/assets/{CodeBlock-Dpa-tOmG.js → CodeBlock-DTtT6SBI.js} +1 -1
  6. package/dist-ksadk/assets/{MathMessageMarkdown-D8kBE9sl.js → MathMessageMarkdown-Dap7DsE1.js} +1 -1
  7. package/dist-ksadk/assets/{MermaidBlock-BYOoZB-_.js → MermaidBlock-C2QkLej8.js} +6 -6
  8. package/dist-ksadk/assets/{NativeTerminalPanel-CAeXHeo6.js → NativeTerminalPanel-CeLWBCnF.js} +1 -1
  9. package/dist-ksadk/assets/{OfficialA2uiRenderer-yPb3s23n.js → OfficialA2uiRenderer-BshRBsxZ.js} +1 -1
  10. package/dist-ksadk/assets/{abnfDiagram-VCTEODGH-DdVxMn2L.js → abnfDiagram-VCTEODGH-RvCk4kKS.js} +1 -1
  11. package/dist-ksadk/assets/{arc-DsOMYRTm.js → arc-R-NvbHBi.js} +1 -1
  12. package/dist-ksadk/assets/architecture-7GRP2DOG-BgT_ltgS.js +1 -0
  13. package/dist-ksadk/assets/{architectureDiagram-5GKGNRK7-BCfzi23_.js → architectureDiagram-5GKGNRK7-CWyeEVzn.js} +1 -1
  14. package/dist-ksadk/assets/{blockDiagram-NRAW4CY4-gC-Gc2Xv.js → blockDiagram-NRAW4CY4-CHbhUWj9.js} +1 -1
  15. package/dist-ksadk/assets/{c4Diagram-UCG6FXSJ-BAHemGZa.js → c4Diagram-UCG6FXSJ-BJAftB45.js} +1 -1
  16. package/dist-ksadk/assets/channel-CO8jKUdU.js +1 -0
  17. package/dist-ksadk/assets/chunk-2Q5K7J3B-BQ7ktM_H.js +1 -0
  18. package/dist-ksadk/assets/{chunk-5VM5RSS4-Cthhs8Yv.js → chunk-5VM5RSS4-BHufOSfh.js} +1 -1
  19. package/dist-ksadk/assets/{chunk-F27PBJKO-BPV04XpW.js → chunk-F27PBJKO-BNPW42o9.js} +1 -1
  20. package/dist-ksadk/assets/{chunk-G27WJ6UU-Cl1n0gHd.js → chunk-G27WJ6UU-D_eOFZiC.js} +1 -1
  21. package/dist-ksadk/assets/{chunk-JWPE2WC7-DqkIh_LK.js → chunk-JWPE2WC7-DEVN_PSR.js} +1 -1
  22. package/dist-ksadk/assets/{chunk-LCL6LL3I-DZhAKY7Z.js → chunk-LCL6LL3I-DjGV_Lnh.js} +1 -1
  23. package/dist-ksadk/assets/{chunk-POPQ4Y6H-BGuhTofV.js → chunk-POPQ4Y6H-C2i8ZB07.js} +1 -1
  24. package/dist-ksadk/assets/{chunk-RHFEMEQ7-DhrRHdJ6.js → chunk-RHFEMEQ7-DMk7_iWC.js} +1 -1
  25. package/dist-ksadk/assets/{chunk-SVP7TREG-CIdm5TIa.js → chunk-SVP7TREG-wHQkXddN.js} +1 -1
  26. package/dist-ksadk/assets/{chunk-XXDRQBXY-CNIlGK4v.js → chunk-XXDRQBXY-gvpc9yiQ.js} +1 -1
  27. package/dist-ksadk/assets/classDiagram-DTDB5LWJ-HRhUD6oW.js +1 -0
  28. package/dist-ksadk/assets/classDiagram-v2-JRS7N3AN-HRhUD6oW.js +1 -0
  29. package/dist-ksadk/assets/{cose-bilkent-JH36ORCC-BjauSFl3.js → cose-bilkent-JH36ORCC-BF-zBbK8.js} +1 -1
  30. package/dist-ksadk/assets/cynefin-OW5HDTMX-DlLbgFtT.js +1 -0
  31. package/dist-ksadk/assets/{cynefinDiagram-5FMLGOSQ-DPszkr1j.js → cynefinDiagram-5FMLGOSQ-0_hg7nkA.js} +1 -1
  32. package/dist-ksadk/assets/{dagre-3AP2YEHR-Ds2xBGA0.js → dagre-3AP2YEHR-uSuKjV2i.js} +1 -1
  33. package/dist-ksadk/assets/{dagre-Dr0YPDPm.js → dagre-BCQPdEAN.js} +1 -1
  34. package/dist-ksadk/assets/{diagram-S7CK7UJ4-BOQfgaW5.js → diagram-S7CK7UJ4-ay17NfAC.js} +1 -1
  35. package/dist-ksadk/assets/{diagram-UQ7AKVKN-DMMyB2sa.js → diagram-UQ7AKVKN-CaUhPrNE.js} +1 -1
  36. package/dist-ksadk/assets/{diagram-VSXAHHWV-DZR1nzPa.js → diagram-VSXAHHWV-upF8B0NL.js} +1 -1
  37. package/dist-ksadk/assets/{diagram-VX7I27RA-DzAwLHuI.js → diagram-VX7I27RA-B4t46LEt.js} +1 -1
  38. package/dist-ksadk/assets/{diagram-Z3DM3KII-D98d_Dgt.js → diagram-Z3DM3KII-BeHjswE7.js} +1 -1
  39. package/dist-ksadk/assets/{dist-A55dc8b7.js → dist-58qYwY0M.js} +1 -1
  40. package/dist-ksadk/assets/{dist-By8HbjFH.js → dist-AF7gi0D5.js} +1 -1
  41. package/dist-ksadk/assets/{dist-HuJDn2Nr.js → dist-B0PMHWqd.js} +1 -1
  42. package/dist-ksadk/assets/{dist-U51Rn7ZW.js → dist-B0s4RUpo.js} +1 -1
  43. package/dist-ksadk/assets/{dist-glVlUB_d.js → dist-BGzoFqM2.js} +1 -1
  44. package/dist-ksadk/assets/{dist-BHIb3Gvv.js → dist-BLCD6xMk.js} +1 -1
  45. package/dist-ksadk/assets/{dist-BIR7kFKG.js → dist-Be3VXZq8.js} +1 -1
  46. package/dist-ksadk/assets/{dist-CpHO1CY1.js → dist-Bt0YWq2H.js} +1 -1
  47. package/dist-ksadk/assets/{dist-BEzIxZLq.js → dist-Bt4Xk1Ro.js} +1 -1
  48. package/dist-ksadk/assets/{dist-D9GtQnvz.js → dist-Bx4az-XW.js} +1 -1
  49. package/dist-ksadk/assets/{dist-DHiOUJJ-.js → dist-C577ALLK.js} +1 -1
  50. package/dist-ksadk/assets/{dist-DxBl1V2_.js → dist-CIZ7o8ol.js} +1 -1
  51. package/dist-ksadk/assets/{dist-CxzBVC3N.js → dist-COzkztpc.js} +1 -1
  52. package/dist-ksadk/assets/{dist-CN8MSPvo.js → dist-CW5ZHS5y.js} +1 -1
  53. package/dist-ksadk/assets/{dist-Du5KbDTg.js → dist-CdhMAiGd.js} +1 -1
  54. package/dist-ksadk/assets/{dist-MMIlBueM.js → dist-DIeaHG12.js} +1 -1
  55. package/dist-ksadk/assets/{dist-BpZXLW0T.js → dist-DfFlb9ip.js} +1 -1
  56. package/dist-ksadk/assets/{dist-C1uAMNTH.js → dist-DvOmTQAV.js} +1 -1
  57. package/dist-ksadk/assets/{dist-VLWgeZIu.js → dist-Dze75pZq.js} +1 -1
  58. package/dist-ksadk/assets/{dist-E1uwqlZY.js → dist-h0bOCJVW.js} +1 -1
  59. package/dist-ksadk/assets/{dist-q8rONmMl.js → dist-mkEF0-z9.js} +1 -1
  60. package/dist-ksadk/assets/{dist-X8Mgnqit.js → dist-uAoeCAZ2.js} +1 -1
  61. package/dist-ksadk/assets/{ebnfDiagram-PWID7BFC-X4mBLaw3.js → ebnfDiagram-PWID7BFC-CZKqGdhK.js} +1 -1
  62. package/dist-ksadk/assets/{erDiagram-SSCWMZ5O-ClybQoOy.js → erDiagram-SSCWMZ5O-CfQ9oOg4.js} +1 -1
  63. package/dist-ksadk/assets/eventmodeling-NTZA5JFV-BgSxiUqa.js +1 -0
  64. package/dist-ksadk/assets/flowDiagram-A5DVABFB-Dcg0DKL0.js +1 -0
  65. package/dist-ksadk/assets/{ganttDiagram-EL5Y4UJY-Dc_fWiA_.js → ganttDiagram-EL5Y4UJY-CWdRcbsA.js} +1 -1
  66. package/dist-ksadk/assets/gitGraph-4MIJSDKK-DiYbIL_1.js +1 -0
  67. package/dist-ksadk/assets/{gitGraphDiagram-WWUBYQGX-0eEV_CEC.js → gitGraphDiagram-WWUBYQGX-S2TxceQ8.js} +1 -1
  68. package/dist-ksadk/assets/index-CK5of5EC.js +1135 -0
  69. package/dist-ksadk/assets/index-ofLgkIsP.css +2 -0
  70. package/dist-ksadk/assets/info-A6RAGUB7-CIUhUhPM.js +1 -0
  71. package/dist-ksadk/assets/{infoDiagram-RXCK75RN-mZoyw4Xh.js → infoDiagram-RXCK75RN-7M0hPUvw.js} +1 -1
  72. package/dist-ksadk/assets/{ishikawaDiagram-5VMMS53U-CO8OkxgJ.js → ishikawaDiagram-5VMMS53U-DApt_KC9.js} +1 -1
  73. package/dist-ksadk/assets/{journeyDiagram-EYS64GPL-Ci8GpXLK.js → journeyDiagram-EYS64GPL-03NWnwcI.js} +1 -1
  74. package/dist-ksadk/assets/{kanban-definition-3QL26DDD-lgD5AYON.js → kanban-definition-3QL26DDD-CWrM-ciB.js} +1 -1
  75. package/dist-ksadk/assets/{katex-Chn0O-XC.js → katex-CVJEnrQQ.js} +1 -1
  76. package/dist-ksadk/assets/{linear-ffygyi0f.js → linear-CuvdttYn.js} +1 -1
  77. package/dist-ksadk/assets/{mermaid-parser.core-CGPz1_57.js → mermaid-parser.core-CyiGaINC.js} +2 -2
  78. package/dist-ksadk/assets/{mindmap-definition-FBJOCRG2-DRaJyZGQ.js → mindmap-definition-FBJOCRG2-Cx8x9zok.js} +1 -1
  79. package/dist-ksadk/assets/packet-AYTQ26CC-CVt8vTzN.js +1 -0
  80. package/dist-ksadk/assets/{pegDiagram-XKGWAZYB-BbQ2QDD3.js → pegDiagram-XKGWAZYB-BvMeLOBU.js} +1 -1
  81. package/dist-ksadk/assets/pie-WAS4IAKB-BmY8d_KC.js +1 -0
  82. package/dist-ksadk/assets/{pieDiagram-E7YTZNPT-BcB_c4Ka.js → pieDiagram-E7YTZNPT-BTEiUEUk.js} +1 -1
  83. package/dist-ksadk/assets/{quadrantDiagram-AXDQQJYC-CK3csxHk.js → quadrantDiagram-AXDQQJYC-CEMfGgSc.js} +1 -1
  84. package/dist-ksadk/assets/radar-RG4KPBEZ-D-vxRTHO.js +1 -0
  85. package/dist-ksadk/assets/railroad-74A4TZTK-hDbxS9Gl.js +1 -0
  86. package/dist-ksadk/assets/railroad-abnf-HS5TGJTU-6j4dsPir.js +1 -0
  87. package/dist-ksadk/assets/railroad-ebnf-LZEXJU2U-f3r0amOv.js +1 -0
  88. package/dist-ksadk/assets/railroad-peg-WCYAUIDC-DpGM5wUK.js +1 -0
  89. package/dist-ksadk/assets/{railroadDiagram-O6MQD6OU-D1YLglVU.js → railroadDiagram-O6MQD6OU-DjL0Ielv.js} +1 -1
  90. package/dist-ksadk/assets/{requirementDiagram-EFPCY7ZU-VeyqOcw3.js → requirementDiagram-EFPCY7ZU-Da11svpD.js} +1 -1
  91. package/dist-ksadk/assets/{sankeyDiagram-P5KCCOFB-uskDVCah.js → sankeyDiagram-P5KCCOFB-DtKGEnlF.js} +1 -1
  92. package/dist-ksadk/assets/{sequenceDiagram-WJ2MYXX4-CmoPC4aR.js → sequenceDiagram-WJ2MYXX4-CR6Ct1Vm.js} +1 -1
  93. package/dist-ksadk/assets/{sizeCapture-X5ZJPWSS-DzV4X5WN.js → sizeCapture-X5ZJPWSS-DaQE2An6.js} +1 -1
  94. package/dist-ksadk/assets/{stateDiagram-HBIQ2CUA-BJehrZbH.js → stateDiagram-HBIQ2CUA-Ct2KGWos.js} +1 -1
  95. package/dist-ksadk/assets/stateDiagram-v2-4QOOHH4V-IHXiAplS.js +1 -0
  96. package/dist-ksadk/assets/{swimlanes-XN3QIQJK-Bn4tEi27.js → swimlanes-XN3QIQJK-BpIOaZ-N.js} +1 -1
  97. package/dist-ksadk/assets/swimlanesDiagram-VK2B7HYN-ByC69bCd.js +8 -0
  98. package/dist-ksadk/assets/{timeline-definition-24CTP7MA-bSkaKxqF.js → timeline-definition-24CTP7MA-CdwbtpKP.js} +1 -1
  99. package/dist-ksadk/assets/treeView-Q6P3EWNA-Bm72pNZV.js +1 -0
  100. package/dist-ksadk/assets/treemap-WGGIJYW6-Dpgkdt4o.js +1 -0
  101. package/dist-ksadk/assets/{vennDiagram-4TSXK5OY-ClO6s5iT.js → vennDiagram-4TSXK5OY-Dr_5LEwY.js} +1 -1
  102. package/dist-ksadk/assets/wardley-WFR3VGLG-C9w6FZRL.js +1 -0
  103. package/dist-ksadk/assets/{wardleyDiagram-VM6X3IG4-CcaYar33.js → wardleyDiagram-VM6X3IG4-DYojPjE8.js} +1 -1
  104. package/dist-ksadk/assets/{xychartDiagram-S5SC5T6Z-DdiPl8uB.js → xychartDiagram-S5SC5T6Z-DV3dpSiv.js} +1 -1
  105. package/dist-ksadk/index.html +2 -2
  106. package/dist-lib/App.d.ts.map +1 -1
  107. package/dist-lib/{AttachmentPreview-DHvWB_a-.js → AttachmentPreview-COS-HmHj.js} +121 -121
  108. package/dist-lib/{ConnectedComposer-CuN3EUnU.js → ConnectedComposer-CB_YmxRQ.js} +246 -246
  109. package/dist-lib/{ConnectedMessageList-CT-MJJkJ.js → ConnectedMessageList-CJgvv-Hi.js} +379 -294
  110. package/dist-lib/{WorkspacePanelContainer-Jg9bUmLJ.js → WorkspacePanelContainer-DU6mKsi5.js} +5 -5
  111. package/dist-lib/{a2ui-DridcTyF.js → a2ui-e0gsVo7e.js} +336 -527
  112. package/dist-lib/api/client.d.ts +2 -1
  113. package/dist-lib/api/client.d.ts.map +1 -1
  114. package/dist-lib/api/messages.d.ts +38 -0
  115. package/dist-lib/api/messages.d.ts.map +1 -1
  116. package/dist-lib/{capabilities-lJRDfRg9.js → capabilities-CHy70QGW.js} +5 -2
  117. package/dist-lib/capabilities.js +1 -1
  118. package/dist-lib/chat-composer.js +2 -2
  119. package/dist-lib/chat-timeline.js +5 -5
  120. package/dist-lib/components/chat/ChatMessageList.d.ts.map +1 -1
  121. package/dist-lib/components/chat/ConnectedMessageList.d.ts.map +1 -1
  122. package/dist-lib/components/chat/DeferredHistoryContent.d.ts +6 -0
  123. package/dist-lib/components/chat/DeferredHistoryContent.d.ts.map +1 -0
  124. package/dist-lib/components/chat/ProcessingBlocksView.d.ts +1 -8
  125. package/dist-lib/components/chat/ProcessingBlocksView.d.ts.map +1 -1
  126. package/dist-lib/components/chat/submitted-interaction-history.d.ts.map +1 -1
  127. package/dist-lib/components/chat/types.d.ts +11 -0
  128. package/dist-lib/components/chat/types.d.ts.map +1 -1
  129. package/dist-lib/components.js +14 -14
  130. package/dist-lib/conversation.js +2 -2
  131. package/dist-lib/core/api/facade.d.ts +2 -14
  132. package/dist-lib/core/api/facade.d.ts.map +1 -1
  133. package/dist-lib/core/api/types.d.ts +1 -24
  134. package/dist-lib/core/api/types.d.ts.map +1 -1
  135. package/dist-lib/core/run/blocks.d.ts +4 -2
  136. package/dist-lib/core/run/blocks.d.ts.map +1 -1
  137. package/dist-lib/core/run/dispatcher.d.ts.map +1 -1
  138. package/dist-lib/core/run/engine.d.ts +5 -1
  139. package/dist-lib/core/run/engine.d.ts.map +1 -1
  140. package/dist-lib/core/run/types.d.ts +13 -0
  141. package/dist-lib/core/run/types.d.ts.map +1 -1
  142. package/dist-lib/core/stream/types.d.ts +7 -0
  143. package/dist-lib/core/stream/types.d.ts.map +1 -1
  144. package/dist-lib/{feedback-CaSZOBD2.js → feedback-nyK8zFEK.js} +1 -1
  145. package/dist-lib/hooks/useAgentChat.d.ts +1 -1
  146. package/dist-lib/hooks/useAgentChat.d.ts.map +1 -1
  147. package/dist-lib/hooks/useInteractions.d.ts +1 -1
  148. package/dist-lib/hooks/useInteractions.d.ts.map +1 -1
  149. package/dist-lib/hooks/useRunAgent.d.ts +1 -0
  150. package/dist-lib/hooks/useRunAgent.d.ts.map +1 -1
  151. package/dist-lib/hooks/useSessionLifecycle.d.ts +3 -1
  152. package/dist-lib/hooks/useSessionLifecycle.d.ts.map +1 -1
  153. package/dist-lib/hooks.js +120 -119
  154. package/dist-lib/{permission-2NpSBuq3.js → permission-B9NRAmxP.js} +1 -1
  155. package/dist-lib/{persisted-session-history-D_1AtH5H.js → persisted-session-history-C8S6Tl-E.js} +482 -380
  156. package/dist-lib/runtime.js +178 -176
  157. package/dist-lib/{session-events-6PXUoAkP.js → session-events-BMRjrPq2.js} +542 -292
  158. package/dist-lib/stores/session.d.ts +4 -0
  159. package/dist-lib/stores/session.d.ts.map +1 -1
  160. package/dist-lib/styles.css +1 -1
  161. package/dist-lib/{useSessionLifecycle-daQg0sqQ.js → useSessionLifecycle-DPwSsODU.js} +1874 -1096
  162. package/dist-lib/utils/capabilities.d.ts +1 -0
  163. package/dist-lib/utils/capabilities.d.ts.map +1 -1
  164. package/dist-lib/utils/history-content.d.ts +16 -0
  165. package/dist-lib/utils/history-content.d.ts.map +1 -0
  166. package/dist-lib/utils/history-tool-facts.d.ts.map +1 -1
  167. package/dist-lib/utils/persisted-session-history.d.ts +1 -1
  168. package/dist-lib/utils/persisted-session-history.d.ts.map +1 -1
  169. package/dist-lib/utils/responses-stream.d.ts +3 -1
  170. package/dist-lib/utils/responses-stream.d.ts.map +1 -1
  171. package/dist-lib/utils/run-progress.d.ts.map +1 -1
  172. package/dist-lib/utils/session-event-history.d.ts +13 -0
  173. package/dist-lib/utils/session-event-history.d.ts.map +1 -1
  174. package/dist-lib/utils/session-events.d.ts +4 -1
  175. package/dist-lib/utils/session-events.d.ts.map +1 -1
  176. package/dist-lib/utils/session-items.d.ts +36 -0
  177. package/dist-lib/utils/session-items.d.ts.map +1 -0
  178. package/dist-lib/utils/transcript-order.d.ts +2 -1
  179. package/dist-lib/utils/transcript-order.d.ts.map +1 -1
  180. package/package.json +1 -1
  181. package/dist-ksadk/assets/architecture-7GRP2DOG-Ds1NB530.js +0 -1
  182. package/dist-ksadk/assets/channel-B4PiWfnA.js +0 -1
  183. package/dist-ksadk/assets/chunk-2Q5K7J3B-CI2tn5IS.js +0 -1
  184. package/dist-ksadk/assets/classDiagram-DTDB5LWJ-BMQzydMm.js +0 -1
  185. package/dist-ksadk/assets/classDiagram-v2-JRS7N3AN-BMQzydMm.js +0 -1
  186. package/dist-ksadk/assets/cynefin-OW5HDTMX-DcGwq_cA.js +0 -1
  187. package/dist-ksadk/assets/eventmodeling-NTZA5JFV--IdqCKdV.js +0 -1
  188. package/dist-ksadk/assets/flowDiagram-A5DVABFB-BsidNZBX.js +0 -1
  189. package/dist-ksadk/assets/gitGraph-4MIJSDKK-BTqI4bBo.js +0 -1
  190. package/dist-ksadk/assets/index-B0DeBpyZ.js +0 -1132
  191. package/dist-ksadk/assets/index-DEVfafsU.css +0 -2
  192. package/dist-ksadk/assets/info-A6RAGUB7-CXZCoW0H.js +0 -1
  193. package/dist-ksadk/assets/packet-AYTQ26CC-DoZlIRtk.js +0 -1
  194. package/dist-ksadk/assets/pie-WAS4IAKB-Dl-IyMT_.js +0 -1
  195. package/dist-ksadk/assets/radar-RG4KPBEZ-Bp8MemxX.js +0 -1
  196. package/dist-ksadk/assets/railroad-74A4TZTK-BmKyKako.js +0 -1
  197. package/dist-ksadk/assets/railroad-abnf-HS5TGJTU-DhFitwOH.js +0 -1
  198. package/dist-ksadk/assets/railroad-ebnf-LZEXJU2U-TB8LQz8q.js +0 -1
  199. package/dist-ksadk/assets/railroad-peg-WCYAUIDC-B3J1Rtq9.js +0 -1
  200. package/dist-ksadk/assets/stateDiagram-v2-4QOOHH4V-DkujIgVj.js +0 -1
  201. package/dist-ksadk/assets/swimlanesDiagram-VK2B7HYN-Blb1TQ9Q.js +0 -8
  202. package/dist-ksadk/assets/treeView-Q6P3EWNA-C5Ez-6L4.js +0 -1
  203. package/dist-ksadk/assets/treemap-WGGIJYW6-WdNvoGQV.js +0 -1
  204. package/dist-ksadk/assets/wardley-WFR3VGLG-DCCceTuX.js +0 -1
@@ -1,23 +1,23 @@
1
- import { i as e, o as t } from "./capabilities-lJRDfRg9.js";
2
- import { f as n, p as r, s as i } from "./session-events-6PXUoAkP.js";
3
- import { createContext as a, useContext as o } from "react";
4
- import { create as s } from "zustand";
5
- import { jsx as c } from "react/jsx-runtime";
6
- import { z as l } from "zod";
7
- import u from "ajv";
8
- import d from "ajv/dist/2019.js";
9
- import f from "ajv/dist/2020.js";
10
- import p from "ajv-draft-04";
11
- import m from "ajv-formats";
12
- import { canonicalize as h } from "json-canonicalize";
13
- import { sha256 as ee } from "@noble/hashes/sha2.js";
14
- import { bytesToHex as te } from "@noble/hashes/utils.js";
15
- import { Catalog as g, MessageProcessor as ne, createFunctionImplementation as re } from "@a2ui/web_core/v0_9";
1
+ import { a as e, s as t } from "./capabilities-CHy70QGW.js";
2
+ import { S as n, b as r, f as i, s as a, y as o } from "./session-events-BMRjrPq2.js";
3
+ import { createContext as s, useContext as c } from "react";
4
+ import { create as l } from "zustand";
5
+ import { jsx as u } from "react/jsx-runtime";
6
+ import { z as d } from "zod";
7
+ import f from "ajv";
8
+ import p from "ajv/dist/2019.js";
9
+ import m from "ajv/dist/2020.js";
10
+ import h from "ajv-draft-04";
11
+ import g from "ajv-formats";
12
+ import { canonicalize as ee } from "json-canonicalize";
13
+ import { sha256 as te } from "@noble/hashes/sha2.js";
14
+ import { bytesToHex as ne } from "@noble/hashes/utils.js";
15
+ import { Catalog as _, MessageProcessor as re, createFunctionImplementation as ie } from "@a2ui/web_core/v0_9";
16
16
  //#region src/stores/ui.ts
17
- function ie(e, t) {
17
+ function ae(e, t) {
18
18
  return typeof t == "function" ? t(e) : t;
19
19
  }
20
- var ae = s()((e) => ({
20
+ var oe = l()((e) => ({
21
21
  sidebarOpen: !0,
22
22
  mobileSidebarOpen: !1,
23
23
  mobileActionsOpen: !1,
@@ -40,10 +40,10 @@ var ae = s()((e) => ({
40
40
  setWorkspacePanelWidth: (t) => e({ workspacePanelWidth: t }),
41
41
  setWorkspacePanelFullscreen: (t) => e({ workspacePanelFullscreen: t }),
42
42
  setInput: (t) => e({ input: t }),
43
- setAttachments: (t) => e((e) => ({ attachments: ie(e.attachments, t) })),
43
+ setAttachments: (t) => e((e) => ({ attachments: ae(e.attachments, t) })),
44
44
  setPreviewAttachment: (t) => e({ previewAttachment: t }),
45
45
  setPreviewImageSize: (t) => e({ previewImageSize: t }),
46
- setQueuedDrafts: (t) => e((e) => ({ queuedDrafts: ie(e.queuedDrafts, t) })),
46
+ setQueuedDrafts: (t) => e((e) => ({ queuedDrafts: ae(e.queuedDrafts, t) })),
47
47
  pushToast: (t, n = "info") => e((e) => ({ toasts: [...e.toasts, {
48
48
  id: String(Date.now() + Math.random()),
49
49
  message: t,
@@ -51,14 +51,14 @@ var ae = s()((e) => ({
51
51
  createdAt: Date.now()
52
52
  }] })),
53
53
  dismissToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) }))
54
- })), _ = (e) => Object.keys(e).length > 0, oe = {
54
+ })), v = (e) => Object.keys(e).length > 0, se = {
55
55
  runId: null,
56
56
  status: null,
57
57
  items: []
58
- }, v = new r(), y = (e, t) => {
58
+ }, y = new n(), b = (e, t) => {
59
59
  let n = { ...e };
60
60
  return delete n[t], n;
61
- }, se = s()((e, t) => ({
61
+ }, ce = l()((e, t) => ({
62
62
  isStreaming: !1,
63
63
  currentRunId: "",
64
64
  stopRequested: !1,
@@ -68,7 +68,7 @@ var ae = s()((e) => ({
68
68
  banner: null,
69
69
  lastSeqId: 0,
70
70
  activeInvocationId: "",
71
- runtimeItems: oe,
71
+ runtimeItems: se,
72
72
  setStreaming: (t) => e({ isStreaming: t }),
73
73
  setBanner: (t) => e({ banner: t ? {
74
74
  ...t,
@@ -77,13 +77,13 @@ var ae = s()((e) => ({
77
77
  setLastSeqId: (t) => e({ lastSeqId: t }),
78
78
  setActiveInvocationId: (t) => e({ activeInvocationId: t }),
79
79
  setSessionStreaming: (t, n) => e((e) => {
80
- let r = String(t || ""), i = y(e.sessionStreaming, r), a = n ? {
80
+ let r = String(t || ""), i = b(e.sessionStreaming, r), a = n ? {
81
81
  ...i,
82
82
  [r]: !0
83
83
  } : i;
84
84
  return {
85
85
  sessionStreaming: a,
86
- isStreaming: _(a)
86
+ isStreaming: v(a)
87
87
  };
88
88
  }),
89
89
  isSessionStreaming: (e) => {
@@ -130,7 +130,7 @@ var ae = s()((e) => ({
130
130
  eventCount: t.countEvent === !1 ? 0 : 1
131
131
  };
132
132
  return n ? {
133
- isStreaming: _(e.sessionStreaming),
133
+ isStreaming: v(e.sessionStreaming),
134
134
  sessionActivities: {
135
135
  ...e.sessionActivities,
136
136
  [n]: i
@@ -163,9 +163,9 @@ var ae = s()((e) => ({
163
163
  }, s = {
164
164
  ...e.sessionActivities,
165
165
  [i]: o
166
- }, c = y(e.sessionStreaming, i);
166
+ }, c = b(e.sessionStreaming, i);
167
167
  return {
168
- isStreaming: _(c),
168
+ isStreaming: v(c),
169
169
  ...r ? {
170
170
  activity: o,
171
171
  stopRequested: !0
@@ -178,19 +178,19 @@ var ae = s()((e) => ({
178
178
  clearSessionActivity: (t) => e((e) => {
179
179
  let n = String(t || "");
180
180
  if (!n) return {};
181
- let { [n]: r, ...i } = e.sessionActivities, a = y(e.sessionStreaming, n);
181
+ let { [n]: r, ...i } = e.sessionActivities, a = b(e.sessionStreaming, n);
182
182
  return {
183
183
  sessionActivities: i,
184
184
  sessionStreaming: a,
185
- isStreaming: _(a),
185
+ isStreaming: v(a),
186
186
  activity: e.activity === r ? null : e.activity
187
187
  };
188
188
  }),
189
189
  applyRuntimeItemOperations: (t) => {
190
- v.applyAll(t), e({ runtimeItems: v.snapshot() });
190
+ y.applyAll(t), e({ runtimeItems: y.snapshot() });
191
191
  },
192
192
  resetRun: () => {
193
- v = new r(), e({
193
+ y = new n(), e({
194
194
  isStreaming: !1,
195
195
  currentRunId: "",
196
196
  stopRequested: !1,
@@ -199,13 +199,13 @@ var ae = s()((e) => ({
199
199
  sessionStreaming: {},
200
200
  lastSeqId: 0,
201
201
  activeInvocationId: "",
202
- runtimeItems: oe
202
+ runtimeItems: se
203
203
  });
204
204
  }
205
205
  }));
206
206
  //#endregion
207
207
  //#region src/stores/model.ts
208
- function ce(e, t) {
208
+ function le(e, t) {
209
209
  let n = /* @__PURE__ */ new Map();
210
210
  for (let t of e) t?.id && n.set(t.id, t);
211
211
  for (let e of t) e?.id && n.set(e.id, {
@@ -214,13 +214,13 @@ function ce(e, t) {
214
214
  });
215
215
  return Array.from(n.values()).sort((e, t) => e.id.localeCompare(t.id));
216
216
  }
217
- var le = s()((e) => ({
217
+ var ue = l()((e) => ({
218
218
  availableModels: [],
219
219
  selectedModel: "",
220
220
  modelSource: "",
221
221
  modelCatalogLoaded: !1,
222
222
  thinkingMode: "auto",
223
- upsertModels: (t) => e((e) => ({ availableModels: ce(e.availableModels, t) })),
223
+ upsertModels: (t) => e((e) => ({ availableModels: le(e.availableModels, t) })),
224
224
  setSelectedModel: (t) => e({ selectedModel: t }),
225
225
  setModelSource: (t) => e({ modelSource: t }),
226
226
  setModelCatalogLoaded: (t) => e({ modelCatalogLoaded: t }),
@@ -231,7 +231,7 @@ var le = s()((e) => ({
231
231
  modelSource: "",
232
232
  modelCatalogLoaded: !1
233
233
  })
234
- })), b = new class {
234
+ })), x = new class {
235
235
  initialized = !1;
236
236
  scope;
237
237
  blocked = !1;
@@ -251,7 +251,7 @@ var le = s()((e) => ({
251
251
  }();
252
252
  //#endregion
253
253
  //#region src/utils/session-pagination.js
254
- function x(e = /* @__PURE__ */ new Set(), t = []) {
254
+ function S(e = /* @__PURE__ */ new Set(), t = []) {
255
255
  let n = new Set(e);
256
256
  for (let e of t) {
257
257
  let t = Number(e);
@@ -259,17 +259,17 @@ function x(e = /* @__PURE__ */ new Set(), t = []) {
259
259
  }
260
260
  return new Set(Array.from(n).sort((e, t) => e - t));
261
261
  }
262
- function ue({ sessionsLength: e = 0, total: t = 0, page: n = 0, pageSize: r = 30, loadedPages: i = /* @__PURE__ */ new Set() } = {}) {
262
+ function de({ sessionsLength: e = 0, total: t = 0, page: n = 0, pageSize: r = 30, loadedPages: i = /* @__PURE__ */ new Set() } = {}) {
263
263
  let a = Math.max(0, Number(t) || 0), o = Math.max(0, Number(e) || 0);
264
264
  return {
265
265
  total: a,
266
266
  page: Math.max(0, Number(n) || 0),
267
267
  pageSize: Math.max(1, Number(r) || 30),
268
- loadedPages: x(i),
268
+ loadedPages: S(i),
269
269
  hasMore: o < a
270
270
  };
271
271
  }
272
- function de({ total: e = 0, pageSize: t = 30, loadedPages: n = /* @__PURE__ */ new Set() } = {}) {
272
+ function fe({ total: e = 0, pageSize: t = 30, loadedPages: n = /* @__PURE__ */ new Set() } = {}) {
273
273
  let r = Math.max(0, Number(e) || 0), i = Math.max(1, Number(t) || 30);
274
274
  if (r <= 0) return null;
275
275
  let a = Math.ceil(r / i);
@@ -278,7 +278,7 @@ function de({ total: e = 0, pageSize: t = 30, loadedPages: n = /* @__PURE__ */ n
278
278
  }
279
279
  //#endregion
280
280
  //#region src/stores/session.ts
281
- function fe(e) {
281
+ function pe(e) {
282
282
  let t = e.UpdatedAt;
283
283
  if (typeof t == "string") {
284
284
  let e = Date.parse(t);
@@ -286,37 +286,37 @@ function fe(e) {
286
286
  }
287
287
  return typeof t == "number" && Number.isFinite(t) ? t > 1e11 ? t : t * 1e3 : 0;
288
288
  }
289
- var pe = "ksadk.pinnedSessionIds";
290
- function me() {
289
+ var me = "ksadk.pinnedSessionIds";
290
+ function he() {
291
291
  try {
292
- let e = globalThis.localStorage?.getItem(b.key(pe)), t = e ? JSON.parse(e) : [];
292
+ let e = globalThis.localStorage?.getItem(x.key(me)), t = e ? JSON.parse(e) : [];
293
293
  return Array.isArray(t) ? t.filter((e) => typeof e == "string") : [];
294
294
  } catch {
295
295
  return [];
296
296
  }
297
297
  }
298
- function he(e) {
299
- if (b.writable) try {
300
- globalThis.localStorage?.setItem(b.key(pe), JSON.stringify(e));
298
+ function ge(e) {
299
+ if (x.writable) try {
300
+ globalThis.localStorage?.setItem(x.key(me), JSON.stringify(e));
301
301
  } catch {}
302
302
  }
303
- function S(e, t) {
303
+ function C(e, t) {
304
304
  let n = new Set(t);
305
305
  return e.slice().sort((e, t) => {
306
306
  let r = +!!n.has(e.SessionId), i = +!!n.has(t.SessionId);
307
- return r === i ? fe(t) - fe(e) : i - r;
307
+ return r === i ? pe(t) - pe(e) : i - r;
308
308
  });
309
309
  }
310
- function ge(e, t, n) {
310
+ function _e(e, t, n) {
311
311
  let r = /* @__PURE__ */ new Map();
312
312
  for (let t of e) t?.SessionId && r.set(t.SessionId, t);
313
313
  for (let e of t) e?.SessionId && r.set(e.SessionId, {
314
314
  ...r.get(e.SessionId) || {},
315
315
  ...e
316
316
  });
317
- return S(Array.from(r.values()), n);
317
+ return C(Array.from(r.values()), n);
318
318
  }
319
- var _e = s()((e) => ({
319
+ var ve = l()((e) => ({
320
320
  sessions: [],
321
321
  currentSessionId: null,
322
322
  sessionsAgentId: "",
@@ -327,12 +327,12 @@ var _e = s()((e) => ({
327
327
  loadedPages: /* @__PURE__ */ new Set(),
328
328
  hasMoreSessions: !1,
329
329
  isLoadingSessions: !0,
330
- pinnedSessionIds: me(),
330
+ pinnedSessionIds: he(),
331
331
  messageHistory: {},
332
- setSessions: (t) => e((e) => ({ sessions: S(t, e.pinnedSessionIds) })),
332
+ setSessions: (t) => e((e) => ({ sessions: C(t, e.pinnedSessionIds) })),
333
333
  setCurrentSessionId: (t) => e({ currentSessionId: t }),
334
334
  upsertSessions: (t, n) => e((e) => {
335
- let r = ge(n?.replace ? [] : e.sessions, t, e.pinnedSessionIds), i = n?.page ?? e.sessionsPage, a = n?.pageSize ?? e.sessionsPageSize, o = n?.total ?? Math.max(e.sessionsTotal, r.length), s = n?.replace ? x(/* @__PURE__ */ new Set(), [i]) : x(e.loadedPages, [i]), c = ue({
335
+ let r = _e(n?.replace ? [] : e.sessions, t, e.pinnedSessionIds), i = n?.page ?? e.sessionsPage, a = n?.pageSize ?? e.sessionsPageSize, o = n?.total ?? Math.max(e.sessionsTotal, r.length), s = n?.replace ? S(/* @__PURE__ */ new Set(), [i]) : S(e.loadedPages, [i]), c = de({
336
336
  sessionsLength: r.length,
337
337
  total: o,
338
338
  page: i,
@@ -354,7 +354,7 @@ var _e = s()((e) => ({
354
354
  return {
355
355
  sessions: n,
356
356
  sessionsTotal: r,
357
- hasMoreSessions: ue({
357
+ hasMoreSessions: de({
358
358
  sessionsLength: n.length,
359
359
  total: r,
360
360
  page: e.sessionsPage,
@@ -379,9 +379,9 @@ var _e = s()((e) => ({
379
379
  let n = new Set(e.pinnedSessionIds);
380
380
  n.has(t) ? n.delete(t) : n.add(t);
381
381
  let r = Array.from(n);
382
- return he(r), {
382
+ return ge(r), {
383
383
  pinnedSessionIds: r,
384
- sessions: S(e.sessions, r)
384
+ sessions: C(e.sessions, r)
385
385
  };
386
386
  }),
387
387
  setSessionMessageHistory: (t, n) => e((e) => ({ messageHistory: {
@@ -423,64 +423,64 @@ var _e = s()((e) => ({
423
423
  let n = { ...e.messageHistory };
424
424
  return delete n[t], { messageHistory: n };
425
425
  })
426
- })), ve = "ksadk.web.execution-permission", ye = [
426
+ })), ye = "ksadk.web.execution-permission", be = [
427
427
  "read-only",
428
428
  "workspace-write",
429
429
  "danger-full-access"
430
- ], be = {
430
+ ], xe = {
431
431
  "read-only": "只读",
432
432
  "workspace-write": "工作区可写",
433
433
  "danger-full-access": "完全访问"
434
- }, xe = {
434
+ }, Se = {
435
435
  "read-only": "只读",
436
436
  "workspace-write": "工作区可写",
437
437
  "danger-full-access": "完全访问"
438
- }, Se = {
438
+ }, Ce = {
439
439
  "read-only": "只读文件与命令",
440
440
  "workspace-write": "可修改工作区文件",
441
441
  "danger-full-access": "不再限制文件与命令"
442
442
  };
443
- function C(e) {
443
+ function w(e) {
444
444
  if (!e || !Array.isArray(e.Modes)) return [];
445
- let t = e.Modes.filter((e) => ye.includes(e));
445
+ let t = e.Modes.filter((e) => be.includes(e));
446
446
  return [...new Set(t)];
447
447
  }
448
- function Ce(e, t) {
449
- let n = C(e);
448
+ function we(e, t) {
449
+ let n = w(e);
450
450
  if (n.length === 0) return;
451
451
  if (t && n.includes(t)) return t;
452
452
  let r = e?.DefaultMode;
453
453
  return r && n.includes(r) ? r : n[0];
454
454
  }
455
- function we(e) {
456
- return e && ye.includes(e) ? { permission_mode: e } : {};
455
+ function Te(e) {
456
+ return e && be.includes(e) ? { permission_mode: e } : {};
457
457
  }
458
- function w(e) {
459
- return b.key(`${ve}.${e}`);
458
+ function T(e) {
459
+ return x.key(`${ye}.${e}`);
460
460
  }
461
- function Te(e) {
461
+ function Ee(e) {
462
462
  try {
463
- return globalThis.localStorage?.getItem(w(e)) ?? null;
463
+ return globalThis.localStorage?.getItem(T(e)) ?? null;
464
464
  } catch {
465
465
  return null;
466
466
  }
467
467
  }
468
- function Ee(e, t) {
469
- if (b.writable) try {
470
- t ? globalThis.localStorage?.setItem(w(e), t) : globalThis.localStorage?.removeItem(w(e));
468
+ function De(e, t) {
469
+ if (x.writable) try {
470
+ t ? globalThis.localStorage?.setItem(T(e), t) : globalThis.localStorage?.removeItem(T(e));
471
471
  } catch {}
472
472
  }
473
- var De = s()((e, t) => ({
473
+ var Oe = l()((e, t) => ({
474
474
  byAgent: {},
475
475
  policies: {},
476
476
  scopes: {},
477
477
  configure: (n, r) => {
478
- if (!n || b.blocked) return;
479
- let i = w(n), a = Te(n), o = t().scopes[n] === i ? t().byAgent[n] : void 0, s = {
480
- Modes: C(r),
478
+ if (!n || x.blocked) return;
479
+ let i = T(n), a = Ee(n), o = t().scopes[n] === i ? t().byAgent[n] : void 0, s = {
480
+ Modes: w(r),
481
481
  DefaultMode: r?.DefaultMode
482
- }, c = Ce(s, o ?? a);
483
- c !== a && Ee(n, c ?? null), e((e) => ({
482
+ }, c = we(s, o ?? a);
483
+ c !== a && De(n, c ?? null), e((e) => ({
484
484
  byAgent: {
485
485
  ...e.byAgent,
486
486
  [n]: c
@@ -496,18 +496,18 @@ var De = s()((e, t) => ({
496
496
  }));
497
497
  },
498
498
  select: (n, r) => {
499
- !n || b.blocked || t().scopes[n] !== w(n) || !C(t().policies[n]).includes(r) || (Ee(n, r), e((e) => ({ byAgent: {
499
+ !n || x.blocked || t().scopes[n] !== T(n) || !w(t().policies[n]).includes(r) || (De(n, r), e((e) => ({ byAgent: {
500
500
  ...e.byAgent,
501
501
  [n]: r
502
502
  } })));
503
503
  },
504
504
  modeFor: (e) => {
505
505
  let n = t();
506
- if (b.blocked || n.scopes[e] !== w(e)) return;
506
+ if (x.blocked || n.scopes[e] !== T(e)) return;
507
507
  let r = n.byAgent[e];
508
- return r && C(n.policies[e]).includes(r) ? r : void 0;
508
+ return r && w(n.policies[e]).includes(r) ? r : void 0;
509
509
  }
510
- })), Oe = s()((t, n) => ({
510
+ })), ke = l()((t, n) => ({
511
511
  agentId: "default-agent",
512
512
  agentName: "Agent",
513
513
  agentFramework: "",
@@ -521,7 +521,7 @@ var De = s()((e, t) => ({
521
521
  setAgentName: (e) => t({ agentName: e }),
522
522
  setAgentFramework: (e) => t({ agentFramework: e }),
523
523
  setCapabilities: (e) => {
524
- De.getState().configure(n().agentId, e.ExecutionPolicy), t({ capabilities: e });
524
+ Oe.getState().configure(n().agentId, e.ExecutionPolicy), t({ capabilities: e });
525
525
  },
526
526
  setApiFormats: (e) => t({ apiFormats: e }),
527
527
  setAccessMode: (e) => t({ accessMode: e }),
@@ -530,119 +530,18 @@ var De = s()((e, t) => ({
530
530
  status: e,
531
531
  errorMessage: n
532
532
  })
533
- })), T = {
534
- schema: "mcp.authorization/v1",
535
- digest: "b9bc3b0c286a3b21b8a5dfee00ad83eaa28aa72e418140502c58fc2e0eced938"
536
- }, ke = new Set([
537
- "approval",
538
- "structured_input",
539
- "plan_review",
540
- "custom"
541
- ]), Ae = new Set([
542
- "pending",
543
- "resolving",
544
- "failed",
533
+ })), Ae = new Set([
545
534
  "resolved",
546
535
  "cancelled",
547
536
  "expired"
548
- ]), je = new Set([
549
- "approved",
550
- "rejected",
551
- "submitted",
552
- "cancelled",
553
- "expired"
554
537
  ]);
555
538
  function E(e) {
556
- return typeof e == "object" && e && !Array.isArray(e) ? e : null;
557
- }
558
- function D(e) {
559
- return typeof e == "string" && e.length > 0 ? e : null;
560
- }
561
- var Me = "人工确认", Ne = "本次运行需要人工处理后才能继续。", Pe = "补充信息", Fe = "请填写后提交,Agent 将继续当前任务。";
562
- function O(e) {
563
- let t = String(e.kind || "approval"), r = String(e.status || "pending"), i = String(e.outcome || ""), a = E(e.presentation), o = a ? E(a.a2ui) : null, s;
564
- if (r === "resolved" && Object.hasOwn(e, "response")) try {
565
- s = { response: n(e.response) };
566
- } catch {}
567
- return {
568
- interactionId: e.interactionId,
569
- sessionId: e.sessionId,
570
- runId: D(e.runId),
571
- kind: ke.has(t) ? t : "custom",
572
- title: typeof e.title == "string" && e.title ? e.title : t === "structured_input" ? Pe : Me,
573
- message: typeof e.message == "string" && e.message ? e.message : t === "structured_input" ? Fe : Ne,
574
- requestSchema: E(e.requestSchema),
575
- presentation: o ? { a2ui: {
576
- wireVersion: String(o.wire_version ?? o.wireVersion ?? ""),
577
- catalogDigest: String(o.catalog_digest ?? o.catalogDigest ?? ""),
578
- messages: Array.isArray(o.messages) ? o.messages.filter((e) => typeof e == "object") : []
579
- } } : null,
580
- status: Ae.has(r) ? r : "pending",
581
- revision: Number.isFinite(Number(e.revision)) && Number(e.revision) > 0 ? Number(e.revision) : 1,
582
- createdAt: D(e.createdAt) || (/* @__PURE__ */ new Date()).toISOString(),
583
- expiresAt: D(e.expiresAt),
584
- resolvedAt: D(e.resolvedAt),
585
- actor: D(e.actor),
586
- outcome: je.has(i) ? i : null,
587
- responseSummary: D(e.responseSummary),
588
- ...s,
589
- source: e.source,
590
- extensions: e.extensions || {}
591
- };
592
- }
593
- //#endregion
594
- //#region src/core/mcp-authorization/normalize.ts
595
- function Ie(e) {
596
- if (!e || typeof e != "object") return !1;
597
- let t = e;
598
- return t.schema === T.schema && typeof t.wait_id == "string" && t.wait_id.length > 0 && typeof t.run_id == "string" && t.run_id.length > 0 && typeof t.revision == "number" && Number.isSafeInteger(t.revision) && t.revision >= 0;
599
- }
600
- function Le(e) {
601
- return Array.isArray(e) && e.every((e) => typeof e == "string");
602
- }
603
- function Re(e) {
604
- return Ie(e) && typeof e.capability_digest == "string" && typeof e.config_id == "string" && typeof e.status == "string" && typeof e.deadline == "number" && Number.isFinite(e.deadline) && typeof e.requires_resume == "boolean" && (e.display_name === void 0 || typeof e.display_name == "string") && (e.error == null || typeof e.error == "string") && Le(e.scopes) && Le(e.allowed_actions);
605
- }
606
- function ze(e, t, n) {
607
- if (!Ie(e) || n && e.run_id !== n) return null;
608
- let r = Re(e) && e.capability_digest === T.digest ? e : {
609
- schema: e.schema,
610
- wait_id: e.wait_id,
611
- run_id: e.run_id,
612
- revision: e.revision,
613
- status: "unsupported"
614
- };
615
- return O({
616
- interactionId: r.wait_id,
617
- sessionId: t,
618
- runId: r.run_id,
619
- kind: "custom",
620
- title: "MCP 服务授权",
621
- message: "授权完成后将继续当前任务。",
622
- revision: r.revision,
623
- source: "interaction_v1",
624
- status: r.status === "resumed" ? "resolved" : [
625
- "cancelled",
626
- "expired",
627
- "failed"
628
- ].includes(r.status) ? r.status : "pending",
629
- extensions: { mcpAuthorization: r }
630
- });
539
+ return Ae.has(e);
631
540
  }
632
- //#endregion
633
- //#region src/core/interaction/types.ts
634
- var Be = new Set([
635
- "resolved",
636
- "cancelled",
637
- "expired"
638
- ]);
639
- function k(e) {
640
- return Be.has(e);
641
- }
642
- function Ve(e, t) {
541
+ function je(e, t) {
643
542
  return `interaction:${e}:revision-${t}`;
644
543
  }
645
- function He(e, t) {
544
+ function Me(e, t) {
646
545
  if (typeof t != "object" || !t || Array.isArray(t)) return e === "cancel" ? "已取消" : "已提交";
647
546
  let n = t.approved;
648
547
  if (typeof n == "boolean") return n ? "已同意" : "已拒绝";
@@ -654,7 +553,7 @@ function He(e, t) {
654
553
  }
655
554
  //#endregion
656
555
  //#region src/core/interaction/store.ts
657
- var A = class {
556
+ var D = class {
658
557
  records = /* @__PURE__ */ new Map();
659
558
  terminalRuns = /* @__PURE__ */ new Set();
660
559
  rejectedCommands = /* @__PURE__ */ new Map();
@@ -687,7 +586,7 @@ var A = class {
687
586
  }
688
587
  upsert(e) {
689
588
  let t = this.get(e.sessionId, e.interactionId);
690
- e.runId && !k(e.status) && !k(t?.status ?? "pending") && this.terminalRuns.has(this.runKey(e.sessionId, e.runId)) && (e = {
589
+ e.runId && !E(e.status) && !E(t?.status ?? "pending") && this.terminalRuns.has(this.runKey(e.sessionId, e.runId)) && (e = {
691
590
  ...e,
692
591
  status: "expired",
693
592
  outcome: "expired",
@@ -695,7 +594,7 @@ var A = class {
695
594
  responseSummary: e.responseSummary ?? "运行已结束"
696
595
  });
697
596
  let n, r;
698
- return t ? k(t.status) && !k(e.status) ? (n = {
597
+ return t ? E(t.status) && !E(e.status) ? (n = {
699
598
  ...t,
700
599
  title: ["人工确认", "补充信息"].includes(t.title) ? e.title : t.title,
701
600
  message: ["本次运行需要人工处理后才能继续。", "请填写后提交,Agent 将继续当前任务。"].includes(t.message) ? e.message : t.message,
@@ -705,10 +604,10 @@ var A = class {
705
604
  }, r = {
706
605
  type: "interaction_updated",
707
606
  interaction: n
708
- }) : e.revision < t.revision || e.revision === t.revision && k(t.status) && !k(e.status) || t.status === "failed" && t.extensions.rejected_command_id && e.revision === t.revision && !k(e.status) || t.status === "resolving" && !k(e.status) ? (n = t, r = {
607
+ }) : e.revision < t.revision || e.revision === t.revision && E(t.status) && !E(e.status) || t.status === "failed" && t.extensions.rejected_command_id && e.revision === t.revision && !E(e.status) || t.status === "resolving" && !E(e.status) ? (n = t, r = {
709
608
  type: "interaction_updated",
710
609
  interaction: n
711
- }) : k(e.status) ? (n = {
610
+ }) : E(e.status) ? (n = {
712
611
  ...t,
713
612
  ...e,
714
613
  title: t.title || e.title,
@@ -765,7 +664,7 @@ var A = class {
765
664
  }
766
665
  recordCommand(e, t, n) {
767
666
  let r = this.get(e, t);
768
- if (!r || !n || k(r.status)) return;
667
+ if (!r || !n || E(r.status)) return;
769
668
  this.records.set(this.key(e, t), {
770
669
  ...r,
771
670
  extensions: {
@@ -814,7 +713,7 @@ var A = class {
814
713
  }
815
714
  markFailed(e, t, n) {
816
715
  let r = this.get(e, t);
817
- if (!r || k(r.status)) return;
716
+ if (!r || E(r.status)) return;
818
717
  let i = {
819
718
  ...r,
820
719
  status: "failed",
@@ -844,7 +743,7 @@ var A = class {
844
743
  if (!(!e || !t)) {
845
744
  this.terminalRuns.add(this.runKey(e, t));
846
745
  for (let n of this.listAll(e)) {
847
- if (n.runId !== t || k(n.status)) continue;
746
+ if (n.runId !== t || E(n.status)) continue;
848
747
  let r = {
849
748
  ...n,
850
749
  status: "expired",
@@ -861,10 +760,10 @@ var A = class {
861
760
  }
862
761
  markSessionTerminal(e) {
863
762
  if (!e) return;
864
- let t = new Set(this.listAll(e).filter((e) => !k(e.status)).map((e) => e.runId).filter((e) => !!e));
763
+ let t = new Set(this.listAll(e).filter((e) => !E(e.status)).map((e) => e.runId).filter((e) => !!e));
865
764
  for (let n of t) this.markRunTerminal(e, n);
866
765
  for (let t of this.listAll(e)) {
867
- if (t.runId || k(t.status)) continue;
766
+ if (t.runId || E(t.status)) continue;
868
767
  let n = {
869
768
  ...t,
870
769
  status: "expired",
@@ -891,11 +790,11 @@ var A = class {
891
790
  for (let e of this.rejectedCommands.keys()) e.startsWith(t) && this.rejectedCommands.delete(e);
892
791
  for (let e of this.terminalRuns) e.startsWith(t) && this.terminalRuns.delete(e);
893
792
  }
894
- }, j = class extends Error {
793
+ }, O = class extends Error {
895
794
  constructor(e) {
896
795
  super(e), this.name = "ContractMismatchError";
897
796
  }
898
- }, Ue = new Set([
797
+ }, Ne = new Set([
899
798
  "schema_version",
900
799
  "command_id",
901
800
  "status",
@@ -903,16 +802,16 @@ var A = class {
903
802
  "run_id",
904
803
  "accepted_seq",
905
804
  "error"
906
- ]), We = l.object({
907
- code: l.string().min(1),
908
- message: l.string(),
909
- retryable: l.boolean(),
910
- details: l.record(l.string(), l.unknown()).optional()
805
+ ]), Pe = d.object({
806
+ code: d.string().min(1),
807
+ message: d.string(),
808
+ retryable: d.boolean(),
809
+ details: d.record(d.string(), d.unknown()).optional()
911
810
  });
912
- function Ge(e) {
913
- if (typeof e != "object" || !e || Array.isArray(e)) return M(e);
811
+ function Fe(e) {
812
+ if (typeof e != "object" || !e || Array.isArray(e)) return k(e);
914
813
  let t = e;
915
- if ("schema_version" in t || !("SchemaVersion" in t)) return M(e);
814
+ if ("schema_version" in t || !("SchemaVersion" in t)) return k(e);
916
815
  let n = {
917
816
  SchemaVersion: "schema_version",
918
817
  CommandId: "command_id",
@@ -922,13 +821,13 @@ function Ge(e) {
922
821
  AcceptedSeq: "accepted_seq",
923
822
  Error: "error"
924
823
  };
925
- return M(Object.fromEntries(Object.entries(t).map(([e, t]) => [n[e] ?? e, t])));
824
+ return k(Object.fromEntries(Object.entries(t).map(([e, t]) => [n[e] ?? e, t])));
926
825
  }
927
- function M(e) {
928
- let t = l.object({
929
- schema_version: l.literal(1),
930
- command_id: l.string().min(1),
931
- status: l.enum([
826
+ function k(e) {
827
+ let t = d.object({
828
+ schema_version: d.literal(1),
829
+ command_id: d.string().min(1),
830
+ status: d.enum([
932
831
  "accepted",
933
832
  "duplicate",
934
833
  "rejected",
@@ -936,16 +835,16 @@ function M(e) {
936
835
  "queue_full",
937
836
  "persistence_uncertain"
938
837
  ]),
939
- message_id: l.string().min(1).nullable().optional(),
940
- run_id: l.string().min(1).nullable().optional(),
941
- accepted_seq: l.number().int().min(0).nullable().optional(),
942
- error: We.nullable().optional()
838
+ message_id: d.string().min(1).nullable().optional(),
839
+ run_id: d.string().min(1).nullable().optional(),
840
+ accepted_seq: d.number().int().min(0).nullable().optional(),
841
+ error: Pe.nullable().optional()
943
842
  }).passthrough().safeParse(e);
944
- if (!t.success) throw new j(`AgentControlReceipt/v1 mismatch: ${t.error.message}`);
843
+ if (!t.success) throw new O(`AgentControlReceipt/v1 mismatch: ${t.error.message}`);
945
844
  let n = t.data;
946
- if ((n.status === "rejected" || n.status === "unsupported" || n.status === "queue_full" || n.status === "persistence_uncertain") && !n.error) throw new j(`AgentControlReceipt/v1 mismatch: status ${n.status} requires error`);
845
+ if ((n.status === "rejected" || n.status === "unsupported" || n.status === "queue_full" || n.status === "persistence_uncertain") && !n.error) throw new O(`AgentControlReceipt/v1 mismatch: status ${n.status} requires error`);
947
846
  let r = {};
948
- for (let [e, t] of Object.entries(n)) Ue.has(e) || (r[e] = t);
847
+ for (let [e, t] of Object.entries(n)) Ne.has(e) || (r[e] = t);
949
848
  let i = n.error ? {
950
849
  ...n.error,
951
850
  extensions: {}
@@ -961,14 +860,14 @@ function M(e) {
961
860
  extensions: r
962
861
  };
963
862
  }
964
- function Ke(e) {
863
+ function Ie(e) {
965
864
  try {
966
865
  return t(e);
967
866
  } catch (e) {
968
- throw new j(`RuntimeCapabilityMatrix/v1 mismatch: ${e instanceof Error ? e.message : String(e)}`);
867
+ throw new O(`RuntimeCapabilityMatrix/v1 mismatch: ${e instanceof Error ? e.message : String(e)}`);
969
868
  }
970
869
  }
971
- var qe = new Set([
870
+ var Le = new Set([
972
871
  "schema_version",
973
872
  "event_id",
974
873
  "session_id",
@@ -982,7 +881,7 @@ var qe = new Set([
982
881
  "causation_id",
983
882
  "correlation_id",
984
883
  "actor_ref"
985
- ]), Je = new Map([["control", 1], ["runtime", 2]]), Ye = {
884
+ ]), Re = new Map([["control", 1], ["runtime", 2]]), ze = {
986
885
  schema_version: ["schemaVersion", "SchemaVersion"],
987
886
  event_id: ["eventId", "EventId"],
988
887
  session_id: ["sessionId", "SessionId"],
@@ -1001,10 +900,10 @@ var qe = new Set([
1001
900
  correlation_id: ["correlationId", "CorrelationId"],
1002
901
  actor_ref: ["actorRef", "ActorRef"]
1003
902
  };
1004
- function Xe(e) {
903
+ function Be(e) {
1005
904
  if (!e || typeof e != "object" || Array.isArray(e)) return e;
1006
905
  let t = e, n = { ...t };
1007
- for (let [e, r] of Object.entries(Ye)) {
906
+ for (let [e, r] of Object.entries(ze)) {
1008
907
  if (n[e] === void 0) {
1009
908
  let i = r.find((e) => t[e] !== void 0);
1010
909
  i && (n[e] = t[i]);
@@ -1013,34 +912,34 @@ function Xe(e) {
1013
912
  }
1014
913
  return n;
1015
914
  }
1016
- var Ze = l.object({
1017
- schema_version: l.literal(1),
1018
- event_id: l.string().min(1),
1019
- session_id: l.string().min(1),
1020
- seq: l.number().int().min(0),
1021
- timestamp: l.string().min(1),
1022
- family: l.string().min(1),
1023
- family_version: l.number().int().min(1),
1024
- event_type: l.string().min(1),
1025
- payload: l.record(l.string(), l.unknown()),
1026
- run_id: l.string().min(1).nullable().optional(),
1027
- causation_id: l.string().min(1).nullable().optional(),
1028
- correlation_id: l.string().min(1).nullable().optional(),
1029
- actor_ref: l.string().min(1).nullable().optional()
915
+ var Ve = d.object({
916
+ schema_version: d.literal(1),
917
+ event_id: d.string().min(1),
918
+ session_id: d.string().min(1),
919
+ seq: d.number().int().min(0),
920
+ timestamp: d.string().min(1),
921
+ family: d.string().min(1),
922
+ family_version: d.number().int().min(1),
923
+ event_type: d.string().min(1),
924
+ payload: d.record(d.string(), d.unknown()),
925
+ run_id: d.string().min(1).nullable().optional(),
926
+ causation_id: d.string().min(1).nullable().optional(),
927
+ correlation_id: d.string().min(1).nullable().optional(),
928
+ actor_ref: d.string().min(1).nullable().optional()
1030
929
  }).passthrough();
1031
- function Qe(e) {
1032
- let t = Ze.safeParse(Xe(e));
930
+ function He(e) {
931
+ let t = Ve.safeParse(Be(e));
1033
932
  if (!t.success) return {
1034
933
  ok: !1,
1035
- error: new j(`SessionEventEnvelope/v1 mismatch: ${t.error.message}`)
934
+ error: new O(`SessionEventEnvelope/v1 mismatch: ${t.error.message}`)
1036
935
  };
1037
- let n = t.data, r = Je.get(n.family);
936
+ let n = t.data, r = Re.get(n.family);
1038
937
  if (r !== void 0 && n.family_version !== r) return {
1039
938
  ok: !1,
1040
- error: new j(`SessionEventEnvelope/v1 mismatch: family ${n.family} requires family_version ${r}`)
939
+ error: new O(`SessionEventEnvelope/v1 mismatch: family ${n.family} requires family_version ${r}`)
1041
940
  };
1042
941
  let i = {};
1043
- for (let [e, t] of Object.entries(n)) qe.has(e) || (i[e] = t);
942
+ for (let [e, t] of Object.entries(n)) Le.has(e) || (i[e] = t);
1044
943
  return {
1045
944
  ok: !0,
1046
945
  value: {
@@ -1061,29 +960,29 @@ function Qe(e) {
1061
960
  }
1062
961
  };
1063
962
  }
1064
- function $e(e) {
1065
- let t = l.object({
1066
- schema_version: l.literal(1),
1067
- agent_instance_id: l.string().min(1),
1068
- instance_state: l.enum([
963
+ function Ue(e) {
964
+ let t = d.object({
965
+ schema_version: d.literal(1),
966
+ agent_instance_id: d.string().min(1),
967
+ instance_state: d.enum([
1069
968
  "ready",
1070
969
  "degraded",
1071
970
  "unavailable"
1072
971
  ]),
1073
- session_id: l.string().min(1).nullable().optional(),
1074
- active_run_id: l.string().min(1).nullable().optional(),
1075
- active_run_state: l.enum([
972
+ session_id: d.string().min(1).nullable().optional(),
973
+ active_run_id: d.string().min(1).nullable().optional(),
974
+ active_run_state: d.enum([
1076
975
  "pending",
1077
976
  "running",
1078
977
  "paused",
1079
978
  "waiting"
1080
979
  ]).nullable().optional(),
1081
- inbox_depth: l.number().int().min(0),
1082
- activation_id: l.string().min(1).nullable().optional(),
1083
- lease_expires_at: l.string().min(1).nullable().optional(),
1084
- capability: l.unknown()
980
+ inbox_depth: d.number().int().min(0),
981
+ activation_id: d.string().min(1).nullable().optional(),
982
+ lease_expires_at: d.string().min(1).nullable().optional(),
983
+ capability: d.unknown()
1085
984
  }).passthrough().safeParse(e);
1086
- if (!t.success) throw new j(`AgentStatusSnapshot/v1 mismatch: ${t.error.message}`);
985
+ if (!t.success) throw new O(`AgentStatusSnapshot/v1 mismatch: ${t.error.message}`);
1087
986
  let n = t.data, r = {};
1088
987
  for (let e of Object.keys(n)) [
1089
988
  "schema_version",
@@ -1107,11 +1006,11 @@ function $e(e) {
1107
1006
  inbox_depth: n.inbox_depth,
1108
1007
  activation_id: n.activation_id ?? null,
1109
1008
  lease_expires_at: n.lease_expires_at ?? null,
1110
- capability: Ke(n.capability),
1009
+ capability: Ie(n.capability),
1111
1010
  extensions: r
1112
1011
  };
1113
1012
  }
1114
- var et = {
1013
+ var We = {
1115
1014
  $schema: "http://json-schema.org/draft-06/schema#",
1116
1015
  $id: "http://json-schema.org/draft-06/schema#",
1117
1016
  title: "Core schema meta-schema",
@@ -1232,11 +1131,11 @@ var et = {
1232
1131
  not: { $ref: "#" }
1233
1132
  },
1234
1133
  default: {}
1235
- }, N = /* @__PURE__ */ new Map();
1236
- function tt(e) {
1237
- n(e);
1238
- let t = JSON.stringify(e), r = N.get(t);
1239
- if (r) return r;
1134
+ }, A = /* @__PURE__ */ new Map();
1135
+ function j(e) {
1136
+ r(e);
1137
+ let t = JSON.stringify(e), n = A.get(t);
1138
+ if (n) return n;
1240
1139
  let i = String(e.$schema || "https://json-schema.org/draft/2020-12/schema"), a = {
1241
1140
  strict: !1,
1242
1141
  allErrors: !0,
@@ -1245,28 +1144,28 @@ function tt(e) {
1245
1144
  removeAdditional: !1,
1246
1145
  ownProperties: !0,
1247
1146
  logger: !1
1248
- }, o = /draft-04/.test(i) ? new p(a) : /draft-0[67]/.test(i) ? new u(a) : /2019-09/.test(i) ? new d(a) : /2020-12/.test(i) ? new f(a) : null;
1147
+ }, o = /draft-04/.test(i) ? new h(a) : /draft-0[67]/.test(i) ? new f(a) : /2019-09/.test(i) ? new p(a) : /2020-12/.test(i) ? new m(a) : null;
1249
1148
  if (!o) throw TypeError("Unsupported JSON Schema dialect");
1250
- /draft-06/.test(i) && o.addMetaSchema(et), m(o);
1149
+ /draft-06/.test(i) && o.addMetaSchema(We), g(o);
1251
1150
  let s = o.compile(e);
1252
1151
  if ("$async" in s && s.$async) throw TypeError("Async schemas are not supported");
1253
- N.size >= 128 && N.delete(N.keys().next().value);
1152
+ A.size >= 128 && A.delete(A.keys().next().value);
1254
1153
  let c = typeof e.$id == "string" ? e.$id.replace(/#$/, "") : typeof e.id == "string" ? e.id.replace(/#$/, "") : "", l = {
1255
1154
  root: s,
1256
1155
  at: (e, t) => !!(e === "" ? s : o.getSchema(`${c}#${e}`))?.(t)
1257
1156
  };
1258
- return N.set(t, l), l;
1157
+ return A.set(t, l), l;
1259
1158
  }
1260
- function nt(e) {
1261
- return tt(e).at;
1159
+ function Ge(e) {
1160
+ return j(e).at;
1262
1161
  }
1263
- function rt(e, t) {
1162
+ function Ke(e, t) {
1264
1163
  try {
1265
- n(t);
1266
- let r = tt(e).root, i = r(t);
1164
+ r(t);
1165
+ let n = j(e).root, i = n(t);
1267
1166
  return {
1268
1167
  valid: !!i,
1269
- issues: i ? [] : (r.errors || []).slice(0, 10).map((e) => `${e.instancePath || "/"}:不符合 ${e.keyword} 约束`)
1168
+ issues: i ? [] : (n.errors || []).slice(0, 10).map((e) => `${e.instancePath || "/"}:不符合 ${e.keyword} 约束`)
1270
1169
  };
1271
1170
  } catch {
1272
1171
  return {
@@ -1277,22 +1176,22 @@ function rt(e, t) {
1277
1176
  }
1278
1177
  //#endregion
1279
1178
  //#region src/core/interaction/form-values.ts
1280
- var P = (e) => typeof e == "object" && e && !Array.isArray(e) ? e : void 0, it = (e, t) => Object.hasOwn(e, t) ? e[t] : void 0, at = (e) => e.replace(/~/g, "~0").replace(/\//g, "~1"), ot = /^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/u;
1281
- function st(e) {
1179
+ var M = (e) => typeof e == "object" && e && !Array.isArray(e) ? e : void 0, qe = (e, t) => Object.hasOwn(e, t) ? e[t] : void 0, Je = (e) => e.replace(/~/g, "~0").replace(/\//g, "~1"), Ye = /^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/u;
1180
+ function Xe(e) {
1282
1181
  let [t, n = "0"] = e.toLowerCase().split("e"), [r, i = ""] = t.replace(/^-/, "").split("."), a = (r + i).replace(/^0+/, "").replace(/0+$/, "");
1283
1182
  if (!a) return "0";
1284
1183
  let o = (r + i).length - (r + i).replace(/0+$/, "").length;
1285
1184
  return `${e.startsWith("-") ? "-" : ""}${a}e${Number(n) - i.length + o}`;
1286
1185
  }
1287
- function ct(e, t) {
1186
+ function Ze(e, t) {
1288
1187
  if (typeof e != "string") return e;
1289
1188
  if (t.includes("boolean") && (e === "true" || e === "false")) return e === "true";
1290
- if (!t.some((e) => e === "number" || e === "integer") || e.length > 1024 || !ot.test(e)) return e;
1189
+ if (!t.some((e) => e === "number" || e === "integer") || e.length > 1024 || !Ye.test(e)) return e;
1291
1190
  let n = Number(e);
1292
- return !Number.isFinite(n) || st(e) !== st(JSON.stringify(n)) || !t.includes("number") && !Number.isSafeInteger(n) ? e : n === 0 ? 0 : n;
1191
+ return !Number.isFinite(n) || Xe(e) !== Xe(JSON.stringify(n)) || !t.includes("number") && !Number.isSafeInteger(n) ? e : n === 0 ? 0 : n;
1293
1192
  }
1294
- function lt(e, t) {
1295
- let r = n(t), i = nt(e), a = 0, o = (e, t) => {
1193
+ function Qe(e, t) {
1194
+ let n = r(t), i = Ge(e), a = 0, o = (e, t) => {
1296
1195
  try {
1297
1196
  return i(e, t);
1298
1197
  } catch {
@@ -1310,14 +1209,14 @@ function lt(e, t) {
1310
1209
  let r = e;
1311
1210
  for (let e of n === "" ? [] : n.slice(1).split("/")) {
1312
1211
  let t = e.replace(/~1/g, "/").replace(/~0/g, "~");
1313
- r = Array.isArray(r) ? r[Number(t)] : P(r) ? it(r, t) : void 0;
1212
+ r = Array.isArray(r) ? r[Number(t)] : M(r) ? qe(r, t) : void 0;
1314
1213
  }
1315
1214
  return {
1316
1215
  node: r,
1317
1216
  path: n
1318
1217
  };
1319
1218
  }, c = (e, t, n, r = 0) => {
1320
- let i = P(e);
1219
+ let i = M(e);
1321
1220
  if (++a > 8192 || r > 48 || !i || o(t, n)) return n;
1322
1221
  let l = n, u = s(i.$ref);
1323
1222
  u && (n = c(u.node, u.path, n, r + 1)), Array.isArray(i.allOf) && i.allOf.forEach((e, i) => {
@@ -1332,14 +1231,14 @@ function lt(e, t) {
1332
1231
  let e = Array.isArray(i.items), a = e ? i.items : Array.isArray(i.prefixItems) ? i.prefixItems : [], o = e ? i.additionalItems : i.items;
1333
1232
  return n.map((n, i) => c(i < a.length ? a[i] : o, i < a.length ? `${t}/${e ? "items" : "prefixItems"}/${i}` : `${t}/${e ? "additionalItems" : "items"}`, n, r + 1));
1334
1233
  }
1335
- let p = P(n);
1234
+ let p = M(n);
1336
1235
  if (p) {
1337
- let e = {}, n = P(i.properties) || {}, a = P(i.patternProperties) || {};
1236
+ let e = {}, n = M(i.properties) || {}, a = M(i.patternProperties) || {};
1338
1237
  for (let [o, s] of Object.entries(p)) {
1339
1238
  let l = s, u = !1;
1340
- Object.hasOwn(n, o) && (l = c(n[o], `${t}/properties/${at(o)}`, l, r + 1), u = !0);
1341
- for (let [e, n] of Object.entries(a)) new RegExp(e, "u").test(o) && (l = c(n, `${t}/patternProperties/${at(e)}`, l, r + 1), u = !0);
1342
- !u && P(i.additionalProperties) && (l = c(i.additionalProperties, `${t}/additionalProperties`, l, r + 1)), Object.defineProperty(e, o, {
1239
+ Object.hasOwn(n, o) && (l = c(n[o], `${t}/properties/${Je(o)}`, l, r + 1), u = !0);
1240
+ for (let [e, n] of Object.entries(a)) new RegExp(e, "u").test(o) && (l = c(n, `${t}/patternProperties/${Je(e)}`, l, r + 1), u = !0);
1241
+ !u && M(i.additionalProperties) && (l = c(i.additionalProperties, `${t}/additionalProperties`, l, r + 1)), Object.defineProperty(e, o, {
1343
1242
  value: l,
1344
1243
  enumerable: !0,
1345
1244
  configurable: !0,
@@ -1348,20 +1247,20 @@ function lt(e, t) {
1348
1247
  }
1349
1248
  return e;
1350
1249
  }
1351
- return ct(n, Array.isArray(i.type) ? i.type : [i.type]);
1352
- }, l = c(e, "", r), u = rt(e, l);
1250
+ return Ze(n, Array.isArray(i.type) ? i.type : [i.type]);
1251
+ }, l = c(e, "", n), u = Ke(e, l);
1353
1252
  if (!u.valid) throw TypeError(u.issues.join(";"));
1354
1253
  return l;
1355
1254
  }
1356
1255
  //#endregion
1357
1256
  //#region src/core/interaction/client.ts
1358
- var ut = {
1257
+ var $e = {
1359
1258
  approve: "approved",
1360
1259
  reject: "rejected",
1361
1260
  submit: "submitted",
1362
1261
  cancel: "cancelled"
1363
1262
  };
1364
- function F(e, t) {
1263
+ function N(e, t) {
1365
1264
  return {
1366
1265
  schema_version: 1,
1367
1266
  command_id: `local-${t}`,
@@ -1373,12 +1272,12 @@ function F(e, t) {
1373
1272
  extensions: {}
1374
1273
  };
1375
1274
  }
1376
- var dt = class {
1275
+ var et = class {
1377
1276
  store;
1378
1277
  deps;
1379
1278
  inFlight = /* @__PURE__ */ new Map();
1380
1279
  constructor(e) {
1381
- this.deps = e, this.store = e.store || new A();
1280
+ this.deps = e, this.store = e.store || new D();
1382
1281
  }
1383
1282
  listPending(e) {
1384
1283
  return this.store.listPending(e);
@@ -1409,10 +1308,10 @@ var dt = class {
1409
1308
  }
1410
1309
  async respond(e) {
1411
1310
  let t = this.findByInteractionId(e.interactionId, e.sessionId);
1412
- if (!t) return F("rejected", e.interactionId);
1413
- if (t.status === "resolved" || t.status === "cancelled" || t.status === "expired" || t.status === "resolving") return F("duplicate", e.interactionId);
1414
- let r = this.deps.interactionV1Enabled || t.source === "interaction_v1";
1415
- if (!r && t.source === "responses" && (t.kind !== "approval" || ![
1311
+ if (!t) return N("rejected", e.interactionId);
1312
+ if (t.status === "resolved" || t.status === "cancelled" || t.status === "expired" || t.status === "resolving") return N("duplicate", e.interactionId);
1313
+ let n = this.deps.interactionV1Enabled || t.source === "interaction_v1";
1314
+ if (!n && t.source === "responses" && (t.kind !== "approval" || ![
1416
1315
  "approve",
1417
1316
  "reject",
1418
1317
  "cancel"
@@ -1424,50 +1323,50 @@ var dt = class {
1424
1323
  extensions: {}
1425
1324
  };
1426
1325
  return this.store.markFailed(t.sessionId, e.interactionId, n), {
1427
- ...F("unsupported", e.interactionId),
1326
+ ...N("unsupported", e.interactionId),
1428
1327
  error: n
1429
1328
  };
1430
1329
  }
1431
1330
  try {
1432
- n(e.response);
1331
+ r(e.response);
1433
1332
  } catch {
1434
1333
  return this.store.markFailed(t.sessionId, e.interactionId, {
1435
1334
  code: "input_response_invalid",
1436
1335
  message: "答案必须是合法 JSON 值。",
1437
1336
  retryable: !0
1438
- }), F("rejected", e.interactionId);
1337
+ }), N("rejected", e.interactionId);
1439
1338
  }
1440
1339
  if (t.kind === "structured_input" && e.action === "submit" && t.requestSchema) try {
1441
1340
  e = {
1442
1341
  ...e,
1443
- response: lt(t.requestSchema, e.response)
1342
+ response: Qe(t.requestSchema, e.response)
1444
1343
  };
1445
1344
  } catch (n) {
1446
1345
  return this.store.markFailed(t.sessionId, e.interactionId, {
1447
1346
  code: "input_response_invalid",
1448
1347
  message: n instanceof Error ? n.message : "答案不符合表单约束。",
1449
1348
  retryable: !0
1450
- }), F("rejected", e.interactionId);
1349
+ }), N("rejected", e.interactionId);
1451
1350
  }
1452
1351
  if (t.source === "agui" && !this.deps.interactionV1Enabled && e.action !== "cancel" && e.response === null) return this.store.markFailed(t.sessionId, e.interactionId, {
1453
1352
  code: "input_transport_unsupported",
1454
1353
  message: "当前 AG-UI 传输不能提交根 null,请使用 Interaction/v1。",
1455
1354
  retryable: !1
1456
- }), F("rejected", e.interactionId);
1457
- let i = e.idempotencyKey || Ve(e.interactionId, e.expectedRevision), a = t.extensions.rejected_command_id, o = a ? `${i}:retry-${a}` : i, s = this.recordKey(t), c = this.inFlight.get(s);
1458
- if (c) return F(c === o ? "duplicate" : "rejected", e.interactionId);
1355
+ }), N("rejected", e.interactionId);
1356
+ let i = e.idempotencyKey || je(e.interactionId, e.expectedRevision), a = t.extensions.rejected_command_id, o = a ? `${i}:retry-${a}` : i, s = this.recordKey(t), c = this.inFlight.get(s);
1357
+ if (c) return N(c === o ? "duplicate" : "rejected", e.interactionId);
1459
1358
  this.inFlight.set(s, o), this.store.markResolving(t.sessionId, e.interactionId);
1460
1359
  try {
1461
- if (!r && t.source === "responses" && this.deps.legacyResponsesApproval) {
1360
+ if (!n && t.source === "responses" && this.deps.legacyResponsesApproval) {
1462
1361
  let n = t.extensions.previous_response_id;
1463
1362
  return await this.deps.legacyResponsesApproval(e.interactionId, e.action === "approve", ...typeof n == "string" && n ? [n] : []) === !1 ? (this.store.markFailed(t.sessionId, e.interactionId, {
1464
1363
  code: "interaction_not_dispatched",
1465
1364
  message: "交互尚未提交,请稍后重试。",
1466
1365
  retryable: !0
1467
- }), F("rejected", e.interactionId)) : (this.resolveLocal(t, e, o), F("accepted", e.interactionId));
1366
+ }), N("rejected", e.interactionId)) : (this.resolveLocal(t, e, o), N("accepted", e.interactionId));
1468
1367
  }
1469
- if (!r && t.source === "agui" && this.deps.legacyAguiResume) return this.deps.legacyAguiResume(String(t.extensions.interrupt_id || e.interactionId), e.action === "cancel" ? "cancelled" : "resolved", e.response) ? (this.store.recordIdempotencyKey(t.sessionId, e.interactionId, o), F("accepted", e.interactionId)) : (this.store.revertToPending(t.sessionId, e.interactionId), F("rejected", e.interactionId));
1470
- let n = M(await this.deps.submitInteraction({
1368
+ if (!n && t.source === "agui" && this.deps.legacyAguiResume) return this.deps.legacyAguiResume(String(t.extensions.interrupt_id || e.interactionId), e.action === "cancel" ? "cancelled" : "resolved", e.response) ? (this.store.recordIdempotencyKey(t.sessionId, e.interactionId, o), N("accepted", e.interactionId)) : (this.store.revertToPending(t.sessionId, e.interactionId), N("rejected", e.interactionId));
1369
+ let r = k(await this.deps.submitInteraction({
1471
1370
  AgentId: this.deps.agentId,
1472
1371
  SessionId: t.sessionId,
1473
1372
  RunId: t.runId || "",
@@ -1477,11 +1376,11 @@ var dt = class {
1477
1376
  Response: e.response,
1478
1377
  IdempotencyKey: o
1479
1378
  }));
1480
- return n.status === "accepted" || n.status === "duplicate" ? (this.store.recordCommand(t.sessionId, e.interactionId, n.command_id), this.store.recordIdempotencyKey(t.sessionId, e.interactionId, o)) : n.status === "queue_full" ? this.store.revertToPending(t.sessionId, e.interactionId) : this.store.markFailed(t.sessionId, e.interactionId, {
1481
- code: n.error?.code ?? String(n.status),
1482
- message: n.error?.message ?? `提交未通过(${n.status})`,
1483
- retryable: n.error?.retryable ?? !1
1484
- }), n;
1379
+ return r.status === "accepted" || r.status === "duplicate" ? (this.store.recordCommand(t.sessionId, e.interactionId, r.command_id), this.store.recordIdempotencyKey(t.sessionId, e.interactionId, o)) : r.status === "queue_full" ? this.store.revertToPending(t.sessionId, e.interactionId) : this.store.markFailed(t.sessionId, e.interactionId, {
1380
+ code: r.error?.code ?? String(r.status),
1381
+ message: r.error?.message ?? `提交未通过(${r.status})`,
1382
+ retryable: r.error?.retryable ?? !1
1383
+ }), r;
1485
1384
  } catch (n) {
1486
1385
  let r = n instanceof Error ? n.message : String(n || "交互提交失败");
1487
1386
  throw this.store.markFailed(t.sessionId, e.interactionId, {
@@ -1495,13 +1394,13 @@ var dt = class {
1495
1394
  }
1496
1395
  resolveLocal(e, t, n) {
1497
1396
  let r = this.store.get(e.sessionId, t.interactionId);
1498
- if (!r || k(r.status)) return;
1397
+ if (!r || E(r.status)) return;
1499
1398
  let i = t.action === "cancel" ? "cancelled" : "resolved";
1500
1399
  this.store.resolveLocally(e.sessionId, t.interactionId, {
1501
1400
  status: i,
1502
- outcome: ut[t.action],
1401
+ outcome: $e[t.action],
1503
1402
  actor: "user",
1504
- responseSummary: e.kind === "structured_input" ? t.action === "cancel" ? "已取消" : "已提交" : He(t.action, t.response),
1403
+ responseSummary: e.kind === "structured_input" ? t.action === "cancel" ? "已取消" : "已提交" : Me(t.action, t.response),
1505
1404
  revision: t.expectedRevision
1506
1405
  });
1507
1406
  let a = this.store.get(e.sessionId, t.interactionId);
@@ -1513,47 +1412,47 @@ var dt = class {
1513
1412
  }
1514
1413
  });
1515
1414
  }
1516
- }, I = (e) => typeof e == "object" && e && !Array.isArray(e) ? e : void 0, L = class extends Error {};
1517
- function ft() {
1415
+ }, P = (e) => typeof e == "object" && e && !Array.isArray(e) ? e : void 0, F = class extends Error {};
1416
+ function tt() {
1518
1417
  let e = 8192;
1519
1418
  return () => {
1520
- if (--e < 0) throw new L();
1419
+ if (--e < 0) throw new F();
1521
1420
  };
1522
1421
  }
1523
- function pt(e, t, n) {
1422
+ function nt(e, t, n) {
1524
1423
  if (e === "#") return t;
1525
- if (typeof e != "string" || !e.startsWith("#/")) throw new L();
1424
+ if (typeof e != "string" || !e.startsWith("#/")) throw new F();
1526
1425
  try {
1527
1426
  let r = t;
1528
1427
  for (let t of decodeURIComponent(e.slice(2)).split("/")) {
1529
1428
  n();
1530
- let e = I(r) ?? (Array.isArray(r) ? r : void 0), i = t.replace(/~1/g, "/").replace(/~0/g, "~");
1531
- if (!e || !Object.hasOwn(e, i)) throw new L();
1429
+ let e = P(r) ?? (Array.isArray(r) ? r : void 0), i = t.replace(/~1/g, "/").replace(/~0/g, "~");
1430
+ if (!e || !Object.hasOwn(e, i)) throw new F();
1532
1431
  r = e[i];
1533
1432
  }
1534
1433
  return r;
1535
1434
  } catch {
1536
- throw new L();
1435
+ throw new F();
1537
1436
  }
1538
1437
  }
1539
- function mt(e, t, n) {
1438
+ function rt(e, t, n) {
1540
1439
  let r = /* @__PURE__ */ new Set(), i = [...e];
1541
1440
  for (; i.length;) {
1542
1441
  n();
1543
1442
  let e = i.pop();
1544
1443
  if (typeof e == "boolean") continue;
1545
- let a = I(e);
1546
- if (!a) throw new L();
1444
+ let a = P(e);
1445
+ if (!a) throw new F();
1547
1446
  if (!r.has(a)) {
1548
- if (r.add(a), a !== t && Object.hasOwn(a, "$id") || Object.hasOwn(a, "$dynamicRef") || Object.hasOwn(a, "$recursiveRef")) throw new L();
1549
- Object.hasOwn(a, "$ref") && i.push(pt(a.$ref, t, n));
1447
+ if (r.add(a), a !== t && Object.hasOwn(a, "$id") || Object.hasOwn(a, "$dynamicRef") || Object.hasOwn(a, "$recursiveRef")) throw new F();
1448
+ Object.hasOwn(a, "$ref") && i.push(nt(a.$ref, t, n));
1550
1449
  for (let e of [
1551
1450
  "allOf",
1552
1451
  "anyOf",
1553
1452
  "oneOf"
1554
1453
  ]) {
1555
1454
  let t = a[e];
1556
- if (t !== void 0 && !Array.isArray(t)) throw new L();
1455
+ if (t !== void 0 && !Array.isArray(t)) throw new F();
1557
1456
  Array.isArray(t) && i.push(...t);
1558
1457
  }
1559
1458
  for (let e of [
@@ -1561,25 +1460,25 @@ function mt(e, t, n) {
1561
1460
  "then",
1562
1461
  "else"
1563
1462
  ]) Object.hasOwn(a, e) && i.push(a[e]);
1564
- for (let e of [I(a.dependentSchemas), I(a.dependencies)]) for (let t of Object.values(e || {})) (I(t) || typeof t == "boolean") && i.push(t);
1463
+ for (let e of [P(a.dependentSchemas), P(a.dependencies)]) for (let t of Object.values(e || {})) (P(t) || typeof t == "boolean") && i.push(t);
1565
1464
  }
1566
1465
  }
1567
1466
  return [...r];
1568
1467
  }
1569
- var ht = (e) => e.writeOnly === !0 || e.format === "password" || e["x-sensitive"] === !0 || e["x-codex-is-secret"] === !0;
1570
- function gt(e, t = e) {
1468
+ var I = (e) => e.writeOnly === !0 || e.format === "password" || e["x-sensitive"] === !0 || e["x-codex-is-secret"] === !0;
1469
+ function it(e, t = e) {
1571
1470
  try {
1572
- return mt([e], t, ft()).some(ht);
1471
+ return rt([e], t, tt()).some(I);
1573
1472
  } catch {
1574
1473
  return !0;
1575
1474
  }
1576
1475
  }
1577
- function _t(e, t) {
1578
- let r = ft();
1579
- function i(t, n, a) {
1580
- if (r(), a > 48) throw new L();
1581
- let o = mt(t, e, r);
1582
- return o.some(ht) ? null : Array.isArray(n) ? n.map((e, t) => {
1476
+ function L(e, t) {
1477
+ let n = tt();
1478
+ function i(t, r, a) {
1479
+ if (n(), a > 48) throw new F();
1480
+ let o = rt(t, e, n);
1481
+ return o.some(I) ? null : Array.isArray(r) ? r.map((e, t) => {
1583
1482
  let n = [];
1584
1483
  for (let e of o) {
1585
1484
  let r = Array.isArray(e.prefixItems) ? e.prefixItems : void 0, i = Array.isArray(e.items) ? e.items : void 0;
@@ -1587,124 +1486,34 @@ function _t(e, t) {
1587
1486
  for (let t of ["contains", "unevaluatedItems"]) Object.hasOwn(e, t) && n.push(e[t]);
1588
1487
  }
1589
1488
  return i(n, e, a + 1);
1590
- }) : typeof n != "object" || !n ? n : Object.fromEntries(Object.entries(n).map(([e, t]) => {
1489
+ }) : typeof r != "object" || !r ? r : Object.fromEntries(Object.entries(r).map(([e, t]) => {
1591
1490
  let n = [];
1592
1491
  for (let t of o) {
1593
- let r = I(t.properties), i = !!(r && Object.hasOwn(r, e));
1492
+ let r = P(t.properties), i = !!(r && Object.hasOwn(r, e));
1594
1493
  i && n.push(r[e]);
1595
- for (let [r, a] of Object.entries(I(t.patternProperties) || {})) new RegExp(r).test(e) && (i = !0, n.push(a));
1494
+ for (let [r, a] of Object.entries(P(t.patternProperties) || {})) new RegExp(r).test(e) && (i = !0, n.push(a));
1596
1495
  !i && Object.hasOwn(t, "additionalProperties") && n.push(t.additionalProperties), Object.hasOwn(t, "unevaluatedProperties") && n.push(t.unevaluatedProperties);
1597
1496
  }
1598
1497
  return [e, i(n, t, a + 1)];
1599
1498
  }));
1600
1499
  }
1601
1500
  try {
1602
- return n(t), i([e], t, 0);
1501
+ return r(t), i([e], t, 0);
1603
1502
  } catch {
1604
1503
  return null;
1605
1504
  }
1606
1505
  }
1607
- function vt(e) {
1506
+ function at(e) {
1608
1507
  if (!(e.kind !== "structured_input" || e.status !== "resolved" || e.outcome !== "submitted" || !e.requestSchema || !Object.hasOwn(e, "response"))) try {
1609
- return { value: _t(e.requestSchema, n(e.response)) };
1508
+ return { value: L(e.requestSchema, r(e.response)) };
1610
1509
  } catch {
1611
1510
  return;
1612
1511
  }
1613
1512
  }
1614
1513
  //#endregion
1615
- //#region src/core/interaction/adapters/session-events.ts
1616
- var yt = new Set([
1617
- "interaction.requested",
1618
- "interaction_requested",
1619
- "ksadk.interaction/v1.requested",
1620
- "InteractionRequested",
1621
- "approval.requested",
1622
- "a2ui.interaction"
1623
- ]), bt = new Set([
1624
- "interaction.resolved",
1625
- "interaction_resolved",
1626
- "ksadk.interaction/v1.resolved",
1627
- "InteractionResolved",
1628
- "interaction.cancelled",
1629
- "interaction.cancel",
1630
- "interaction.expired",
1631
- "approval.resolved",
1632
- "a2ui.action"
1633
- ]);
1634
- function R(e) {
1635
- return typeof e == "object" && e && !Array.isArray(e) ? e : null;
1636
- }
1637
- function xt(e, t) {
1638
- let n = R(e);
1639
- if (!n) return null;
1640
- let r = R(n.Content ?? n.content), i = R(r?.session_event ?? r?.sessionEvent), a = R(n.payload), o = i ?? (a?.family === "interaction" ? a : null) ?? (n.family === "interaction" ? n : null), s = i ?? (String(a?.event_type || "").startsWith("mcp.authorization.") ? a : null) ?? (String(r?.event_type || "").startsWith("mcp.authorization.") ? r : n);
1641
- if (s && String(s?.event_type || s?.EventType || "").startsWith("mcp.authorization.")) return ze(s.payload ?? s, String(s.session_id || n.SessionId || t || ""), String(s.run_id || n.InvocationId || ""));
1642
- if (o && o.family !== "interaction") return null;
1643
- let c = o ?? n, l = String(c.event_type || c.EventType || "").trim();
1644
- if (!l) return null;
1645
- let u = R(c.payload ?? c.Content) ?? (o || {}), d = R(u.interaction) || R(u.Interaction) || R(u.interaction_request) || u, f = String(d.interaction_id || d.interactionId || d.InteractionId || d.approval_id || d.approvalId || u.interaction_id || u.interactionId || u.InteractionId || u.approval_id || u.approvalId || "");
1646
- if (!f) return null;
1647
- let p = String(c.session_id || c.SessionId || d.session_id || d.sessionId || t || "");
1648
- if (!p) return null;
1649
- if (yt.has(l)) {
1650
- let e = R(d.request) || {}, t = R(d.presentation ?? e.presentation), n = {
1651
- ...R(d.extensions) || {},
1652
- ...d.detail === void 0 ? {} : { detail: d.detail },
1653
- ...(d.call_id ?? d.callId) === void 0 ? {} : { call_id: d.call_id ?? d.callId }
1654
- };
1655
- return O({
1656
- interactionId: f,
1657
- sessionId: p,
1658
- runId: d.run_id ?? d.runId ?? c.run_id ?? c.InvocationId,
1659
- kind: l === "approval.requested" ? "approval" : d.kind === "form" ? "structured_input" : d.kind ?? e.kind ?? "approval",
1660
- title: d.title ?? t?.title,
1661
- message: d.message ?? d.description ?? R(d.detail)?.command ?? t?.description,
1662
- requestSchema: d.request_schema ?? d.requestSchema ?? d.input_schema ?? d.inputSchema ?? d.RequestSchema ?? e.request_schema,
1663
- presentation: t,
1664
- status: "pending",
1665
- revision: d.revision ?? 1,
1666
- createdAt: d.created_at ?? d.createdAt ?? c.timestamp ?? c.Timestamp,
1667
- expiresAt: d.expires_at ?? e.expires_at,
1668
- source: "interaction_v1",
1669
- extensions: n
1670
- });
1671
- }
1672
- if (bt.has(l)) {
1673
- let e = {
1674
- ...R(d.extensions) || {},
1675
- ...d.detail === void 0 ? {} : { detail: d.detail },
1676
- ...(d.call_id ?? d.callId) === void 0 ? {} : { call_id: d.call_id ?? d.callId }
1677
- }, t = l === "interaction.cancelled" || l === "interaction.cancel" ? "cancelled" : l === "interaction.expired" ? "expired" : "resolved", n = String(u.outcome ?? d.outcome ?? d.status ?? "").toLowerCase(), r = String(u.action ?? d.action ?? u.name ?? d.name ?? "").toLowerCase(), i = n;
1678
- i ||= r === "approve" ? "approved" : r === "reject" ? "rejected" : r === "submit" ? "submitted" : r === "cancel" || t === "cancelled" ? "cancelled" : t === "expired" ? "expired" : "submitted";
1679
- let a = t === "resolved" ? "resolved" : t;
1680
- return O({
1681
- interactionId: f,
1682
- sessionId: p,
1683
- runId: d.run_id ?? d.runId ?? c.run_id ?? c.InvocationId,
1684
- kind: d.kind,
1685
- title: d.title,
1686
- message: d.message,
1687
- requestSchema: d.request_schema,
1688
- presentation: d.presentation,
1689
- status: a,
1690
- revision: d.revision,
1691
- createdAt: d.created_at ?? c.timestamp,
1692
- expiresAt: d.expires_at,
1693
- resolvedAt: u.resolved_at ?? u.resolvedAt ?? d.resolved_at ?? d.resolvedAt ?? c.timestamp ?? c.Timestamp,
1694
- actor: u.actor ?? d.actor ?? c.actor_ref,
1695
- outcome: i,
1696
- responseSummary: u.response_summary ?? d.response_summary ?? (r ? `${r}` : void 0),
1697
- ...Object.hasOwn(d, "response") ? { response: d.response } : Object.hasOwn(u, "response") ? { response: u.response } : !o && ["a2ui.action", "interaction.resolved"].includes(l) && Object.hasOwn(d, "data") ? { response: d.data } : {},
1698
- source: "interaction_v1",
1699
- extensions: e
1700
- });
1701
- }
1702
- return null;
1703
- }
1704
- //#endregion
1705
1514
  //#region src/core/interaction/adapters/responses.ts
1706
- function z(e) {
1707
- return !e.approvalRequestId || !e.sessionId ? null : O({
1515
+ function R(e) {
1516
+ return !e.approvalRequestId || !e.sessionId ? null : o({
1708
1517
  interactionId: e.approvalRequestId,
1709
1518
  sessionId: e.sessionId,
1710
1519
  runId: e.runId ?? null,
@@ -1722,7 +1531,7 @@ function z(e) {
1722
1531
  }
1723
1532
  });
1724
1533
  }
1725
- function St(e) {
1534
+ function ot(e) {
1726
1535
  let t = {}, n = [];
1727
1536
  for (let r of e) {
1728
1537
  let e = r && typeof r == "object" ? r : {}, i = String(e.id || e.question_id || e.name || `question_${n.length + 1}`), a = Array.isArray(e.options) ? e.options.map((e) => typeof e == "string" ? e : String(e?.id ?? e?.value ?? e?.label ?? "")).filter(Boolean) : [];
@@ -1739,17 +1548,17 @@ function St(e) {
1739
1548
  additionalProperties: !1
1740
1549
  };
1741
1550
  }
1742
- function Ct(e) {
1551
+ function st(e) {
1743
1552
  if (!e.questionId || !e.sessionId) return null;
1744
1553
  let t = Array.isArray(e.questions) ? e.questions : [];
1745
- return O({
1554
+ return o({
1746
1555
  interactionId: e.questionId,
1747
1556
  sessionId: e.sessionId,
1748
1557
  runId: e.runId ?? null,
1749
1558
  kind: "structured_input",
1750
1559
  title: "询问",
1751
1560
  message: "Agent 需要你的选择后才能继续。",
1752
- requestSchema: St(t),
1561
+ requestSchema: ot(t),
1753
1562
  status: "pending",
1754
1563
  revision: 1,
1755
1564
  source: "responses",
@@ -1758,10 +1567,10 @@ function Ct(e) {
1758
1567
  }
1759
1568
  //#endregion
1760
1569
  //#region src/core/interaction/adapters/agui.ts
1761
- function B(e) {
1570
+ function z(e) {
1762
1571
  if (!e.interruptId || !e.sessionId) return null;
1763
1572
  let t = e.requestSchema != null;
1764
- return O({
1573
+ return o({
1765
1574
  interactionId: e.interruptId,
1766
1575
  sessionId: e.sessionId,
1767
1576
  runId: e.runId ?? null,
@@ -1779,7 +1588,7 @@ function B(e) {
1779
1588
  }
1780
1589
  });
1781
1590
  }
1782
- var V = {
1591
+ var B = {
1783
1592
  $schema: "https://json-schema.org/draft/2020-12/schema",
1784
1593
  $id: "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json",
1785
1594
  title: "A2UI Basic Catalog",
@@ -1855,7 +1664,7 @@ var V = {
1855
1664
  { $ref: "#/functions/not" }
1856
1665
  ] }
1857
1666
  }
1858
- }, wt = {
1667
+ }, ct = {
1859
1668
  $schema: "https://json-schema.org/draft/2020-12/schema",
1860
1669
  $id: "https://a2ui.org/specification/v0_9/common_types.json",
1861
1670
  title: "A2UI Common Types",
@@ -2048,7 +1857,7 @@ var V = {
2048
1857
  }]
2049
1858
  }
2050
1859
  }
2051
- }, Tt = {
1860
+ }, V = {
2052
1861
  schema_version: 1,
2053
1862
  profile: "official-0.9.1",
2054
1863
  wire_versions: ["v0.9", "v0.9.1"],
@@ -2296,24 +2105,24 @@ var V = {
2296
2105
  }
2297
2106
  },
2298
2107
  functions: {}
2299
- }, U = V, W = Tt, G = H;
2108
+ }, U = B, W = V, G = H;
2300
2109
  function K(e) {
2301
- return te(ee(new TextEncoder().encode(h(n(e)))));
2110
+ return ne(te(new TextEncoder().encode(ee(r(e)))));
2302
2111
  }
2303
- var q = new f({
2112
+ var q = new m({
2304
2113
  strict: !1,
2305
2114
  allErrors: !0,
2306
2115
  logger: !1
2307
2116
  });
2308
- m(q), q.addSchema(wt), q.addSchema(V), q.addSchema(H);
2309
- for (let e of Object.keys(Tt.schema_resolution_aliases)) q.addSchema({
2310
- ...V,
2117
+ g(q), q.addSchema(ct), q.addSchema(B), q.addSchema(H);
2118
+ for (let e of Object.keys(V.schema_resolution_aliases)) q.addSchema({
2119
+ ...B,
2311
2120
  $id: e
2312
2121
  });
2313
- new Map(Object.keys(V.components).map((e) => [e, q.getSchema(`${V.$id}#/components/${e}`)])), new Map(Object.keys(H.components).map((e) => [e, q.getSchema(`${H.$id}#/components/${e}`)]));
2122
+ new Map(Object.keys(B.components).map((e) => [e, q.getSchema(`${B.$id}#/components/${e}`)])), new Map(Object.keys(H.components).map((e) => [e, q.getSchema(`${H.$id}#/components/${e}`)]));
2314
2123
  //#endregion
2315
2124
  //#region src/core/a2ui/linking.ts
2316
- var Et = new Set([
2125
+ var lt = new Set([
2317
2126
  "components",
2318
2127
  "functions",
2319
2128
  "$defs",
@@ -2321,7 +2130,7 @@ var Et = new Set([
2321
2130
  "properties",
2322
2131
  "patternProperties",
2323
2132
  "dependentSchemas"
2324
- ]), Dt = new Set([
2133
+ ]), ut = new Set([
2325
2134
  "theme",
2326
2135
  "items",
2327
2136
  "additionalProperties",
@@ -2335,13 +2144,13 @@ var Et = new Set([
2335
2144
  "unevaluatedProperties",
2336
2145
  "unevaluatedItems",
2337
2146
  "contentSchema"
2338
- ]), Ot = new Set([
2147
+ ]), dt = new Set([
2339
2148
  "allOf",
2340
2149
  "anyOf",
2341
2150
  "oneOf",
2342
2151
  "prefixItems"
2343
- ]), kt = "https://a2ui.org/specification/v0_9/common_types.json";
2344
- function At(e, t) {
2152
+ ]), ft = "https://a2ui.org/specification/v0_9/common_types.json";
2153
+ function pt(e, t) {
2345
2154
  let n = String(e.$id || e.catalogId), r = /* @__PURE__ */ new Set(), i = (e, t) => t.startsWith("#") ? e.split("#")[0] + t : /^[a-z][a-z0-9+.-]*:/i.test(t) ? t : new URL(t, e).href, a = (e, o, s = !1) => {
2346
2155
  if (!e || typeof e != "object" || Array.isArray(e)) return structuredClone(e);
2347
2156
  let c = e, l = typeof c.$id == "string" && c.$id !== o ? i(o, c.$id) : o, u = structuredClone(c);
@@ -2351,7 +2160,7 @@ function At(e, t) {
2351
2160
  let d = i(l, o), f = t(d);
2352
2161
  if (f === void 0) throw Error("A2UI 目录包含未提供的离线 Schema 引用。");
2353
2162
  if (d.split("#")[0] === n) u[e] = "#" + (d.split("#")[1] || "");
2354
- else if (d.split("#")[0] !== kt) {
2163
+ else if (d.split("#")[0] !== ft) {
2355
2164
  if (r.has(d)) throw Error("循环的外部 A2UI Schema 资产无法完成链接。");
2356
2165
  r.add(d);
2357
2166
  let t;
@@ -2364,19 +2173,19 @@ function At(e, t) {
2364
2173
  return Object.keys(n).length ? { allOf: [t, a(n, l, s)] } : t;
2365
2174
  }
2366
2175
  }
2367
- for (let [e, t] of Object.entries(c)) Et.has(e) && t && typeof t == "object" && !Array.isArray(t) ? u[e] = Object.fromEntries(Object.entries(t).map(([e, t]) => [e, a(t, l, s)])) : Dt.has(e) && (typeof t == "object" || typeof t == "boolean") ? u[e] = a(t, l, s) : Ot.has(e) && Array.isArray(t) && (u[e] = t.map((e) => a(e, l, s)));
2176
+ for (let [e, t] of Object.entries(c)) lt.has(e) && t && typeof t == "object" && !Array.isArray(t) ? u[e] = Object.fromEntries(Object.entries(t).map(([e, t]) => [e, a(t, l, s)])) : ut.has(e) && (typeof t == "object" || typeof t == "boolean") ? u[e] = a(t, l, s) : dt.has(e) && Array.isArray(t) && (u[e] = t.map((e) => a(e, l, s)));
2368
2177
  return s && (delete u.$id, delete u.$schema, delete u.$anchor), u;
2369
2178
  };
2370
2179
  return a(e, n);
2371
2180
  }
2372
2181
  //#endregion
2373
2182
  //#region src/core/a2ui/registry.ts
2374
- var jt = [{
2183
+ var mt = [{
2375
2184
  schema: U,
2376
2185
  loadRenderer: async () => (await import("@a2ui/web_core/v0_9/basic_catalog")).basicCatalog
2377
2186
  }, {
2378
2187
  schema: G,
2379
- loadRenderer: async () => new g(G.catalogId, "0.9", [...g.fromSchema(G, "0.9").components.values()], [])
2188
+ loadRenderer: async () => new _(G.catalogId, "0.9", [..._.fromSchema(G, "0.9").components.values()], [])
2380
2189
  }], J = class {
2381
2190
  defaultCatalogId;
2382
2191
  entries = /* @__PURE__ */ new Map();
@@ -2384,7 +2193,7 @@ var jt = [{
2384
2193
  loaders = /* @__PURE__ */ new Map();
2385
2194
  processorSchemas = /* @__PURE__ */ new Map();
2386
2195
  constructor(e = [], t = W.catalog_id) {
2387
- for (let t of [...jt, ...e]) {
2196
+ for (let t of [...mt, ...e]) {
2388
2197
  let e = structuredClone(t.schema), n = e.catalogId;
2389
2198
  if (typeof n != "string" || !n.trim() || !e.components || typeof e.components != "object") throw Error("A2UI 目录缺少身份或组件 Schema。");
2390
2199
  let r = K(e), i = this.entries.get(n);
@@ -2401,19 +2210,19 @@ var jt = [{
2401
2210
  inputComponents: Object.freeze([...t.inputComponents || []])
2402
2211
  }));
2403
2212
  }
2404
- let n = new f({
2213
+ let n = new m({
2405
2214
  strict: !1,
2406
2215
  allErrors: !0,
2407
2216
  logger: !1
2408
2217
  });
2409
- m(n);
2218
+ g(n);
2410
2219
  let r = /* @__PURE__ */ new Map(), i = (e) => {
2411
2220
  let t = e.$id ?? e.catalogId;
2412
2221
  if (typeof t != "string" || !t) throw Error("离线 A2UI Schema 缺少 $id。");
2413
2222
  if (r.has(t) && K(r.get(t)) !== K(e)) throw Error("离线 A2UI Schema 身份存在冲突。");
2414
2223
  r.set(t, e);
2415
2224
  };
2416
- i(wt);
2225
+ i(ct);
2417
2226
  for (let e of this.entries.values()) {
2418
2227
  i(e.schema);
2419
2228
  for (let t of e.resources || []) i(t);
@@ -2425,7 +2234,7 @@ var jt = [{
2425
2234
  for (let [e, t] of r) n.addSchema(t, e);
2426
2235
  for (let [e, t] of this.entries) {
2427
2236
  let r = String(t.schema.$id || e);
2428
- this.validators.set(e, new Map(Object.keys(t.schema.components).map((e) => [e, n.getSchema(`${r}#/components/${e}`)]))), this.processorSchemas.set(e, At(t.schema, (e) => n.getSchema(e)?.schema));
2237
+ this.validators.set(e, new Map(Object.keys(t.schema.components).map((e) => [e, n.getSchema(`${r}#/components/${e}`)]))), this.processorSchemas.set(e, pt(t.schema, (e) => n.getSchema(e)?.schema));
2429
2238
  }
2430
2239
  if (!this.entries.has(t)) throw Error("默认 A2UI 目录未注册。");
2431
2240
  this.defaultCatalogId = t;
@@ -2455,9 +2264,9 @@ var jt = [{
2455
2264
  }
2456
2265
  validateMessages(e) {
2457
2266
  if (!e.length || e.length > 4096 || new TextEncoder().encode(JSON.stringify(e)).length > 1048576) throw Error("A2UI 消息无效或超过展示预算。");
2458
- let t = new ne([...this.processorSchemas.values()].map((e) => {
2459
- let t = g.fromSchema(e, "0.9");
2460
- return new g(t.id, t.protocolVersion, [...t.components.values()], [...t.functions.values()].map((e) => re(e, () => {
2267
+ let t = new re([...this.processorSchemas.values()].map((e) => {
2268
+ let t = _.fromSchema(e, "0.9");
2269
+ return new _(t.id, t.protocolVersion, [...t.components.values()], [...t.functions.values()].map((e) => ie(e, () => {
2461
2270
  throw Error("校验过程不能执行 A2UI 函数。");
2462
2271
  })), t.themeSchema, t.instructions);
2463
2272
  }), void 0, {
@@ -2514,14 +2323,14 @@ var jt = [{
2514
2323
  }));
2515
2324
  }
2516
2325
  };
2517
- function Mt(e = [], t = {}) {
2326
+ function ht(e = [], t = {}) {
2518
2327
  return new J(e, t.defaultCatalogId);
2519
2328
  }
2520
- var Y = Mt(), Nt = "0.9.1";
2521
- function Pt(e) {
2329
+ var Y = ht(), gt = "0.9.1";
2330
+ function _t(e) {
2522
2331
  return K(e);
2523
2332
  }
2524
- function Ft(e, t = Y) {
2333
+ function vt(e, t = Y) {
2525
2334
  if (!e) return X(null);
2526
2335
  if (e.wireVersion !== "0.9.1" || !e.messages || e.messages.length === 0) return X(e);
2527
2336
  try {
@@ -2532,7 +2341,7 @@ function Ft(e, t = Y) {
2532
2341
  if (r.size !== 1) return "json-schema-form";
2533
2342
  let i = n.get([...r][0]);
2534
2343
  if (!i) return "json-schema-form";
2535
- let a = t instanceof J ? i.digest : Pt(t), o = [...r][0] === G.catalogId && e.catalogDigest === W.catalog_digest;
2344
+ let a = t instanceof J ? i.digest : _t(t), o = [...r][0] === G.catalogId && e.catalogDigest === W.catalog_digest;
2536
2345
  if (!e.catalogDigest || e.catalogDigest !== a && !o) return "json-schema-form";
2537
2346
  n.validateMessages(e.messages).dispose();
2538
2347
  } catch {
@@ -2541,24 +2350,24 @@ function Ft(e, t = Y) {
2541
2350
  return "a2ui";
2542
2351
  }
2543
2352
  function X(e) {
2544
- return e && It(e) ? "json-schema-form" : "basic-controls";
2353
+ return e && yt(e) ? "json-schema-form" : "basic-controls";
2545
2354
  }
2546
- function It(e) {
2355
+ function yt(e) {
2547
2356
  return e.messages.some((e) => {
2548
2357
  let t = e.inputSchema ?? e.input_schema ?? e.schema;
2549
2358
  return typeof t == "object" && !!t;
2550
2359
  });
2551
2360
  }
2552
- function Lt(e, t = Y) {
2361
+ function bt(e, t = Y) {
2553
2362
  let n = e.kind === "approval" ? e.presentation?.a2ui : null;
2554
- return n && Ft(n, t) === "a2ui" ? n : null;
2363
+ return n && vt(n, t) === "a2ui" ? n : null;
2555
2364
  }
2556
2365
  //#endregion
2557
2366
  //#region src/core/interaction/legacy-history.ts
2558
2367
  var Z = (e) => typeof e == "string" && e ? e : void 0;
2559
- function Rt(e, t, n) {
2368
+ function xt(e, t, n) {
2560
2369
  for (let r of n) {
2561
- if (r.agentBlock && Rt(e, t, r.agentBlock.messages), r.eventType === "conversation_item_v1") continue;
2370
+ if (r.agentBlock && xt(e, t, r.agentBlock.messages), r.eventType === "conversation_item_v1") continue;
2562
2371
  let n = Object.values(r.tools || {}), i = [...n];
2563
2372
  for (let e of r.blocks || []) {
2564
2373
  if (e.type !== "tool" || !Z(e.extra?.approvalRequestId)) continue;
@@ -2584,7 +2393,7 @@ function Rt(e, t, n) {
2584
2393
  "cancelled"
2585
2394
  ].includes(o) || a !== "responses" && a !== "ag-ui") continue;
2586
2395
  let s = e.get(t, i);
2587
- if (s && (s.source === "interaction_v1" || k(s.status))) continue;
2396
+ if (s && (s.source === "interaction_v1" || E(s.status))) continue;
2588
2397
  let c = {
2589
2398
  sessionId: t,
2590
2399
  runId: r.runId || r.invocationId,
@@ -2592,11 +2401,11 @@ function Rt(e, t, n) {
2592
2401
  message: n.approvalMessage,
2593
2402
  args: n.args,
2594
2403
  previousResponseId: n.previousResponseId || r.responseId
2595
- }, l = a === "ag-ui" ? B({
2404
+ }, l = a === "ag-ui" ? z({
2596
2405
  ...c,
2597
2406
  interruptId: i,
2598
2407
  toolCallId: n.callId
2599
- }) : z({
2408
+ }) : R({
2600
2409
  ...c,
2601
2410
  approvalRequestId: i
2602
2411
  });
@@ -2612,7 +2421,7 @@ function Rt(e, t, n) {
2612
2421
  function Q(e) {
2613
2422
  return e && typeof e == "object" && !Array.isArray(e) ? e : null;
2614
2423
  }
2615
- function zt(e, t) {
2424
+ function St(e, t) {
2616
2425
  let n = Q(e), r = Q(Q(n?.Content)?.runtime_event);
2617
2426
  if (!r || r.schema_version !== 2 || r.interaction_kind !== "approval") return null;
2618
2427
  let i = Q(r.source);
@@ -2625,7 +2434,7 @@ function zt(e, t) {
2625
2434
  if (!a || !o) return null;
2626
2435
  let s = Q(r.request), c = Q(s?.detail), l = Q(r.response), u = r.event_type === "interaction.requested", d = r.event_type === "interaction.resolved";
2627
2436
  if (u && (s?.request_type !== "approval" || c?.approval_request_id !== o) || !u && (!d || l?.response_type !== "approval")) return null;
2628
- let f = Q((Array.isArray(c?.action_requests) ? c.action_requests : [])[0]), p = c?.arguments ?? f?.args, m = Q(i?.metadata), h = z({
2437
+ let f = Q((Array.isArray(c?.action_requests) ? c.action_requests : [])[0]), p = c?.arguments ?? f?.args, m = Q(i?.metadata), h = R({
2629
2438
  approvalRequestId: o,
2630
2439
  sessionId: a,
2631
2440
  runId: String(r.run_id || n?.InvocationId || "") || void 0,
@@ -2644,7 +2453,7 @@ function zt(e, t) {
2644
2453
  }
2645
2454
  //#endregion
2646
2455
  //#region src/core/interaction/index.ts
2647
- var Bt = new Set([
2456
+ var Ct = new Set([
2648
2457
  "completed",
2649
2458
  "failed",
2650
2459
  "error",
@@ -2652,29 +2461,29 @@ var Bt = new Set([
2652
2461
  "canceled",
2653
2462
  "aborted",
2654
2463
  "resume_failed"
2655
- ]), $ = new A();
2656
- function Vt(e, t) {
2657
- Rt($, t, e);
2464
+ ]), $ = new D();
2465
+ function wt(e, t) {
2466
+ xt($, t, e);
2658
2467
  }
2659
- function Ht(e, t) {
2660
- let n = xt(e, t) ?? zt(e, t);
2468
+ function Tt(e, t) {
2469
+ let n = i(e, t) ?? St(e, t);
2661
2470
  n && $.upsert(n);
2662
2471
  let r = typeof e == "object" && e ? e : null;
2663
2472
  if (r?.EventType === "control.command_rejected") {
2664
2473
  let e = r.Content;
2665
2474
  $.rejectCommand(String(r.SessionId || t || ""), String(e?.command_id || ""), String(e?.reason || "command_rejected"));
2666
2475
  }
2667
- let a = r ? i(r) : null;
2668
- if (a !== null && Bt.has(a)) {
2476
+ let o = r ? a(r) : null;
2477
+ if (o !== null && Ct.has(o)) {
2669
2478
  let e = typeof r?.Content == "object" && r.Content !== null ? r.Content : {}, n = typeof e.payload == "object" && e.payload !== null ? e.payload : {}, i = String(r?.SessionId || r?.session_id || t || ""), a = String(r?.InvocationId || r?.run_id || n.run_id || n.runId || "");
2670
2479
  $.markRunTerminal(i, a);
2671
2480
  }
2672
2481
  return n;
2673
2482
  }
2674
- function Ut(e) {
2483
+ function Et(e) {
2675
2484
  let t = e.sessionId || "";
2676
2485
  if (!t || !e.approvalRequestId) return null;
2677
- let n = e.protocol === "ag-ui" ? B({
2486
+ let n = e.protocol === "ag-ui" ? z({
2678
2487
  interruptId: e.approvalRequestId,
2679
2488
  sessionId: t,
2680
2489
  runId: e.runId,
@@ -2682,7 +2491,7 @@ function Ut(e) {
2682
2491
  message: e.message,
2683
2492
  reason: e.approvalLevel,
2684
2493
  requestSchema: e.requestSchema
2685
- }) : z({
2494
+ }) : R({
2686
2495
  approvalRequestId: e.approvalRequestId,
2687
2496
  sessionId: t,
2688
2497
  runId: e.runId,
@@ -2694,10 +2503,10 @@ function Ut(e) {
2694
2503
  });
2695
2504
  return n && $.upsert(n), n;
2696
2505
  }
2697
- function Wt(e) {
2506
+ function Dt(e) {
2698
2507
  let t = e.sessionId || "";
2699
2508
  if (!t || !e.questionId) return null;
2700
- let n = Ct({
2509
+ let n = st({
2701
2510
  questionId: e.questionId,
2702
2511
  sessionId: t,
2703
2512
  runId: e.runId,
@@ -2705,7 +2514,7 @@ function Wt(e) {
2705
2514
  });
2706
2515
  return n && $.upsert(n), n;
2707
2516
  }
2708
- function Gt(e) {
2517
+ function Ot(e) {
2709
2518
  let t = e.sessionId || "";
2710
2519
  if (!t || !e.questionId) return null;
2711
2520
  let n = $.get(t, e.questionId);
@@ -2724,16 +2533,16 @@ function Gt(e) {
2724
2533
  }
2725
2534
  }), $.get(t, e.questionId);
2726
2535
  }
2727
- function Kt(e) {
2536
+ function kt(e) {
2728
2537
  let t = e.sessionId || "";
2729
2538
  if (!t || !e.approvalRequestId) return null;
2730
2539
  let n = $.get(t, e.approvalRequestId);
2731
- return n?.source === "agui" && n.kind === "structured_input" ? k(n.status) ? n : ($.resolveLocally(t, n.interactionId, {
2540
+ return n?.source === "agui" && n.kind === "structured_input" ? E(n.status) ? n : ($.resolveLocally(t, n.interactionId, {
2732
2541
  status: e.decision === "cancelled" ? "cancelled" : "resolved",
2733
2542
  outcome: e.decision === "cancelled" ? "cancelled" : "submitted",
2734
2543
  revision: e.revision || 2,
2735
2544
  actor: "user"
2736
- }), $.get(t, n.interactionId)) : Ht({
2545
+ }), $.get(t, n.interactionId)) : Tt({
2737
2546
  EventType: "approval.resolved",
2738
2547
  Content: {
2739
2548
  approvalId: e.approvalRequestId,
@@ -2744,9 +2553,9 @@ function Kt(e) {
2744
2553
  }
2745
2554
  }, t);
2746
2555
  }
2747
- function qt(e) {
2556
+ function At(e) {
2748
2557
  let t = $.get(e.sessionId || "", e.interactionId);
2749
- !t || t.source !== "agui" || k(t.status) || $.markFailed(t.sessionId, t.interactionId, {
2558
+ !t || t.source !== "agui" || E(t.status) || $.markFailed(t.sessionId, t.interactionId, {
2750
2559
  code: "input_response_invalid",
2751
2560
  message: e.message,
2752
2561
  retryable: !0
@@ -2754,30 +2563,30 @@ function qt(e) {
2754
2563
  }
2755
2564
  //#endregion
2756
2565
  //#region src/core/a2ui/provider.tsx
2757
- var Jt = a(Y);
2758
- function Yt({ registry: e, children: t }) {
2759
- return /* @__PURE__ */ c(Jt.Provider, {
2566
+ var jt = s(Y);
2567
+ function Mt({ registry: e, children: t }) {
2568
+ return /* @__PURE__ */ u(jt.Provider, {
2760
2569
  value: e,
2761
2570
  children: t
2762
2571
  });
2763
2572
  }
2764
- function Xt() {
2765
- return o(Jt);
2573
+ function Nt() {
2574
+ return c(jt);
2766
2575
  }
2767
2576
  //#endregion
2768
2577
  //#region src/core/run/a2ui.ts
2769
- var Zt = {
2578
+ var Pt = {
2770
2579
  description: "A2UI Component Schema — available components for generating UI surfaces. Use these component names and properties when creating A2UI operations.",
2771
2580
  value: JSON.stringify({
2772
2581
  ...U,
2773
2582
  ksadkManifest: W
2774
2583
  })
2775
2584
  };
2776
- function Qt(e = Y) {
2777
- if (e === Y) return Zt;
2585
+ function Ft(e = Y) {
2586
+ if (e === Y) return Pt;
2778
2587
  let t = e.get(e.defaultCatalogId);
2779
2588
  return {
2780
- description: Zt.description,
2589
+ description: Pt.description,
2781
2590
  value: JSON.stringify({
2782
2591
  ...t.schema,
2783
2592
  ksadkResources: t.resources,
@@ -2789,7 +2598,7 @@ function Qt(e = Y) {
2789
2598
  })
2790
2599
  };
2791
2600
  }
2792
- function $t(e) {
2601
+ function It(e) {
2793
2602
  return e.map((e) => {
2794
2603
  let t = e.updateComponents;
2795
2604
  if (!t || typeof t != "object" || Array.isArray(t)) return e;
@@ -2812,7 +2621,7 @@ function $t(e) {
2812
2621
  };
2813
2622
  });
2814
2623
  }
2815
- function en(e) {
2624
+ function Lt(e) {
2816
2625
  for (let t of e) {
2817
2626
  let e = t.updateComponents?.components;
2818
2627
  if (!Array.isArray(e) || !e.some((e) => e.component === "Form" && e.id === "form")) continue;
@@ -2822,4 +2631,4 @@ function en(e) {
2822
2631
  return null;
2823
2632
  }
2824
2633
  //#endregion
2825
- export { se as $, $e as A, Oe as B, gt as C, rt as D, dt as E, Ve as F, C as G, be as H, k as I, me as J, Ce as K, ze as L, M, Qe as N, j as O, A as P, le as Q, Re as R, xt as S, vt as T, xe as U, Se as V, we as W, de as X, _e as Y, b as Z, Mt as _, Xt as a, B as b, qt as c, Gt as d, ae as et, Ht as f, Lt as g, Ft as h, Yt as i, Ke as j, Ge as k, Vt as l, Nt as m, en as n, Ut as o, $ as p, De as q, $t as r, Kt as s, Qt as t, Wt as u, Y as v, _t as w, z as x, G as y, T as z };
2634
+ export { Ue as A, Se as B, it as C, Ke as D, et as E, je as F, he as G, w as H, E as I, x as J, ve as K, ke as L, k as M, He as N, O, D as P, Ce as R, R as S, at as T, we as U, Te as V, Oe as W, ce as X, ue as Y, oe as Z, ht as _, Nt as a, V as b, At as c, Ot as d, Tt as f, bt as g, vt as h, Mt as i, Ie as j, Fe as k, wt as l, gt as m, Lt as n, Et as o, $ as p, fe as q, It as r, kt as s, Ft as t, Dt as u, Y as v, L as w, z as x, G as y, xe as z };