#!/usr/bin/env node
import'./chunk-5TAVYPOV.js';import o from'chalk';import*as n from'path';import {fileURLToPath}from'url';var p=fileURLToPath(import.meta.url),i=n.dirname(p);async function g(d,t){let r=parseInt(t.port||"3839",10),s=t.open!==false;console.log(o.cyan(`
Opening the campus gates...
`));try{let{startServer:e}=await import('./server-2MNROHF6.js'),a=n.resolve(i,"university-content"),c=n.resolve(i,"university-ui");console.log(o.gray(`Port: ${r}`)),console.log(),await e({port:r,open:s,contentDir:a,uiDistPath:c,projectDir:process.cwd()}),console.log(o.green(`
Paradigm University is running at http://localhost:${r}`)),console.log(o.gray(`
Press Ctrl+C to stop
`)),await new Promise(()=>{});}catch(e){e.code==="ERR_MODULE_NOT_FOUND"||e.code==="MODULE_NOT_FOUND"?(console.error(o.red(`
@a-company/university is not installed.`)),console.log(o.gray(`Install it with: npm install @a-company/university
`))):e.code==="EADDRINUSE"?(console.error(o.red(`
Error: Port ${r} is already in use.`)),console.log(o.gray(`Try a different port with: paradigm university serve --port ${r+1}
`))):console.error(o.red(`
Failed to start Paradigm University:`),e),process.exit(1);}}export{g as universityServeCommand};