type CommandFunction = ( ip : string , port : number , basePath : string ) => string ; const SPEC = { code : ( ip , port ) => `code-server --bind-addr=${ ip }:${ port } --auth=none` , jupyter : ( ip , port , basePath ) => `jupyter notebook --port-retries=0 --no-browser --NotebookApp.iopub_data_rate_limit=${ process . env . COCALC_JUPYTER_NOTEBOOK_iopub_data_rate_limit ?? 2000000 } --NotebookApp.iopub_msg_rate_limit=${ process . env . COCALC_JUPYTER_NOTEBOOK_iopub_msg_rate_limit ?? 50 } --NotebookApp.token='' --NotebookApp.password='' --NotebookApp.allow_remote_access=True --NotebookApp.mathjax_url=/cdn/mathjax/MathJax.js --NotebookApp.base_url=${ basePath } --ip=${ ip } --port=${ port }` , jupyterlab : ( ip , port , basePath ) => `jupyter lab --port-retries=0 --no-browser --NotebookApp.iopub_data_rate_limit=${ process . env . COCALC_JUPYTER_LAB_iopub_data_rate_limit ?? 2000000 } --NotebookApp.iopub_msg_rate_limit=${ process . env . COCALC_JUPYTER_LAB_iopub_msg_rate_limit ?? 50 } --NotebookApp.token='' --NotebookApp.password='' --NotebookApp.allow_remote_access=True --NotebookApp.mathjax_url=/cdn/mathjax/MathJax.js --NotebookApp.base_url=${ basePath } --ip=${ ip } --port=${ port }` , pluto : ( ip , port ) => `echo 'import Pluto; Pluto.run(launch_browser=false, require_secret_for_access=false, host="${ ip }", port=${ port })' | julia` , } as const ; export default function getSpec ( name ) { const spec = SPEC [ name ] ; if ( spec == null ) { throw Error ( `unknown named server: "${ name }"` ) ; } return spec ; }