@onlive.ai/common-121 0.2.163 → 0.2.184
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/audi-dark.theme-B8g9SRrd.d.cts +11 -0
- package/audi-dark.theme-B8g9SRrd.d.ts +11 -0
- package/audi.theme-CbqEkKLD.d.cts +11 -0
- package/audi.theme-CbqEkKLD.d.ts +11 -0
- package/australia.theme-Cs0cygOQ.d.cts +11 -0
- package/australia.theme-Cs0cygOQ.d.ts +11 -0
- package/chunk-UTOVVCSU.js +2 -0
- package/components/asset/asset-modal-portal.cjs +1 -1
- package/components/asset/asset-modal-portal.d.cts +1 -1
- package/components/asset/asset-modal-portal.d.ts +1 -1
- package/components/asset/asset-modal-portal.js +1 -1
- package/components/asset/asset.cjs +4 -4
- package/components/asset/asset.d.cts +1 -1
- package/components/asset/asset.d.ts +1 -1
- package/components/asset/asset.js +13 -13
- package/components/asset/asset.loaders.cjs +1 -1
- package/components/asset/asset.loaders.d.cts +1 -1
- package/components/asset/asset.loaders.d.ts +1 -1
- package/components/asset/asset.loaders.js +1 -1
- package/components/asset/asset.renderer.cjs +4 -4
- package/components/asset/asset.renderer.d.cts +1 -1
- package/components/asset/asset.renderer.d.ts +1 -1
- package/components/asset/asset.renderer.js +10 -10
- package/components/asset/asset.styles.cjs +1 -1
- package/components/asset/asset.styles.d.cts +1 -1
- package/components/asset/asset.styles.d.ts +1 -1
- package/components/asset/asset.styles.js +1 -1
- package/components/asset/asset.types.cjs +1 -1
- package/components/asset/asset.types.d.cts +1 -1
- package/components/asset/asset.types.d.ts +1 -1
- package/components/asset/asset.types.js +1 -1
- package/components/asset/index.cjs +4 -4
- package/components/asset/index.d.cts +1 -1
- package/components/asset/index.d.ts +1 -1
- package/components/asset/index.js +13 -13
- package/components/player/player.cjs +1 -1
- package/components/player/player.d.cts +1 -1
- package/components/player/player.d.ts +1 -1
- package/components/player/player.js +1 -1
- package/components/player/player.styles.cjs +1 -1
- package/components/player/player.styles.d.cts +1 -1
- package/components/player/player.styles.d.ts +1 -1
- package/components/player/player.styles.js +1 -1
- package/components/side-bar/index.cjs +1 -1
- package/components/side-bar/index.d.cts +1 -1
- package/components/side-bar/index.d.ts +1 -1
- package/components/side-bar/index.js +1 -1
- package/components/side-bar/side-bar.cjs +1 -1
- package/components/side-bar/side-bar.d.cts +1 -1
- package/components/side-bar/side-bar.d.ts +1 -1
- package/components/side-bar/side-bar.js +1 -1
- package/components/side-bar/side-bar.styles.cjs +1 -1
- package/components/side-bar/side-bar.styles.d.cts +1 -1
- package/components/side-bar/side-bar.styles.d.ts +1 -1
- package/components/side-bar/side-bar.styles.js +1 -1
- package/components/side-bar/side-bar.types.cjs +1 -1
- package/components/side-bar/side-bar.types.d.cts +1 -1
- package/components/side-bar/side-bar.types.d.ts +1 -1
- package/components/side-bar/side-bar.types.js +1 -1
- package/components/upload/index.cjs +1 -1
- package/components/upload/index.d.cts +1 -1
- package/components/upload/index.d.ts +1 -1
- package/components/upload/index.js +1 -1
- package/components/upload/upload.cjs +1 -1
- package/components/upload/upload.d.cts +1 -1
- package/components/upload/upload.d.ts +1 -1
- package/components/upload/upload.js +1 -1
- package/components/upload/upload.styles.cjs +1 -1
- package/components/upload/upload.styles.d.cts +1 -1
- package/components/upload/upload.styles.d.ts +1 -1
- package/components/upload/upload.styles.js +1 -1
- package/components/upload/upload.types.cjs +1 -1
- package/components/upload/upload.types.d.cts +1 -1
- package/components/upload/upload.types.d.ts +1 -1
- package/components/upload/upload.types.js +1 -1
- package/cuernavaca.theme-0UFX1MeG.d.cts +11 -0
- package/cuernavaca.theme-0UFX1MeG.d.ts +11 -0
- package/cupra-diagonal.theme-DVrQr2iv.d.cts +11 -0
- package/cupra-diagonal.theme-DVrQr2iv.d.ts +11 -0
- package/cupra-events.theme-D2xJeafa.d.cts +11 -0
- package/cupra-events.theme-D2xJeafa.d.ts +11 -0
- package/cupra.theme-CqgKWLYE.d.cts +11 -0
- package/cupra.theme-CqgKWLYE.d.ts +11 -0
- package/germany.theme-CnwD309P.d.cts +11 -0
- package/germany.theme-CnwD309P.d.ts +11 -0
- package/hyundai.theme-E2ZiyZmJ.d.cts +11 -0
- package/hyundai.theme-E2ZiyZmJ.d.ts +11 -0
- package/index.cjs +276 -276
- package/index.d.cts +4134 -3
- package/index.d.ts +4134 -3
- package/index.js +280 -280
- package/italy.theme-BjfPp7rU.d.cts +11 -0
- package/italy.theme-BjfPp7rU.d.ts +11 -0
- package/magimix.theme-7cd19P1X.d.cts +11 -0
- package/magimix.theme-7cd19P1X.d.ts +11 -0
- package/media-SB4RDT6E.js +2 -0
- package/onlive-ai.theme-CASPoRHr.d.cts +11 -0
- package/onlive-ai.theme-CASPoRHr.d.ts +11 -0
- package/onlive.theme-nKZQHG1I.d.cts +11 -0
- package/onlive.theme-nKZQHG1I.d.ts +11 -0
- package/package.json +13 -9
- package/react/components/asset/Asset.cjs +1 -1
- package/react/components/asset/Asset.jsx +1 -1
- package/react/components/side-bar/SideBar.cjs +1 -1
- package/react/components/side-bar/SideBar.jsx +1 -1
- package/react/components/upload/Upload.cjs +1 -1
- package/react/components/upload/Upload.jsx +1 -1
- package/seat-cupra.theme-B4ylEjOZ.d.cts +11 -0
- package/seat-cupra.theme-B4ylEjOZ.d.ts +11 -0
- package/services/audio.service.cjs +1 -1
- package/services/audio.service.d.cts +1 -1
- package/services/audio.service.d.ts +1 -1
- package/services/audio.service.js +1 -1
- package/services/conversation/conversation.service.cjs +2 -2
- package/services/conversation/conversation.service.d.cts +26 -3
- package/services/conversation/conversation.service.d.ts +26 -3
- package/services/conversation/conversation.service.js +2 -2
- package/services/conversation/conversation.types.cjs +2 -2
- package/services/conversation/conversation.types.d.cts +120 -4
- package/services/conversation/conversation.types.d.ts +120 -4
- package/services/conversation/conversation.types.js +2 -2
- package/services/conversation/index.cjs +2 -2
- package/services/conversation/index.d.cts +19 -2
- package/services/conversation/index.d.ts +19 -2
- package/services/conversation/index.js +2 -2
- package/services/conversation/mock/actor/agent.cjs +2 -0
- package/services/conversation/mock/actor/agent.d.cts +202 -0
- package/services/conversation/mock/actor/agent.d.ts +202 -0
- package/services/conversation/mock/actor/agent.js +2 -0
- package/services/conversation/mock/actor/index.cjs +2 -0
- package/services/conversation/mock/actor/index.d.cts +4 -0
- package/services/conversation/mock/actor/index.d.ts +4 -0
- package/services/conversation/mock/actor/index.js +2 -0
- package/services/conversation/mock/actor/strategies.cjs +2 -0
- package/services/conversation/mock/actor/strategies.d.cts +31 -0
- package/services/conversation/mock/actor/strategies.d.ts +31 -0
- package/services/conversation/mock/actor/strategies.js +2 -0
- package/services/conversation/mock/errors.cjs +2 -0
- package/services/conversation/mock/errors.d.cts +125 -0
- package/services/conversation/mock/errors.d.ts +125 -0
- package/services/conversation/mock/errors.js +2 -0
- package/services/conversation/mock/events.cjs +2 -0
- package/services/conversation/mock/events.d.cts +253 -0
- package/services/conversation/mock/events.d.ts +253 -0
- package/services/conversation/mock/events.js +2 -0
- package/services/conversation/mock/factory.cjs +2 -0
- package/services/conversation/mock/factory.d.cts +134 -0
- package/services/conversation/mock/factory.d.ts +134 -0
- package/services/conversation/mock/factory.js +2 -0
- package/services/conversation/mock/fixtures.cjs +2 -0
- package/services/conversation/mock/fixtures.d.cts +191 -0
- package/services/conversation/mock/fixtures.d.ts +191 -0
- package/services/conversation/mock/fixtures.js +2 -0
- package/services/conversation/mock/generators.cjs +2 -0
- package/services/conversation/mock/generators.d.cts +123 -0
- package/services/conversation/mock/generators.d.ts +123 -0
- package/services/conversation/mock/generators.js +2 -0
- package/services/conversation/mock/index.cjs +2 -0
- package/services/conversation/mock/index.d.cts +24 -0
- package/services/conversation/mock/index.d.ts +24 -0
- package/services/conversation/mock/index.js +2 -0
- package/services/conversation/mock/livekit/index.cjs +2 -0
- package/services/conversation/mock/livekit/index.d.cts +7 -0
- package/services/conversation/mock/livekit/index.d.ts +7 -0
- package/services/conversation/mock/livekit/index.js +2 -0
- package/services/conversation/mock/livekit/local-participant.cjs +2 -0
- package/services/conversation/mock/livekit/local-participant.d.cts +204 -0
- package/services/conversation/mock/livekit/local-participant.d.ts +204 -0
- package/services/conversation/mock/livekit/local-participant.js +2 -0
- package/services/conversation/mock/livekit/participant.cjs +2 -0
- package/services/conversation/mock/livekit/participant.d.cts +171 -0
- package/services/conversation/mock/livekit/participant.d.ts +171 -0
- package/services/conversation/mock/livekit/participant.js +2 -0
- package/services/conversation/mock/livekit/room.cjs +2 -0
- package/services/conversation/mock/livekit/room.d.cts +292 -0
- package/services/conversation/mock/livekit/room.d.ts +292 -0
- package/services/conversation/mock/livekit/room.js +2 -0
- package/services/conversation/mock/livekit/streams.cjs +2 -0
- package/services/conversation/mock/livekit/streams.d.cts +190 -0
- package/services/conversation/mock/livekit/streams.d.ts +190 -0
- package/services/conversation/mock/livekit/streams.js +2 -0
- package/services/conversation/mock/livekit/tracks.cjs +2 -0
- package/services/conversation/mock/livekit/tracks.d.cts +149 -0
- package/services/conversation/mock/livekit/tracks.d.ts +149 -0
- package/services/conversation/mock/livekit/tracks.js +2 -0
- package/services/conversation/mock/media.cjs +2 -0
- package/services/conversation/mock/media.d.cts +174 -0
- package/services/conversation/mock/media.d.ts +174 -0
- package/services/conversation/mock/media.js +2 -0
- package/services/conversation/mock/service.cjs +2 -0
- package/services/conversation/mock/service.d.cts +305 -0
- package/services/conversation/mock/service.d.ts +305 -0
- package/services/conversation/mock/service.js +2 -0
- package/services/conversation/mock/service.test.cjs +2 -0
- package/services/conversation/mock/service.test.d.cts +1 -0
- package/services/conversation/mock/service.test.d.ts +1 -0
- package/services/conversation/mock/service.test.js +2 -0
- package/services/conversation/mock/state.cjs +2 -0
- package/services/conversation/mock/state.d.cts +296 -0
- package/services/conversation/mock/state.d.ts +296 -0
- package/services/conversation/mock/state.js +2 -0
- package/services/conversation/mock/storybook.cjs +2 -0
- package/services/conversation/mock/storybook.d.cts +197 -0
- package/services/conversation/mock/storybook.d.ts +197 -0
- package/services/conversation/mock/storybook.js +2 -0
- package/services/conversation/mock/types.cjs +2 -0
- package/services/conversation/mock/types.d.cts +442 -0
- package/services/conversation/mock/types.d.ts +442 -0
- package/services/conversation/mock/types.js +1 -0
- package/services/faqs/faqs.service.cjs +1 -1
- package/services/faqs/faqs.service.d.cts +1 -1
- package/services/faqs/faqs.service.d.ts +1 -1
- package/services/faqs/faqs.service.js +1 -1
- package/services/faqs/faqs.types.cjs +1 -1
- package/services/faqs/faqs.types.d.cts +1 -1
- package/services/faqs/faqs.types.d.ts +1 -1
- package/services/faqs/faqs.types.js +1 -1
- package/services/faqs/index.cjs +1 -1
- package/services/faqs/index.d.cts +1 -1
- package/services/faqs/index.d.ts +1 -1
- package/services/faqs/index.js +1 -1
- package/services/file/file.service.cjs +1 -1
- package/services/file/file.service.d.cts +1 -1
- package/services/file/file.service.d.ts +1 -1
- package/services/file/file.service.js +1 -1
- package/services/file/file.types.cjs +1 -1
- package/services/file/file.types.d.cts +1 -1
- package/services/file/file.types.d.ts +1 -1
- package/services/file/file.types.js +1 -1
- package/services/file/index.cjs +1 -1
- package/services/file/index.d.cts +1 -1
- package/services/file/index.d.ts +1 -1
- package/services/file/index.js +1 -1
- package/services/firebase/firebase-api.cjs +1 -1
- package/services/firebase/firebase-api.d.cts +1 -1
- package/services/firebase/firebase-api.d.ts +1 -1
- package/services/firebase/firebase-api.js +1 -1
- package/services/multimedia/config.example.cjs +1 -1
- package/services/multimedia/config.example.d.cts +1 -1
- package/services/multimedia/config.example.d.ts +1 -1
- package/services/multimedia/config.example.js +1 -1
- package/services/multimedia/index.cjs +1 -1
- package/services/multimedia/index.d.cts +1 -1
- package/services/multimedia/index.d.ts +1 -1
- package/services/multimedia/index.js +1 -1
- package/services/multimedia/multimedia.service.cjs +1 -1
- package/services/multimedia/multimedia.service.d.cts +1 -1
- package/services/multimedia/multimedia.service.d.ts +1 -1
- package/services/multimedia/multimedia.service.js +1 -1
- package/services/multimedia/multimedia.types.cjs +1 -1
- package/services/multimedia/multimedia.types.d.cts +1 -1
- package/services/multimedia/multimedia.types.d.ts +1 -1
- package/services/multimedia/multimedia.types.js +1 -1
- package/services/product/index.cjs +1 -1
- package/services/product/index.d.cts +1 -1
- package/services/product/index.d.ts +1 -1
- package/services/product/index.js +1 -1
- package/services/product/product.service.cjs +1 -1
- package/services/product/product.service.d.cts +1 -1
- package/services/product/product.service.d.ts +1 -1
- package/services/product/product.service.js +1 -1
- package/services/product/product.types.cjs +1 -1
- package/services/product/product.types.d.cts +1 -1
- package/services/product/product.types.d.ts +1 -1
- package/services/product/product.types.js +1 -1
- package/services/request.provider.cjs +1 -1
- package/services/request.provider.d.cts +1 -1
- package/services/request.provider.d.ts +1 -1
- package/services/request.provider.js +1 -1
- package/services/session.service.cjs +2 -2
- package/services/session.service.d.cts +1 -1
- package/services/session.service.d.ts +1 -1
- package/services/session.service.js +2 -2
- package/services/upload/index.cjs +1 -1
- package/services/upload/index.d.cts +1 -1
- package/services/upload/index.d.ts +1 -1
- package/services/upload/index.js +1 -1
- package/services/upload/upload.service.cjs +1 -1
- package/services/upload/upload.service.d.cts +1 -1
- package/services/upload/upload.service.d.ts +1 -1
- package/services/upload/upload.service.js +1 -1
- package/themes/custom/audi-dark.theme.cjs +920 -0
- package/themes/custom/audi-dark.theme.d.cts +3 -0
- package/themes/custom/audi-dark.theme.d.ts +3 -0
- package/themes/custom/audi-dark.theme.js +920 -0
- package/themes/custom/audi.theme.cjs +777 -0
- package/themes/custom/audi.theme.d.cts +3 -0
- package/themes/custom/audi.theme.d.ts +3 -0
- package/themes/custom/audi.theme.js +777 -0
- package/themes/custom/australia.theme.cjs +386 -0
- package/themes/custom/australia.theme.d.cts +3 -0
- package/themes/custom/australia.theme.d.ts +3 -0
- package/themes/custom/australia.theme.js +386 -0
- package/themes/custom/cuernavaca.theme.cjs +196 -0
- package/themes/custom/cuernavaca.theme.d.cts +3 -0
- package/themes/custom/cuernavaca.theme.d.ts +3 -0
- package/themes/custom/cuernavaca.theme.js +196 -0
- package/themes/custom/cupra-diagonal.theme.cjs +1029 -0
- package/themes/custom/cupra-diagonal.theme.d.cts +3 -0
- package/themes/custom/cupra-diagonal.theme.d.ts +3 -0
- package/themes/custom/cupra-diagonal.theme.js +1029 -0
- package/themes/custom/cupra-events.theme.cjs +555 -0
- package/themes/custom/cupra-events.theme.d.cts +3 -0
- package/themes/custom/cupra-events.theme.d.ts +3 -0
- package/themes/custom/cupra-events.theme.js +555 -0
- package/themes/custom/cupra.theme.cjs +147 -0
- package/themes/custom/cupra.theme.d.cts +3 -0
- package/themes/custom/cupra.theme.d.ts +3 -0
- package/themes/custom/cupra.theme.js +147 -0
- package/themes/custom/germany.theme.cjs +716 -0
- package/themes/custom/germany.theme.d.cts +3 -0
- package/themes/custom/germany.theme.d.ts +3 -0
- package/themes/custom/germany.theme.js +716 -0
- package/themes/custom/hyundai.theme.cjs +294 -0
- package/themes/custom/hyundai.theme.d.cts +3 -0
- package/themes/custom/hyundai.theme.d.ts +3 -0
- package/themes/custom/hyundai.theme.js +294 -0
- package/themes/custom/italy.theme.cjs +850 -0
- package/themes/custom/italy.theme.d.cts +3 -0
- package/themes/custom/italy.theme.d.ts +3 -0
- package/themes/custom/italy.theme.js +850 -0
- package/themes/custom/magimix.theme.cjs +119 -0
- package/themes/custom/magimix.theme.d.cts +3 -0
- package/themes/custom/magimix.theme.d.ts +3 -0
- package/themes/custom/magimix.theme.js +119 -0
- package/themes/custom/onlive-ai.theme.cjs +74 -0
- package/themes/custom/onlive-ai.theme.d.cts +3 -0
- package/themes/custom/onlive-ai.theme.d.ts +3 -0
- package/themes/custom/onlive-ai.theme.js +74 -0
- package/themes/custom/onlive.theme.cjs +33 -0
- package/themes/custom/onlive.theme.d.cts +3 -0
- package/themes/custom/onlive.theme.d.ts +3 -0
- package/themes/custom/onlive.theme.js +33 -0
- package/themes/custom/seat-cupra.theme.cjs +478 -0
- package/themes/custom/seat-cupra.theme.d.cts +3 -0
- package/themes/custom/seat-cupra.theme.d.ts +3 -0
- package/themes/custom/seat-cupra.theme.js +478 -0
- package/themes/dark.cjs +13 -2
- package/themes/dark.d.cts +1 -1
- package/themes/dark.d.ts +1 -1
- package/themes/dark.js +12 -1
- package/themes/light.cjs +13 -2
- package/themes/light.d.cts +1 -1
- package/themes/light.d.ts +1 -1
- package/themes/light.js +12 -1
- package/types/globals.cjs +1 -1
- package/types/globals.d.cts +1 -1
- package/types/globals.d.ts +1 -1
- package/types/globals.js +1 -1
- package/types/tracking-options.cjs +1 -1
- package/types/tracking-options.d.cts +1 -1
- package/types/tracking-options.d.ts +1 -1
- package/types/tracking-options.js +1 -1
- package/utils/adopt-styles.cjs +1 -1
- package/utils/adopt-styles.d.cts +1 -1
- package/utils/adopt-styles.d.ts +1 -1
- package/utils/adopt-styles.js +1 -1
- package/utils/apply-optional-styles.cjs +6548 -0
- package/utils/apply-optional-styles.d.cts +47 -0
- package/utils/apply-optional-styles.d.ts +47 -0
- package/utils/apply-optional-styles.js +6548 -0
- package/utils/browser-preferences.cjs +1 -1
- package/utils/browser-preferences.d.cts +1 -1
- package/utils/browser-preferences.d.ts +1 -1
- package/utils/browser-preferences.js +1 -1
- package/utils/classify-media.cjs +1 -1
- package/utils/classify-media.d.cts +1 -1
- package/utils/classify-media.d.ts +1 -1
- package/utils/classify-media.js +1 -1
- package/utils/decorators.cjs +1 -1
- package/utils/decorators.d.cts +1 -1
- package/utils/decorators.d.ts +1 -1
- package/utils/decorators.js +1 -1
- package/utils/detected-lang.cjs +1 -1
- package/utils/detected-lang.d.cts +1 -1
- package/utils/detected-lang.d.ts +1 -1
- package/utils/detected-lang.js +1 -1
- package/utils/fullscreen.cjs +1 -1
- package/utils/fullscreen.d.cts +1 -1
- package/utils/fullscreen.d.ts +1 -1
- package/utils/fullscreen.js +1 -1
- package/utils/insert-script.cjs +1 -1
- package/utils/insert-script.d.cts +1 -1
- package/utils/insert-script.d.ts +1 -1
- package/utils/insert-script.js +1 -1
- package/utils/is-map-compatible.cjs +1 -1
- package/utils/is-map-compatible.d.cts +1 -1
- package/utils/is-map-compatible.d.ts +1 -1
- package/utils/is-map-compatible.js +1 -1
- package/utils/markdown.cjs +1 -1
- package/utils/markdown.d.cts +1 -1
- package/utils/markdown.d.ts +1 -1
- package/utils/markdown.js +1 -1
- package/utils/merge.cjs +1 -1
- package/utils/merge.d.cts +1 -1
- package/utils/merge.d.ts +1 -1
- package/utils/merge.js +1 -1
- package/utils/multiband-track-volume.cjs +1 -1
- package/utils/multiband-track-volume.d.cts +1 -1
- package/utils/multiband-track-volume.d.ts +1 -1
- package/utils/multiband-track-volume.js +1 -1
- package/utils/onlive-url-params.cjs +1 -1
- package/utils/onlive-url-params.d.cts +1 -1
- package/utils/onlive-url-params.d.ts +1 -1
- package/utils/onlive-url-params.js +1 -1
- package/utils/pretty-distance.cjs +1 -1
- package/utils/pretty-distance.d.cts +1 -1
- package/utils/pretty-distance.d.ts +1 -1
- package/utils/pretty-distance.js +1 -1
- package/utils/pretty-time.cjs +1 -1
- package/utils/pretty-time.d.cts +1 -1
- package/utils/pretty-time.d.ts +1 -1
- package/utils/pretty-time.js +1 -1
- package/utils/random-string.cjs +1 -1
- package/utils/random-string.d.cts +1 -1
- package/utils/random-string.d.ts +1 -1
- package/utils/random-string.js +1 -1
- package/utils/resource-type.cjs +1 -1
- package/utils/resource-type.d.cts +1 -1
- package/utils/resource-type.d.ts +1 -1
- package/utils/resource-type.js +1 -1
- package/utils/round-number.cjs +1 -1
- package/utils/round-number.d.cts +1 -1
- package/utils/round-number.d.ts +1 -1
- package/utils/round-number.js +1 -1
- package/utils/safe-html.cjs +2 -2
- package/utils/safe-html.d.cts +9 -2
- package/utils/safe-html.d.ts +9 -2
- package/utils/safe-html.js +2 -2
- package/utils/sanitize.cjs +1 -1
- package/utils/sanitize.d.cts +1 -1
- package/utils/sanitize.d.ts +1 -1
- package/utils/sanitize.js +1 -1
- package/utils/spread.cjs +1 -1
- package/utils/spread.d.cts +1 -1
- package/utils/spread.d.ts +1 -1
- package/utils/spread.js +1 -1
- package/utils/watch.cjs +1 -1
- package/utils/watch.d.cts +1 -1
- package/utils/watch.d.ts +1 -1
- package/utils/watch.js +1 -1
- package/react/components/asset/Asset.d.cts +0 -33
- package/react/components/asset/Asset.d.ts +0 -33
- package/react/components/side-bar/SideBar.d.cts +0 -37
- package/react/components/side-bar/SideBar.d.ts +0 -37
- package/react/components/upload/Upload.d.cts +0 -23
- package/react/components/upload/Upload.d.ts +0 -23
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.184 | © 2026 Onlive.ai */
|
|
2
|
+
import { MockTrackPublication } from './tracks.js';
|
|
3
|
+
import '../types.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file Mock LiveKit Participant implementations.
|
|
7
|
+
*
|
|
8
|
+
* @description Provides mock implementations of LiveKit Participant classes
|
|
9
|
+
* for simulating remote participants in a room.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Participant connection quality.
|
|
14
|
+
*/
|
|
15
|
+
type MockConnectionQuality = "excellent" | "good" | "poor" | "lost" | "unknown";
|
|
16
|
+
/**
|
|
17
|
+
* Participant kind string type (for configuration).
|
|
18
|
+
*/
|
|
19
|
+
type MockParticipantKind = "standard" | "ingress" | "egress" | "sip" | "agent";
|
|
20
|
+
/**
|
|
21
|
+
* Participant kind enum matching LiveKit's ParticipantKind values.
|
|
22
|
+
* These numeric values must match livekit-protocol's ParticipantInfo_Kind enum.
|
|
23
|
+
*/
|
|
24
|
+
declare enum ParticipantKindValue {
|
|
25
|
+
STANDARD = 0,
|
|
26
|
+
INGRESS = 1,
|
|
27
|
+
EGRESS = 2,
|
|
28
|
+
SIP = 3,
|
|
29
|
+
AGENT = 4
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Mock participant representing a remote user in the room.
|
|
33
|
+
*
|
|
34
|
+
* @description Simulates a LiveKit RemoteParticipant with track publications
|
|
35
|
+
* and attribute management.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* const participant = new MockParticipant("user_123", "John Doe");
|
|
40
|
+
* participant.addTrackPublication(videoPublication);
|
|
41
|
+
* console.log(participant.getTrackPublications());
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
declare class MockParticipant {
|
|
45
|
+
/** Participant identity (unique in room) */
|
|
46
|
+
identity: string;
|
|
47
|
+
/** Server-assigned SID */
|
|
48
|
+
sid: string;
|
|
49
|
+
/** Display name */
|
|
50
|
+
name?: string;
|
|
51
|
+
/** Custom attributes */
|
|
52
|
+
attributes: Record<string, string>;
|
|
53
|
+
/**
|
|
54
|
+
* Participant kind as numeric value.
|
|
55
|
+
* This matches LiveKit's ParticipantKind enum values.
|
|
56
|
+
*/
|
|
57
|
+
kind: ParticipantKindValue;
|
|
58
|
+
/** String representation of kind for convenience */
|
|
59
|
+
private _kindString;
|
|
60
|
+
/** Connection quality */
|
|
61
|
+
connectionQuality: MockConnectionQuality;
|
|
62
|
+
/** Whether participant is speaking */
|
|
63
|
+
isSpeaking: boolean;
|
|
64
|
+
/** Audio level (0-1) */
|
|
65
|
+
audioLevel: number;
|
|
66
|
+
/** When the participant joined */
|
|
67
|
+
joinedAt?: Date;
|
|
68
|
+
/** Track publications */
|
|
69
|
+
private trackPublications;
|
|
70
|
+
/**
|
|
71
|
+
* Creates a new MockParticipant.
|
|
72
|
+
*
|
|
73
|
+
* @param identity - Unique participant identity.
|
|
74
|
+
* @param name - Optional display name.
|
|
75
|
+
* @param attributes - Optional custom attributes.
|
|
76
|
+
* @param kind - Participant kind (default: "standard").
|
|
77
|
+
*/
|
|
78
|
+
constructor(identity: string, name?: string, attributes?: Record<string, string>, kind?: MockParticipantKind);
|
|
79
|
+
/**
|
|
80
|
+
* Checks if this is an agent participant.
|
|
81
|
+
*/
|
|
82
|
+
get isAgent(): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Gets the string representation of kind.
|
|
85
|
+
*/
|
|
86
|
+
get kindString(): MockParticipantKind;
|
|
87
|
+
/**
|
|
88
|
+
* Checks if camera is enabled (has an unmuted camera track).
|
|
89
|
+
*/
|
|
90
|
+
get isCameraEnabled(): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Checks if microphone is enabled (has an unmuted microphone track).
|
|
93
|
+
*/
|
|
94
|
+
get isMicrophoneEnabled(): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Gets a track publication by source.
|
|
97
|
+
*
|
|
98
|
+
* @param source - Track source (camera, microphone, etc.).
|
|
99
|
+
* @returns The track publication or undefined.
|
|
100
|
+
*/
|
|
101
|
+
getTrackPublication(source: string): MockTrackPublication | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Gets a track publication by SID.
|
|
104
|
+
*
|
|
105
|
+
* @param trackSid - Track SID.
|
|
106
|
+
* @returns The track publication or undefined.
|
|
107
|
+
*/
|
|
108
|
+
getTrackPublicationBySid(trackSid: string): MockTrackPublication | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* Gets all track publications.
|
|
111
|
+
*
|
|
112
|
+
* @returns Array of all track publications.
|
|
113
|
+
*/
|
|
114
|
+
getTrackPublications(): MockTrackPublication[];
|
|
115
|
+
/**
|
|
116
|
+
* Gets only audio track publications.
|
|
117
|
+
*/
|
|
118
|
+
getAudioTracks(): MockTrackPublication[];
|
|
119
|
+
/**
|
|
120
|
+
* Gets only video track publications.
|
|
121
|
+
*/
|
|
122
|
+
getVideoTracks(): MockTrackPublication[];
|
|
123
|
+
/**
|
|
124
|
+
* Adds a track publication.
|
|
125
|
+
*
|
|
126
|
+
* @param pub - Track publication to add.
|
|
127
|
+
*/
|
|
128
|
+
addTrackPublication(pub: MockTrackPublication): void;
|
|
129
|
+
/**
|
|
130
|
+
* Removes a track publication.
|
|
131
|
+
*
|
|
132
|
+
* @param trackSid - Track SID to remove.
|
|
133
|
+
* @returns The removed publication or undefined.
|
|
134
|
+
*/
|
|
135
|
+
removeTrackPublication(trackSid: string): MockTrackPublication | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Updates participant attributes.
|
|
138
|
+
*
|
|
139
|
+
* @param attributes - Attributes to merge.
|
|
140
|
+
*/
|
|
141
|
+
setAttributes(attributes: Record<string, string>): void;
|
|
142
|
+
/**
|
|
143
|
+
* Gets a specific attribute.
|
|
144
|
+
*
|
|
145
|
+
* @param key - Attribute key.
|
|
146
|
+
* @returns The attribute value or undefined.
|
|
147
|
+
*/
|
|
148
|
+
getAttribute(key: string): string | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* Simulates the participant starting to speak.
|
|
151
|
+
*
|
|
152
|
+
* @param audioLevel - Audio level (0-1).
|
|
153
|
+
*/
|
|
154
|
+
startSpeaking(audioLevel?: number): void;
|
|
155
|
+
/**
|
|
156
|
+
* Simulates the participant stopping speaking.
|
|
157
|
+
*/
|
|
158
|
+
stopSpeaking(): void;
|
|
159
|
+
/**
|
|
160
|
+
* Sets connection quality.
|
|
161
|
+
*
|
|
162
|
+
* @param quality - Connection quality.
|
|
163
|
+
*/
|
|
164
|
+
setConnectionQuality(quality: MockConnectionQuality): void;
|
|
165
|
+
/**
|
|
166
|
+
* Cleans up all tracks.
|
|
167
|
+
*/
|
|
168
|
+
cleanup(): void;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export { type MockConnectionQuality, MockParticipant, type MockParticipantKind, ParticipantKindValue };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.184 | © 2026 Onlive.ai */
|
|
2
|
+
var o=0;function a(i){return o++,`mock_${i}_${o}_${Date.now().toString(36)}`}var u=(n=>(n[n.STANDARD=0]="STANDARD",n[n.INGRESS=1]="INGRESS",n[n.EGRESS=2]="EGRESS",n[n.SIP=3]="SIP",n[n.AGENT=4]="AGENT",n))(u||{});function g(i){switch(i){case"standard":return 0;case"ingress":return 1;case"egress":return 2;case"sip":return 3;case"agent":return 4;default:return 0}}var s=class{constructor(t,e,c={},r="standard"){this.connectionQuality="excellent";this.isSpeaking=!1;this.audioLevel=0;this.trackPublications=new Map;this.identity=t,this.sid=a("PA"),this.name=e,this.attributes=c,this._kindString=r,this.kind=g(r),this.joinedAt=new Date}get isAgent(){return this.kind===4||this.attributes["lk.agent.name"]!==void 0}get kindString(){return this._kindString}get isCameraEnabled(){let t=this.getTrackPublication("camera");return!!(t?.track&&!t.isMuted)}get isMicrophoneEnabled(){let t=this.getTrackPublication("microphone");return!!(t?.track&&!t.isMuted)}getTrackPublication(t){for(let e of this.trackPublications.values())if(e.source===t)return e}getTrackPublicationBySid(t){return this.trackPublications.get(t)}getTrackPublications(){return Array.from(this.trackPublications.values())}getAudioTracks(){return this.getTrackPublications().filter(t=>t.kind==="audio")}getVideoTracks(){return this.getTrackPublications().filter(t=>t.kind==="video")}addTrackPublication(t){this.trackPublications.set(t.trackSid,t)}removeTrackPublication(t){let e=this.trackPublications.get(t);return e&&(this.trackPublications.delete(t),e.track?.stop()),e}setAttributes(t){this.attributes={...this.attributes,...t}}getAttribute(t){return this.attributes[t]}startSpeaking(t=.5){this.isSpeaking=!0,this.audioLevel=t}stopSpeaking(){this.isSpeaking=!1,this.audioLevel=0}setConnectionQuality(t){this.connectionQuality=t}cleanup(){for(let t of this.trackPublications.values())t.track?.stop();this.trackPublications.clear()}};export{s as MockParticipant,u as ParticipantKindValue};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.184 | © 2026 Onlive.ai */
|
|
2
|
+
"use strict";var E=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var G=Object.prototype.hasOwnProperty;var K=(o,t)=>()=>(o&&(t=o(o=0)),t);var H=(o,t)=>{for(var e in t)E(o,e,{get:t[e],enumerable:!0})},q=(o,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of j(t))!G.call(o,n)&&n!==e&&E(o,n,{get:()=>t[n],enumerable:!(i=U(t,n))||i.enumerable});return o};var B=o=>q(E({},"__esModule",{value:!0}),o);var M={};H(M,{SYNTHETIC_MEDIA_PRESETS:()=>V,createSyntheticAudioTrack:()=>D,createSyntheticMedia:()=>L,createSyntheticMediaFromPreset:()=>Q,createSyntheticVideoTrack:()=>$});function $(o={}){let{width:t=640,height:e=480,fps:i=30,backgroundColor:n="#1a1a2e",foregroundColor:s="#4361ee",label:c="Mock Video",animation:d="wave"}=o,r=document.createElement("canvas");r.width=t,r.height=e;let a=r.getContext("2d"),u,f=Date.now(),y={wave:m=>{a.fillStyle=n,a.fillRect(0,0,t,e),a.strokeStyle=s,a.lineWidth=3,a.beginPath();for(let l=0;l<t;l++){let h=e/2+Math.sin(l/t*4*Math.PI+m*.002)*(e/4);l===0?a.moveTo(l,h):a.lineTo(l,h)}a.stroke()},pulse:m=>{a.fillStyle=n,a.fillRect(0,0,t,e);let l=Math.sin(m*.003)*.3+.7,h=Math.min(t,e)*.3*l;a.beginPath(),a.arc(t/2,e/2,h,0,Math.PI*2),a.fillStyle=s,a.fill()},bars:m=>{a.fillStyle=n,a.fillRect(0,0,t,e);let l=20,h=t/l,b=e*.7;a.fillStyle=s;for(let v=0;v<l;v++){let R=Math.abs(Math.sin(v/l*Math.PI*2+m*.004))*b,N=v*h,O=e-R;a.fillRect(N+2,O,h-4,R)}},avatar:m=>{a.fillStyle=n,a.fillRect(0,0,t,e);let l=t/2,h=e/2-20,b=Math.min(t,e)*.15;a.beginPath(),a.arc(l,h,b,0,Math.PI*2),a.fillStyle=s,a.fill(),a.beginPath(),a.ellipse(l,h+b*2.2,b*1.5,b,0,Math.PI,0),a.fill(),Math.sin(m*.01)>0&&(a.beginPath(),a.arc(l,h+b*3,5+Math.sin(m*.02)*3,0,Math.PI*2),a.fillStyle="#22c55e",a.fill())},none:()=>{a.fillStyle=n,a.fillRect(0,0,t,e)}},_=()=>{a.fillStyle="rgba(255, 255, 255, 0.8)",a.font=`${Math.floor(e*.04)}px system-ui, sans-serif`,a.textAlign="center",a.fillText(c,t/2,e-20)},P=()=>{let m=Date.now()-f;y[d](m),_(),u=requestAnimationFrame(P)};P();let C=r.captureStream(i),A=C.getVideoTracks()[0];return{track:A,stream:C,cleanup:()=>{cancelAnimationFrame(u),A.stop()}}}function D(o={}){let{frequency:t=440,volume:e=.1,waveType:i="sine",addVariation:n=!0,enabled:s=!1}=o,c=new AudioContext,d=c.createMediaStreamDestination(),r=c.createOscillator();r.type=i,r.frequency.value=t;let a=c.createGain();a.gain.value=s?e:0;let u=null,f=null;n&&(u=c.createOscillator(),u.frequency.value=.5,f=c.createGain(),f.gain.value=10,u.connect(f),f.connect(r.frequency),u.start()),r.connect(a),a.connect(d),r.start();let y=d.stream,_=y.getAudioTracks()[0];return{track:_,stream:y,setVolume:P=>{a.gain.value=Math.max(0,Math.min(1,P))},setEnabled:P=>{a.gain.value=P?e:0},cleanup:()=>{r.stop(),u?.stop(),c.close(),_.stop()}}}function L(o,t){let e=$(o),i=D(t),n=new MediaStream([e.track,i.track]);return{videoTrack:e.track,audioTrack:i.track,combinedStream:n,setAudioVolume:i.setVolume,setAudioEnabled:i.setEnabled,cleanup:()=>{e.cleanup(),i.cleanup()}}}function Q(o){let t=V[o];return L(t.video,t.audio)}var V,S=K(()=>{"use strict";V={localCamera:{video:{width:640,height:480,animation:"avatar",label:"You",foregroundColor:"#4361ee"},audio:{enabled:!1}},agentCamera:{video:{width:640,height:480,animation:"avatar",label:"AI Agent",foregroundColor:"#22c55e",backgroundColor:"#0f172a"},audio:{enabled:!1,frequency:300}},screenShare:{video:{width:1920,height:1080,animation:"bars",label:"Screen Share",backgroundColor:"#0a0a0a",foregroundColor:"#f59e0b"},audio:{enabled:!1}},voiceOnly:{video:{width:320,height:240,animation:"wave",label:"Voice Call"},audio:{enabled:!1,volume:.05}}}});var W={};H(W,{MockRoom:()=>x});module.exports=B(W);var I=0;function k(o){return I++,`mock_${o}_${I}_${Date.now().toString(36)}`}var g=class{constructor(t,e,i,n){this.muted=!1;this.enabled=!0;this.attachedElements=new Set;this.kind=t,this.source=e,this.sid=k("TR"),this.mediaStreamTrack=i,this.mediaCleanup=n}get mediaTrack(){return this.mediaStreamTrack}attach(t){let e=t||document.createElement(this.kind==="video"?"video":"audio");if(this.mediaStreamTrack){let i=new MediaStream([this.mediaStreamTrack]);e.srcObject=i,e.autoplay=!0,this.kind==="video"&&(e.playsInline=!0,e.muted=!0)}return this.attachedElements.add(e),e}detach(t){if(t)return t.srcObject=null,this.attachedElements.delete(t),[t];let e=Array.from(this.attachedElements);for(let i of e)i.srcObject=null;return this.attachedElements.clear(),e}stop(){this.detach(),this.mediaCleanup&&this.mediaCleanup(),this.mediaStreamTrack&&this.mediaStreamTrack.stop(),this.enabled=!1}setMuted(t){this.muted=t,this.mediaStreamTrack&&(this.mediaStreamTrack.enabled=!t)}setEnabled(t){this.enabled=t,this.mediaStreamTrack&&(this.mediaStreamTrack.enabled=t)}},p=class{constructor(t,e){this.subscribed=!0;this.isEnabled=!0;this.track=t,this.trackSid=t.sid,this.trackName=e||`${t.kind}_${t.source}`,this.source=t.source,this.kind=t.kind}get isMuted(){return this.track?.muted??!1}get isSubscribed(){return this.subscribed&&this.track!==null}setSubscribed(t){this.subscribed=t}setEnabled(t){this.isEnabled=t,this.track&&(this.track.enabled=t)}setMuted(t){this.track&&this.track.setMuted(t)}};var w=class{constructor(t){this.identity="";this.sid="";this.name="";this.attributes={};this.kind="standard";this.trackPublications=new Map;this.audioTrackPublications=new Map;this.videoTrackPublications=new Map;this._cameraEnabled=!1;this._microphoneEnabled=!1;this._screenShareEnabled=!1;this.room=t,this.sid=k("PA"),this.joinedAt=new Date}get isCameraEnabled(){return this._cameraEnabled}get isMicrophoneEnabled(){return this._microphoneEnabled}get isScreenShareEnabled(){return this._screenShareEnabled}getTrackPublications(){return Array.from(this.trackPublications.values())}getTrackPublication(t){let i={camera:"camera",Camera:"camera",microphone:"microphone",Microphone:"microphone",screen_share:"screen_share",ScreenShare:"screen_share",screen_share_audio:"screen_share_audio",ScreenShareAudio:"screen_share_audio"}[t]||t;return this.trackPublications.get(i)}getTrackPublicationBySid(t){for(let e of this.trackPublications.values())if(e.trackSid===t)return e}setAttributes(t){this.attributes={...this.attributes,...t}}async setCameraEnabled(t,e){if(this._cameraEnabled=t,t){let{createSyntheticVideoTrack:n}=await Promise.resolve().then(()=>(S(),M)),{track:s,cleanup:c}=n({animation:"avatar",label:this.name||"Local Camera"}),d=new g("video","camera",s,c),r=new p(d,e?.name);return this.trackPublications.set("camera",r),this.videoTrackPublications.set(d.sid,r),this.room.emit("localTrackPublished",r,this),r}let i=this.trackPublications.get("camera");i&&(i.track?.stop(),this.trackPublications.delete("camera"),this.videoTrackPublications.delete(i.trackSid),this.room.emit("localTrackUnpublished",i,this))}async setMicrophoneEnabled(t,e){if(this._microphoneEnabled=t,t){let{createSyntheticAudioTrack:n}=await Promise.resolve().then(()=>(S(),M)),{track:s,cleanup:c}=n({enabled:!1}),d=new g("audio","microphone",s,c),r=new p(d,e?.name);return this.trackPublications.set("microphone",r),this.audioTrackPublications.set(d.sid,r),this.room.emit("localTrackPublished",r,this),r}let i=this.trackPublications.get("microphone");i&&(i.track?.stop(),this.trackPublications.delete("microphone"),this.audioTrackPublications.delete(i.trackSid),this.room.emit("localTrackUnpublished",i,this))}async setScreenShareEnabled(t,e){if(this._screenShareEnabled=t,t){let{createSyntheticVideoTrack:n}=await Promise.resolve().then(()=>(S(),M)),{track:s,cleanup:c}=n({animation:"bars",label:"Screen Share",width:1920,height:1080}),d=new g("video","screen_share",s,c),r=new p(d,e?.name||"screen");return this.trackPublications.set("screen_share",r),this.videoTrackPublications.set(d.sid,r),this.room.emit("localTrackPublished",r,this),r}let i=this.trackPublications.get("screen_share");i&&(i.track?.stop(),this.trackPublications.delete("screen_share"),this.videoTrackPublications.delete(i.trackSid),this.room.emit("localTrackUnpublished",i,this))}async publishTrack(t,e){let i=new p(t,e?.name),n=e?.source||t.source;return this.trackPublications.set(n,i),t.kind==="audio"?this.audioTrackPublications.set(t.sid,i):t.kind==="video"&&this.videoTrackPublications.set(t.sid,i),this.room.emit("localTrackPublished",i,this),i}async unpublishTrack(t){t.stop();for(let[e,i]of this.trackPublications)if(i.track===t){this.trackPublications.delete(e),t.kind==="audio"?this.audioTrackPublications.delete(t.sid):t.kind==="video"&&this.videoTrackPublications.delete(t.sid),this.room.emit("localTrackUnpublished",i,this);break}}async sendText(t,e){return{id:k("msg")}}async publishData(t,e){}async setMetadata(t){this.attributes.metadata=t}async setName(t){this.name=t}cleanup(){for(let t of this.trackPublications.values())t.track?.stop();this.trackPublications.clear(),this.audioTrackPublications.clear(),this.videoTrackPublications.clear(),this._cameraEnabled=!1,this._microphoneEnabled=!1,this._screenShareEnabled=!1}};function F(o){switch(o){case"standard":return 0;case"ingress":return 1;case"egress":return 2;case"sip":return 3;case"agent":return 4;default:return 0}}var T=class{constructor(t,e,i={},n="standard"){this.connectionQuality="excellent";this.isSpeaking=!1;this.audioLevel=0;this.trackPublications=new Map;this.identity=t,this.sid=k("PA"),this.name=e,this.attributes=i,this._kindString=n,this.kind=F(n),this.joinedAt=new Date}get isAgent(){return this.kind===4||this.attributes["lk.agent.name"]!==void 0}get kindString(){return this._kindString}get isCameraEnabled(){let t=this.getTrackPublication("camera");return!!(t?.track&&!t.isMuted)}get isMicrophoneEnabled(){let t=this.getTrackPublication("microphone");return!!(t?.track&&!t.isMuted)}getTrackPublication(t){for(let e of this.trackPublications.values())if(e.source===t)return e}getTrackPublicationBySid(t){return this.trackPublications.get(t)}getTrackPublications(){return Array.from(this.trackPublications.values())}getAudioTracks(){return this.getTrackPublications().filter(t=>t.kind==="audio")}getVideoTracks(){return this.getTrackPublications().filter(t=>t.kind==="video")}addTrackPublication(t){this.trackPublications.set(t.trackSid,t)}removeTrackPublication(t){let e=this.trackPublications.get(t);return e&&(this.trackPublications.delete(t),e.track?.stop()),e}setAttributes(t){this.attributes={...this.attributes,...t}}getAttribute(t){return this.attributes[t]}startSpeaking(t=.5){this.isSpeaking=!0,this.audioLevel=t}stopSpeaking(){this.isSpeaking=!1,this.audioLevel=0}setConnectionQuality(t){this.connectionQuality=t}cleanup(){for(let t of this.trackPublications.values())t.track?.stop();this.trackPublications.clear()}};var x=class{constructor(t){this.remoteParticipants=new Map;this._state="disconnected";this.eventHandlers=new Map;this.textStreamHandlers=new Map;this.rpcHandlers=new Map;this.mockService=t,this.localParticipant=new w(this),this.sid=k("RM")}get state(){return this._state}set state(t){let e=this._state;this._state=t,e!==t&&this.emit("connectionStateChanged",t,e)}get numParticipants(){return this.remoteParticipants.size+1}get isConnected(){return this._state==="connected"}async connect(t,e){this._state="connecting",this.emit("connectionStateChanged","connecting","disconnected"),await this.mockService.simulateLatency(),this._state="connected",this.connectedAt=new Date().toISOString(),this.emit("connectionStateChanged","connected","connecting"),this.emit("connected")}async disconnect(){for(let e of this.remoteParticipants.values())e.cleanup();this.remoteParticipants.clear(),this.localParticipant.cleanup();let t=this._state;this._state="disconnected",this.emit("connectionStateChanged","disconnected",t),this.emit("disconnected"),this.eventHandlers.clear()}async reconnect(){this._state="reconnecting",this.emit("connectionStateChanged","reconnecting","connected"),await this.mockService.simulateLatency(),this._state="connected",this.emit("connectionStateChanged","connected","reconnecting"),this.emit("reconnected")}on(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Set),this.eventHandlers.get(t).add(e),this}once(t,e){let i=(...n)=>{this.off(t,i),e(...n)};return this.on(t,i)}off(t,e){return this.eventHandlers.get(t)?.delete(e),this}removeAllListeners(){this.eventHandlers.clear()}emit(t,...e){let i=this.eventHandlers.get(t);if(i)for(let n of i)try{n(...e)}catch(s){console.error(`Error in mock room event handler for ${t}:`,s)}}registerRpcMethod(t,e){this.rpcHandlers.set(t,e)}unregisterRpcMethod(t){this.rpcHandlers.delete(t)}async callRpc(t,e,i,n=1e4){let s=this.rpcHandlers.get(t);if(!s)throw new Error(`RPC method not found: ${t}`);return s({callerIdentity:e,payload:i,responseTimeout:n})}registerTextStreamHandler(t,e){this.textStreamHandlers.set(t,e)}unregisterTextStreamHandler(t){this.textStreamHandlers.delete(t)}simulateTextStream(t,e){let i=this.textStreamHandlers.get(t);i&&i(e,{identity:e.participantIdentity})}getParticipantByIdentity(t){return t===this.localParticipant.identity?new T(this.localParticipant.identity,this.localParticipant.name,this.localParticipant.attributes):this.remoteParticipants.get(t)}getParticipantBySid(t){if(t===this.localParticipant.sid)return new T(this.localParticipant.identity,this.localParticipant.name,this.localParticipant.attributes);for(let e of this.remoteParticipants.values())if(e.sid===t)return e}async simulateParticipantJoin(t,e){let i=new T(t,e?.name,e?.attributes||{},e?.kind||"standard");return this.remoteParticipants.set(t,i),this.emit("participantConnected",i),e?.withCamera&&await this.simulateRemoteTrack(t,"video","camera"),e?.withMicrophone&&await this.simulateRemoteTrack(t,"audio","microphone"),i}simulateParticipantLeave(t){let e=this.remoteParticipants.get(t);if(e){for(let i of e.getTrackPublications())i.track?.stop(),this.emit("trackUnsubscribed",i.track,i,e);this.remoteParticipants.delete(t),this.emit("participantDisconnected",e)}}async simulateRemoteTrack(t,e,i){let n=this.remoteParticipants.get(t);if(!n)return;let s,c;if(e==="video"){let{createSyntheticVideoTrack:a}=await Promise.resolve().then(()=>(S(),M)),u=a({animation:n.isAgent?"avatar":"pulse",label:n.name||t,foregroundColor:n.isAgent?"#22c55e":"#4361ee"});s=u.track,c=u.cleanup}else if(e==="audio"){let{createSyntheticAudioTrack:a}=await Promise.resolve().then(()=>(S(),M)),u=a({enabled:!1});s=u.track,c=u.cleanup}let d=new g(e,i,s,c),r=new p(d);return n.addTrackPublication(r),this.emit("trackSubscribed",d,r,n),this.emit("trackPublished",r,n),d}simulateTrackUnpublished(t,e){let i=this.remoteParticipants.get(t);if(!i)return;let n=i.getTrackPublication(e);n&&(i.removeTrackPublication(n.trackSid),this.emit("trackUnpublished",n,i),this.emit("trackUnsubscribed",n.track,n,i))}async simulateAgentJoin(t,e="AI Agent"){return this.simulateParticipantJoin(t,{name:e,kind:"agent",withCamera:!0,withMicrophone:!0,attributes:{"lk.agent.name":e,"lk.agent.state":"active"}})}simulateAttributeChange(t,e){let i=this.remoteParticipants.get(t);if(i){let n={...i.attributes};i.setAttributes(e),this.emit("participantAttributesChanged",e,n,i)}}simulateTrackMuted(t,e,i){let n=this.remoteParticipants.get(t);if(!n)return;let s=n.getTrackPublication(e);s?.track&&(s.track.setMuted(i),this.emit(i?"trackMuted":"trackUnmuted",s,n))}simulateActiveSpeakersChanged(t){let e=[];for(let i of t){let n=this.remoteParticipants.get(i);n&&(n.startSpeaking(),e.push(n))}this.emit("activeSpeakersChanged",e)}simulateDataReceived(t,e,i,n){let s=this.remoteParticipants.get(e);this.emit("dataReceived",t,s,i,n)}};0&&(module.exports={MockRoom});
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.184 | © 2026 Onlive.ai */
|
|
2
|
+
import { MockLocalParticipant } from './local-participant.cjs';
|
|
3
|
+
import { MockParticipant, MockParticipantKind } from './participant.cjs';
|
|
4
|
+
import { MockTextStreamReader } from './streams.cjs';
|
|
5
|
+
import { MockTrack } from './tracks.cjs';
|
|
6
|
+
import '../types.cjs';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @file Mock LiveKit Room implementation.
|
|
10
|
+
*
|
|
11
|
+
* @description Provides a mock implementation of LiveKit's Room class that simulates
|
|
12
|
+
* room connections, events, and participant management without real infrastructure.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Room connection state.
|
|
17
|
+
*/
|
|
18
|
+
type MockConnectionState = "disconnected" | "connecting" | "connected" | "reconnecting";
|
|
19
|
+
/**
|
|
20
|
+
* RPC method handler type.
|
|
21
|
+
*/
|
|
22
|
+
type MockRpcHandler = (data: {
|
|
23
|
+
callerIdentity: string;
|
|
24
|
+
payload: string;
|
|
25
|
+
responseTimeout: number;
|
|
26
|
+
}) => Promise<string> | string;
|
|
27
|
+
/**
|
|
28
|
+
* Text stream handler type.
|
|
29
|
+
*/
|
|
30
|
+
type MockTextStreamHandler = (reader: MockTextStreamReader, participant: {
|
|
31
|
+
identity: string;
|
|
32
|
+
}) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Event handler type.
|
|
35
|
+
*/
|
|
36
|
+
type MockEventHandler = (...args: unknown[]) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Options for simulating participant join.
|
|
39
|
+
*/
|
|
40
|
+
interface SimulateParticipantOptions {
|
|
41
|
+
/** Participant display name */
|
|
42
|
+
name?: string;
|
|
43
|
+
/** Participant kind */
|
|
44
|
+
kind?: MockParticipantKind;
|
|
45
|
+
/** Custom attributes */
|
|
46
|
+
attributes?: Record<string, string>;
|
|
47
|
+
/** Whether to add camera track */
|
|
48
|
+
withCamera?: boolean;
|
|
49
|
+
/** Whether to add microphone track */
|
|
50
|
+
withMicrophone?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Mock Room class that mimics LiveKit's Room behavior.
|
|
54
|
+
*
|
|
55
|
+
* @description Simulates a LiveKit room with connection management, participant tracking,
|
|
56
|
+
* event emission, and RPC/stream handling. Core component for testing real-time features.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* const room = new MockRoom(mockService);
|
|
61
|
+
* await room.connect("wss://mock.local", "token");
|
|
62
|
+
*
|
|
63
|
+
* room.on("ParticipantConnected", (participant) => {
|
|
64
|
+
* console.log(`${participant.name} joined`);
|
|
65
|
+
* });
|
|
66
|
+
*
|
|
67
|
+
* await room.simulateAgentJoin("agent_1", "AI Assistant");
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
declare class MockRoom {
|
|
71
|
+
/** Room ID */
|
|
72
|
+
id: string;
|
|
73
|
+
/** Server-assigned SID */
|
|
74
|
+
sid: string;
|
|
75
|
+
/** Room group ID */
|
|
76
|
+
groupId: string;
|
|
77
|
+
/** Room name */
|
|
78
|
+
name: string;
|
|
79
|
+
/** Creation timestamp */
|
|
80
|
+
createdAt: string;
|
|
81
|
+
/** Connection timestamp */
|
|
82
|
+
connectedAt: string;
|
|
83
|
+
/** Room metadata */
|
|
84
|
+
metadata?: string;
|
|
85
|
+
/** Local participant reference */
|
|
86
|
+
localParticipant: MockLocalParticipant;
|
|
87
|
+
/** Remote participants by identity */
|
|
88
|
+
remoteParticipants: Map<string, MockParticipant>;
|
|
89
|
+
/** Connection state */
|
|
90
|
+
private _state;
|
|
91
|
+
/** Event handlers by event name */
|
|
92
|
+
private eventHandlers;
|
|
93
|
+
/** Text stream handlers by topic */
|
|
94
|
+
private textStreamHandlers;
|
|
95
|
+
/** RPC method handlers */
|
|
96
|
+
private rpcHandlers;
|
|
97
|
+
/** Reference to parent service for simulation */
|
|
98
|
+
private mockService;
|
|
99
|
+
/**
|
|
100
|
+
* Creates a new MockRoom.
|
|
101
|
+
*
|
|
102
|
+
* @param mockService - Parent mock service for coordination.
|
|
103
|
+
*/
|
|
104
|
+
constructor(mockService: {
|
|
105
|
+
simulateLatency(): Promise<void>;
|
|
106
|
+
getState(): any;
|
|
107
|
+
});
|
|
108
|
+
/**
|
|
109
|
+
* Gets the current connection state.
|
|
110
|
+
*/
|
|
111
|
+
get state(): MockConnectionState;
|
|
112
|
+
/**
|
|
113
|
+
* Sets the connection state.
|
|
114
|
+
*/
|
|
115
|
+
set state(value: MockConnectionState);
|
|
116
|
+
/**
|
|
117
|
+
* Gets the number of participants (including local).
|
|
118
|
+
*/
|
|
119
|
+
get numParticipants(): number;
|
|
120
|
+
/**
|
|
121
|
+
* Gets whether the room is connected.
|
|
122
|
+
*/
|
|
123
|
+
get isConnected(): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Connects to the room.
|
|
126
|
+
*
|
|
127
|
+
* @param wsURL - WebSocket URL.
|
|
128
|
+
* @param token - Authentication token.
|
|
129
|
+
*/
|
|
130
|
+
connect(_wsURL: string, _token: string): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Disconnects from the room.
|
|
133
|
+
*/
|
|
134
|
+
disconnect(): Promise<void>;
|
|
135
|
+
/**
|
|
136
|
+
* Simulates reconnection.
|
|
137
|
+
*/
|
|
138
|
+
reconnect(): Promise<void>;
|
|
139
|
+
/**
|
|
140
|
+
* Registers an event handler.
|
|
141
|
+
*
|
|
142
|
+
* @param event - Event name.
|
|
143
|
+
* @param handler - Event handler function.
|
|
144
|
+
*/
|
|
145
|
+
on(event: string, handler: MockEventHandler): this;
|
|
146
|
+
/**
|
|
147
|
+
* Registers a one-time event handler.
|
|
148
|
+
*
|
|
149
|
+
* @param event - Event name.
|
|
150
|
+
* @param handler - Event handler function.
|
|
151
|
+
*/
|
|
152
|
+
once(event: string, handler: MockEventHandler): this;
|
|
153
|
+
/**
|
|
154
|
+
* Removes an event handler.
|
|
155
|
+
*
|
|
156
|
+
* @param event - Event name.
|
|
157
|
+
* @param handler - Handler to remove.
|
|
158
|
+
*/
|
|
159
|
+
off(event: string, handler: MockEventHandler): this;
|
|
160
|
+
/**
|
|
161
|
+
* Removes all event handlers.
|
|
162
|
+
*/
|
|
163
|
+
removeAllListeners(): void;
|
|
164
|
+
/**
|
|
165
|
+
* Emits an event to all registered handlers.
|
|
166
|
+
*
|
|
167
|
+
* @param event - Event name.
|
|
168
|
+
* @param args - Event arguments.
|
|
169
|
+
*/
|
|
170
|
+
emit(event: string, ...args: unknown[]): void;
|
|
171
|
+
/**
|
|
172
|
+
* Registers an RPC method handler.
|
|
173
|
+
*
|
|
174
|
+
* @param method - Method name.
|
|
175
|
+
* @param handler - Method handler.
|
|
176
|
+
*/
|
|
177
|
+
registerRpcMethod(method: string, handler: MockRpcHandler): void;
|
|
178
|
+
/**
|
|
179
|
+
* Unregisters an RPC method handler.
|
|
180
|
+
*
|
|
181
|
+
* @param method - Method name.
|
|
182
|
+
*/
|
|
183
|
+
unregisterRpcMethod(method: string): void;
|
|
184
|
+
/**
|
|
185
|
+
* Calls an RPC method (simulates receiving a call).
|
|
186
|
+
*
|
|
187
|
+
* @param method - Method name.
|
|
188
|
+
* @param callerIdentity - Caller identity.
|
|
189
|
+
* @param payload - Method payload.
|
|
190
|
+
* @param responseTimeout - Timeout in ms.
|
|
191
|
+
*/
|
|
192
|
+
callRpc(method: string, callerIdentity: string, payload: string, responseTimeout?: number): Promise<string>;
|
|
193
|
+
/**
|
|
194
|
+
* Registers a text stream handler.
|
|
195
|
+
*
|
|
196
|
+
* @param topic - Stream topic.
|
|
197
|
+
* @param handler - Stream handler.
|
|
198
|
+
*/
|
|
199
|
+
registerTextStreamHandler(topic: string, handler: MockTextStreamHandler): void;
|
|
200
|
+
/**
|
|
201
|
+
* Unregisters a text stream handler.
|
|
202
|
+
*
|
|
203
|
+
* @param topic - Stream topic.
|
|
204
|
+
*/
|
|
205
|
+
unregisterTextStreamHandler(topic: string): void;
|
|
206
|
+
/**
|
|
207
|
+
* Simulates receiving a text stream.
|
|
208
|
+
*
|
|
209
|
+
* @param topic - Stream topic.
|
|
210
|
+
* @param reader - Text stream reader.
|
|
211
|
+
*/
|
|
212
|
+
simulateTextStream(topic: string, reader: MockTextStreamReader): void;
|
|
213
|
+
/**
|
|
214
|
+
* Gets a participant by identity.
|
|
215
|
+
*
|
|
216
|
+
* @param identity - Participant identity.
|
|
217
|
+
*/
|
|
218
|
+
getParticipantByIdentity(identity: string): MockParticipant | undefined;
|
|
219
|
+
/**
|
|
220
|
+
* Gets a participant by SID.
|
|
221
|
+
*
|
|
222
|
+
* @param sid - Participant SID.
|
|
223
|
+
*/
|
|
224
|
+
getParticipantBySid(sid: string): MockParticipant | undefined;
|
|
225
|
+
/**
|
|
226
|
+
* Simulates a remote participant joining.
|
|
227
|
+
*
|
|
228
|
+
* @param identity - Participant identity.
|
|
229
|
+
* @param options - Join options.
|
|
230
|
+
*/
|
|
231
|
+
simulateParticipantJoin(identity: string, options?: SimulateParticipantOptions): Promise<MockParticipant>;
|
|
232
|
+
/**
|
|
233
|
+
* Simulates a remote participant leaving.
|
|
234
|
+
*
|
|
235
|
+
* @param identity - Participant identity.
|
|
236
|
+
*/
|
|
237
|
+
simulateParticipantLeave(identity: string): void;
|
|
238
|
+
/**
|
|
239
|
+
* Simulates a remote track being published.
|
|
240
|
+
*
|
|
241
|
+
* @param participantIdentity - Participant identity.
|
|
242
|
+
* @param kind - Track kind.
|
|
243
|
+
* @param source - Track source.
|
|
244
|
+
*/
|
|
245
|
+
simulateRemoteTrack(participantIdentity: string, kind: "audio" | "video", source: string): Promise<MockTrack | undefined>;
|
|
246
|
+
/**
|
|
247
|
+
* Simulates a track being unpublished.
|
|
248
|
+
*
|
|
249
|
+
* @param participantIdentity - Participant identity.
|
|
250
|
+
* @param source - Track source.
|
|
251
|
+
*/
|
|
252
|
+
simulateTrackUnpublished(participantIdentity: string, source: string): void;
|
|
253
|
+
/**
|
|
254
|
+
* Simulates an agent joining with camera and microphone.
|
|
255
|
+
*
|
|
256
|
+
* @param identity - Agent identity.
|
|
257
|
+
* @param name - Agent display name.
|
|
258
|
+
*/
|
|
259
|
+
simulateAgentJoin(identity: string, name?: string): Promise<MockParticipant>;
|
|
260
|
+
/**
|
|
261
|
+
* Simulates a participant's attribute change.
|
|
262
|
+
*
|
|
263
|
+
* @param identity - Participant identity.
|
|
264
|
+
* @param attributes - New attributes.
|
|
265
|
+
*/
|
|
266
|
+
simulateAttributeChange(identity: string, attributes: Record<string, string>): void;
|
|
267
|
+
/**
|
|
268
|
+
* Simulates a track mute/unmute.
|
|
269
|
+
*
|
|
270
|
+
* @param participantIdentity - Participant identity.
|
|
271
|
+
* @param source - Track source.
|
|
272
|
+
* @param muted - Whether muted.
|
|
273
|
+
*/
|
|
274
|
+
simulateTrackMuted(participantIdentity: string, source: string, muted: boolean): void;
|
|
275
|
+
/**
|
|
276
|
+
* Simulates an active speaker change.
|
|
277
|
+
*
|
|
278
|
+
* @param speakerIdentities - Identities of active speakers.
|
|
279
|
+
*/
|
|
280
|
+
simulateActiveSpeakersChanged(speakerIdentities: string[]): void;
|
|
281
|
+
/**
|
|
282
|
+
* Simulates data received event.
|
|
283
|
+
*
|
|
284
|
+
* @param data - Binary data.
|
|
285
|
+
* @param participantIdentity - Sender identity.
|
|
286
|
+
* @param kind - Data kind.
|
|
287
|
+
* @param topic - Data topic.
|
|
288
|
+
*/
|
|
289
|
+
simulateDataReceived(data: Uint8Array, participantIdentity: string, kind?: string, topic?: string): void;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export { type MockConnectionState, type MockEventHandler, MockRoom, type MockRpcHandler, type MockTextStreamHandler, type SimulateParticipantOptions };
|