#!/usr/bin/env node
import {g,i,f}from'./chunk-D34YFK4M.js';import'./chunk-5TAVYPOV.js';import r from'chalk';import {execSync}from'child_process';import*as y from'os';function b(){try{return execSync("git config user.name",{encoding:"utf-8",timeout:3e3}).trim().toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").slice(0,20)||"unknown"}catch{try{return y.userInfo().username}catch{return "unknown"}}}async function w(i$1,t){let s=process.cwd();t.title||(console.error(r.red(`
  Error: --title is required
`)),process.exit(1));let a=b(),n=new Date().toISOString().slice(0,10),l=t.title.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,40),u=t.tags?t.tags.split(",").map(e=>e.trim()):[],d=t.symbols?t.symbols.split(",").map(e=>e.trim()):[];if(i$1==="quiz"){let e=`Q-${l}`,p={id:e,title:t.title,description:t.body||"",author:a,created:n,updated:n,tags:u,symbols:d,difficulty:t.difficulty||"beginner",passThreshold:.7,questions:[]};g(s,p),i(s),console.log(r.green(`
  Created quiz: ${e}`)),console.log(r.gray(`  Add questions by editing the YAML file
`));return}let o=`${i$1==="policy"?"P":"N"}-${l}`,g$1={id:o,title:t.title,type:i$1,author:a,created:n,updated:n,tags:u,symbols:d,difficulty:t.difficulty||"beginner",estimatedMinutes:t.minutes?parseInt(t.minutes,10):void 0,prerequisites:[]};f(s,g$1,t.body||""),i(s),console.log(r.green(`
  Created ${i$1}: ${o}`)),console.log(r.gray(`  Edit at .paradigm/university/content/${i$1==="policy"?"policies":"notes"}/${o}.md
`));}export{w as universityAddCommand};