Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function nodeSimulationForRemote(
host: string,
user: AuxUser,
id: string,
config: FormulaLibraryOptions['config']
): RemoteSimulation {
const parsedId = parseSimulationId(id);
return new RemoteSimulationImpl(
id,
config,
{
shared: {
type: 'remote_causal_tree',
host: host,
id: id,
treeName: getTreeName(parsedId.channel),
},
},
cfg =>
new AuxVMNode(
new RemoteAuxChannel(user, cfg, {
sandboxFactory: lib => getSandbox(lib),
partitionOptions: {
defaultHost: host,
export function nodeSimulationForBranch(
user: AuxUser,
client: CausalRepoClient,
branch: string,
extraOptions?: Partial
) {
return new RemoteSimulationImpl(
branch,
null,
{
shared: {
type: 'causal_repo_client',
...(extraOptions || {}),
branch: branch,
client: client,
},
},
cfg =>
new AuxVMNode(
new RemoteAuxChannel(user, cfg, {
sandboxFactory: lib => getSandbox(lib),
})
)
export function nodeSimulationForLocalRepo(user: AuxUser, id: string) {
return new RemoteSimulationImpl(
id,
null,
{
shared: {
type: 'causal_repo',
},
},
cfg =>
new AuxVMNode(
new RemoteAuxChannel(user, cfg, {
sandboxFactory: lib => getSandbox(lib),
})
)
);
}
export function nodeSimulationWithConfig(
user: AuxUser,
id: string,
config: AuxConfig
) {
return new RemoteSimulationImpl(
id,
config.config,
config.partitions,
cfg =>
new AuxVMNode(
new RemoteAuxChannel(user, cfg, {
sandboxFactory: lib => getSandbox(lib),
})
)
);
}