@adaas/a-frame 0.0.22 → 0.0.23
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 +13 -0
- package/.conf/tsconfig.node.json +14 -0
- package/.env.example +12 -0
- package/dist/browser/A-FrameBrowserStorageBlobs.context-OEQr85oq.d.mts +40 -0
- package/dist/browser/A-FrameBundle.types-DaaUvViw.d.mts +33 -0
- package/dist/browser/A-FrameChannel.types-DWOEUs28.d.mts +142 -0
- package/dist/browser/A-FrameDefinition.entity-DWGN_Ujr.d.mts +329 -0
- package/dist/browser/A-FrameDynamicStructure.entity-DaBgSRCR.d.mts +188 -0
- package/dist/browser/A-FrameLogger.component.env-browser-BIPAP4oQ.d.mts +112 -0
- package/dist/browser/A-FrameNamespace.entity-rCm1AavP.d.mts +125 -0
- package/dist/browser/bundle.d.mts +8 -0
- package/dist/browser/bundle.mjs +2 -0
- package/dist/browser/bundle.mjs.map +1 -0
- package/dist/browser/channel.d.mts +165 -0
- package/dist/browser/channel.mjs +3 -0
- package/dist/browser/channel.mjs.map +1 -0
- package/dist/browser/chunk-5TTVFB3G.mjs +2 -0
- package/dist/browser/chunk-5TTVFB3G.mjs.map +1 -0
- package/dist/browser/chunk-AYN7KUQT.mjs +3 -0
- package/dist/browser/chunk-AYN7KUQT.mjs.map +1 -0
- package/dist/browser/chunk-DMGQW3AO.mjs +2 -0
- package/dist/browser/chunk-DMGQW3AO.mjs.map +1 -0
- package/dist/browser/chunk-G66IL2DR.mjs +2 -0
- package/dist/browser/chunk-G66IL2DR.mjs.map +1 -0
- package/dist/browser/chunk-H6OZP4ZV.mjs +2 -0
- package/dist/browser/chunk-H6OZP4ZV.mjs.map +1 -0
- package/dist/browser/chunk-INS7RO3B.mjs +2 -0
- package/dist/browser/chunk-INS7RO3B.mjs.map +1 -0
- package/dist/browser/chunk-K4MZY4ME.mjs +2 -0
- package/dist/browser/chunk-K4MZY4ME.mjs.map +1 -0
- package/dist/browser/chunk-OFKV5GNB.mjs +3 -0
- package/dist/browser/chunk-OFKV5GNB.mjs.map +1 -0
- package/dist/browser/chunk-QATIN7CO.mjs +3 -0
- package/dist/browser/chunk-QATIN7CO.mjs.map +1 -0
- package/dist/browser/chunk-QBBQ37P3.mjs +2 -0
- package/dist/browser/chunk-QBBQ37P3.mjs.map +1 -0
- package/dist/browser/chunk-VDVJWU5T.mjs +2 -0
- package/dist/browser/chunk-VDVJWU5T.mjs.map +1 -0
- package/dist/browser/chunk-X3C4I6YJ.mjs +2 -0
- package/dist/browser/chunk-X3C4I6YJ.mjs.map +1 -0
- package/dist/browser/chunk-ZVCTU2DN.mjs +3 -0
- package/dist/browser/chunk-ZVCTU2DN.mjs.map +1 -0
- package/dist/browser/core.d.mts +97 -0
- package/dist/browser/core.mjs +2 -0
- package/dist/browser/core.mjs.map +1 -0
- package/dist/browser/crypto.d.mts +35 -0
- package/dist/browser/crypto.mjs +2 -0
- package/dist/browser/crypto.mjs.map +1 -0
- package/dist/browser/definition.d.mts +13 -0
- package/dist/browser/definition.mjs +2 -0
- package/dist/browser/definition.mjs.map +1 -0
- package/dist/browser/dynamic-feature.d.mts +10 -0
- package/dist/browser/dynamic-feature.mjs +2 -0
- package/dist/browser/dynamic-feature.mjs.map +1 -0
- package/dist/browser/dynamic-structure.d.mts +12 -0
- package/dist/browser/dynamic-structure.mjs +2 -0
- package/dist/browser/dynamic-structure.mjs.map +1 -0
- package/dist/browser/env.d.mts +2 -0
- package/dist/browser/env.mjs +2 -0
- package/dist/browser/env.mjs.map +1 -0
- package/dist/browser/frame-index.d.mts +95 -0
- package/dist/browser/frame-index.mjs +2 -0
- package/dist/browser/frame-index.mjs.map +1 -0
- package/dist/browser/index.browser-CZlhzfSP.d.mts +22 -0
- package/dist/browser/index.d.mts +1 -144
- package/dist/browser/index.mjs +1 -1
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/logger.d.mts +41 -0
- package/dist/browser/logger.mjs +2 -0
- package/dist/browser/logger.mjs.map +1 -0
- package/dist/browser/namespace.d.mts +13 -0
- package/dist/browser/namespace.mjs +2 -0
- package/dist/browser/namespace.mjs.map +1 -0
- package/dist/browser/storage.d.mts +194 -0
- package/dist/browser/storage.mjs +2 -0
- package/dist/browser/storage.mjs.map +1 -0
- package/dist/browser/vector.d.mts +15 -0
- package/dist/browser/vector.mjs +2 -0
- package/dist/browser/vector.mjs.map +1 -0
- package/dist/index.cjs +0 -0
- package/dist/node/A-FrameChannel.component-BfBcs734.d.ts +62 -0
- package/dist/node/A-FrameChannel.component-NNKcFViw.d.mts +62 -0
- package/dist/node/A-FrameChannel.types-DQF-IiRq.d.mts +146 -0
- package/dist/node/A-FrameChannel.types-DQF-IiRq.d.ts +146 -0
- package/dist/node/A-FrameDefinition.entity-CAUOdEvU.d.ts +329 -0
- package/dist/node/A-FrameDefinition.entity-DWGN_Ujr.d.mts +329 -0
- package/dist/node/A-FrameDynamicStructure.entity-DaBgSRCR.d.mts +188 -0
- package/dist/node/A-FrameDynamicStructure.entity-DaBgSRCR.d.ts +188 -0
- package/dist/node/A-FrameNamespace.entity-D3fZBGDx.d.ts +125 -0
- package/dist/node/A-FrameNamespace.entity-rCm1AavP.d.mts +125 -0
- package/dist/node/A-FrameStorage.component-BYjHfHJJ.d.mts +107 -0
- package/dist/node/A-FrameStorage.component-CT01fs-t.d.ts +107 -0
- package/dist/node/bundle.cjs +101 -0
- package/dist/node/bundle.cjs.map +1 -0
- package/dist/node/bundle.d.mts +69 -0
- package/dist/node/bundle.d.ts +69 -0
- package/dist/node/bundle.mjs +76 -0
- package/dist/node/bundle.mjs.map +1 -0
- package/dist/node/channel.cjs +60 -0
- package/dist/node/channel.cjs.map +1 -0
- package/dist/node/channel.d.mts +61 -0
- package/dist/node/channel.d.ts +61 -0
- package/dist/node/channel.mjs +11 -0
- package/dist/node/channel.mjs.map +1 -0
- package/dist/node/chunk-3LOMGNWA.cjs +8 -0
- package/dist/node/chunk-3LOMGNWA.cjs.map +1 -0
- package/dist/node/chunk-3ONWH75E.mjs +257 -0
- package/dist/node/chunk-3ONWH75E.mjs.map +1 -0
- package/dist/node/chunk-3TD2PEDZ.mjs +53 -0
- package/dist/node/chunk-3TD2PEDZ.mjs.map +1 -0
- package/dist/node/chunk-442DXGOD.mjs +16 -0
- package/dist/node/chunk-442DXGOD.mjs.map +1 -0
- package/dist/node/chunk-6EFXNUL4.mjs +6 -0
- package/dist/node/chunk-6EFXNUL4.mjs.map +1 -0
- package/dist/node/chunk-7A6XGT5J.cjs +541 -0
- package/dist/node/chunk-7A6XGT5J.cjs.map +1 -0
- package/dist/node/chunk-AOQRXZPC.mjs +207 -0
- package/dist/node/chunk-AOQRXZPC.mjs.map +1 -0
- package/dist/node/chunk-APRYHBEF.mjs +171 -0
- package/dist/node/chunk-APRYHBEF.mjs.map +1 -0
- package/dist/node/chunk-B7BXP7K4.mjs +253 -0
- package/dist/node/chunk-B7BXP7K4.mjs.map +1 -0
- package/dist/node/chunk-B7ZDJXD3.cjs +35 -0
- package/dist/node/chunk-B7ZDJXD3.cjs.map +1 -0
- package/dist/node/chunk-CP6JHUU6.cjs +541 -0
- package/dist/node/chunk-CP6JHUU6.cjs.map +1 -0
- package/dist/node/chunk-DDCEMKBP.mjs +655 -0
- package/dist/node/chunk-DDCEMKBP.mjs.map +1 -0
- package/dist/node/chunk-DMY44VUG.mjs +655 -0
- package/dist/node/chunk-DMY44VUG.mjs.map +1 -0
- package/dist/node/chunk-F4UCOZW5.mjs +33 -0
- package/dist/node/chunk-F4UCOZW5.mjs.map +1 -0
- package/dist/node/chunk-GBTFMT3K.cjs +256 -0
- package/dist/node/chunk-GBTFMT3K.cjs.map +1 -0
- package/dist/node/chunk-GNVXVK2B.cjs +8 -0
- package/dist/node/chunk-GNVXVK2B.cjs.map +1 -0
- package/dist/node/chunk-IIVYTS5M.mjs +239 -0
- package/dist/node/chunk-IIVYTS5M.mjs.map +1 -0
- package/dist/node/chunk-JQBYDEMW.mjs +33 -0
- package/dist/node/chunk-JQBYDEMW.mjs.map +1 -0
- package/dist/node/chunk-K4MZY4ME.mjs +3 -0
- package/dist/node/chunk-K4MZY4ME.mjs.map +1 -0
- package/dist/node/chunk-KK64VLZN.cjs +4 -0
- package/dist/node/chunk-KK64VLZN.cjs.map +1 -0
- package/dist/node/chunk-KLG6HKFU.cjs +175 -0
- package/dist/node/chunk-KLG6HKFU.cjs.map +1 -0
- package/dist/node/chunk-LJIZ47HO.cjs +688 -0
- package/dist/node/chunk-LJIZ47HO.cjs.map +1 -0
- package/dist/node/chunk-NIXKAQVP.cjs +35 -0
- package/dist/node/chunk-NIXKAQVP.cjs.map +1 -0
- package/dist/node/chunk-OI76LHVT.mjs +21 -0
- package/dist/node/chunk-OI76LHVT.mjs.map +1 -0
- package/dist/node/chunk-OJGCQNAH.mjs +529 -0
- package/dist/node/chunk-OJGCQNAH.mjs.map +1 -0
- package/dist/node/chunk-QFHZIG7Y.cjs +25 -0
- package/dist/node/chunk-QFHZIG7Y.cjs.map +1 -0
- package/dist/node/chunk-QFUZVN4Y.cjs +259 -0
- package/dist/node/chunk-QFUZVN4Y.cjs.map +1 -0
- package/dist/node/chunk-RRLTGGM7.cjs +209 -0
- package/dist/node/chunk-RRLTGGM7.cjs.map +1 -0
- package/dist/node/chunk-TO4BPKCY.mjs +6 -0
- package/dist/node/chunk-TO4BPKCY.mjs.map +1 -0
- package/dist/node/chunk-UKKCN7CQ.cjs +688 -0
- package/dist/node/chunk-UKKCN7CQ.cjs.map +1 -0
- package/dist/node/chunk-UPA7VN4R.mjs +153 -0
- package/dist/node/chunk-UPA7VN4R.mjs.map +1 -0
- package/dist/node/chunk-UTJ7CVVB.cjs +248 -0
- package/dist/node/chunk-UTJ7CVVB.cjs.map +1 -0
- package/dist/node/chunk-YVX4W6SI.cjs +155 -0
- package/dist/node/chunk-YVX4W6SI.cjs.map +1 -0
- package/dist/node/chunk-YWWGJ6EJ.cjs +55 -0
- package/dist/node/chunk-YWWGJ6EJ.cjs.map +1 -0
- package/dist/node/chunk-Z4HUCRK2.mjs +529 -0
- package/dist/node/chunk-Z4HUCRK2.mjs.map +1 -0
- package/dist/node/chunk-ZM2RLVVH.cjs +18 -0
- package/dist/node/chunk-ZM2RLVVH.cjs.map +1 -0
- package/dist/node/core.cjs +261 -0
- package/dist/node/core.cjs.map +1 -0
- package/dist/node/core.d.mts +76 -0
- package/dist/node/core.d.ts +76 -0
- package/dist/node/core.mjs +250 -0
- package/dist/node/core.mjs.map +1 -0
- package/dist/node/crypto.cjs +13 -0
- package/dist/node/crypto.cjs.map +1 -0
- package/dist/node/crypto.d.mts +44 -0
- package/dist/node/crypto.d.ts +44 -0
- package/dist/node/crypto.mjs +4 -0
- package/dist/node/crypto.mjs.map +1 -0
- package/dist/node/definition.cjs +19 -0
- package/dist/node/definition.cjs.map +1 -0
- package/dist/node/definition.d.mts +13 -0
- package/dist/node/definition.d.ts +13 -0
- package/dist/node/definition.mjs +6 -0
- package/dist/node/definition.mjs.map +1 -0
- package/dist/node/dynamic-feature.cjs +14 -0
- package/dist/node/dynamic-feature.cjs.map +1 -0
- package/dist/node/dynamic-feature.d.mts +10 -0
- package/dist/node/dynamic-feature.d.ts +10 -0
- package/dist/node/dynamic-feature.mjs +12 -0
- package/dist/node/dynamic-feature.mjs.map +1 -0
- package/dist/node/dynamic-structure.cjs +143 -0
- package/dist/node/dynamic-structure.cjs.map +1 -0
- package/dist/node/dynamic-structure.d.mts +12 -0
- package/dist/node/dynamic-structure.d.ts +12 -0
- package/dist/node/dynamic-structure.mjs +138 -0
- package/dist/node/dynamic-structure.mjs.map +1 -0
- package/dist/node/env.cjs +14 -0
- package/dist/node/env.cjs.map +1 -0
- package/dist/node/env.d.mts +22 -0
- package/dist/node/env.d.ts +22 -0
- package/dist/node/env.mjs +5 -0
- package/dist/node/env.mjs.map +1 -0
- package/dist/node/frame-index.cjs +16 -0
- package/dist/node/frame-index.cjs.map +1 -0
- package/dist/node/frame-index.d.mts +95 -0
- package/dist/node/frame-index.d.ts +95 -0
- package/dist/node/frame-index.mjs +7 -0
- package/dist/node/frame-index.mjs.map +1 -0
- package/dist/node/index.cjs +0 -288
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.mts +1 -144
- package/dist/node/index.d.ts +1 -144
- package/dist/node/index.mjs +0 -284
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/logger.cjs +41 -0
- package/dist/node/logger.cjs.map +1 -0
- package/dist/node/logger.d.mts +150 -0
- package/dist/node/logger.d.ts +150 -0
- package/dist/node/logger.mjs +4 -0
- package/dist/node/logger.mjs.map +1 -0
- package/dist/node/namespace.cjs +24 -0
- package/dist/node/namespace.cjs.map +1 -0
- package/dist/node/namespace.d.mts +13 -0
- package/dist/node/namespace.d.ts +13 -0
- package/dist/node/namespace.mjs +7 -0
- package/dist/node/namespace.mjs.map +1 -0
- package/dist/node/storage.cjs +42 -0
- package/dist/node/storage.cjs.map +1 -0
- package/dist/node/storage.d.mts +110 -0
- package/dist/node/storage.d.ts +110 -0
- package/dist/node/storage.mjs +13 -0
- package/dist/node/storage.mjs.map +1 -0
- package/dist/node/vector.cjs +13 -0
- package/dist/node/vector.cjs.map +1 -0
- package/dist/node/vector.d.mts +15 -0
- package/dist/node/vector.d.ts +15 -0
- package/dist/node/vector.mjs +4 -0
- package/dist/node/vector.mjs.map +1 -0
- package/jest.config.browser.ts +41 -0
- package/jest.config.ts +18 -8
- package/package.json +125 -13
- package/{index.ts → src/concept.ts} +5 -2
- package/src/helpers/Hash.helper.ts +14 -0
- package/src/index.ts +0 -24
- package/src/lib/A-Frame/A-Frame.component.env-browser.ts +124 -0
- package/src/lib/A-Frame/A-Frame.component.env-node.ts +106 -0
- package/src/lib/A-Frame/A-Frame.component.ts +62 -0
- package/src/lib/A-Frame/A-Frame.context.ts +40 -0
- package/src/lib/{components/Index.component.ts/Index.error.ts → A-Frame/A-Frame.error.ts} +1 -1
- package/src/lib/{components/Index.component.ts/Index.guard.ts → A-Frame/A-Frame.guard.ts} +9 -6
- package/src/lib/A-Frame/A-Frame.meta.ts +27 -0
- package/src/lib/{components/Index.component.ts/Index.types.ts → A-Frame/A-Frame.types.ts} +52 -17
- package/src/lib/A-Frame/decorators/A-FrameDefine.decorator.ts +104 -0
- package/src/lib/A-Frame/decorators/A-FrameNamespace.decorator.ts +33 -0
- package/src/lib/A-Frame/index.browser.ts +10 -0
- package/src/lib/A-Frame/index.ts +10 -0
- package/src/lib/A-FrameBundle/A-FrameBundle.builder.env-node.ts +95 -0
- package/src/lib/A-FrameBundle/A-FrameBundle.constants.ts +5 -0
- package/src/lib/A-FrameBundle/A-FrameBundle.types.ts +31 -0
- package/src/lib/A-FrameBundle/index.browser.ts +6 -0
- package/src/lib/A-FrameBundle/index.ts +7 -0
- package/src/lib/A-FrameCLI/A-FrameCLI.container.ts +333 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.component.env-browser.ts +63 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.component.env-node.ts +586 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.component.ts +273 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.constants.ts +39 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.error.ts +10 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.types.ts +143 -0
- package/src/lib/A-FrameChannel/A-FrameChannelEvent.context.ts +28 -0
- package/src/lib/A-FrameChannel/A-FrameChannelRequest.context.ts +36 -0
- package/src/lib/A-FrameChannel/A-FrameChannelSocket.entity.ts +189 -0
- package/src/lib/A-FrameChannel/A-FrameChannelStream.entity.ts +144 -0
- package/src/lib/A-FrameChannel/index.browser.ts +3 -0
- package/src/lib/A-FrameChannel/index.ts +10 -0
- package/src/lib/A-FrameCrypto/A-FrameCrypto.component.env-browser.ts +123 -0
- package/src/lib/A-FrameCrypto/A-FrameCrypto.component.env-node.ts +204 -0
- package/src/lib/A-FrameCrypto/index.browser.ts +1 -0
- package/src/lib/A-FrameCrypto/index.ts +1 -0
- package/src/lib/A-FrameDefinition/A-FrameDefinition.constants.ts +8 -0
- package/src/lib/A-FrameDefinition/A-FrameDefinition.entity.ts +290 -0
- package/src/lib/A-FrameDefinition/A-FrameDefinition.types.ts +109 -0
- package/src/lib/A-FrameDefinition/index.ts +3 -0
- package/src/lib/A-FrameDynamicFeature/A-FrameDynamicFeature.entity.ts +13 -0
- package/src/lib/A-FrameDynamicFeature/A-FrameDynamicFeature.types.ts +10 -0
- package/src/lib/A-FrameDynamicFeature/index.ts +2 -0
- package/src/lib/A-FrameDynamicPatch/A-FrameDynamicPatch.entity.ts +38 -0
- package/src/lib/A-FrameDynamicPatch/A-FrameDynamicPatch.types.ts +20 -0
- package/src/lib/A-FrameDynamicSession/A-FrameDynamicSession.constants.ts +9 -0
- package/src/lib/A-FrameDynamicSession/A-FrameDynamicSession.entity.ts +91 -0
- package/src/lib/A-FrameDynamicSession/A-FrameDynamicSession.types.ts +18 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructure.constants.ts +13 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructure.entity.ts +187 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructure.error.ts +13 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructure.types.ts +128 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructureOperation.context.ts +32 -0
- package/src/lib/A-FrameDynamicStructure/index.ts +5 -0
- package/src/lib/A-FrameEnv/A-FrameEnv.fragment.env-browser.ts +31 -0
- package/src/lib/A-FrameEnv/A-FrameEnv.fragment.env-node.ts +39 -0
- package/src/lib/A-FrameEnv/A-FrameEnv.types.ts +7 -0
- package/src/lib/A-FrameEnv/index.browser.ts +1 -0
- package/src/lib/A-FrameEnv/index.ts +1 -0
- package/src/lib/A-FrameIndex/A-FrameIndex.context.ts +321 -0
- package/src/lib/A-FrameIndex/A-FrameIndex.types.ts +63 -0
- package/src/lib/A-FrameIndex/index.browser.ts +3 -0
- package/src/lib/A-FrameIndex/index.ts +3 -0
- package/src/lib/A-FrameLogger/A-FrameLogger.component.env-browser.ts +99 -0
- package/src/lib/A-FrameLogger/A-FrameLogger.component.env-node.ts +129 -0
- package/src/lib/A-FrameLogger/A-FrameLogger.component.ts +123 -0
- package/src/lib/A-FrameLogger/A-FrameLogger.constants.ts +66 -0
- package/src/lib/A-FrameLogger/A-FrameLogger.types.ts +67 -0
- package/src/lib/A-FrameLogger/index.browser.ts +4 -0
- package/src/lib/A-FrameLogger/index.ts +4 -0
- package/src/lib/A-FrameNamespace/A-FrameNamespace.constants.ts +12 -0
- package/src/lib/A-FrameNamespace/A-FrameNamespace.entity.ts +211 -0
- package/src/lib/A-FrameNamespace/A-FrameNamespace.types.ts +72 -0
- package/src/lib/A-FrameNamespace/index.ts +3 -0
- package/src/lib/A-FrameStorage/A-FrameStorage.codec.ts +338 -0
- package/src/lib/A-FrameStorage/A-FrameStorage.component.ts +191 -0
- package/src/lib/A-FrameStorage/A-FrameStorage.constants.ts +11 -0
- package/src/lib/A-FrameStorage/A-FrameStorage.error.ts +13 -0
- package/src/lib/A-FrameStorage/A-FrameStorage.types.ts +98 -0
- package/src/lib/A-FrameStorage/A-FrameStorageOperation.context.ts +59 -0
- package/src/lib/A-FrameStorage/browser/A-FrameBrowserStorage.component.ts +312 -0
- package/src/lib/A-FrameStorage/browser/A-FrameBrowserStorageBlobs.context.ts +77 -0
- package/src/lib/A-FrameStorage/index.browser.ts +11 -0
- package/src/lib/A-FrameStorage/index.ts +10 -0
- package/src/lib/A-FrameStorage/node/A-FrameNodeStorage.component.ts +464 -0
- package/src/lib/A-FrameStorage/server/A-FrameServerStorage.component.ts +177 -0
- package/src/lib/{entities/A_FrameVector/A_FrameVector.entity.ts → A-FrameVector/A-FrameVector.entity.ts} +10 -0
- package/src/lib/A-FrameVector/index.ts +3 -0
- package/tests/A-Frame.browser.test.ts +94 -0
- package/tests/A-Frame.test.ts +73 -68
- package/tests/jest.browser-environment.js +30 -0
- package/tests/jest.polyfills.browser.ts +13 -0
- package/tests/jest.setup.browser.ts +33 -0
- package/tsconfig.browser.json +54 -0
- package/tsconfig.json +16 -0
- package/tsup.config.ts +32 -2
- package/src/lib/components/Builder.component.ts/Builder.component.ts +0 -0
- package/src/lib/components/Index.component.ts/Index.component.ts +0 -79
- package/src/lib/components/Index.component.ts/Index.constants.ts +0 -0
- package/src/lib/components/Index.component.ts/Index.meta.ts +0 -28
- package/src/lib/components/Index.component.ts/IndexConfigurations.meta.ts +0 -78
- package/src/lib/components/Index.component.ts/decorators/IndexComponent.decorator.ts +0 -97
- package/src/lib/components/Index.component.ts/decorators/IndexDescribe.decorator.ts +0 -59
- package/src/lib/components/Index.component.ts/decorators/IndexNamespace.decorator.ts +0 -57
- package/src/lib/components/Search/A_FrameSearch.component.ts +0 -66
- package/src/lib/containers/CLI.container.ts +0 -27
- package/src/lib/entities/Namespace/Namespace.entity.ts +0 -8
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import { A_Dependency, A_Entity, A_FormatterHelper, A_Scope } from "@adaas/a-concept";
|
|
2
|
+
import {
|
|
3
|
+
A_FrameDefinition_EmbeddingMeta,
|
|
4
|
+
A_FrameDefinition_Init,
|
|
5
|
+
A_FrameDefinition_Serialized,
|
|
6
|
+
} from "./A-FrameDefinition.types";
|
|
7
|
+
import { A_FrameVector } from "../A-FrameVector/A-FrameVector.entity";
|
|
8
|
+
import { A_FrameNamespace } from "../A-FrameNamespace";
|
|
9
|
+
import { A_FrameHashHelper } from "@adaas/a-frame/helpers/Hash.helper";
|
|
10
|
+
import { A_FrameDefinitionFeatures } from "./A-FrameDefinition.constants";
|
|
11
|
+
import { A_FrameTargetType } from "../A-Frame/A-Frame.types";
|
|
12
|
+
|
|
13
|
+
export class A_FrameDefinition extends A_Entity<A_FrameDefinition_Init, A_FrameDefinition_Serialized> {
|
|
14
|
+
|
|
15
|
+
static get concept(): string {
|
|
16
|
+
return 'a-frame';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
protected _name!: string;
|
|
20
|
+
protected _type!: A_FrameTargetType;
|
|
21
|
+
protected _source!: string;
|
|
22
|
+
protected _dependency!: string;
|
|
23
|
+
protected _description?: string;
|
|
24
|
+
protected _namespace!: A_FrameNamespace;
|
|
25
|
+
protected _metadata?: Record<string, any>;
|
|
26
|
+
protected _vector?: A_FrameVector;
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Common properties for all definition types (component, entity, container, fragment, method
|
|
31
|
+
*/
|
|
32
|
+
protected _hash!: string;
|
|
33
|
+
protected _date?: string;
|
|
34
|
+
protected _model!: string;
|
|
35
|
+
protected _credentialId!: string;
|
|
36
|
+
protected _aFrameVersion!: string;
|
|
37
|
+
protected _aFrameServerVersion!: string;
|
|
38
|
+
|
|
39
|
+
//-----------------------------------------------------------------------------------------------------
|
|
40
|
+
//---------------------------------------- Primary properties -----------------------------------------
|
|
41
|
+
//-----------------------------------------------------------------------------------------------------
|
|
42
|
+
/**
|
|
43
|
+
* Definition Identifier from ASEID unique name
|
|
44
|
+
*/
|
|
45
|
+
get id(): string {
|
|
46
|
+
return this.aseid.id;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The type of the definition target (component, entity, container, fragment, or method)
|
|
50
|
+
*/
|
|
51
|
+
get type(): A_FrameTargetType {
|
|
52
|
+
return this._type;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The name of the defined feature (e.g. "MyComponent", "myMethod", etc.)
|
|
56
|
+
*/
|
|
57
|
+
get name(): string {
|
|
58
|
+
return this._name;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Description that explains the purpose of the defined feature, its inputs/outputs, or any other relevant information.
|
|
62
|
+
*/
|
|
63
|
+
get description(): string | undefined {
|
|
64
|
+
return this._description;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
get dependency(): A_Dependency {
|
|
68
|
+
return new A_Dependency(this._dependency);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The original source code string that implements the defined feature. This is the main content that gets embedded and indexed for search.
|
|
72
|
+
*/
|
|
73
|
+
get source(): string {
|
|
74
|
+
return this._source;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The vector embedding representing the definition's source and metadata. This is populated after embedding and is used for similarity search in the index.
|
|
78
|
+
*/
|
|
79
|
+
get vector(): A_FrameVector | undefined {
|
|
80
|
+
return this._vector;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Namespace to which this definition belongs. Used for scoping search and organizing definitions. If not specified, defaults to the global namespace.
|
|
84
|
+
*/
|
|
85
|
+
get namespace(): A_FrameNamespace {
|
|
86
|
+
return this._namespace;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Additional metadata about the definition, stored as key-value pairs. This can include any relevant information that doesn't fit into the other properties but may be useful for search or organization.
|
|
90
|
+
*/
|
|
91
|
+
get metadata(): Record<string, any> {
|
|
92
|
+
return this._metadata || {};
|
|
93
|
+
}
|
|
94
|
+
//-----------------------------------------------------------------------------------------------------
|
|
95
|
+
//----------------------------------- Common State properties -----------------------------------------
|
|
96
|
+
//-----------------------------------------------------------------------------------------------------
|
|
97
|
+
/**
|
|
98
|
+
* A unique hash string computed from the definition's name, source, description, and metadata. This is used to identify identical definitions and avoid duplicates in the index.
|
|
99
|
+
*/
|
|
100
|
+
get hash(): string {
|
|
101
|
+
return this._hash;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The timestamp (in milliseconds since epoch) when the definition was embedded. This is used for tracking the freshness of the embedding and can be useful for re-embedding stale definitions.
|
|
105
|
+
*/
|
|
106
|
+
get date(): string | undefined {
|
|
107
|
+
return this._date;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The name of the embedding model used to produce the vector. This is important for understanding the characteristics of the embedding and for debugging purposes.
|
|
111
|
+
*/
|
|
112
|
+
get model(): string {
|
|
113
|
+
return this._model;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* ID of the server credential (API key) used during embedding. This is useful for auditing and debugging embedding operations, especially when multiple credentials are in use.
|
|
117
|
+
*/
|
|
118
|
+
get credentialId(): string | undefined {
|
|
119
|
+
return this._credentialId;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Version of @adaas/a-frame that produced this record. This helps track compatibility and understand which version of the library was used to create the definition.
|
|
123
|
+
*/
|
|
124
|
+
get aFrameVersion(): string | undefined {
|
|
125
|
+
return this._aFrameVersion;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Version of a-frame-server that produced the vector. This is useful for debugging embedding issues and ensuring compatibility between the library and the embed server.
|
|
129
|
+
*/
|
|
130
|
+
get aFrameServerVersion(): string | undefined {
|
|
131
|
+
return this._aFrameServerVersion;
|
|
132
|
+
}
|
|
133
|
+
//-----------------------------------------------------------------------------------------------------
|
|
134
|
+
//--------------------------------------- Computed properties -----------------------------------------
|
|
135
|
+
//-----------------------------------------------------------------------------------------------------
|
|
136
|
+
get isEmbed(): boolean {
|
|
137
|
+
return this._vector !== undefined;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Saves the definition to storage. The actual implementation of saving is handled by the A_FrameDefinitionFeatures.Save feature, which can be implemented by the environment (e.g. browser, Node.js) to persist the definition in a database, file system, or other storage mechanism.
|
|
141
|
+
*
|
|
142
|
+
* @param scope
|
|
143
|
+
* @returns
|
|
144
|
+
*/
|
|
145
|
+
save(scope?: A_Scope): Promise<void> | void {
|
|
146
|
+
return this.call(A_FrameDefinitionFeatures.Save, scope);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Deletes the definition from storage. The actual implementation of deletion is handled by the A_FrameDefinitionFeatures.Destroy feature, which can be implemented by the environment to remove the definition from the database, file system, or other storage mechanism.
|
|
150
|
+
*
|
|
151
|
+
* @param scope
|
|
152
|
+
* @returns
|
|
153
|
+
*/
|
|
154
|
+
destroy(scope?: A_Scope): Promise<void> | void {
|
|
155
|
+
return this.call(A_FrameDefinitionFeatures.Destroy, scope);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Loads the definition from storage. The actual implementation of loading is handled by the A_FrameDefinitionFeatures.Load feature, which can be implemented by the environment to retrieve the definition from the database, file system, or other storage mechanism and populate the entity's properties accordingly.
|
|
159
|
+
*
|
|
160
|
+
* @param scope
|
|
161
|
+
* @returns
|
|
162
|
+
*/
|
|
163
|
+
load(scope?: A_Scope): Promise<void> | void {
|
|
164
|
+
return this.call(A_FrameDefinitionFeatures.Load, scope);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* 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.
|
|
168
|
+
*
|
|
169
|
+
* @param updates
|
|
170
|
+
*/
|
|
171
|
+
update(updates: Partial<Pick<A_FrameDefinition, 'source' | 'description' | 'metadata' | 'namespace'>>): void {
|
|
172
|
+
if (updates.source) this._source = updates.source;
|
|
173
|
+
if (updates.description !== undefined) this._description = updates.description;
|
|
174
|
+
if (updates.metadata !== undefined) this._metadata = updates.metadata;
|
|
175
|
+
if (updates.namespace !== undefined) this._namespace = updates.namespace;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Generates the embedding for the definition's source and metadata.
|
|
179
|
+
*
|
|
180
|
+
* @param scope
|
|
181
|
+
* @returns
|
|
182
|
+
*/
|
|
183
|
+
embed(scope?: A_Scope): Promise<void> | void {
|
|
184
|
+
return this.call(A_FrameDefinitionFeatures.Embed, scope);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
fromNew(newEntity: A_FrameDefinition_Init): void {
|
|
189
|
+
this._type = newEntity.type;
|
|
190
|
+
|
|
191
|
+
this.aseid = this.generateASEID({
|
|
192
|
+
id: A_FormatterHelper.toKebabCase(newEntity.dependency + '-' + newEntity.name),
|
|
193
|
+
scope: 'a-frame',
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
this._name = newEntity.name;
|
|
197
|
+
|
|
198
|
+
const hashSource = this._name + '//'
|
|
199
|
+
+ (newEntity.description || '') + '//'
|
|
200
|
+
+ (newEntity.metadata ? JSON.stringify(newEntity.metadata) : '') + '//'
|
|
201
|
+
+ newEntity.source + '//'
|
|
202
|
+
+ 'Namespace: ' + newEntity.namespace.id;
|
|
203
|
+
|
|
204
|
+
this._hash = A_FrameHashHelper.fnv1a(hashSource);
|
|
205
|
+
|
|
206
|
+
this._source = newEntity.source;
|
|
207
|
+
this._description = newEntity.description;
|
|
208
|
+
this._namespace = newEntity.namespace;
|
|
209
|
+
this._metadata = newEntity.metadata;
|
|
210
|
+
this._dependency = newEntity.dependency;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
fromJSON(serialized: A_FrameDefinition_Serialized): void {
|
|
214
|
+
this._name = serialized.name;
|
|
215
|
+
this._hash = serialized.hash;
|
|
216
|
+
this._source = serialized.source || '';
|
|
217
|
+
this._description = serialized.description;
|
|
218
|
+
this._metadata = serialized.metadata;
|
|
219
|
+
this._vector = serialized.embedding ? new A_FrameVector(serialized.embedding) : undefined;
|
|
220
|
+
this._date = serialized.date;
|
|
221
|
+
this._model = serialized.model;
|
|
222
|
+
this._credentialId = serialized.credentialId;
|
|
223
|
+
this._aFrameVersion = serialized.aFrameVersion;
|
|
224
|
+
this._aFrameServerVersion = serialized.aFrameServerVersion;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
toJSON(): A_FrameDefinition_Serialized {
|
|
228
|
+
return {
|
|
229
|
+
...super.toJSON(),
|
|
230
|
+
hash: this._hash,
|
|
231
|
+
name: this._name,
|
|
232
|
+
source: this._source,
|
|
233
|
+
description: this._description,
|
|
234
|
+
metadata: this._metadata,
|
|
235
|
+
namespace: this._namespace.aseid.toString(),
|
|
236
|
+
embedding: this._vector?.values,
|
|
237
|
+
date: this._date ?? new Date().toISOString(),
|
|
238
|
+
model: this._model,
|
|
239
|
+
credentialId: this._credentialId,
|
|
240
|
+
aFrameVersion: this._aFrameVersion,
|
|
241
|
+
aFrameServerVersion: this._aFrameServerVersion,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
// ─── Embedding hydration ──────────────────────────────────────────────────
|
|
247
|
+
|
|
248
|
+
/** Populate the vector from a pre-existing storage record */
|
|
249
|
+
// hydrateFromRecord(record: A_FrameDefinition_Record): void {
|
|
250
|
+
// if (record.hash !== this._hash) {
|
|
251
|
+
// throw new Error(
|
|
252
|
+
// `A_FrameDefinition.hydrateFromRecord: hash mismatch for "${this._name}" ` +
|
|
253
|
+
// `(expected ${this._hash}, got ${record.hash})`
|
|
254
|
+
// );
|
|
255
|
+
// }
|
|
256
|
+
// this._vector = new A_FrameVector(record.embedding);
|
|
257
|
+
// this._embeddedAt = record.embeddedAt;
|
|
258
|
+
// this._model = record.model;
|
|
259
|
+
// this._credentialId = record.credentialId;
|
|
260
|
+
// this._aFrameVersion = record.aFrameVersion;
|
|
261
|
+
// this._aFrameServerVersion = record.aFrameServerVersion;
|
|
262
|
+
// }
|
|
263
|
+
|
|
264
|
+
/** Populate the vector from a freshly-fetched embedding */
|
|
265
|
+
hydrateFromEmbedding(embedding: Float32Array, meta?: A_FrameDefinition_EmbeddingMeta): void {
|
|
266
|
+
this._vector = new A_FrameVector(embedding);
|
|
267
|
+
this._date = new Date().toISOString();
|
|
268
|
+
if (meta) {
|
|
269
|
+
this._model = meta.model;
|
|
270
|
+
this._credentialId = meta.credentialId ?? undefined;
|
|
271
|
+
this._aFrameVersion = meta.aFrameVersion;
|
|
272
|
+
this._aFrameServerVersion = meta.aFrameServerVersion;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// ─── Embedding input ──────────────────────────────────────────────────────
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Build the text string sent to the embedding model.
|
|
280
|
+
* Concatenates name + description + source so the resulting
|
|
281
|
+
* vector captures both intent and implementation.
|
|
282
|
+
*/
|
|
283
|
+
toString(): string {
|
|
284
|
+
const parts: string[] = [];
|
|
285
|
+
parts.push(`// ${this._name}`);
|
|
286
|
+
if (this._description) parts.push(`// ${this._description}`);
|
|
287
|
+
parts.push(this._source);
|
|
288
|
+
return parts.join('\n');
|
|
289
|
+
}
|
|
290
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { A_TYPES__Entity_Serialized } from "@adaas/a-concept"
|
|
2
|
+
import { A_FrameNamespace } from "../A-FrameNamespace";
|
|
3
|
+
import { A_FrameTargetType } from "../A-Frame/A-Frame.types";
|
|
4
|
+
import { A_FrameDefinition } from "./A-FrameDefinition.entity";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
// ─── Entity init / serialized ─────────────────────────────────────────────────
|
|
11
|
+
|
|
12
|
+
export type A_FrameDefinition_Init = {
|
|
13
|
+
/**
|
|
14
|
+
* Name of the Component/Fragment/Entity or method, provided automatically by the decorator.
|
|
15
|
+
*/
|
|
16
|
+
name: string,
|
|
17
|
+
/**
|
|
18
|
+
* Information where this Definition relates to Container/Component/Fragment/Entity
|
|
19
|
+
*/
|
|
20
|
+
dependency: string,
|
|
21
|
+
/**
|
|
22
|
+
* The Description that explains the purpose and functionality of the defined feature. This should provide enough context for someone to understand what the feature does and when to use it, without needing to read the source code.
|
|
23
|
+
*/
|
|
24
|
+
description?: string,
|
|
25
|
+
/**
|
|
26
|
+
* An optional metadata object that can contain any additional information about the defined feature. This can include things like parameter types for methods, expected props for components, or any other relevant details that don't fit into the description or source fields.
|
|
27
|
+
*/
|
|
28
|
+
namespace: A_FrameNamespace,
|
|
29
|
+
/**
|
|
30
|
+
* The source code or implementation details of the defined feature. For a component, this would be the component's code; for a method, it would be the method's implementation, etc.
|
|
31
|
+
*/
|
|
32
|
+
source: string,
|
|
33
|
+
/**
|
|
34
|
+
* The type of the defined feature, indicating whether it's a component, entity, container, fragment, or method. This is used for categorization and search filtering in the index.
|
|
35
|
+
*/
|
|
36
|
+
type: A_FrameTargetType,
|
|
37
|
+
/**
|
|
38
|
+
* Optional metadata object that can contain any additional information about the defined feature. This can include things like parameter types for methods, expected props for components, or any other relevant details that don't fit into the description or source fields.
|
|
39
|
+
*/
|
|
40
|
+
metadata?: Record<string, any>,
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type A_FrameDefinition_Serialized = {
|
|
44
|
+
/**
|
|
45
|
+
* Name of the Component/Fragment/Entity or method, provided automatically by the decorator.
|
|
46
|
+
*/
|
|
47
|
+
name: string
|
|
48
|
+
/**
|
|
49
|
+
* Information where this Definition relates to Container/Component/Fragment/Entity
|
|
50
|
+
*/
|
|
51
|
+
description?: string
|
|
52
|
+
/**
|
|
53
|
+
* Namespace ID or name that this definition belongs to. This is used for grouping related definitions together in the index and can be used as a filter during search.
|
|
54
|
+
*/
|
|
55
|
+
source?: string
|
|
56
|
+
/**
|
|
57
|
+
* A state indicating the last status of embeddings applied
|
|
58
|
+
*/
|
|
59
|
+
hash: string
|
|
60
|
+
/**
|
|
61
|
+
* Type of the definition (component, entity, container, fragment or method)
|
|
62
|
+
*/
|
|
63
|
+
type: A_FrameTargetType,
|
|
64
|
+
/**
|
|
65
|
+
* Optional metadata object that can contain any additional information about the defined feature. This can include things like parameter types for methods, expected props for components, or any other relevant details that don't fit into the description or source fields.
|
|
66
|
+
*/
|
|
67
|
+
metadata?: Record<string, unknown>
|
|
68
|
+
/**
|
|
69
|
+
* Namespace ID or name that this definition belongs to. This is used for grouping related definitions together in the index and can be used as a filter during search.
|
|
70
|
+
*/
|
|
71
|
+
namespace: string
|
|
72
|
+
/**
|
|
73
|
+
* An Float32Array representing the embedding vector for this definition, if it has been generated and stored. This can be used for similarity search and retrieval in the index.
|
|
74
|
+
*/
|
|
75
|
+
embedding?: Float32Array
|
|
76
|
+
/**
|
|
77
|
+
* ISO timestamp string of when the embedding was generated. This can be used for cache invalidation or tracking when the data was last updated.
|
|
78
|
+
*/
|
|
79
|
+
date: string
|
|
80
|
+
/**
|
|
81
|
+
* Name of the model used in the request
|
|
82
|
+
*/
|
|
83
|
+
model: string
|
|
84
|
+
/**
|
|
85
|
+
* ID of the server credential (API key) used during embedding
|
|
86
|
+
*/
|
|
87
|
+
credentialId: string
|
|
88
|
+
/**
|
|
89
|
+
* Version of @adaas/a-frame that produced this record
|
|
90
|
+
*/
|
|
91
|
+
aFrameVersion: string
|
|
92
|
+
/**
|
|
93
|
+
* Version of adaas-a-frame-mcp (embed-server) that produced the vector
|
|
94
|
+
*/
|
|
95
|
+
aFrameServerVersion: string
|
|
96
|
+
|
|
97
|
+
} & A_TYPES__Entity_Serialized
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
export type A_FrameDefinition_EmbeddingMeta = {
|
|
102
|
+
model: string,
|
|
103
|
+
dimensions: number,
|
|
104
|
+
inputCount: number,
|
|
105
|
+
date: string,
|
|
106
|
+
credentialId: string,
|
|
107
|
+
aFrameVersion: string,
|
|
108
|
+
aFrameServerVersion: string
|
|
109
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { A_Entity } from "@adaas/a-concept";
|
|
2
|
+
import { A_FrameDynamicFeature_Init, A_FrameDynamicFeature_Serialized } from "./A-FrameDynamicFeature.types";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export class A_FrameDynamicFeature extends A_Entity<A_FrameDynamicFeature_Init, A_FrameDynamicFeature_Serialized> {
|
|
7
|
+
|
|
8
|
+
static get concept(): string {
|
|
9
|
+
return 'a-frame';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { A_Entity } from "@adaas/a-concept";
|
|
2
|
+
import { A_FrameDynamicPatch_Init, A_FrameDynamicPatch_Serialized } from "./A-FrameDynamicPatch.types";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export class A_FrameDynamicPatch extends A_Entity<A_FrameDynamicPatch_Init, A_FrameDynamicPatch_Serialized> {
|
|
6
|
+
|
|
7
|
+
static get concept(): string {
|
|
8
|
+
return 'a-frame';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
version!: number;
|
|
12
|
+
timestamp!: number;
|
|
13
|
+
reason!: string;
|
|
14
|
+
encoded!: string; // base64-encoded snapshot of components at this version
|
|
15
|
+
delta!: number; // component count change vs. previous patch
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
fromNew(options: A_FrameDynamicPatch_Init) {
|
|
20
|
+
this.version = options.version;
|
|
21
|
+
this.timestamp = options.timestamp;
|
|
22
|
+
this.reason = options.reason;
|
|
23
|
+
this.encoded = options.encoded;
|
|
24
|
+
this.delta = options.delta;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
toJSON(): A_FrameDynamicPatch_Serialized {
|
|
29
|
+
return {
|
|
30
|
+
...super.toJSON(),
|
|
31
|
+
version: this.version,
|
|
32
|
+
timestamp: this.timestamp,
|
|
33
|
+
reason: this.reason,
|
|
34
|
+
encoded: this.encoded,
|
|
35
|
+
delta: this.delta,
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { A_TYPES__Entity_Serialized } from "@adaas/a-concept";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export type A_FrameDynamicPatch_Init = {
|
|
6
|
+
version: number;
|
|
7
|
+
timestamp: number;
|
|
8
|
+
reason: string;
|
|
9
|
+
encoded: string; // base64-encoded snapshot of components at this version
|
|
10
|
+
delta: number; // component count change vs. previous patch
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export type A_FrameDynamicPatch_Serialized = {
|
|
15
|
+
version: number;
|
|
16
|
+
timestamp: number;
|
|
17
|
+
reason: string;
|
|
18
|
+
encoded: string; // base64-encoded snapshot of components at this version
|
|
19
|
+
delta: number; // component count change vs. previous patch
|
|
20
|
+
} & A_TYPES__Entity_Serialized
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { A_Context, A_Entity, A_Scope } from "@adaas/a-concept"
|
|
2
|
+
import { A_FrameDynamicSession_Init, A_FrameDynamicSession_Serialized } from "./A-FrameDynamicSession.types";
|
|
3
|
+
import { A_FrameDynamicSessionFeatures } from "./A-FrameDynamicSession.constants";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export class A_FrameDynamicSession extends A_Entity<A_FrameDynamicSession_Init, A_FrameDynamicSession_Serialized> {
|
|
7
|
+
static get concept(): string {
|
|
8
|
+
return 'a-frame';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
protected _scope!: A_Scope
|
|
15
|
+
|
|
16
|
+
protected _turnsCount!: number;
|
|
17
|
+
protected _currentTurn!: number;
|
|
18
|
+
protected _initDate!: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
get scope(): A_Scope {
|
|
24
|
+
|
|
25
|
+
if (!this._scope) {
|
|
26
|
+
this._scope = A_Context.allocate(this, new A_Scope({ name: `${this.aseid.id}-scope` }));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return this._scope;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
get currentTurn(): number {
|
|
33
|
+
return this._currentTurn;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
get initDate(): Date {
|
|
37
|
+
return new Date(this._initDate);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
static onQuestion() {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
static onAnswer() {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
fromNew(newEntity: A_FrameDynamicSession_Init): void {
|
|
51
|
+
this._turnsCount = newEntity.turnsCount || 5;
|
|
52
|
+
this._currentTurn = 0;
|
|
53
|
+
this._initDate = new Date().toISOString();
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
fromJSON(serialized: A_FrameDynamicSession_Serialized): void {
|
|
58
|
+
this._turnsCount = serialized.turnsCount;
|
|
59
|
+
this._currentTurn = serialized.currentTurn;
|
|
60
|
+
this._initDate = serialized.initDate;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
async init() {
|
|
65
|
+
await this.call(A_FrameDynamicSessionFeatures.Init)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async destroy(scope?: A_Scope): Promise<void> {
|
|
69
|
+
await this.call(A_FrameDynamicSessionFeatures.Destroy, scope);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
async question() {
|
|
74
|
+
this._currentTurn++;
|
|
75
|
+
await this.call(A_FrameDynamicSessionFeatures.Question);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async answer() {
|
|
79
|
+
await this.call(A_FrameDynamicSessionFeatures.Answer);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
toJSON(): A_FrameDynamicSession_Serialized {
|
|
84
|
+
return {
|
|
85
|
+
...super.toJSON(),
|
|
86
|
+
turnsCount: this._turnsCount,
|
|
87
|
+
currentTurn: this._currentTurn,
|
|
88
|
+
initDate: this._initDate,
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { A_TYPES__Entity_Serialized } from "@adaas/a-concept";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export type A_FrameDynamicSession_Init = {
|
|
6
|
+
|
|
7
|
+
turnsCount: number;
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export type A_FrameDynamicSession_Serialized = {
|
|
13
|
+
|
|
14
|
+
turnsCount: number;
|
|
15
|
+
currentTurn: number;
|
|
16
|
+
initDate: string;
|
|
17
|
+
|
|
18
|
+
} & A_TYPES__Entity_Serialized
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const A_FrameDynamicStructureFeatures = {
|
|
5
|
+
Load: '_A_FRAME_DYNAMIC_STRUCTURE_LOAD',
|
|
6
|
+
Update: '_A_FRAME_DYNAMIC_STRUCTURE_UPDATE',
|
|
7
|
+
Generate: '_A_FRAME_DYNAMIC_STRUCTURE_GENERATE',
|
|
8
|
+
} as const;
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
export const A_FrameDynamicStructureEvents = {
|
|
12
|
+
Updated: '_A_FRAME_DYNAMIC_STRUCTURE_UPDATED',
|
|
13
|
+
} as const;
|