@kingsoftcloud/ksadk-web 0.3.15 → 0.3.17

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 (225) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +2 -2
  3. package/RELEASE_PROVENANCE.json +2 -2
  4. package/dist-ksadk/assets/{ArtifactsPanel-ND1ni01O.js → ArtifactsPanel-DYzXIPnl.js} +1 -1
  5. package/dist-ksadk/assets/{CodeBlock-Bm987IV9.js → CodeBlock-Dpa-tOmG.js} +1 -1
  6. package/dist-ksadk/assets/{MathMessageMarkdown-m289SxEv.js → MathMessageMarkdown-D8kBE9sl.js} +1 -1
  7. package/dist-ksadk/assets/{MermaidBlock-Draq-3W4.js → MermaidBlock-BYOoZB-_.js} +6 -6
  8. package/dist-ksadk/assets/{NativeTerminalPanel-BPKj9OEV.js → NativeTerminalPanel-CAeXHeo6.js} +1 -1
  9. package/dist-ksadk/assets/{OfficialA2uiRenderer-Buvy4tjx.js → OfficialA2uiRenderer-yPb3s23n.js} +1 -1
  10. package/dist-ksadk/assets/{abnfDiagram-VCTEODGH-DSkvfGF3.js → abnfDiagram-VCTEODGH-DdVxMn2L.js} +1 -1
  11. package/dist-ksadk/assets/{arc-D2OD6TRH.js → arc-DsOMYRTm.js} +1 -1
  12. package/dist-ksadk/assets/architecture-7GRP2DOG-Ds1NB530.js +1 -0
  13. package/dist-ksadk/assets/{architectureDiagram-5GKGNRK7-BAGaNeP_.js → architectureDiagram-5GKGNRK7-BCfzi23_.js} +1 -1
  14. package/dist-ksadk/assets/{blockDiagram-NRAW4CY4-CE77-fsa.js → blockDiagram-NRAW4CY4-gC-Gc2Xv.js} +1 -1
  15. package/dist-ksadk/assets/{c4Diagram-UCG6FXSJ-QM8LLt8e.js → c4Diagram-UCG6FXSJ-BAHemGZa.js} +1 -1
  16. package/dist-ksadk/assets/channel-B4PiWfnA.js +1 -0
  17. package/dist-ksadk/assets/chunk-2Q5K7J3B-CI2tn5IS.js +1 -0
  18. package/dist-ksadk/assets/{chunk-5VM5RSS4-NBYbb28t.js → chunk-5VM5RSS4-Cthhs8Yv.js} +1 -1
  19. package/dist-ksadk/assets/{chunk-F27PBJKO-xaO4b0PR.js → chunk-F27PBJKO-BPV04XpW.js} +1 -1
  20. package/dist-ksadk/assets/{chunk-G27WJ6UU-Bi73NhBu.js → chunk-G27WJ6UU-Cl1n0gHd.js} +1 -1
  21. package/dist-ksadk/assets/{chunk-JWPE2WC7-CngFBp9d.js → chunk-JWPE2WC7-DqkIh_LK.js} +1 -1
  22. package/dist-ksadk/assets/{chunk-LCL6LL3I-BsunO5Rx.js → chunk-LCL6LL3I-DZhAKY7Z.js} +1 -1
  23. package/dist-ksadk/assets/{chunk-POPQ4Y6H-ImP4Ew8y.js → chunk-POPQ4Y6H-BGuhTofV.js} +1 -1
  24. package/dist-ksadk/assets/{chunk-RHFEMEQ7-CdQmbok4.js → chunk-RHFEMEQ7-DhrRHdJ6.js} +1 -1
  25. package/dist-ksadk/assets/{chunk-SVP7TREG-ExibL7Ea.js → chunk-SVP7TREG-CIdm5TIa.js} +1 -1
  26. package/dist-ksadk/assets/{chunk-XXDRQBXY-Bz850mDu.js → chunk-XXDRQBXY-CNIlGK4v.js} +1 -1
  27. package/dist-ksadk/assets/classDiagram-DTDB5LWJ-BMQzydMm.js +1 -0
  28. package/dist-ksadk/assets/classDiagram-v2-JRS7N3AN-BMQzydMm.js +1 -0
  29. package/dist-ksadk/assets/{cose-bilkent-JH36ORCC-C0xUJvyH.js → cose-bilkent-JH36ORCC-BjauSFl3.js} +1 -1
  30. package/dist-ksadk/assets/cynefin-OW5HDTMX-DcGwq_cA.js +1 -0
  31. package/dist-ksadk/assets/{cynefinDiagram-5FMLGOSQ-DV2coA_s.js → cynefinDiagram-5FMLGOSQ-DPszkr1j.js} +1 -1
  32. package/dist-ksadk/assets/{dagre-3AP2YEHR-jEooZQ_X.js → dagre-3AP2YEHR-Ds2xBGA0.js} +1 -1
  33. package/dist-ksadk/assets/{dagre-ljD7-f9M.js → dagre-Dr0YPDPm.js} +1 -1
  34. package/dist-ksadk/assets/{diagram-S7CK7UJ4-B5BoTuaY.js → diagram-S7CK7UJ4-BOQfgaW5.js} +1 -1
  35. package/dist-ksadk/assets/{diagram-UQ7AKVKN-Cvxn92tK.js → diagram-UQ7AKVKN-DMMyB2sa.js} +1 -1
  36. package/dist-ksadk/assets/{diagram-VSXAHHWV-CI86Na4n.js → diagram-VSXAHHWV-DZR1nzPa.js} +1 -1
  37. package/dist-ksadk/assets/{diagram-VX7I27RA-CeZud7ml.js → diagram-VX7I27RA-DzAwLHuI.js} +1 -1
  38. package/dist-ksadk/assets/{diagram-Z3DM3KII-GeJxYdqI.js → diagram-Z3DM3KII-D98d_Dgt.js} +1 -1
  39. package/dist-ksadk/assets/{dist-CJuVeKiz.js → dist-A55dc8b7.js} +1 -1
  40. package/dist-ksadk/assets/{dist-BtermLVk.js → dist-BEzIxZLq.js} +1 -1
  41. package/dist-ksadk/assets/{dist-BxicrSj5.js → dist-BHIb3Gvv.js} +1 -1
  42. package/dist-ksadk/assets/{dist-Dk6TLega.js → dist-BIR7kFKG.js} +1 -1
  43. package/dist-ksadk/assets/{dist-Dig9D26k.js → dist-BpZXLW0T.js} +1 -1
  44. package/dist-ksadk/assets/{dist-lHe3BnLM.js → dist-By8HbjFH.js} +1 -1
  45. package/dist-ksadk/assets/{dist-ubZkVDhc.js → dist-C1uAMNTH.js} +1 -1
  46. package/dist-ksadk/assets/{dist-C7H9f-JT.js → dist-CN8MSPvo.js} +1 -1
  47. package/dist-ksadk/assets/{dist-eYoWaedR.js → dist-CpHO1CY1.js} +1 -1
  48. package/dist-ksadk/assets/{dist-BcNp5ouu.js → dist-CxzBVC3N.js} +1 -1
  49. package/dist-ksadk/assets/{dist-D2IRjZmI.js → dist-D9GtQnvz.js} +1 -1
  50. package/dist-ksadk/assets/{dist-CmWGM_T9.js → dist-DHiOUJJ-.js} +1 -1
  51. package/dist-ksadk/assets/{dist-Cgh3LKbI.js → dist-Du5KbDTg.js} +1 -1
  52. package/dist-ksadk/assets/{dist-CXo9VOuF.js → dist-DxBl1V2_.js} +1 -1
  53. package/dist-ksadk/assets/{dist-BiarszCa.js → dist-E1uwqlZY.js} +1 -1
  54. package/dist-ksadk/assets/{dist-BOBeN4EW.js → dist-HuJDn2Nr.js} +1 -1
  55. package/dist-ksadk/assets/{dist-BgCDfLfr.js → dist-MMIlBueM.js} +1 -1
  56. package/dist-ksadk/assets/{dist-IuOndGF_.js → dist-U51Rn7ZW.js} +1 -1
  57. package/dist-ksadk/assets/{dist-nOyq5Gq7.js → dist-VLWgeZIu.js} +1 -1
  58. package/dist-ksadk/assets/{dist-XaciJNLw.js → dist-X8Mgnqit.js} +1 -1
  59. package/dist-ksadk/assets/{dist-B_y4v6Vh.js → dist-glVlUB_d.js} +1 -1
  60. package/dist-ksadk/assets/{dist-CWaqQiTL.js → dist-q8rONmMl.js} +1 -1
  61. package/dist-ksadk/assets/{ebnfDiagram-PWID7BFC-CVnEnD_Y.js → ebnfDiagram-PWID7BFC-X4mBLaw3.js} +1 -1
  62. package/dist-ksadk/assets/{erDiagram-SSCWMZ5O-gaG6xmRn.js → erDiagram-SSCWMZ5O-ClybQoOy.js} +1 -1
  63. package/dist-ksadk/assets/eventmodeling-NTZA5JFV--IdqCKdV.js +1 -0
  64. package/dist-ksadk/assets/flowDiagram-A5DVABFB-BsidNZBX.js +1 -0
  65. package/dist-ksadk/assets/{ganttDiagram-EL5Y4UJY-Yov_MdHm.js → ganttDiagram-EL5Y4UJY-Dc_fWiA_.js} +1 -1
  66. package/dist-ksadk/assets/gitGraph-4MIJSDKK-BTqI4bBo.js +1 -0
  67. package/dist-ksadk/assets/{gitGraphDiagram-WWUBYQGX-pCt6JiWp.js → gitGraphDiagram-WWUBYQGX-0eEV_CEC.js} +1 -1
  68. package/dist-ksadk/assets/index-B0DeBpyZ.js +1132 -0
  69. package/dist-ksadk/assets/index-DEVfafsU.css +2 -0
  70. package/dist-ksadk/assets/info-A6RAGUB7-CXZCoW0H.js +1 -0
  71. package/dist-ksadk/assets/{infoDiagram-RXCK75RN-Df7QB9IZ.js → infoDiagram-RXCK75RN-mZoyw4Xh.js} +1 -1
  72. package/dist-ksadk/assets/{ishikawaDiagram-5VMMS53U-BxZM8H3E.js → ishikawaDiagram-5VMMS53U-CO8OkxgJ.js} +1 -1
  73. package/dist-ksadk/assets/{journeyDiagram-EYS64GPL-DXJc7vNQ.js → journeyDiagram-EYS64GPL-Ci8GpXLK.js} +1 -1
  74. package/dist-ksadk/assets/{kanban-definition-3QL26DDD-uGr_y_n5.js → kanban-definition-3QL26DDD-lgD5AYON.js} +1 -1
  75. package/dist-ksadk/assets/{katex-C34HoTrL.js → katex-Chn0O-XC.js} +1 -1
  76. package/dist-ksadk/assets/{linear-C7-Mijzq.js → linear-ffygyi0f.js} +1 -1
  77. package/dist-ksadk/assets/{mermaid-parser.core-DH4-hsMU.js → mermaid-parser.core-CGPz1_57.js} +2 -2
  78. package/dist-ksadk/assets/{mindmap-definition-FBJOCRG2-5UJYSEer.js → mindmap-definition-FBJOCRG2-DRaJyZGQ.js} +1 -1
  79. package/dist-ksadk/assets/packet-AYTQ26CC-DoZlIRtk.js +1 -0
  80. package/dist-ksadk/assets/{pegDiagram-XKGWAZYB-BPdl55Nd.js → pegDiagram-XKGWAZYB-BbQ2QDD3.js} +1 -1
  81. package/dist-ksadk/assets/pie-WAS4IAKB-Dl-IyMT_.js +1 -0
  82. package/dist-ksadk/assets/{pieDiagram-E7YTZNPT-cDC3mpF_.js → pieDiagram-E7YTZNPT-BcB_c4Ka.js} +1 -1
  83. package/dist-ksadk/assets/{quadrantDiagram-AXDQQJYC-7jhGjy86.js → quadrantDiagram-AXDQQJYC-CK3csxHk.js} +1 -1
  84. package/dist-ksadk/assets/radar-RG4KPBEZ-Bp8MemxX.js +1 -0
  85. package/dist-ksadk/assets/railroad-74A4TZTK-BmKyKako.js +1 -0
  86. package/dist-ksadk/assets/railroad-abnf-HS5TGJTU-DhFitwOH.js +1 -0
  87. package/dist-ksadk/assets/railroad-ebnf-LZEXJU2U-TB8LQz8q.js +1 -0
  88. package/dist-ksadk/assets/railroad-peg-WCYAUIDC-B3J1Rtq9.js +1 -0
  89. package/dist-ksadk/assets/{railroadDiagram-O6MQD6OU-DdTXYjCz.js → railroadDiagram-O6MQD6OU-D1YLglVU.js} +1 -1
  90. package/dist-ksadk/assets/{requirementDiagram-EFPCY7ZU-BxH5im9j.js → requirementDiagram-EFPCY7ZU-VeyqOcw3.js} +1 -1
  91. package/dist-ksadk/assets/{sankeyDiagram-P5KCCOFB-BrTs-PhV.js → sankeyDiagram-P5KCCOFB-uskDVCah.js} +1 -1
  92. package/dist-ksadk/assets/{sequenceDiagram-WJ2MYXX4-B-GvSk9Z.js → sequenceDiagram-WJ2MYXX4-CmoPC4aR.js} +1 -1
  93. package/dist-ksadk/assets/{sizeCapture-X5ZJPWSS-CxP3dmNT.js → sizeCapture-X5ZJPWSS-DzV4X5WN.js} +1 -1
  94. package/dist-ksadk/assets/{stateDiagram-HBIQ2CUA-CIw-mH34.js → stateDiagram-HBIQ2CUA-BJehrZbH.js} +1 -1
  95. package/dist-ksadk/assets/stateDiagram-v2-4QOOHH4V-DkujIgVj.js +1 -0
  96. package/dist-ksadk/assets/{swimlanes-XN3QIQJK-YZIWfS0x.js → swimlanes-XN3QIQJK-Bn4tEi27.js} +1 -1
  97. package/dist-ksadk/assets/swimlanesDiagram-VK2B7HYN-Blb1TQ9Q.js +8 -0
  98. package/dist-ksadk/assets/{timeline-definition-24CTP7MA-CJ63qwLI.js → timeline-definition-24CTP7MA-bSkaKxqF.js} +1 -1
  99. package/dist-ksadk/assets/treeView-Q6P3EWNA-C5Ez-6L4.js +1 -0
  100. package/dist-ksadk/assets/treemap-WGGIJYW6-WdNvoGQV.js +1 -0
  101. package/dist-ksadk/assets/{vennDiagram-4TSXK5OY-DimJA1nS.js → vennDiagram-4TSXK5OY-ClO6s5iT.js} +1 -1
  102. package/dist-ksadk/assets/wardley-WFR3VGLG-DCCceTuX.js +1 -0
  103. package/dist-ksadk/assets/{wardleyDiagram-VM6X3IG4-Wf93ZvjN.js → wardleyDiagram-VM6X3IG4-CcaYar33.js} +1 -1
  104. package/dist-ksadk/assets/{xychartDiagram-S5SC5T6Z-B2A1aC7t.js → xychartDiagram-S5SC5T6Z-DdiPl8uB.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 +1956 -0
  108. package/dist-lib/ConnectedComposer-CuN3EUnU.js +872 -0
  109. package/dist-lib/{ConnectedMessageList-Dhudkynn.js → ConnectedMessageList-CT-MJJkJ.js} +444 -442
  110. package/dist-lib/{WorkspacePanelContainer-CA59c9AQ.js → WorkspacePanelContainer-Jg9bUmLJ.js} +321 -321
  111. package/dist-lib/{a2ui-D2QH7eTV.js → a2ui-DridcTyF.js} +1717 -447
  112. package/dist-lib/{capabilities-DAeBY-WO.js → capabilities-lJRDfRg9.js} +46 -33
  113. package/dist-lib/capabilities.js +1 -1
  114. package/dist-lib/chat-composer.js +2 -2
  115. package/dist-lib/chat-timeline.js +3 -3
  116. package/dist-lib/components/chat/A2UIActivityMessage.d.ts +1 -0
  117. package/dist-lib/components/chat/A2UIActivityMessage.d.ts.map +1 -1
  118. package/dist-lib/components/chat/ChatComposer.d.ts +4 -2
  119. package/dist-lib/components/chat/ChatComposer.d.ts.map +1 -1
  120. package/dist-lib/components/chat/ChatMessageList.d.ts.map +1 -1
  121. package/dist-lib/components/chat/ConnectedComposer.d.ts +4 -2
  122. package/dist-lib/components/chat/ConnectedComposer.d.ts.map +1 -1
  123. package/dist-lib/components/chat/ExecutionPermissionMenu.d.ts +11 -0
  124. package/dist-lib/components/chat/ExecutionPermissionMenu.d.ts.map +1 -0
  125. package/dist-lib/components/chat/InteractionA2uiSurface.d.ts +6 -1
  126. package/dist-lib/components/chat/InteractionA2uiSurface.d.ts.map +1 -1
  127. package/dist-lib/components/chat/InteractionTray.d.ts +3 -1
  128. package/dist-lib/components/chat/InteractionTray.d.ts.map +1 -1
  129. package/dist-lib/components/chat/JsonSchemaInputForm.d.ts.map +1 -1
  130. package/dist-lib/components/chat/McpAuthorizationCard.d.ts +8 -0
  131. package/dist-lib/components/chat/McpAuthorizationCard.d.ts.map +1 -0
  132. package/dist-lib/components/chat/permission-menu-visibility.d.ts +7 -0
  133. package/dist-lib/components/chat/permission-menu-visibility.d.ts.map +1 -0
  134. package/dist-lib/components/ui/button.d.ts +12 -0
  135. package/dist-lib/components/ui/button.d.ts.map +1 -0
  136. package/dist-lib/components.js +13 -13
  137. package/dist-lib/conversation.js +2 -2
  138. package/dist-lib/core/api/facade.d.ts +1 -0
  139. package/dist-lib/core/api/facade.d.ts.map +1 -1
  140. package/dist-lib/core/api/types.d.ts +1 -0
  141. package/dist-lib/core/api/types.d.ts.map +1 -1
  142. package/dist-lib/core/conversation/presentation.d.ts.map +1 -1
  143. package/dist-lib/core/conversation/runtime-ingress.d.ts.map +1 -1
  144. package/dist-lib/core/interaction/a2ui-approval.d.ts +20 -0
  145. package/dist-lib/core/interaction/a2ui-approval.d.ts.map +1 -0
  146. package/dist-lib/core/interaction/adapters/agui.d.ts.map +1 -1
  147. package/dist-lib/core/interaction/adapters/normalize.d.ts +2 -0
  148. package/dist-lib/core/interaction/adapters/normalize.d.ts.map +1 -1
  149. package/dist-lib/core/interaction/adapters/responses.d.ts +14 -0
  150. package/dist-lib/core/interaction/adapters/responses.d.ts.map +1 -1
  151. package/dist-lib/core/interaction/adapters/session-events.d.ts.map +1 -1
  152. package/dist-lib/core/interaction/client.d.ts.map +1 -1
  153. package/dist-lib/core/interaction/index.d.ts +16 -2
  154. package/dist-lib/core/interaction/index.d.ts.map +1 -1
  155. package/dist-lib/core/interaction/legacy-a2ui.d.ts +5 -0
  156. package/dist-lib/core/interaction/legacy-a2ui.d.ts.map +1 -0
  157. package/dist-lib/core/interaction/pending.d.ts +4 -0
  158. package/dist-lib/core/interaction/pending.d.ts.map +1 -0
  159. package/dist-lib/core/mcp-authorization/contract.d.ts +5 -0
  160. package/dist-lib/core/mcp-authorization/contract.d.ts.map +1 -0
  161. package/dist-lib/core/mcp-authorization/normalize.d.ts +4 -0
  162. package/dist-lib/core/mcp-authorization/normalize.d.ts.map +1 -0
  163. package/dist-lib/core/mcp-authorization/recovery.d.ts +5 -0
  164. package/dist-lib/core/mcp-authorization/recovery.d.ts.map +1 -0
  165. package/dist-lib/core/mcp-authorization/types.d.ts +20 -0
  166. package/dist-lib/core/mcp-authorization/types.d.ts.map +1 -0
  167. package/dist-lib/core/run/agui.d.ts.map +1 -1
  168. package/dist-lib/core/run/dispatcher.d.ts.map +1 -1
  169. package/dist-lib/core/run/engine.d.ts.map +1 -1
  170. package/dist-lib/core/run/types.d.ts +13 -0
  171. package/dist-lib/core/run/types.d.ts.map +1 -1
  172. package/dist-lib/core/stream/types.d.ts +11 -0
  173. package/dist-lib/core/stream/types.d.ts.map +1 -1
  174. package/dist-lib/core/teams/cloudContracts.d.ts +15 -15
  175. package/dist-lib/{feedback-DRgW061h.js → feedback-CaSZOBD2.js} +12 -22
  176. package/dist-lib/hooks/useAgentChat.d.ts.map +1 -1
  177. package/dist-lib/hooks/useInteractions.d.ts +1 -0
  178. package/dist-lib/hooks/useInteractions.d.ts.map +1 -1
  179. package/dist-lib/hooks/useSessionLifecycle.d.ts.map +1 -1
  180. package/dist-lib/hooks.js +58 -57
  181. package/dist-lib/{permission-CHy_uZD0.js → permission-2NpSBuq3.js} +1 -1
  182. package/dist-lib/{persisted-session-history-KtoKbLRA.js → persisted-session-history-D_1AtH5H.js} +536 -1457
  183. package/dist-lib/runtime.js +279 -276
  184. package/dist-lib/session-events-6PXUoAkP.js +1225 -0
  185. package/dist-lib/stores/bootstrap.d.ts.map +1 -1
  186. package/dist-lib/stores/execution-permission.d.ts +21 -0
  187. package/dist-lib/stores/execution-permission.d.ts.map +1 -0
  188. package/dist-lib/styles.css +1 -1
  189. package/dist-lib/types/capabilities.d.ts +14 -0
  190. package/dist-lib/types/capabilities.d.ts.map +1 -1
  191. package/dist-lib/{useSessionLifecycle-DNG3Yks2.js → useSessionLifecycle-daQg0sqQ.js} +1032 -1946
  192. package/dist-lib/utils/capabilities.d.ts.map +1 -1
  193. package/dist-lib/utils/persisted-session-history.d.ts.map +1 -1
  194. package/dist-lib/utils/responses-stream.d.ts.map +1 -1
  195. package/dist-lib/utils/run-progress.d.ts.map +1 -1
  196. package/dist-lib/utils/workspace.d.ts +1 -1
  197. package/package.json +1 -1
  198. package/dist-ksadk/assets/architecture-7GRP2DOG-vaJx2f97.js +0 -1
  199. package/dist-ksadk/assets/channel-qoLBikeO.js +0 -1
  200. package/dist-ksadk/assets/chunk-2Q5K7J3B-OLdkjA_5.js +0 -1
  201. package/dist-ksadk/assets/classDiagram-DTDB5LWJ-DqbkClnv.js +0 -1
  202. package/dist-ksadk/assets/classDiagram-v2-JRS7N3AN-DqbkClnv.js +0 -1
  203. package/dist-ksadk/assets/cynefin-OW5HDTMX-BnPp48kV.js +0 -1
  204. package/dist-ksadk/assets/eventmodeling-NTZA5JFV-BHS_Svvs.js +0 -1
  205. package/dist-ksadk/assets/flowDiagram-A5DVABFB-BkQ0O0Ft.js +0 -1
  206. package/dist-ksadk/assets/gitGraph-4MIJSDKK-CSW-TIsw.js +0 -1
  207. package/dist-ksadk/assets/index-DMqhW2cV.css +0 -2
  208. package/dist-ksadk/assets/index-DcQSCIw4.js +0 -1132
  209. package/dist-ksadk/assets/info-A6RAGUB7-2r962Zht.js +0 -1
  210. package/dist-ksadk/assets/packet-AYTQ26CC-C8AN0vyj.js +0 -1
  211. package/dist-ksadk/assets/pie-WAS4IAKB-D8iGFt9t.js +0 -1
  212. package/dist-ksadk/assets/radar-RG4KPBEZ-BFDLv34s.js +0 -1
  213. package/dist-ksadk/assets/railroad-74A4TZTK-BCF2fZR0.js +0 -1
  214. package/dist-ksadk/assets/railroad-abnf-HS5TGJTU-Ban_fK3c.js +0 -1
  215. package/dist-ksadk/assets/railroad-ebnf-LZEXJU2U-DKxLpd8o.js +0 -1
  216. package/dist-ksadk/assets/railroad-peg-WCYAUIDC-n_o0pjRU.js +0 -1
  217. package/dist-ksadk/assets/stateDiagram-v2-4QOOHH4V-CFLSAbtQ.js +0 -1
  218. package/dist-ksadk/assets/swimlanesDiagram-VK2B7HYN-CNHXQSl-.js +0 -8
  219. package/dist-ksadk/assets/treeView-Q6P3EWNA-B1wKifn0.js +0 -1
  220. package/dist-ksadk/assets/treemap-WGGIJYW6-DECztlF0.js +0 -1
  221. package/dist-ksadk/assets/wardley-WFR3VGLG-BSQgLjrP.js +0 -1
  222. package/dist-lib/AttachmentPreview-CPRjbiqd.js +0 -1545
  223. package/dist-lib/ConnectedComposer-CKnKpokV.js +0 -781
  224. package/dist-lib/json-value-DnHp0582.js +0 -186
  225. package/dist-lib/tool-display-DTiRdghE.js +0 -64
@@ -1,21 +1,23 @@
1
- import { n as e, t } from "./json-value-DnHp0582.js";
2
- import { createContext as n, useContext as r } from "react";
3
- import { create as i } from "zustand";
4
- import { jsx as a } from "react/jsx-runtime";
5
- import o from "ajv/dist/2020.js";
6
- import s from "ajv-formats";
7
- import { Catalog as c, MessageProcessor as l, createFunctionImplementation as u } from "@a2ui/web_core/v0_9";
8
- import { canonicalize as d } from "json-canonicalize";
9
- import { sha256 as f } from "@noble/hashes/sha2.js";
10
- import { bytesToHex as ee } from "@noble/hashes/utils.js";
11
- import te from "ajv";
12
- import ne from "ajv/dist/2019.js";
13
- import re from "ajv-draft-04";
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";
14
16
  //#region src/stores/ui.ts
15
- function p(e, t) {
17
+ function ie(e, t) {
16
18
  return typeof t == "function" ? t(e) : t;
17
19
  }
18
- var ie = i()((e) => ({
20
+ var ae = s()((e) => ({
19
21
  sidebarOpen: !0,
20
22
  mobileSidebarOpen: !1,
21
23
  mobileActionsOpen: !1,
@@ -38,10 +40,10 @@ var ie = i()((e) => ({
38
40
  setWorkspacePanelWidth: (t) => e({ workspacePanelWidth: t }),
39
41
  setWorkspacePanelFullscreen: (t) => e({ workspacePanelFullscreen: t }),
40
42
  setInput: (t) => e({ input: t }),
41
- setAttachments: (t) => e((e) => ({ attachments: p(e.attachments, t) })),
43
+ setAttachments: (t) => e((e) => ({ attachments: ie(e.attachments, t) })),
42
44
  setPreviewAttachment: (t) => e({ previewAttachment: t }),
43
45
  setPreviewImageSize: (t) => e({ previewImageSize: t }),
44
- setQueuedDrafts: (t) => e((e) => ({ queuedDrafts: p(e.queuedDrafts, t) })),
46
+ setQueuedDrafts: (t) => e((e) => ({ queuedDrafts: ie(e.queuedDrafts, t) })),
45
47
  pushToast: (t, n = "info") => e((e) => ({ toasts: [...e.toasts, {
46
48
  id: String(Date.now() + Math.random()),
47
49
  message: t,
@@ -49,14 +51,14 @@ var ie = i()((e) => ({
49
51
  createdAt: Date.now()
50
52
  }] })),
51
53
  dismissToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) }))
52
- })), m = (e) => Object.keys(e).length > 0, h = {
54
+ })), _ = (e) => Object.keys(e).length > 0, oe = {
53
55
  runId: null,
54
56
  status: null,
55
57
  items: []
56
- }, g = new e(), _ = (e, t) => {
58
+ }, v = new r(), y = (e, t) => {
57
59
  let n = { ...e };
58
60
  return delete n[t], n;
59
- }, v = i()((t, n) => ({
61
+ }, se = s()((e, t) => ({
60
62
  isStreaming: !1,
61
63
  currentRunId: "",
62
64
  stopRequested: !1,
@@ -66,91 +68,91 @@ var ie = i()((e) => ({
66
68
  banner: null,
67
69
  lastSeqId: 0,
68
70
  activeInvocationId: "",
69
- runtimeItems: h,
70
- setStreaming: (e) => t({ isStreaming: e }),
71
- setBanner: (e) => t({ banner: e ? {
72
- ...e,
71
+ runtimeItems: oe,
72
+ setStreaming: (t) => e({ isStreaming: t }),
73
+ setBanner: (t) => e({ banner: t ? {
74
+ ...t,
73
75
  createdAt: Date.now()
74
76
  } : null }),
75
- setLastSeqId: (e) => t({ lastSeqId: e }),
76
- setActiveInvocationId: (e) => t({ activeInvocationId: e }),
77
- setSessionStreaming: (e, n) => t((t) => {
78
- let r = String(e || ""), i = _(t.sessionStreaming, r), a = n ? {
77
+ setLastSeqId: (t) => e({ lastSeqId: t }),
78
+ setActiveInvocationId: (t) => e({ activeInvocationId: t }),
79
+ setSessionStreaming: (t, n) => e((e) => {
80
+ let r = String(t || ""), i = y(e.sessionStreaming, r), a = n ? {
79
81
  ...i,
80
82
  [r]: !0
81
83
  } : i;
82
84
  return {
83
85
  sessionStreaming: a,
84
- isStreaming: m(a)
86
+ isStreaming: _(a)
85
87
  };
86
88
  }),
87
89
  isSessionStreaming: (e) => {
88
- let t = String(e || "");
89
- return !!n().sessionStreaming[t];
90
+ let n = String(e || "");
91
+ return !!t().sessionStreaming[n];
90
92
  },
91
93
  getSessionActivity: (e) => {
92
- let t = String(e || "");
93
- return t && n().sessionActivities[t] || null;
94
+ let n = String(e || "");
95
+ return n && t().sessionActivities[n] || null;
94
96
  },
95
- setCurrentRunId: (e) => t({ currentRunId: e }),
96
- requestStop: () => t({ stopRequested: !0 }),
97
- beginActivity: (e) => t({
97
+ setCurrentRunId: (t) => e({ currentRunId: t }),
98
+ requestStop: () => e({ stopRequested: !0 }),
99
+ beginActivity: (t) => e({
98
100
  stopRequested: !1,
99
101
  activity: {
100
- runId: e.runId,
101
- source: e.source || "run",
102
- status: e.status || "running",
103
- phase: e.phase,
104
- detail: e.detail,
102
+ runId: t.runId,
103
+ source: t.source || "run",
104
+ status: t.status || "running",
105
+ phase: t.phase,
106
+ detail: t.detail,
105
107
  startedAt: Date.now(),
106
108
  lastEventAt: Date.now(),
107
109
  eventCount: 0
108
110
  }
109
111
  }),
110
- updateActivity: (e) => t((t) => {
111
- let n = String(e.sessionId || ""), r = n ? t.sessionActivities[n] : t.activity, i = r ? {
112
+ updateActivity: (t) => e((e) => {
113
+ let n = String(t.sessionId || ""), r = n ? e.sessionActivities[n] : e.activity, i = r ? {
112
114
  ...r,
113
- runId: e.runId || r.runId,
114
- source: e.source || r.source,
115
- status: e.status || r.status,
116
- phase: e.phase || r.phase,
117
- detail: e.detail === void 0 ? r.detail : e.detail,
115
+ runId: t.runId || r.runId,
116
+ source: t.source || r.source,
117
+ status: t.status || r.status,
118
+ phase: t.phase || r.phase,
119
+ detail: t.detail === void 0 ? r.detail : t.detail,
118
120
  lastEventAt: Date.now(),
119
- eventCount: r.eventCount + (e.countEvent === !1 ? 0 : 1)
121
+ eventCount: r.eventCount + (t.countEvent === !1 ? 0 : 1)
120
122
  } : {
121
- runId: e.runId,
122
- source: e.source || "run",
123
- status: e.status || "running",
124
- phase: e.phase || "正在运行",
125
- detail: e.detail,
123
+ runId: t.runId,
124
+ source: t.source || "run",
125
+ status: t.status || "running",
126
+ phase: t.phase || "正在运行",
127
+ detail: t.detail,
126
128
  startedAt: Date.now(),
127
129
  lastEventAt: Date.now(),
128
- eventCount: e.countEvent === !1 ? 0 : 1
130
+ eventCount: t.countEvent === !1 ? 0 : 1
129
131
  };
130
132
  return n ? {
131
- isStreaming: m(t.sessionStreaming),
133
+ isStreaming: _(e.sessionStreaming),
132
134
  sessionActivities: {
133
- ...t.sessionActivities,
135
+ ...e.sessionActivities,
134
136
  [n]: i
135
137
  },
136
- ...e.visible === !1 ? {} : { activity: i }
137
- } : { ...e.visible === !1 ? {} : { activity: i } };
138
+ ...t.visible === !1 ? {} : { activity: i }
139
+ } : { ...t.visible === !1 ? {} : { activity: i } };
138
140
  }),
139
- stopActivity: (e) => t((t) => ({
141
+ stopActivity: (t) => e((e) => ({
140
142
  isStreaming: !1,
141
143
  stopRequested: !0,
142
- activity: t.activity ? {
143
- ...t.activity,
144
+ activity: e.activity ? {
145
+ ...e.activity,
144
146
  status: "stopped",
145
147
  phase: "已断开输出流",
146
- detail: e || "前端已断开本次输出流;后台运行可稍后通过会话记录继续查看。",
148
+ detail: t || "前端已断开本次输出流;后台运行可稍后通过会话记录继续查看。",
147
149
  lastEventAt: Date.now()
148
150
  } : null
149
151
  })),
150
- stopSessionActivity: (e, n, r = !0) => t((t) => {
151
- let i = String(e || "");
152
+ stopSessionActivity: (t, n, r = !0) => e((e) => {
153
+ let i = String(t || "");
152
154
  if (!i) return {};
153
- let a = t.sessionActivities[i];
155
+ let a = e.sessionActivities[i];
154
156
  if (!a) return {};
155
157
  let o = {
156
158
  ...a,
@@ -159,11 +161,11 @@ var ie = i()((e) => ({
159
161
  detail: n || "前端已断开本次输出流;后台运行可稍后通过会话记录继续查看。",
160
162
  lastEventAt: Date.now()
161
163
  }, s = {
162
- ...t.sessionActivities,
164
+ ...e.sessionActivities,
163
165
  [i]: o
164
- }, c = _(t.sessionStreaming, i);
166
+ }, c = y(e.sessionStreaming, i);
165
167
  return {
166
- isStreaming: m(c),
168
+ isStreaming: _(c),
167
169
  ...r ? {
168
170
  activity: o,
169
171
  stopRequested: !0
@@ -172,23 +174,23 @@ var ie = i()((e) => ({
172
174
  sessionStreaming: c
173
175
  };
174
176
  }),
175
- clearActivity: () => t({ activity: null }),
176
- clearSessionActivity: (e) => t((t) => {
177
- let n = String(e || "");
177
+ clearActivity: () => e({ activity: null }),
178
+ clearSessionActivity: (t) => e((e) => {
179
+ let n = String(t || "");
178
180
  if (!n) return {};
179
- let { [n]: r, ...i } = t.sessionActivities, a = _(t.sessionStreaming, n);
181
+ let { [n]: r, ...i } = e.sessionActivities, a = y(e.sessionStreaming, n);
180
182
  return {
181
183
  sessionActivities: i,
182
184
  sessionStreaming: a,
183
- isStreaming: m(a),
184
- activity: t.activity === r ? null : t.activity
185
+ isStreaming: _(a),
186
+ activity: e.activity === r ? null : e.activity
185
187
  };
186
188
  }),
187
- applyRuntimeItemOperations: (e) => {
188
- g.applyAll(e), t({ runtimeItems: g.snapshot() });
189
+ applyRuntimeItemOperations: (t) => {
190
+ v.applyAll(t), e({ runtimeItems: v.snapshot() });
189
191
  },
190
192
  resetRun: () => {
191
- g = new e(), t({
193
+ v = new r(), e({
192
194
  isStreaming: !1,
193
195
  currentRunId: "",
194
196
  stopRequested: !1,
@@ -197,13 +199,13 @@ var ie = i()((e) => ({
197
199
  sessionStreaming: {},
198
200
  lastSeqId: 0,
199
201
  activeInvocationId: "",
200
- runtimeItems: h
202
+ runtimeItems: oe
201
203
  });
202
204
  }
203
205
  }));
204
206
  //#endregion
205
207
  //#region src/stores/model.ts
206
- function y(e, t) {
208
+ function ce(e, t) {
207
209
  let n = /* @__PURE__ */ new Map();
208
210
  for (let t of e) t?.id && n.set(t.id, t);
209
211
  for (let e of t) e?.id && n.set(e.id, {
@@ -212,13 +214,13 @@ function y(e, t) {
212
214
  });
213
215
  return Array.from(n.values()).sort((e, t) => e.id.localeCompare(t.id));
214
216
  }
215
- var ae = i()((e) => ({
217
+ var le = s()((e) => ({
216
218
  availableModels: [],
217
219
  selectedModel: "",
218
220
  modelSource: "",
219
221
  modelCatalogLoaded: !1,
220
222
  thinkingMode: "auto",
221
- upsertModels: (t) => e((e) => ({ availableModels: y(e.availableModels, t) })),
223
+ upsertModels: (t) => e((e) => ({ availableModels: ce(e.availableModels, t) })),
222
224
  setSelectedModel: (t) => e({ selectedModel: t }),
223
225
  setModelSource: (t) => e({ modelSource: t }),
224
226
  setModelCatalogLoaded: (t) => e({ modelCatalogLoaded: t }),
@@ -257,7 +259,7 @@ function x(e = /* @__PURE__ */ new Set(), t = []) {
257
259
  }
258
260
  return new Set(Array.from(n).sort((e, t) => e - t));
259
261
  }
260
- function S({ sessionsLength: e = 0, total: t = 0, page: n = 0, pageSize: r = 30, loadedPages: i = /* @__PURE__ */ new Set() } = {}) {
262
+ function ue({ sessionsLength: e = 0, total: t = 0, page: n = 0, pageSize: r = 30, loadedPages: i = /* @__PURE__ */ new Set() } = {}) {
261
263
  let a = Math.max(0, Number(t) || 0), o = Math.max(0, Number(e) || 0);
262
264
  return {
263
265
  total: a,
@@ -267,7 +269,7 @@ function S({ sessionsLength: e = 0, total: t = 0, page: n = 0, pageSize: r = 30,
267
269
  hasMore: o < a
268
270
  };
269
271
  }
270
- function oe({ total: e = 0, pageSize: t = 30, loadedPages: n = /* @__PURE__ */ new Set() } = {}) {
272
+ function de({ total: e = 0, pageSize: t = 30, loadedPages: n = /* @__PURE__ */ new Set() } = {}) {
271
273
  let r = Math.max(0, Number(e) || 0), i = Math.max(1, Number(t) || 30);
272
274
  if (r <= 0) return null;
273
275
  let a = Math.ceil(r / i);
@@ -276,7 +278,7 @@ function oe({ total: e = 0, pageSize: t = 30, loadedPages: n = /* @__PURE__ */ n
276
278
  }
277
279
  //#endregion
278
280
  //#region src/stores/session.ts
279
- function C(e) {
281
+ function fe(e) {
280
282
  let t = e.UpdatedAt;
281
283
  if (typeof t == "string") {
282
284
  let e = Date.parse(t);
@@ -284,37 +286,37 @@ function C(e) {
284
286
  }
285
287
  return typeof t == "number" && Number.isFinite(t) ? t > 1e11 ? t : t * 1e3 : 0;
286
288
  }
287
- var w = "ksadk.pinnedSessionIds";
288
- function T() {
289
+ var pe = "ksadk.pinnedSessionIds";
290
+ function me() {
289
291
  try {
290
- let e = globalThis.localStorage?.getItem(b.key(w)), t = e ? JSON.parse(e) : [];
292
+ let e = globalThis.localStorage?.getItem(b.key(pe)), t = e ? JSON.parse(e) : [];
291
293
  return Array.isArray(t) ? t.filter((e) => typeof e == "string") : [];
292
294
  } catch {
293
295
  return [];
294
296
  }
295
297
  }
296
- function se(e) {
298
+ function he(e) {
297
299
  if (b.writable) try {
298
- globalThis.localStorage?.setItem(b.key(w), JSON.stringify(e));
300
+ globalThis.localStorage?.setItem(b.key(pe), JSON.stringify(e));
299
301
  } catch {}
300
302
  }
301
- function E(e, t) {
303
+ function S(e, t) {
302
304
  let n = new Set(t);
303
305
  return e.slice().sort((e, t) => {
304
306
  let r = +!!n.has(e.SessionId), i = +!!n.has(t.SessionId);
305
- return r === i ? C(t) - C(e) : i - r;
307
+ return r === i ? fe(t) - fe(e) : i - r;
306
308
  });
307
309
  }
308
- function ce(e, t, n) {
310
+ function ge(e, t, n) {
309
311
  let r = /* @__PURE__ */ new Map();
310
312
  for (let t of e) t?.SessionId && r.set(t.SessionId, t);
311
313
  for (let e of t) e?.SessionId && r.set(e.SessionId, {
312
314
  ...r.get(e.SessionId) || {},
313
315
  ...e
314
316
  });
315
- return E(Array.from(r.values()), n);
317
+ return S(Array.from(r.values()), n);
316
318
  }
317
- var D = i()((e) => ({
319
+ var _e = s()((e) => ({
318
320
  sessions: [],
319
321
  currentSessionId: null,
320
322
  sessionsAgentId: "",
@@ -325,12 +327,12 @@ var D = i()((e) => ({
325
327
  loadedPages: /* @__PURE__ */ new Set(),
326
328
  hasMoreSessions: !1,
327
329
  isLoadingSessions: !0,
328
- pinnedSessionIds: T(),
330
+ pinnedSessionIds: me(),
329
331
  messageHistory: {},
330
- setSessions: (t) => e((e) => ({ sessions: E(t, e.pinnedSessionIds) })),
332
+ setSessions: (t) => e((e) => ({ sessions: S(t, e.pinnedSessionIds) })),
331
333
  setCurrentSessionId: (t) => e({ currentSessionId: t }),
332
334
  upsertSessions: (t, n) => e((e) => {
333
- let r = ce(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 = S({
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({
334
336
  sessionsLength: r.length,
335
337
  total: o,
336
338
  page: i,
@@ -352,7 +354,7 @@ var D = i()((e) => ({
352
354
  return {
353
355
  sessions: n,
354
356
  sessionsTotal: r,
355
- hasMoreSessions: S({
357
+ hasMoreSessions: ue({
356
358
  sessionsLength: n.length,
357
359
  total: r,
358
360
  page: e.sessionsPage,
@@ -377,9 +379,9 @@ var D = i()((e) => ({
377
379
  let n = new Set(e.pinnedSessionIds);
378
380
  n.has(t) ? n.delete(t) : n.add(t);
379
381
  let r = Array.from(n);
380
- return se(r), {
382
+ return he(r), {
381
383
  pinnedSessionIds: r,
382
- sessions: E(e.sessions, r)
384
+ sessions: S(e.sessions, r)
383
385
  };
384
386
  }),
385
387
  setSessionMessageHistory: (t, n) => e((e) => ({ messageHistory: {
@@ -421,7 +423,1363 @@ var D = i()((e) => ({
421
423
  let n = { ...e.messageHistory };
422
424
  return delete n[t], { messageHistory: n };
423
425
  })
424
- })), O = {
426
+ })), ve = "ksadk.web.execution-permission", ye = [
427
+ "read-only",
428
+ "workspace-write",
429
+ "danger-full-access"
430
+ ], be = {
431
+ "read-only": "只读",
432
+ "workspace-write": "工作区可写",
433
+ "danger-full-access": "完全访问"
434
+ }, xe = {
435
+ "read-only": "只读",
436
+ "workspace-write": "工作区可写",
437
+ "danger-full-access": "完全访问"
438
+ }, Se = {
439
+ "read-only": "只读文件与命令",
440
+ "workspace-write": "可修改工作区文件",
441
+ "danger-full-access": "不再限制文件与命令"
442
+ };
443
+ function C(e) {
444
+ if (!e || !Array.isArray(e.Modes)) return [];
445
+ let t = e.Modes.filter((e) => ye.includes(e));
446
+ return [...new Set(t)];
447
+ }
448
+ function Ce(e, t) {
449
+ let n = C(e);
450
+ if (n.length === 0) return;
451
+ if (t && n.includes(t)) return t;
452
+ let r = e?.DefaultMode;
453
+ return r && n.includes(r) ? r : n[0];
454
+ }
455
+ function we(e) {
456
+ return e && ye.includes(e) ? { permission_mode: e } : {};
457
+ }
458
+ function w(e) {
459
+ return b.key(`${ve}.${e}`);
460
+ }
461
+ function Te(e) {
462
+ try {
463
+ return globalThis.localStorage?.getItem(w(e)) ?? null;
464
+ } catch {
465
+ return null;
466
+ }
467
+ }
468
+ function Ee(e, t) {
469
+ if (b.writable) try {
470
+ t ? globalThis.localStorage?.setItem(w(e), t) : globalThis.localStorage?.removeItem(w(e));
471
+ } catch {}
472
+ }
473
+ var De = s()((e, t) => ({
474
+ byAgent: {},
475
+ policies: {},
476
+ scopes: {},
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),
481
+ DefaultMode: r?.DefaultMode
482
+ }, c = Ce(s, o ?? a);
483
+ c !== a && Ee(n, c ?? null), e((e) => ({
484
+ byAgent: {
485
+ ...e.byAgent,
486
+ [n]: c
487
+ },
488
+ policies: {
489
+ ...e.policies,
490
+ [n]: s
491
+ },
492
+ scopes: {
493
+ ...e.scopes,
494
+ [n]: i
495
+ }
496
+ }));
497
+ },
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: {
500
+ ...e.byAgent,
501
+ [n]: r
502
+ } })));
503
+ },
504
+ modeFor: (e) => {
505
+ let n = t();
506
+ if (b.blocked || n.scopes[e] !== w(e)) return;
507
+ let r = n.byAgent[e];
508
+ return r && C(n.policies[e]).includes(r) ? r : void 0;
509
+ }
510
+ })), Oe = s()((t, n) => ({
511
+ agentId: "default-agent",
512
+ agentName: "Agent",
513
+ agentFramework: "",
514
+ capabilities: e({}),
515
+ apiFormats: ["responses", "chat_completions"],
516
+ accessMode: "Owner",
517
+ workspaceFiles: null,
518
+ status: "loading",
519
+ errorMessage: "",
520
+ setAgentId: (e) => t({ agentId: e }),
521
+ setAgentName: (e) => t({ agentName: e }),
522
+ setAgentFramework: (e) => t({ agentFramework: e }),
523
+ setCapabilities: (e) => {
524
+ De.getState().configure(n().agentId, e.ExecutionPolicy), t({ capabilities: e });
525
+ },
526
+ setApiFormats: (e) => t({ apiFormats: e }),
527
+ setAccessMode: (e) => t({ accessMode: e }),
528
+ setWorkspaceFiles: (e) => t({ workspaceFiles: e }),
529
+ setStatus: (e, n = "") => t({
530
+ status: e,
531
+ errorMessage: n
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",
545
+ "resolved",
546
+ "cancelled",
547
+ "expired"
548
+ ]), je = new Set([
549
+ "approved",
550
+ "rejected",
551
+ "submitted",
552
+ "cancelled",
553
+ "expired"
554
+ ]);
555
+ 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
+ });
631
+ }
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) {
643
+ return `interaction:${e}:revision-${t}`;
644
+ }
645
+ function He(e, t) {
646
+ if (typeof t != "object" || !t || Array.isArray(t)) return e === "cancel" ? "已取消" : "已提交";
647
+ let n = t.approved;
648
+ if (typeof n == "boolean") return n ? "已同意" : "已拒绝";
649
+ let r = Object.keys(t);
650
+ return r.length === 0 ? e === "approve" ? "已同意" : e === "reject" ? "已拒绝" : e === "cancel" ? "已取消" : "已提交" : `${e}(${r.slice(0, 3).map((e) => {
651
+ let n = t[e];
652
+ return `${e}=${typeof n == "string" ? n.length > 24 ? `${n.slice(0, 24)}…` : n : typeof n == "object" && n ? "[object]" : String(n)}`;
653
+ }).join(", ")})`;
654
+ }
655
+ //#endregion
656
+ //#region src/core/interaction/store.ts
657
+ var A = class {
658
+ records = /* @__PURE__ */ new Map();
659
+ terminalRuns = /* @__PURE__ */ new Set();
660
+ rejectedCommands = /* @__PURE__ */ new Map();
661
+ listeners = /* @__PURE__ */ new Set();
662
+ key(e, t) {
663
+ return `${e}\u0000${t}`;
664
+ }
665
+ runKey(e, t) {
666
+ return `${e}\u0000${t}`;
667
+ }
668
+ subscribe(e) {
669
+ return this.listeners.add(e), () => {
670
+ this.listeners.delete(e);
671
+ };
672
+ }
673
+ emit(e) {
674
+ for (let t of this.listeners) t(e);
675
+ }
676
+ get(e, t) {
677
+ return this.records.get(this.key(e, t)) || null;
678
+ }
679
+ listPending(e) {
680
+ return this.listAll(e).filter((e) => e.status === "pending");
681
+ }
682
+ listAll(e) {
683
+ return this.all().filter((t) => t.sessionId === e);
684
+ }
685
+ all() {
686
+ return [...this.records.values()].sort((e, t) => String(e.createdAt).localeCompare(String(t.createdAt)));
687
+ }
688
+ upsert(e) {
689
+ 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 = {
691
+ ...e,
692
+ status: "expired",
693
+ outcome: "expired",
694
+ resolvedAt: e.resolvedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
695
+ responseSummary: e.responseSummary ?? "运行已结束"
696
+ });
697
+ let n, r;
698
+ return t ? k(t.status) && !k(e.status) ? (n = {
699
+ ...t,
700
+ title: ["人工确认", "补充信息"].includes(t.title) ? e.title : t.title,
701
+ message: ["本次运行需要人工处理后才能继续。", "请填写后提交,Agent 将继续当前任务。"].includes(t.message) ? e.message : t.message,
702
+ kind: t.kind === "approval" && !t.requestSchema ? e.kind : t.kind,
703
+ requestSchema: t.requestSchema ?? e.requestSchema,
704
+ presentation: t.presentation ?? e.presentation
705
+ }, r = {
706
+ type: "interaction_updated",
707
+ 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 = {
709
+ type: "interaction_updated",
710
+ interaction: n
711
+ }) : k(e.status) ? (n = {
712
+ ...t,
713
+ ...e,
714
+ title: t.title || e.title,
715
+ kind: t.kind || e.kind,
716
+ message: t.message || e.message,
717
+ runId: e.runId ?? t.runId,
718
+ requestSchema: t.requestSchema ?? e.requestSchema,
719
+ presentation: t.presentation ?? e.presentation,
720
+ actor: e.actor ?? t.actor,
721
+ outcome: e.outcome ?? t.outcome,
722
+ resolvedAt: e.resolvedAt ?? t.resolvedAt,
723
+ responseSummary: e.responseSummary ?? t.responseSummary,
724
+ ...Object.hasOwn(t, "response") ? { response: t.response } : {}
725
+ }, r = {
726
+ type: "interaction_resolved",
727
+ interaction: n
728
+ }) : (n = {
729
+ ...t,
730
+ ...e
731
+ }, r = {
732
+ type: "interaction_updated",
733
+ interaction: n
734
+ }) : (n = e, r = {
735
+ type: "interaction_requested",
736
+ interaction: n
737
+ }), this.records.set(this.key(n.sessionId, n.interactionId), n), this.emit(r), r;
738
+ }
739
+ markResolving(e, t) {
740
+ let n = this.get(e, t);
741
+ if (!n || !["pending", "failed"].includes(n.status)) return;
742
+ let r = { ...n.extensions };
743
+ delete r.submit_error, delete r.submit_command_id, this.records.set(this.key(e, t), {
744
+ ...n,
745
+ status: "resolving",
746
+ extensions: r
747
+ }), this.emit({
748
+ type: "interaction_updated",
749
+ interaction: this.get(e, t)
750
+ });
751
+ }
752
+ resolveLocally(e, t, n) {
753
+ let r = this.get(e, t);
754
+ if (!r) return;
755
+ let i = {
756
+ ...r,
757
+ ...n,
758
+ resolvedAt: n.resolvedAt ?? r.resolvedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
759
+ revision: n.revision ?? r.revision
760
+ };
761
+ this.records.set(this.key(e, t), i), this.emit({
762
+ type: "interaction_resolved",
763
+ interaction: i
764
+ });
765
+ }
766
+ recordCommand(e, t, n) {
767
+ let r = this.get(e, t);
768
+ if (!r || !n || k(r.status)) return;
769
+ this.records.set(this.key(e, t), {
770
+ ...r,
771
+ extensions: {
772
+ ...r.extensions,
773
+ submit_command_id: n
774
+ }
775
+ });
776
+ let i = this.rejectedCommands.get(this.key(e, n));
777
+ i && this.rejectCommand(e, n, i);
778
+ }
779
+ rejectCommand(e, t, n) {
780
+ if (!(!e || !t)) {
781
+ this.rejectedCommands.set(this.key(e, t), n);
782
+ for (let r of this.listAll(e)) {
783
+ if (r.extensions.submit_command_id !== t) continue;
784
+ this.markFailed(e, r.interactionId, {
785
+ code: n,
786
+ message: `提交未执行(${n}),请重试`,
787
+ retryable: !0
788
+ });
789
+ let i = this.get(e, r.interactionId);
790
+ i?.status === "failed" && this.records.set(this.key(e, r.interactionId), {
791
+ ...i,
792
+ extensions: {
793
+ ...i.extensions,
794
+ rejected_command_id: t
795
+ }
796
+ });
797
+ }
798
+ }
799
+ }
800
+ recordIdempotencyKey(e, t, n) {
801
+ let r = this.get(e, t);
802
+ if (!r) return;
803
+ let i = {
804
+ ...r,
805
+ extensions: {
806
+ ...r.extensions,
807
+ idempotency_key: n
808
+ }
809
+ };
810
+ this.records.set(this.key(e, t), i), this.emit({
811
+ type: "interaction_updated",
812
+ interaction: i
813
+ });
814
+ }
815
+ markFailed(e, t, n) {
816
+ let r = this.get(e, t);
817
+ if (!r || k(r.status)) return;
818
+ let i = {
819
+ ...r,
820
+ status: "failed",
821
+ extensions: {
822
+ ...r.extensions,
823
+ submit_error: n
824
+ }
825
+ };
826
+ this.records.set(this.key(e, t), i), this.emit({
827
+ type: "interaction_updated",
828
+ interaction: i
829
+ });
830
+ }
831
+ revertToPending(e, t) {
832
+ let n = this.get(e, t);
833
+ if (!n || n.status !== "resolving") return;
834
+ let r = {
835
+ ...n,
836
+ status: "pending"
837
+ };
838
+ this.records.set(this.key(e, t), r), this.emit({
839
+ type: "interaction_updated",
840
+ interaction: r
841
+ });
842
+ }
843
+ markRunTerminal(e, t) {
844
+ if (!(!e || !t)) {
845
+ this.terminalRuns.add(this.runKey(e, t));
846
+ for (let n of this.listAll(e)) {
847
+ if (n.runId !== t || k(n.status)) continue;
848
+ let r = {
849
+ ...n,
850
+ status: "expired",
851
+ outcome: "expired",
852
+ resolvedAt: n.resolvedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
853
+ responseSummary: n.responseSummary ?? "运行已结束"
854
+ };
855
+ this.records.set(this.key(e, n.interactionId), r), this.emit({
856
+ type: "interaction_resolved",
857
+ interaction: r
858
+ });
859
+ }
860
+ }
861
+ }
862
+ markSessionTerminal(e) {
863
+ if (!e) return;
864
+ let t = new Set(this.listAll(e).filter((e) => !k(e.status)).map((e) => e.runId).filter((e) => !!e));
865
+ for (let n of t) this.markRunTerminal(e, n);
866
+ for (let t of this.listAll(e)) {
867
+ if (t.runId || k(t.status)) continue;
868
+ let n = {
869
+ ...t,
870
+ status: "expired",
871
+ outcome: "expired",
872
+ resolvedAt: t.resolvedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
873
+ responseSummary: t.responseSummary ?? "运行已结束"
874
+ };
875
+ this.records.set(this.key(e, t.interactionId), n), this.emit({
876
+ type: "interaction_resolved",
877
+ interaction: n
878
+ });
879
+ }
880
+ }
881
+ remove(e, t) {
882
+ let n = this.key(e, t);
883
+ this.records.has(n) && (this.records.delete(n), this.emit({
884
+ type: "interaction_removed",
885
+ interactionId: t
886
+ }));
887
+ }
888
+ clearSession(e) {
889
+ for (let t of this.listAll(e)) this.remove(e, t.interactionId);
890
+ let t = `${e}\u0000`;
891
+ for (let e of this.rejectedCommands.keys()) e.startsWith(t) && this.rejectedCommands.delete(e);
892
+ for (let e of this.terminalRuns) e.startsWith(t) && this.terminalRuns.delete(e);
893
+ }
894
+ }, j = class extends Error {
895
+ constructor(e) {
896
+ super(e), this.name = "ContractMismatchError";
897
+ }
898
+ }, Ue = new Set([
899
+ "schema_version",
900
+ "command_id",
901
+ "status",
902
+ "message_id",
903
+ "run_id",
904
+ "accepted_seq",
905
+ "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()
911
+ });
912
+ function Ge(e) {
913
+ if (typeof e != "object" || !e || Array.isArray(e)) return M(e);
914
+ let t = e;
915
+ if ("schema_version" in t || !("SchemaVersion" in t)) return M(e);
916
+ let n = {
917
+ SchemaVersion: "schema_version",
918
+ CommandId: "command_id",
919
+ Status: "status",
920
+ MessageId: "message_id",
921
+ RunId: "run_id",
922
+ AcceptedSeq: "accepted_seq",
923
+ Error: "error"
924
+ };
925
+ return M(Object.fromEntries(Object.entries(t).map(([e, t]) => [n[e] ?? e, t])));
926
+ }
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([
932
+ "accepted",
933
+ "duplicate",
934
+ "rejected",
935
+ "unsupported",
936
+ "queue_full",
937
+ "persistence_uncertain"
938
+ ]),
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()
943
+ }).passthrough().safeParse(e);
944
+ if (!t.success) throw new j(`AgentControlReceipt/v1 mismatch: ${t.error.message}`);
945
+ 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`);
947
+ let r = {};
948
+ for (let [e, t] of Object.entries(n)) Ue.has(e) || (r[e] = t);
949
+ let i = n.error ? {
950
+ ...n.error,
951
+ extensions: {}
952
+ } : null;
953
+ return {
954
+ schema_version: 1,
955
+ command_id: n.command_id,
956
+ status: n.status,
957
+ message_id: n.message_id ?? null,
958
+ run_id: n.run_id ?? null,
959
+ accepted_seq: n.accepted_seq ?? null,
960
+ error: i,
961
+ extensions: r
962
+ };
963
+ }
964
+ function Ke(e) {
965
+ try {
966
+ return t(e);
967
+ } catch (e) {
968
+ throw new j(`RuntimeCapabilityMatrix/v1 mismatch: ${e instanceof Error ? e.message : String(e)}`);
969
+ }
970
+ }
971
+ var qe = new Set([
972
+ "schema_version",
973
+ "event_id",
974
+ "session_id",
975
+ "seq",
976
+ "timestamp",
977
+ "family",
978
+ "family_version",
979
+ "event_type",
980
+ "payload",
981
+ "run_id",
982
+ "causation_id",
983
+ "correlation_id",
984
+ "actor_ref"
985
+ ]), Je = new Map([["control", 1], ["runtime", 2]]), Ye = {
986
+ schema_version: ["schemaVersion", "SchemaVersion"],
987
+ event_id: ["eventId", "EventId"],
988
+ session_id: ["sessionId", "SessionId"],
989
+ seq: [
990
+ "seqId",
991
+ "SeqId",
992
+ "Seq"
993
+ ],
994
+ timestamp: ["Timestamp"],
995
+ family: ["Family"],
996
+ family_version: ["familyVersion", "FamilyVersion"],
997
+ event_type: ["eventType", "EventType"],
998
+ payload: ["Payload"],
999
+ run_id: ["runId", "RunId"],
1000
+ causation_id: ["causationId", "CausationId"],
1001
+ correlation_id: ["correlationId", "CorrelationId"],
1002
+ actor_ref: ["actorRef", "ActorRef"]
1003
+ };
1004
+ function Xe(e) {
1005
+ if (!e || typeof e != "object" || Array.isArray(e)) return e;
1006
+ let t = e, n = { ...t };
1007
+ for (let [e, r] of Object.entries(Ye)) {
1008
+ if (n[e] === void 0) {
1009
+ let i = r.find((e) => t[e] !== void 0);
1010
+ i && (n[e] = t[i]);
1011
+ }
1012
+ for (let e of r) delete n[e];
1013
+ }
1014
+ return n;
1015
+ }
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()
1030
+ }).passthrough();
1031
+ function Qe(e) {
1032
+ let t = Ze.safeParse(Xe(e));
1033
+ if (!t.success) return {
1034
+ ok: !1,
1035
+ error: new j(`SessionEventEnvelope/v1 mismatch: ${t.error.message}`)
1036
+ };
1037
+ let n = t.data, r = Je.get(n.family);
1038
+ if (r !== void 0 && n.family_version !== r) return {
1039
+ ok: !1,
1040
+ error: new j(`SessionEventEnvelope/v1 mismatch: family ${n.family} requires family_version ${r}`)
1041
+ };
1042
+ let i = {};
1043
+ for (let [e, t] of Object.entries(n)) qe.has(e) || (i[e] = t);
1044
+ return {
1045
+ ok: !0,
1046
+ value: {
1047
+ schema_version: 1,
1048
+ event_id: n.event_id,
1049
+ session_id: n.session_id,
1050
+ seq: n.seq,
1051
+ timestamp: n.timestamp,
1052
+ family: n.family,
1053
+ family_version: n.family_version,
1054
+ event_type: n.event_type,
1055
+ payload: n.payload,
1056
+ run_id: n.run_id ?? null,
1057
+ causation_id: n.causation_id ?? null,
1058
+ correlation_id: n.correlation_id ?? null,
1059
+ actor_ref: n.actor_ref ?? null,
1060
+ extensions: i
1061
+ }
1062
+ };
1063
+ }
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([
1069
+ "ready",
1070
+ "degraded",
1071
+ "unavailable"
1072
+ ]),
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([
1076
+ "pending",
1077
+ "running",
1078
+ "paused",
1079
+ "waiting"
1080
+ ]).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()
1085
+ }).passthrough().safeParse(e);
1086
+ if (!t.success) throw new j(`AgentStatusSnapshot/v1 mismatch: ${t.error.message}`);
1087
+ let n = t.data, r = {};
1088
+ for (let e of Object.keys(n)) [
1089
+ "schema_version",
1090
+ "agent_instance_id",
1091
+ "instance_state",
1092
+ "session_id",
1093
+ "active_run_id",
1094
+ "active_run_state",
1095
+ "inbox_depth",
1096
+ "activation_id",
1097
+ "lease_expires_at",
1098
+ "capability"
1099
+ ].includes(e) || (r[e] = n[e]);
1100
+ return {
1101
+ schema_version: 1,
1102
+ agent_instance_id: n.agent_instance_id,
1103
+ instance_state: n.instance_state,
1104
+ session_id: n.session_id ?? null,
1105
+ active_run_id: n.active_run_id ?? null,
1106
+ active_run_state: n.active_run_state ?? null,
1107
+ inbox_depth: n.inbox_depth,
1108
+ activation_id: n.activation_id ?? null,
1109
+ lease_expires_at: n.lease_expires_at ?? null,
1110
+ capability: Ke(n.capability),
1111
+ extensions: r
1112
+ };
1113
+ }
1114
+ var et = {
1115
+ $schema: "http://json-schema.org/draft-06/schema#",
1116
+ $id: "http://json-schema.org/draft-06/schema#",
1117
+ title: "Core schema meta-schema",
1118
+ definitions: {
1119
+ schemaArray: {
1120
+ type: "array",
1121
+ minItems: 1,
1122
+ items: { $ref: "#" }
1123
+ },
1124
+ nonNegativeInteger: {
1125
+ type: "integer",
1126
+ minimum: 0
1127
+ },
1128
+ nonNegativeIntegerDefault0: { allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }] },
1129
+ simpleTypes: { enum: [
1130
+ "array",
1131
+ "boolean",
1132
+ "integer",
1133
+ "null",
1134
+ "number",
1135
+ "object",
1136
+ "string"
1137
+ ] },
1138
+ stringArray: {
1139
+ type: "array",
1140
+ items: { type: "string" },
1141
+ uniqueItems: !0,
1142
+ default: []
1143
+ }
1144
+ },
1145
+ type: ["object", "boolean"],
1146
+ properties: {
1147
+ $id: {
1148
+ type: "string",
1149
+ format: "uri-reference"
1150
+ },
1151
+ $schema: {
1152
+ type: "string",
1153
+ format: "uri"
1154
+ },
1155
+ $ref: {
1156
+ type: "string",
1157
+ format: "uri-reference"
1158
+ },
1159
+ title: { type: "string" },
1160
+ description: { type: "string" },
1161
+ default: {},
1162
+ examples: {
1163
+ type: "array",
1164
+ items: {}
1165
+ },
1166
+ multipleOf: {
1167
+ type: "number",
1168
+ exclusiveMinimum: 0
1169
+ },
1170
+ maximum: { type: "number" },
1171
+ exclusiveMaximum: { type: "number" },
1172
+ minimum: { type: "number" },
1173
+ exclusiveMinimum: { type: "number" },
1174
+ maxLength: { $ref: "#/definitions/nonNegativeInteger" },
1175
+ minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" },
1176
+ pattern: {
1177
+ type: "string",
1178
+ format: "regex"
1179
+ },
1180
+ additionalItems: { $ref: "#" },
1181
+ items: {
1182
+ anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }],
1183
+ default: {}
1184
+ },
1185
+ maxItems: { $ref: "#/definitions/nonNegativeInteger" },
1186
+ minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" },
1187
+ uniqueItems: {
1188
+ type: "boolean",
1189
+ default: !1
1190
+ },
1191
+ contains: { $ref: "#" },
1192
+ maxProperties: { $ref: "#/definitions/nonNegativeInteger" },
1193
+ minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" },
1194
+ required: { $ref: "#/definitions/stringArray" },
1195
+ additionalProperties: { $ref: "#" },
1196
+ definitions: {
1197
+ type: "object",
1198
+ additionalProperties: { $ref: "#" },
1199
+ default: {}
1200
+ },
1201
+ properties: {
1202
+ type: "object",
1203
+ additionalProperties: { $ref: "#" },
1204
+ default: {}
1205
+ },
1206
+ patternProperties: {
1207
+ type: "object",
1208
+ additionalProperties: { $ref: "#" },
1209
+ default: {}
1210
+ },
1211
+ dependencies: {
1212
+ type: "object",
1213
+ additionalProperties: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] }
1214
+ },
1215
+ propertyNames: { $ref: "#" },
1216
+ const: {},
1217
+ enum: {
1218
+ type: "array",
1219
+ minItems: 1,
1220
+ uniqueItems: !0
1221
+ },
1222
+ type: { anyOf: [{ $ref: "#/definitions/simpleTypes" }, {
1223
+ type: "array",
1224
+ items: { $ref: "#/definitions/simpleTypes" },
1225
+ minItems: 1,
1226
+ uniqueItems: !0
1227
+ }] },
1228
+ format: { type: "string" },
1229
+ allOf: { $ref: "#/definitions/schemaArray" },
1230
+ anyOf: { $ref: "#/definitions/schemaArray" },
1231
+ oneOf: { $ref: "#/definitions/schemaArray" },
1232
+ not: { $ref: "#" }
1233
+ },
1234
+ 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;
1240
+ let i = String(e.$schema || "https://json-schema.org/draft/2020-12/schema"), a = {
1241
+ strict: !1,
1242
+ allErrors: !0,
1243
+ coerceTypes: !1,
1244
+ useDefaults: !1,
1245
+ removeAdditional: !1,
1246
+ ownProperties: !0,
1247
+ 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;
1249
+ if (!o) throw TypeError("Unsupported JSON Schema dialect");
1250
+ /draft-06/.test(i) && o.addMetaSchema(et), m(o);
1251
+ let s = o.compile(e);
1252
+ if ("$async" in s && s.$async) throw TypeError("Async schemas are not supported");
1253
+ N.size >= 128 && N.delete(N.keys().next().value);
1254
+ let c = typeof e.$id == "string" ? e.$id.replace(/#$/, "") : typeof e.id == "string" ? e.id.replace(/#$/, "") : "", l = {
1255
+ root: s,
1256
+ at: (e, t) => !!(e === "" ? s : o.getSchema(`${c}#${e}`))?.(t)
1257
+ };
1258
+ return N.set(t, l), l;
1259
+ }
1260
+ function nt(e) {
1261
+ return tt(e).at;
1262
+ }
1263
+ function rt(e, t) {
1264
+ try {
1265
+ n(t);
1266
+ let r = tt(e).root, i = r(t);
1267
+ return {
1268
+ valid: !!i,
1269
+ issues: i ? [] : (r.errors || []).slice(0, 10).map((e) => `${e.instancePath || "/"}:不符合 ${e.keyword} 约束`)
1270
+ };
1271
+ } catch {
1272
+ return {
1273
+ valid: !1,
1274
+ issues: ["输入或表单约束不是受支持的 JSON。"]
1275
+ };
1276
+ }
1277
+ }
1278
+ //#endregion
1279
+ //#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) {
1282
+ let [t, n = "0"] = e.toLowerCase().split("e"), [r, i = ""] = t.replace(/^-/, "").split("."), a = (r + i).replace(/^0+/, "").replace(/0+$/, "");
1283
+ if (!a) return "0";
1284
+ let o = (r + i).length - (r + i).replace(/0+$/, "").length;
1285
+ return `${e.startsWith("-") ? "-" : ""}${a}e${Number(n) - i.length + o}`;
1286
+ }
1287
+ function ct(e, t) {
1288
+ if (typeof e != "string") return e;
1289
+ 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;
1291
+ 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;
1293
+ }
1294
+ function lt(e, t) {
1295
+ let r = n(t), i = nt(e), a = 0, o = (e, t) => {
1296
+ try {
1297
+ return i(e, t);
1298
+ } catch {
1299
+ return !1;
1300
+ }
1301
+ }, s = (t) => {
1302
+ if (typeof t != "string" || !t.startsWith("#")) return;
1303
+ let n;
1304
+ try {
1305
+ n = decodeURIComponent(t.slice(1));
1306
+ } catch {
1307
+ return;
1308
+ }
1309
+ if (n !== "" && !n.startsWith("/")) return;
1310
+ let r = e;
1311
+ for (let e of n === "" ? [] : n.slice(1).split("/")) {
1312
+ let t = e.replace(/~1/g, "/").replace(/~0/g, "~");
1313
+ r = Array.isArray(r) ? r[Number(t)] : P(r) ? it(r, t) : void 0;
1314
+ }
1315
+ return {
1316
+ node: r,
1317
+ path: n
1318
+ };
1319
+ }, c = (e, t, n, r = 0) => {
1320
+ let i = P(e);
1321
+ if (++a > 8192 || r > 48 || !i || o(t, n)) return n;
1322
+ let l = n, u = s(i.$ref);
1323
+ u && (n = c(u.node, u.path, n, r + 1)), Array.isArray(i.allOf) && i.allOf.forEach((e, i) => {
1324
+ n = c(e, `${t}/allOf/${i}`, n, r + 1);
1325
+ });
1326
+ let d = Array.isArray(i.oneOf) ? "oneOf" : "anyOf", f = i[d];
1327
+ if (Array.isArray(f)) {
1328
+ let e = f.map((e, i) => c(e, `${t}/${d}/${i}`, n, r + 1)).filter((e) => o(t, e)), i = new Map(e.map((e) => [JSON.stringify(e), e]));
1329
+ return i.size === 1 ? [...i.values()][0] : l;
1330
+ }
1331
+ if (Array.isArray(n)) {
1332
+ let e = Array.isArray(i.items), a = e ? i.items : Array.isArray(i.prefixItems) ? i.prefixItems : [], o = e ? i.additionalItems : i.items;
1333
+ 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
+ }
1335
+ let p = P(n);
1336
+ if (p) {
1337
+ let e = {}, n = P(i.properties) || {}, a = P(i.patternProperties) || {};
1338
+ for (let [o, s] of Object.entries(p)) {
1339
+ 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, {
1343
+ value: l,
1344
+ enumerable: !0,
1345
+ configurable: !0,
1346
+ writable: !0
1347
+ });
1348
+ }
1349
+ return e;
1350
+ }
1351
+ return ct(n, Array.isArray(i.type) ? i.type : [i.type]);
1352
+ }, l = c(e, "", r), u = rt(e, l);
1353
+ if (!u.valid) throw TypeError(u.issues.join(";"));
1354
+ return l;
1355
+ }
1356
+ //#endregion
1357
+ //#region src/core/interaction/client.ts
1358
+ var ut = {
1359
+ approve: "approved",
1360
+ reject: "rejected",
1361
+ submit: "submitted",
1362
+ cancel: "cancelled"
1363
+ };
1364
+ function F(e, t) {
1365
+ return {
1366
+ schema_version: 1,
1367
+ command_id: `local-${t}`,
1368
+ status: e,
1369
+ message_id: null,
1370
+ run_id: null,
1371
+ accepted_seq: null,
1372
+ error: null,
1373
+ extensions: {}
1374
+ };
1375
+ }
1376
+ var dt = class {
1377
+ store;
1378
+ deps;
1379
+ inFlight = /* @__PURE__ */ new Map();
1380
+ constructor(e) {
1381
+ this.deps = e, this.store = e.store || new A();
1382
+ }
1383
+ listPending(e) {
1384
+ return this.store.listPending(e);
1385
+ }
1386
+ setInteractionV1Enabled(e) {
1387
+ this.deps.interactionV1Enabled = e;
1388
+ }
1389
+ subscribe(e) {
1390
+ return this.store.subscribe(e);
1391
+ }
1392
+ ingest(e) {
1393
+ this.store.upsert(e);
1394
+ }
1395
+ ingestHistory(e) {
1396
+ for (let t of e) this.store.upsert(t);
1397
+ for (let [e] of this.inFlight) {
1398
+ let t = this.store.all().find((t) => this.recordKey(t) === e);
1399
+ t && t.status !== "pending" && t.status !== "resolving" && this.inFlight.delete(e);
1400
+ }
1401
+ }
1402
+ recordKey(e) {
1403
+ return JSON.stringify([e.sessionId, e.interactionId]);
1404
+ }
1405
+ findByInteractionId(e, t) {
1406
+ if (t) return this.store.get(t, e);
1407
+ let n = this.store.all().filter((t) => t.interactionId === e);
1408
+ return n.length === 1 ? n[0] : null;
1409
+ }
1410
+ async respond(e) {
1411
+ 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" || ![
1416
+ "approve",
1417
+ "reject",
1418
+ "cancel"
1419
+ ].includes(e.action))) {
1420
+ let n = {
1421
+ code: "input_transport_unsupported",
1422
+ message: "当前运行时不支持提交此提问,请升级运行时后重试。",
1423
+ retryable: !1,
1424
+ extensions: {}
1425
+ };
1426
+ return this.store.markFailed(t.sessionId, e.interactionId, n), {
1427
+ ...F("unsupported", e.interactionId),
1428
+ error: n
1429
+ };
1430
+ }
1431
+ try {
1432
+ n(e.response);
1433
+ } catch {
1434
+ return this.store.markFailed(t.sessionId, e.interactionId, {
1435
+ code: "input_response_invalid",
1436
+ message: "答案必须是合法 JSON 值。",
1437
+ retryable: !0
1438
+ }), F("rejected", e.interactionId);
1439
+ }
1440
+ if (t.kind === "structured_input" && e.action === "submit" && t.requestSchema) try {
1441
+ e = {
1442
+ ...e,
1443
+ response: lt(t.requestSchema, e.response)
1444
+ };
1445
+ } catch (n) {
1446
+ return this.store.markFailed(t.sessionId, e.interactionId, {
1447
+ code: "input_response_invalid",
1448
+ message: n instanceof Error ? n.message : "答案不符合表单约束。",
1449
+ retryable: !0
1450
+ }), F("rejected", e.interactionId);
1451
+ }
1452
+ if (t.source === "agui" && !this.deps.interactionV1Enabled && e.action !== "cancel" && e.response === null) return this.store.markFailed(t.sessionId, e.interactionId, {
1453
+ code: "input_transport_unsupported",
1454
+ message: "当前 AG-UI 传输不能提交根 null,请使用 Interaction/v1。",
1455
+ 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);
1459
+ this.inFlight.set(s, o), this.store.markResolving(t.sessionId, e.interactionId);
1460
+ try {
1461
+ if (!r && t.source === "responses" && this.deps.legacyResponsesApproval) {
1462
+ let n = t.extensions.previous_response_id;
1463
+ return await this.deps.legacyResponsesApproval(e.interactionId, e.action === "approve", ...typeof n == "string" && n ? [n] : []) === !1 ? (this.store.markFailed(t.sessionId, e.interactionId, {
1464
+ code: "interaction_not_dispatched",
1465
+ message: "交互尚未提交,请稍后重试。",
1466
+ retryable: !0
1467
+ }), F("rejected", e.interactionId)) : (this.resolveLocal(t, e, o), F("accepted", e.interactionId));
1468
+ }
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({
1471
+ AgentId: this.deps.agentId,
1472
+ SessionId: t.sessionId,
1473
+ RunId: t.runId || "",
1474
+ InteractionId: e.interactionId,
1475
+ ExpectedRevision: e.expectedRevision,
1476
+ Action: e.action,
1477
+ Response: e.response,
1478
+ IdempotencyKey: o
1479
+ }));
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;
1485
+ } catch (n) {
1486
+ let r = n instanceof Error ? n.message : String(n || "交互提交失败");
1487
+ throw this.store.markFailed(t.sessionId, e.interactionId, {
1488
+ code: "interaction_submit_failed",
1489
+ message: r,
1490
+ retryable: !0
1491
+ }), n;
1492
+ } finally {
1493
+ this.inFlight.delete(s);
1494
+ }
1495
+ }
1496
+ resolveLocal(e, t, n) {
1497
+ let r = this.store.get(e.sessionId, t.interactionId);
1498
+ if (!r || k(r.status)) return;
1499
+ let i = t.action === "cancel" ? "cancelled" : "resolved";
1500
+ this.store.resolveLocally(e.sessionId, t.interactionId, {
1501
+ status: i,
1502
+ outcome: ut[t.action],
1503
+ actor: "user",
1504
+ responseSummary: e.kind === "structured_input" ? t.action === "cancel" ? "已取消" : "已提交" : He(t.action, t.response),
1505
+ revision: t.expectedRevision
1506
+ });
1507
+ let a = this.store.get(e.sessionId, t.interactionId);
1508
+ a && this.store.upsert({
1509
+ ...a,
1510
+ extensions: {
1511
+ ...a.extensions,
1512
+ idempotency_key: n
1513
+ }
1514
+ });
1515
+ }
1516
+ }, I = (e) => typeof e == "object" && e && !Array.isArray(e) ? e : void 0, L = class extends Error {};
1517
+ function ft() {
1518
+ let e = 8192;
1519
+ return () => {
1520
+ if (--e < 0) throw new L();
1521
+ };
1522
+ }
1523
+ function pt(e, t, n) {
1524
+ if (e === "#") return t;
1525
+ if (typeof e != "string" || !e.startsWith("#/")) throw new L();
1526
+ try {
1527
+ let r = t;
1528
+ for (let t of decodeURIComponent(e.slice(2)).split("/")) {
1529
+ 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();
1532
+ r = e[i];
1533
+ }
1534
+ return r;
1535
+ } catch {
1536
+ throw new L();
1537
+ }
1538
+ }
1539
+ function mt(e, t, n) {
1540
+ let r = /* @__PURE__ */ new Set(), i = [...e];
1541
+ for (; i.length;) {
1542
+ n();
1543
+ let e = i.pop();
1544
+ if (typeof e == "boolean") continue;
1545
+ let a = I(e);
1546
+ if (!a) throw new L();
1547
+ 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));
1550
+ for (let e of [
1551
+ "allOf",
1552
+ "anyOf",
1553
+ "oneOf"
1554
+ ]) {
1555
+ let t = a[e];
1556
+ if (t !== void 0 && !Array.isArray(t)) throw new L();
1557
+ Array.isArray(t) && i.push(...t);
1558
+ }
1559
+ for (let e of [
1560
+ "if",
1561
+ "then",
1562
+ "else"
1563
+ ]) 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);
1565
+ }
1566
+ }
1567
+ return [...r];
1568
+ }
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) {
1571
+ try {
1572
+ return mt([e], t, ft()).some(ht);
1573
+ } catch {
1574
+ return !0;
1575
+ }
1576
+ }
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) => {
1583
+ let n = [];
1584
+ for (let e of o) {
1585
+ let r = Array.isArray(e.prefixItems) ? e.prefixItems : void 0, i = Array.isArray(e.items) ? e.items : void 0;
1586
+ n.push(r && t < r.length ? r[t] : i ? t < i.length ? i[t] : e.additionalItems ?? {} : e.items ?? {});
1587
+ for (let t of ["contains", "unevaluatedItems"]) Object.hasOwn(e, t) && n.push(e[t]);
1588
+ }
1589
+ return i(n, e, a + 1);
1590
+ }) : typeof n != "object" || !n ? n : Object.fromEntries(Object.entries(n).map(([e, t]) => {
1591
+ let n = [];
1592
+ for (let t of o) {
1593
+ let r = I(t.properties), i = !!(r && Object.hasOwn(r, e));
1594
+ 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));
1596
+ !i && Object.hasOwn(t, "additionalProperties") && n.push(t.additionalProperties), Object.hasOwn(t, "unevaluatedProperties") && n.push(t.unevaluatedProperties);
1597
+ }
1598
+ return [e, i(n, t, a + 1)];
1599
+ }));
1600
+ }
1601
+ try {
1602
+ return n(t), i([e], t, 0);
1603
+ } catch {
1604
+ return null;
1605
+ }
1606
+ }
1607
+ function vt(e) {
1608
+ 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)) };
1610
+ } catch {
1611
+ return;
1612
+ }
1613
+ }
1614
+ //#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
+ //#region src/core/interaction/adapters/responses.ts
1706
+ function z(e) {
1707
+ return !e.approvalRequestId || !e.sessionId ? null : O({
1708
+ interactionId: e.approvalRequestId,
1709
+ sessionId: e.sessionId,
1710
+ runId: e.runId ?? null,
1711
+ kind: "approval",
1712
+ title: e.name ? `审批:${e.name}` : "人工确认",
1713
+ message: e.message || "本次运行需要人工审批后才能继续。",
1714
+ requestSchema: e.requestSchema ?? null,
1715
+ status: "pending",
1716
+ revision: 1,
1717
+ source: "responses",
1718
+ extensions: {
1719
+ ...e.previousResponseId ? { previous_response_id: e.previousResponseId } : {},
1720
+ ...e.approvalLevel ? { approval_level: e.approvalLevel } : {},
1721
+ ...e.args ? { arguments: e.args } : {}
1722
+ }
1723
+ });
1724
+ }
1725
+ function St(e) {
1726
+ let t = {}, n = [];
1727
+ for (let r of e) {
1728
+ 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) : [];
1729
+ t[i] = {
1730
+ type: "string",
1731
+ title: String(e.question || e.label || e.title || i),
1732
+ ...a.length ? { enum: a } : {}
1733
+ }, n.push(i);
1734
+ }
1735
+ return {
1736
+ type: "object",
1737
+ properties: t,
1738
+ required: n,
1739
+ additionalProperties: !1
1740
+ };
1741
+ }
1742
+ function Ct(e) {
1743
+ if (!e.questionId || !e.sessionId) return null;
1744
+ let t = Array.isArray(e.questions) ? e.questions : [];
1745
+ return O({
1746
+ interactionId: e.questionId,
1747
+ sessionId: e.sessionId,
1748
+ runId: e.runId ?? null,
1749
+ kind: "structured_input",
1750
+ title: "询问",
1751
+ message: "Agent 需要你的选择后才能继续。",
1752
+ requestSchema: St(t),
1753
+ status: "pending",
1754
+ revision: 1,
1755
+ source: "responses",
1756
+ extensions: { questions: t }
1757
+ });
1758
+ }
1759
+ //#endregion
1760
+ //#region src/core/interaction/adapters/agui.ts
1761
+ function B(e) {
1762
+ if (!e.interruptId || !e.sessionId) return null;
1763
+ let t = e.requestSchema != null;
1764
+ return O({
1765
+ interactionId: e.interruptId,
1766
+ sessionId: e.sessionId,
1767
+ runId: e.runId ?? null,
1768
+ kind: t ? "structured_input" : "approval",
1769
+ title: e.name ? `${t ? "补充信息" : "确认"}:${e.name}` : t ? "补充信息" : "人工确认",
1770
+ message: e.message || (t ? "请填写后提交,Agent 将继续当前任务。" : "本次运行需要人工确认后才能继续。"),
1771
+ requestSchema: e.requestSchema ?? null,
1772
+ status: "pending",
1773
+ revision: 1,
1774
+ source: "agui",
1775
+ extensions: {
1776
+ interrupt_id: e.interruptId,
1777
+ ...e.toolCallId ? { tool_call_id: e.toolCallId } : {},
1778
+ ...e.reason ? { reason: e.reason } : {}
1779
+ }
1780
+ });
1781
+ }
1782
+ var V = {
425
1783
  $schema: "https://json-schema.org/draft/2020-12/schema",
426
1784
  $id: "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json",
427
1785
  title: "A2UI Basic Catalog",
@@ -497,7 +1855,7 @@ var D = i()((e) => ({
497
1855
  { $ref: "#/functions/not" }
498
1856
  ] }
499
1857
  }
500
- }, k = {
1858
+ }, wt = {
501
1859
  $schema: "https://json-schema.org/draft/2020-12/schema",
502
1860
  $id: "https://a2ui.org/specification/v0_9/common_types.json",
503
1861
  title: "A2UI Common Types",
@@ -690,7 +2048,7 @@ var D = i()((e) => ({
690
2048
  }]
691
2049
  }
692
2050
  }
693
- }, A = {
2051
+ }, Tt = {
694
2052
  schema_version: 1,
695
2053
  profile: "official-0.9.1",
696
2054
  wire_versions: ["v0.9", "v0.9.1"],
@@ -768,7 +2126,7 @@ var D = i()((e) => ({
768
2126
  ],
769
2127
  source: "ksadk.a2ui.models.BASIC_CATALOG; project compatibility asset"
770
2128
  }]
771
- }, j = {
2129
+ }, H = {
772
2130
  $schema: "https://json-schema.org/draft/2020-12/schema",
773
2131
  $id: "a2ui.org/catalogs/basic/v1.0",
774
2132
  catalogId: "a2ui.org/catalogs/basic/v1.0",
@@ -938,24 +2296,24 @@ var D = i()((e) => ({
938
2296
  }
939
2297
  },
940
2298
  functions: {}
941
- }, M = O, N = A, P = j;
942
- function F(e) {
943
- return ee(f(new TextEncoder().encode(d(t(e)))));
2299
+ }, U = V, W = Tt, G = H;
2300
+ function K(e) {
2301
+ return te(ee(new TextEncoder().encode(h(n(e)))));
944
2302
  }
945
- var I = new o({
2303
+ var q = new f({
946
2304
  strict: !1,
947
2305
  allErrors: !0,
948
2306
  logger: !1
949
2307
  });
950
- s(I), I.addSchema(k), I.addSchema(O), I.addSchema(j);
951
- for (let e of Object.keys(A.schema_resolution_aliases)) I.addSchema({
952
- ...O,
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,
953
2311
  $id: e
954
2312
  });
955
- new Map(Object.keys(O.components).map((e) => [e, I.getSchema(`${O.$id}#/components/${e}`)])), new Map(Object.keys(j.components).map((e) => [e, I.getSchema(`${j.$id}#/components/${e}`)]));
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}`)]));
956
2314
  //#endregion
957
2315
  //#region src/core/a2ui/linking.ts
958
- var le = new Set([
2316
+ var Et = new Set([
959
2317
  "components",
960
2318
  "functions",
961
2319
  "$defs",
@@ -963,7 +2321,7 @@ var le = new Set([
963
2321
  "properties",
964
2322
  "patternProperties",
965
2323
  "dependentSchemas"
966
- ]), ue = new Set([
2324
+ ]), Dt = new Set([
967
2325
  "theme",
968
2326
  "items",
969
2327
  "additionalProperties",
@@ -977,13 +2335,13 @@ var le = new Set([
977
2335
  "unevaluatedProperties",
978
2336
  "unevaluatedItems",
979
2337
  "contentSchema"
980
- ]), de = new Set([
2338
+ ]), Ot = new Set([
981
2339
  "allOf",
982
2340
  "anyOf",
983
2341
  "oneOf",
984
2342
  "prefixItems"
985
- ]), fe = "https://a2ui.org/specification/v0_9/common_types.json";
986
- function pe(e, t) {
2343
+ ]), kt = "https://a2ui.org/specification/v0_9/common_types.json";
2344
+ function At(e, t) {
987
2345
  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) => {
988
2346
  if (!e || typeof e != "object" || Array.isArray(e)) return structuredClone(e);
989
2347
  let c = e, l = typeof c.$id == "string" && c.$id !== o ? i(o, c.$id) : o, u = structuredClone(c);
@@ -993,7 +2351,7 @@ function pe(e, t) {
993
2351
  let d = i(l, o), f = t(d);
994
2352
  if (f === void 0) throw Error("A2UI 目录包含未提供的离线 Schema 引用。");
995
2353
  if (d.split("#")[0] === n) u[e] = "#" + (d.split("#")[1] || "");
996
- else if (d.split("#")[0] !== fe) {
2354
+ else if (d.split("#")[0] !== kt) {
997
2355
  if (r.has(d)) throw Error("循环的外部 A2UI Schema 资产无法完成链接。");
998
2356
  r.add(d);
999
2357
  let t;
@@ -1006,32 +2364,32 @@ function pe(e, t) {
1006
2364
  return Object.keys(n).length ? { allOf: [t, a(n, l, s)] } : t;
1007
2365
  }
1008
2366
  }
1009
- for (let [e, t] of Object.entries(c)) le.has(e) && t && typeof t == "object" && !Array.isArray(t) ? u[e] = Object.fromEntries(Object.entries(t).map(([e, t]) => [e, a(t, l, s)])) : ue.has(e) && (typeof t == "object" || typeof t == "boolean") ? u[e] = a(t, l, s) : de.has(e) && Array.isArray(t) && (u[e] = t.map((e) => a(e, l, s)));
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)));
1010
2368
  return s && (delete u.$id, delete u.$schema, delete u.$anchor), u;
1011
2369
  };
1012
2370
  return a(e, n);
1013
2371
  }
1014
2372
  //#endregion
1015
2373
  //#region src/core/a2ui/registry.ts
1016
- var L = [{
1017
- schema: M,
2374
+ var jt = [{
2375
+ schema: U,
1018
2376
  loadRenderer: async () => (await import("@a2ui/web_core/v0_9/basic_catalog")).basicCatalog
1019
2377
  }, {
1020
- schema: P,
1021
- loadRenderer: async () => new c(P.catalogId, "0.9", [...c.fromSchema(P, "0.9").components.values()], [])
1022
- }], R = class {
2378
+ schema: G,
2379
+ loadRenderer: async () => new g(G.catalogId, "0.9", [...g.fromSchema(G, "0.9").components.values()], [])
2380
+ }], J = class {
1023
2381
  defaultCatalogId;
1024
2382
  entries = /* @__PURE__ */ new Map();
1025
2383
  validators = /* @__PURE__ */ new Map();
1026
2384
  loaders = /* @__PURE__ */ new Map();
1027
2385
  processorSchemas = /* @__PURE__ */ new Map();
1028
- constructor(e = [], t = N.catalog_id) {
1029
- for (let t of [...L, ...e]) {
2386
+ constructor(e = [], t = W.catalog_id) {
2387
+ for (let t of [...jt, ...e]) {
1030
2388
  let e = structuredClone(t.schema), n = e.catalogId;
1031
2389
  if (typeof n != "string" || !n.trim() || !e.components || typeof e.components != "object") throw Error("A2UI 目录缺少身份或组件 Schema。");
1032
- let r = F(e), i = this.entries.get(n);
2390
+ let r = K(e), i = this.entries.get(n);
1033
2391
  if (i) {
1034
- if (i.digest !== r || i.loadRenderer !== t.loadRenderer || i.historyAdapter !== t.historyAdapter || F(i.resources) !== F(t.resources || []) || F(i.inputComponents) !== F(t.inputComponents || [])) throw Error("A2UI 目录身份存在冲突。");
2392
+ if (i.digest !== r || i.loadRenderer !== t.loadRenderer || i.historyAdapter !== t.historyAdapter || K(i.resources) !== K(t.resources || []) || K(i.inputComponents) !== K(t.inputComponents || [])) throw Error("A2UI 目录身份存在冲突。");
1035
2393
  continue;
1036
2394
  }
1037
2395
  let a = structuredClone(t.resources || []);
@@ -1043,31 +2401,31 @@ var L = [{
1043
2401
  inputComponents: Object.freeze([...t.inputComponents || []])
1044
2402
  }));
1045
2403
  }
1046
- let n = new o({
2404
+ let n = new f({
1047
2405
  strict: !1,
1048
2406
  allErrors: !0,
1049
2407
  logger: !1
1050
2408
  });
1051
- s(n);
2409
+ m(n);
1052
2410
  let r = /* @__PURE__ */ new Map(), i = (e) => {
1053
2411
  let t = e.$id ?? e.catalogId;
1054
2412
  if (typeof t != "string" || !t) throw Error("离线 A2UI Schema 缺少 $id。");
1055
- if (r.has(t) && F(r.get(t)) !== F(e)) throw Error("离线 A2UI Schema 身份存在冲突。");
2413
+ if (r.has(t) && K(r.get(t)) !== K(e)) throw Error("离线 A2UI Schema 身份存在冲突。");
1056
2414
  r.set(t, e);
1057
2415
  };
1058
- i(k);
2416
+ i(wt);
1059
2417
  for (let e of this.entries.values()) {
1060
2418
  i(e.schema);
1061
2419
  for (let t of e.resources || []) i(t);
1062
2420
  }
1063
- for (let e of Object.keys(N.schema_resolution_aliases)) i({
1064
- ...M,
2421
+ for (let e of Object.keys(W.schema_resolution_aliases)) i({
2422
+ ...U,
1065
2423
  $id: e
1066
2424
  });
1067
2425
  for (let [e, t] of r) n.addSchema(t, e);
1068
2426
  for (let [e, t] of this.entries) {
1069
2427
  let r = String(t.schema.$id || e);
1070
- this.validators.set(e, new Map(Object.keys(t.schema.components).map((e) => [e, n.getSchema(`${r}#/components/${e}`)]))), this.processorSchemas.set(e, pe(t.schema, (e) => n.getSchema(e)?.schema));
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));
1071
2429
  }
1072
2430
  if (!this.entries.has(t)) throw Error("默认 A2UI 目录未注册。");
1073
2431
  this.defaultCatalogId = t;
@@ -1097,9 +2455,9 @@ var L = [{
1097
2455
  }
1098
2456
  validateMessages(e) {
1099
2457
  if (!e.length || e.length > 4096 || new TextEncoder().encode(JSON.stringify(e)).length > 1048576) throw Error("A2UI 消息无效或超过展示预算。");
1100
- let t = new l([...this.processorSchemas.values()].map((e) => {
1101
- let t = c.fromSchema(e, "0.9");
1102
- return new c(t.id, t.protocolVersion, [...t.components.values()], [...t.functions.values()].map((e) => u(e, () => {
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, () => {
1103
2461
  throw Error("校验过程不能执行 A2UI 函数。");
1104
2462
  })), t.themeSchema, t.instructions);
1105
2463
  }), void 0, {
@@ -1156,37 +2514,25 @@ var L = [{
1156
2514
  }));
1157
2515
  }
1158
2516
  };
1159
- function z(e = [], t = {}) {
1160
- return new R(e, t.defaultCatalogId);
1161
- }
1162
- var B = z(), V = n(B);
1163
- function me({ registry: e, children: t }) {
1164
- return /* @__PURE__ */ a(V.Provider, {
1165
- value: e,
1166
- children: t
1167
- });
2517
+ function Mt(e = [], t = {}) {
2518
+ return new J(e, t.defaultCatalogId);
1168
2519
  }
1169
- function he() {
1170
- return r(V);
2520
+ var Y = Mt(), Nt = "0.9.1";
2521
+ function Pt(e) {
2522
+ return K(e);
1171
2523
  }
1172
- //#endregion
1173
- //#region src/core/interaction/a2ui-validate.ts
1174
- var ge = "0.9.1";
1175
- function _e(e) {
1176
- return F(e);
1177
- }
1178
- function H(e, t = B) {
1179
- if (!e) return U(null);
1180
- if (e.wireVersion !== "0.9.1" || !e.messages || e.messages.length === 0) return U(e);
2524
+ function Ft(e, t = Y) {
2525
+ if (!e) return X(null);
2526
+ if (e.wireVersion !== "0.9.1" || !e.messages || e.messages.length === 0) return X(e);
1181
2527
  try {
1182
- let n = t instanceof R ? t : B, r = new Set(e.messages.flatMap((e) => {
2528
+ let n = t instanceof J ? t : Y, r = new Set(e.messages.flatMap((e) => {
1183
2529
  let t = e.createSurface;
1184
2530
  return t?.catalogId ? [t.catalogId] : [];
1185
2531
  }));
1186
2532
  if (r.size !== 1) return "json-schema-form";
1187
2533
  let i = n.get([...r][0]);
1188
2534
  if (!i) return "json-schema-form";
1189
- let a = t instanceof R ? i.digest : _e(t), o = [...r][0] === P.catalogId && e.catalogDigest === N.catalog_digest;
2535
+ let a = t instanceof J ? i.digest : Pt(t), o = [...r][0] === G.catalogId && e.catalogDigest === W.catalog_digest;
1190
2536
  if (!e.catalogDigest || e.catalogDigest !== a && !o) return "json-schema-form";
1191
2537
  n.validateMessages(e.messages).dispose();
1192
2538
  } catch {
@@ -1194,320 +2540,244 @@ function H(e, t = B) {
1194
2540
  }
1195
2541
  return "a2ui";
1196
2542
  }
1197
- function U(e) {
1198
- return e && ve(e) ? "json-schema-form" : "basic-controls";
2543
+ function X(e) {
2544
+ return e && It(e) ? "json-schema-form" : "basic-controls";
1199
2545
  }
1200
- function ve(e) {
2546
+ function It(e) {
1201
2547
  return e.messages.some((e) => {
1202
2548
  let t = e.inputSchema ?? e.input_schema ?? e.schema;
1203
2549
  return typeof t == "object" && !!t;
1204
2550
  });
1205
2551
  }
1206
- function ye(e, t = B) {
2552
+ function Lt(e, t = Y) {
1207
2553
  let n = e.kind === "approval" ? e.presentation?.a2ui : null;
1208
- return n && H(n, t) === "a2ui" ? n : null;
2554
+ return n && Ft(n, t) === "a2ui" ? n : null;
1209
2555
  }
1210
2556
  //#endregion
1211
- //#region src/core/interaction/types.ts
1212
- var be = new Set([
1213
- "resolved",
1214
- "cancelled",
1215
- "expired"
1216
- ]);
1217
- function W(e) {
1218
- return be.has(e);
1219
- }
1220
- function xe(e, t) {
1221
- return `interaction:${e}:revision-${t}`;
1222
- }
1223
- function Se(e, t) {
1224
- if (typeof t != "object" || !t || Array.isArray(t)) return e === "cancel" ? "已取消" : "已提交";
1225
- let n = t.approved;
1226
- if (typeof n == "boolean") return n ? "已同意" : "已拒绝";
1227
- let r = Object.keys(t);
1228
- return r.length === 0 ? e === "approve" ? "已同意" : e === "reject" ? "已拒绝" : e === "cancel" ? "已取消" : "已提交" : `${e}(${r.slice(0, 3).map((e) => {
1229
- let n = t[e];
1230
- return `${e}=${typeof n == "string" ? n.length > 24 ? `${n.slice(0, 24)}…` : n : typeof n == "object" && n ? "[object]" : String(n)}`;
1231
- }).join(", ")})`;
1232
- }
1233
- var Ce = {
1234
- $schema: "http://json-schema.org/draft-06/schema#",
1235
- $id: "http://json-schema.org/draft-06/schema#",
1236
- title: "Core schema meta-schema",
1237
- definitions: {
1238
- schemaArray: {
1239
- type: "array",
1240
- minItems: 1,
1241
- items: { $ref: "#" }
1242
- },
1243
- nonNegativeInteger: {
1244
- type: "integer",
1245
- minimum: 0
1246
- },
1247
- nonNegativeIntegerDefault0: { allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }] },
1248
- simpleTypes: { enum: [
1249
- "array",
1250
- "boolean",
1251
- "integer",
1252
- "null",
1253
- "number",
1254
- "object",
1255
- "string"
1256
- ] },
1257
- stringArray: {
1258
- type: "array",
1259
- items: { type: "string" },
1260
- uniqueItems: !0,
1261
- default: []
2557
+ //#region src/core/interaction/legacy-history.ts
2558
+ var Z = (e) => typeof e == "string" && e ? e : void 0;
2559
+ function Rt(e, t, n) {
2560
+ for (let r of n) {
2561
+ if (r.agentBlock && Rt(e, t, r.agentBlock.messages), r.eventType === "conversation_item_v1") continue;
2562
+ let n = Object.values(r.tools || {}), i = [...n];
2563
+ for (let e of r.blocks || []) {
2564
+ if (e.type !== "tool" || !Z(e.extra?.approvalRequestId)) continue;
2565
+ let t = e.extra || {}, r = n.find((e) => e.approvalRequestId === t.approvalRequestId);
2566
+ i.push({
2567
+ ...r,
2568
+ name: e.toolName,
2569
+ args: e.args,
2570
+ status: e.status,
2571
+ approvalRequestId: Z(t.approvalRequestId),
2572
+ approvalStatus: Z(t.approvalStatus) || r?.approvalStatus,
2573
+ approvalProtocol: Z(t.approvalProtocol) || r?.approvalProtocol,
2574
+ approvalMessage: Z(t.approvalMessage) || r?.approvalMessage,
2575
+ previousResponseId: Z(t.previousResponseId) || r?.previousResponseId
2576
+ });
1262
2577
  }
1263
- },
1264
- type: ["object", "boolean"],
1265
- properties: {
1266
- $id: {
1267
- type: "string",
1268
- format: "uri-reference"
1269
- },
1270
- $schema: {
1271
- type: "string",
1272
- format: "uri"
1273
- },
1274
- $ref: {
1275
- type: "string",
1276
- format: "uri-reference"
1277
- },
1278
- title: { type: "string" },
1279
- description: { type: "string" },
1280
- default: {},
1281
- examples: {
1282
- type: "array",
1283
- items: {}
1284
- },
1285
- multipleOf: {
1286
- type: "number",
1287
- exclusiveMinimum: 0
1288
- },
1289
- maximum: { type: "number" },
1290
- exclusiveMaximum: { type: "number" },
1291
- minimum: { type: "number" },
1292
- exclusiveMinimum: { type: "number" },
1293
- maxLength: { $ref: "#/definitions/nonNegativeInteger" },
1294
- minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" },
1295
- pattern: {
1296
- type: "string",
1297
- format: "regex"
1298
- },
1299
- additionalItems: { $ref: "#" },
1300
- items: {
1301
- anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }],
1302
- default: {}
1303
- },
1304
- maxItems: { $ref: "#/definitions/nonNegativeInteger" },
1305
- minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" },
1306
- uniqueItems: {
1307
- type: "boolean",
1308
- default: !1
1309
- },
1310
- contains: { $ref: "#" },
1311
- maxProperties: { $ref: "#/definitions/nonNegativeInteger" },
1312
- minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" },
1313
- required: { $ref: "#/definitions/stringArray" },
1314
- additionalProperties: { $ref: "#" },
1315
- definitions: {
1316
- type: "object",
1317
- additionalProperties: { $ref: "#" },
1318
- default: {}
1319
- },
1320
- properties: {
1321
- type: "object",
1322
- additionalProperties: { $ref: "#" },
1323
- default: {}
1324
- },
1325
- patternProperties: {
1326
- type: "object",
1327
- additionalProperties: { $ref: "#" },
1328
- default: {}
1329
- },
1330
- dependencies: {
1331
- type: "object",
1332
- additionalProperties: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] }
1333
- },
1334
- propertyNames: { $ref: "#" },
1335
- const: {},
1336
- enum: {
1337
- type: "array",
1338
- minItems: 1,
1339
- uniqueItems: !0
1340
- },
1341
- type: { anyOf: [{ $ref: "#/definitions/simpleTypes" }, {
1342
- type: "array",
1343
- items: { $ref: "#/definitions/simpleTypes" },
1344
- minItems: 1,
1345
- uniqueItems: !0
1346
- }] },
1347
- format: { type: "string" },
1348
- allOf: { $ref: "#/definitions/schemaArray" },
1349
- anyOf: { $ref: "#/definitions/schemaArray" },
1350
- oneOf: { $ref: "#/definitions/schemaArray" },
1351
- not: { $ref: "#" }
1352
- },
1353
- default: {}
1354
- }, G = /* @__PURE__ */ new Map();
1355
- function K(e) {
1356
- t(e);
1357
- let n = JSON.stringify(e), r = G.get(n);
1358
- if (r) return r;
1359
- let i = String(e.$schema || "https://json-schema.org/draft/2020-12/schema"), a = {
1360
- strict: !1,
1361
- allErrors: !0,
1362
- coerceTypes: !1,
1363
- useDefaults: !1,
1364
- removeAdditional: !1,
1365
- ownProperties: !0,
1366
- logger: !1
1367
- }, c = /draft-04/.test(i) ? new re(a) : /draft-0[67]/.test(i) ? new te(a) : /2019-09/.test(i) ? new ne(a) : /2020-12/.test(i) ? new o(a) : null;
1368
- if (!c) throw TypeError("Unsupported JSON Schema dialect");
1369
- /draft-06/.test(i) && c.addMetaSchema(Ce), s(c);
1370
- let l = c.compile(e);
1371
- if ("$async" in l && l.$async) throw TypeError("Async schemas are not supported");
1372
- G.size >= 128 && G.delete(G.keys().next().value);
1373
- let u = typeof e.$id == "string" ? e.$id.replace(/#$/, "") : typeof e.id == "string" ? e.id.replace(/#$/, "") : "", d = {
1374
- root: l,
1375
- at: (e, t) => !!(e === "" ? l : c.getSchema(`${u}#${e}`))?.(t)
1376
- };
1377
- return G.set(n, d), d;
2578
+ for (let n of i) {
2579
+ let i = n.approvalRequestId, a = n.approvalProtocol, o = n.approvalStatus || (n.status === "paused" ? "pending" : void 0);
2580
+ if (!i || !o || ![
2581
+ "pending",
2582
+ "approved",
2583
+ "rejected",
2584
+ "cancelled"
2585
+ ].includes(o) || a !== "responses" && a !== "ag-ui") continue;
2586
+ let s = e.get(t, i);
2587
+ if (s && (s.source === "interaction_v1" || k(s.status))) continue;
2588
+ let c = {
2589
+ sessionId: t,
2590
+ runId: r.runId || r.invocationId,
2591
+ name: n.name,
2592
+ message: n.approvalMessage,
2593
+ args: n.args,
2594
+ previousResponseId: n.previousResponseId || r.responseId
2595
+ }, l = a === "ag-ui" ? B({
2596
+ ...c,
2597
+ interruptId: i,
2598
+ toolCallId: n.callId
2599
+ }) : z({
2600
+ ...c,
2601
+ approvalRequestId: i
2602
+ });
2603
+ l && (l.revision = s?.revision || l.revision, l.createdAt = s?.createdAt || l.createdAt, l.runId = s?.runId || l.runId, l.extensions = {
2604
+ ...l.extensions,
2605
+ ...s?.extensions
2606
+ }, o !== "pending" && (l.status = o === "cancelled" ? "cancelled" : "resolved", l.outcome = o), e.upsert(l));
2607
+ }
2608
+ }
1378
2609
  }
1379
- function we(e) {
1380
- return K(e).at;
2610
+ //#endregion
2611
+ //#region src/core/interaction/adapters/legacy-runtime-events.ts
2612
+ function Q(e) {
2613
+ return e && typeof e == "object" && !Array.isArray(e) ? e : null;
1381
2614
  }
1382
- function Te(e, n) {
1383
- try {
1384
- t(n);
1385
- let r = K(e).root, i = r(n);
1386
- return {
1387
- valid: !!i,
1388
- issues: i ? [] : (r.errors || []).slice(0, 10).map((e) => `${e.instancePath || "/"}:不符合 ${e.keyword} 约束`)
1389
- };
1390
- } catch {
1391
- return {
1392
- valid: !1,
1393
- issues: ["输入或表单约束不是受支持的 JSON。"]
1394
- };
2615
+ function zt(e, t) {
2616
+ let n = Q(e), r = Q(Q(n?.Content)?.runtime_event);
2617
+ if (!r || r.schema_version !== 2 || r.interaction_kind !== "approval") return null;
2618
+ let i = Q(r.source);
2619
+ if (![
2620
+ "langgraph",
2621
+ "langchain",
2622
+ "deepagents"
2623
+ ].includes(String(i?.framework))) return null;
2624
+ let a = String(n?.SessionId || t || ""), o = typeof r.interaction_id == "string" ? r.interaction_id : "";
2625
+ if (!a || !o) return null;
2626
+ 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
+ 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({
2629
+ approvalRequestId: o,
2630
+ sessionId: a,
2631
+ runId: String(r.run_id || n?.InvocationId || "") || void 0,
2632
+ name: String(c?.tool_name || f?.name || "") || void 0,
2633
+ message: typeof c?.description == "string" ? c.description : void 0,
2634
+ args: p === void 0 ? void 0 : typeof p == "string" ? p : JSON.stringify(p),
2635
+ previousResponseId: typeof m?.response_id == "string" ? m.response_id : void 0
2636
+ });
2637
+ if (!h) return null;
2638
+ if (h.createdAt = String(r.timestamp ?? n?.Timestamp ?? h.createdAt), d) {
2639
+ let e = l?.decision;
2640
+ if (e !== "approved" && e !== "rejected" && e !== "canceled") return null;
2641
+ h.status = e === "canceled" ? "cancelled" : "resolved", h.outcome = e === "canceled" ? "cancelled" : e, h.resolvedAt = h.createdAt;
1395
2642
  }
2643
+ return h;
1396
2644
  }
1397
2645
  //#endregion
1398
- //#region src/core/interaction/response-snapshot.ts
1399
- var q = (e) => typeof e == "object" && e && !Array.isArray(e) ? e : void 0, J = class extends Error {};
1400
- function Y() {
1401
- let e = 8192;
1402
- return () => {
1403
- if (--e < 0) throw new J();
1404
- };
2646
+ //#region src/core/interaction/index.ts
2647
+ var Bt = new Set([
2648
+ "completed",
2649
+ "failed",
2650
+ "error",
2651
+ "cancelled",
2652
+ "canceled",
2653
+ "aborted",
2654
+ "resume_failed"
2655
+ ]), $ = new A();
2656
+ function Vt(e, t) {
2657
+ Rt($, t, e);
1405
2658
  }
1406
- function Ee(e, t, n) {
1407
- if (e === "#") return t;
1408
- if (typeof e != "string" || !e.startsWith("#/")) throw new J();
1409
- try {
1410
- let r = t;
1411
- for (let t of decodeURIComponent(e.slice(2)).split("/")) {
1412
- n();
1413
- let e = q(r) ?? (Array.isArray(r) ? r : void 0), i = t.replace(/~1/g, "/").replace(/~0/g, "~");
1414
- if (!e || !Object.hasOwn(e, i)) throw new J();
1415
- r = e[i];
1416
- }
1417
- return r;
1418
- } catch {
1419
- throw new J();
2659
+ function Ht(e, t) {
2660
+ let n = xt(e, t) ?? zt(e, t);
2661
+ n && $.upsert(n);
2662
+ let r = typeof e == "object" && e ? e : null;
2663
+ if (r?.EventType === "control.command_rejected") {
2664
+ let e = r.Content;
2665
+ $.rejectCommand(String(r.SessionId || t || ""), String(e?.command_id || ""), String(e?.reason || "command_rejected"));
1420
2666
  }
2667
+ let a = r ? i(r) : null;
2668
+ if (a !== null && Bt.has(a)) {
2669
+ 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
+ $.markRunTerminal(i, a);
2671
+ }
2672
+ return n;
1421
2673
  }
1422
- function X(e, t, n) {
1423
- let r = /* @__PURE__ */ new Set(), i = [...e];
1424
- for (; i.length;) {
1425
- n();
1426
- let e = i.pop();
1427
- if (typeof e == "boolean") continue;
1428
- let a = q(e);
1429
- if (!a) throw new J();
1430
- if (!r.has(a)) {
1431
- if (r.add(a), a !== t && Object.hasOwn(a, "$id") || Object.hasOwn(a, "$dynamicRef") || Object.hasOwn(a, "$recursiveRef")) throw new J();
1432
- Object.hasOwn(a, "$ref") && i.push(Ee(a.$ref, t, n));
1433
- for (let e of [
1434
- "allOf",
1435
- "anyOf",
1436
- "oneOf"
1437
- ]) {
1438
- let t = a[e];
1439
- if (t !== void 0 && !Array.isArray(t)) throw new J();
1440
- Array.isArray(t) && i.push(...t);
1441
- }
1442
- for (let e of [
1443
- "if",
1444
- "then",
1445
- "else"
1446
- ]) Object.hasOwn(a, e) && i.push(a[e]);
1447
- for (let e of [q(a.dependentSchemas), q(a.dependencies)]) for (let t of Object.values(e || {})) (q(t) || typeof t == "boolean") && i.push(t);
2674
+ function Ut(e) {
2675
+ let t = e.sessionId || "";
2676
+ if (!t || !e.approvalRequestId) return null;
2677
+ let n = e.protocol === "ag-ui" ? B({
2678
+ interruptId: e.approvalRequestId,
2679
+ sessionId: t,
2680
+ runId: e.runId,
2681
+ name: e.name,
2682
+ message: e.message,
2683
+ reason: e.approvalLevel,
2684
+ requestSchema: e.requestSchema
2685
+ }) : z({
2686
+ approvalRequestId: e.approvalRequestId,
2687
+ sessionId: t,
2688
+ runId: e.runId,
2689
+ name: e.name,
2690
+ message: e.message,
2691
+ args: e.args,
2692
+ approvalLevel: e.approvalLevel,
2693
+ previousResponseId: e.previousResponseId
2694
+ });
2695
+ return n && $.upsert(n), n;
2696
+ }
2697
+ function Wt(e) {
2698
+ let t = e.sessionId || "";
2699
+ if (!t || !e.questionId) return null;
2700
+ let n = Ct({
2701
+ questionId: e.questionId,
2702
+ sessionId: t,
2703
+ runId: e.runId,
2704
+ questions: e.questions
2705
+ });
2706
+ return n && $.upsert(n), n;
2707
+ }
2708
+ function Gt(e) {
2709
+ let t = e.sessionId || "";
2710
+ if (!t || !e.questionId) return null;
2711
+ let n = $.get(t, e.questionId);
2712
+ if (!n) return null;
2713
+ let r = e.answers && typeof e.answers == "object" ? e.answers : {};
2714
+ return $.upsert({
2715
+ ...n,
2716
+ status: "resolved",
2717
+ revision: e.revision ?? n.revision + 1,
2718
+ resolvedAt: (/* @__PURE__ */ new Date()).toISOString(),
2719
+ outcome: "submitted",
2720
+ responseSummary: JSON.stringify(r).slice(0, 200),
2721
+ extensions: {
2722
+ ...n.extensions,
2723
+ answers: r
1448
2724
  }
1449
- }
1450
- return [...r];
2725
+ }), $.get(t, e.questionId);
1451
2726
  }
1452
- var Z = (e) => e.writeOnly === !0 || e.format === "password" || e["x-sensitive"] === !0 || e["x-codex-is-secret"] === !0;
1453
- function De(e, t = e) {
1454
- try {
1455
- return X([e], t, Y()).some(Z);
1456
- } catch {
1457
- return !0;
1458
- }
2727
+ function Kt(e) {
2728
+ let t = e.sessionId || "";
2729
+ if (!t || !e.approvalRequestId) return null;
2730
+ let n = $.get(t, e.approvalRequestId);
2731
+ return n?.source === "agui" && n.kind === "structured_input" ? k(n.status) ? n : ($.resolveLocally(t, n.interactionId, {
2732
+ status: e.decision === "cancelled" ? "cancelled" : "resolved",
2733
+ outcome: e.decision === "cancelled" ? "cancelled" : "submitted",
2734
+ revision: e.revision || 2,
2735
+ actor: "user"
2736
+ }), $.get(t, n.interactionId)) : Ht({
2737
+ EventType: "approval.resolved",
2738
+ Content: {
2739
+ approvalId: e.approvalRequestId,
2740
+ revision: e.revision || 2,
2741
+ outcome: e.decision,
2742
+ actor: "user",
2743
+ resolvedAt: (/* @__PURE__ */ new Date()).toISOString()
2744
+ }
2745
+ }, t);
1459
2746
  }
1460
- function Q(e, n) {
1461
- let r = Y();
1462
- function i(t, n, a) {
1463
- if (r(), a > 48) throw new J();
1464
- let o = X(t, e, r);
1465
- return o.some(Z) ? null : Array.isArray(n) ? n.map((e, t) => {
1466
- let n = [];
1467
- for (let e of o) {
1468
- let r = Array.isArray(e.prefixItems) ? e.prefixItems : void 0, i = Array.isArray(e.items) ? e.items : void 0;
1469
- n.push(r && t < r.length ? r[t] : i ? t < i.length ? i[t] : e.additionalItems ?? {} : e.items ?? {});
1470
- for (let t of ["contains", "unevaluatedItems"]) Object.hasOwn(e, t) && n.push(e[t]);
1471
- }
1472
- return i(n, e, a + 1);
1473
- }) : typeof n != "object" || !n ? n : Object.fromEntries(Object.entries(n).map(([e, t]) => {
1474
- let n = [];
1475
- for (let t of o) {
1476
- let r = q(t.properties), i = !!(r && Object.hasOwn(r, e));
1477
- i && n.push(r[e]);
1478
- for (let [r, a] of Object.entries(q(t.patternProperties) || {})) new RegExp(r).test(e) && (i = !0, n.push(a));
1479
- !i && Object.hasOwn(t, "additionalProperties") && n.push(t.additionalProperties), Object.hasOwn(t, "unevaluatedProperties") && n.push(t.unevaluatedProperties);
1480
- }
1481
- return [e, i(n, t, a + 1)];
1482
- }));
1483
- }
1484
- try {
1485
- return t(n), i([e], n, 0);
1486
- } catch {
1487
- return null;
1488
- }
2747
+ function qt(e) {
2748
+ let t = $.get(e.sessionId || "", e.interactionId);
2749
+ !t || t.source !== "agui" || k(t.status) || $.markFailed(t.sessionId, t.interactionId, {
2750
+ code: "input_response_invalid",
2751
+ message: e.message,
2752
+ retryable: !0
2753
+ });
1489
2754
  }
1490
- function Oe(e) {
1491
- if (!(e.kind !== "structured_input" || e.status !== "resolved" || e.outcome !== "submitted" || !e.requestSchema || !Object.hasOwn(e, "response"))) try {
1492
- return { value: Q(e.requestSchema, t(e.response)) };
1493
- } catch {
1494
- return;
1495
- }
2755
+ //#endregion
2756
+ //#region src/core/a2ui/provider.tsx
2757
+ var Jt = a(Y);
2758
+ function Yt({ registry: e, children: t }) {
2759
+ return /* @__PURE__ */ c(Jt.Provider, {
2760
+ value: e,
2761
+ children: t
2762
+ });
2763
+ }
2764
+ function Xt() {
2765
+ return o(Jt);
1496
2766
  }
1497
2767
  //#endregion
1498
2768
  //#region src/core/run/a2ui.ts
1499
- var $ = {
2769
+ var Zt = {
1500
2770
  description: "A2UI Component Schema — available components for generating UI surfaces. Use these component names and properties when creating A2UI operations.",
1501
2771
  value: JSON.stringify({
1502
- ...M,
1503
- ksadkManifest: N
2772
+ ...U,
2773
+ ksadkManifest: W
1504
2774
  })
1505
2775
  };
1506
- function ke(e = B) {
1507
- if (e === B) return $;
2776
+ function Qt(e = Y) {
2777
+ if (e === Y) return Zt;
1508
2778
  let t = e.get(e.defaultCatalogId);
1509
2779
  return {
1510
- description: $.description,
2780
+ description: Zt.description,
1511
2781
  value: JSON.stringify({
1512
2782
  ...t.schema,
1513
2783
  ksadkResources: t.resources,
@@ -1519,7 +2789,7 @@ function ke(e = B) {
1519
2789
  })
1520
2790
  };
1521
2791
  }
1522
- function Ae(e) {
2792
+ function $t(e) {
1523
2793
  return e.map((e) => {
1524
2794
  let t = e.updateComponents;
1525
2795
  if (!t || typeof t != "object" || Array.isArray(t)) return e;
@@ -1542,7 +2812,7 @@ function Ae(e) {
1542
2812
  };
1543
2813
  });
1544
2814
  }
1545
- function je(e) {
2815
+ function en(e) {
1546
2816
  for (let t of e) {
1547
2817
  let e = t.updateComponents?.components;
1548
2818
  if (!Array.isArray(e) || !e.some((e) => e.component === "Form" && e.id === "form")) continue;
@@ -1552,4 +2822,4 @@ function je(e) {
1552
2822
  return null;
1553
2823
  }
1554
2824
  //#endregion
1555
- export { b as C, ie as E, oe as S, v as T, z as _, Q as a, T as b, Te as c, Se as d, ge as f, he as g, me as h, De as i, xe as l, ye as m, je as n, Oe as o, H as p, Ae as r, we as s, ke as t, W as u, B as v, ae as w, D as x, P as y };
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 };