@a-company/paradigm 6.6.2 → 6.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/{accept-orchestration-TIXUQQGR.js → accept-orchestration-JHDCVHB2.js} +1 -1
  2. package/dist/add-V6XR7DU5.js +12 -0
  3. package/dist/{aggregate-A5S5MTCC.js → aggregate-KZICPVT3.js} +1 -1
  4. package/dist/arch-loader-G3AAM4E2.js +2 -0
  5. package/dist/{beacon-QVUD3MGP.js → beacon-52EWNZPK.js} +1 -1
  6. package/dist/{chunk-AXQBUD3Q.js → chunk-3OXR6F65.js} +49 -49
  7. package/dist/chunk-4GC35IFF.js +2 -0
  8. package/dist/chunk-EKNLG73M.js +6 -0
  9. package/dist/{chunk-Y4P4SGZV.js → chunk-MBSY57RN.js} +1 -1
  10. package/dist/{chunk-IOVHF4SR.js → chunk-MU5YWTNE.js} +1 -1
  11. package/dist/chunk-PMKZMCTS.js +111 -0
  12. package/dist/{chunk-4PSD5R7N.js → chunk-QDP4G53M.js} +1 -1
  13. package/dist/{chunk-ARLB6YYW.js → chunk-RGSFU2YW.js} +1 -1
  14. package/dist/{chunk-TOYQ2QCB.js → chunk-S3UVQ5RV.js} +1 -1
  15. package/dist/chunk-TMDPDIWA.js +3 -0
  16. package/dist/{chunk-2AU5L333.js → chunk-XKNJSPB5.js} +1 -1
  17. package/dist/{commands-ANRJNG2W.js → commands-4ENQMHFO.js} +1 -1
  18. package/dist/{constellation-NWLXYATA.js → constellation-RHZAEFV7.js} +1 -1
  19. package/dist/{diff-75MABOSL.js → diff-ANKTFDRA.js} +1 -1
  20. package/dist/dist-RXYJK7AZ.js +2 -0
  21. package/dist/dist-TNE4GFT7.js +2 -0
  22. package/dist/index.js +6 -6
  23. package/dist/{init-V4KSEKPK.js → init-F4MSKZIW.js} +1 -1
  24. package/dist/{integrity-ROO3G43N.js → integrity-7TKX3DZ4.js} +1 -1
  25. package/dist/list-NC3QGT75.js +12 -0
  26. package/dist/mcp.js +3 -3
  27. package/dist/{orchestrate-K4KBTBYK.js → orchestrate-UG5QXNAU.js} +1 -1
  28. package/dist/{probe-5HAXULAD.js → probe-27ARJKRO.js} +1 -1
  29. package/dist/quiz-TNV6APBM.js +10 -0
  30. package/dist/reindex-PTIQ2UGY.js +2 -0
  31. package/dist/review-BRO2UP4M.js +11 -0
  32. package/dist/{ripple-FNZI47SH.js → ripple-KCVDS3WE.js} +1 -1
  33. package/dist/sentinel.js +1 -1
  34. package/dist/serve-2PKJP65E.js +12 -0
  35. package/dist/server-4SYOUF6D.js +7 -0
  36. package/dist/{setup-ZSEC72BS.js → setup-5V2AGLQ6.js} +1 -1
  37. package/dist/{shift-QY3EXVF4.js → shift-TNA2E5O7.js} +2 -2
  38. package/dist/show-N5LGB5B2.js +7 -0
  39. package/dist/{snapshot-3IYB67D4.js → snapshot-YMX5QRBM.js} +1 -1
  40. package/dist/{status-DB3KNLW3.js → status-3GJXI4IK.js} +1 -1
  41. package/dist/status-ENAI35NL.js +6 -0
  42. package/dist/{summary-WLI3NF4G.js → summary-RPU2BS3Q.js} +1 -1
  43. package/dist/{team-2LGZQRP4.js → team-PEGP6F7S.js} +1 -1
  44. package/dist/{tools-W5WRPSJF.js → tools-PUSDXUYE.js} +1 -1
  45. package/dist/university-ui/assets/{index-BIQeax_b.js → index-DrtbBC21.js} +2 -2
  46. package/dist/university-ui/assets/{index-BIQeax_b.js.map → index-DrtbBC21.js.map} +1 -1
  47. package/dist/university-ui/index.html +1 -1
  48. package/dist/validate-IQG7DBFC.js +9 -0
  49. package/dist/{workspace-VMSPYIBV.js → workspace-6POCBPDY.js} +1 -1
  50. package/package.json +2 -1
  51. package/dist/add-CBDFTWST.js +0 -12
  52. package/dist/arch-loader-T3TARMSO.js +0 -2
  53. package/dist/chunk-5NAF6CKU.js +0 -111
  54. package/dist/chunk-ERO4MJSH.js +0 -6
  55. package/dist/chunk-LWAIVOSF.js +0 -2
  56. package/dist/chunk-P344HV6Z.js +0 -2
  57. package/dist/chunk-SU5F5D4I.js +0 -3
  58. package/dist/dist-JZZJLVMR.js +0 -2
  59. package/dist/dist-OG6MM4VY.js +0 -2
  60. package/dist/list-AXKTBXKJ.js +0 -12
  61. package/dist/quiz-G56CUN45.js +0 -10
  62. package/dist/reindex-2YTQP2EO.js +0 -2
  63. package/dist/review-VMSX2PKI.js +0 -11
  64. package/dist/serve-TJQ5BNKR.js +0 -12
  65. package/dist/server-QOCW5RU6.js +0 -7
  66. package/dist/show-MTPEQFXK.js +0 -7
  67. package/dist/status-REA6HUXE.js +0 -6
  68. package/dist/validate-742XMB42.js +0 -9
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export{b as PREFIX_TO_TYPE,a as SYMBOL_PREFIXES,j as addConnection,h as addPremiseNode,m as aggregateFromDirectory,l as aggregateFromPremise,o as buildSymbolIndex,e as createEmptyPremiseFile,k as createSnapshot,n as createSymbolIndex,E as createSymbolString,v as getAllComponentTypes,C as getAllSymbols,A as getAllTags,G as getAutocompleteSuggestions,w as getChildComponents,u as getComponentsByType,g as getDefaultPremiseContent,y as getReferencesFrom,x as getReferencesTo,p as getSymbol,q as getSymbolById,B as getSymbolCounts,s as getSymbolsBySource,z as getSymbolsByTag,r as getSymbolsByType,F as isValidSymbol,d as parsePremiseContent,c as parsePremiseFile,D as parseSymbol,t as searchSymbols,f as serializePremiseFile,i as updateNodePosition}from'./chunk-LWAIVOSF.js';import'./chunk-JIXHEBGK.js';import'./chunk-ZJQY5PPP.js';import'./chunk-5TAVYPOV.js';
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env node
2
- import {a as a$1,j}from'./chunk-ERO4MJSH.js';import {d,b,a,c}from'./chunk-P344HV6Z.js';import'./chunk-5TAVYPOV.js';import t from'chalk';async function w(o){let s=process.cwd();if(!d(o)){let n=b(s);if(o.json){console.log(JSON.stringify({packs:n},null,2));return}if(n.length===0){console.log(t.yellow(`
3
- No content packs discovered.`)),console.log(t.gray(` Scaffold one with: paradigm university init
4
- `));return}console.log(t.blue(`
5
- Content packs (${n.length})
6
- `));for(let e of n){let r=e.tenantKind==="first-party"?t.cyan("first-party"):e.tenantKind==="project"?t.green("project"):t.yellow("external"),a$1=e.disciplines&&e.disciplines.length>0?t.gray(` [${e.disciplines.join(", ")}]`):"",d=a(e.packRoot),k=d.length>0?t.gray(` (${d.length} section${d.length===1?"":"s"})`):"";console.log(` ${t.white(e.id.padEnd(28))} ${r} ${e.entryCount} entries${k}${a$1}`),e.name&&e.name!==e.id&&console.log(t.gray(` ${e.name}`));}console.log(t.gray(`
7
- Tip: paradigm university list --project (list entries in project pack)`)),console.log("");return}let g=c(s,o),l=g.subPackId??g.packId,i=a$1(s);if(!i||i.totalContent===0){console.log(t.yellow(`
8
- No content found in pack "${l}".`)),console.log(t.gray(` Create content with: paradigm university add note --title "My Note"
9
- `));return}let c$1=j(s,{type:o.type,tag:o.tag,difficulty:o.difficulty,symbol:o.symbol,section:o.section,limit:o.limit?parseInt(o.limit,10):20});if(o.json){console.log(JSON.stringify({pack:l,results:c$1},null,2));return}console.log(t.blue(`
10
- University Content \u2014 pack: ${l} (${c$1.length} of ${i.totalContent})
11
- `));let h={note:"N",policy:"P",guide:"N",runbook:"N",quiz:"Q",path:"LP"};for(let n of c$1){let e=h[n.type]||"?",r=n.difficulty==="advanced"?t.red:n.difficulty==="intermediate"?t.yellow:t.green,a=n.tags.length>0?t.gray(` [${n.tags.join(", ")}]`):"";console.log(` ${t.cyan(e)} ${t.white(`${l}:${n.id}`)} \u2014 ${n.title}${a}`),n.difficulty&&console.log(` ${r(n.difficulty)} \xB7 ${n.author} \xB7 ${n.updated||n.created}`);}i.diplomaCount>0&&console.log(t.gray(`
12
- ${i.diplomaCount} diploma${i.diplomaCount>1?"s":""} earned`)),console.log();}export{w as universityListCommand};
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
- import {c as c$1,h}from'./chunk-ERO4MJSH.js';import {c}from'./chunk-P344HV6Z.js';import'./chunk-5TAVYPOV.js';import o from'chalk';import*as q from'readline';import {execSync}from'child_process';import*as S from'os';function x(){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 S.userInfo().username}catch{return "unknown"}}}function P(e,n){return new Promise(r=>e.question(n,r))}function v(e){let n=e.indexOf(":");return n===-1?{entryId:e}:{packId:e.slice(0,n),entryId:e.slice(n+1)}}async function T(e,n={}){let r=process.cwd(),{packId:g,entryId:D}=v(e),d={...n};g&&(d.pack=g),c(r,d);let t=c$1(r,D);if(t||(console.error(o.red(`
3
- Quiz "${e}" not found
4
- `)),process.exit(1)),t.questions.length===0){console.log(o.yellow(`
5
- Quiz "${e}" has no questions.
6
- `));return}let m=q.createInterface({input:process.stdin,output:process.stdout});console.log(o.blue(`
7
- ${t.title}`)),t.description&&console.log(o.gray(` ${t.description}`)),console.log(o.gray(` ${t.questions.length} questions \xB7 Pass: ${t.passThreshold*100}%
8
- `));let i=0;for(let l=0;l<t.questions.length;l++){let s=t.questions[l];console.log(o.white(` ${l+1}. ${s.question}`));let u=Object.keys(s.choices).sort();for(let $ of u)console.log(` ${o.cyan($)}: ${s.choices[$]}`);let c="";for(;!u.includes(c.toUpperCase());)c=await P(m,o.gray(` Your answer (${u.join("/")}): `)),c=c.trim().toUpperCase();c===s.correct?(i++,console.log(o.green(" Correct!"))):console.log(o.red(` Wrong \u2014 correct answer: ${s.correct}`)),s.explanation&&console.log(o.gray(` \u2192 ${s.explanation}`)),console.log();}m.close();let a=t.questions.length,p=Math.round(i/a*1e4)/100,f=p/100>=t.passThreshold,y=x();console.log(o.blue(" \u2500\u2500\u2500 Results \u2500\u2500\u2500")),console.log(` Score: ${i}/${a} (${p}%)`),console.log(` Pass threshold: ${t.passThreshold*100}%`),console.log(f?o.green(" PASSED"):o.red(" FAILED"));let h$1=`D-${new Date().toISOString().slice(0,10)}-${y}-${e.replace(/^Q-/,"")}`,O={id:h$1,type:"quiz",student:y,earnedAt:new Date().toISOString(),source:e,score:i,total:a,percentage:p,passed:f};h(r,O),console.log(o.gray(`
9
- Diploma saved: ${h$1}
10
- `));}export{T as universityQuizCommand};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export{ea as getReindexToolsList,fa as handleReindexTool,ga as rebuildStaticFiles}from'./chunk-5NAF6CKU.js';import'./chunk-SU5F5D4I.js';import'./chunk-M4UMM6DC.js';import'./chunk-GRZQIKST.js';import'./chunk-6QXBXZF6.js';import'./chunk-EK4ZRIFJ.js';import'./chunk-LAYBUKMB.js';import'./chunk-5TAVYPOV.js';
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- import {n,m,o as o$1,t,r as r$1}from'./chunk-LWAIVOSF.js';import'./chunk-JIXHEBGK.js';import'./chunk-ZJQY5PPP.js';import {a as a$1}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as a from'fs';import*as r from'path';import o from'chalk';import {execSync}from'child_process';import*as F from'js-yaml';var W=/[@#$%^!?&~][a-zA-Z][a-zA-Z0-9_-]*/g,_=[/\.(get|post|put|patch|delete)\s*\(\s*['"`]([^'"`]+)['"`]/gi,/export\s+(async\s+)?function\s+(GET|POST|PUT|PATCH|DELETE)/gi];async function G(n$1={}){let i=process.cwd(),b=a$1.command("review").start("Running review pipeline",{cwd:i}),u=[],m$1=[];try{if(n$1.pr)u=execSync(`gh pr diff ${n$1.pr} --name-only`,{cwd:i,encoding:"utf8",timeout:15e3}).trim().split(`
3
- `).filter(Boolean);else {let e=execSync("git diff --cached --name-only",{cwd:i,encoding:"utf8",timeout:5e3}).trim(),t=execSync("git diff --name-only",{cwd:i,encoding:"utf8",timeout:5e3}).trim();u=[...new Set([...e.split(`
4
- `).filter(Boolean),...t.split(`
5
- `).filter(Boolean)])];}}catch(e){let t=e.message;n$1.json||a$1.command("review").error(`Failed to get changed files: ${t}`),b.error("Failed to get changed files"),n$1.ci&&process.exit(1);return}if(u.length===0){n$1.json?console.log(JSON.stringify({findings:[],summary:{total:0,blocking:0,improvements:0,notes:0}})):console.log(o.green(`
6
- No modified files to review.
7
- `)),b.success("No files to review");return}try{for(let e of u)if(e.endsWith(".purpose")){let t=r.join(i,e);if(a.existsSync(t)){let g=a.readFileSync(t,"utf-8").match(W)||[];m$1.push(...g);}}m$1=[...new Set(m$1)];}catch{}let s=[],$=n();try{let e=await m(i);$=o$1(e);}catch{}let R=r.join(i,"portal.yaml"),h=null;if(a.existsSync(R))try{h=F.load(a.readFileSync(R,"utf-8"));}catch{}for(let e of m$1)t($,e).length===0&&s.push({type:"blocking",category:"purpose-coverage",message:`Symbol "${e}" is not registered in any .purpose file`,suggestion:"Add to nearest .purpose file using paradigm_purpose_add_component."});let N=h?.routes?Object.keys(h.routes):[];for(let e of u){let t=r.isAbsolute(e)?e:r.join(i,e);if(!a.existsSync(t))continue;let l;try{l=a.readFileSync(t,"utf-8");}catch{continue}for(let g of _){g.lastIndex=0;let d;for(;(d=g.exec(l))!==null;){let f=d[2]||d[0];f&&f.startsWith("/")&&(N.some(p=>p.replace(/\s+(GET|POST|PUT|PATCH|DELETE)\s*$/,"").trim()===f)||s.push({type:h?"blocking":"improvement",category:"route-coverage",message:`Route "${f}" in ${e} not in portal.yaml`,file:e,suggestion:"Add route to portal.yaml with ^gates."}));}}}let O=h?Object.keys(h.gates||{}).map(e=>e.startsWith("^")?e.slice(1):e):[];for(let e of m$1)if(e.startsWith("^")){let t=e.slice(1);O.includes(t)||s.push({type:"blocking",category:"portal-compliance",message:`Gate "${e}" referenced but not declared in portal.yaml`,suggestion:`Add ${e} to portal.yaml with description and check expression.`});}try{let e=r$1($,"aspect");for(let t of e){let l=t.appliesTo||[];if(l.length!==0){for(let g of l)for(let d of m$1)if(I(g,d)){let c=t.anchors||[];if(c.length===0)s.push({type:"improvement",category:"aspect-anchors",message:`Aspect "${t.symbol}" applies to "${d}" but has no code anchors`,suggestion:`Add anchors to ${t.symbol} in .purpose file.`});else for(let p of c){let T=r.isAbsolute(p.path)?p.path:r.join(i,p.path);a.existsSync(T)||s.push({type:"improvement",category:"aspect-anchors",message:`Aspect "${t.symbol}" anchor "${p.raw}" points to missing file`,suggestion:`Update anchors for ${t.symbol} in .purpose file.`});}}}}}catch{}for(let e of m$1){let t$1=t($,e);if(t$1.length===0)continue;let l=t$1[0];l.parentSymbol&&t($,l.parentSymbol).length===0&&s.push({type:"improvement",category:"broken-reference",message:`Symbol "${e}" references parent "${l.parentSymbol}" which does not exist`,suggestion:"Create the parent symbol or update the parent reference."});}if(n$1.deep)for(let e of u){let t=r.isAbsolute(e)?e:r.join(i,e);if(!a.existsSync(t))continue;let l=r.extname(e);if(![".ts",".tsx",".js",".jsx",".py",".rs"].includes(l))continue;let g;try{g=a.readFileSync(t,"utf-8");}catch{continue}let d=g.split(`
8
- `);for(let f=0;f<d.length;f++){let c=d[f],p=f+1;/\beval\s*\(/.test(c)&&!c.trimStart().startsWith("//")&&s.push({type:"blocking",category:"security",message:"eval() detected \u2014 potential code injection risk",file:e,line:p,suggestion:"Replace eval() with a safer alternative."}),/(?:password|secret|api_key|apikey|token)\s*[:=]\s*['"][^'"]{8,}['"]/i.test(c)&&!c.trimStart().startsWith("//")&&!c.trimStart().startsWith("#")&&s.push({type:"blocking",category:"security",message:"Possible hardcoded secret detected",file:e,line:p,suggestion:"Move secrets to environment variables or a secrets manager."}),/\bconsole\.(log|debug|info|warn)\b/.test(c)&&!e.includes("test")&&!e.includes("spec")&&(c.trimStart().startsWith("//")||s.push({type:"note",category:"convention",message:"console.log detected \u2014 use Paradigm logger instead",file:e,line:p,suggestion:"Use log.component(), log.gate(), etc. from the Paradigm logger."}));}}let y=s.filter(e=>e.type==="blocking"),w=s.filter(e=>e.type==="improvement"),S=s.filter(e=>e.type==="note");if(n$1.json)console.log(JSON.stringify({findings:s,summary:{total:s.length,blocking:y.length,improvements:w.length,notes:S.length,filesReviewed:u.length,symbolsChecked:m$1.length}},null,2));else if(console.log(o.blue(`
9
- \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510`)),console.log(o.blue("\u2502")+o.white.bold(" paradigm review ")+o.blue("\u2502")),console.log(o.blue("\u2502")+o.gray(` ${u.length} files, ${m$1.length} symbols${n$1.deep?", deep mode":""}`.padEnd(50))+o.blue("\u2502")),console.log(o.blue(`\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
10
- `)),s.length===0)console.log(o.green(` All checks passed \u2014 no findings.
11
- `));else {if(y.length>0){console.log(o.red.bold(` Blocking (${y.length})`));for(let e of y)console.log(` ${o.red("x")} ${e.message}`),e.file&&console.log(` ${o.gray(e.file)}${e.line?`:${e.line}`:""}`),e.suggestion&&console.log(` ${o.yellow("->")} ${e.suggestion}`);console.log("");}if(w.length>0){console.log(o.yellow(` Improvements (${w.length})`));for(let e of w)console.log(` ${o.yellow("*")} ${e.message}`),e.file&&console.log(` ${o.gray(e.file)}${e.line?`:${e.line}`:""}`),e.suggestion&&console.log(` ${o.yellow("->")} ${e.suggestion}`);console.log("");}if(S.length>0){console.log(o.gray(` Notes (${S.length})`));for(let e of S)console.log(` ${o.gray("o")} ${e.message}`),e.file&&console.log(` ${o.gray(e.file)}${e.line?`:${e.line}`:""}`);console.log("");}}n$1.ci&&y.length>0&&(b.error(`${y.length} blocking findings`),process.exit(1)),b.success(`Review complete: ${s.length} findings`);}function I(n,i){return n.includes("*")?new RegExp("^"+n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$").test(i):n===i}export{G as reviewCommand};
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env node
2
- import {c,a}from'./chunk-P344HV6Z.js';import {a as a$1}from'./chunk-WR6D3SC6.js';import'./chunk-5TAVYPOV.js';import e from'chalk';import*as r from'path';import {fileURLToPath}from'url';var p=false,v=fileURLToPath(import.meta.url),d=r.dirname(v);async function U(h,n){let i=parseInt(n.port||"3839",10),m=n.open!==false,u=process.cwd(),o=!!(n.pack||n.project||n.discipline)?c(u,n):null;if(o&&!p){let t=o.subPackRoot??o.packRoot;a(t).length===0&&(a$1("Using implicit default section. v6.5 supports custom sections \u2014 see docs."),p=true);}console.log(e.cyan(`
3
- Opening the campus gates...
4
- `));try{let{startServer:t}=await import('./server-QOCW5RU6.js'),s=r.resolve(d,"university-content");o&&(s=r.join(o.subPackRoot??o.packRoot,"content"));let g=r.resolve(d,"university-ui");console.log(e.gray(`Port: ${i}`)),o&&console.log(e.gray(`Pack: ${o.subPackId??o.packId}`)),console.log(),await t({port:i,open:m,contentDir:s,uiDistPath:g,projectDir:process.cwd()}),console.log(e.green(`
5
- Paradigm University is running at http://localhost:${i}`)),console.log(e.gray(`
6
- Press Ctrl+C to stop
7
- `)),await new Promise(()=>{});}catch(t){t.code==="ERR_MODULE_NOT_FOUND"||t.code==="MODULE_NOT_FOUND"?(console.error(e.red(`
8
- @a-company/university is not installed.`)),console.log(e.gray(`Install it with: npm install @a-company/university
9
- `))):t.code==="EADDRINUSE"?(console.error(e.red(`
10
- Error: Port ${i} is already in use.`)),console.log(e.gray(`Try a different port with: paradigm university serve --port ${i+1}
11
- `))):console.error(e.red(`
12
- Failed to start Paradigm University:`),t),process.exit(1);}}export{U as universityServeCommand};
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import'./chunk-5TAVYPOV.js';import w,{Router}from'express';import*as u from'path';import*as p from'fs';import {fileURLToPath}from'url';import j from'chalk';import*as D from'js-yaml';var R=new Set(["track","index","chronological","featured"]);function S(e,t,s){let i=j.magenta(`#${e}`),r=s?j.gray(` ${Object.entries(s).map(([a,o])=>`${a}=${o}`).join(" ")}`):"";console.log(`${j.yellow("\u26A0")} ${i} ${t}${r}`);}var k=[{id:"main",name:"Main",order:0,style:"track",default:true}];function F(e){if(!Array.isArray(e)||e.length===0)return [...k];let t=[];return e.forEach((s,i)=>{if(!s||typeof s!="object"){S("university-server","Dropping invalid section entry (not an object)",{index:i});return}let r=s,a=typeof r.id=="string"?r.id:null,o=typeof r.name=="string"?r.name:null,n=typeof r.style=="string"?r.style:null;if(!a||!o||!n){S("university-server","Dropping section: missing id/name/style",{index:i,id:String(a)});return}if(!R.has(n)){S("university-server","Dropping section: unknown style",{id:a,style:n});return}let l=n,c;typeof r.order=="number"&&Number.isFinite(r.order)?c=r.order:c=i;let d={id:a,name:o,order:c,style:l};typeof r.description=="string"&&(d.description=r.description),r.default===true&&(d.default=true),l!=="track"&&S("university-server","Section style not yet implemented \u2014 UI will fall back to track",{id:a,style:l}),t.push(d);}),t.length===0?[...k]:(t.sort((s,i)=>s.order-i.order),t)}function W(e){if(!p.existsSync(e))return [...k];try{let t=p.readFileSync(e,"utf-8"),s=D.load(t)??{};return F(s.sections)}catch{return S("university-server","Could not parse pack.yaml for sections \u2014 using implicit default",{path:e}),[...k]}}function V(e,t,s){return W(e==="project"&&s?u.join(s,".paradigm","university","pack.yaml"):u.join(t,"pack.yaml"))}function G(e,t){if(typeof e=="string"&&e.trim().length>0)return e.trim();let s=t.find(i=>i.default===true);return s?s.id:t.length===1?t[0].id:"main"}function H(e){let t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/);if(!t)return null;try{return {fm:Z(t[1]),body:t[2].trim()}}catch{return null}}function Z(e){let t={},s=e.split(/\r?\n/);for(let i of s){if(!i.trim()||i.trim().startsWith("#"))continue;let r=i.match(/^([A-Za-z_][A-Za-z0-9_-]*)\s*:\s*(.*)$/);if(!r)continue;let a=r[1],o=r[2],n=r[2].trim();if(n.startsWith("[")&&n.endsWith("]")){let l=n.slice(1,-1).trim();o=l.length===0?[]:l.split(",").map(c=>c.trim().replace(/^['"]|['"]$/g,""));}else n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'")?o=n.slice(1,-1):/^\d+$/.test(n)?o=parseInt(n,10):n==="true"||n==="false"?o=n==="true":o=n;t[a]=o;}return t}function O(e){try{let t=p.readFileSync(e,"utf-8");return D.load(t)}catch{return null}}function _(e){let t=u.join(e,"paths");if(!p.existsSync(t))return [];let s=p.readdirSync(t).filter(r=>r.startsWith("LP-")&&r.endsWith(".yaml")),i=[];for(let r of s){let a=O(u.join(t,r));a?.id&&i.push(a);}return i}function K(e,t,s){let i=s==="project"?[]:[e];if(!t)return i;let r=u.join(t,".paradigm","university");if(!p.existsSync(r))return i;p.existsSync(u.join(r,"paths"))&&i.push(r);try{for(let a of p.readdirSync(r,{withFileTypes:!0})){if(!a.isDirectory())continue;let o=u.join(r,a.name);p.existsSync(u.join(o,"paths"))&&i.push(o);}}catch{}return i}function N(e,t,s){let i=u.join(e,"notes"),r=u.join(e,"quizzes"),a=[],o=new Set,n=s.steps||[];for(let l of n){let c=l.content;if(!c.startsWith("N-")||o.has(c))continue;o.add(c);let d=c.slice(`N-${t}-`.length),m=u.join(i,`${c}.md`);if(!p.existsSync(m))continue;let f=p.readFileSync(m,"utf-8"),g=H(f);if(!g)continue;let y=g.fm,h={id:d,title:y.title||d,content:g.body,keyConcepts:Array.isArray(y.tags)?y.tags:[],quiz:[]},v=u.join(r,`Q-${t}-${d}.yaml`);if(p.existsSync(v)){let b=O(v);b?.questions&&(h.quiz=b.questions);}a.push(h);}return a}function A(e,t){let s=u.join(e,"paths",`LP-${t}.yaml`);if(!p.existsSync(s))return null;let i=O(s);if(!i?.id)return null;let r=N(e,t,i);return {id:t,title:i.title,description:i.description||"",lessons:r}}function Y(e,t,s){let i=Router(),r=K(e,t,s),a=V(s??"paradigm",e,t);return i.get("/",(o,n)=>{let l=new Set,c=[];for(let d of r){let m=_(d);for(let f of m){let g=f.id.startsWith("LP-")?f.id.slice(3):f.id;if(l.has(g))continue;l.add(g);let y=N(d,g,f);c.push({id:g,title:f.title,description:f.description||"",lessonCount:y.length,lessons:y.map(h=>({id:h.id,title:h.title})),section:G(f.section,a)});}}return c.sort((d,m)=>d.id.localeCompare(m.id)),n.json({courses:c})}),i.get("/:id",(o,n)=>{for(let l of r){let c=A(l,o.params.id);if(c)return n.json(c)}return n.status(404).json({error:`Course '${o.params.id}' not found`})}),i.get("/:id/lessons/:lessonId",(o,n)=>{for(let l of r){let c=A(l,o.params.id);if(!c)continue;let d=c.lessons.find(m=>m.id===o.params.lessonId);if(d)return n.json(d)}return n.status(404).json({error:`Lesson '${o.params.lessonId}' not found`})}),i}function q(e){try{let t=p.readFileSync(e,"utf-8");return D.load(t)}catch{return null}}function B(e){for(let t=e.length-1;t>0;t--){let s=Math.floor(Math.random()*(t+1));[e[t],e[s]]=[e[s],e[t]];}return e}function X(e){if(!e.variants||e.variants.length===0)return e;let t=[{id:e.id,scenario:e.scenario??"",question:e.question,choices:e.choices,correct:e.correct,explanation:e.explanation??""},...e.variants];return t[Math.floor(Math.random()*t.length)]}function ee(e){return e.questions.length}function te(e){let t={},s=[],i=new Map;for(let r of e.questions){let a=X(r),o={id:a.id,course:r.section??"",scenario:a.scenario??r.scenario??"",question:a.question,choices:a.choices,correct:a.correct,explanation:a.explanation??r.explanation??"",...r.passageId?{passageId:r.passageId}:{}};r.passageId?(r.passage&&(t[r.passageId]=r.passage),i.has(r.passageId)||i.set(r.passageId,[]),i.get(r.passageId).push(o)):s.push([o]);}for(let r of i.values())s.push(r);return B(s),{questions:s.flat(),passages:t}}function re(e,t){let s=Router(),i=u.join(e,"quizzes");return s.get("/",(r,a)=>{if(!p.existsSync(i))return a.json({versions:[]});let o=p.readdirSync(i).filter(n=>n.startsWith("Q-plsat-v")&&n.endsWith(".yaml")).map(n=>{let l=q(u.join(i,n));if(!l)return null;let c=n.match(/^Q-plsat-v(\d+)\.yaml$/);return {version:c?`${c[1]}.0`:"0.0",frameworkVersion:"2.0",questionCount:ee(l),timeLimit:l.timeLimit,passThreshold:l.passThreshold}}).filter(n=>n!==null);return o.sort((n,l)=>l.version.localeCompare(n.version)),a.json({versions:o})}),s.get("/:version",(r,a)=>{try{let o=r.params.version.split(".")[0],n=u.join(i,`Q-plsat-v${o}.yaml`);if(!p.existsSync(n))return a.status(404).json({error:`PLSAT version '${r.params.version}' not found`});let l=q(n);if(!l)return a.status(500).json({error:"Failed to parse PLSAT exam"});let{questions:c,passages:d}=te(l);return a.json({version:r.params.version,frameworkVersion:"2.0",timeLimit:l.timeLimit,passThreshold:l.passThreshold,title:l.title,description:l.description??"",questions:c,...Object.keys(d).length>0?{passages:d}:{}})}catch(o){let n=o instanceof Error?o.message:"Internal error";return a.status(500).json({error:`Failed to load PLSAT exam: ${n}`})}}),s.post("/diploma",(r,a)=>{if(!t)return a.status(400).json({error:"No project directory configured"});let o=u.join(t,".paradigm","university","diplomas");if(!p.existsSync(o))return a.json({saved:false,reason:"university directory not found"});try{let{student:n,version:l,score:c,total:d,percentage:m,passed:f}=r.body;if(!n||!l||c==null||d==null)return a.status(400).json({error:"Missing required fields: student, version, score, total"});let g=new Date().toISOString().slice(0,10),y=String(n).toLowerCase().replace(/[^a-z0-9-]/g,"-").slice(0,20),h=`D-${g}-${y}-plsat-v${l}`,v={id:h,type:"plsat",student:y,earnedAt:new Date().toISOString(),source:`plsat:v${l}`,score:c,total:d,percentage:m??(d>0?Math.round(c/d*1e4)/100:0),passed:f??!1,details:{plsatVersion:l}},b=u.join(o,`${h}.yaml`),M=Object.entries(v).map(([I,x])=>{if(typeof x=="object"&&x!==null){let z=Object.entries(x).map(([J,U])=>` ${J}: ${JSON.stringify(U)}`).join(`
3
- `);return `${I}:
4
- ${z}`}return `${I}: ${JSON.stringify(x)}`});return p.writeFileSync(b,M.join(`
5
- `)+`
6
- `,"utf8"),a.json({saved:!0,diplomaId:h})}catch(n){let l=n instanceof Error?n.message:"Internal error";return a.status(500).json({error:`Failed to save diploma: ${l}`})}}),s}var ne=fileURLToPath(import.meta.url),P=u.dirname(ne);function ie(e){let t=e;for(;t!==u.dirname(t);){if(p.existsSync(u.join(t,"package.json"))&&JSON.parse(p.readFileSync(u.join(t,"package.json"),"utf-8")).name==="@a-company/university")return t;t=u.dirname(t);}return e}var $={component(e){let t=j.magenta(`#${e}`);return {info:(s,i)=>{let r=i?j.gray(` ${Object.entries(i).map(([a,o])=>`${a}=${o}`).join(" ")}`):"";console.log(`${j.blue("\u2139")} ${t} ${s}${r}`);},success:(s,i)=>{let r=i?j.gray(` ${Object.entries(i).map(([a,o])=>`${a}=${o}`).join(" ")}`):"";console.log(`${j.green("\u2714")} ${t} ${s}${r}`);},warn:(s,i)=>{let r=i?j.gray(` ${Object.entries(i).map(([a,o])=>`${a}=${o}`).join(" ")}`):"";console.log(`${j.yellow("\u26A0")} ${t} ${s}${r}`);},error:(s,i)=>{let r=i?j.gray(` ${Object.entries(i).map(([a,o])=>`${a}=${o}`).join(" ")}`):"";console.error(`${j.red("\u2716")} ${t} ${s}${r}`);}}}};function se(e){if(e?.contentDir&&e?.uiDistPath)return {contentDir:e.contentDir,uiDistPath:e.uiDistPath};let t=u.join(P,"university-content"),s=u.join(P,"university-ui");if(p.existsSync(t)&&p.existsSync(s))return {contentDir:e?.contentDir||t,uiDistPath:e?.uiDistPath||s};let i=ie(P);return {contentDir:e?.contentDir||u.join(i,"src","content"),uiDistPath:e?.uiDistPath||u.join(i,"ui","dist")}}var C="6.4.0",L={name:"Paradigm University",tagline:"Lux in Codice",logo:null,institution:null,favicon:null,tabs:["campus","courses","plsat","library","certificates"],startCourse:null};function E(e){let t=w();t.use(w.json()),t.use((o,n,l)=>{n.header("Access-Control-Allow-Origin","*"),n.header("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),n.header("Access-Control-Allow-Headers","Content-Type"),l();});let{contentDir:s,uiDistPath:i}=se(e),r="paradigm",a;if(e?.projectDir){let o=u.join(e.projectDir,".paradigm","university","pack.yaml");p.existsSync(o)&&(r="project");}if(r==="project"&&e?.projectDir){let o=u.join(e.projectDir,".paradigm","university","pack.yaml"),n={};try{let v=p.readFileSync(o,"utf-8");n=D.load(v)??{};}catch{$.component("university-server").warn("Could not parse pack.yaml \u2014 using defaults",{path:o});}let l=n.branding??{},c=n.theme??null,d=typeof n.version=="string"?n.version:C,m=u.join(e.projectDir,".paradigm","university","reference.json"),f=p.existsSync(m),g=l.tabs,y={...L,...l};if(!g){let v=["campus","courses","certificates"];f&&v.splice(2,0,"library"),y.tabs=v;}let h=F(n.sections);a={mode:"project",branding:y,theme:c,version:d,hasProjectLibrary:f,sections:h},$.component("university-server").info("Project mode active",{pack:String(n.id??"unknown"),sections:h.length});}else {let o=W(u.join(s,"pack.yaml"));a={mode:"paradigm",branding:{...L},theme:null,version:C,hasProjectLibrary:false,sections:o};}return t.get("/api/pack-config",(o,n)=>{n.json(a);}),t.use("/api/courses",Y(s,e?.projectDir,r)),t.use("/api/plsat",re(s,e?.projectDir)),t.get("/api/reference",(o,n)=>{if(r==="project"&&e?.projectDir){let c=u.join(e.projectDir,".paradigm","university","reference.json");if(p.existsSync(c))try{let d=JSON.parse(p.readFileSync(c,"utf-8"));return n.json(d)}catch{return n.status(500).json({error:"Failed to parse project reference.json"})}return n.status(404).json({error:"No reference library configured for this project."})}let l=u.join(s,"reference.json");if(p.existsSync(l)){let c=JSON.parse(p.readFileSync(l,"utf-8"));return n.json(c)}return n.status(404).json({error:"Reference data not found"})}),t.get("/api/health",(o,n)=>{n.json({status:"ok",timestamp:new Date().toISOString()});}),p.existsSync(i)&&(t.use(w.static(i)),t.get("{*path}",(o,n)=>{o.path.startsWith("/api")||n.sendFile(u.join(i,"index.html"));})),t}async function oe(e){let t=E({contentDir:e.contentDir,uiDistPath:e.uiDistPath,projectDir:e.projectDir});return $.component("university-server").info("Starting server",{port:e.port}),new Promise((s,i)=>{t.listen(e.port,()=>{$.component("university-server").success("Server running",{url:`http://localhost:${e.port}`}),e.open&&import('open').then(r=>{r.default(`http://localhost:${e.port}`),$.component("university-server").info("Opened browser");}).catch(()=>{$.component("university-server").warn("Could not open browser automatically");}),s();}).on("error",r=>{r.code==="EADDRINUSE"?$.component("university-server").error("Port already in use",{port:e.port}):$.component("university-server").error("Server error",{error:r.message}),i(r);});})}
7
- export{E as createApp,oe as startServer};
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import {b,c as c$1,d}from'./chunk-ERO4MJSH.js';import {c}from'./chunk-P344HV6Z.js';import'./chunk-5TAVYPOV.js';import o from'chalk';function h(l){let s=l.indexOf(":");return s===-1?{entryId:l}:{packId:l.slice(0,s),entryId:l.slice(s+1)}}async function S(l,s){let c$2=process.cwd(),{packId:f,entryId:g}=h(l),d$1={...s};f&&(d$1.pack=f),c(c$2,d$1);let e=b(c$2,g);if(e){if(s.json){console.log(JSON.stringify({...e.frontmatter,body:e.body},null,2));return}console.log(o.blue(`
3
- ${e.frontmatter.title}`)),console.log(o.gray(` ${e.frontmatter.type} \xB7 ${e.frontmatter.difficulty} \xB7 ${e.frontmatter.author}`)),e.frontmatter.tags.length>0&&console.log(o.gray(` Tags: ${e.frontmatter.tags.join(", ")}`)),e.frontmatter.symbols.length>0&&console.log(o.gray(` Symbols: ${e.frontmatter.symbols.join(", ")}`)),console.log(),console.log(e.body),console.log();return}let t=c$1(c$2,g);if(t){if(s.json){console.log(JSON.stringify(t,null,2));return}console.log(o.blue(`
4
- ${t.title}`)),console.log(o.gray(` quiz \xB7 ${t.difficulty} \xB7 ${t.questions.length} questions \xB7 pass: ${t.passThreshold*100}%`)),t.description&&console.log(o.gray(` ${t.description}`)),console.log();for(let n of t.questions){console.log(` ${o.cyan(n.id)}: ${n.question}`);for(let[i,a]of Object.entries(n.choices)){let m=i===n.correct?o.green("*"):" ";console.log(` ${m} ${i}: ${a}`);}n.explanation&&console.log(o.gray(` \u2192 ${n.explanation}`)),console.log();}return}let r=d(c$2,g);if(r){if(s.json){console.log(JSON.stringify(r,null,2));return}console.log(o.blue(`
5
- ${r.title}`)),console.log(o.gray(` learning path \xB7 ${r.steps.length} steps \xB7 ${r.ordered?"ordered":"unordered"}`)),r.description&&console.log(o.gray(` ${r.description}`)),console.log();for(let n=0;n<r.steps.length;n++){let i=r.steps[n],a=i.required?o.red("required"):o.gray("optional");console.log(` ${n+1}. ${o.cyan(i.content)} (${a})`),i.note&&console.log(o.gray(` ${i.note}`));}console.log();return}console.error(o.red(`
6
- Content "${l}" not found
7
- `)),process.exit(1);}export{S as universityShowCommand};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import {a,e}from'./chunk-ERO4MJSH.js';import {c}from'./chunk-P344HV6Z.js';import'./chunk-5TAVYPOV.js';import t from'chalk';async function h(d){let g=process.cwd(),r=c(g,d),s=a(g);if(!s||s.totalContent===0){console.log(t.yellow(`
3
- No university content found.`)),console.log(t.gray(` Create content with: paradigm university add note --title "My Note"
4
- `));return}let n=e(g),a$1={},c$1={},l={};for(let o of s.entries){a$1[o.type]=(a$1[o.type]||0)+1,o.difficulty&&(l[o.difficulty]=(l[o.difficulty]||0)+1);for(let e of o.tags)c$1[e]=(c$1[e]||0)+1;}if(d.json){console.log(JSON.stringify({pack:r.subPackId??r.packId,totalContent:s.totalContent,typeCounts:a$1,difficultyCounts:l,tagCounts:c$1,diplomaCount:n.length},null,2));return}console.log(t.blue(`
5
- University Status \u2014 pack: ${r.subPackId??r.packId}
6
- `)),console.log(t.white(` Total content: ${s.totalContent}`));for(let[o,e]of Object.entries(a$1).sort())console.log(` ${t.cyan(o)}: ${e}`);if(Object.keys(l).length>0){console.log(),console.log(t.white(" By difficulty:"));for(let[o,e]of Object.entries(l)){let i=o==="advanced"?t.red:o==="intermediate"?t.yellow:t.green;console.log(` ${i(o)}: ${e}`);}}if(Object.keys(c$1).length>0){console.log(),console.log(t.white(" Top tags:"));let o=Object.entries(c$1).sort((e,i)=>i[1]-e[1]).slice(0,8);for(let[e,i]of o)console.log(` ${t.gray(e)}: ${i}`);}if(console.log(),console.log(t.white(` Diplomas earned: ${n.length}`)),n.length>0){for(let o of n.slice(0,5)){let e=o.passed?t.green("PASS"):t.red("FAIL");console.log(` ${e} ${o.source} \u2014 ${o.student} (${o.percentage}%) ${t.gray(o.earnedAt.slice(0,10))}`);}n.length>5&&console.log(t.gray(` ... and ${n.length-5} more`));}console.log();}export{h as universityStatusCommand};
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- import {a,c as c$1,d as d$1}from'./chunk-ERO4MJSH.js';import {c}from'./chunk-P344HV6Z.js';import'./chunk-5TAVYPOV.js';import d from'chalk';import*as h from'fs';import*as p from'path';import*as I from'js-yaml';var v=/^[a-z0-9][a-z0-9-]{0,63}$/,x=new Set(["track","index","chronological","featured"]);function C(s){let a=p.join(s,"pack.yaml");if(!h.existsSync(a))return null;try{let i=h.readFileSync(a,"utf8"),n=I.load(i);return Array.isArray(n?.sections)?n.sections:null}catch{return null}}function j(s,a,i){let n=new Set,t=false;if(!s||s.length===0)return n.add("main"),{knownIds:n,hadValidationError:t};let f=new Set,u=0;for(let l=0;l<s.length;l++){let c=s[l],y=`sections[${l}]`;if(typeof c.id!="string"||!v.test(c.id)){i.push({contentId:"pack.yaml",severity:"error",check:"section-bad-id",message:`${y}.id must be kebab-case matching /^[a-z0-9][a-z0-9-]{0,63}$/`,fix:"Use lowercase letters, digits, and hyphens; start with a letter or digit"}),t=true;continue}if(f.has(c.id)){i.push({contentId:"pack.yaml",severity:"error",check:"section-duplicate-id",message:`duplicate section id "${c.id}"`,fix:"Each section id must be unique within the pack"}),t=true;continue}f.add(c.id),n.add(c.id),(typeof c.style!="string"||!x.has(c.style))&&(i.push({contentId:"pack.yaml",severity:"error",check:"section-bad-style",message:`${y}.style must be one of: ${Array.from(x).join(", ")}`}),t=true),c.default===true&&u++;}u>1&&(i.push({contentId:"pack.yaml",severity:"error",check:"section-multiple-defaults",message:`at most one section may set default: true (found ${u})`,fix:"Set default: true on exactly one section"}),t=true);for(let l of a)n.has(l)||i.push({contentId:"pack.yaml",severity:"warning",check:"section-unknown-ref",message:`entries reference unknown section "${l}"`,fix:`Declare section "${l}" in pack.yaml, or remove the section: field from those entries`});return {knownIds:n,hadValidationError:t}}async function R(s){let a$1=process.cwd(),i=c(a$1,s),n=a(a$1);if(!n||n.totalContent===0){console.log(d.yellow(`
3
- No university content to validate.
4
- `));return}let t=[],f=n.entries;s.id&&(f=f.filter(e=>e.id===s.id),f.length===0&&(console.error(d.red(`
5
- Content "${s.id}" not found
6
- `)),process.exit(1)));let u=null;if(s.deep){u=new Set;let e=p.join(a$1,".paradigm","scan-index.json");if(h.existsSync(e))try{let r=JSON.parse(h.readFileSync(e,"utf8"));if(r.symbols&&Array.isArray(r.symbols))for(let o of r.symbols)o.symbol&&u.add(o.symbol);}catch{}}let l=new Set(n.entries.map(e=>e.id)),c$2=i.subPackRoot??i.packRoot,y=C(c$2),k=new Set;for(let e of n.entries)e.section&&typeof e.section=="string"&&e.section.length>0&&k.add(e.section);j(y,k,t);for(let e of f){if(e.title||t.push({contentId:e.id,severity:"error",check:"missing-title",message:"Content is missing a title"}),e.type==="quiz"){let r=c$1(a$1,e.id);if(!r)t.push({contentId:e.id,severity:"error",check:"unreadable-quiz",message:"Quiz file could not be parsed"});else for(let o of r.questions)(!o.choices||!(o.correct in o.choices))&&t.push({contentId:e.id,severity:"error",check:"invalid-quiz-answer",message:`Question ${o.id}: correct "${o.correct}" not in choices [${Object.keys(o.choices||{}).join(", ")}]`,fix:`Set correct to one of: ${Object.keys(o.choices||{}).join(", ")}`});}if(e.type==="path"){let r=d$1(a$1,e.id);if(!r)t.push({contentId:e.id,severity:"error",check:"unreadable-path",message:"Learning path file could not be parsed"});else for(let o of r.steps)!o.content.startsWith("plsat:")&&!l.has(o.content)&&t.push({contentId:e.id,severity:"error",check:"broken-path-step",message:`Step references "${o.content}" which doesn't exist`,fix:`Create content with id "${o.content}"`});}if(u&&e.symbols.length>0)for(let r of e.symbols)u.has(r)||t.push({contentId:e.id,severity:"warning",check:"broken-symbol-ref",message:`Symbol "${r}" not found in scan-index`});}if(s.json){console.log(JSON.stringify({status:t.some(e=>e.severity==="error")?"errors":t.length>0?"warnings":"healthy",totalContent:n.totalContent,checked:f.length,issues:t},null,2));return}if(console.log(d.blue(`
7
- University Validation \u2014 pack: ${i.subPackId??i.packId} (${f.length} items${s.deep?", deep mode":""})
8
- `)),t.length===0){console.log(d.green(` All checks passed.
9
- `));return}let g=t.filter(e=>e.severity==="error"),m=t.filter(e=>e.severity==="warning");for(let e of g)console.log(d.red(` x ${e.contentId}: ${e.message}`)),e.fix&&console.log(d.gray(` Fix: ${e.fix}`));for(let e of m)console.log(d.yellow(` ! ${e.contentId}: ${e.message}`)),e.fix&&console.log(d.gray(` Fix: ${e.fix}`));console.log(),g.length>0&&console.log(d.red(` ${g.length} error${g.length>1?"s":""}`)),m.length>0&&console.log(d.yellow(` ${m.length} warning${m.length>1?"s":""}`)),console.log();}export{R as universityValidateCommand};