import { ADMIN_ROLE , RemoteAction , DeviceInfo , } from '@casual-simulation/causal-trees' ; import { PartitionConfig , AuxPartition , createAuxPartition , createMemoryPartition , createCausalRepoPartition , AuxRuntime , } from '@casual-simulation/aux-common' ; import { AuxConfig , BaseAuxChannel , AuxUser } from '@casual-simulation/aux-vm' ; import { Observable , Subject } from 'rxjs' ; export class NodeAuxChannel extends BaseAuxChannel { private _remoteEvents : Subject < RemoteAction [ ] > ; private _device : DeviceInfo ; get remoteEvents ( ) : Observable < RemoteAction [ ] > { return this . _remoteEvents ; } constructor ( user , device , config ) { super ( user , config , { } ) ; this . _device = device ; this . _remoteEvents = new Subject < RemoteAction [ ] > ( ) ; } protected async _createPartition ( config ) { return await createAuxPartition ( config , createMemoryPartition , config => createCausalRepoPartition ( config , this . user ) ) ; } protected async _sendRemoteEvents ( events ) { await super . _sendRemoteEvents ( events ) ; this . _remoteEvents . next ( events ) ; } protected _createRuntime ( ) { const manager = super . _createRuntime ( ) ; return manager ; } }