@kingsoftcloud/ksadk-web 0.3.13 → 0.3.14
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.
- package/CHANGELOG.md +14 -0
- package/README.md +3 -3
- package/RELEASE_PROVENANCE.json +2 -2
- package/dist-ksadk/a2ui/basic-v0_9_1.json +1383 -0
- package/dist-ksadk/a2ui/common-types-v0_9.json +305 -0
- package/dist-ksadk/a2ui/legacy-seven-components.json +230 -0
- package/dist-ksadk/a2ui/manifest.json +86 -0
- package/dist-ksadk/a2ui/material-icons-OFL-1.1.txt +93 -0
- package/dist-ksadk/assets/{ArtifactsPanel-CILaW-fC.js → ArtifactsPanel-D6LwZ4tH.js} +1 -1
- package/dist-ksadk/assets/{CodeBlock-BVrNVtJC.js → CodeBlock-CVzuVnaN.js} +6 -6
- package/dist-ksadk/assets/{MathMessageMarkdown-Dp7c4wWD.js → MathMessageMarkdown-BV0Wpi0w.js} +7 -7
- package/dist-ksadk/assets/{MermaidBlock-Dxop8Rd7.js → MermaidBlock-CnBUrMcm.js} +9 -9
- package/dist-ksadk/assets/NativeTerminalPanel-JqWiX3NG.js +1 -0
- package/dist-ksadk/assets/OfficialA2uiRenderer-jre8Zxwn.js +16 -0
- package/dist-ksadk/assets/{abnfDiagram-VCTEODGH-ckWDmOzw.js → abnfDiagram-VCTEODGH-5klLGLXu.js} +1 -1
- package/dist-ksadk/assets/{arc-DqxJede-.js → arc-BZZ76X9T.js} +1 -1
- package/dist-ksadk/assets/architecture-7GRP2DOG-HtHCKaib.js +1 -0
- package/dist-ksadk/assets/{architectureDiagram-5GKGNRK7-SEQA4bVi.js → architectureDiagram-5GKGNRK7-Z8sis19K.js} +1 -1
- package/dist-ksadk/assets/{blockDiagram-NRAW4CY4-pM0B-6NJ.js → blockDiagram-NRAW4CY4-CbvtJUlp.js} +1 -1
- package/dist-ksadk/assets/{c4Diagram-UCG6FXSJ-m2tuCNVq.js → c4Diagram-UCG6FXSJ-DRDFUFRO.js} +1 -1
- package/dist-ksadk/assets/channel-kuCeovvA.js +1 -0
- package/dist-ksadk/assets/chunk-2Q5K7J3B-DW3fGlBY.js +1 -0
- package/dist-ksadk/assets/{chunk-5VM5RSS4-GJHDr9Ww.js → chunk-5VM5RSS4-DgtggYEo.js} +1 -1
- package/dist-ksadk/assets/{chunk-F27PBJKO-CbAN45AV.js → chunk-F27PBJKO-DBbGWzCA.js} +1 -1
- package/dist-ksadk/assets/{chunk-G27WJ6UU-D5ngbbzF.js → chunk-G27WJ6UU-DN3d7UAB.js} +1 -1
- package/dist-ksadk/assets/{chunk-JWPE2WC7-Cc5IwuYC.js → chunk-JWPE2WC7-Bx1EEStb.js} +1 -1
- package/dist-ksadk/assets/{chunk-LCL6LL3I-CprgDDdJ.js → chunk-LCL6LL3I-WtVZVwRo.js} +1 -1
- package/dist-ksadk/assets/{chunk-POPQ4Y6H-CDZhSy82.js → chunk-POPQ4Y6H-Bws5AdxJ.js} +1 -1
- package/dist-ksadk/assets/{chunk-RHFEMEQ7-CZchUNro.js → chunk-RHFEMEQ7-XkUQsrvs.js} +1 -1
- package/dist-ksadk/assets/{chunk-SVP7TREG-BVruqk6T.js → chunk-SVP7TREG-Bsl7M9AM.js} +1 -1
- package/dist-ksadk/assets/{chunk-XXDRQBXY-4ld9SxPN.js → chunk-XXDRQBXY-CgtLH0fF.js} +1 -1
- package/dist-ksadk/assets/classDiagram-DTDB5LWJ-2ASNdnzY.js +1 -0
- package/dist-ksadk/assets/classDiagram-v2-JRS7N3AN-2ASNdnzY.js +1 -0
- package/dist-ksadk/assets/{cose-bilkent-JH36ORCC-Dmyyk_Vp.js → cose-bilkent-JH36ORCC-CeWoENhZ.js} +1 -1
- package/dist-ksadk/assets/cynefin-OW5HDTMX-1bdXRZZW.js +1 -0
- package/dist-ksadk/assets/{cynefinDiagram-5FMLGOSQ-BIyq3EJb.js → cynefinDiagram-5FMLGOSQ-20tItmQc.js} +1 -1
- package/dist-ksadk/assets/{dagre-3AP2YEHR-eBw08Qdk.js → dagre-3AP2YEHR-Dbq7kvPA.js} +1 -1
- package/dist-ksadk/assets/{dagre-DfvnEf45.js → dagre-CDn7V_FV.js} +1 -1
- package/dist-ksadk/assets/{diagram-S7CK7UJ4-CUSrE3Mg.js → diagram-S7CK7UJ4-BZmC9O9H.js} +1 -1
- package/dist-ksadk/assets/{diagram-UQ7AKVKN-Dq5Zw2gy.js → diagram-UQ7AKVKN-Du6_H3qW.js} +1 -1
- package/dist-ksadk/assets/{diagram-VSXAHHWV-DyUHfNwT.js → diagram-VSXAHHWV-C-yzAkOw.js} +1 -1
- package/dist-ksadk/assets/{diagram-VX7I27RA-CREmM89O.js → diagram-VX7I27RA-D9uvDFOT.js} +1 -1
- package/dist-ksadk/assets/{diagram-Z3DM3KII-Dw9zhHUK.js → diagram-Z3DM3KII-CU7oDxrX.js} +1 -1
- package/dist-ksadk/assets/{dist-pq-nD33R.js → dist--hkDI36a.js} +1 -1
- package/dist-ksadk/assets/{dist-BQMrUwdI.js → dist-A93qMRIG.js} +1 -1
- package/dist-ksadk/assets/{dist-Co68Apq4.js → dist-BAQdZ6nL.js} +1 -1
- package/dist-ksadk/assets/{dist-bupkyEBZ.js → dist-BMr3B20m.js} +1 -1
- package/dist-ksadk/assets/{dist-hL5p1til.js → dist-BzJ7YZSp.js} +1 -1
- package/dist-ksadk/assets/{dist-DUxO0R99.js → dist-C27hii8p.js} +1 -1
- package/dist-ksadk/assets/{dist-BX_-FENW.js → dist-C6_6Bds1.js} +1 -1
- package/dist-ksadk/assets/{dist-lOy23y43.js → dist-CCsMtFWS.js} +1 -1
- package/dist-ksadk/assets/{dist-B8Myiet9.js → dist-CJWOBYYA.js} +1 -1
- package/dist-ksadk/assets/{dist-QzbGrED_.js → dist-CKdx7EBd.js} +1 -1
- package/dist-ksadk/assets/{dist-DDSyLEOX.js → dist-CYZpFnLj.js} +1 -1
- package/dist-ksadk/assets/{dist-AEv-vXf-.js → dist-CicTOm8l.js} +1 -1
- package/dist-ksadk/assets/{dist-CVPau3tn.js → dist-D5UMz8J2.js} +1 -1
- package/dist-ksadk/assets/{dist-Cp2PaOMY.js → dist-DGF16E1K.js} +1 -1
- package/dist-ksadk/assets/{dist-cxTGfdqx.js → dist-DIDBisGY.js} +1 -1
- package/dist-ksadk/assets/{dist-C_qdxcSH.js → dist-DLUtqcff.js} +1 -1
- package/dist-ksadk/assets/{dist-0uJ4tdx6.js → dist-DNKlYhx0.js} +1 -1
- package/dist-ksadk/assets/{dist-CuR5Bgme.js → dist-DXQ4VAxh.js} +1 -1
- package/dist-ksadk/assets/{dist-CHpW1BHj.js → dist-DlTRB6vC.js} +1 -1
- package/dist-ksadk/assets/{dist-CD4L6ymH.js → dist-KZg0gTHo.js} +1 -1
- package/dist-ksadk/assets/{dist-BBsYarrI.js → dist-di2puApf.js} +1 -1
- package/dist-ksadk/assets/{dist-B49GzZDb.js → dist-raxPVjNv.js} +1 -1
- package/dist-ksadk/assets/{ebnfDiagram-PWID7BFC-BS5LdNoR.js → ebnfDiagram-PWID7BFC-DuZG2dXs.js} +1 -1
- package/dist-ksadk/assets/{erDiagram-SSCWMZ5O-Bv1QtiY-.js → erDiagram-SSCWMZ5O-BL8xNTj7.js} +1 -1
- package/dist-ksadk/assets/eventmodeling-NTZA5JFV-CJmDiSBW.js +1 -0
- package/dist-ksadk/assets/flowDiagram-A5DVABFB-CQeF2mVM.js +1 -0
- package/dist-ksadk/assets/{ganttDiagram-EL5Y4UJY-musi-e0G.js → ganttDiagram-EL5Y4UJY-CrlgL4uW.js} +1 -1
- package/dist-ksadk/assets/gitGraph-4MIJSDKK-nZDWMnv0.js +1 -0
- package/dist-ksadk/assets/{gitGraphDiagram-WWUBYQGX-DH37EGkG.js → gitGraphDiagram-WWUBYQGX-rSzorCYl.js} +1 -1
- package/dist-ksadk/assets/index-Bdrdzuun.js +1132 -0
- package/dist-ksadk/assets/index-DMqhW2cV.css +2 -0
- package/dist-ksadk/assets/info-A6RAGUB7-De1Iwui5.js +1 -0
- package/dist-ksadk/assets/{infoDiagram-RXCK75RN-C1kEtv2y.js → infoDiagram-RXCK75RN-CAt8qVFg.js} +1 -1
- package/dist-ksadk/assets/{ishikawaDiagram-5VMMS53U-BCNPyMka.js → ishikawaDiagram-5VMMS53U-VhqJKMYj.js} +1 -1
- package/dist-ksadk/assets/{journeyDiagram-EYS64GPL--cDbKnjP.js → journeyDiagram-EYS64GPL-Bhfu6YF7.js} +1 -1
- package/dist-ksadk/assets/{kanban-definition-3QL26DDD-R1rAVw2f.js → kanban-definition-3QL26DDD-7OI9pMVn.js} +1 -1
- package/dist-ksadk/assets/{katex-BT-X-V7U.js → katex-Dg-M8r12.js} +1 -1
- package/dist-ksadk/assets/{linear-DTR631iG.js → linear-NMml7t9_.js} +1 -1
- package/dist-ksadk/assets/material-icons-latin-400-normal-kAwBdRge.woff2 +0 -0
- package/dist-ksadk/assets/{mermaid-parser.core-DfFzJhX8.js → mermaid-parser.core-BEmZbnyI.js} +2 -2
- package/dist-ksadk/assets/{mindmap-definition-FBJOCRG2-D4by_rmk.js → mindmap-definition-FBJOCRG2-B0xwWHMG.js} +1 -1
- package/dist-ksadk/assets/packet-AYTQ26CC-D1e-X1k6.js +1 -0
- package/dist-ksadk/assets/{pegDiagram-XKGWAZYB-xWXPEh0c.js → pegDiagram-XKGWAZYB-Cu7QgjWh.js} +1 -1
- package/dist-ksadk/assets/pie-WAS4IAKB-Lxivx4QM.js +1 -0
- package/dist-ksadk/assets/{pieDiagram-E7YTZNPT-BudBDlCI.js → pieDiagram-E7YTZNPT-DkoIrDma.js} +1 -1
- package/dist-ksadk/assets/{quadrantDiagram-AXDQQJYC-DXZ0PCJF.js → quadrantDiagram-AXDQQJYC-BNlrjzzI.js} +1 -1
- package/dist-ksadk/assets/radar-RG4KPBEZ-BQSVqVrb.js +1 -0
- package/dist-ksadk/assets/railroad-74A4TZTK-Cbnh6XZs.js +1 -0
- package/dist-ksadk/assets/railroad-abnf-HS5TGJTU-2ECgbBti.js +1 -0
- package/dist-ksadk/assets/railroad-ebnf-LZEXJU2U-BfFn9JLY.js +1 -0
- package/dist-ksadk/assets/railroad-peg-WCYAUIDC-DyICMM5z.js +1 -0
- package/dist-ksadk/assets/{railroadDiagram-O6MQD6OU-BdAYRYB8.js → railroadDiagram-O6MQD6OU-BK0bi_rd.js} +1 -1
- package/dist-ksadk/assets/{requirementDiagram-EFPCY7ZU-CBBmaL70.js → requirementDiagram-EFPCY7ZU-B7OeRQPt.js} +1 -1
- package/dist-ksadk/assets/{sankeyDiagram-P5KCCOFB-Doc3rdwp.js → sankeyDiagram-P5KCCOFB-dE-_Jk7C.js} +1 -1
- package/dist-ksadk/assets/{sequenceDiagram-WJ2MYXX4-0J8R8hWW.js → sequenceDiagram-WJ2MYXX4-y0THlktZ.js} +1 -1
- package/dist-ksadk/assets/{sizeCapture-X5ZJPWSS-CfFLlWsK.js → sizeCapture-X5ZJPWSS-CROa4oek.js} +1 -1
- package/dist-ksadk/assets/{stateDiagram-HBIQ2CUA-jBwkjtTy.js → stateDiagram-HBIQ2CUA-Bz1m4ALw.js} +1 -1
- package/dist-ksadk/assets/stateDiagram-v2-4QOOHH4V-D1bq-RBG.js +1 -0
- package/dist-ksadk/assets/{swimlanes-XN3QIQJK-B0WxTQf8.js → swimlanes-XN3QIQJK-CvTFLiud.js} +1 -1
- package/dist-ksadk/assets/swimlanesDiagram-VK2B7HYN-BoqEqfqH.js +8 -0
- package/dist-ksadk/assets/{timeline-definition-24CTP7MA-BfCT_75A.js → timeline-definition-24CTP7MA-1uvXxAPl.js} +1 -1
- package/dist-ksadk/assets/treeView-Q6P3EWNA-BS4HVbiU.js +1 -0
- package/dist-ksadk/assets/treemap-WGGIJYW6-D9_U1F01.js +1 -0
- package/dist-ksadk/assets/{vennDiagram-4TSXK5OY-9gX1VMDC.js → vennDiagram-4TSXK5OY-ruwLjPyJ.js} +1 -1
- package/dist-ksadk/assets/wardley-WFR3VGLG-DAiztg_B.js +1 -0
- package/dist-ksadk/assets/{wardleyDiagram-VM6X3IG4-sEs_BP6O.js → wardleyDiagram-VM6X3IG4-DlwZFHFD.js} +1 -1
- package/dist-ksadk/assets/{xychartDiagram-S5SC5T6Z-Ll4jvUN9.js → xychartDiagram-S5SC5T6Z-pouF3HpF.js} +1 -1
- package/dist-ksadk/index.html +2 -2
- package/dist-lib/App.d.ts +2 -0
- package/dist-lib/App.d.ts.map +1 -1
- package/dist-lib/AttachmentPreview-C5ruk44B.js +1545 -0
- package/dist-lib/{ConnectedComposer-Dd8ZFhfL.js → ConnectedComposer-D6eV5hd8.js} +16 -16
- package/dist-lib/ConnectedMessageList-YRps8tha.js +1616 -0
- package/dist-lib/OfficialA2uiRenderer-DI49Kpxu.js +8 -0
- package/dist-lib/{WorkspacePanelContainer-BDbgHg1_.js → WorkspacePanelContainer-cAypD1ss.js} +5 -5
- package/dist-lib/a2ui/basic-v0_9_1.json +1383 -0
- package/dist-lib/a2ui/common-types-v0_9.json +305 -0
- package/dist-lib/a2ui/legacy-seven-components.json +230 -0
- package/dist-lib/a2ui/manifest.json +86 -0
- package/dist-lib/a2ui/material-icons-OFL-1.1.txt +93 -0
- package/dist-lib/a2ui-DVGulxKb.js +1547 -0
- package/dist-lib/api/client.d.ts.map +1 -1
- package/dist-lib/api/messages.d.ts +3 -2
- package/dist-lib/api/messages.d.ts.map +1 -1
- package/dist-lib/{capabilities-CXle1R-K.js → capabilities-DAeBY-WO.js} +3 -2
- package/dist-lib/capabilities.js +1 -1
- package/dist-lib/chat-composer.js +2 -2
- package/dist-lib/chat-timeline.js +5 -4
- package/dist-lib/components/chat/A2UIActivityMessage.d.ts +10 -3
- package/dist-lib/components/chat/A2UIActivityMessage.d.ts.map +1 -1
- package/dist-lib/components/chat/ChatMessageList.d.ts +6 -2
- package/dist-lib/components/chat/ChatMessageList.d.ts.map +1 -1
- package/dist-lib/components/chat/ConnectedMessageList.d.ts +1 -1
- package/dist-lib/components/chat/ConnectedMessageList.d.ts.map +1 -1
- package/dist-lib/components/chat/InteractionA2uiSurface.d.ts +2 -1
- package/dist-lib/components/chat/InteractionA2uiSurface.d.ts.map +1 -1
- package/dist-lib/components/chat/InteractionHistoryAnchor.d.ts.map +1 -1
- package/dist-lib/components/chat/InteractionTray.d.ts +2 -1
- package/dist-lib/components/chat/InteractionTray.d.ts.map +1 -1
- package/dist-lib/components/chat/JsonSchemaInputForm.d.ts +16 -0
- package/dist-lib/components/chat/JsonSchemaInputForm.d.ts.map +1 -0
- package/dist-lib/components/chat/LegacyA2UISurface.d.ts +14 -0
- package/dist-lib/components/chat/LegacyA2UISurface.d.ts.map +1 -0
- package/dist-lib/components/chat/OfficialA2uiRenderer.d.ts +3 -0
- package/dist-lib/components/chat/OfficialA2uiRenderer.d.ts.map +1 -0
- package/dist-lib/components/chat/ProcessingBlocksView.d.ts +5 -1
- package/dist-lib/components/chat/ProcessingBlocksView.d.ts.map +1 -1
- package/dist-lib/components/chat/RunProgressIndicator.d.ts +4 -0
- package/dist-lib/components/chat/RunProgressIndicator.d.ts.map +1 -0
- package/dist-lib/components/chat/a2ui-response-snapshot.d.ts +25 -0
- package/dist-lib/components/chat/a2ui-response-snapshot.d.ts.map +1 -0
- package/dist-lib/components/chat/approval-status.d.ts +2 -0
- package/dist-lib/components/chat/approval-status.d.ts.map +1 -1
- package/dist-lib/components/chat/submitted-interaction-history.d.ts +16 -0
- package/dist-lib/components/chat/submitted-interaction-history.d.ts.map +1 -0
- package/dist-lib/components/chat/types.d.ts +17 -0
- package/dist-lib/components/chat/types.d.ts.map +1 -1
- package/dist-lib/components.js +34 -34
- package/dist-lib/conversation.js +2 -2
- package/dist-lib/core/a2ui/catalog.d.ts +250 -0
- package/dist-lib/core/a2ui/catalog.d.ts.map +1 -0
- package/dist-lib/core/a2ui/history.d.ts +13 -0
- package/dist-lib/core/a2ui/history.d.ts.map +1 -0
- package/dist-lib/core/a2ui/linking.d.ts +7 -0
- package/dist-lib/core/a2ui/linking.d.ts.map +1 -0
- package/dist-lib/core/a2ui/provider.d.ts +8 -0
- package/dist-lib/core/a2ui/provider.d.ts.map +1 -0
- package/dist-lib/core/a2ui/registry.d.ts +45 -0
- package/dist-lib/core/a2ui/registry.d.ts.map +1 -0
- package/dist-lib/core/a2ui/snapshot.d.ts +4 -0
- package/dist-lib/core/a2ui/snapshot.d.ts.map +1 -0
- package/dist-lib/core/a2ui/surfaces.d.ts +23 -0
- package/dist-lib/core/a2ui/surfaces.d.ts.map +1 -0
- package/dist-lib/core/a2ui/transcript.d.ts +14 -0
- package/dist-lib/core/a2ui/transcript.d.ts.map +1 -0
- package/dist-lib/core/api/facade.d.ts +7 -1
- package/dist-lib/core/api/facade.d.ts.map +1 -1
- package/dist-lib/core/api/types.d.ts +7 -1
- package/dist-lib/core/api/types.d.ts.map +1 -1
- package/dist-lib/core/conversation/hosted.d.ts.map +1 -1
- package/dist-lib/core/conversation/presentation.d.ts.map +1 -1
- package/dist-lib/core/conversation/runtime-ingress.d.ts.map +1 -1
- package/dist-lib/core/interaction/a2ui-validate.d.ts +6 -3
- package/dist-lib/core/interaction/a2ui-validate.d.ts.map +1 -1
- package/dist-lib/core/interaction/adapters/normalize.d.ts +3 -0
- package/dist-lib/core/interaction/adapters/normalize.d.ts.map +1 -1
- package/dist-lib/core/interaction/adapters/session-events.d.ts.map +1 -1
- package/dist-lib/core/interaction/client.d.ts +2 -1
- package/dist-lib/core/interaction/client.d.ts.map +1 -1
- package/dist-lib/core/interaction/index.d.ts +8 -0
- package/dist-lib/core/interaction/index.d.ts.map +1 -1
- package/dist-lib/core/interaction/response-snapshot.d.ts +13 -0
- package/dist-lib/core/interaction/response-snapshot.d.ts.map +1 -0
- package/dist-lib/core/interaction/schema.d.ts +7 -0
- package/dist-lib/core/interaction/schema.d.ts.map +1 -0
- package/dist-lib/core/interaction/store.d.ts.map +1 -1
- package/dist-lib/core/interaction/types.d.ts +5 -2
- package/dist-lib/core/interaction/types.d.ts.map +1 -1
- package/dist-lib/core/run/a2ui.d.ts +6 -1
- package/dist-lib/core/run/a2ui.d.ts.map +1 -1
- package/dist-lib/core/run/agui.d.ts +14 -0
- package/dist-lib/core/run/agui.d.ts.map +1 -1
- package/dist-lib/core/run/blocks.d.ts +5 -0
- package/dist-lib/core/run/blocks.d.ts.map +1 -1
- package/dist-lib/core/run/dispatcher.d.ts.map +1 -1
- package/dist-lib/core/run/engine.d.ts.map +1 -1
- package/dist-lib/core/run/types.d.ts +17 -0
- package/dist-lib/core/run/types.d.ts.map +1 -1
- package/dist-lib/core/stream/kernel-events.d.ts.map +1 -1
- package/dist-lib/core/stream/types.d.ts +3 -0
- package/dist-lib/core/stream/types.d.ts.map +1 -1
- package/dist-lib/core/teams/cloudContracts.d.ts +40 -40
- package/dist-lib/core/teams/cloudEffects.d.ts +8 -8
- package/dist-lib/core/teams/cloudExtendedContracts.d.ts +26 -26
- package/dist-lib/core/teams/cloudMaterials.d.ts +1 -1
- package/dist-lib/core/teams/contracts.d.ts +12 -12
- package/dist-lib/core/teams/workspaceContracts.d.ts +27 -27
- package/dist-lib/{feedback-CuC5jRi_.js → feedback-DRgW061h.js} +108 -86
- package/dist-lib/hooks/useAgentChat.d.ts +3 -3
- package/dist-lib/hooks/useAgentChat.d.ts.map +1 -1
- package/dist-lib/hooks/useInteractions.d.ts +3 -2
- package/dist-lib/hooks/useInteractions.d.ts.map +1 -1
- package/dist-lib/hooks/useRunAgent.d.ts +3 -1
- package/dist-lib/hooks/useRunAgent.d.ts.map +1 -1
- package/dist-lib/hooks/useSessionLifecycle.d.ts.map +1 -1
- package/dist-lib/hooks.js +21 -19
- package/dist-lib/{runtime-items-VPq7711E.js → json-value-DnHp0582.js} +22 -1
- package/dist-lib/{permission-B2MuVypC.js → permission-BT1f0PIC.js} +1 -1
- package/dist-lib/{persisted-session-history-CBk_ypXo.js → persisted-session-history-KtoKbLRA.js} +842 -587
- package/dist-lib/public/chat-timeline.d.ts +3 -0
- package/dist-lib/public/chat-timeline.d.ts.map +1 -1
- package/dist-lib/public/components.d.ts +3 -0
- package/dist-lib/public/components.d.ts.map +1 -1
- package/dist-lib/public/runtime.d.ts +3 -0
- package/dist-lib/public/runtime.d.ts.map +1 -1
- package/dist-lib/public/types.d.ts +1 -0
- package/dist-lib/public/types.d.ts.map +1 -1
- package/dist-lib/runtime.js +284 -279
- package/dist-lib/schema-fields-CUpDl1NB.js +41 -0
- package/dist-lib/styles.css +1 -1
- package/dist-lib/team-components.js +882 -750
- package/dist-lib/types/api.d.ts +2 -0
- package/dist-lib/types/api.d.ts.map +1 -1
- package/dist-lib/types/capabilities.d.ts +2 -0
- package/dist-lib/types/capabilities.d.ts.map +1 -1
- package/dist-lib/types/json-value.d.ts +6 -0
- package/dist-lib/types/json-value.d.ts.map +1 -0
- package/dist-lib/{useSessionLifecycle-DS3PPoWK.js → useSessionLifecycle-CUf3hB30.js} +1612 -1142
- package/dist-lib/utils/capabilities.d.ts.map +1 -1
- package/dist-lib/utils/history-tool-facts.d.ts +8 -0
- package/dist-lib/utils/history-tool-facts.d.ts.map +1 -0
- package/dist-lib/utils/interaction-history.d.ts +11 -0
- package/dist-lib/utils/interaction-history.d.ts.map +1 -0
- package/dist-lib/utils/kernel-run-history.d.ts +9 -0
- package/dist-lib/utils/kernel-run-history.d.ts.map +1 -0
- package/dist-lib/utils/messages.d.ts +1 -1
- package/dist-lib/utils/messages.d.ts.map +1 -1
- package/dist-lib/utils/persisted-session-history.d.ts.map +1 -1
- package/dist-lib/utils/recovered-run.d.ts.map +1 -1
- package/dist-lib/utils/responses-stream.d.ts.map +1 -1
- package/dist-lib/utils/run-progress.d.ts +11 -0
- package/dist-lib/utils/run-progress.d.ts.map +1 -0
- package/dist-lib/utils/session-events.d.ts.map +1 -1
- package/dist-lib/utils/transcript-order.d.ts.map +1 -1
- package/dist-lib/utils/workspace.d.ts +1 -1
- package/package.json +13 -4
- package/dist-ksadk/assets/NativeTerminalPanel-Cjjz8B30.js +0 -1
- package/dist-ksadk/assets/architecture-7GRP2DOG-pn_DuLy6.js +0 -1
- package/dist-ksadk/assets/channel-fySsnkft.js +0 -1
- package/dist-ksadk/assets/chunk-2Q5K7J3B-BheGxKRQ.js +0 -1
- package/dist-ksadk/assets/classDiagram-DTDB5LWJ-DSfLtNYm.js +0 -1
- package/dist-ksadk/assets/classDiagram-v2-JRS7N3AN-DSfLtNYm.js +0 -1
- package/dist-ksadk/assets/cynefin-OW5HDTMX-PFWIGtvA.js +0 -1
- package/dist-ksadk/assets/eventmodeling-NTZA5JFV-DsM4upQX.js +0 -1
- package/dist-ksadk/assets/flowDiagram-A5DVABFB-D5NA16k9.js +0 -1
- package/dist-ksadk/assets/gitGraph-4MIJSDKK-DUCVz-ih.js +0 -1
- package/dist-ksadk/assets/index-CZdkAvsv.js +0 -244
- package/dist-ksadk/assets/index-CvXdHgF3.css +0 -2
- package/dist-ksadk/assets/info-A6RAGUB7-rw0ZNHZp.js +0 -1
- package/dist-ksadk/assets/packet-AYTQ26CC-Ca4Hvki9.js +0 -1
- package/dist-ksadk/assets/pie-WAS4IAKB-hwiz6fbw.js +0 -1
- package/dist-ksadk/assets/radar-RG4KPBEZ-BR1oZXLM.js +0 -1
- package/dist-ksadk/assets/railroad-74A4TZTK-DfgEISfX.js +0 -1
- package/dist-ksadk/assets/railroad-abnf-HS5TGJTU-CWOC3rdk.js +0 -1
- package/dist-ksadk/assets/railroad-ebnf-LZEXJU2U-CiRvHCLY.js +0 -1
- package/dist-ksadk/assets/railroad-peg-WCYAUIDC-DSDDyJ2f.js +0 -1
- package/dist-ksadk/assets/stateDiagram-v2-4QOOHH4V-Cw1fPb5w.js +0 -1
- package/dist-ksadk/assets/swimlanesDiagram-VK2B7HYN-Cc3JMBAF.js +0 -8
- package/dist-ksadk/assets/treeView-Q6P3EWNA-C05SJHxo.js +0 -1
- package/dist-ksadk/assets/treemap-WGGIJYW6-BqNLAhc3.js +0 -1
- package/dist-ksadk/assets/wardley-WFR3VGLG-DokNktqB.js +0 -1
- package/dist-lib/AttachmentPreview-lufx89xJ.js +0 -535
- package/dist-lib/ConnectedMessageList-CzTOJbZU.js +0 -1433
- package/dist-lib/InteractionSchemaForm-ChYkHPop.js +0 -174
- package/dist-lib/a2ui-DfAshhMK.js +0 -507
|
@@ -0,0 +1,1547 @@
|
|
|
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";
|
|
14
|
+
//#region src/stores/ui.ts
|
|
15
|
+
function p(e, t) {
|
|
16
|
+
return typeof t == "function" ? t(e) : t;
|
|
17
|
+
}
|
|
18
|
+
var ie = i()((e) => ({
|
|
19
|
+
sidebarOpen: !0,
|
|
20
|
+
mobileSidebarOpen: !1,
|
|
21
|
+
mobileActionsOpen: !1,
|
|
22
|
+
workspacePanelOpen: !1,
|
|
23
|
+
workspacePanelWidth: 820,
|
|
24
|
+
workspacePanelFullscreen: !1,
|
|
25
|
+
input: "",
|
|
26
|
+
attachments: [],
|
|
27
|
+
previewAttachment: null,
|
|
28
|
+
previewImageSize: null,
|
|
29
|
+
queuedDrafts: [],
|
|
30
|
+
toasts: [],
|
|
31
|
+
toggleSidebar: () => e((e) => ({ sidebarOpen: !e.sidebarOpen })),
|
|
32
|
+
setSidebarOpen: (t) => e({ sidebarOpen: t }),
|
|
33
|
+
toggleMobileSidebar: () => e((e) => ({ mobileSidebarOpen: !e.mobileSidebarOpen })),
|
|
34
|
+
setMobileSidebarOpen: (t) => e({ mobileSidebarOpen: t }),
|
|
35
|
+
toggleMobileActions: () => e((e) => ({ mobileActionsOpen: !e.mobileActionsOpen })),
|
|
36
|
+
setMobileActionsOpen: (t) => e({ mobileActionsOpen: t }),
|
|
37
|
+
setWorkspacePanelOpen: (t) => e({ workspacePanelOpen: t }),
|
|
38
|
+
setWorkspacePanelWidth: (t) => e({ workspacePanelWidth: t }),
|
|
39
|
+
setWorkspacePanelFullscreen: (t) => e({ workspacePanelFullscreen: t }),
|
|
40
|
+
setInput: (t) => e({ input: t }),
|
|
41
|
+
setAttachments: (t) => e((e) => ({ attachments: p(e.attachments, t) })),
|
|
42
|
+
setPreviewAttachment: (t) => e({ previewAttachment: t }),
|
|
43
|
+
setPreviewImageSize: (t) => e({ previewImageSize: t }),
|
|
44
|
+
setQueuedDrafts: (t) => e((e) => ({ queuedDrafts: p(e.queuedDrafts, t) })),
|
|
45
|
+
pushToast: (t, n = "info") => e((e) => ({ toasts: [...e.toasts, {
|
|
46
|
+
id: String(Date.now() + Math.random()),
|
|
47
|
+
message: t,
|
|
48
|
+
variant: n,
|
|
49
|
+
createdAt: Date.now()
|
|
50
|
+
}] })),
|
|
51
|
+
dismissToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) }))
|
|
52
|
+
})), m = (e) => Object.keys(e).length > 0, h = {
|
|
53
|
+
runId: null,
|
|
54
|
+
status: null,
|
|
55
|
+
items: []
|
|
56
|
+
}, g = new e(), _ = (e, t) => {
|
|
57
|
+
let n = { ...e };
|
|
58
|
+
return delete n[t], n;
|
|
59
|
+
}, v = i()((t, n) => ({
|
|
60
|
+
isStreaming: !1,
|
|
61
|
+
currentRunId: "",
|
|
62
|
+
stopRequested: !1,
|
|
63
|
+
activity: null,
|
|
64
|
+
sessionActivities: {},
|
|
65
|
+
sessionStreaming: {},
|
|
66
|
+
banner: null,
|
|
67
|
+
lastSeqId: 0,
|
|
68
|
+
activeInvocationId: "",
|
|
69
|
+
runtimeItems: h,
|
|
70
|
+
setStreaming: (e) => t({ isStreaming: e }),
|
|
71
|
+
setBanner: (e) => t({ banner: e ? {
|
|
72
|
+
...e,
|
|
73
|
+
createdAt: Date.now()
|
|
74
|
+
} : 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 ? {
|
|
79
|
+
...i,
|
|
80
|
+
[r]: !0
|
|
81
|
+
} : i;
|
|
82
|
+
return {
|
|
83
|
+
sessionStreaming: a,
|
|
84
|
+
isStreaming: m(a)
|
|
85
|
+
};
|
|
86
|
+
}),
|
|
87
|
+
isSessionStreaming: (e) => {
|
|
88
|
+
let t = String(e || "");
|
|
89
|
+
return !!n().sessionStreaming[t];
|
|
90
|
+
},
|
|
91
|
+
getSessionActivity: (e) => {
|
|
92
|
+
let t = String(e || "");
|
|
93
|
+
return t && n().sessionActivities[t] || null;
|
|
94
|
+
},
|
|
95
|
+
setCurrentRunId: (e) => t({ currentRunId: e }),
|
|
96
|
+
requestStop: () => t({ stopRequested: !0 }),
|
|
97
|
+
beginActivity: (e) => t({
|
|
98
|
+
stopRequested: !1,
|
|
99
|
+
activity: {
|
|
100
|
+
runId: e.runId,
|
|
101
|
+
source: e.source || "run",
|
|
102
|
+
status: e.status || "running",
|
|
103
|
+
phase: e.phase,
|
|
104
|
+
detail: e.detail,
|
|
105
|
+
startedAt: Date.now(),
|
|
106
|
+
lastEventAt: Date.now(),
|
|
107
|
+
eventCount: 0
|
|
108
|
+
}
|
|
109
|
+
}),
|
|
110
|
+
updateActivity: (e) => t((t) => {
|
|
111
|
+
let n = String(e.sessionId || ""), r = n ? t.sessionActivities[n] : t.activity, i = r ? {
|
|
112
|
+
...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,
|
|
118
|
+
lastEventAt: Date.now(),
|
|
119
|
+
eventCount: r.eventCount + (e.countEvent === !1 ? 0 : 1)
|
|
120
|
+
} : {
|
|
121
|
+
runId: e.runId,
|
|
122
|
+
source: e.source || "run",
|
|
123
|
+
status: e.status || "running",
|
|
124
|
+
phase: e.phase || "正在运行",
|
|
125
|
+
detail: e.detail,
|
|
126
|
+
startedAt: Date.now(),
|
|
127
|
+
lastEventAt: Date.now(),
|
|
128
|
+
eventCount: e.countEvent === !1 ? 0 : 1
|
|
129
|
+
};
|
|
130
|
+
return n ? {
|
|
131
|
+
isStreaming: m(t.sessionStreaming),
|
|
132
|
+
sessionActivities: {
|
|
133
|
+
...t.sessionActivities,
|
|
134
|
+
[n]: i
|
|
135
|
+
},
|
|
136
|
+
...e.visible === !1 ? {} : { activity: i }
|
|
137
|
+
} : { ...e.visible === !1 ? {} : { activity: i } };
|
|
138
|
+
}),
|
|
139
|
+
stopActivity: (e) => t((t) => ({
|
|
140
|
+
isStreaming: !1,
|
|
141
|
+
stopRequested: !0,
|
|
142
|
+
activity: t.activity ? {
|
|
143
|
+
...t.activity,
|
|
144
|
+
status: "stopped",
|
|
145
|
+
phase: "已断开输出流",
|
|
146
|
+
detail: e || "前端已断开本次输出流;后台运行可稍后通过会话记录继续查看。",
|
|
147
|
+
lastEventAt: Date.now()
|
|
148
|
+
} : null
|
|
149
|
+
})),
|
|
150
|
+
stopSessionActivity: (e, n, r = !0) => t((t) => {
|
|
151
|
+
let i = String(e || "");
|
|
152
|
+
if (!i) return {};
|
|
153
|
+
let a = t.sessionActivities[i];
|
|
154
|
+
if (!a) return {};
|
|
155
|
+
let o = {
|
|
156
|
+
...a,
|
|
157
|
+
status: "stopped",
|
|
158
|
+
phase: "已断开输出流",
|
|
159
|
+
detail: n || "前端已断开本次输出流;后台运行可稍后通过会话记录继续查看。",
|
|
160
|
+
lastEventAt: Date.now()
|
|
161
|
+
}, s = {
|
|
162
|
+
...t.sessionActivities,
|
|
163
|
+
[i]: o
|
|
164
|
+
}, c = _(t.sessionStreaming, i);
|
|
165
|
+
return {
|
|
166
|
+
isStreaming: m(c),
|
|
167
|
+
...r ? {
|
|
168
|
+
activity: o,
|
|
169
|
+
stopRequested: !0
|
|
170
|
+
} : {},
|
|
171
|
+
sessionActivities: s,
|
|
172
|
+
sessionStreaming: c
|
|
173
|
+
};
|
|
174
|
+
}),
|
|
175
|
+
clearActivity: () => t({ activity: null }),
|
|
176
|
+
clearSessionActivity: (e) => t((t) => {
|
|
177
|
+
let n = String(e || "");
|
|
178
|
+
if (!n) return {};
|
|
179
|
+
let { [n]: r, ...i } = t.sessionActivities, a = _(t.sessionStreaming, n);
|
|
180
|
+
return {
|
|
181
|
+
sessionActivities: i,
|
|
182
|
+
sessionStreaming: a,
|
|
183
|
+
isStreaming: m(a),
|
|
184
|
+
activity: t.activity === r ? null : t.activity
|
|
185
|
+
};
|
|
186
|
+
}),
|
|
187
|
+
applyRuntimeItemOperations: (e) => {
|
|
188
|
+
g.applyAll(e), t({ runtimeItems: g.snapshot() });
|
|
189
|
+
},
|
|
190
|
+
resetRun: () => {
|
|
191
|
+
g = new e(), t({
|
|
192
|
+
isStreaming: !1,
|
|
193
|
+
currentRunId: "",
|
|
194
|
+
stopRequested: !1,
|
|
195
|
+
activity: null,
|
|
196
|
+
sessionActivities: {},
|
|
197
|
+
sessionStreaming: {},
|
|
198
|
+
lastSeqId: 0,
|
|
199
|
+
activeInvocationId: "",
|
|
200
|
+
runtimeItems: h
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}));
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region src/stores/model.ts
|
|
206
|
+
function ae(e, t) {
|
|
207
|
+
let n = /* @__PURE__ */ new Map();
|
|
208
|
+
for (let t of e) t?.id && n.set(t.id, t);
|
|
209
|
+
for (let e of t) e?.id && n.set(e.id, {
|
|
210
|
+
...n.get(e.id) || {},
|
|
211
|
+
...e
|
|
212
|
+
});
|
|
213
|
+
return Array.from(n.values()).sort((e, t) => e.id.localeCompare(t.id));
|
|
214
|
+
}
|
|
215
|
+
var y = i()((e) => ({
|
|
216
|
+
availableModels: [],
|
|
217
|
+
selectedModel: "",
|
|
218
|
+
modelSource: "",
|
|
219
|
+
modelCatalogLoaded: !1,
|
|
220
|
+
thinkingMode: "auto",
|
|
221
|
+
upsertModels: (t) => e((e) => ({ availableModels: ae(e.availableModels, t) })),
|
|
222
|
+
setSelectedModel: (t) => e({ selectedModel: t }),
|
|
223
|
+
setModelSource: (t) => e({ modelSource: t }),
|
|
224
|
+
setModelCatalogLoaded: (t) => e({ modelCatalogLoaded: t }),
|
|
225
|
+
setThinkingMode: (t) => e({ thinkingMode: t }),
|
|
226
|
+
resetCatalog: () => e({
|
|
227
|
+
availableModels: [],
|
|
228
|
+
selectedModel: "",
|
|
229
|
+
modelSource: "",
|
|
230
|
+
modelCatalogLoaded: !1
|
|
231
|
+
})
|
|
232
|
+
})), b = new class {
|
|
233
|
+
initialized = !1;
|
|
234
|
+
scope;
|
|
235
|
+
blocked = !1;
|
|
236
|
+
enter(e) {
|
|
237
|
+
if (e !== void 0 && !e.trim()) throw Error("authorizationScopeKey must be non-empty");
|
|
238
|
+
return this.blocked ? "reload" : this.initialized && this.scope !== e ? (this.blocked = !0, "reload") : (this.initialized = !0, this.scope = e, "ready");
|
|
239
|
+
}
|
|
240
|
+
matches(e) {
|
|
241
|
+
return this.initialized && !this.blocked && this.scope === e;
|
|
242
|
+
}
|
|
243
|
+
key(e) {
|
|
244
|
+
return this.scope === void 0 ? e : `ksadk:authorization:${encodeURIComponent(this.scope)}:${e}`;
|
|
245
|
+
}
|
|
246
|
+
get writable() {
|
|
247
|
+
return !this.blocked;
|
|
248
|
+
}
|
|
249
|
+
}();
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region src/utils/session-pagination.js
|
|
252
|
+
function x(e = /* @__PURE__ */ new Set(), t = []) {
|
|
253
|
+
let n = new Set(e);
|
|
254
|
+
for (let e of t) {
|
|
255
|
+
let t = Number(e);
|
|
256
|
+
Number.isFinite(t) && t > 0 && n.add(t);
|
|
257
|
+
}
|
|
258
|
+
return new Set(Array.from(n).sort((e, t) => e - t));
|
|
259
|
+
}
|
|
260
|
+
function S({ sessionsLength: e = 0, total: t = 0, page: n = 0, pageSize: r = 30, loadedPages: i = /* @__PURE__ */ new Set() } = {}) {
|
|
261
|
+
let a = Math.max(0, Number(t) || 0), o = Math.max(0, Number(e) || 0);
|
|
262
|
+
return {
|
|
263
|
+
total: a,
|
|
264
|
+
page: Math.max(0, Number(n) || 0),
|
|
265
|
+
pageSize: Math.max(1, Number(r) || 30),
|
|
266
|
+
loadedPages: x(i),
|
|
267
|
+
hasMore: o < a
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
function C({ total: e = 0, pageSize: t = 30, loadedPages: n = /* @__PURE__ */ new Set() } = {}) {
|
|
271
|
+
let r = Math.max(0, Number(e) || 0), i = Math.max(1, Number(t) || 30);
|
|
272
|
+
if (r <= 0) return null;
|
|
273
|
+
let a = Math.ceil(r / i);
|
|
274
|
+
for (let e = 1; e <= a; e += 1) if (!n.has(e)) return e;
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
//#endregion
|
|
278
|
+
//#region src/stores/session.ts
|
|
279
|
+
function w(e) {
|
|
280
|
+
let t = e.UpdatedAt;
|
|
281
|
+
if (typeof t == "string") {
|
|
282
|
+
let e = Date.parse(t);
|
|
283
|
+
return Number.isNaN(e) ? 0 : e;
|
|
284
|
+
}
|
|
285
|
+
return typeof t == "number" && Number.isFinite(t) ? t > 1e11 ? t : t * 1e3 : 0;
|
|
286
|
+
}
|
|
287
|
+
var T = "ksadk.pinnedSessionIds";
|
|
288
|
+
function E() {
|
|
289
|
+
try {
|
|
290
|
+
let e = globalThis.localStorage?.getItem(b.key(T)), t = e ? JSON.parse(e) : [];
|
|
291
|
+
return Array.isArray(t) ? t.filter((e) => typeof e == "string") : [];
|
|
292
|
+
} catch {
|
|
293
|
+
return [];
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
function oe(e) {
|
|
297
|
+
if (b.writable) try {
|
|
298
|
+
globalThis.localStorage?.setItem(b.key(T), JSON.stringify(e));
|
|
299
|
+
} catch {}
|
|
300
|
+
}
|
|
301
|
+
function D(e, t) {
|
|
302
|
+
let n = new Set(t);
|
|
303
|
+
return e.slice().sort((e, t) => {
|
|
304
|
+
let r = +!!n.has(e.SessionId), i = +!!n.has(t.SessionId);
|
|
305
|
+
return r === i ? w(t) - w(e) : i - r;
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
function se(e, t, n) {
|
|
309
|
+
let r = /* @__PURE__ */ new Map();
|
|
310
|
+
for (let t of e) t?.SessionId && r.set(t.SessionId, t);
|
|
311
|
+
for (let e of t) e?.SessionId && r.set(e.SessionId, {
|
|
312
|
+
...r.get(e.SessionId) || {},
|
|
313
|
+
...e
|
|
314
|
+
});
|
|
315
|
+
return D(Array.from(r.values()), n);
|
|
316
|
+
}
|
|
317
|
+
var ce = i()((e) => ({
|
|
318
|
+
sessions: [],
|
|
319
|
+
currentSessionId: null,
|
|
320
|
+
sessionsAgentId: "",
|
|
321
|
+
sessionsGeneration: 0,
|
|
322
|
+
sessionsTotal: 0,
|
|
323
|
+
sessionsPage: 0,
|
|
324
|
+
sessionsPageSize: 30,
|
|
325
|
+
loadedPages: /* @__PURE__ */ new Set(),
|
|
326
|
+
hasMoreSessions: !1,
|
|
327
|
+
isLoadingSessions: !0,
|
|
328
|
+
pinnedSessionIds: E(),
|
|
329
|
+
messageHistory: {},
|
|
330
|
+
setSessions: (t) => e((e) => ({ sessions: D(t, e.pinnedSessionIds) })),
|
|
331
|
+
setCurrentSessionId: (t) => e({ currentSessionId: t }),
|
|
332
|
+
upsertSessions: (t, n) => e((e) => {
|
|
333
|
+
let r = se(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({
|
|
334
|
+
sessionsLength: r.length,
|
|
335
|
+
total: o,
|
|
336
|
+
page: i,
|
|
337
|
+
pageSize: a,
|
|
338
|
+
loadedPages: s
|
|
339
|
+
});
|
|
340
|
+
return {
|
|
341
|
+
sessions: r,
|
|
342
|
+
sessionsAgentId: n?.agentId ?? e.sessionsAgentId,
|
|
343
|
+
sessionsTotal: c.total,
|
|
344
|
+
sessionsPage: c.page,
|
|
345
|
+
sessionsPageSize: c.pageSize,
|
|
346
|
+
loadedPages: c.loadedPages,
|
|
347
|
+
hasMoreSessions: c.hasMore
|
|
348
|
+
};
|
|
349
|
+
}),
|
|
350
|
+
removeSession: (t) => e((e) => {
|
|
351
|
+
let n = e.sessions.filter((e) => e.SessionId !== t), r = Math.max(0, e.sessionsTotal - 1);
|
|
352
|
+
return {
|
|
353
|
+
sessions: n,
|
|
354
|
+
sessionsTotal: r,
|
|
355
|
+
hasMoreSessions: S({
|
|
356
|
+
sessionsLength: n.length,
|
|
357
|
+
total: r,
|
|
358
|
+
page: e.sessionsPage,
|
|
359
|
+
pageSize: e.sessionsPageSize,
|
|
360
|
+
loadedPages: e.loadedPages
|
|
361
|
+
}).hasMore,
|
|
362
|
+
pinnedSessionIds: e.pinnedSessionIds.filter((e) => e !== t)
|
|
363
|
+
};
|
|
364
|
+
}),
|
|
365
|
+
setLoadingSessions: (t) => e({ isLoadingSessions: t }),
|
|
366
|
+
resetSessionPagination: (t) => e((e) => ({
|
|
367
|
+
sessionsGeneration: e.sessionsGeneration + 1,
|
|
368
|
+
sessions: [],
|
|
369
|
+
sessionsAgentId: t,
|
|
370
|
+
sessionsTotal: 0,
|
|
371
|
+
sessionsPage: 0,
|
|
372
|
+
loadedPages: /* @__PURE__ */ new Set(),
|
|
373
|
+
hasMoreSessions: !1,
|
|
374
|
+
isLoadingSessions: !1
|
|
375
|
+
})),
|
|
376
|
+
togglePinnedSession: (t) => e((e) => {
|
|
377
|
+
let n = new Set(e.pinnedSessionIds);
|
|
378
|
+
n.has(t) ? n.delete(t) : n.add(t);
|
|
379
|
+
let r = Array.from(n);
|
|
380
|
+
return oe(r), {
|
|
381
|
+
pinnedSessionIds: r,
|
|
382
|
+
sessions: D(e.sessions, r)
|
|
383
|
+
};
|
|
384
|
+
}),
|
|
385
|
+
setSessionMessageHistory: (t, n) => e((e) => ({ messageHistory: {
|
|
386
|
+
...e.messageHistory,
|
|
387
|
+
[t]: {
|
|
388
|
+
...e.messageHistory[t],
|
|
389
|
+
...n,
|
|
390
|
+
nextCursor: n.nextCursor,
|
|
391
|
+
hasMore: n.hasMore,
|
|
392
|
+
isLoadingInitial: !1,
|
|
393
|
+
isLoadingOlder: n.isLoadingOlder ?? !1
|
|
394
|
+
}
|
|
395
|
+
} })),
|
|
396
|
+
setSessionInitialMessageHistoryLoading: (t, n) => e((e) => {
|
|
397
|
+
let r = e.messageHistory[t];
|
|
398
|
+
return { messageHistory: {
|
|
399
|
+
...e.messageHistory,
|
|
400
|
+
[t]: {
|
|
401
|
+
...r,
|
|
402
|
+
nextCursor: r?.nextCursor ?? null,
|
|
403
|
+
hasMore: r?.hasMore ?? !1,
|
|
404
|
+
isLoadingInitial: n,
|
|
405
|
+
isLoadingOlder: r?.isLoadingOlder ?? !1
|
|
406
|
+
}
|
|
407
|
+
} };
|
|
408
|
+
}),
|
|
409
|
+
setSessionMessageHistoryLoading: (t, n) => e((e) => {
|
|
410
|
+
let r = e.messageHistory[t];
|
|
411
|
+
return r ? { messageHistory: {
|
|
412
|
+
...e.messageHistory,
|
|
413
|
+
[t]: {
|
|
414
|
+
...r,
|
|
415
|
+
isLoadingOlder: n
|
|
416
|
+
}
|
|
417
|
+
} } : {};
|
|
418
|
+
}),
|
|
419
|
+
clearSessionMessageHistory: (t) => e((e) => {
|
|
420
|
+
if (!t) return { messageHistory: {} };
|
|
421
|
+
let n = { ...e.messageHistory };
|
|
422
|
+
return delete n[t], { messageHistory: n };
|
|
423
|
+
})
|
|
424
|
+
})), O = {
|
|
425
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
426
|
+
$id: "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json",
|
|
427
|
+
title: "A2UI Basic Catalog",
|
|
428
|
+
description: "Unified catalog of basic A2UI components and functions.",
|
|
429
|
+
catalogId: "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json",
|
|
430
|
+
components: /* @__PURE__ */ JSON.parse("{\"Text\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"type\":\"object\",\"properties\":{\"component\":{\"const\":\"Text\"},\"text\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"The text content to display. While simple Markdown formatting is supported (i.e. without HTML, images, or links), utilizing dedicated UI components is generally preferred for a richer and more structured presentation.\"},\"variant\":{\"type\":\"string\",\"description\":\"A hint for the base text style.\",\"enum\":[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"caption\",\"body\"],\"default\":\"body\"}},\"required\":[\"component\",\"text\"]}],\"unevaluatedProperties\":false},\"Image\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"type\":\"object\",\"properties\":{\"component\":{\"const\":\"Image\"},\"url\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"The URL of the image to display.\"},\"description\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"Accessibility text for the image.\"},\"fit\":{\"type\":\"string\",\"description\":\"Specifies how the image should be resized to fit its container. This corresponds to the CSS 'object-fit' property.\",\"enum\":[\"contain\",\"cover\",\"fill\",\"none\",\"scaleDown\"],\"default\":\"fill\"},\"variant\":{\"type\":\"string\",\"description\":\"A hint for the image size and style.\",\"enum\":[\"icon\",\"avatar\",\"smallFeature\",\"mediumFeature\",\"largeFeature\",\"header\"],\"default\":\"mediumFeature\"}},\"required\":[\"component\",\"url\"]}],\"unevaluatedProperties\":false},\"Icon\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"type\":\"object\",\"properties\":{\"component\":{\"const\":\"Icon\"},\"name\":{\"description\":\"The name of the icon to display.\",\"oneOf\":[{\"type\":\"string\",\"enum\":[\"accountCircle\",\"add\",\"arrowBack\",\"arrowForward\",\"attachFile\",\"calendarToday\",\"call\",\"camera\",\"check\",\"close\",\"delete\",\"download\",\"edit\",\"event\",\"error\",\"fastForward\",\"favorite\",\"favoriteOff\",\"folder\",\"help\",\"home\",\"info\",\"locationOn\",\"lock\",\"lockOpen\",\"mail\",\"menu\",\"moreVert\",\"moreHoriz\",\"notificationsOff\",\"notifications\",\"pause\",\"payment\",\"person\",\"phone\",\"photo\",\"play\",\"print\",\"refresh\",\"rewind\",\"search\",\"send\",\"settings\",\"share\",\"shoppingCart\",\"skipNext\",\"skipPrevious\",\"star\",\"starHalf\",\"starOff\",\"stop\",\"upload\",\"visibility\",\"visibilityOff\",\"volumeDown\",\"volumeMute\",\"volumeOff\",\"volumeUp\",\"warning\"]},{\"type\":\"object\",\"properties\":{\"svgPath\":{\"type\":\"string\"}},\"required\":[\"svgPath\"],\"additionalProperties\":false},{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DataBinding\"}]}},\"required\":[\"component\",\"name\"]}],\"unevaluatedProperties\":false},\"Video\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"type\":\"object\",\"properties\":{\"component\":{\"const\":\"Video\"},\"url\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"The URL of the video to display.\"}},\"required\":[\"component\",\"url\"]}],\"unevaluatedProperties\":false},\"AudioPlayer\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"type\":\"object\",\"properties\":{\"component\":{\"const\":\"AudioPlayer\"},\"url\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"The URL of the audio to be played.\"},\"description\":{\"description\":\"A description of the audio, such as a title or summary.\",\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\"}},\"required\":[\"component\",\"url\"]}],\"unevaluatedProperties\":false},\"Row\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"type\":\"object\",\"description\":\"A layout component that arranges its children horizontally. To create a grid layout, nest Columns within this Row.\",\"properties\":{\"component\":{\"const\":\"Row\"},\"children\":{\"description\":\"Defines the children. Use an array of strings for a fixed set of children, or a template object to generate children from a data list. Children cannot be defined inline, they must be referred to by ID.\",\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ChildList\"},\"justify\":{\"type\":\"string\",\"description\":\"Defines the arrangement of children along the main axis (horizontally). Use 'spaceBetween' to push items to the edges, or 'start'/'end'/'center' to pack them together.\",\"enum\":[\"center\",\"end\",\"spaceAround\",\"spaceBetween\",\"spaceEvenly\",\"start\",\"stretch\"],\"default\":\"start\"},\"align\":{\"type\":\"string\",\"description\":\"Defines the alignment of children along the cross axis (vertically). This is similar to the CSS 'align-items' property, but uses camelCase values (e.g., 'start').\",\"enum\":[\"start\",\"center\",\"end\",\"stretch\"],\"default\":\"stretch\"}},\"required\":[\"component\",\"children\"]}],\"unevaluatedProperties\":false},\"Column\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"type\":\"object\",\"description\":\"A layout component that arranges its children vertically. To create a grid layout, nest Rows within this Column.\",\"properties\":{\"component\":{\"const\":\"Column\"},\"children\":{\"description\":\"Defines the children. Use an array of strings for a fixed set of children, or a template object to generate children from a data list. Children cannot be defined inline, they must be referred to by ID.\",\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ChildList\"},\"justify\":{\"type\":\"string\",\"description\":\"Defines the arrangement of children along the main axis (vertically). Use 'spaceBetween' to push items to the edges (e.g. header at top, footer at bottom), or 'start'/'end'/'center' to pack them together.\",\"enum\":[\"start\",\"center\",\"end\",\"spaceBetween\",\"spaceAround\",\"spaceEvenly\",\"stretch\"],\"default\":\"start\"},\"align\":{\"type\":\"string\",\"description\":\"Defines the alignment of children along the cross axis (horizontally). This is similar to the CSS 'align-items' property.\",\"enum\":[\"center\",\"end\",\"start\",\"stretch\"],\"default\":\"stretch\"}},\"required\":[\"component\",\"children\"]}],\"unevaluatedProperties\":false},\"List\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"type\":\"object\",\"properties\":{\"component\":{\"const\":\"List\"},\"children\":{\"description\":\"Defines the children. Use an array of strings for a fixed set of children, or a template object to generate children from a data list.\",\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ChildList\"},\"direction\":{\"type\":\"string\",\"description\":\"The direction in which the list items are laid out.\",\"enum\":[\"vertical\",\"horizontal\"],\"default\":\"vertical\"},\"align\":{\"type\":\"string\",\"description\":\"Defines the alignment of children along the cross axis.\",\"enum\":[\"start\",\"center\",\"end\",\"stretch\"],\"default\":\"stretch\"}},\"required\":[\"component\",\"children\"]}],\"unevaluatedProperties\":false},\"Card\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"type\":\"object\",\"properties\":{\"component\":{\"const\":\"Card\"},\"child\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentId\",\"description\":\"The ID of the single child component to be rendered inside the card. To display multiple elements, you MUST wrap them in a layout component (like Column or Row) and pass that container's ID here. Do NOT pass multiple IDs or a non-existent ID.\"}},\"required\":[\"component\",\"child\"]}],\"unevaluatedProperties\":false},\"Tabs\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"type\":\"object\",\"properties\":{\"component\":{\"const\":\"Tabs\"},\"tabs\":{\"type\":\"array\",\"description\":\"An array of objects, where each object defines a tab with a title and a child component.\",\"minItems\":1,\"items\":{\"type\":\"object\",\"properties\":{\"title\":{\"description\":\"The tab title.\",\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\"},\"child\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentId\",\"description\":\"The ID of the child component.\"}},\"required\":[\"title\",\"child\"],\"additionalProperties\":false}}},\"required\":[\"component\",\"tabs\"]}],\"unevaluatedProperties\":false},\"Modal\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"type\":\"object\",\"properties\":{\"component\":{\"const\":\"Modal\"},\"trigger\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentId\",\"description\":\"The ID of the component that opens the modal when interacted with (e.g., a button).\"},\"content\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentId\",\"description\":\"The ID of the component to be displayed inside the modal.\"}},\"required\":[\"component\",\"trigger\",\"content\"]}],\"unevaluatedProperties\":false},\"Divider\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"type\":\"object\",\"properties\":{\"component\":{\"const\":\"Divider\"},\"axis\":{\"type\":\"string\",\"description\":\"The orientation of the divider.\",\"enum\":[\"horizontal\",\"vertical\"],\"default\":\"horizontal\"}},\"required\":[\"component\"]}],\"unevaluatedProperties\":false},\"Button\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/Checkable\"},{\"type\":\"object\",\"properties\":{\"component\":{\"const\":\"Button\"},\"child\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentId\",\"description\":\"The ID of the child component. Use a 'Text' component for a labeled button. Only use an 'Icon' if the requirements explicitly ask for an icon-only button.\"},\"variant\":{\"type\":\"string\",\"description\":\"A hint for the button style. If omitted, a default button style is used. 'primary' indicates this is the main call-to-action button. 'borderless' means the button has no visual border or background, making its child content appear like a clickable link.\",\"enum\":[\"default\",\"primary\",\"borderless\"],\"default\":\"default\"},\"action\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/Action\"}},\"required\":[\"component\",\"child\",\"action\"]}],\"unevaluatedProperties\":false},\"TextField\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/Checkable\"},{\"type\":\"object\",\"properties\":{\"component\":{\"const\":\"TextField\"},\"label\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"The text label for the input field.\"},\"value\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"The value of the text field.\"},\"variant\":{\"type\":\"string\",\"description\":\"The type of input field to display.\",\"enum\":[\"longText\",\"number\",\"shortText\",\"obscured\"],\"default\":\"shortText\"},\"validationRegexp\":{\"type\":\"string\",\"description\":\"A regular expression used for client-side validation of the input.\"}},\"required\":[\"component\",\"label\"]}],\"unevaluatedProperties\":false},\"CheckBox\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/Checkable\"},{\"type\":\"object\",\"properties\":{\"component\":{\"const\":\"CheckBox\"},\"label\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"The text to display next to the checkbox.\"},\"value\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicBoolean\",\"description\":\"The current state of the checkbox (true for checked, false for unchecked).\"}},\"required\":[\"component\",\"label\",\"value\"]}],\"unevaluatedProperties\":false},\"ChoicePicker\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/Checkable\"},{\"type\":\"object\",\"description\":\"A component that allows selecting one or more options from a list.\",\"properties\":{\"component\":{\"const\":\"ChoicePicker\"},\"label\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"The label for the group of options.\"},\"variant\":{\"type\":\"string\",\"description\":\"A hint for how the choice picker should be displayed and behave.\",\"enum\":[\"multipleSelection\",\"mutuallyExclusive\"],\"default\":\"mutuallyExclusive\"},\"options\":{\"type\":\"array\",\"description\":\"The list of available options to choose from.\",\"items\":{\"type\":\"object\",\"properties\":{\"label\":{\"description\":\"The text to display for this option.\",\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\"},\"value\":{\"type\":\"string\",\"description\":\"The stable value associated with this option.\"}},\"required\":[\"label\",\"value\"],\"additionalProperties\":false}},\"value\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicStringList\",\"description\":\"The list of currently selected values. This should be bound to a string array in the data model.\"},\"displayStyle\":{\"type\":\"string\",\"description\":\"The display style of the component.\",\"enum\":[\"checkbox\",\"chips\"],\"default\":\"checkbox\"},\"filterable\":{\"type\":\"boolean\",\"description\":\"If true, displays a search input to filter the options.\",\"default\":false}},\"required\":[\"component\",\"options\",\"value\"]}],\"unevaluatedProperties\":false},\"Slider\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/Checkable\"},{\"type\":\"object\",\"properties\":{\"component\":{\"const\":\"Slider\"},\"label\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"The label for the slider.\"},\"min\":{\"type\":\"number\",\"description\":\"The minimum value of the slider.\",\"default\":0},\"max\":{\"type\":\"number\",\"description\":\"The maximum value of the slider.\"},\"value\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicNumber\",\"description\":\"The current value of the slider.\"}},\"required\":[\"component\",\"value\",\"max\"]}],\"unevaluatedProperties\":false},\"DateTimeInput\":{\"type\":\"object\",\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/ComponentCommon\"},{\"$ref\":\"#/$defs/CatalogComponentCommon\"},{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/Checkable\"},{\"type\":\"object\",\"properties\":{\"component\":{\"const\":\"DateTimeInput\"},\"value\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"The selected date and/or time value in ISO 8601 format. If not yet set, initialize with an empty string.\"},\"enableDate\":{\"type\":\"boolean\",\"description\":\"If true, allows the user to select a date.\",\"default\":false},\"enableTime\":{\"type\":\"boolean\",\"description\":\"If true, allows the user to select a time.\",\"default\":false},\"min\":{\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\"},{\"if\":{\"type\":\"string\"},\"then\":{\"oneOf\":[{\"format\":\"date\"},{\"format\":\"time\"},{\"format\":\"date-time\"}]}}],\"description\":\"The minimum allowed date/time in ISO 8601 format.\"},\"max\":{\"allOf\":[{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\"},{\"if\":{\"type\":\"string\"},\"then\":{\"oneOf\":[{\"format\":\"date\"},{\"format\":\"time\"},{\"format\":\"date-time\"}]}}],\"description\":\"The maximum allowed date/time in ISO 8601 format.\"},\"label\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"The text label for the input field.\"}},\"required\":[\"component\",\"value\"]}],\"unevaluatedProperties\":false}}"),
|
|
431
|
+
functions: /* @__PURE__ */ JSON.parse("{\"required\":{\"type\":\"object\",\"description\":\"Checks that the value is not null, undefined, or empty.\",\"properties\":{\"call\":{\"const\":\"required\"},\"args\":{\"type\":\"object\",\"properties\":{\"value\":{\"description\":\"The value to check.\"}},\"required\":[\"value\"],\"additionalProperties\":false},\"returnType\":{\"const\":\"boolean\"}},\"required\":[\"call\",\"args\"],\"unevaluatedProperties\":false},\"regex\":{\"type\":\"object\",\"description\":\"Checks that the value matches a regular expression string.\",\"properties\":{\"call\":{\"const\":\"regex\"},\"args\":{\"type\":\"object\",\"properties\":{\"value\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\"},\"pattern\":{\"type\":\"string\",\"description\":\"The regex pattern to match against.\"}},\"required\":[\"value\",\"pattern\"],\"unevaluatedProperties\":false},\"returnType\":{\"const\":\"boolean\"}},\"required\":[\"call\",\"args\"],\"unevaluatedProperties\":false},\"length\":{\"type\":\"object\",\"description\":\"Checks string length constraints.\",\"properties\":{\"call\":{\"const\":\"length\"},\"args\":{\"type\":\"object\",\"properties\":{\"value\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\"},\"min\":{\"type\":\"integer\",\"minimum\":0,\"description\":\"The minimum allowed length.\"},\"max\":{\"type\":\"integer\",\"minimum\":0,\"description\":\"The maximum allowed length.\"}},\"required\":[\"value\"],\"anyOf\":[{\"required\":[\"min\"]},{\"required\":[\"max\"]}],\"unevaluatedProperties\":false},\"returnType\":{\"const\":\"boolean\"}},\"required\":[\"call\",\"args\"],\"unevaluatedProperties\":false},\"numeric\":{\"type\":\"object\",\"description\":\"Checks numeric range constraints.\",\"properties\":{\"call\":{\"const\":\"numeric\"},\"args\":{\"type\":\"object\",\"properties\":{\"value\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicNumber\"},\"min\":{\"type\":\"number\",\"description\":\"The minimum allowed value.\"},\"max\":{\"type\":\"number\",\"description\":\"The maximum allowed value.\"}},\"required\":[\"value\"],\"anyOf\":[{\"required\":[\"min\"]},{\"required\":[\"max\"]}],\"unevaluatedProperties\":false},\"returnType\":{\"const\":\"boolean\"}},\"required\":[\"call\",\"args\"],\"unevaluatedProperties\":false},\"email\":{\"type\":\"object\",\"description\":\"Checks that the value is a valid email address.\",\"properties\":{\"call\":{\"const\":\"email\"},\"args\":{\"type\":\"object\",\"properties\":{\"value\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\"}},\"required\":[\"value\"],\"unevaluatedProperties\":false},\"returnType\":{\"const\":\"boolean\"}},\"required\":[\"call\",\"args\"],\"unevaluatedProperties\":false},\"formatString\":{\"type\":\"object\",\"description\":\"Performs string interpolation of data model values and other functions in the catalog functions list and returns the resulting string. The value string can contain interpolated expressions in the `${expression}` format. Supported expression types include: JSON Pointer paths to the data model (e.g., `${/absolute/path}` or `${relative/path}`), and client-side function calls (e.g., `${now()}`). Function arguments must be named (e.g., `${formatDate(value:${/currentDate}, format:'MM-dd')}`). To include a literal `${` sequence, escape it as `\\\\${`.\",\"properties\":{\"call\":{\"const\":\"formatString\"},\"args\":{\"type\":\"object\",\"properties\":{\"value\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\"}},\"required\":[\"value\"],\"unevaluatedProperties\":false},\"returnType\":{\"const\":\"string\"}},\"required\":[\"call\",\"args\"],\"unevaluatedProperties\":false},\"formatNumber\":{\"type\":\"object\",\"description\":\"Formats a number with the specified grouping and decimal precision.\",\"properties\":{\"call\":{\"const\":\"formatNumber\"},\"args\":{\"type\":\"object\",\"properties\":{\"value\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicNumber\",\"description\":\"The number to format.\"},\"decimals\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicNumber\",\"description\":\"Optional. The number of decimal places to show. Defaults to 0 or 2 depending on locale.\"},\"grouping\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicBoolean\",\"description\":\"Optional. If true, uses locale-specific grouping separators (e.g. '1,000'). If false, returns raw digits (e.g. '1000'). Defaults to true.\"}},\"required\":[\"value\"],\"unevaluatedProperties\":false},\"returnType\":{\"const\":\"string\"}},\"required\":[\"call\",\"args\"],\"unevaluatedProperties\":false},\"formatCurrency\":{\"type\":\"object\",\"description\":\"Formats a number as a currency string.\",\"properties\":{\"call\":{\"const\":\"formatCurrency\"},\"args\":{\"type\":\"object\",\"properties\":{\"value\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicNumber\",\"description\":\"The monetary amount.\"},\"currency\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"The ISO 4217 currency code (e.g., 'USD', 'EUR').\"},\"decimals\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicNumber\",\"description\":\"Optional. The number of decimal places to show. Defaults to 0 or 2 depending on locale.\"},\"grouping\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicBoolean\",\"description\":\"Optional. If true, uses locale-specific grouping separators (e.g. '1,000'). If false, returns raw digits (e.g. '1000'). Defaults to true.\"}},\"required\":[\"currency\",\"value\"],\"unevaluatedProperties\":false},\"returnType\":{\"const\":\"string\"}},\"required\":[\"call\",\"args\"],\"unevaluatedProperties\":false},\"formatDate\":{\"type\":\"object\",\"description\":\"Formats a timestamp into a string using a pattern.\",\"properties\":{\"call\":{\"const\":\"formatDate\"},\"args\":{\"type\":\"object\",\"properties\":{\"value\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicValue\",\"description\":\"The date to format.\"},\"format\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"A Unicode TR35 date pattern string.\\n\\nToken Reference:\\n- Year: 'yy' (26), 'yyyy' (2026)\\n- Month: 'M' (1), 'MM' (01), 'MMM' (Jan), 'MMMM' (January)\\n- Day: 'd' (1), 'dd' (01), 'E' (Tue), 'EEEE' (Tuesday)\\n- Hour (12h): 'h' (1-12), 'hh' (01-12) - requires 'a' for AM/PM\\n- Hour (24h): 'H' (0-23), 'HH' (00-23) - Military Time\\n- Minute: 'mm' (00-59)\\n- Second: 'ss' (00-59)\\n- Period: 'a' (AM/PM)\\n\\nExamples:\\n- 'MMM dd, yyyy' -> 'Jan 16, 2026'\\n- 'HH:mm' -> '14:30' (Military)\\n- 'h:mm a' -> '2:30 PM'\\n- 'EEEE, d MMMM' -> 'Friday, 16 January'\"}},\"required\":[\"format\",\"value\"],\"unevaluatedProperties\":false},\"returnType\":{\"const\":\"string\"}},\"required\":[\"call\",\"args\"],\"unevaluatedProperties\":false},\"pluralize\":{\"type\":\"object\",\"description\":\"Returns a localized string based on the Common Locale Data Repository (CLDR) plural category of the count (zero, one, two, few, many, other). Requires an 'other' fallback. For English, just use 'one' and 'other'.\",\"properties\":{\"call\":{\"const\":\"pluralize\"},\"args\":{\"type\":\"object\",\"properties\":{\"value\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicNumber\",\"description\":\"The numeric value used to determine the plural category.\"},\"zero\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"String for the 'zero' category (e.g., 0 items).\"},\"one\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"String for the 'one' category (e.g., 1 item).\"},\"two\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"String for the 'two' category (used in Arabic, Welsh, etc.).\"},\"few\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"String for the 'few' category (e.g., small groups in Slavic languages).\"},\"many\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"String for the 'many' category (e.g., large groups in various languages).\"},\"other\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicString\",\"description\":\"The default/fallback string (used for general plural cases).\"}},\"required\":[\"value\",\"other\"],\"unevaluatedProperties\":false},\"returnType\":{\"const\":\"string\"}},\"required\":[\"call\",\"args\"],\"unevaluatedProperties\":false},\"openUrl\":{\"type\":\"object\",\"description\":\"Opens the specified URL in a browser or handler. This function has no return value.\",\"properties\":{\"call\":{\"const\":\"openUrl\"},\"args\":{\"type\":\"object\",\"properties\":{\"url\":{\"type\":\"string\",\"format\":\"uri\",\"description\":\"The URL to open.\"}},\"required\":[\"url\"],\"additionalProperties\":false},\"returnType\":{\"const\":\"void\"}},\"required\":[\"call\",\"args\"],\"unevaluatedProperties\":false},\"and\":{\"type\":\"object\",\"description\":\"Performs a logical AND operation on a list of boolean values.\",\"properties\":{\"call\":{\"const\":\"and\"},\"args\":{\"type\":\"object\",\"properties\":{\"values\":{\"type\":\"array\",\"description\":\"The list of boolean values to evaluate.\",\"items\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicBoolean\"},\"minItems\":2}},\"required\":[\"values\"],\"unevaluatedProperties\":false},\"returnType\":{\"const\":\"boolean\"}},\"required\":[\"call\",\"args\"],\"unevaluatedProperties\":false},\"or\":{\"type\":\"object\",\"description\":\"Performs a logical OR operation on a list of boolean values.\",\"properties\":{\"call\":{\"const\":\"or\"},\"args\":{\"type\":\"object\",\"properties\":{\"values\":{\"type\":\"array\",\"description\":\"The list of boolean values to evaluate.\",\"items\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicBoolean\"},\"minItems\":2}},\"required\":[\"values\"],\"unevaluatedProperties\":false},\"returnType\":{\"const\":\"boolean\"}},\"required\":[\"call\",\"args\"],\"unevaluatedProperties\":false},\"not\":{\"type\":\"object\",\"description\":\"Performs a logical NOT operation on a boolean value.\",\"properties\":{\"call\":{\"const\":\"not\"},\"args\":{\"type\":\"object\",\"properties\":{\"value\":{\"$ref\":\"https://a2ui.org/specification/v0_9/common_types.json#/$defs/DynamicBoolean\",\"description\":\"The boolean value to negate.\"}},\"required\":[\"value\"],\"unevaluatedProperties\":false},\"returnType\":{\"const\":\"boolean\"}},\"required\":[\"call\",\"args\"],\"unevaluatedProperties\":false}}"),
|
|
432
|
+
$defs: {
|
|
433
|
+
CatalogComponentCommon: {
|
|
434
|
+
type: "object",
|
|
435
|
+
properties: { weight: {
|
|
436
|
+
type: "number",
|
|
437
|
+
description: "The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column."
|
|
438
|
+
} }
|
|
439
|
+
},
|
|
440
|
+
theme: {
|
|
441
|
+
type: "object",
|
|
442
|
+
properties: {
|
|
443
|
+
primaryColor: {
|
|
444
|
+
type: "string",
|
|
445
|
+
description: "The primary brand color used for highlights (e.g., primary buttons, active borders). Renderers may generate variants of this color for different contexts. Format: Hexadecimal code (e.g., '#00BFFF').",
|
|
446
|
+
pattern: "^#[0-9a-fA-F]{6}$"
|
|
447
|
+
},
|
|
448
|
+
iconUrl: {
|
|
449
|
+
type: "string",
|
|
450
|
+
format: "uri",
|
|
451
|
+
description: "A URL for an image that identifies the agent or tool associated with the surface."
|
|
452
|
+
},
|
|
453
|
+
agentDisplayName: {
|
|
454
|
+
type: "string",
|
|
455
|
+
description: "Text to be displayed next to the surface to identify the agent or tool that created it."
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
additionalProperties: !0
|
|
459
|
+
},
|
|
460
|
+
anyComponent: {
|
|
461
|
+
oneOf: [
|
|
462
|
+
{ $ref: "#/components/Text" },
|
|
463
|
+
{ $ref: "#/components/Image" },
|
|
464
|
+
{ $ref: "#/components/Icon" },
|
|
465
|
+
{ $ref: "#/components/Video" },
|
|
466
|
+
{ $ref: "#/components/AudioPlayer" },
|
|
467
|
+
{ $ref: "#/components/Row" },
|
|
468
|
+
{ $ref: "#/components/Column" },
|
|
469
|
+
{ $ref: "#/components/List" },
|
|
470
|
+
{ $ref: "#/components/Card" },
|
|
471
|
+
{ $ref: "#/components/Tabs" },
|
|
472
|
+
{ $ref: "#/components/Modal" },
|
|
473
|
+
{ $ref: "#/components/Divider" },
|
|
474
|
+
{ $ref: "#/components/Button" },
|
|
475
|
+
{ $ref: "#/components/TextField" },
|
|
476
|
+
{ $ref: "#/components/CheckBox" },
|
|
477
|
+
{ $ref: "#/components/ChoicePicker" },
|
|
478
|
+
{ $ref: "#/components/Slider" },
|
|
479
|
+
{ $ref: "#/components/DateTimeInput" }
|
|
480
|
+
],
|
|
481
|
+
discriminator: { propertyName: "component" }
|
|
482
|
+
},
|
|
483
|
+
anyFunction: { oneOf: [
|
|
484
|
+
{ $ref: "#/functions/required" },
|
|
485
|
+
{ $ref: "#/functions/regex" },
|
|
486
|
+
{ $ref: "#/functions/length" },
|
|
487
|
+
{ $ref: "#/functions/numeric" },
|
|
488
|
+
{ $ref: "#/functions/email" },
|
|
489
|
+
{ $ref: "#/functions/formatString" },
|
|
490
|
+
{ $ref: "#/functions/formatNumber" },
|
|
491
|
+
{ $ref: "#/functions/formatCurrency" },
|
|
492
|
+
{ $ref: "#/functions/formatDate" },
|
|
493
|
+
{ $ref: "#/functions/pluralize" },
|
|
494
|
+
{ $ref: "#/functions/openUrl" },
|
|
495
|
+
{ $ref: "#/functions/and" },
|
|
496
|
+
{ $ref: "#/functions/or" },
|
|
497
|
+
{ $ref: "#/functions/not" }
|
|
498
|
+
] }
|
|
499
|
+
}
|
|
500
|
+
}, k = {
|
|
501
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
502
|
+
$id: "https://a2ui.org/specification/v0_9/common_types.json",
|
|
503
|
+
title: "A2UI Common Types",
|
|
504
|
+
description: "Common type definitions used across A2UI schemas.",
|
|
505
|
+
$defs: {
|
|
506
|
+
ComponentId: {
|
|
507
|
+
type: "string",
|
|
508
|
+
description: "The unique identifier for a component, used for both definitions and references within the same surface."
|
|
509
|
+
},
|
|
510
|
+
AccessibilityAttributes: {
|
|
511
|
+
type: "object",
|
|
512
|
+
description: "Attributes to enhance accessibility when using assistive technologies like screen readers.",
|
|
513
|
+
properties: {
|
|
514
|
+
label: {
|
|
515
|
+
$ref: "#/$defs/DynamicString",
|
|
516
|
+
description: "A short string, typically 1 to 3 words, used by assistive technologies to convey the purpose or intent of an element. For example, an input field might have an accessible label of 'User ID' or a button might be labeled 'Submit'."
|
|
517
|
+
},
|
|
518
|
+
description: {
|
|
519
|
+
$ref: "#/$defs/DynamicString",
|
|
520
|
+
description: "Additional information provided by assistive technologies about an element such as instructions, format requirements, or result of an action. For example, a mute button might have a label of 'Mute' and a description of 'Silences notifications about this conversation'."
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
ComponentCommon: {
|
|
525
|
+
type: "object",
|
|
526
|
+
properties: {
|
|
527
|
+
id: { $ref: "#/$defs/ComponentId" },
|
|
528
|
+
accessibility: { $ref: "#/$defs/AccessibilityAttributes" }
|
|
529
|
+
},
|
|
530
|
+
required: ["id"]
|
|
531
|
+
},
|
|
532
|
+
ChildList: { oneOf: [{
|
|
533
|
+
type: "array",
|
|
534
|
+
description: "A static list of child component IDs.",
|
|
535
|
+
items: { $ref: "#/$defs/ComponentId" }
|
|
536
|
+
}, {
|
|
537
|
+
type: "object",
|
|
538
|
+
description: "A template for generating a dynamic list of children from a data model list. The `componentId` is the component to use as a template.",
|
|
539
|
+
properties: {
|
|
540
|
+
componentId: { $ref: "#/$defs/ComponentId" },
|
|
541
|
+
path: {
|
|
542
|
+
type: "string",
|
|
543
|
+
description: "The path to the list of component property objects in the data model."
|
|
544
|
+
}
|
|
545
|
+
},
|
|
546
|
+
required: ["componentId", "path"],
|
|
547
|
+
additionalProperties: !1
|
|
548
|
+
}] },
|
|
549
|
+
DataBinding: {
|
|
550
|
+
type: "object",
|
|
551
|
+
properties: { path: {
|
|
552
|
+
type: "string",
|
|
553
|
+
description: "A JSON Pointer path to a value in the data model."
|
|
554
|
+
} },
|
|
555
|
+
required: ["path"],
|
|
556
|
+
additionalProperties: !1
|
|
557
|
+
},
|
|
558
|
+
DynamicValue: {
|
|
559
|
+
description: "A value that can be a literal, a path, or a function call returning any type.",
|
|
560
|
+
oneOf: [
|
|
561
|
+
{ type: "string" },
|
|
562
|
+
{ type: "number" },
|
|
563
|
+
{ type: "boolean" },
|
|
564
|
+
{ type: "array" },
|
|
565
|
+
{ $ref: "#/$defs/DataBinding" },
|
|
566
|
+
{ $ref: "#/$defs/FunctionCall" }
|
|
567
|
+
]
|
|
568
|
+
},
|
|
569
|
+
DynamicString: {
|
|
570
|
+
description: "Represents a string",
|
|
571
|
+
oneOf: [
|
|
572
|
+
{ type: "string" },
|
|
573
|
+
{ $ref: "#/$defs/DataBinding" },
|
|
574
|
+
{ allOf: [{ $ref: "#/$defs/FunctionCall" }, { properties: { returnType: { const: "string" } } }] }
|
|
575
|
+
]
|
|
576
|
+
},
|
|
577
|
+
DynamicNumber: {
|
|
578
|
+
description: "Represents a value that can be either a literal number, a path to a number in the data model, or a function call returning a number.",
|
|
579
|
+
oneOf: [
|
|
580
|
+
{ type: "number" },
|
|
581
|
+
{ $ref: "#/$defs/DataBinding" },
|
|
582
|
+
{ allOf: [{ $ref: "#/$defs/FunctionCall" }, { properties: { returnType: { const: "number" } } }] }
|
|
583
|
+
]
|
|
584
|
+
},
|
|
585
|
+
DynamicBoolean: {
|
|
586
|
+
description: "A boolean value that can be a literal, a path, or a function call returning a boolean.",
|
|
587
|
+
oneOf: [
|
|
588
|
+
{ type: "boolean" },
|
|
589
|
+
{ $ref: "#/$defs/DataBinding" },
|
|
590
|
+
{ allOf: [{ $ref: "#/$defs/FunctionCall" }, { properties: { returnType: { const: "boolean" } } }] }
|
|
591
|
+
]
|
|
592
|
+
},
|
|
593
|
+
DynamicStringList: {
|
|
594
|
+
description: "Represents a value that can be either a literal array of strings, a path to a string array in the data model, or a function call returning a string array.",
|
|
595
|
+
oneOf: [
|
|
596
|
+
{
|
|
597
|
+
type: "array",
|
|
598
|
+
items: { type: "string" }
|
|
599
|
+
},
|
|
600
|
+
{ $ref: "#/$defs/DataBinding" },
|
|
601
|
+
{ allOf: [{ $ref: "#/$defs/FunctionCall" }, { properties: { returnType: { const: "array" } } }] }
|
|
602
|
+
]
|
|
603
|
+
},
|
|
604
|
+
FunctionCall: {
|
|
605
|
+
type: "object",
|
|
606
|
+
description: "Invokes a named function on the client.",
|
|
607
|
+
properties: {
|
|
608
|
+
call: {
|
|
609
|
+
type: "string",
|
|
610
|
+
description: "The name of the function to call."
|
|
611
|
+
},
|
|
612
|
+
args: {
|
|
613
|
+
type: "object",
|
|
614
|
+
description: "Arguments passed to the function.",
|
|
615
|
+
additionalProperties: { anyOf: [{ $ref: "#/$defs/DynamicValue" }, {
|
|
616
|
+
type: "object",
|
|
617
|
+
description: "A literal object argument (e.g. configuration)."
|
|
618
|
+
}] }
|
|
619
|
+
},
|
|
620
|
+
returnType: {
|
|
621
|
+
type: "string",
|
|
622
|
+
description: "The expected return type of the function call.",
|
|
623
|
+
enum: [
|
|
624
|
+
"string",
|
|
625
|
+
"number",
|
|
626
|
+
"boolean",
|
|
627
|
+
"array",
|
|
628
|
+
"object",
|
|
629
|
+
"any",
|
|
630
|
+
"void"
|
|
631
|
+
],
|
|
632
|
+
default: "boolean"
|
|
633
|
+
}
|
|
634
|
+
},
|
|
635
|
+
required: ["call"],
|
|
636
|
+
oneOf: [{ $ref: "catalog.json#/$defs/anyFunction" }]
|
|
637
|
+
},
|
|
638
|
+
CheckRule: {
|
|
639
|
+
type: "object",
|
|
640
|
+
description: "A single validation rule applied to an input component.",
|
|
641
|
+
properties: {
|
|
642
|
+
condition: { $ref: "#/$defs/DynamicBoolean" },
|
|
643
|
+
message: {
|
|
644
|
+
type: "string",
|
|
645
|
+
description: "The error message to display if the check fails."
|
|
646
|
+
}
|
|
647
|
+
},
|
|
648
|
+
required: ["condition", "message"],
|
|
649
|
+
additionalProperties: !1
|
|
650
|
+
},
|
|
651
|
+
Checkable: {
|
|
652
|
+
type: "object",
|
|
653
|
+
description: "Properties for components that support client-side checks.",
|
|
654
|
+
properties: { checks: {
|
|
655
|
+
type: "array",
|
|
656
|
+
description: "A list of checks to perform. These are function calls that must return a boolean indicating validity.",
|
|
657
|
+
items: { $ref: "#/$defs/CheckRule" }
|
|
658
|
+
} }
|
|
659
|
+
},
|
|
660
|
+
Action: {
|
|
661
|
+
description: "Defines an interaction handler that can either trigger a server-side event or execute a local client-side function.",
|
|
662
|
+
oneOf: [{
|
|
663
|
+
type: "object",
|
|
664
|
+
description: "Triggers a server-side event.",
|
|
665
|
+
properties: { event: {
|
|
666
|
+
type: "object",
|
|
667
|
+
description: "The event to dispatch to the server.",
|
|
668
|
+
properties: {
|
|
669
|
+
name: {
|
|
670
|
+
type: "string",
|
|
671
|
+
description: "The name of the action to be dispatched to the server."
|
|
672
|
+
},
|
|
673
|
+
context: {
|
|
674
|
+
type: "object",
|
|
675
|
+
description: "A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.",
|
|
676
|
+
additionalProperties: { $ref: "#/$defs/DynamicValue" }
|
|
677
|
+
}
|
|
678
|
+
},
|
|
679
|
+
required: ["name"],
|
|
680
|
+
additionalProperties: !1
|
|
681
|
+
} },
|
|
682
|
+
required: ["event"],
|
|
683
|
+
additionalProperties: !1
|
|
684
|
+
}, {
|
|
685
|
+
type: "object",
|
|
686
|
+
description: "Executes a local client-side function.",
|
|
687
|
+
properties: { functionCall: { $ref: "#/$defs/FunctionCall" } },
|
|
688
|
+
required: ["functionCall"],
|
|
689
|
+
additionalProperties: !1
|
|
690
|
+
}]
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
}, A = {
|
|
694
|
+
schema_version: 1,
|
|
695
|
+
profile: "official-0.9.1",
|
|
696
|
+
wire_versions: ["v0.9", "v0.9.1"],
|
|
697
|
+
capability_family: "v0.9",
|
|
698
|
+
catalog_id: "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json",
|
|
699
|
+
schema_resolution_aliases: { "https://a2ui.org/specification/v0_9/catalog.json": "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json" },
|
|
700
|
+
schema_draft: "https://json-schema.org/draft/2020-12/schema",
|
|
701
|
+
canonicalization: "RFC8785",
|
|
702
|
+
catalog_digest: "34eefcf32a13860465c71e340dd8c6c2f5f328865db140fa31ab83e30cbf42b1",
|
|
703
|
+
components: [
|
|
704
|
+
"AudioPlayer",
|
|
705
|
+
"Button",
|
|
706
|
+
"Card",
|
|
707
|
+
"CheckBox",
|
|
708
|
+
"ChoicePicker",
|
|
709
|
+
"Column",
|
|
710
|
+
"DateTimeInput",
|
|
711
|
+
"Divider",
|
|
712
|
+
"Icon",
|
|
713
|
+
"Image",
|
|
714
|
+
"List",
|
|
715
|
+
"Modal",
|
|
716
|
+
"Row",
|
|
717
|
+
"Slider",
|
|
718
|
+
"Tabs",
|
|
719
|
+
"Text",
|
|
720
|
+
"TextField",
|
|
721
|
+
"Video"
|
|
722
|
+
],
|
|
723
|
+
functions: [
|
|
724
|
+
"and",
|
|
725
|
+
"email",
|
|
726
|
+
"formatCurrency",
|
|
727
|
+
"formatDate",
|
|
728
|
+
"formatNumber",
|
|
729
|
+
"formatString",
|
|
730
|
+
"length",
|
|
731
|
+
"not",
|
|
732
|
+
"numeric",
|
|
733
|
+
"openUrl",
|
|
734
|
+
"or",
|
|
735
|
+
"pluralize",
|
|
736
|
+
"regex",
|
|
737
|
+
"required"
|
|
738
|
+
],
|
|
739
|
+
packages: {
|
|
740
|
+
"a2ui-core": "0.3.0",
|
|
741
|
+
"@a2ui/react": "0.13.0",
|
|
742
|
+
"@a2ui/web_core": "0.13.0",
|
|
743
|
+
"@a2ui/markdown-it": "0.2.1"
|
|
744
|
+
},
|
|
745
|
+
sources: {
|
|
746
|
+
"basic-v0_9_1.json": {
|
|
747
|
+
url: "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json",
|
|
748
|
+
raw_sha256: "8cc94d0a482e67048f9fc989964ca5da56fe42f531d919315a508989fb22e13e"
|
|
749
|
+
},
|
|
750
|
+
"common-types-v0_9.json": {
|
|
751
|
+
url: "https://a2ui.org/specification/v0_9/common_types.json",
|
|
752
|
+
raw_sha256: "a13897d7dbe14c37512c5cbc9b8561782fc3b01e3a6ff114c1f12c82275b5884"
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
transform: "identity; official assets preserved byte-for-byte",
|
|
756
|
+
legacy_profiles: [{
|
|
757
|
+
profile: "ksadk-legacy-seven-components",
|
|
758
|
+
catalog_id: "a2ui.org/catalogs/basic/v1.0",
|
|
759
|
+
catalog_digest: "56e78e6da4456d70b516f282518de2c75a59174874a0f49226ef3a3d920f829b",
|
|
760
|
+
components: [
|
|
761
|
+
"ApprovalBar",
|
|
762
|
+
"Card",
|
|
763
|
+
"CheckboxGroup",
|
|
764
|
+
"Form",
|
|
765
|
+
"RadioGroup",
|
|
766
|
+
"Select",
|
|
767
|
+
"Text"
|
|
768
|
+
],
|
|
769
|
+
source: "ksadk.a2ui.models.BASIC_CATALOG; project compatibility asset"
|
|
770
|
+
}]
|
|
771
|
+
}, j = {
|
|
772
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
773
|
+
$id: "a2ui.org/catalogs/basic/v1.0",
|
|
774
|
+
catalogId: "a2ui.org/catalogs/basic/v1.0",
|
|
775
|
+
components: {
|
|
776
|
+
Card: {
|
|
777
|
+
type: "object",
|
|
778
|
+
properties: {
|
|
779
|
+
id: {
|
|
780
|
+
type: "string",
|
|
781
|
+
minLength: 1
|
|
782
|
+
},
|
|
783
|
+
component: { const: "Card" },
|
|
784
|
+
body: {},
|
|
785
|
+
children: {
|
|
786
|
+
type: "array",
|
|
787
|
+
items: { type: "string" }
|
|
788
|
+
},
|
|
789
|
+
footer: {},
|
|
790
|
+
title: {}
|
|
791
|
+
},
|
|
792
|
+
required: ["id", "component"],
|
|
793
|
+
additionalProperties: !1
|
|
794
|
+
},
|
|
795
|
+
Text: {
|
|
796
|
+
type: "object",
|
|
797
|
+
properties: {
|
|
798
|
+
id: {
|
|
799
|
+
type: "string",
|
|
800
|
+
minLength: 1
|
|
801
|
+
},
|
|
802
|
+
component: { const: "Text" },
|
|
803
|
+
text: {},
|
|
804
|
+
variant: {},
|
|
805
|
+
children: {
|
|
806
|
+
type: "array",
|
|
807
|
+
items: { type: "string" }
|
|
808
|
+
}
|
|
809
|
+
},
|
|
810
|
+
required: ["id", "component"],
|
|
811
|
+
additionalProperties: !1
|
|
812
|
+
},
|
|
813
|
+
Form: {
|
|
814
|
+
type: "object",
|
|
815
|
+
properties: {
|
|
816
|
+
id: {
|
|
817
|
+
type: "string",
|
|
818
|
+
minLength: 1
|
|
819
|
+
},
|
|
820
|
+
component: { const: "Form" },
|
|
821
|
+
fields: {
|
|
822
|
+
type: "array",
|
|
823
|
+
maxItems: 200,
|
|
824
|
+
items: {
|
|
825
|
+
type: "object",
|
|
826
|
+
required: ["name"],
|
|
827
|
+
properties: {
|
|
828
|
+
name: {
|
|
829
|
+
type: "string",
|
|
830
|
+
minLength: 1,
|
|
831
|
+
maxLength: 256
|
|
832
|
+
},
|
|
833
|
+
label: { type: "string" },
|
|
834
|
+
placeholder: { type: "string" },
|
|
835
|
+
type: { enum: [
|
|
836
|
+
"string",
|
|
837
|
+
"str",
|
|
838
|
+
"text",
|
|
839
|
+
"int",
|
|
840
|
+
"integer",
|
|
841
|
+
"number",
|
|
842
|
+
"float",
|
|
843
|
+
"bool",
|
|
844
|
+
"boolean"
|
|
845
|
+
] },
|
|
846
|
+
required: { type: "boolean" },
|
|
847
|
+
value: {}
|
|
848
|
+
},
|
|
849
|
+
additionalProperties: !1
|
|
850
|
+
}
|
|
851
|
+
},
|
|
852
|
+
submit_label: {},
|
|
853
|
+
title: {},
|
|
854
|
+
children: {
|
|
855
|
+
type: "array",
|
|
856
|
+
items: { type: "string" }
|
|
857
|
+
}
|
|
858
|
+
},
|
|
859
|
+
required: ["id", "component"],
|
|
860
|
+
additionalProperties: !1
|
|
861
|
+
},
|
|
862
|
+
Select: {
|
|
863
|
+
type: "object",
|
|
864
|
+
properties: {
|
|
865
|
+
id: {
|
|
866
|
+
type: "string",
|
|
867
|
+
minLength: 1
|
|
868
|
+
},
|
|
869
|
+
component: { const: "Select" },
|
|
870
|
+
label: {},
|
|
871
|
+
options: {},
|
|
872
|
+
value: {},
|
|
873
|
+
children: {
|
|
874
|
+
type: "array",
|
|
875
|
+
items: { type: "string" }
|
|
876
|
+
}
|
|
877
|
+
},
|
|
878
|
+
required: ["id", "component"],
|
|
879
|
+
additionalProperties: !1
|
|
880
|
+
},
|
|
881
|
+
RadioGroup: {
|
|
882
|
+
type: "object",
|
|
883
|
+
properties: {
|
|
884
|
+
id: {
|
|
885
|
+
type: "string",
|
|
886
|
+
minLength: 1
|
|
887
|
+
},
|
|
888
|
+
component: { const: "RadioGroup" },
|
|
889
|
+
label: {},
|
|
890
|
+
options: {},
|
|
891
|
+
value: {},
|
|
892
|
+
children: {
|
|
893
|
+
type: "array",
|
|
894
|
+
items: { type: "string" }
|
|
895
|
+
}
|
|
896
|
+
},
|
|
897
|
+
required: ["id", "component"],
|
|
898
|
+
additionalProperties: !1
|
|
899
|
+
},
|
|
900
|
+
CheckboxGroup: {
|
|
901
|
+
type: "object",
|
|
902
|
+
properties: {
|
|
903
|
+
id: {
|
|
904
|
+
type: "string",
|
|
905
|
+
minLength: 1
|
|
906
|
+
},
|
|
907
|
+
component: { const: "CheckboxGroup" },
|
|
908
|
+
label: {},
|
|
909
|
+
options: {},
|
|
910
|
+
value: {},
|
|
911
|
+
children: {
|
|
912
|
+
type: "array",
|
|
913
|
+
items: { type: "string" }
|
|
914
|
+
}
|
|
915
|
+
},
|
|
916
|
+
required: ["id", "component"],
|
|
917
|
+
additionalProperties: !1
|
|
918
|
+
},
|
|
919
|
+
ApprovalBar: {
|
|
920
|
+
type: "object",
|
|
921
|
+
properties: {
|
|
922
|
+
id: {
|
|
923
|
+
type: "string",
|
|
924
|
+
minLength: 1
|
|
925
|
+
},
|
|
926
|
+
component: { const: "ApprovalBar" },
|
|
927
|
+
approve_label: {},
|
|
928
|
+
deny_label: {},
|
|
929
|
+
summary: {},
|
|
930
|
+
tool_name: {},
|
|
931
|
+
children: {
|
|
932
|
+
type: "array",
|
|
933
|
+
items: { type: "string" }
|
|
934
|
+
}
|
|
935
|
+
},
|
|
936
|
+
required: ["id", "component"],
|
|
937
|
+
additionalProperties: !1
|
|
938
|
+
}
|
|
939
|
+
},
|
|
940
|
+
functions: {}
|
|
941
|
+
}, M = O, N = A, P = j;
|
|
942
|
+
function F(e) {
|
|
943
|
+
return ee(f(new TextEncoder().encode(d(t(e)))));
|
|
944
|
+
}
|
|
945
|
+
var I = new o({
|
|
946
|
+
strict: !1,
|
|
947
|
+
allErrors: !0,
|
|
948
|
+
logger: !1
|
|
949
|
+
});
|
|
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,
|
|
953
|
+
$id: e
|
|
954
|
+
});
|
|
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}`)]));
|
|
956
|
+
//#endregion
|
|
957
|
+
//#region src/core/a2ui/linking.ts
|
|
958
|
+
var le = new Set([
|
|
959
|
+
"components",
|
|
960
|
+
"functions",
|
|
961
|
+
"$defs",
|
|
962
|
+
"definitions",
|
|
963
|
+
"properties",
|
|
964
|
+
"patternProperties",
|
|
965
|
+
"dependentSchemas"
|
|
966
|
+
]), ue = new Set([
|
|
967
|
+
"theme",
|
|
968
|
+
"items",
|
|
969
|
+
"additionalProperties",
|
|
970
|
+
"additionalItems",
|
|
971
|
+
"contains",
|
|
972
|
+
"propertyNames",
|
|
973
|
+
"not",
|
|
974
|
+
"if",
|
|
975
|
+
"then",
|
|
976
|
+
"else",
|
|
977
|
+
"unevaluatedProperties",
|
|
978
|
+
"unevaluatedItems",
|
|
979
|
+
"contentSchema"
|
|
980
|
+
]), de = new Set([
|
|
981
|
+
"allOf",
|
|
982
|
+
"anyOf",
|
|
983
|
+
"oneOf",
|
|
984
|
+
"prefixItems"
|
|
985
|
+
]), fe = "https://a2ui.org/specification/v0_9/common_types.json";
|
|
986
|
+
function L(e, t) {
|
|
987
|
+
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
|
+
if (!e || typeof e != "object" || Array.isArray(e)) return structuredClone(e);
|
|
989
|
+
let c = e, l = typeof c.$id == "string" && c.$id !== o ? i(o, c.$id) : o, u = structuredClone(c);
|
|
990
|
+
for (let e of ["$ref", "$dynamicRef"]) {
|
|
991
|
+
let o = c[e];
|
|
992
|
+
if (typeof o != "string") continue;
|
|
993
|
+
let d = i(l, o), f = t(d);
|
|
994
|
+
if (f === void 0) throw Error("A2UI 目录包含未提供的离线 Schema 引用。");
|
|
995
|
+
if (d.split("#")[0] === n) u[e] = "#" + (d.split("#")[1] || "");
|
|
996
|
+
else if (d.split("#")[0] !== fe) {
|
|
997
|
+
if (r.has(d)) throw Error("循环的外部 A2UI Schema 资产无法完成链接。");
|
|
998
|
+
r.add(d);
|
|
999
|
+
let t;
|
|
1000
|
+
try {
|
|
1001
|
+
t = a(f, d.split("#")[0], !0);
|
|
1002
|
+
} finally {
|
|
1003
|
+
r.delete(d);
|
|
1004
|
+
}
|
|
1005
|
+
let n = Object.fromEntries(Object.entries(c).filter(([t]) => t !== e));
|
|
1006
|
+
return Object.keys(n).length ? { allOf: [t, a(n, l, s)] } : t;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
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)));
|
|
1010
|
+
return s && (delete u.$id, delete u.$schema, delete u.$anchor), u;
|
|
1011
|
+
};
|
|
1012
|
+
return a(e, n);
|
|
1013
|
+
}
|
|
1014
|
+
//#endregion
|
|
1015
|
+
//#region src/core/a2ui/registry.ts
|
|
1016
|
+
var R = [{
|
|
1017
|
+
schema: M,
|
|
1018
|
+
loadRenderer: async () => (await import("@a2ui/web_core/v0_9/basic_catalog")).basicCatalog
|
|
1019
|
+
}, {
|
|
1020
|
+
schema: P,
|
|
1021
|
+
loadRenderer: async () => new c(P.catalogId, "0.9", [...c.fromSchema(P, "0.9").components.values()], [])
|
|
1022
|
+
}], z = class {
|
|
1023
|
+
defaultCatalogId;
|
|
1024
|
+
entries = /* @__PURE__ */ new Map();
|
|
1025
|
+
validators = /* @__PURE__ */ new Map();
|
|
1026
|
+
loaders = /* @__PURE__ */ new Map();
|
|
1027
|
+
processorSchemas = /* @__PURE__ */ new Map();
|
|
1028
|
+
constructor(e = [], t = N.catalog_id) {
|
|
1029
|
+
for (let t of [...R, ...e]) {
|
|
1030
|
+
let e = structuredClone(t.schema), n = e.catalogId;
|
|
1031
|
+
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);
|
|
1033
|
+
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 目录身份存在冲突。");
|
|
1035
|
+
continue;
|
|
1036
|
+
}
|
|
1037
|
+
let a = structuredClone(t.resources || []);
|
|
1038
|
+
this.entries.set(n, Object.freeze({
|
|
1039
|
+
...t,
|
|
1040
|
+
schema: e,
|
|
1041
|
+
resources: a,
|
|
1042
|
+
digest: r,
|
|
1043
|
+
inputComponents: Object.freeze([...t.inputComponents || []])
|
|
1044
|
+
}));
|
|
1045
|
+
}
|
|
1046
|
+
let n = new o({
|
|
1047
|
+
strict: !1,
|
|
1048
|
+
allErrors: !0,
|
|
1049
|
+
logger: !1
|
|
1050
|
+
});
|
|
1051
|
+
s(n);
|
|
1052
|
+
let r = /* @__PURE__ */ new Map(), i = (e) => {
|
|
1053
|
+
let t = e.$id ?? e.catalogId;
|
|
1054
|
+
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 身份存在冲突。");
|
|
1056
|
+
r.set(t, e);
|
|
1057
|
+
};
|
|
1058
|
+
i(k);
|
|
1059
|
+
for (let e of this.entries.values()) {
|
|
1060
|
+
i(e.schema);
|
|
1061
|
+
for (let t of e.resources || []) i(t);
|
|
1062
|
+
}
|
|
1063
|
+
for (let e of Object.keys(N.schema_resolution_aliases)) i({
|
|
1064
|
+
...M,
|
|
1065
|
+
$id: e
|
|
1066
|
+
});
|
|
1067
|
+
for (let [e, t] of r) n.addSchema(t, e);
|
|
1068
|
+
for (let [e, t] of this.entries) {
|
|
1069
|
+
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, L(t.schema, (e) => n.getSchema(e)?.schema));
|
|
1071
|
+
}
|
|
1072
|
+
if (!this.entries.has(t)) throw Error("默认 A2UI 目录未注册。");
|
|
1073
|
+
this.defaultCatalogId = t;
|
|
1074
|
+
}
|
|
1075
|
+
get catalogIds() {
|
|
1076
|
+
return [...this.entries.keys()];
|
|
1077
|
+
}
|
|
1078
|
+
get(e) {
|
|
1079
|
+
let t = this.entries.get(e);
|
|
1080
|
+
return t && {
|
|
1081
|
+
...t,
|
|
1082
|
+
schema: structuredClone(t.schema),
|
|
1083
|
+
resources: structuredClone(t.resources)
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
validateComponents(e, t) {
|
|
1087
|
+
if (!Array.isArray(t) || t.length === 0 || t.length > 2048) throw Error("A2UI 组件列表无效或过大。");
|
|
1088
|
+
let n = this.validators.get(e);
|
|
1089
|
+
if (!n) throw Error("当前卡片使用了页面未注册的组件目录。");
|
|
1090
|
+
let r = /* @__PURE__ */ new Set();
|
|
1091
|
+
for (let e of t) {
|
|
1092
|
+
let t = e, i = t && typeof t.component == "string" && n.get(t.component);
|
|
1093
|
+
if (!i || !i(t)) throw Error("A2UI 组件或属性不符合已注册的目录。");
|
|
1094
|
+
if (typeof t?.id != "string" || !t.id.trim() || r.has(t.id)) throw Error("A2UI 组件身份无效或重复。");
|
|
1095
|
+
r.add(t.id);
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
validateMessages(e) {
|
|
1099
|
+
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, () => {
|
|
1103
|
+
throw Error("校验过程不能执行 A2UI 函数。");
|
|
1104
|
+
})), t.themeSchema, t.instructions);
|
|
1105
|
+
}), void 0, {
|
|
1106
|
+
version: "v0.9.1",
|
|
1107
|
+
validationConfig: {
|
|
1108
|
+
allowOrphanComponents: !0,
|
|
1109
|
+
allowDanglingReferences: !0,
|
|
1110
|
+
allowMissingRoot: !0,
|
|
1111
|
+
allowUnknownElements: !1
|
|
1112
|
+
}
|
|
1113
|
+
});
|
|
1114
|
+
try {
|
|
1115
|
+
for (let n of e) {
|
|
1116
|
+
if (!["v0.9", "v0.9.1"].includes(String(n.version))) throw Error("当前页面不支持此 A2UI 协议版本。");
|
|
1117
|
+
let e = [
|
|
1118
|
+
"createSurface",
|
|
1119
|
+
"updateComponents",
|
|
1120
|
+
"updateDataModel",
|
|
1121
|
+
"deleteSurface"
|
|
1122
|
+
].filter((e) => e in n);
|
|
1123
|
+
if (e.length !== 1) throw Error("A2UI 消息操作无效。");
|
|
1124
|
+
let r = e[0], i = n[r];
|
|
1125
|
+
if (!i || typeof i.surfaceId != "string" || !i.surfaceId.trim()) throw Error("A2UI surface 身份无效。");
|
|
1126
|
+
let a = t.getSurface(i.surfaceId);
|
|
1127
|
+
if (r === "createSurface") {
|
|
1128
|
+
if (!this.entries.has(String(i.catalogId))) throw Error("当前卡片使用了页面未注册的组件目录。");
|
|
1129
|
+
if (a) throw Error("重建卡片前必须先删除原 surface。");
|
|
1130
|
+
} else if (!a) throw Error("卡片缺少已接受的 createSurface。");
|
|
1131
|
+
r === "updateComponents" && this.validateComponents(a.defaultCatalog.id, i.components), t.processMessages(structuredClone(n));
|
|
1132
|
+
}
|
|
1133
|
+
return t;
|
|
1134
|
+
} catch (e) {
|
|
1135
|
+
throw t.dispose(), e;
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
async loadRenderers(e = this.catalogIds) {
|
|
1139
|
+
return Promise.all([...new Set(e)].map((e) => {
|
|
1140
|
+
let t = this.entries.get(e);
|
|
1141
|
+
if (!t) throw Error("当前卡片使用了页面未注册的组件目录。");
|
|
1142
|
+
let n = this.loaders.get(e);
|
|
1143
|
+
return n || (n = Promise.resolve().then(() => t.loadRenderer()).then((n) => {
|
|
1144
|
+
if (n.id !== e || ![
|
|
1145
|
+
"0.9",
|
|
1146
|
+
"v0.9",
|
|
1147
|
+
"0.9.1",
|
|
1148
|
+
"v0.9.1"
|
|
1149
|
+
].includes(String(n.protocolVersion))) throw Error("A2UI 组件实现与注册目录身份不一致。");
|
|
1150
|
+
for (let e of Object.keys(t.schema.components)) if (!n.components.has(e)) throw Error("A2UI 目录缺少组件实现。");
|
|
1151
|
+
for (let e of Object.keys(t.schema.functions || {})) if (!n.functions.has(e)) throw Error("A2UI 目录缺少函数实现。");
|
|
1152
|
+
return n;
|
|
1153
|
+
}).catch((t) => {
|
|
1154
|
+
throw this.loaders.delete(e), t;
|
|
1155
|
+
}), this.loaders.set(e, n)), n;
|
|
1156
|
+
}));
|
|
1157
|
+
}
|
|
1158
|
+
};
|
|
1159
|
+
function B(e = [], t = {}) {
|
|
1160
|
+
return new z(e, t.defaultCatalogId);
|
|
1161
|
+
}
|
|
1162
|
+
var V = B(), H = n(V);
|
|
1163
|
+
function pe({ registry: e, children: t }) {
|
|
1164
|
+
return /* @__PURE__ */ a(H.Provider, {
|
|
1165
|
+
value: e,
|
|
1166
|
+
children: t
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
function me() {
|
|
1170
|
+
return r(H);
|
|
1171
|
+
}
|
|
1172
|
+
//#endregion
|
|
1173
|
+
//#region src/core/interaction/a2ui-validate.ts
|
|
1174
|
+
var he = "0.9.1";
|
|
1175
|
+
function ge(e) {
|
|
1176
|
+
return F(e);
|
|
1177
|
+
}
|
|
1178
|
+
function U(e, t = V) {
|
|
1179
|
+
if (!e) return W(null);
|
|
1180
|
+
if (e.wireVersion !== "0.9.1" || !e.messages || e.messages.length === 0) return W(e);
|
|
1181
|
+
try {
|
|
1182
|
+
let n = t instanceof z ? t : V, r = new Set(e.messages.flatMap((e) => {
|
|
1183
|
+
let t = e.createSurface;
|
|
1184
|
+
return t?.catalogId ? [t.catalogId] : [];
|
|
1185
|
+
}));
|
|
1186
|
+
if (r.size !== 1) return "json-schema-form";
|
|
1187
|
+
let i = n.get([...r][0]);
|
|
1188
|
+
if (!i) return "json-schema-form";
|
|
1189
|
+
let a = t instanceof z ? i.digest : ge(t), o = [...r][0] === P.catalogId && e.catalogDigest === N.catalog_digest;
|
|
1190
|
+
if (!e.catalogDigest || e.catalogDigest !== a && !o) return "json-schema-form";
|
|
1191
|
+
n.validateMessages(e.messages).dispose();
|
|
1192
|
+
} catch {
|
|
1193
|
+
return "json-schema-form";
|
|
1194
|
+
}
|
|
1195
|
+
return "a2ui";
|
|
1196
|
+
}
|
|
1197
|
+
function W(e) {
|
|
1198
|
+
return e && _e(e) ? "json-schema-form" : "basic-controls";
|
|
1199
|
+
}
|
|
1200
|
+
function _e(e) {
|
|
1201
|
+
return e.messages.some((e) => {
|
|
1202
|
+
let t = e.inputSchema ?? e.input_schema ?? e.schema;
|
|
1203
|
+
return typeof t == "object" && !!t;
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
1206
|
+
function ve(e, t = V) {
|
|
1207
|
+
let n = e.kind === "approval" ? e.presentation?.a2ui : null;
|
|
1208
|
+
return n && U(n, t) === "a2ui" ? n : null;
|
|
1209
|
+
}
|
|
1210
|
+
//#endregion
|
|
1211
|
+
//#region src/core/interaction/types.ts
|
|
1212
|
+
var G = new Set([
|
|
1213
|
+
"resolved",
|
|
1214
|
+
"cancelled",
|
|
1215
|
+
"expired"
|
|
1216
|
+
]);
|
|
1217
|
+
function ye(e) {
|
|
1218
|
+
return G.has(e);
|
|
1219
|
+
}
|
|
1220
|
+
function be(e, t) {
|
|
1221
|
+
return `interaction:${e}:revision-${t}`;
|
|
1222
|
+
}
|
|
1223
|
+
function xe(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 Se = {
|
|
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: []
|
|
1262
|
+
}
|
|
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
|
+
}, K = /* @__PURE__ */ new Map();
|
|
1355
|
+
function Ce(e) {
|
|
1356
|
+
t(e);
|
|
1357
|
+
let n = JSON.stringify(e), r = K.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(Se), s(c);
|
|
1370
|
+
let l = c.compile(e);
|
|
1371
|
+
if ("$async" in l && l.$async) throw TypeError("Async schemas are not supported");
|
|
1372
|
+
return K.size >= 128 && K.delete(K.keys().next().value), K.set(n, l), l;
|
|
1373
|
+
}
|
|
1374
|
+
function we(e, n) {
|
|
1375
|
+
try {
|
|
1376
|
+
t(n);
|
|
1377
|
+
let r = Ce(e), i = r(n);
|
|
1378
|
+
return {
|
|
1379
|
+
valid: !!i,
|
|
1380
|
+
issues: i ? [] : (r.errors || []).slice(0, 10).map((e) => `${e.instancePath || "/"}:不符合 ${e.keyword} 约束`)
|
|
1381
|
+
};
|
|
1382
|
+
} catch {
|
|
1383
|
+
return {
|
|
1384
|
+
valid: !1,
|
|
1385
|
+
issues: ["输入或表单约束不是受支持的 JSON。"]
|
|
1386
|
+
};
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
//#endregion
|
|
1390
|
+
//#region src/core/interaction/response-snapshot.ts
|
|
1391
|
+
var q = (e) => typeof e == "object" && e && !Array.isArray(e) ? e : void 0, J = class extends Error {};
|
|
1392
|
+
function Y() {
|
|
1393
|
+
let e = 8192;
|
|
1394
|
+
return () => {
|
|
1395
|
+
if (--e < 0) throw new J();
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
function Te(e, t, n) {
|
|
1399
|
+
if (e === "#") return t;
|
|
1400
|
+
if (typeof e != "string" || !e.startsWith("#/")) throw new J();
|
|
1401
|
+
try {
|
|
1402
|
+
let r = t;
|
|
1403
|
+
for (let t of decodeURIComponent(e.slice(2)).split("/")) {
|
|
1404
|
+
n();
|
|
1405
|
+
let e = q(r) ?? (Array.isArray(r) ? r : void 0), i = t.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
1406
|
+
if (!e || !Object.hasOwn(e, i)) throw new J();
|
|
1407
|
+
r = e[i];
|
|
1408
|
+
}
|
|
1409
|
+
return r;
|
|
1410
|
+
} catch {
|
|
1411
|
+
throw new J();
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
function X(e, t, n) {
|
|
1415
|
+
let r = /* @__PURE__ */ new Set(), i = [...e];
|
|
1416
|
+
for (; i.length;) {
|
|
1417
|
+
n();
|
|
1418
|
+
let e = i.pop();
|
|
1419
|
+
if (typeof e == "boolean") continue;
|
|
1420
|
+
let a = q(e);
|
|
1421
|
+
if (!a) throw new J();
|
|
1422
|
+
if (!r.has(a)) {
|
|
1423
|
+
if (r.add(a), a !== t && Object.hasOwn(a, "$id") || Object.hasOwn(a, "$dynamicRef") || Object.hasOwn(a, "$recursiveRef")) throw new J();
|
|
1424
|
+
Object.hasOwn(a, "$ref") && i.push(Te(a.$ref, t, n));
|
|
1425
|
+
for (let e of [
|
|
1426
|
+
"allOf",
|
|
1427
|
+
"anyOf",
|
|
1428
|
+
"oneOf"
|
|
1429
|
+
]) {
|
|
1430
|
+
let t = a[e];
|
|
1431
|
+
if (t !== void 0 && !Array.isArray(t)) throw new J();
|
|
1432
|
+
Array.isArray(t) && i.push(...t);
|
|
1433
|
+
}
|
|
1434
|
+
for (let e of [
|
|
1435
|
+
"if",
|
|
1436
|
+
"then",
|
|
1437
|
+
"else"
|
|
1438
|
+
]) Object.hasOwn(a, e) && i.push(a[e]);
|
|
1439
|
+
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);
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
return [...r];
|
|
1443
|
+
}
|
|
1444
|
+
var Z = (e) => e.writeOnly === !0 || e.format === "password" || e["x-sensitive"] === !0 || e["x-codex-is-secret"] === !0;
|
|
1445
|
+
function Ee(e, t = e) {
|
|
1446
|
+
try {
|
|
1447
|
+
return X([e], t, Y()).some(Z);
|
|
1448
|
+
} catch {
|
|
1449
|
+
return !0;
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
function Q(e, n) {
|
|
1453
|
+
let r = Y();
|
|
1454
|
+
function i(t, n, a) {
|
|
1455
|
+
if (r(), a > 48) throw new J();
|
|
1456
|
+
let o = X(t, e, r);
|
|
1457
|
+
return o.some(Z) ? null : Array.isArray(n) ? n.map((e, t) => {
|
|
1458
|
+
let n = [];
|
|
1459
|
+
for (let e of o) {
|
|
1460
|
+
let r = Array.isArray(e.prefixItems) ? e.prefixItems : void 0, i = Array.isArray(e.items) ? e.items : void 0;
|
|
1461
|
+
n.push(r && t < r.length ? r[t] : i ? t < i.length ? i[t] : e.additionalItems ?? {} : e.items ?? {});
|
|
1462
|
+
for (let t of ["contains", "unevaluatedItems"]) Object.hasOwn(e, t) && n.push(e[t]);
|
|
1463
|
+
}
|
|
1464
|
+
return i(n, e, a + 1);
|
|
1465
|
+
}) : typeof n != "object" || !n ? n : Object.fromEntries(Object.entries(n).map(([e, t]) => {
|
|
1466
|
+
let n = [];
|
|
1467
|
+
for (let t of o) {
|
|
1468
|
+
let r = q(t.properties), i = !!(r && Object.hasOwn(r, e));
|
|
1469
|
+
i && n.push(r[e]);
|
|
1470
|
+
for (let [r, a] of Object.entries(q(t.patternProperties) || {})) new RegExp(r).test(e) && (i = !0, n.push(a));
|
|
1471
|
+
!i && Object.hasOwn(t, "additionalProperties") && n.push(t.additionalProperties), Object.hasOwn(t, "unevaluatedProperties") && n.push(t.unevaluatedProperties);
|
|
1472
|
+
}
|
|
1473
|
+
return [e, i(n, t, a + 1)];
|
|
1474
|
+
}));
|
|
1475
|
+
}
|
|
1476
|
+
try {
|
|
1477
|
+
return t(n), i([e], n, 0);
|
|
1478
|
+
} catch {
|
|
1479
|
+
return null;
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
function De(e) {
|
|
1483
|
+
if (!(e.kind !== "structured_input" || e.status !== "resolved" || e.outcome !== "submitted" || !e.requestSchema || !Object.hasOwn(e, "response"))) try {
|
|
1484
|
+
return { value: Q(e.requestSchema, t(e.response)) };
|
|
1485
|
+
} catch {
|
|
1486
|
+
return;
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
//#endregion
|
|
1490
|
+
//#region src/core/run/a2ui.ts
|
|
1491
|
+
var $ = {
|
|
1492
|
+
description: "A2UI Component Schema — available components for generating UI surfaces. Use these component names and properties when creating A2UI operations.",
|
|
1493
|
+
value: JSON.stringify({
|
|
1494
|
+
...M,
|
|
1495
|
+
ksadkManifest: N
|
|
1496
|
+
})
|
|
1497
|
+
};
|
|
1498
|
+
function Oe(e = V) {
|
|
1499
|
+
if (e === V) return $;
|
|
1500
|
+
let t = e.get(e.defaultCatalogId);
|
|
1501
|
+
return {
|
|
1502
|
+
description: $.description,
|
|
1503
|
+
value: JSON.stringify({
|
|
1504
|
+
...t.schema,
|
|
1505
|
+
ksadkResources: t.resources,
|
|
1506
|
+
ksadkManifest: {
|
|
1507
|
+
catalog_id: e.defaultCatalogId,
|
|
1508
|
+
catalog_digest: t.digest,
|
|
1509
|
+
supported_catalog_ids: e.catalogIds
|
|
1510
|
+
}
|
|
1511
|
+
})
|
|
1512
|
+
};
|
|
1513
|
+
}
|
|
1514
|
+
function ke(e) {
|
|
1515
|
+
return e.map((e) => {
|
|
1516
|
+
let t = e.updateComponents;
|
|
1517
|
+
if (!t || typeof t != "object" || Array.isArray(t)) return e;
|
|
1518
|
+
let n = t.components;
|
|
1519
|
+
if (!Array.isArray(n)) return e;
|
|
1520
|
+
let r = n.filter((e) => !!(e && typeof e == "object" && !Array.isArray(e)));
|
|
1521
|
+
if (r.some((e) => e.id === "root")) return e;
|
|
1522
|
+
let i = r.filter((e) => typeof e.id == "string" && e.id.endsWith("-root"));
|
|
1523
|
+
if (i.length !== 1) return e;
|
|
1524
|
+
let a = i[0];
|
|
1525
|
+
return {
|
|
1526
|
+
...e,
|
|
1527
|
+
updateComponents: {
|
|
1528
|
+
...t,
|
|
1529
|
+
components: n.map((e) => e === a ? {
|
|
1530
|
+
...a,
|
|
1531
|
+
id: "root"
|
|
1532
|
+
} : e)
|
|
1533
|
+
}
|
|
1534
|
+
};
|
|
1535
|
+
});
|
|
1536
|
+
}
|
|
1537
|
+
function Ae(e) {
|
|
1538
|
+
for (let t of e) {
|
|
1539
|
+
let e = t.updateComponents?.components;
|
|
1540
|
+
if (!Array.isArray(e) || !e.some((e) => e.component === "Form" && e.id === "form")) continue;
|
|
1541
|
+
let n = e.filter((e) => e.component === "MultipleChoice");
|
|
1542
|
+
if (n.length) return n.map((e) => String(e.description || e.label || e.id));
|
|
1543
|
+
}
|
|
1544
|
+
return null;
|
|
1545
|
+
}
|
|
1546
|
+
//#endregion
|
|
1547
|
+
export { y as C, b as S, ie as T, V as _, Q as a, ce as b, be as c, he as d, U as f, B as g, me as h, Ee as i, ye as l, pe as m, Ae as n, De as o, ve as p, ke as r, we as s, Oe as t, xe as u, P as v, v as w, C as x, E as y };
|