@adaas/a-frame 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.conf/tsconfig.browser.json +7 -1
- package/.conf/tsconfig.node.json +7 -1
- package/dist/browser/A-FrameBrowserStorageBlobs.context-CZTTvpn2.d.mts +53 -0
- package/dist/browser/A-FrameBrowserStorageBlobs.context-CaGTyatz.d.mts +40 -0
- package/dist/browser/A-FrameBrowserStorageBlobs.context-DjeEH8cn.d.mts +53 -0
- package/dist/browser/A-FrameBrowserStorageBlobs.context-vCsuTea9.d.mts +40 -0
- package/dist/browser/A-FrameBundle.types-LzfgdMiQ.d.mts +71 -0
- package/dist/browser/A-FrameChannel.component-4mTNctXL.d.mts +704 -0
- package/dist/browser/A-FrameChannel.types-BXEKJK9t.d.mts +205 -0
- package/dist/browser/A-FrameChannel.types-Ba3wgUZj.d.mts +199 -0
- package/dist/browser/A-FrameChannel.types-BfINhQZe.d.mts +145 -0
- package/dist/browser/A-FrameChannel.types-DfacgYL1.d.mts +199 -0
- package/dist/browser/A-FrameCompletion.entity-Dzy9sIa8.d.mts +72 -0
- package/dist/browser/A-FrameDefinition.entity-C1aK-gdl.d.mts +370 -0
- package/dist/browser/A-FrameDefinition.entity-CKPXsarS.d.mts +358 -0
- package/dist/browser/A-FrameDefinition.entity-yA0GsBoe.d.mts +143 -0
- package/dist/browser/A-FrameDefinition.types-BT02yAhQ.d.mts +232 -0
- package/dist/browser/A-FrameDynamicContentOperation.context-CoViNb19.d.mts +297 -0
- package/dist/browser/A-FrameDynamicContentOperation.context-Dd7Lb7X2.d.mts +266 -0
- package/dist/browser/A-FrameDynamicPatch.entity-BRuF1tqs.d.mts +29 -0
- package/dist/browser/A-FrameDynamicStructure.entity-DMvI_EPT.d.mts +210 -0
- package/dist/browser/A-FrameDynamicStructure.entity-DxkPP9mR.d.mts +235 -0
- package/dist/browser/A-FrameEnv.types-DnK-CYVk.d.mts +21 -0
- package/dist/browser/A-FrameNamespace.entity-BDg1FUgo.d.mts +136 -0
- package/dist/browser/A-FrameSchema.entity-DjYIhsoj.d.mts +141 -0
- package/dist/browser/A-FrameSegment.entity-D1xjjWvG.d.mts +161 -0
- package/dist/browser/A-FrameSegment.entity-D7Aj39Wh.d.mts +146 -0
- package/dist/browser/bundle.d.mts +6 -2
- package/dist/browser/bundle.mjs +1 -1
- package/dist/browser/bundle.mjs.map +1 -1
- package/dist/browser/channel.d.mts +51 -74
- package/dist/browser/channel.mjs +1 -2
- package/dist/browser/channel.mjs.map +1 -1
- package/dist/browser/chunk-2RNFZSBL.mjs +2 -0
- package/dist/browser/chunk-2RNFZSBL.mjs.map +1 -0
- package/dist/browser/chunk-46LRNZRG.mjs +2 -0
- package/dist/browser/chunk-46LRNZRG.mjs.map +1 -0
- package/dist/browser/chunk-52HFO3OY.mjs +2 -0
- package/dist/browser/chunk-52HFO3OY.mjs.map +1 -0
- package/dist/browser/chunk-643KGQKR.mjs +3 -0
- package/dist/browser/chunk-643KGQKR.mjs.map +1 -0
- package/dist/browser/chunk-66BBIZAM.mjs +3 -0
- package/dist/browser/chunk-66BBIZAM.mjs.map +1 -0
- package/dist/browser/chunk-6NPQURSO.mjs +2 -0
- package/dist/browser/chunk-6NPQURSO.mjs.map +1 -0
- package/dist/browser/chunk-6WAOMX7M.mjs +2 -0
- package/dist/browser/chunk-6WAOMX7M.mjs.map +1 -0
- package/dist/browser/chunk-77HU5SRQ.mjs +2 -0
- package/dist/browser/chunk-77HU5SRQ.mjs.map +1 -0
- package/dist/browser/chunk-AET6XULU.mjs +2 -0
- package/dist/browser/chunk-AET6XULU.mjs.map +1 -0
- package/dist/browser/chunk-BIBPE2GT.mjs +3 -0
- package/dist/browser/chunk-BIBPE2GT.mjs.map +1 -0
- package/dist/browser/chunk-CDJKU4DK.mjs +2 -0
- package/dist/browser/chunk-CDJKU4DK.mjs.map +1 -0
- package/dist/browser/chunk-CT67Y46H.mjs +3 -0
- package/dist/browser/chunk-CT67Y46H.mjs.map +1 -0
- package/dist/browser/chunk-EFC7OUNO.mjs +2 -0
- package/dist/browser/chunk-EFC7OUNO.mjs.map +1 -0
- package/dist/browser/chunk-EJIX7H7A.mjs +2 -0
- package/dist/browser/chunk-EJIX7H7A.mjs.map +1 -0
- package/dist/browser/chunk-FHJ5ATND.mjs +3 -0
- package/dist/browser/chunk-FHJ5ATND.mjs.map +1 -0
- package/dist/browser/chunk-FVH2EEVP.mjs +3 -0
- package/dist/browser/chunk-FVH2EEVP.mjs.map +1 -0
- package/dist/browser/chunk-G6ULYKSU.mjs +2 -0
- package/dist/browser/chunk-G6ULYKSU.mjs.map +1 -0
- package/dist/browser/chunk-G7MKGKG5.mjs +2 -0
- package/dist/browser/chunk-G7MKGKG5.mjs.map +1 -0
- package/dist/browser/chunk-GOMJPGVB.mjs +3 -0
- package/dist/browser/chunk-GOMJPGVB.mjs.map +1 -0
- package/dist/browser/chunk-INQV5UZA.mjs +2 -0
- package/dist/browser/chunk-INQV5UZA.mjs.map +1 -0
- package/dist/browser/chunk-INXPVBTZ.mjs +2 -0
- package/dist/browser/chunk-INXPVBTZ.mjs.map +1 -0
- package/dist/browser/chunk-KFMVTZ7T.mjs +2 -0
- package/dist/browser/chunk-KFMVTZ7T.mjs.map +1 -0
- package/dist/browser/chunk-LK6C7C3S.mjs +2 -0
- package/dist/browser/chunk-LK6C7C3S.mjs.map +1 -0
- package/dist/browser/chunk-LOGRQOWP.mjs +3 -0
- package/dist/browser/chunk-LOGRQOWP.mjs.map +1 -0
- package/dist/browser/chunk-LZACYSUC.mjs +3 -0
- package/dist/browser/chunk-LZACYSUC.mjs.map +1 -0
- package/dist/browser/chunk-NTOIVRX3.mjs +2 -0
- package/dist/browser/chunk-NTOIVRX3.mjs.map +1 -0
- package/dist/browser/chunk-OES2N3X7.mjs +3 -0
- package/dist/browser/chunk-OES2N3X7.mjs.map +1 -0
- package/dist/browser/chunk-OFKV5GNB.mjs +1 -1
- package/dist/browser/chunk-OFKV5GNB.mjs.map +1 -1
- package/dist/browser/chunk-OVLM5A32.mjs +3 -0
- package/dist/browser/chunk-OVLM5A32.mjs.map +1 -0
- package/dist/browser/chunk-QATIN7CO.mjs +1 -1
- package/dist/browser/chunk-QATIN7CO.mjs.map +1 -1
- package/dist/browser/chunk-QOL7CAUZ.mjs +2 -0
- package/dist/browser/chunk-QOL7CAUZ.mjs.map +1 -0
- package/dist/browser/chunk-RCB3PX4V.mjs +2 -0
- package/dist/browser/chunk-RCB3PX4V.mjs.map +1 -0
- package/dist/browser/chunk-RWQSCROK.mjs +3 -0
- package/dist/browser/chunk-RWQSCROK.mjs.map +1 -0
- package/dist/browser/chunk-TIAUMK2X.mjs +2 -0
- package/dist/browser/chunk-TIAUMK2X.mjs.map +1 -0
- package/dist/browser/chunk-TQPC5MYM.mjs +3 -0
- package/dist/browser/chunk-TQPC5MYM.mjs.map +1 -0
- package/dist/browser/chunk-UNIKTCXL.mjs +3 -0
- package/dist/browser/chunk-UNIKTCXL.mjs.map +1 -0
- package/dist/browser/chunk-UULJJ5C5.mjs +3 -0
- package/dist/browser/chunk-UULJJ5C5.mjs.map +1 -0
- package/dist/browser/chunk-VSSANMPF.mjs +2 -0
- package/dist/browser/chunk-VSSANMPF.mjs.map +1 -0
- package/dist/browser/chunk-VW2BZYNY.mjs +2 -0
- package/dist/browser/chunk-VW2BZYNY.mjs.map +1 -0
- package/dist/browser/chunk-WAXBOWM6.mjs +3 -0
- package/dist/browser/chunk-WAXBOWM6.mjs.map +1 -0
- package/dist/browser/chunk-WXCQCHAX.mjs +2 -0
- package/dist/browser/chunk-WXCQCHAX.mjs.map +1 -0
- package/dist/browser/chunk-XKKBIIZG.mjs +3 -0
- package/dist/browser/chunk-XKKBIIZG.mjs.map +1 -0
- package/dist/browser/chunk-XR7FVA5M.mjs +3 -0
- package/dist/browser/chunk-XR7FVA5M.mjs.map +1 -0
- package/dist/browser/chunk-YQJFTBGV.mjs +1 -1
- package/dist/browser/chunk-YQJFTBGV.mjs.map +1 -1
- package/dist/browser/chunk-YTAMZDWC.mjs +3 -0
- package/dist/browser/chunk-YTAMZDWC.mjs.map +1 -0
- package/dist/browser/chunk-ZEONOTRL.mjs +2 -0
- package/dist/browser/chunk-ZEONOTRL.mjs.map +1 -0
- package/dist/browser/completion.d.mts +10 -0
- package/dist/browser/completion.mjs +2 -0
- package/dist/browser/completion.mjs.map +1 -0
- package/dist/browser/core.d.mts +7 -6
- package/dist/browser/core.mjs +1 -1
- package/dist/browser/core.mjs.map +1 -1
- package/dist/browser/credentials.d.mts +74 -0
- package/dist/browser/credentials.mjs +2 -0
- package/dist/browser/credentials.mjs.map +1 -0
- package/dist/browser/definition.d.mts +3 -2
- package/dist/browser/definition.mjs +1 -1
- package/dist/browser/dynamic-content.d.mts +13 -0
- package/dist/browser/dynamic-content.mjs +2 -0
- package/dist/browser/dynamic-content.mjs.map +1 -0
- package/dist/browser/dynamic-feature.d.mts +66 -6
- package/dist/browser/dynamic-feature.mjs +3 -1
- package/dist/browser/dynamic-feature.mjs.map +1 -1
- package/dist/browser/dynamic-structure.d.mts +77 -3
- package/dist/browser/dynamic-structure.mjs +1 -1
- package/dist/browser/dynamic-structure.mjs.map +1 -1
- package/dist/browser/env.d.mts +16 -2
- package/dist/browser/env.mjs +1 -1
- package/dist/browser/frame-index.d.mts +70 -9
- package/dist/browser/frame-index.mjs +1 -1
- package/dist/browser/models.d.mts +64 -0
- package/dist/browser/models.mjs +2 -0
- package/dist/browser/models.mjs.map +1 -0
- package/dist/browser/namespace.d.mts +1 -1
- package/dist/browser/namespace.mjs +1 -1
- package/dist/browser/schema.d.mts +10 -0
- package/dist/browser/schema.mjs +2 -0
- package/dist/browser/schema.mjs.map +1 -0
- package/dist/browser/segment.d.mts +13 -0
- package/dist/browser/segment.mjs +2 -0
- package/dist/browser/segment.mjs.map +1 -0
- package/dist/browser/storage.d.mts +13 -7
- package/dist/browser/storage.mjs +1 -1
- package/dist/browser/vector.d.mts +7 -0
- package/dist/browser/vector.mjs +1 -1
- package/dist/cli.cjs +5593 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/node/A-FrameChannel.component--YErPxf4.d.mts +97 -0
- package/dist/node/A-FrameChannel.component-BjgqMh1B.d.ts +97 -0
- package/dist/node/A-FrameChannel.component-C0O3TaRD.d.ts +679 -0
- package/dist/node/A-FrameChannel.component-CgBZYBz0.d.mts +379 -0
- package/dist/node/A-FrameChannel.component-CkZserv3.d.ts +97 -0
- package/dist/node/A-FrameChannel.component-DMA-3sUB.d.mts +679 -0
- package/dist/node/A-FrameChannel.component-DYV8omYR.d.ts +379 -0
- package/dist/node/A-FrameChannel.component-DwgYNfFn.d.mts +97 -0
- package/dist/node/A-FrameChannel.types-B3_xWKEO.d.mts +151 -0
- package/dist/node/A-FrameChannel.types-BGcVXTqa.d.ts +205 -0
- package/dist/node/A-FrameChannel.types-Boi8QqDK.d.mts +205 -0
- package/dist/node/A-FrameChannel.types-BsE6bNky.d.mts +205 -0
- package/dist/node/A-FrameChannel.types-C-gxXl8m.d.ts +151 -0
- package/dist/node/A-FrameChannel.types-DD2B11rf.d.ts +205 -0
- package/dist/node/A-FrameChannel.types-DYMgRiCF.d.mts +205 -0
- package/dist/node/A-FrameChannel.types-DwyZRsOy.d.ts +205 -0
- package/dist/node/A-FrameCompletion.entity-Brx11JMp.d.ts +72 -0
- package/dist/node/A-FrameCompletion.entity-Dzy9sIa8.d.mts +72 -0
- package/dist/node/A-FrameDefinition.entity-BIF0sclD.d.ts +370 -0
- package/dist/node/A-FrameDefinition.entity-Bt9ua6cn.d.ts +358 -0
- package/dist/node/A-FrameDefinition.entity-C0kzaGJ0.d.ts +143 -0
- package/dist/node/A-FrameDefinition.entity-C1aK-gdl.d.mts +370 -0
- package/dist/node/A-FrameDefinition.entity-CKPXsarS.d.mts +358 -0
- package/dist/node/A-FrameDefinition.entity-yA0GsBoe.d.mts +143 -0
- package/dist/node/A-FrameDefinition.types-BA_pLGpo.d.ts +232 -0
- package/dist/node/A-FrameDefinition.types-BT02yAhQ.d.mts +232 -0
- package/dist/node/A-FrameDynamicContentOperation.context-C_aH1gEn.d.ts +297 -0
- package/dist/node/A-FrameDynamicContentOperation.context-CoViNb19.d.mts +297 -0
- package/dist/node/A-FrameDynamicContentOperation.context-DRqH2c3o.d.ts +266 -0
- package/dist/node/A-FrameDynamicContentOperation.context-Dd7Lb7X2.d.mts +266 -0
- package/dist/node/A-FrameDynamicPatch.entity-BRuF1tqs.d.mts +29 -0
- package/dist/node/A-FrameDynamicPatch.entity-BRuF1tqs.d.ts +29 -0
- package/dist/node/A-FrameDynamicStructure.entity-BVCbolMd.d.ts +210 -0
- package/dist/node/A-FrameDynamicStructure.entity-DMvI_EPT.d.mts +210 -0
- package/dist/node/A-FrameDynamicStructure.entity-DxkPP9mR.d.mts +235 -0
- package/dist/node/A-FrameDynamicStructure.entity-DxkPP9mR.d.ts +235 -0
- package/dist/node/A-FrameLogger.component.env-node-DIDBeuiz.d.mts +114 -0
- package/dist/node/A-FrameLogger.component.env-node-DIDBeuiz.d.ts +114 -0
- package/dist/node/A-FrameNamespace.entity-BDg1FUgo.d.mts +136 -0
- package/dist/node/A-FrameNamespace.entity-HDXcLGcS.d.ts +136 -0
- package/dist/node/A-FrameSchema.entity-DjYIhsoj.d.mts +141 -0
- package/dist/node/A-FrameSchema.entity-DjYIhsoj.d.ts +141 -0
- package/dist/node/A-FrameSegment.entity-C0izuOmC.d.ts +161 -0
- package/dist/node/A-FrameSegment.entity-CMCgFCWU.d.ts +146 -0
- package/dist/node/A-FrameSegment.entity-D1xjjWvG.d.mts +161 -0
- package/dist/node/A-FrameSegment.entity-D7Aj39Wh.d.mts +146 -0
- package/dist/node/A-FrameStorage.component-BnNKzvpY.d.mts +107 -0
- package/dist/node/A-FrameStorage.component-CDztogHV.d.mts +107 -0
- package/dist/node/A-FrameStorage.component-CW0YgKDI.d.mts +107 -0
- package/dist/node/A-FrameStorage.component-D4UEkIBx.d.mts +107 -0
- package/dist/node/A-FrameStorage.component-DV_jwK6r.d.ts +107 -0
- package/dist/node/A-FrameStorage.component-Di4EvbtC.d.ts +107 -0
- package/dist/node/A-FrameStorage.component-emIH1a1M.d.ts +107 -0
- package/dist/node/A-FrameStorage.component-y-JPiIQ4.d.ts +107 -0
- package/dist/node/bundle.cjs +66 -21
- package/dist/node/bundle.cjs.map +1 -1
- package/dist/node/bundle.d.mts +88 -24
- package/dist/node/bundle.d.ts +88 -24
- package/dist/node/bundle.mjs +65 -20
- package/dist/node/bundle.mjs.map +1 -1
- package/dist/node/channel.cjs +33 -26
- package/dist/node/channel.d.mts +10 -6
- package/dist/node/channel.d.ts +10 -6
- package/dist/node/channel.mjs +13 -6
- package/dist/node/chunk-2HUSP34L.mjs +55 -0
- package/dist/node/chunk-2HUSP34L.mjs.map +1 -0
- package/dist/node/chunk-2KXGI2E5.cjs +474 -0
- package/dist/node/chunk-2KXGI2E5.cjs.map +1 -0
- package/dist/node/chunk-2OQMOIR5.mjs +170 -0
- package/dist/node/chunk-2OQMOIR5.mjs.map +1 -0
- package/dist/node/chunk-2UI7RJ4Q.mjs +207 -0
- package/dist/node/chunk-2UI7RJ4Q.mjs.map +1 -0
- package/dist/node/chunk-3SLICJ3L.cjs +265 -0
- package/dist/node/chunk-3SLICJ3L.cjs.map +1 -0
- package/dist/node/chunk-3ZDHQOIU.cjs +92 -0
- package/dist/node/chunk-3ZDHQOIU.cjs.map +1 -0
- package/dist/node/chunk-5BKCX2RO.mjs +1 -1
- package/dist/node/chunk-5BKCX2RO.mjs.map +1 -1
- package/dist/node/chunk-5NCGXLP2.mjs +6 -0
- package/dist/node/chunk-5NCGXLP2.mjs.map +1 -0
- package/dist/node/chunk-5OTXZ7BB.mjs +53 -0
- package/dist/node/chunk-5OTXZ7BB.mjs.map +1 -0
- package/dist/node/chunk-5PYIATGT.mjs +469 -0
- package/dist/node/chunk-5PYIATGT.mjs.map +1 -0
- package/dist/node/chunk-64QCZG53.cjs +57 -0
- package/dist/node/chunk-64QCZG53.cjs.map +1 -0
- package/dist/node/chunk-652OEICJ.cjs +4 -0
- package/dist/node/chunk-652OEICJ.cjs.map +1 -0
- package/dist/node/chunk-674ZX6XJ.mjs +187 -0
- package/dist/node/chunk-674ZX6XJ.mjs.map +1 -0
- package/dist/node/chunk-6ID2IXYX.mjs +6 -0
- package/dist/node/chunk-6ID2IXYX.mjs.map +1 -0
- package/dist/node/chunk-7EM3Q7HA.mjs +655 -0
- package/dist/node/chunk-7EM3Q7HA.mjs.map +1 -0
- package/dist/node/chunk-7MVVMISA.cjs +293 -0
- package/dist/node/chunk-7MVVMISA.cjs.map +1 -0
- package/dist/node/chunk-7NSLGCAZ.mjs +1395 -0
- package/dist/node/chunk-7NSLGCAZ.mjs.map +1 -0
- package/dist/node/chunk-7OLLATCC.mjs +1289 -0
- package/dist/node/chunk-7OLLATCC.mjs.map +1 -0
- package/dist/node/chunk-7SEZMRLI.cjs +183 -0
- package/dist/node/chunk-7SEZMRLI.cjs.map +1 -0
- package/dist/node/chunk-A4CVDMSV.mjs +608 -0
- package/dist/node/chunk-A4CVDMSV.mjs.map +1 -0
- package/dist/node/chunk-A7CJIUYY.cjs +4 -0
- package/dist/node/chunk-A7CJIUYY.cjs.map +1 -0
- package/dist/node/chunk-ALFFUJ2J.mjs +163 -0
- package/dist/node/chunk-ALFFUJ2J.mjs.map +1 -0
- package/dist/node/chunk-AMMQ76RJ.mjs +179 -0
- package/dist/node/chunk-AMMQ76RJ.mjs.map +1 -0
- package/dist/node/chunk-AUKWKGVA.cjs +688 -0
- package/dist/node/chunk-AUKWKGVA.cjs.map +1 -0
- package/dist/node/chunk-AY6UMDWD.cjs +270 -0
- package/dist/node/chunk-AY6UMDWD.cjs.map +1 -0
- package/dist/node/chunk-B7ZDJXD3.cjs +1 -1
- package/dist/node/chunk-B7ZDJXD3.cjs.map +1 -1
- package/dist/node/chunk-BBYOL3LM.cjs +1308 -0
- package/dist/node/chunk-BBYOL3LM.cjs.map +1 -0
- package/dist/node/chunk-BINGAHFW.cjs +1308 -0
- package/dist/node/chunk-BINGAHFW.cjs.map +1 -0
- package/dist/node/chunk-BSBY37MG.cjs +55 -0
- package/dist/node/chunk-BSBY37MG.cjs.map +1 -0
- package/dist/node/chunk-BWX7HFTH.cjs +209 -0
- package/dist/node/chunk-BWX7HFTH.cjs.map +1 -0
- package/dist/node/chunk-C37B34MH.cjs +188 -0
- package/dist/node/chunk-C37B34MH.cjs.map +1 -0
- package/dist/node/chunk-C6BBKHQG.cjs +250 -0
- package/dist/node/chunk-C6BBKHQG.cjs.map +1 -0
- package/dist/node/chunk-CLCAS67N.cjs +8 -0
- package/dist/node/chunk-CLCAS67N.cjs.map +1 -0
- package/dist/node/chunk-CNU3CRTR.mjs +43 -0
- package/dist/node/chunk-CNU3CRTR.mjs.map +1 -0
- package/dist/node/chunk-CV5FPKU6.mjs +6 -0
- package/dist/node/chunk-CV5FPKU6.mjs.map +1 -0
- package/dist/node/chunk-CZYOAFIR.mjs +129 -0
- package/dist/node/chunk-CZYOAFIR.mjs.map +1 -0
- package/dist/node/chunk-D2HTYEJZ.cjs +209 -0
- package/dist/node/chunk-D2HTYEJZ.cjs.map +1 -0
- package/dist/node/chunk-EMLZZPOT.cjs +1446 -0
- package/dist/node/chunk-EMLZZPOT.cjs.map +1 -0
- package/dist/node/chunk-EOIXXXBV.cjs +55 -0
- package/dist/node/chunk-EOIXXXBV.cjs.map +1 -0
- package/dist/node/chunk-F4UCOZW5.mjs +1 -1
- package/dist/node/chunk-F4UCOZW5.mjs.map +1 -1
- package/dist/node/chunk-F64CK4NI.mjs +53 -0
- package/dist/node/chunk-F64CK4NI.mjs.map +1 -0
- package/dist/node/chunk-FAV62EUG.cjs +35 -0
- package/dist/node/chunk-FAV62EUG.cjs.map +1 -0
- package/dist/node/chunk-GHSPKZUN.mjs +529 -0
- package/dist/node/chunk-GHSPKZUN.mjs.map +1 -0
- package/dist/node/chunk-GRNVK7DW.mjs +97 -0
- package/dist/node/chunk-GRNVK7DW.mjs.map +1 -0
- package/dist/node/chunk-H5VGRPD5.cjs +8 -0
- package/dist/node/chunk-H5VGRPD5.cjs.map +1 -0
- package/dist/node/chunk-HAMDDCPS.cjs +8 -0
- package/dist/node/chunk-HAMDDCPS.cjs.map +1 -0
- package/dist/node/chunk-HAORARSB.cjs +75 -0
- package/dist/node/chunk-HAORARSB.cjs.map +1 -0
- package/dist/node/chunk-HELNAM5Y.cjs +8 -0
- package/dist/node/chunk-HELNAM5Y.cjs.map +1 -0
- package/dist/node/chunk-HET6L5PD.mjs +530 -0
- package/dist/node/chunk-HET6L5PD.mjs.map +1 -0
- package/dist/node/chunk-HI5SEX53.mjs +264 -0
- package/dist/node/chunk-HI5SEX53.mjs.map +1 -0
- package/dist/node/chunk-HZGFXE4Q.mjs +6 -0
- package/dist/node/chunk-HZGFXE4Q.mjs.map +1 -0
- package/dist/node/chunk-IAL2NK2V.mjs +73 -0
- package/dist/node/chunk-IAL2NK2V.mjs.map +1 -0
- package/dist/node/chunk-IHELFDCW.mjs +327 -0
- package/dist/node/chunk-IHELFDCW.mjs.map +1 -0
- package/dist/node/chunk-ILD6OSYW.mjs +966 -0
- package/dist/node/chunk-ILD6OSYW.mjs.map +1 -0
- package/dist/node/chunk-IP6DFAO7.mjs +264 -0
- package/dist/node/chunk-IP6DFAO7.mjs.map +1 -0
- package/dist/node/chunk-IYEDO7OQ.cjs +276 -0
- package/dist/node/chunk-IYEDO7OQ.cjs.map +1 -0
- package/dist/node/chunk-JFPGFPQD.mjs +1413 -0
- package/dist/node/chunk-JFPGFPQD.mjs.map +1 -0
- package/dist/node/chunk-JHZGTVYF.cjs +999 -0
- package/dist/node/chunk-JHZGTVYF.cjs.map +1 -0
- package/dist/node/chunk-JN3UJBUH.mjs +608 -0
- package/dist/node/chunk-JN3UJBUH.mjs.map +1 -0
- package/dist/node/chunk-JNPDXCCN.mjs +530 -0
- package/dist/node/chunk-JNPDXCCN.mjs.map +1 -0
- package/dist/node/chunk-JQBYDEMW.mjs +1 -1
- package/dist/node/chunk-JQBYDEMW.mjs.map +1 -1
- package/dist/node/chunk-JQJ7N4NL.cjs +267 -0
- package/dist/node/chunk-JQJ7N4NL.cjs.map +1 -0
- package/dist/node/chunk-K4AJBPPY.cjs +174 -0
- package/dist/node/chunk-K4AJBPPY.cjs.map +1 -0
- package/dist/node/chunk-K7SXPJPK.cjs +131 -0
- package/dist/node/chunk-K7SXPJPK.cjs.map +1 -0
- package/dist/node/chunk-KFW4GE7H.mjs +1289 -0
- package/dist/node/chunk-KFW4GE7H.mjs.map +1 -0
- package/dist/node/chunk-KKL2DF2D.cjs +518 -0
- package/dist/node/chunk-KKL2DF2D.cjs.map +1 -0
- package/dist/node/chunk-KKMKQGTR.cjs +620 -0
- package/dist/node/chunk-KKMKQGTR.cjs.map +1 -0
- package/dist/node/chunk-KNTO7FCZ.mjs +207 -0
- package/dist/node/chunk-KNTO7FCZ.mjs.map +1 -0
- package/dist/node/chunk-KTKVW3PH.mjs +286 -0
- package/dist/node/chunk-KTKVW3PH.mjs.map +1 -0
- package/dist/node/chunk-KZPSF32W.mjs +33 -0
- package/dist/node/chunk-KZPSF32W.mjs.map +1 -0
- package/dist/node/chunk-LWKFCMA7.mjs +129 -0
- package/dist/node/chunk-LWKFCMA7.mjs.map +1 -0
- package/dist/node/chunk-M2ZSE6YJ.mjs +512 -0
- package/dist/node/chunk-M2ZSE6YJ.mjs.map +1 -0
- package/dist/node/chunk-M6DJYGDO.cjs +167 -0
- package/dist/node/chunk-M6DJYGDO.cjs.map +1 -0
- package/dist/node/chunk-MAHKDTOQ.mjs +3 -0
- package/dist/node/chunk-MAHKDTOQ.mjs.map +1 -0
- package/dist/node/chunk-MM2R2OM6.cjs +541 -0
- package/dist/node/chunk-MM2R2OM6.cjs.map +1 -0
- package/dist/node/chunk-MSOD5UQH.cjs +45 -0
- package/dist/node/chunk-MSOD5UQH.cjs.map +1 -0
- package/dist/node/chunk-MVAWR76Q.cjs +276 -0
- package/dist/node/chunk-MVAWR76Q.cjs.map +1 -0
- package/dist/node/chunk-MXUO7OR5.cjs +97 -0
- package/dist/node/chunk-MXUO7OR5.cjs.map +1 -0
- package/dist/node/chunk-N4THTV6P.cjs +131 -0
- package/dist/node/chunk-N4THTV6P.cjs.map +1 -0
- package/dist/node/chunk-NIXKAQVP.cjs +1 -1
- package/dist/node/chunk-NIXKAQVP.cjs.map +1 -1
- package/dist/node/chunk-NUPXUUPM.cjs +1428 -0
- package/dist/node/chunk-NUPXUUPM.cjs.map +1 -0
- package/dist/node/chunk-NWOUVAIS.cjs +45 -0
- package/dist/node/chunk-NWOUVAIS.cjs.map +1 -0
- package/dist/node/chunk-OK7I5OQ3.mjs +89 -0
- package/dist/node/chunk-OK7I5OQ3.mjs.map +1 -0
- package/dist/node/chunk-OMGYXCFM.mjs +248 -0
- package/dist/node/chunk-OMGYXCFM.mjs.map +1 -0
- package/dist/node/chunk-OYZAQMKD.mjs +263 -0
- package/dist/node/chunk-OYZAQMKD.mjs.map +1 -0
- package/dist/node/chunk-P2LULMNL.cjs +189 -0
- package/dist/node/chunk-P2LULMNL.cjs.map +1 -0
- package/dist/node/chunk-PABEFHCO.mjs +63 -0
- package/dist/node/chunk-PABEFHCO.mjs.map +1 -0
- package/dist/node/chunk-Q5NYJQP2.cjs +8 -0
- package/dist/node/chunk-Q5NYJQP2.cjs.map +1 -0
- package/dist/node/chunk-QCEWWJ3N.cjs +65 -0
- package/dist/node/chunk-QCEWWJ3N.cjs.map +1 -0
- package/dist/node/chunk-QW4AZ3Z2.cjs +542 -0
- package/dist/node/chunk-QW4AZ3Z2.cjs.map +1 -0
- package/dist/node/chunk-RK5WSZ5J.mjs +43 -0
- package/dist/node/chunk-RK5WSZ5J.mjs.map +1 -0
- package/dist/node/chunk-RPHYBPXT.mjs +30 -0
- package/dist/node/chunk-RPHYBPXT.mjs.map +1 -0
- package/dist/node/chunk-RVXASBMQ.mjs +273 -0
- package/dist/node/chunk-RVXASBMQ.mjs.map +1 -0
- package/dist/node/chunk-RVZTZD32.mjs +187 -0
- package/dist/node/chunk-RVZTZD32.mjs.map +1 -0
- package/dist/node/chunk-RWLKISZQ.mjs +273 -0
- package/dist/node/chunk-RWLKISZQ.mjs.map +1 -0
- package/dist/node/chunk-SESXQJDD.cjs +999 -0
- package/dist/node/chunk-SESXQJDD.cjs.map +1 -0
- package/dist/node/chunk-SKIEPTFS.mjs +6 -0
- package/dist/node/chunk-SKIEPTFS.mjs.map +1 -0
- package/dist/node/chunk-SL7FT5R5.mjs +94 -0
- package/dist/node/chunk-SL7FT5R5.mjs.map +1 -0
- package/dist/node/chunk-SXHQW74T.mjs +43 -0
- package/dist/node/chunk-SXHQW74T.mjs.map +1 -0
- package/dist/node/chunk-TEJKDVNT.cjs +620 -0
- package/dist/node/chunk-TEJKDVNT.cjs.map +1 -0
- package/dist/node/chunk-TQS5WYND.cjs +352 -0
- package/dist/node/chunk-TQS5WYND.cjs.map +1 -0
- package/dist/node/chunk-UCAWV2IG.mjs +184 -0
- package/dist/node/chunk-UCAWV2IG.mjs.map +1 -0
- package/dist/node/chunk-UDUJDEAO.cjs +189 -0
- package/dist/node/chunk-UDUJDEAO.cjs.map +1 -0
- package/dist/node/chunk-VMJDL4SS.cjs +542 -0
- package/dist/node/chunk-VMJDL4SS.cjs.map +1 -0
- package/dist/node/chunk-VNOZTB3B.cjs +8 -0
- package/dist/node/chunk-VNOZTB3B.cjs.map +1 -0
- package/dist/node/chunk-VPMBZGYR.mjs +327 -0
- package/dist/node/chunk-VPMBZGYR.mjs.map +1 -0
- package/dist/node/chunk-WEPNBKOA.mjs +6 -0
- package/dist/node/chunk-WEPNBKOA.mjs.map +1 -0
- package/dist/node/chunk-WTBRJXFG.cjs +100 -0
- package/dist/node/chunk-WTBRJXFG.cjs.map +1 -0
- package/dist/node/chunk-WXCQCHAX.mjs +3 -0
- package/dist/node/chunk-WXCQCHAX.mjs.map +1 -0
- package/dist/node/chunk-X3TRPYGV.cjs +352 -0
- package/dist/node/chunk-X3TRPYGV.cjs.map +1 -0
- package/dist/node/chunk-XFUF7SDO.cjs +1 -1
- package/dist/node/chunk-XFUF7SDO.cjs.map +1 -1
- package/dist/node/chunk-XP2EPEBM.mjs +966 -0
- package/dist/node/chunk-XP2EPEBM.mjs.map +1 -0
- package/dist/node/chunk-XPIJ6BKP.cjs +45 -0
- package/dist/node/chunk-XPIJ6BKP.cjs.map +1 -0
- package/dist/node/chunk-YRVBMP7I.cjs +542 -0
- package/dist/node/chunk-YRVBMP7I.cjs.map +1 -0
- package/dist/node/chunk-ZIHSN5EE.mjs +530 -0
- package/dist/node/chunk-ZIHSN5EE.mjs.map +1 -0
- package/dist/node/chunk-ZNQMUU7I.cjs +32 -0
- package/dist/node/chunk-ZNQMUU7I.cjs.map +1 -0
- package/dist/node/completion.cjs +23 -0
- package/dist/node/completion.cjs.map +1 -0
- package/dist/node/completion.d.mts +10 -0
- package/dist/node/completion.d.ts +10 -0
- package/dist/node/completion.mjs +6 -0
- package/dist/node/completion.mjs.map +1 -0
- package/dist/node/core.cjs +67 -38
- package/dist/node/core.cjs.map +1 -1
- package/dist/node/core.d.mts +13 -8
- package/dist/node/core.d.ts +13 -8
- package/dist/node/core.mjs +58 -29
- package/dist/node/core.mjs.map +1 -1
- package/dist/node/credentials.cjs +17 -0
- package/dist/node/credentials.cjs.map +1 -0
- package/dist/node/credentials.d.mts +74 -0
- package/dist/node/credentials.d.ts +74 -0
- package/dist/node/credentials.mjs +4 -0
- package/dist/node/credentials.mjs.map +1 -0
- package/dist/node/definition.cjs +6 -4
- package/dist/node/definition.d.mts +3 -2
- package/dist/node/definition.d.ts +3 -2
- package/dist/node/definition.mjs +4 -2
- package/dist/node/dynamic-content.cjs +30 -0
- package/dist/node/dynamic-content.cjs.map +1 -0
- package/dist/node/dynamic-content.d.mts +13 -0
- package/dist/node/dynamic-content.d.ts +13 -0
- package/dist/node/dynamic-content.mjs +9 -0
- package/dist/node/dynamic-content.mjs.map +1 -0
- package/dist/node/dynamic-feature.cjs +41 -7
- package/dist/node/dynamic-feature.cjs.map +1 -1
- package/dist/node/dynamic-feature.d.mts +66 -6
- package/dist/node/dynamic-feature.d.ts +66 -6
- package/dist/node/dynamic-feature.mjs +16 -9
- package/dist/node/dynamic-feature.mjs.map +1 -1
- package/dist/node/dynamic-structure.cjs +45 -136
- package/dist/node/dynamic-structure.cjs.map +1 -1
- package/dist/node/dynamic-structure.d.mts +77 -3
- package/dist/node/dynamic-structure.d.ts +77 -3
- package/dist/node/dynamic-structure.mjs +16 -135
- package/dist/node/dynamic-structure.mjs.map +1 -1
- package/dist/node/env.cjs +3 -3
- package/dist/node/env.d.mts +26 -0
- package/dist/node/env.d.ts +26 -0
- package/dist/node/env.mjs +2 -2
- package/dist/node/frame-index.cjs +7 -4
- package/dist/node/frame-index.d.mts +70 -9
- package/dist/node/frame-index.d.ts +70 -9
- package/dist/node/frame-index.mjs +6 -3
- package/dist/node/logger.d.mts +4 -113
- package/dist/node/logger.d.ts +4 -113
- package/dist/node/models.cjs +14 -0
- package/dist/node/models.cjs.map +1 -0
- package/dist/node/models.d.mts +64 -0
- package/dist/node/models.d.ts +64 -0
- package/dist/node/models.mjs +5 -0
- package/dist/node/models.mjs.map +1 -0
- package/dist/node/namespace.cjs +7 -5
- package/dist/node/namespace.d.mts +1 -1
- package/dist/node/namespace.d.ts +1 -1
- package/dist/node/namespace.mjs +4 -2
- package/dist/node/schema.cjs +22 -0
- package/dist/node/schema.cjs.map +1 -0
- package/dist/node/schema.d.mts +10 -0
- package/dist/node/schema.d.ts +10 -0
- package/dist/node/schema.mjs +5 -0
- package/dist/node/schema.mjs.map +1 -0
- package/dist/node/segment.cjs +25 -0
- package/dist/node/segment.cjs.map +1 -0
- package/dist/node/segment.d.mts +13 -0
- package/dist/node/segment.d.ts +13 -0
- package/dist/node/segment.mjs +8 -0
- package/dist/node/segment.mjs.map +1 -0
- package/dist/node/storage.cjs +17 -14
- package/dist/node/storage.d.mts +18 -6
- package/dist/node/storage.d.ts +18 -6
- package/dist/node/storage.mjs +11 -8
- package/dist/node/vector.cjs +2 -2
- package/dist/node/vector.d.mts +7 -0
- package/dist/node/vector.d.ts +7 -0
- package/dist/node/vector.mjs +1 -1
- package/examples/article/main.ts +358 -0
- package/examples/components.ts +660 -0
- package/examples/feature/file-system.components.ts +211 -0
- package/examples/feature/main.ts +374 -0
- package/examples/interaction/main.ts +426 -0
- package/examples/logger.ts +126 -0
- package/examples/structure/main.ts +195 -0
- package/examples/structure/renderer.ts +296 -0
- package/examples/structure/server-app.components.ts +387 -0
- package/jest.config.browser.ts +9 -0
- package/jest.config.examples.ts +49 -0
- package/jest.config.integration.ts +38 -0
- package/jest.config.ts +56 -27
- package/jest.config.unit.ts +38 -0
- package/package.json +75 -7
- package/src/index.ts +13 -0
- package/src/lib/A-Frame/A-Frame.component.env-browser.ts +14 -3
- package/src/lib/A-Frame/A-Frame.component.env-node.ts +45 -15
- package/src/lib/A-Frame/A-Frame.context.ts +9 -8
- package/src/lib/A-Frame/decorators/A-FrameDefine.decorator.ts +4 -4
- package/src/lib/A-FrameBundle/A-FrameBundle.builder.env-node.ts +95 -25
- package/src/lib/A-FrameBundle/A-FrameBundle.constants.ts +1 -1
- package/src/lib/A-FrameBundle/A-FrameBundle.types.ts +54 -13
- package/src/lib/A-FrameBundle/index.browser.ts +1 -1
- package/src/lib/A-FrameBundle/index.ts +1 -1
- package/src/lib/A-FrameCLI/A-FrameCLI.container.ts +18 -7
- package/src/lib/A-FrameChannel/A-FrameChannel.component.env-browser.ts +0 -2
- package/src/lib/A-FrameChannel/A-FrameChannel.component.env-node.ts +14 -15
- package/src/lib/A-FrameChannel/A-FrameChannel.component.ts +542 -7
- package/src/lib/A-FrameChannel/A-FrameChannel.constants.ts +2 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.types.ts +65 -1
- package/src/lib/A-FrameChannel/A-FrameChannelDsgStream.entity.ts +112 -0
- package/src/lib/A-FrameChannel/A-FrameChannelStream.entity.ts +1 -0
- package/src/lib/A-FrameChannel/index.browser.ts +5 -0
- package/src/lib/A-FrameCompletion/A-FrameCompletion.constants.ts +3 -0
- package/src/lib/A-FrameCompletion/A-FrameCompletion.entity.ts +128 -0
- package/src/lib/A-FrameCompletion/A-FrameCompletion.types.ts +40 -0
- package/src/lib/A-FrameCompletion/index.ts +3 -0
- package/src/lib/A-FrameCredentials/A-FrameCredentials.constants.ts +5 -0
- package/src/lib/A-FrameCredentials/A-FrameCredentials.entity.ts +120 -0
- package/src/lib/A-FrameCredentials/A-FrameCredentials.types.ts +39 -0
- package/src/lib/A-FrameCredentials/index.ts +3 -0
- package/src/lib/A-FrameDefinition/A-FrameDefinition.entity.ts +23 -1
- package/src/lib/A-FrameDefinition/A-FrameDefinition.types.ts +34 -1
- package/src/lib/A-FrameDynamicContent/A-FrameDynamicContent.constants.ts +5 -0
- package/src/lib/A-FrameDynamicContent/A-FrameDynamicContent.entity.ts +348 -0
- package/src/lib/A-FrameDynamicContent/A-FrameDynamicContent.error.ts +10 -0
- package/src/lib/A-FrameDynamicContent/A-FrameDynamicContent.types.ts +116 -0
- package/src/lib/A-FrameDynamicContent/A-FrameDynamicContentIndex.context.ts +288 -0
- package/src/lib/A-FrameDynamicContent/A-FrameDynamicContentOperation.context.ts +26 -0
- package/src/lib/A-FrameDynamicContent/index.ts +5 -0
- package/src/lib/A-FrameDynamicFeature/A-FrameDynamicFeature.constants.ts +6 -0
- package/src/lib/A-FrameDynamicFeature/A-FrameDynamicFeature.entity.ts +253 -4
- package/src/lib/A-FrameDynamicFeature/A-FrameDynamicFeature.error.ts +11 -0
- package/src/lib/A-FrameDynamicFeature/A-FrameDynamicFeature.types.ts +188 -4
- package/src/lib/A-FrameDynamicFeature/A-FrameDynamicFeatureOperation.context.ts +33 -0
- package/src/lib/A-FrameDynamicFeature/A-FrameMethodMapIndex.context.ts +99 -0
- package/src/lib/A-FrameDynamicFeature/A-FrameMethodMapper.component.ts +182 -0
- package/src/lib/A-FrameDynamicFeature/index.ts +6 -1
- package/src/lib/A-FrameDynamicPatch/index.ts +2 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameComponentMapIndex.context.ts +99 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameComponentMapper.component.ts +320 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructure.constants.ts +2 -1
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructure.entity.ts +240 -128
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructure.types.ts +183 -87
- package/src/lib/A-FrameDynamicStructure/index.ts +3 -0
- package/src/lib/A-FrameEnv/A-FrameEnv.fragment.env-browser.ts +5 -1
- package/src/lib/A-FrameEnv/A-FrameEnv.fragment.env-node.ts +23 -1
- package/src/lib/A-FrameEnv/A-FrameEnv.types.ts +12 -0
- package/src/lib/A-FrameIndex/A-FrameIndex.context.ts +63 -13
- package/src/lib/A-FrameIndex/A-FrameIndex.types.ts +53 -0
- package/src/lib/A-FrameModels/A-FrameModels.constants.ts +75 -0
- package/src/lib/A-FrameModels/index.ts +1 -0
- package/src/lib/A-FrameNamespace/A-FrameNamespace.entity.ts +10 -3
- package/src/lib/A-FrameNamespace/A-FrameNamespace.types.ts +5 -0
- package/src/lib/A-FrameSchema/A-FrameSchema.constants.ts +4 -0
- package/src/lib/A-FrameSchema/A-FrameSchema.entity.ts +154 -0
- package/src/lib/A-FrameSchema/A-FrameSchema.types.ts +88 -0
- package/src/lib/A-FrameSchema/index.ts +3 -0
- package/src/lib/A-FrameSegment/A-FrameSegment.constants.ts +12 -0
- package/src/lib/A-FrameSegment/A-FrameSegment.entity.ts +221 -0
- package/src/lib/A-FrameSegment/A-FrameSegment.types.ts +91 -0
- package/src/lib/A-FrameSegment/index.ts +3 -0
- package/src/lib/A-FrameStorage/A-FrameStorage.codec.ts +10 -4
- package/src/lib/A-FrameStorage/browser/A-FrameBrowserStorage.component.ts +21 -0
- package/src/lib/A-FrameStorage/browser/A-FrameBrowserStorageBlobs.context.ts +39 -21
- package/src/lib/A-FrameStorage/node/A-FrameNodeStorage.component.ts +124 -42
- package/src/lib/A-FrameVector/A-FrameVector.entity.ts +24 -0
- package/tests/A-Frame.browser.test.ts +167 -57
- package/tests/A-FrameDynamicContent.browser.test.ts +74 -0
- package/tests/integration/A-Frame.integration.test.ts +272 -0
- package/tests/integration/A-FrameCompletion.integration.test.ts +88 -0
- package/tests/integration/A-FrameContentMapping.integration.test.ts +261 -0
- package/tests/integration/A-FrameDefinition.integration.test.ts +154 -0
- package/tests/integration/A-FrameDynamicContent.integration.test.ts +126 -0
- package/tests/integration/A-FrameDynamicFeature.integration.test.ts +337 -0
- package/tests/integration/A-FrameDynamicStructure.integration.test.ts +264 -0
- package/tests/integration/A-FrameNamespace.integration.test.ts +109 -0
- package/tests/integration/A-FrameSchema.integration.test.ts +74 -0
- package/tests/integration/A-FrameSegment.integration.test.ts +102 -0
- package/tests/integration/A-FrameStorage.integration.test.ts +598 -0
- package/tests/jest.setup.browser.ts +1 -1
- package/tests/jest.setup.ts +4 -0
- package/tests/jest.setup.unit.ts +30 -0
- package/tests/unit/A-FrameChannel.unit.test.ts +124 -0
- package/tests/unit/A-FrameCompletion.unit.test.ts +25 -0
- package/tests/unit/A-FrameDefinition.unit.test.ts +36 -0
- package/tests/unit/A-FrameDynamicContent.unit.test.ts +28 -0
- package/tests/unit/A-FrameNamespace.unit.test.ts +35 -0
- package/tests/unit/A-FrameSchema.unit.test.ts +31 -0
- package/tests/unit/A-FrameSegment.unit.test.ts +20 -0
- package/tests/unit/mocks/MockA_FrameChannel.ts +112 -0
- package/tsconfig.browser.json +2 -0
- package/tsconfig.json +6 -0
- package/tsup.config.ts +52 -0
- package/tests/A-Frame.test.ts +0 -98
|
@@ -0,0 +1,1446 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk7MVVMISA_cjs = require('./chunk-7MVVMISA.cjs');
|
|
4
|
+
var chunkBWX7HFTH_cjs = require('./chunk-BWX7HFTH.cjs');
|
|
5
|
+
var chunkXPIJ6BKP_cjs = require('./chunk-XPIJ6BKP.cjs');
|
|
6
|
+
var chunkK4AJBPPY_cjs = require('./chunk-K4AJBPPY.cjs');
|
|
7
|
+
var chunkJQJ7N4NL_cjs = require('./chunk-JQJ7N4NL.cjs');
|
|
8
|
+
var chunkZM2RLVVH_cjs = require('./chunk-ZM2RLVVH.cjs');
|
|
9
|
+
var chunkQCEWWJ3N_cjs = require('./chunk-QCEWWJ3N.cjs');
|
|
10
|
+
var chunkQFHZIG7Y_cjs = require('./chunk-QFHZIG7Y.cjs');
|
|
11
|
+
var aConcept = require('@adaas/a-concept');
|
|
12
|
+
var http = require('http');
|
|
13
|
+
var https = require('https');
|
|
14
|
+
|
|
15
|
+
function _interopNamespace(e) {
|
|
16
|
+
if (e && e.__esModule) return e;
|
|
17
|
+
var n = Object.create(null);
|
|
18
|
+
if (e) {
|
|
19
|
+
Object.keys(e).forEach(function (k) {
|
|
20
|
+
if (k !== 'default') {
|
|
21
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
22
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return e[k]; }
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
n.default = e;
|
|
30
|
+
return Object.freeze(n);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var http__namespace = /*#__PURE__*/_interopNamespace(http);
|
|
34
|
+
var https__namespace = /*#__PURE__*/_interopNamespace(https);
|
|
35
|
+
|
|
36
|
+
// src/lib/A-FrameChannel/A-FrameChannel.constants.ts
|
|
37
|
+
var A_FrameFeatures = {
|
|
38
|
+
Request: "_A_FRAME_REQUEST",
|
|
39
|
+
Socket: "_A_FRAME_SOCKET",
|
|
40
|
+
Stream: "_A_FRAME_STREAM",
|
|
41
|
+
Send: "_A_FRAME_SEND"
|
|
42
|
+
};
|
|
43
|
+
var A_FrameChannelStreamStatuses = {
|
|
44
|
+
Open: "open",
|
|
45
|
+
Closed: "closed"
|
|
46
|
+
};
|
|
47
|
+
var A_FrameChannelStreamFeatures = {
|
|
48
|
+
open: "_A_FRAME_CHANNEL_STREAM_OPEN",
|
|
49
|
+
send: "_A_FRAME_CHANNEL_STREAM_SEND",
|
|
50
|
+
onEvent: "_A_FRAME_CHANNEL_STREAM_ON_EVENT",
|
|
51
|
+
onError: "_A_FRAME_CHANNEL_STREAM_ON_ERROR",
|
|
52
|
+
onComplete: "_A_FRAME_CHANNEL_STREAM_ON_COMPLETE",
|
|
53
|
+
onClose: "_A_FRAME_CHANNEL_STREAM_ON_CLOSE"
|
|
54
|
+
};
|
|
55
|
+
var A_FrameChannelSocketStatuses = {
|
|
56
|
+
Connecting: "connecting",
|
|
57
|
+
Open: "open",
|
|
58
|
+
Closed: "closed"
|
|
59
|
+
};
|
|
60
|
+
var A_FrameChannelSocketFeatures = {
|
|
61
|
+
onEvent: "_A_FRAME_CHANNEL_SOCKET_ON_EVENT",
|
|
62
|
+
onError: "_A_FRAME_CHANNEL_SOCKET_ON_ERROR",
|
|
63
|
+
onOpen: "_A_FRAME_CHANNEL_SOCKET_ON_OPEN",
|
|
64
|
+
onClose: "_A_FRAME_CHANNEL_SOCKET_ON_CLOSE"
|
|
65
|
+
};
|
|
66
|
+
var A_FrameChannelRequest = class extends aConcept.A_Fragment {
|
|
67
|
+
constructor(method, path, body) {
|
|
68
|
+
super({ name: "a-frame-channel-request" });
|
|
69
|
+
this.method = method;
|
|
70
|
+
this.path = path;
|
|
71
|
+
this.body = body;
|
|
72
|
+
}
|
|
73
|
+
complete(response) {
|
|
74
|
+
this._response = response;
|
|
75
|
+
}
|
|
76
|
+
fail(error) {
|
|
77
|
+
this._error = error;
|
|
78
|
+
}
|
|
79
|
+
get response() {
|
|
80
|
+
return this._response;
|
|
81
|
+
}
|
|
82
|
+
get error() {
|
|
83
|
+
return this._error;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
var A_FrameChannelError = class extends aConcept.A_Error {
|
|
87
|
+
};
|
|
88
|
+
A_FrameChannelError.InvalidRequest = "InvalidRequest";
|
|
89
|
+
A_FrameChannelError.Timeout = "Timeout";
|
|
90
|
+
A_FrameChannelError.RequestFailed = "RequestFailed";
|
|
91
|
+
var A_FrameChannelEvent = class extends aConcept.A_Fragment {
|
|
92
|
+
constructor(name, data) {
|
|
93
|
+
super({ name: "a-frame-channel-event-" + name });
|
|
94
|
+
this._data = data;
|
|
95
|
+
this._eventName = name;
|
|
96
|
+
}
|
|
97
|
+
get name() {
|
|
98
|
+
return this._eventName;
|
|
99
|
+
}
|
|
100
|
+
get data() {
|
|
101
|
+
return this._data;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
var A_FrameChannelStream = class extends aConcept.A_Entity {
|
|
105
|
+
static onEvent(name) {
|
|
106
|
+
const eventName = (name || "all") + A_FrameChannelStreamFeatures.onEvent;
|
|
107
|
+
return (target, propertyKey, descriptor) => {
|
|
108
|
+
return aConcept.A_Feature.Extend({
|
|
109
|
+
name: eventName,
|
|
110
|
+
scope: [target.constructor]
|
|
111
|
+
})(target, propertyKey, descriptor);
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The scope of the session, Will be destroyed after the session is closed.
|
|
116
|
+
*/
|
|
117
|
+
get scope() {
|
|
118
|
+
if (!this._scope) {
|
|
119
|
+
this._scope = aConcept.A_Context.allocate(this, new aConcept.A_Scope({ name: `${this.aseid.id}-scope` }));
|
|
120
|
+
}
|
|
121
|
+
return this._scope;
|
|
122
|
+
}
|
|
123
|
+
get method() {
|
|
124
|
+
return this._method;
|
|
125
|
+
}
|
|
126
|
+
get path() {
|
|
127
|
+
return this._path;
|
|
128
|
+
}
|
|
129
|
+
get body() {
|
|
130
|
+
return this._body;
|
|
131
|
+
}
|
|
132
|
+
get status() {
|
|
133
|
+
return this._status;
|
|
134
|
+
}
|
|
135
|
+
get error() {
|
|
136
|
+
return this._error;
|
|
137
|
+
}
|
|
138
|
+
get initDate() {
|
|
139
|
+
return new Date(this._initDate);
|
|
140
|
+
}
|
|
141
|
+
complete() {
|
|
142
|
+
this._status = A_FrameChannelStreamStatuses.Closed;
|
|
143
|
+
}
|
|
144
|
+
fail(error) {
|
|
145
|
+
this._status = A_FrameChannelStreamStatuses.Closed;
|
|
146
|
+
this._error = error;
|
|
147
|
+
}
|
|
148
|
+
destroy() {
|
|
149
|
+
this.scope.destroy();
|
|
150
|
+
}
|
|
151
|
+
async open() {
|
|
152
|
+
await this.call(A_FrameChannelStreamFeatures.open);
|
|
153
|
+
}
|
|
154
|
+
async send() {
|
|
155
|
+
await this.call(A_FrameChannelStreamFeatures.send);
|
|
156
|
+
}
|
|
157
|
+
async propagate(name, data) {
|
|
158
|
+
const request = new A_FrameChannelEvent(name, data);
|
|
159
|
+
const executionScope = new aConcept.A_Scope({
|
|
160
|
+
name: "A_FrameChannelStream.propagate",
|
|
161
|
+
fragments: [request]
|
|
162
|
+
}).inherit(this.scope);
|
|
163
|
+
try {
|
|
164
|
+
const callName = (name || "all") + A_FrameChannelStreamFeatures.onEvent;
|
|
165
|
+
await this.call(callName, executionScope);
|
|
166
|
+
executionScope.destroy();
|
|
167
|
+
} catch {
|
|
168
|
+
executionScope.destroy();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
fromNew(newEntity) {
|
|
172
|
+
this.aseid = this.generateASEID();
|
|
173
|
+
this._method = newEntity.method;
|
|
174
|
+
this._path = newEntity.path;
|
|
175
|
+
this._body = newEntity.body;
|
|
176
|
+
this._initDate = (/* @__PURE__ */ new Date()).toISOString();
|
|
177
|
+
}
|
|
178
|
+
fromJSON(serialized) {
|
|
179
|
+
this._method = serialized.method;
|
|
180
|
+
this._path = serialized.path;
|
|
181
|
+
this._body = serialized.body;
|
|
182
|
+
this._initDate = serialized.initDate;
|
|
183
|
+
}
|
|
184
|
+
toJSON() {
|
|
185
|
+
return {
|
|
186
|
+
...super.toJSON(),
|
|
187
|
+
initDate: this._initDate,
|
|
188
|
+
status: this._status,
|
|
189
|
+
error: this._error ? this._error.toJSON() : void 0,
|
|
190
|
+
method: this._method,
|
|
191
|
+
path: this._path,
|
|
192
|
+
body: this._body
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
// src/lib/A-FrameDynamicSession/A-FrameDynamicSession.constants.ts
|
|
198
|
+
var A_FrameDynamicSessionFeatures = {
|
|
199
|
+
Init: "_A_FRAME_DYNAMIC_SESSION_INIT",
|
|
200
|
+
Question: "_A_FRAME_DYNAMIC_SESSION_QUESTION",
|
|
201
|
+
Answer: "_A_FRAME_DYNAMIC_SESSION_ANSWER",
|
|
202
|
+
Destroy: "_A_FRAME_DYNAMIC_SESSION_DESTROY"
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
// src/lib/A-FrameDynamicSession/A-FrameDynamicSession.entity.ts
|
|
206
|
+
var A_FrameDynamicSession = class extends aConcept.A_Entity {
|
|
207
|
+
static get concept() {
|
|
208
|
+
return "a-frame";
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
*
|
|
212
|
+
*/
|
|
213
|
+
get scope() {
|
|
214
|
+
if (!this._scope) {
|
|
215
|
+
this._scope = aConcept.A_Context.allocate(this, new aConcept.A_Scope({ name: `${this.aseid.id}-scope` }));
|
|
216
|
+
}
|
|
217
|
+
return this._scope;
|
|
218
|
+
}
|
|
219
|
+
get currentTurn() {
|
|
220
|
+
return this._currentTurn;
|
|
221
|
+
}
|
|
222
|
+
get initDate() {
|
|
223
|
+
return new Date(this._initDate);
|
|
224
|
+
}
|
|
225
|
+
static onQuestion() {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
static onAnswer() {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
fromNew(newEntity) {
|
|
232
|
+
this._turnsCount = newEntity.turnsCount || 5;
|
|
233
|
+
this._currentTurn = 0;
|
|
234
|
+
this._initDate = (/* @__PURE__ */ new Date()).toISOString();
|
|
235
|
+
}
|
|
236
|
+
fromJSON(serialized) {
|
|
237
|
+
this._turnsCount = serialized.turnsCount;
|
|
238
|
+
this._currentTurn = serialized.currentTurn;
|
|
239
|
+
this._initDate = serialized.initDate;
|
|
240
|
+
}
|
|
241
|
+
async init() {
|
|
242
|
+
await this.call(A_FrameDynamicSessionFeatures.Init);
|
|
243
|
+
}
|
|
244
|
+
async destroy(scope) {
|
|
245
|
+
await this.call(A_FrameDynamicSessionFeatures.Destroy, scope);
|
|
246
|
+
}
|
|
247
|
+
async question() {
|
|
248
|
+
this._currentTurn++;
|
|
249
|
+
await this.call(A_FrameDynamicSessionFeatures.Question);
|
|
250
|
+
}
|
|
251
|
+
async answer() {
|
|
252
|
+
await this.call(A_FrameDynamicSessionFeatures.Answer);
|
|
253
|
+
}
|
|
254
|
+
toJSON() {
|
|
255
|
+
return {
|
|
256
|
+
...super.toJSON(),
|
|
257
|
+
turnsCount: this._turnsCount,
|
|
258
|
+
currentTurn: this._currentTurn,
|
|
259
|
+
initDate: this._initDate
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
var A_FrameChannelDsgStream = class extends A_FrameChannelStream {
|
|
264
|
+
constructor() {
|
|
265
|
+
super(...arguments);
|
|
266
|
+
this._resolvedComponents = [];
|
|
267
|
+
}
|
|
268
|
+
// ── Configuration ──────────────────────────────────────────────────────
|
|
269
|
+
/**
|
|
270
|
+
* Provide the callback that sends a component-search response back to the
|
|
271
|
+
* server via HTTP POST. Must be set before the SSE stream is opened.
|
|
272
|
+
*/
|
|
273
|
+
setRespondFn(fn) {
|
|
274
|
+
this._respondFn = fn;
|
|
275
|
+
}
|
|
276
|
+
// ── Result accessor ────────────────────────────────────────────────────
|
|
277
|
+
/**
|
|
278
|
+
* Contains the resolved components after `structure_complete` is received.
|
|
279
|
+
* Empty until the server pushes the final structure.
|
|
280
|
+
*/
|
|
281
|
+
get resolvedComponents() {
|
|
282
|
+
return this._resolvedComponents;
|
|
283
|
+
}
|
|
284
|
+
async onSearchComponent(event) {
|
|
285
|
+
if (!this._respondFn) return;
|
|
286
|
+
const { requestId, vector } = event.data;
|
|
287
|
+
const queryVector = new chunkQCEWWJ3N_cjs.A_FrameVector(vector ?? []);
|
|
288
|
+
const results = chunkBWX7HFTH_cjs.A_FrameIndex.search(queryVector, { topK: 1 });
|
|
289
|
+
const top = results[0];
|
|
290
|
+
await this._respondFn(requestId, {
|
|
291
|
+
component: top?.record?.name ?? null,
|
|
292
|
+
score: top?.score ?? 0
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
async onStructureComplete(event) {
|
|
296
|
+
const { components } = event.data;
|
|
297
|
+
this._resolvedComponents = Array.isArray(components) ? components : [];
|
|
298
|
+
}
|
|
299
|
+
async onStructureError(event) {
|
|
300
|
+
const { message } = event.data ?? {};
|
|
301
|
+
console.error("[A_FrameChannelDsgStream] Server reported structure error:", message ?? "unknown");
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
chunkQFHZIG7Y_cjs.__decorateClass([
|
|
305
|
+
A_FrameChannelStream.onEvent("search_component"),
|
|
306
|
+
chunkQFHZIG7Y_cjs.__decorateParam(0, aConcept.A_Inject(A_FrameChannelEvent))
|
|
307
|
+
], A_FrameChannelDsgStream.prototype, "onSearchComponent", 1);
|
|
308
|
+
chunkQFHZIG7Y_cjs.__decorateClass([
|
|
309
|
+
A_FrameChannelStream.onEvent("structure_complete"),
|
|
310
|
+
chunkQFHZIG7Y_cjs.__decorateParam(0, aConcept.A_Inject(A_FrameChannelEvent))
|
|
311
|
+
], A_FrameChannelDsgStream.prototype, "onStructureComplete", 1);
|
|
312
|
+
chunkQFHZIG7Y_cjs.__decorateClass([
|
|
313
|
+
A_FrameChannelStream.onEvent("structure_error"),
|
|
314
|
+
chunkQFHZIG7Y_cjs.__decorateParam(0, aConcept.A_Inject(A_FrameChannelEvent))
|
|
315
|
+
], A_FrameChannelDsgStream.prototype, "onStructureError", 1);
|
|
316
|
+
|
|
317
|
+
// src/lib/A-FrameDynamicContent/A-FrameDynamicContent.constants.ts
|
|
318
|
+
var A_FrameDynamicContentFeatures = {
|
|
319
|
+
Generate: "_A_FRAME_DYNAMIC_CONTENT_GENERATE",
|
|
320
|
+
Patch: "_A_FRAME_DYNAMIC_CONTENT_PATCH"
|
|
321
|
+
};
|
|
322
|
+
var A_FrameDynamicContentOperation = class extends aConcept.A_Fragment {
|
|
323
|
+
constructor(params = {}) {
|
|
324
|
+
super({ name: "a-frame-dynamic-content-operation-context" });
|
|
325
|
+
this._meta = /* @__PURE__ */ new Map();
|
|
326
|
+
this._meta.set("params", params);
|
|
327
|
+
}
|
|
328
|
+
get params() {
|
|
329
|
+
return this._meta.get("params");
|
|
330
|
+
}
|
|
331
|
+
get(key) {
|
|
332
|
+
return this._meta.get(key);
|
|
333
|
+
}
|
|
334
|
+
set(key, value) {
|
|
335
|
+
this._meta.set(key, value);
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
var A_FrameDynamicContentError = class extends aConcept.A_Error {
|
|
339
|
+
};
|
|
340
|
+
A_FrameDynamicContentError.GenerationFailed = "GenerationFailed";
|
|
341
|
+
A_FrameDynamicContentError.PatchFailed = "PatchFailed";
|
|
342
|
+
A_FrameDynamicContentError.InvalidPatch = "InvalidPatch";
|
|
343
|
+
A_FrameDynamicContentError.PieceNotFound = "PieceNotFound";
|
|
344
|
+
var _A_FrameDynamicContentIndex = class _A_FrameDynamicContentIndex extends aConcept.A_Fragment {
|
|
345
|
+
constructor() {
|
|
346
|
+
super(...arguments);
|
|
347
|
+
/** Ordered list of segment IDs — defines the canonical reading order. */
|
|
348
|
+
this._order = [];
|
|
349
|
+
/** O(1) lookup by id. */
|
|
350
|
+
this._map = /* @__PURE__ */ new Map();
|
|
351
|
+
}
|
|
352
|
+
// ── Accessors ─────────────────────────────────────────────────────────────
|
|
353
|
+
get count() {
|
|
354
|
+
return this._order.length;
|
|
355
|
+
}
|
|
356
|
+
get size() {
|
|
357
|
+
return this._order.length;
|
|
358
|
+
}
|
|
359
|
+
// ── Basic mutation ────────────────────────────────────────────────────────
|
|
360
|
+
/** Append one or more segments to the end. */
|
|
361
|
+
add(...segments) {
|
|
362
|
+
segments.forEach((seg) => {
|
|
363
|
+
this._map.set(seg.id, seg);
|
|
364
|
+
if (!this._order.includes(seg.id)) {
|
|
365
|
+
this._order.push(seg.id);
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
/** Replace the content of an existing segment in-place (position unchanged). */
|
|
370
|
+
update(segment) {
|
|
371
|
+
this._map.set(segment.id, segment);
|
|
372
|
+
if (!this._order.includes(segment.id)) {
|
|
373
|
+
this._order.push(segment.id);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
/** Remove a segment by id. */
|
|
377
|
+
remove(id) {
|
|
378
|
+
this._map.delete(id);
|
|
379
|
+
const idx = this._order.indexOf(id);
|
|
380
|
+
if (idx !== -1) this._order.splice(idx, 1);
|
|
381
|
+
}
|
|
382
|
+
/** Remove all segments. */
|
|
383
|
+
clear() {
|
|
384
|
+
this._map.clear();
|
|
385
|
+
this._order = [];
|
|
386
|
+
}
|
|
387
|
+
// ── Positional insertion ──────────────────────────────────────────────────
|
|
388
|
+
/** Insert `segment` immediately before the segment with `targetId`. */
|
|
389
|
+
insertBefore(targetId, segment) {
|
|
390
|
+
this._map.set(segment.id, segment);
|
|
391
|
+
const targetIdx = this._order.indexOf(targetId);
|
|
392
|
+
if (targetIdx === -1) {
|
|
393
|
+
this._order.push(segment.id);
|
|
394
|
+
} else {
|
|
395
|
+
this._order.splice(targetIdx, 0, segment.id);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
/** Insert `segment` immediately after the segment with `targetId`. */
|
|
399
|
+
insertAfter(targetId, segment) {
|
|
400
|
+
this._map.set(segment.id, segment);
|
|
401
|
+
const targetIdx = this._order.indexOf(targetId);
|
|
402
|
+
if (targetIdx === -1) {
|
|
403
|
+
this._order.push(segment.id);
|
|
404
|
+
} else {
|
|
405
|
+
this._order.splice(targetIdx + 1, 0, segment.id);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
/** Swap the content of `targetId` with `segment`, keeping the same position. */
|
|
409
|
+
replace(targetId, segment) {
|
|
410
|
+
const pos = this._order.indexOf(targetId);
|
|
411
|
+
if (pos === -1) return;
|
|
412
|
+
this._map.delete(targetId);
|
|
413
|
+
this._map.set(segment.id, segment);
|
|
414
|
+
this._order[pos] = segment.id;
|
|
415
|
+
}
|
|
416
|
+
// ── Position management ────────────────────────────────────────────────────
|
|
417
|
+
/** Move the segment with `id` to absolute zero-based `newPosition`. */
|
|
418
|
+
moveTo(id, newPosition) {
|
|
419
|
+
const from = this._order.indexOf(id);
|
|
420
|
+
if (from === -1) return;
|
|
421
|
+
this._order.splice(from, 1);
|
|
422
|
+
const clipped = Math.max(0, Math.min(newPosition, this._order.length));
|
|
423
|
+
this._order.splice(clipped, 0, id);
|
|
424
|
+
}
|
|
425
|
+
/** Move `id` to directly before `targetId`. */
|
|
426
|
+
moveBefore(id, targetId) {
|
|
427
|
+
const from = this._order.indexOf(id);
|
|
428
|
+
if (from === -1) return;
|
|
429
|
+
this._order.splice(from, 1);
|
|
430
|
+
const to = this._order.indexOf(targetId);
|
|
431
|
+
this._order.splice(to === -1 ? 0 : to, 0, id);
|
|
432
|
+
}
|
|
433
|
+
/** Move `id` to directly after `targetId`. */
|
|
434
|
+
moveAfter(id, targetId) {
|
|
435
|
+
const from = this._order.indexOf(id);
|
|
436
|
+
if (from === -1) return;
|
|
437
|
+
this._order.splice(from, 1);
|
|
438
|
+
const to = this._order.indexOf(targetId);
|
|
439
|
+
this._order.splice(to === -1 ? this._order.length : to + 1, 0, id);
|
|
440
|
+
}
|
|
441
|
+
// ── Patch operation dispatch ──────────────────────────────────────────────
|
|
442
|
+
/**
|
|
443
|
+
* Apply a single `A_FrameContentPatchOperation` to the index.
|
|
444
|
+
* For `add` and `replace` the caller must supply the resolved `segment`.
|
|
445
|
+
* For `remove` only the `op` is needed.
|
|
446
|
+
*/
|
|
447
|
+
applyOperation(op, segment) {
|
|
448
|
+
switch (op.action) {
|
|
449
|
+
case "remove": {
|
|
450
|
+
if (op.targetId) this.remove(op.targetId);
|
|
451
|
+
break;
|
|
452
|
+
}
|
|
453
|
+
case "replace": {
|
|
454
|
+
if (op.targetId && segment) this.replace(op.targetId, segment);
|
|
455
|
+
break;
|
|
456
|
+
}
|
|
457
|
+
case "add": {
|
|
458
|
+
if (!segment) break;
|
|
459
|
+
if (!op.targetId || op.position === "append") {
|
|
460
|
+
this.add(segment);
|
|
461
|
+
} else if (op.position === "before") {
|
|
462
|
+
this.insertBefore(op.targetId, segment);
|
|
463
|
+
} else {
|
|
464
|
+
this.insertAfter(op.targetId, segment);
|
|
465
|
+
}
|
|
466
|
+
break;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
// ── Lookup ────────────────────────────────────────────────────────────────
|
|
471
|
+
get(id) {
|
|
472
|
+
return this._map.get(id);
|
|
473
|
+
}
|
|
474
|
+
/** Returns all segments in their current canonical order. */
|
|
475
|
+
list() {
|
|
476
|
+
return this._order.map((id) => this._map.get(id)).filter((s) => s !== void 0);
|
|
477
|
+
}
|
|
478
|
+
// ── Search ────────────────────────────────────────────────────────────────
|
|
479
|
+
/**
|
|
480
|
+
* Rank all embedded segments by cosine similarity to the query vector.
|
|
481
|
+
*/
|
|
482
|
+
search(vector, topK = _A_FrameDynamicContentIndex.PATCH_PIECE_LIMIT) {
|
|
483
|
+
const queryVec = vector.normalize();
|
|
484
|
+
return this.list().filter((s) => s.isEmbed && s.vector).map((s) => ({
|
|
485
|
+
segment: s,
|
|
486
|
+
score: queryVec.dot(s.vector.normalize())
|
|
487
|
+
})).sort((a, b) => b.score - a.score).slice(0, topK);
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Rank segments by how many instruction keywords appear in their content.
|
|
491
|
+
* Words shorter than 4 characters are ignored.
|
|
492
|
+
*/
|
|
493
|
+
searchByKeywords(instruction, topK = _A_FrameDynamicContentIndex.PATCH_PIECE_LIMIT) {
|
|
494
|
+
const keywords = instruction.toLowerCase().split(/\W+/).filter((w) => w.length > 3);
|
|
495
|
+
if (keywords.length === 0) return [];
|
|
496
|
+
return this.list().map((segment) => {
|
|
497
|
+
const lower = segment.content.toLowerCase();
|
|
498
|
+
const score = keywords.reduce(
|
|
499
|
+
(acc, kw) => acc + (lower.includes(kw) ? 1 : 0),
|
|
500
|
+
0
|
|
501
|
+
);
|
|
502
|
+
return { segment, score };
|
|
503
|
+
}).filter((s) => s.score > 0).sort((a, b) => b.score - a.score).slice(0, topK);
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Select at most `limit` segments most relevant to a patch instruction.
|
|
507
|
+
*
|
|
508
|
+
* Priority:
|
|
509
|
+
* 1. Vector search — when `vector` is provided and segments carry embeddings.
|
|
510
|
+
* 2. Keyword search — fallback when embeddings are absent or vector is null.
|
|
511
|
+
* 3. Identity — first N segments when neither search finds candidates.
|
|
512
|
+
*/
|
|
513
|
+
selectForPatch(vector, instruction, limit = _A_FrameDynamicContentIndex.PATCH_PIECE_LIMIT) {
|
|
514
|
+
const all = this.list();
|
|
515
|
+
if (all.length <= limit) return all;
|
|
516
|
+
if (vector) {
|
|
517
|
+
const hasEmbedded = all.some((s) => s.isEmbed);
|
|
518
|
+
if (hasEmbedded) {
|
|
519
|
+
const results = this.search(vector, limit);
|
|
520
|
+
if (results.length > 0) return results.map((r) => r.segment);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
const kwResults = this.searchByKeywords(instruction, limit);
|
|
524
|
+
if (kwResults.length > 0) return kwResults.map((r) => r.segment);
|
|
525
|
+
return all.slice(0, limit);
|
|
526
|
+
}
|
|
527
|
+
// ── Similarity helpers ────────────────────────────────────────────────────
|
|
528
|
+
cosineSimilarity(a, b) {
|
|
529
|
+
if (!b) return 0;
|
|
530
|
+
const dot = a.dot(b);
|
|
531
|
+
const mag = a.magnitude() * b.magnitude();
|
|
532
|
+
return mag === 0 ? 0 : dot / mag;
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
/** Maximum segments forwarded to the server in a single patch request. */
|
|
536
|
+
_A_FrameDynamicContentIndex.PATCH_PIECE_LIMIT = 5;
|
|
537
|
+
var A_FrameDynamicContentIndex = _A_FrameDynamicContentIndex;
|
|
538
|
+
|
|
539
|
+
// src/lib/A-FrameSegment/A-FrameSegment.constants.ts
|
|
540
|
+
var A_FrameSegmentFeatures = {
|
|
541
|
+
Load: "_A_FRAME_SEGMENT_LOAD",
|
|
542
|
+
Save: "_A_FRAME_SEGMENT_SAVE",
|
|
543
|
+
Embed: "_A_FRAME_SEGMENT_EMBED",
|
|
544
|
+
Destroy: "_A_FRAME_SEGMENT_DESTROY"
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
// src/lib/A-FrameSegment/A-FrameSegment.entity.ts
|
|
548
|
+
var A_FrameSegment = class extends aConcept.A_Entity {
|
|
549
|
+
static get concept() {
|
|
550
|
+
return "a-frame";
|
|
551
|
+
}
|
|
552
|
+
// ─── Getters ──────────────────────────────────────────────────────────────
|
|
553
|
+
get id() {
|
|
554
|
+
return this.aseid.id;
|
|
555
|
+
}
|
|
556
|
+
get content() {
|
|
557
|
+
return this._content;
|
|
558
|
+
}
|
|
559
|
+
get hash() {
|
|
560
|
+
return this._hash;
|
|
561
|
+
}
|
|
562
|
+
get vector() {
|
|
563
|
+
return this._vector;
|
|
564
|
+
}
|
|
565
|
+
get embedding() {
|
|
566
|
+
return this._vector?.values ?? null;
|
|
567
|
+
}
|
|
568
|
+
//-----------------------------------------------------------------------------------------------------
|
|
569
|
+
//--------------------------------------- Computed properties -----------------------------------------
|
|
570
|
+
//-----------------------------------------------------------------------------------------------------
|
|
571
|
+
get aFrameServerVersion() {
|
|
572
|
+
return this._aFrameServerVersion;
|
|
573
|
+
}
|
|
574
|
+
get aFrameVersion() {
|
|
575
|
+
return this._aFrameVersion;
|
|
576
|
+
}
|
|
577
|
+
get isEmbed() {
|
|
578
|
+
return this._vector !== void 0;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Saves Segment to storage. The actual implementation of saving is handled by the A_FrameSegmentFeatures.Save feature, which can be implemented by the environment to persist the definition to a database, file system, or other storage mechanism.
|
|
582
|
+
*
|
|
583
|
+
* @param scope
|
|
584
|
+
* @returns
|
|
585
|
+
*/
|
|
586
|
+
save(scope) {
|
|
587
|
+
return this.call(A_FrameSegmentFeatures.Save, scope);
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Deletes the namespace from storage. The actual implementation of deletion is handled by the A_FrameSegmentFeatures.Destroy feature, which can be implemented by the environment to remove the namespace from the database, file system, or other storage mechanism.
|
|
591
|
+
*
|
|
592
|
+
* @param scope
|
|
593
|
+
* @returns
|
|
594
|
+
*/
|
|
595
|
+
destroy(scope) {
|
|
596
|
+
return this.call(A_FrameSegmentFeatures.Destroy, scope);
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Loads the namespace from storage. The actual implementation of loading is handled by the A_FrameSegmentFeatures.Load feature, which can be implemented by the environment to retrieve the namespace from the database, file system, or other storage mechanism and populate the entity's properties accordingly.
|
|
600
|
+
*
|
|
601
|
+
* @param scope
|
|
602
|
+
* @returns
|
|
603
|
+
*/
|
|
604
|
+
async load(scope) {
|
|
605
|
+
return this.call(A_FrameSegmentFeatures.Load, scope);
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Updates the definition's properties. This can be used to modify the source code, description, metadata, or namespace of the definition. After updating, you may want to call `embed()` again to refresh the embedding based on the new content.
|
|
609
|
+
*
|
|
610
|
+
* @param updates
|
|
611
|
+
*/
|
|
612
|
+
update(updates) {
|
|
613
|
+
if (updates.content) this._content = updates.content;
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Generates an embedding vector for the namespace using the A_FrameSegmentFeatures.Embed feature. This typically involves sending the namespace's content (name + description) to an embedding model and storing the resulting vector in the entity. Once embedded, the namespace can be searched using its vector representation.
|
|
617
|
+
*
|
|
618
|
+
* @param scope
|
|
619
|
+
* @returns
|
|
620
|
+
*/
|
|
621
|
+
embed(scope) {
|
|
622
|
+
return this.call(A_FrameSegmentFeatures.Embed, scope);
|
|
623
|
+
}
|
|
624
|
+
// ─── A_Entity lifecycle ───────────────────────────────────────────────────
|
|
625
|
+
fromNew(init) {
|
|
626
|
+
super.fromNew(init);
|
|
627
|
+
this._content = init.content;
|
|
628
|
+
const hashSource = this._content;
|
|
629
|
+
this._hash = chunkZM2RLVVH_cjs.A_FrameHashHelper.fnv1a(hashSource);
|
|
630
|
+
}
|
|
631
|
+
fromJSON(serialized) {
|
|
632
|
+
this._content = serialized.content;
|
|
633
|
+
this._hash = serialized.hash;
|
|
634
|
+
this._vector = serialized.embedding ? new chunkQCEWWJ3N_cjs.A_FrameVector(serialized.embedding) : void 0;
|
|
635
|
+
this._embeddedAt = serialized.embeddedAt;
|
|
636
|
+
this._model = serialized.model;
|
|
637
|
+
this._credentialId = serialized.credentialId;
|
|
638
|
+
this._aFrameVersion = serialized.aFrameVersion;
|
|
639
|
+
this._aFrameServerVersion = serialized.aFrameServerVersion;
|
|
640
|
+
}
|
|
641
|
+
toJSON() {
|
|
642
|
+
return {
|
|
643
|
+
...super.toJSON(),
|
|
644
|
+
hash: this._hash,
|
|
645
|
+
content: this._content,
|
|
646
|
+
embedding: this._vector?.values,
|
|
647
|
+
embeddedAt: this._embeddedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
648
|
+
model: this._model,
|
|
649
|
+
credentialId: this._credentialId,
|
|
650
|
+
aFrameVersion: this._aFrameVersion,
|
|
651
|
+
aFrameServerVersion: this._aFrameServerVersion
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
// ─── Embedding hydration ──────────────────────────────────────────────────
|
|
655
|
+
hydrateFromRecord(record) {
|
|
656
|
+
if (record.hash !== this._hash) {
|
|
657
|
+
throw new Error(
|
|
658
|
+
`A_FrameSegment.hydrateFromRecord: hash mismatch for "${this._content}" (expected ${this._hash}, got ${record.hash})`
|
|
659
|
+
);
|
|
660
|
+
}
|
|
661
|
+
this._vector = new chunkQCEWWJ3N_cjs.A_FrameVector(record.embedding);
|
|
662
|
+
this._embeddedAt = record.embeddedAt;
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Populate the embedding vector directly from a raw `Float32Array`.
|
|
666
|
+
* Use this when the vector is obtained externally (e.g. from a server
|
|
667
|
+
* response) without going through the full `embed()` feature pipeline.
|
|
668
|
+
*/
|
|
669
|
+
hydrateFromEmbedding(embedding) {
|
|
670
|
+
this._vector = new chunkQCEWWJ3N_cjs.A_FrameVector(embedding);
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* Build the text string sent to the embedding model.
|
|
674
|
+
* Uses content so the vector captures semantic intent.
|
|
675
|
+
*/
|
|
676
|
+
toString() {
|
|
677
|
+
const parts = [`// content: ${this._content}`];
|
|
678
|
+
return parts.join("\n");
|
|
679
|
+
}
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
// src/lib/A-FrameDynamicContent/A-FrameDynamicContent.entity.ts
|
|
683
|
+
var A_FrameDynamicContent = class extends aConcept.A_Entity {
|
|
684
|
+
static get concept() {
|
|
685
|
+
return "a-frame";
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
*
|
|
689
|
+
*/
|
|
690
|
+
get scope() {
|
|
691
|
+
if (!this._scope) {
|
|
692
|
+
this._scope = aConcept.A_Context.allocate(this, new aConcept.A_Scope({ name: `${this.aseid.id}-scope` }));
|
|
693
|
+
}
|
|
694
|
+
return this._scope;
|
|
695
|
+
}
|
|
696
|
+
get index() {
|
|
697
|
+
const index = this.scope.resolve(A_FrameDynamicContentIndex);
|
|
698
|
+
return index;
|
|
699
|
+
}
|
|
700
|
+
fromNew(options) {
|
|
701
|
+
super.fromNew(options);
|
|
702
|
+
const index = new A_FrameDynamicContentIndex({ name: `${this.aseid.id}` });
|
|
703
|
+
this.scope.register(index);
|
|
704
|
+
this.createdAt = Date.now();
|
|
705
|
+
this.prompt = options.prompt;
|
|
706
|
+
this.model = options.options?.model || "default-model";
|
|
707
|
+
this._patchPieceLimit = options.options?.patchPieceLimit || A_FrameDynamicContentIndex.PATCH_PIECE_LIMIT;
|
|
708
|
+
this._history = [];
|
|
709
|
+
this._version = 0;
|
|
710
|
+
}
|
|
711
|
+
// ── Accessors ────────────────────────────────────────────────────────────
|
|
712
|
+
/** Ordered list of content pieces (output of the last generate or patch). */
|
|
713
|
+
get segments() {
|
|
714
|
+
return this.index.list();
|
|
715
|
+
}
|
|
716
|
+
/** Full content reconstructed from all segments in index order. */
|
|
717
|
+
get content() {
|
|
718
|
+
return this.index.list().map((s) => s.content).join("\n");
|
|
719
|
+
}
|
|
720
|
+
/** Alias for `content` — kept for backward compatibility. */
|
|
721
|
+
get text() {
|
|
722
|
+
return this.content;
|
|
723
|
+
}
|
|
724
|
+
/** Immutable patch history. */
|
|
725
|
+
get history() {
|
|
726
|
+
return this._history;
|
|
727
|
+
}
|
|
728
|
+
/** Current content version (increments with each patch). */
|
|
729
|
+
get version() {
|
|
730
|
+
return this._version;
|
|
731
|
+
}
|
|
732
|
+
/** The AI model name to use for generation / patching. */
|
|
733
|
+
get modelName() {
|
|
734
|
+
return this.model;
|
|
735
|
+
}
|
|
736
|
+
// ── Main pipeline ─────────────────────────────────────────────────────────
|
|
737
|
+
/**
|
|
738
|
+
* Generate content from the entity's prompt.
|
|
739
|
+
* Populates `pieces` and creates the first history entry.
|
|
740
|
+
*/
|
|
741
|
+
async generate() {
|
|
742
|
+
const operation = new A_FrameDynamicContentOperation();
|
|
743
|
+
if (!this.scope.isInheritedFrom(aConcept.A_Context.scope(this)))
|
|
744
|
+
this.scope.inherit(aConcept.A_Context.scope(this));
|
|
745
|
+
const executionScope = new aConcept.A_Scope({
|
|
746
|
+
name: "a-frame-dynamic-content-generate",
|
|
747
|
+
fragments: [operation]
|
|
748
|
+
}).inherit(this.scope);
|
|
749
|
+
try {
|
|
750
|
+
await this.call(A_FrameDynamicContentFeatures.Generate, executionScope);
|
|
751
|
+
executionScope.destroy();
|
|
752
|
+
} catch (err) {
|
|
753
|
+
executionScope.destroy();
|
|
754
|
+
throw new A_FrameDynamicContentError({
|
|
755
|
+
title: A_FrameDynamicContentError.GenerationFailed,
|
|
756
|
+
description: `Failed to generate content: ${err instanceof Error ? err.message : String(err)}`
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Apply a natural-language patch instruction to the current pieces.
|
|
762
|
+
* The server identifies which pieces to add, replace, or remove using
|
|
763
|
+
* semantic search over piece embeddings.
|
|
764
|
+
*/
|
|
765
|
+
async patch(instruction) {
|
|
766
|
+
if (!this.scope.isInheritedFrom(aConcept.A_Context.scope(this)))
|
|
767
|
+
this.scope.inherit(aConcept.A_Context.scope(this));
|
|
768
|
+
const executionScope = new aConcept.A_Scope({
|
|
769
|
+
name: "a-frame-dynamic-content-patch"
|
|
770
|
+
}).inherit(this.scope);
|
|
771
|
+
const inputSegment = new A_FrameSegment({
|
|
772
|
+
content: instruction
|
|
773
|
+
});
|
|
774
|
+
executionScope.register(inputSegment);
|
|
775
|
+
await inputSegment.embed();
|
|
776
|
+
const targetSegments = this.index.selectForPatch(inputSegment.vector ?? null, instruction, this._patchPieceLimit);
|
|
777
|
+
const operation = new A_FrameDynamicContentOperation({
|
|
778
|
+
instruction,
|
|
779
|
+
segments: targetSegments
|
|
780
|
+
});
|
|
781
|
+
executionScope.register(operation);
|
|
782
|
+
try {
|
|
783
|
+
await this.call(A_FrameDynamicContentFeatures.Patch, executionScope);
|
|
784
|
+
executionScope.destroy();
|
|
785
|
+
} catch (err) {
|
|
786
|
+
executionScope.destroy();
|
|
787
|
+
throw new A_FrameDynamicContentError({
|
|
788
|
+
title: A_FrameDynamicContentError.PatchFailed,
|
|
789
|
+
description: `Failed to patch content: ${err instanceof Error ? err.message : String(err)}`
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
// ── Hydration ─────────────────────────────────────────────────────────────
|
|
794
|
+
/**
|
|
795
|
+
* Populate index from the segments created by the channel after a generate response.
|
|
796
|
+
* Creates the first history entry.
|
|
797
|
+
*/
|
|
798
|
+
hydrateFromGeneration(segments, meta) {
|
|
799
|
+
segments.forEach((s) => this.index.add(s));
|
|
800
|
+
this._history.push(new chunk7MVVMISA_cjs.A_FrameDynamicPatch({
|
|
801
|
+
version: this._version,
|
|
802
|
+
timestamp: Date.now(),
|
|
803
|
+
reason: `Generated for: "${this.prompt}"`,
|
|
804
|
+
encoded: Buffer.from(JSON.stringify(this.index.list())).toString("base64"),
|
|
805
|
+
delta: this.index.size
|
|
806
|
+
}));
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Apply a patch diff returned by the server to the current piece list.
|
|
810
|
+
* Increments the version and records a history entry.
|
|
811
|
+
*/
|
|
812
|
+
hydrateFromPatch(patchResult, meta) {
|
|
813
|
+
const prevCount = this.index.size;
|
|
814
|
+
const normalize = (s) => s.toLowerCase().replace(/[^\w\s]/g, "").replace(/\s+/g, " ").trim();
|
|
815
|
+
const existingNormalized = this.index.list().map((s) => normalize(s.content));
|
|
816
|
+
const isNearDuplicate = (newContent) => {
|
|
817
|
+
const norm = normalize(newContent);
|
|
818
|
+
if (norm.length < 8) return false;
|
|
819
|
+
return existingNormalized.some(
|
|
820
|
+
(existing) => existing === norm || existing.includes(norm) || norm.includes(existing)
|
|
821
|
+
);
|
|
822
|
+
};
|
|
823
|
+
for (const op of patchResult.operations) {
|
|
824
|
+
if (!["add", "replace", "remove"].includes(op.action)) continue;
|
|
825
|
+
let segment;
|
|
826
|
+
if (op.segment) {
|
|
827
|
+
if ((op.action === "add" || op.action === "replace") && isNearDuplicate(op.segment.content)) continue;
|
|
828
|
+
segment = new A_FrameSegment({ content: op.segment.content });
|
|
829
|
+
if (op.segment.embedding?.length) {
|
|
830
|
+
segment.hydrateFromEmbedding(new Float32Array(op.segment.embedding));
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
if (op.action === "add") {
|
|
834
|
+
const validPositions = /* @__PURE__ */ new Set(["before", "after", "append", void 0]);
|
|
835
|
+
if (!validPositions.has(op.position)) {
|
|
836
|
+
op.position = "append";
|
|
837
|
+
op.targetId = void 0;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
this.index.applyOperation(op, segment);
|
|
841
|
+
}
|
|
842
|
+
this._version++;
|
|
843
|
+
this._history.push(new chunk7MVVMISA_cjs.A_FrameDynamicPatch({
|
|
844
|
+
version: this._version,
|
|
845
|
+
timestamp: Date.now(),
|
|
846
|
+
reason: patchResult.patchSummary,
|
|
847
|
+
encoded: Buffer.from(JSON.stringify(this.index.list())).toString("base64"),
|
|
848
|
+
delta: this.index.size - prevCount
|
|
849
|
+
}));
|
|
850
|
+
}
|
|
851
|
+
// ── Serialisation ──────────────────────────────────────────────────────────
|
|
852
|
+
toJSON() {
|
|
853
|
+
return {
|
|
854
|
+
...super.toJSON(),
|
|
855
|
+
prompt: this.prompt,
|
|
856
|
+
metadata: {
|
|
857
|
+
model: this.model,
|
|
858
|
+
createdAt: this.createdAt
|
|
859
|
+
},
|
|
860
|
+
history: this._history.map((item) => item.toJSON())
|
|
861
|
+
};
|
|
862
|
+
}
|
|
863
|
+
};
|
|
864
|
+
|
|
865
|
+
// src/lib/A-FrameChannel/A-FrameChannel.component.ts
|
|
866
|
+
var A_FrameChannel = class extends aConcept.A_Component {
|
|
867
|
+
async generate(prompt) {
|
|
868
|
+
const request = new A_FrameChannelRequest("POST", "/api/v1/completions", { prompt, max_tokens: 512 });
|
|
869
|
+
const executionScope = new aConcept.A_Scope({
|
|
870
|
+
name: "A_FrameChannel.generate",
|
|
871
|
+
fragments: [request]
|
|
872
|
+
}).inherit(aConcept.A_Context.scope(this));
|
|
873
|
+
try {
|
|
874
|
+
await this.call(A_FrameFeatures.Request, executionScope);
|
|
875
|
+
executionScope.destroy();
|
|
876
|
+
return request;
|
|
877
|
+
} catch (err) {
|
|
878
|
+
executionScope.destroy();
|
|
879
|
+
throw new A_FrameChannelError({
|
|
880
|
+
title: A_FrameChannelError.RequestFailed,
|
|
881
|
+
description: `Failed to generate completion: ${err instanceof Error ? err.message : String(err)}`
|
|
882
|
+
});
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
async embed(input) {
|
|
886
|
+
const request = new A_FrameChannelRequest("POST", "/api/v1/embeddings", { input });
|
|
887
|
+
const executionScope = new aConcept.A_Scope({
|
|
888
|
+
name: "A_FrameChannel.embed",
|
|
889
|
+
fragments: [request]
|
|
890
|
+
}).inherit(aConcept.A_Context.scope(this));
|
|
891
|
+
try {
|
|
892
|
+
await this.call(A_FrameFeatures.Request, executionScope);
|
|
893
|
+
executionScope.destroy();
|
|
894
|
+
return request;
|
|
895
|
+
} catch (err) {
|
|
896
|
+
executionScope.destroy();
|
|
897
|
+
throw new A_FrameChannelError({
|
|
898
|
+
title: A_FrameChannelError.RequestFailed,
|
|
899
|
+
description: `Failed to embed input: ${err instanceof Error ? err.message : String(err)}`
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
async getCredentials() {
|
|
904
|
+
const request = new A_FrameChannelRequest("GET", "/api/v1/credentials/me");
|
|
905
|
+
const executionScope = new aConcept.A_Scope({
|
|
906
|
+
name: "A_FrameChannel.getCredentials",
|
|
907
|
+
fragments: [request]
|
|
908
|
+
}).inherit(aConcept.A_Context.scope(this));
|
|
909
|
+
try {
|
|
910
|
+
await this.call(A_FrameFeatures.Request, executionScope);
|
|
911
|
+
executionScope.destroy();
|
|
912
|
+
return request;
|
|
913
|
+
} catch (err) {
|
|
914
|
+
executionScope.destroy();
|
|
915
|
+
throw new A_FrameChannelError({
|
|
916
|
+
title: A_FrameChannelError.RequestFailed,
|
|
917
|
+
description: `Failed to get credentials: ${err instanceof Error ? err.message : String(err)}`
|
|
918
|
+
});
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
async ping() {
|
|
922
|
+
const request = new A_FrameChannelRequest("GET", "/health");
|
|
923
|
+
const executionScope = new aConcept.A_Scope({
|
|
924
|
+
name: "A_FrameChannel.ping",
|
|
925
|
+
fragments: [request]
|
|
926
|
+
}).inherit(aConcept.A_Context.scope(this));
|
|
927
|
+
try {
|
|
928
|
+
await this.call(A_FrameFeatures.Request, executionScope);
|
|
929
|
+
executionScope.destroy();
|
|
930
|
+
return request;
|
|
931
|
+
} catch {
|
|
932
|
+
executionScope.destroy();
|
|
933
|
+
return request;
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
async embedDefinition(definition, env) {
|
|
937
|
+
const request = new A_FrameChannelRequest("POST", "/api/v1/definition/embed", {
|
|
938
|
+
definition: definition.toJSON()
|
|
939
|
+
});
|
|
940
|
+
const executionScope = new aConcept.A_Scope({
|
|
941
|
+
name: "A_FrameChannel.embedDefinition",
|
|
942
|
+
fragments: [request]
|
|
943
|
+
}).inherit(aConcept.A_Context.scope(this));
|
|
944
|
+
try {
|
|
945
|
+
await this.call(A_FrameFeatures.Request, executionScope);
|
|
946
|
+
executionScope.destroy();
|
|
947
|
+
const response = request.response;
|
|
948
|
+
if (!response.data || !response.data[0] || !response.data[0].embedding) {
|
|
949
|
+
throw new A_FrameChannelError({
|
|
950
|
+
title: A_FrameChannelError.InvalidRequest,
|
|
951
|
+
description: `Invalid embedding response for definition "${definition.name}"`
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
const vector = new Float32Array(response.data[0].embedding);
|
|
955
|
+
definition.hydrateFromEmbedding(vector, {
|
|
956
|
+
model: response.model,
|
|
957
|
+
dimensions: response.meta.dimensions,
|
|
958
|
+
inputCount: response.meta.input_count,
|
|
959
|
+
aFrameServerVersion: response.meta.server_version,
|
|
960
|
+
aFrameVersion: env.A_FRAME_VERSION,
|
|
961
|
+
credentialId: response.meta.credential_id,
|
|
962
|
+
date: response.date,
|
|
963
|
+
aFrameMeta: response.aFrameMeta
|
|
964
|
+
});
|
|
965
|
+
} catch (err) {
|
|
966
|
+
throw new A_FrameChannelError({
|
|
967
|
+
title: A_FrameChannelError.RequestFailed,
|
|
968
|
+
description: `Failed to embed definition "${definition.name}": ${err instanceof Error ? err.message : String(err)}`
|
|
969
|
+
});
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
async embedNamespace(namespace, env) {
|
|
973
|
+
const request = new A_FrameChannelRequest("POST", "/api/v1/namespace/embed", {
|
|
974
|
+
namespace: namespace.toJSON()
|
|
975
|
+
});
|
|
976
|
+
const executionScope = new aConcept.A_Scope({
|
|
977
|
+
name: "A_FrameChannel.embedNamespace",
|
|
978
|
+
fragments: [request]
|
|
979
|
+
}).inherit(aConcept.A_Context.scope(this));
|
|
980
|
+
try {
|
|
981
|
+
await this.call(A_FrameFeatures.Request, executionScope);
|
|
982
|
+
executionScope.destroy();
|
|
983
|
+
const response = request.response;
|
|
984
|
+
if (!response.data || !response.data[0] || !response.data[0].embedding) {
|
|
985
|
+
throw new A_FrameChannelError({
|
|
986
|
+
title: A_FrameChannelError.InvalidRequest,
|
|
987
|
+
description: `Invalid embedding response for namespace "${namespace.name}"`
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
const vector = new Float32Array(response.data[0].embedding);
|
|
991
|
+
namespace.hydrateFromEmbedding(vector, {
|
|
992
|
+
model: response.model,
|
|
993
|
+
dimensions: response.meta.dimensions,
|
|
994
|
+
inputCount: response.meta.input_count,
|
|
995
|
+
aFrameServerVersion: response.meta.server_version,
|
|
996
|
+
aFrameVersion: env.A_FRAME_VERSION,
|
|
997
|
+
credentialId: response.meta.credential_id,
|
|
998
|
+
date: response.date
|
|
999
|
+
});
|
|
1000
|
+
} catch (err) {
|
|
1001
|
+
throw new A_FrameChannelError({
|
|
1002
|
+
title: A_FrameChannelError.RequestFailed,
|
|
1003
|
+
description: `Failed to embed namespace "${namespace.name}": ${err instanceof Error ? err.message : String(err)}`
|
|
1004
|
+
});
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
async embedSegment(segment, env) {
|
|
1008
|
+
const request = new A_FrameChannelRequest("POST", "/api/v1/segment/embed", {
|
|
1009
|
+
segment: segment.toJSON()
|
|
1010
|
+
});
|
|
1011
|
+
const executionScope = new aConcept.A_Scope({
|
|
1012
|
+
name: "A_FrameChannel.embedNamespace",
|
|
1013
|
+
fragments: [request]
|
|
1014
|
+
}).inherit(aConcept.A_Context.scope(this));
|
|
1015
|
+
try {
|
|
1016
|
+
await this.call(A_FrameFeatures.Request, executionScope);
|
|
1017
|
+
executionScope.destroy();
|
|
1018
|
+
const response = request.response;
|
|
1019
|
+
if (!response.data || !response.data[0] || !response.data[0].embedding) {
|
|
1020
|
+
throw new A_FrameChannelError({
|
|
1021
|
+
title: A_FrameChannelError.InvalidRequest,
|
|
1022
|
+
description: `Error during embed a segment: ${segment.content}`
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
const vector = new Float32Array(response.data[0].embedding);
|
|
1026
|
+
segment.fromJSON({
|
|
1027
|
+
aseid: segment.aseid.toString(),
|
|
1028
|
+
content: segment.content,
|
|
1029
|
+
hash: segment.hash,
|
|
1030
|
+
embedding: vector,
|
|
1031
|
+
model: response.model,
|
|
1032
|
+
// dimensions: response.meta.dimensions,
|
|
1033
|
+
// inputCount: response.meta.input_count,
|
|
1034
|
+
aFrameServerVersion: response.meta.server_version,
|
|
1035
|
+
aFrameVersion: env.A_FRAME_VERSION,
|
|
1036
|
+
credentialId: response.meta.credential_id,
|
|
1037
|
+
embeddedAt: response.date
|
|
1038
|
+
});
|
|
1039
|
+
} catch (err) {
|
|
1040
|
+
throw new A_FrameChannelError({
|
|
1041
|
+
title: A_FrameChannelError.RequestFailed,
|
|
1042
|
+
description: `Failed to embed segment with content "${segment.content}": ${err instanceof Error ? err.message : String(err)}`
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
async generateDynamicStructure(structure, session, operation) {
|
|
1047
|
+
const openRequest = new A_FrameChannelRequest(
|
|
1048
|
+
"POST",
|
|
1049
|
+
"/api/v1/dsg/stream/open"
|
|
1050
|
+
);
|
|
1051
|
+
const openScope = new aConcept.A_Scope({
|
|
1052
|
+
name: "A_FrameChannel.generateDynamicStructure:open",
|
|
1053
|
+
fragments: [openRequest]
|
|
1054
|
+
}).inherit(aConcept.A_Context.scope(this));
|
|
1055
|
+
await this.call(A_FrameFeatures.Request, openScope);
|
|
1056
|
+
openScope.destroy();
|
|
1057
|
+
const { channelId } = openRequest.response;
|
|
1058
|
+
const channel = this;
|
|
1059
|
+
const dsgStream = new A_FrameChannelDsgStream({
|
|
1060
|
+
method: "GET",
|
|
1061
|
+
path: `/api/v1/dsg/stream/${channelId}`
|
|
1062
|
+
});
|
|
1063
|
+
dsgStream.setRespondFn(async (requestId, data) => {
|
|
1064
|
+
const respondRequest = new A_FrameChannelRequest(
|
|
1065
|
+
"POST",
|
|
1066
|
+
"/api/v1/dsg/stream/respond",
|
|
1067
|
+
{ requestId, data }
|
|
1068
|
+
);
|
|
1069
|
+
const respondScope = new aConcept.A_Scope({
|
|
1070
|
+
name: "A_FrameChannel.generateDynamicStructure:respond",
|
|
1071
|
+
fragments: [respondRequest]
|
|
1072
|
+
}).inherit(aConcept.A_Context.scope(channel));
|
|
1073
|
+
await channel.call(A_FrameFeatures.Request, respondScope);
|
|
1074
|
+
respondScope.destroy();
|
|
1075
|
+
});
|
|
1076
|
+
const streamScope = new aConcept.A_Scope({
|
|
1077
|
+
name: "A_FrameChannel.generateDynamicStructure:stream",
|
|
1078
|
+
entities: [dsgStream]
|
|
1079
|
+
}).inherit(aConcept.A_Context.scope(this));
|
|
1080
|
+
const streamTask = this.call(A_FrameFeatures.Stream, streamScope);
|
|
1081
|
+
const generateRequest = new A_FrameChannelRequest(
|
|
1082
|
+
"POST",
|
|
1083
|
+
"/api/v1/dsg/structure/generate-stream",
|
|
1084
|
+
{ channelId, prompt: structure.prompt }
|
|
1085
|
+
);
|
|
1086
|
+
const generateScope = new aConcept.A_Scope({
|
|
1087
|
+
name: "A_FrameChannel.generateDynamicStructure:generate",
|
|
1088
|
+
fragments: [generateRequest]
|
|
1089
|
+
}).inherit(aConcept.A_Context.scope(this));
|
|
1090
|
+
await this.call(A_FrameFeatures.Request, generateScope);
|
|
1091
|
+
generateScope.destroy();
|
|
1092
|
+
await streamTask;
|
|
1093
|
+
streamScope.destroy();
|
|
1094
|
+
structure.hydrateFromResolved(
|
|
1095
|
+
dsgStream.resolvedComponents,
|
|
1096
|
+
{ model: "sse-stream", serverVersion: "0.0.0" }
|
|
1097
|
+
);
|
|
1098
|
+
}
|
|
1099
|
+
async generateDynamicContent(content, operation) {
|
|
1100
|
+
const request = new A_FrameChannelRequest(
|
|
1101
|
+
"POST",
|
|
1102
|
+
"/api/v1/content/generate",
|
|
1103
|
+
{ prompt: content.prompt, model: content.modelName }
|
|
1104
|
+
);
|
|
1105
|
+
const requestScope = new aConcept.A_Scope({
|
|
1106
|
+
name: "A_FrameChannel.generateDynamicContent",
|
|
1107
|
+
fragments: [request]
|
|
1108
|
+
}).inherit(aConcept.A_Context.scope(this));
|
|
1109
|
+
await this.call(A_FrameFeatures.Request, requestScope);
|
|
1110
|
+
requestScope.destroy();
|
|
1111
|
+
const resp = request.response;
|
|
1112
|
+
const segments = (resp.segments ?? []).map((w) => {
|
|
1113
|
+
const seg = new A_FrameSegment({ content: w.content });
|
|
1114
|
+
if (w.embedding?.length) {
|
|
1115
|
+
seg.hydrateFromEmbedding(new Float32Array(w.embedding));
|
|
1116
|
+
}
|
|
1117
|
+
return seg;
|
|
1118
|
+
});
|
|
1119
|
+
content.hydrateFromGeneration(segments, {
|
|
1120
|
+
model: resp.model,
|
|
1121
|
+
serverVersion: resp.meta?.server_version ?? "0.0.0"
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1124
|
+
async patchDynamicContent(content, operation) {
|
|
1125
|
+
const { instruction, segments } = operation.params;
|
|
1126
|
+
const wireIdToAseid = /* @__PURE__ */ new Map();
|
|
1127
|
+
const wireSegments = segments.map((s, idx) => {
|
|
1128
|
+
const wireId = `s${idx}`;
|
|
1129
|
+
wireIdToAseid.set(wireId, String(s.id));
|
|
1130
|
+
return {
|
|
1131
|
+
id: wireId,
|
|
1132
|
+
index: idx,
|
|
1133
|
+
text: s.content,
|
|
1134
|
+
vector: s.vector ? Array.from(s.vector.values) : void 0
|
|
1135
|
+
};
|
|
1136
|
+
});
|
|
1137
|
+
const request = new A_FrameChannelRequest(
|
|
1138
|
+
"POST",
|
|
1139
|
+
"/api/v1/content/patch",
|
|
1140
|
+
{
|
|
1141
|
+
prompt: content.prompt,
|
|
1142
|
+
segments: wireSegments,
|
|
1143
|
+
instruction,
|
|
1144
|
+
model: content.modelName
|
|
1145
|
+
}
|
|
1146
|
+
);
|
|
1147
|
+
const requestScope = new aConcept.A_Scope({
|
|
1148
|
+
name: "A_FrameChannel.patchDynamicContent",
|
|
1149
|
+
fragments: [request]
|
|
1150
|
+
}).inherit(aConcept.A_Context.scope(this));
|
|
1151
|
+
await this.call(A_FrameFeatures.Request, requestScope);
|
|
1152
|
+
requestScope.destroy();
|
|
1153
|
+
const resp = request.response;
|
|
1154
|
+
const translatedOperations = resp.operations.map((op) => ({
|
|
1155
|
+
...op,
|
|
1156
|
+
targetId: op.targetId ? wireIdToAseid.get(op.targetId) ?? op.targetId : op.targetId
|
|
1157
|
+
}));
|
|
1158
|
+
content.hydrateFromPatch(
|
|
1159
|
+
{ ...resp, operations: translatedOperations },
|
|
1160
|
+
{
|
|
1161
|
+
model: resp.model,
|
|
1162
|
+
serverVersion: resp.meta?.server_version ?? "0.0.0"
|
|
1163
|
+
}
|
|
1164
|
+
);
|
|
1165
|
+
}
|
|
1166
|
+
};
|
|
1167
|
+
chunkQFHZIG7Y_cjs.__decorateClass([
|
|
1168
|
+
aConcept.A_Feature.Extend({
|
|
1169
|
+
name: chunkJQJ7N4NL_cjs.A_FrameDefinitionFeatures.Embed,
|
|
1170
|
+
scope: [chunkJQJ7N4NL_cjs.A_FrameDefinition]
|
|
1171
|
+
}),
|
|
1172
|
+
chunkQFHZIG7Y_cjs.__decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
|
|
1173
|
+
chunkQFHZIG7Y_cjs.__decorateParam(1, aConcept.A_Inject(chunkXPIJ6BKP_cjs.A_FrameEnv))
|
|
1174
|
+
], A_FrameChannel.prototype, "embedDefinition", 1);
|
|
1175
|
+
chunkQFHZIG7Y_cjs.__decorateClass([
|
|
1176
|
+
aConcept.A_Feature.Extend({
|
|
1177
|
+
name: chunkK4AJBPPY_cjs.A_FrameNamespaceFeatures.Embed,
|
|
1178
|
+
scope: [chunkK4AJBPPY_cjs.A_FrameNamespace]
|
|
1179
|
+
}),
|
|
1180
|
+
chunkQFHZIG7Y_cjs.__decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
|
|
1181
|
+
chunkQFHZIG7Y_cjs.__decorateParam(1, aConcept.A_Inject(chunkXPIJ6BKP_cjs.A_FrameEnv))
|
|
1182
|
+
], A_FrameChannel.prototype, "embedNamespace", 1);
|
|
1183
|
+
chunkQFHZIG7Y_cjs.__decorateClass([
|
|
1184
|
+
aConcept.A_Feature.Extend({
|
|
1185
|
+
name: A_FrameSegmentFeatures.Embed,
|
|
1186
|
+
scope: [A_FrameSegment]
|
|
1187
|
+
}),
|
|
1188
|
+
chunkQFHZIG7Y_cjs.__decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
|
|
1189
|
+
chunkQFHZIG7Y_cjs.__decorateParam(1, aConcept.A_Inject(chunkXPIJ6BKP_cjs.A_FrameEnv))
|
|
1190
|
+
], A_FrameChannel.prototype, "embedSegment", 1);
|
|
1191
|
+
chunkQFHZIG7Y_cjs.__decorateClass([
|
|
1192
|
+
aConcept.A_Feature.Extend({
|
|
1193
|
+
name: chunk7MVVMISA_cjs.A_FrameDynamicStructureFeatures.Generate,
|
|
1194
|
+
scope: [chunk7MVVMISA_cjs.A_FrameDynamicStructure]
|
|
1195
|
+
}),
|
|
1196
|
+
chunkQFHZIG7Y_cjs.__decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
|
|
1197
|
+
chunkQFHZIG7Y_cjs.__decorateParam(1, aConcept.A_Inject(A_FrameDynamicSession)),
|
|
1198
|
+
chunkQFHZIG7Y_cjs.__decorateParam(2, aConcept.A_Inject(chunk7MVVMISA_cjs.A_FrameDynamicStructureOperation))
|
|
1199
|
+
], A_FrameChannel.prototype, "generateDynamicStructure", 1);
|
|
1200
|
+
chunkQFHZIG7Y_cjs.__decorateClass([
|
|
1201
|
+
aConcept.A_Feature.Extend({
|
|
1202
|
+
name: A_FrameDynamicContentFeatures.Generate,
|
|
1203
|
+
scope: [A_FrameDynamicContent]
|
|
1204
|
+
}),
|
|
1205
|
+
chunkQFHZIG7Y_cjs.__decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
|
|
1206
|
+
chunkQFHZIG7Y_cjs.__decorateParam(1, aConcept.A_Inject(A_FrameDynamicContentOperation))
|
|
1207
|
+
], A_FrameChannel.prototype, "generateDynamicContent", 1);
|
|
1208
|
+
chunkQFHZIG7Y_cjs.__decorateClass([
|
|
1209
|
+
aConcept.A_Feature.Extend({
|
|
1210
|
+
name: A_FrameDynamicContentFeatures.Patch,
|
|
1211
|
+
scope: [A_FrameDynamicContent]
|
|
1212
|
+
}),
|
|
1213
|
+
chunkQFHZIG7Y_cjs.__decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
|
|
1214
|
+
chunkQFHZIG7Y_cjs.__decorateParam(1, aConcept.A_Inject(A_FrameDynamicContentOperation))
|
|
1215
|
+
], A_FrameChannel.prototype, "patchDynamicContent", 1);
|
|
1216
|
+
var A_FrameNodeChannel = class extends A_FrameChannel {
|
|
1217
|
+
async request(context, env) {
|
|
1218
|
+
const url = `${env.A_FRAME_SERVER_URL}${context.path}`;
|
|
1219
|
+
const parsedUrl = new URL(url);
|
|
1220
|
+
const client = parsedUrl.protocol === "https:" ? https__namespace : http__namespace;
|
|
1221
|
+
const payload = context.body !== void 0 ? JSON.stringify(context.body) : void 0;
|
|
1222
|
+
const result = await new Promise((resolve, reject) => {
|
|
1223
|
+
const req = client.request(
|
|
1224
|
+
{
|
|
1225
|
+
protocol: parsedUrl.protocol,
|
|
1226
|
+
hostname: parsedUrl.hostname,
|
|
1227
|
+
port: parsedUrl.port,
|
|
1228
|
+
path: `${parsedUrl.pathname}${parsedUrl.search}`,
|
|
1229
|
+
method: context.method,
|
|
1230
|
+
headers: {
|
|
1231
|
+
...payload ? { "Content-Type": "application/json", "Content-Length": Buffer.byteLength(payload) } : {},
|
|
1232
|
+
Authorization: `Bearer ${env.A_FRAME_SERVER_API_KEY}`
|
|
1233
|
+
}
|
|
1234
|
+
},
|
|
1235
|
+
(res) => {
|
|
1236
|
+
const chunks = [];
|
|
1237
|
+
res.on("data", (chunk) => chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)));
|
|
1238
|
+
res.on("end", () => {
|
|
1239
|
+
const raw = Buffer.concat(chunks).toString("utf8");
|
|
1240
|
+
if ((res.statusCode ?? 500) >= 400) {
|
|
1241
|
+
console.error(`[A-FrameChannel] <-- ${res.statusCode} ${context.method} ${url}`);
|
|
1242
|
+
reject(
|
|
1243
|
+
new A_FrameChannelError({
|
|
1244
|
+
title: A_FrameChannelError.RequestFailed,
|
|
1245
|
+
description: `Request to ${context.path} failed with status ${res.statusCode}`
|
|
1246
|
+
})
|
|
1247
|
+
);
|
|
1248
|
+
return;
|
|
1249
|
+
}
|
|
1250
|
+
if (!raw) {
|
|
1251
|
+
console.log(`[A-FrameChannel] <-- ${res.statusCode} ${context.method} ${url} (empty)`);
|
|
1252
|
+
resolve(void 0);
|
|
1253
|
+
return;
|
|
1254
|
+
}
|
|
1255
|
+
try {
|
|
1256
|
+
const parsed = JSON.parse(raw);
|
|
1257
|
+
console.log(`[A-FrameChannel] <-- ${res.statusCode} ${context.method} ${url}`);
|
|
1258
|
+
resolve(parsed);
|
|
1259
|
+
} catch {
|
|
1260
|
+
console.error(`[A-FrameChannel] <-- ${res.statusCode} ${context.method} ${url} (invalid JSON)`);
|
|
1261
|
+
reject(
|
|
1262
|
+
new A_FrameChannelError({
|
|
1263
|
+
title: A_FrameChannelError.RequestFailed,
|
|
1264
|
+
description: `Invalid JSON response from ${context.path}`
|
|
1265
|
+
})
|
|
1266
|
+
);
|
|
1267
|
+
}
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1270
|
+
);
|
|
1271
|
+
req.setTimeout(env.A_FRAME_REQUEST_TIMEOUT, () => {
|
|
1272
|
+
console.error(`[A-FrameChannel] TIMEOUT ${context.method} ${url}`);
|
|
1273
|
+
req.destroy(
|
|
1274
|
+
new A_FrameChannelError({
|
|
1275
|
+
title: A_FrameChannelError.Timeout,
|
|
1276
|
+
description: `Request to ${context.path} timed out after ${env.A_FRAME_REQUEST_TIMEOUT}ms`
|
|
1277
|
+
})
|
|
1278
|
+
);
|
|
1279
|
+
});
|
|
1280
|
+
req.on("error", (err) => reject(err));
|
|
1281
|
+
if (payload) req.write(payload);
|
|
1282
|
+
req.end();
|
|
1283
|
+
});
|
|
1284
|
+
context.complete(result);
|
|
1285
|
+
}
|
|
1286
|
+
async stream(stream, env) {
|
|
1287
|
+
const url = `${env.A_FRAME_SERVER_URL}${stream.path}`;
|
|
1288
|
+
const parsedUrl = new URL(url);
|
|
1289
|
+
const client = parsedUrl.protocol === "https:" ? https__namespace : http__namespace;
|
|
1290
|
+
const payload = stream.body !== void 0 ? JSON.stringify(stream.body) : void 0;
|
|
1291
|
+
await new Promise((resolve, reject) => {
|
|
1292
|
+
const req = client.request(
|
|
1293
|
+
{
|
|
1294
|
+
protocol: parsedUrl.protocol,
|
|
1295
|
+
hostname: parsedUrl.hostname,
|
|
1296
|
+
port: parsedUrl.port,
|
|
1297
|
+
path: `${parsedUrl.pathname}${parsedUrl.search}`,
|
|
1298
|
+
method: stream.method,
|
|
1299
|
+
headers: {
|
|
1300
|
+
...payload ? { "Content-Type": "application/json" } : {},
|
|
1301
|
+
Accept: "text/event-stream",
|
|
1302
|
+
Authorization: `Bearer ${env.A_FRAME_SERVER_API_KEY}`,
|
|
1303
|
+
...payload ? { "Content-Length": Buffer.byteLength(payload) } : {}
|
|
1304
|
+
}
|
|
1305
|
+
},
|
|
1306
|
+
(res) => {
|
|
1307
|
+
if ((res.statusCode ?? 500) >= 400) {
|
|
1308
|
+
console.error(`[A-FrameChannel] <-- ${res.statusCode} ${stream.method} ${url}`);
|
|
1309
|
+
reject(
|
|
1310
|
+
new A_FrameChannelError({
|
|
1311
|
+
title: A_FrameChannelError.RequestFailed,
|
|
1312
|
+
description: `Stream request to ${stream.path} failed with status ${res.statusCode}`
|
|
1313
|
+
})
|
|
1314
|
+
);
|
|
1315
|
+
return;
|
|
1316
|
+
}
|
|
1317
|
+
let buffer = "";
|
|
1318
|
+
res.on("data", async (chunk) => {
|
|
1319
|
+
buffer += Buffer.isBuffer(chunk) ? chunk.toString("utf8") : String(chunk);
|
|
1320
|
+
const lines = buffer.split("\n");
|
|
1321
|
+
buffer = lines.pop() || "";
|
|
1322
|
+
for (const line of lines) {
|
|
1323
|
+
if (!line.startsWith("data: ")) continue;
|
|
1324
|
+
const data = line.slice(6).trim();
|
|
1325
|
+
if (data === "[DONE]") continue;
|
|
1326
|
+
try {
|
|
1327
|
+
const event = JSON.parse(data);
|
|
1328
|
+
await stream.propagate(event.type, event.data);
|
|
1329
|
+
} catch {
|
|
1330
|
+
console.error(`[A-FrameChannel] Invalid SSE payload from ${stream.path}: ${data}`);
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
});
|
|
1334
|
+
res.on("end", () => {
|
|
1335
|
+
console.log(`[A-FrameChannel] <-- ${res.statusCode} ${stream.method} ${url} (stream complete)`);
|
|
1336
|
+
resolve();
|
|
1337
|
+
});
|
|
1338
|
+
res.on("error", (err) => reject(err));
|
|
1339
|
+
}
|
|
1340
|
+
);
|
|
1341
|
+
req.setTimeout(3e5, () => {
|
|
1342
|
+
console.error(`[A-FrameChannel] TIMEOUT ${stream.method} ${url}`);
|
|
1343
|
+
req.destroy(
|
|
1344
|
+
new A_FrameChannelError({
|
|
1345
|
+
title: A_FrameChannelError.Timeout,
|
|
1346
|
+
description: `Stream request to ${stream.path} timed out after 300 seconds`
|
|
1347
|
+
})
|
|
1348
|
+
);
|
|
1349
|
+
});
|
|
1350
|
+
req.on("error", (err) => reject(err));
|
|
1351
|
+
if (payload) req.write(payload);
|
|
1352
|
+
req.end();
|
|
1353
|
+
});
|
|
1354
|
+
stream.complete();
|
|
1355
|
+
}
|
|
1356
|
+
async send(stream, event, env) {
|
|
1357
|
+
const url = `${env.A_FRAME_SERVER_URL}${stream.path}/send`;
|
|
1358
|
+
const parsedUrl = new URL(url);
|
|
1359
|
+
const client = parsedUrl.protocol === "https:" ? https__namespace : http__namespace;
|
|
1360
|
+
const payload = JSON.stringify({ type: event.name, data: event.data });
|
|
1361
|
+
await new Promise((resolve, reject) => {
|
|
1362
|
+
const req = client.request(
|
|
1363
|
+
{
|
|
1364
|
+
protocol: parsedUrl.protocol,
|
|
1365
|
+
hostname: parsedUrl.hostname,
|
|
1366
|
+
port: parsedUrl.port,
|
|
1367
|
+
path: `${parsedUrl.pathname}${parsedUrl.search}`,
|
|
1368
|
+
method: "POST",
|
|
1369
|
+
headers: {
|
|
1370
|
+
"Content-Type": "application/json",
|
|
1371
|
+
Authorization: `Bearer ${env.A_FRAME_SERVER_API_KEY}`,
|
|
1372
|
+
"Content-Length": Buffer.byteLength(payload)
|
|
1373
|
+
}
|
|
1374
|
+
},
|
|
1375
|
+
(res) => {
|
|
1376
|
+
res.resume();
|
|
1377
|
+
res.on("end", () => {
|
|
1378
|
+
if ((res.statusCode ?? 500) >= 400) {
|
|
1379
|
+
console.error(`[A-FrameChannel] <-- ${res.statusCode} POST ${url}`);
|
|
1380
|
+
reject(
|
|
1381
|
+
new A_FrameChannelError({
|
|
1382
|
+
title: A_FrameChannelError.RequestFailed,
|
|
1383
|
+
description: `Send event "${event.name}" to ${stream.path} failed with status ${res.statusCode}`
|
|
1384
|
+
})
|
|
1385
|
+
);
|
|
1386
|
+
return;
|
|
1387
|
+
}
|
|
1388
|
+
console.log(`[A-FrameChannel] --> ${res.statusCode} POST ${url} (event: ${event.name})`);
|
|
1389
|
+
resolve();
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
);
|
|
1393
|
+
req.setTimeout(15e3, () => {
|
|
1394
|
+
console.error(`[A-FrameChannel] TIMEOUT POST ${url}`);
|
|
1395
|
+
req.destroy(
|
|
1396
|
+
new A_FrameChannelError({
|
|
1397
|
+
title: A_FrameChannelError.Timeout,
|
|
1398
|
+
description: `Send event "${event.name}" to ${stream.path} timed out after 15 seconds`
|
|
1399
|
+
})
|
|
1400
|
+
);
|
|
1401
|
+
});
|
|
1402
|
+
req.on("error", (err) => reject(err));
|
|
1403
|
+
req.write(payload);
|
|
1404
|
+
req.end();
|
|
1405
|
+
});
|
|
1406
|
+
}
|
|
1407
|
+
};
|
|
1408
|
+
chunkQFHZIG7Y_cjs.__decorateClass([
|
|
1409
|
+
aConcept.A_Feature.Extend({
|
|
1410
|
+
name: A_FrameFeatures.Request,
|
|
1411
|
+
scope: [A_FrameChannel]
|
|
1412
|
+
}),
|
|
1413
|
+
chunkQFHZIG7Y_cjs.__decorateParam(0, aConcept.A_Inject(A_FrameChannelRequest)),
|
|
1414
|
+
chunkQFHZIG7Y_cjs.__decorateParam(1, aConcept.A_Inject(chunkXPIJ6BKP_cjs.A_FrameEnv))
|
|
1415
|
+
], A_FrameNodeChannel.prototype, "request", 1);
|
|
1416
|
+
chunkQFHZIG7Y_cjs.__decorateClass([
|
|
1417
|
+
aConcept.A_Feature.Extend({
|
|
1418
|
+
name: A_FrameFeatures.Stream,
|
|
1419
|
+
scope: [A_FrameChannel]
|
|
1420
|
+
}),
|
|
1421
|
+
chunkQFHZIG7Y_cjs.__decorateParam(0, aConcept.A_Inject(A_FrameChannelStream)),
|
|
1422
|
+
chunkQFHZIG7Y_cjs.__decorateParam(1, aConcept.A_Inject(chunkXPIJ6BKP_cjs.A_FrameEnv))
|
|
1423
|
+
], A_FrameNodeChannel.prototype, "stream", 1);
|
|
1424
|
+
chunkQFHZIG7Y_cjs.__decorateClass([
|
|
1425
|
+
aConcept.A_Feature.Extend({
|
|
1426
|
+
name: A_FrameFeatures.Send,
|
|
1427
|
+
scope: [A_FrameChannel]
|
|
1428
|
+
}),
|
|
1429
|
+
chunkQFHZIG7Y_cjs.__decorateParam(0, aConcept.A_Inject(A_FrameChannelStream)),
|
|
1430
|
+
chunkQFHZIG7Y_cjs.__decorateParam(1, aConcept.A_Inject(A_FrameChannelEvent)),
|
|
1431
|
+
chunkQFHZIG7Y_cjs.__decorateParam(2, aConcept.A_Inject(chunkXPIJ6BKP_cjs.A_FrameEnv))
|
|
1432
|
+
], A_FrameNodeChannel.prototype, "send", 1);
|
|
1433
|
+
|
|
1434
|
+
exports.A_FrameChannel = A_FrameChannel;
|
|
1435
|
+
exports.A_FrameChannelError = A_FrameChannelError;
|
|
1436
|
+
exports.A_FrameChannelEvent = A_FrameChannelEvent;
|
|
1437
|
+
exports.A_FrameChannelRequest = A_FrameChannelRequest;
|
|
1438
|
+
exports.A_FrameChannelSocketFeatures = A_FrameChannelSocketFeatures;
|
|
1439
|
+
exports.A_FrameChannelSocketStatuses = A_FrameChannelSocketStatuses;
|
|
1440
|
+
exports.A_FrameChannelStream = A_FrameChannelStream;
|
|
1441
|
+
exports.A_FrameChannelStreamFeatures = A_FrameChannelStreamFeatures;
|
|
1442
|
+
exports.A_FrameChannelStreamStatuses = A_FrameChannelStreamStatuses;
|
|
1443
|
+
exports.A_FrameFeatures = A_FrameFeatures;
|
|
1444
|
+
exports.A_FrameNodeChannel = A_FrameNodeChannel;
|
|
1445
|
+
//# sourceMappingURL=chunk-EMLZZPOT.cjs.map
|
|
1446
|
+
//# sourceMappingURL=chunk-EMLZZPOT.cjs.map
|