@a-company/paradigm 6.2.1 → 6.3.1

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 (30) hide show
  1. package/dist/chunk-32XL3FIQ.js +2 -0
  2. package/dist/{chunk-MA75GS7J.js → chunk-SRWROALW.js} +68 -37
  3. package/dist/{enforcement-46XWPNSA.js → enforcement-FXO6IYYE.js} +1 -1
  4. package/dist/{enforcement-BEGPQIUN.js → enforcement-VRE3WZOI.js} +1 -1
  5. package/dist/index.js +2 -2
  6. package/dist/mcp.js +1 -1
  7. package/dist/rune-promotion-3JQ5LMWK.js +3 -0
  8. package/dist/{serve-OQYUO7CR.js → serve-NAAK7PAD.js} +1 -1
  9. package/dist/server-SHD4ELRO.js +7 -0
  10. package/dist/{shift-3ATE2ONQ.js → shift-6Y3KQP62.js} +2 -2
  11. package/dist/{tools-BPEKRC2U.js → tools-2XPMZZBT.js} +1 -1
  12. package/dist/university-content/notes/N-para-001-shift-setup.md +2 -2
  13. package/dist/university-content/notes/N-para-301-enforcement-levels.md +18 -11
  14. package/dist/university-content/notes/N-para-301-paradigm-shift.md +2 -2
  15. package/dist/university-content/notes/N-para-301-rune-promotion.md +69 -0
  16. package/dist/university-content/notes/N-para-501-hook-enforcement.md +3 -1
  17. package/dist/university-content/notes/N-para-701-orchestration-enforcement.md +10 -1
  18. package/dist/university-content/quizzes/Q-para-301-enforcement-levels.yaml +21 -1
  19. package/dist/university-content/quizzes/Q-para-401-notebooks-permissions.yaml +32 -32
  20. package/dist/university-content/quizzes/Q-para-501-review-compliance.yaml +31 -31
  21. package/dist/university-content/quizzes/Q-para-701-arch-mcp-tools.yaml +3 -3
  22. package/dist/university-content/quizzes/Q-para-701-arch-yaml-format.yaml +1 -1
  23. package/dist/university-content/quizzes/Q-para-701-orchestration-enforcement.yaml +11 -1
  24. package/dist/university-content/quizzes/Q-plsat-v3.yaml +2 -2
  25. package/dist/university-ui/assets/{index-SNyIB61M.js → index-BlS8W3tC.js} +14 -14
  26. package/dist/university-ui/assets/{index-SNyIB61M.js.map → index-BlS8W3tC.js.map} +1 -1
  27. package/dist/university-ui/index.html +1 -1
  28. package/package.json +1 -1
  29. package/dist/chunk-KYA4TP26.js +0 -2
  30. package/dist/server-FGUL2FWQ.js +0 -7
@@ -8,7 +8,7 @@
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
10
  <link href="https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap" rel="stylesheet">
11
- <script type="module" crossorigin src="/assets/index-SNyIB61M.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-BlS8W3tC.js"></script>
12
12
  <link rel="stylesheet" crossorigin href="/assets/index-CMrxD7y5.css">
13
13
  </head>
14
14
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a-company/paradigm",
3
- "version": "6.2.1",
3
+ "version": "6.3.1",
4
4
  "description": "Unified CLI for Paradigm developer tools",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import*as i from'fs';import*as u from'path';import*as f from'js-yaml';var s=["purpose-coverage","purpose-exists","portal-gates","aspect-anchors","purpose-freshness","aspect-advisory","lore-required","habits-blocking","purpose-required-patterns","drift-detection","portal-compliance","graduation-tracking","orchestration-required"];var A={"purpose-coverage":"block","purpose-exists":"block","portal-gates":"block","aspect-anchors":"block","purpose-freshness":"warn","aspect-advisory":"warn","lore-required":"block","habits-blocking":"block","purpose-required-patterns":"block","drift-detection":"block","portal-compliance":"block","graduation-tracking":"warn","orchestration-required":"block"},O={"purpose-coverage":"block","purpose-exists":"warn","portal-gates":"warn","aspect-anchors":"warn","purpose-freshness":"warn","aspect-advisory":"off","lore-required":"warn","habits-blocking":"block","purpose-required-patterns":"warn","drift-detection":"warn","portal-compliance":"warn","graduation-tracking":"off","orchestration-required":"warn"},P={"purpose-coverage":"warn","purpose-exists":"off","portal-gates":"off","aspect-anchors":"off","purpose-freshness":"off","aspect-advisory":"off","lore-required":"off","habits-blocking":"warn","purpose-required-patterns":"off","drift-detection":"off","portal-compliance":"off","graduation-tracking":"off","orchestration-required":"off"},x={strict:A,balanced:O,minimal:P};function p(e){return {...x[e]}}function V(e,t){return x[e][t]}function b(e){return s.includes(e)}function E(e){return e==="block"||e==="warn"||e==="off"}function S(e){return e==="strict"||e==="balanced"||e==="minimal"}var L="minimal",j={threshold:3,detection:"git-diff",exempt:["*.md","*.yaml","*.yml",".purpose"]};function T(e){let t=u.join(e,".paradigm","config.yaml");if(!i.existsSync(t))return h();try{let n=i.readFileSync(t,"utf8"),r=f.load(n);if(!r||typeof r!="object")return h();let o=r.enforcement;if(!o||typeof o!="object")return h();let y=o.level,q=typeof y=="string"&&S(y)?y:L,v=o.checks,w={};if(v&&typeof v=="object")for(let[d,C]of Object.entries(v))b(d)&&typeof C=="string"&&E(C)&&(w[d]=C);let c=o.orchestration,l={...j};return c&&typeof c=="object"&&(typeof c.threshold=="number"&&(l.threshold=c.threshold),typeof c.detection=="string"&&(l.detection=c.detection),Array.isArray(c.exempt)&&(l.exempt=c.exempt.filter(d=>typeof d=="string"))),{level:q,checks:w,orchestration:l}}catch{return h()}}function h(){return {level:L,checks:{},orchestration:{...j}}}function _(e,t){let n=e.checks[t];return n!==void 0?n:p(e.level)[t]}function D(e){let t=p(e.level);for(let n of s){let r=e.checks[n];r!==void 0&&(t[n]=r);}return t}function k(e){let t=u.join(e,".paradigm","config.yaml");if(!i.existsSync(t))throw new Error(`Config not found: ${t}`);let n=i.readFileSync(t,"utf8"),r=f.load(n);if(!r||typeof r!="object")throw new Error("Config is not a valid YAML object");return [r,n]}function a(e,t){let n=u.join(e,".paradigm","config.yaml"),r=f.dump(t,{lineWidth:-1,noRefs:true,sortKeys:false,quotingType:"'"});i.writeFileSync(n,r,"utf8");}function g(e){return (!e.enforcement||typeof e.enforcement!="object")&&(e.enforcement={level:"minimal",checks:{}}),e.enforcement}function F(e,t){let[n]=k(e),r=g(n);r.level=t,a(e,n);}function H(e,t,n){let[r]=k(e),o=g(r);(!o.checks||typeof o.checks!="object")&&(o.checks={}),o.checks[t]=n,a(e,r);}function K(e,t){let[n]=k(e),r=g(n);r.checks&&typeof r.checks=="object"&&delete r.checks[t],a(e,n);}function M(e){let[t]=k(e),n=g(t);n.checks={},a(e,t);}function N(e){let t=u.join(e,".paradigm","config.yaml");if(!i.existsSync(t))return false;try{let n=i.readFileSync(t,"utf8"),r=f.load(n);return !r||typeof r!="object"||r.enforcement?!1:(r.enforcement={level:"balanced",checks:{},orchestration:{threshold:3,detection:"git-diff",exempt:["*.md","*.yaml","*.yml",".purpose"]}},a(e,r),!0)}catch{return false}}export{s as a,p as b,V as c,b as d,E as e,S as f,T as g,_ as h,D as i,F as j,H as k,K as l,M as m,N as n};
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import'./chunk-5TAVYPOV.js';import P,{Router}from'express';import*as u from'path';import*as c from'fs';import {fileURLToPath}from'url';import f from'chalk';import*as I from'js-yaml';function k(e){let t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/);if(!t)return null;try{return {fm:E(t[1]),body:t[2].trim()}}catch{return null}}function E(e){let t={},i=e.split(/\r?\n/);for(let s of i){if(!s.trim()||s.trim().startsWith("#"))continue;let r=s.match(/^([A-Za-z_][A-Za-z0-9_-]*)\s*:\s*(.*)$/);if(!r)continue;let n=r[1],o=r[2],a=r[2].trim();if(a.startsWith("[")&&a.endsWith("]")){let l=a.slice(1,-1).trim();o=l.length===0?[]:l.split(",").map(p=>p.trim().replace(/^['"]|['"]$/g,""));}else a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")?o=a.slice(1,-1):/^\d+$/.test(a)?o=parseInt(a,10):a==="true"||a==="false"?o=a==="true":o=a;t[n]=o;}return t}function b(e){try{let t=c.readFileSync(e,"utf-8");return I.load(t)}catch{return null}}function z(e){let t=u.join(e,"paths");if(!c.existsSync(t))return [];let i=c.readdirSync(t).filter(r=>r.startsWith("LP-")&&r.endsWith(".yaml")),s=[];for(let r of i){let n=b(u.join(t,r));n?.id&&s.push(n);}return s}function L(e,t,i){let s=u.join(e,"notes"),r=u.join(e,"quizzes"),n=[],o=new Set,a=i.steps||[];for(let l of a){let p=l.content;if(!p.startsWith("N-")||o.has(p))continue;o.add(p);let d=p.slice(`N-${t}-`.length),j=u.join(s,`${p}.md`);if(!c.existsSync(j))continue;let D=c.readFileSync(j,"utf-8"),y=k(D);if(!y)continue;let g=y.fm,m={id:d,title:g.title||d,content:y.body},$=u.join(r,`Q-${t}-${d}.yaml`);if(c.existsSync($)){let v=b($);v?.questions&&(m.quiz=v.questions);}n.push(m);}return n}function O(e,t){let i=u.join(e,"paths",`LP-${t}.yaml`);if(!c.existsSync(i))return null;let s=b(i);if(!s?.id)return null;let r=L(e,t,s);return {id:t,title:s.title,description:s.description||"",lessons:r}}function R(e){let t=Router();return t.get("/",(i,s)=>{let r=z(e).filter(n=>n.id.startsWith("LP-para-")).map(n=>{let o=n.id.slice(3),a=L(e,o,n);return {id:o,title:n.title,description:n.description||"",lessonCount:a.length,lessons:a.map(l=>({id:l.id,title:l.title}))}});return r.sort((n,o)=>n.id.localeCompare(o.id)),s.json({courses:r})}),t.get("/:id",(i,s)=>{let r=O(e,i.params.id);return r?s.json(r):s.status(404).json({error:`Course '${i.params.id}' not found`})}),t.get("/:id/lessons/:lessonId",(i,s)=>{let r=O(e,i.params.id);if(!r)return s.status(404).json({error:`Course '${i.params.id}' not found`});let n=r.lessons.find(o=>o.id===i.params.lessonId);return n?s.json(n):s.status(404).json({error:`Lesson '${i.params.lessonId}' not found`})}),t}function q(e){try{let t=c.readFileSync(e,"utf-8");return I.load(t)}catch{return null}}function Q(e){for(let t=e.length-1;t>0;t--){let i=Math.floor(Math.random()*(t+1));[e[t],e[i]]=[e[i],e[t]];}return e}function J(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 U(e){return e.questions.length}function V(e){let t={},i=[],s=new Map;for(let r of e.questions){let n=J(r),o={id:n.id,course:r.section??"",scenario:n.scenario??r.scenario??"",question:n.question,choices:n.choices,correct:n.correct,explanation:n.explanation??r.explanation??"",...r.passageId?{passageId:r.passageId}:{}};r.passageId?(r.passage&&(t[r.passageId]=r.passage),s.has(r.passageId)||s.set(r.passageId,[]),s.get(r.passageId).push(o)):i.push([o]);}for(let r of s.values())i.push(r);return Q(i),{questions:i.flat(),passages:t}}function Z(e,t){let i=Router(),s=u.join(e,"quizzes");return i.get("/",(r,n)=>{if(!c.existsSync(s))return n.json({versions:[]});let o=c.readdirSync(s).filter(a=>a.startsWith("Q-plsat-v")&&a.endsWith(".yaml")).map(a=>{let l=q(u.join(s,a));if(!l)return null;let p=a.match(/^Q-plsat-v(\d+)\.yaml$/);return {version:p?`${p[1]}.0`:"0.0",frameworkVersion:"2.0",questionCount:U(l),timeLimit:l.timeLimit,passThreshold:l.passThreshold}}).filter(a=>a!==null);return o.sort((a,l)=>l.version.localeCompare(a.version)),n.json({versions:o})}),i.get("/:version",(r,n)=>{try{let o=r.params.version.split(".")[0],a=u.join(s,`Q-plsat-v${o}.yaml`);if(!c.existsSync(a))return n.status(404).json({error:`PLSAT version '${r.params.version}' not found`});let l=q(a);if(!l)return n.status(500).json({error:"Failed to parse PLSAT exam"});let{questions:p,passages:d}=V(l);return n.json({version:r.params.version,frameworkVersion:"2.0",timeLimit:l.timeLimit,passThreshold:l.passThreshold,title:l.title,description:l.description??"",questions:p,...Object.keys(d).length>0?{passages:d}:{}})}catch(o){let a=o instanceof Error?o.message:"Internal error";return n.status(500).json({error:`Failed to load PLSAT exam: ${a}`})}}),i.post("/diploma",(r,n)=>{if(!t)return n.status(400).json({error:"No project directory configured"});let o=u.join(t,".paradigm","university","diplomas");if(!c.existsSync(o))return n.json({saved:false,reason:"university directory not found"});try{let{student:a,version:l,score:p,total:d,percentage:j,passed:D}=r.body;if(!a||!l||p==null||d==null)return n.status(400).json({error:"Missing required fields: student, version, score, total"});let y=new Date().toISOString().slice(0,10),g=String(a).toLowerCase().replace(/[^a-z0-9-]/g,"-").slice(0,20),m=`D-${y}-${g}-plsat-v${l}`,$={id:m,type:"plsat",student:g,earnedAt:new Date().toISOString(),source:`plsat:v${l}`,score:p,total:d,percentage:j??(d>0?Math.round(p/d*1e4)/100:0),passed:D??!1,details:{plsatVersion:l}},v=u.join(o,`${m}.yaml`),W=Object.entries($).map(([w,S])=>{if(typeof S=="object"&&S!==null){let F=Object.entries(S).map(([N,C])=>` ${N}: ${JSON.stringify(C)}`).join(`
3
- `);return `${w}:
4
- ${F}`}return `${w}: ${JSON.stringify(S)}`});return c.writeFileSync(v,W.join(`
5
- `)+`
6
- `,"utf8"),n.json({saved:!0,diplomaId:m})}catch(a){let l=a instanceof Error?a.message:"Internal error";return n.status(500).json({error:`Failed to save diploma: ${l}`})}}),i}var _=fileURLToPath(import.meta.url),x=u.dirname(_);function G(e){let t=e;for(;t!==u.dirname(t);){if(c.existsSync(u.join(t,"package.json"))&&JSON.parse(c.readFileSync(u.join(t,"package.json"),"utf-8")).name==="@a-company/university")return t;t=u.dirname(t);}return e}var h={component(e){let t=f.magenta(`#${e}`);return {info:(i,s)=>{let r=s?f.gray(` ${Object.entries(s).map(([n,o])=>`${n}=${o}`).join(" ")}`):"";console.log(`${f.blue("\u2139")} ${t} ${i}${r}`);},success:(i,s)=>{let r=s?f.gray(` ${Object.entries(s).map(([n,o])=>`${n}=${o}`).join(" ")}`):"";console.log(`${f.green("\u2714")} ${t} ${i}${r}`);},warn:(i,s)=>{let r=s?f.gray(` ${Object.entries(s).map(([n,o])=>`${n}=${o}`).join(" ")}`):"";console.log(`${f.yellow("\u26A0")} ${t} ${i}${r}`);},error:(i,s)=>{let r=s?f.gray(` ${Object.entries(s).map(([n,o])=>`${n}=${o}`).join(" ")}`):"";console.error(`${f.red("\u2716")} ${t} ${i}${r}`);}}}};function B(e){if(e?.contentDir&&e?.uiDistPath)return {contentDir:e.contentDir,uiDistPath:e.uiDistPath};let t=u.join(x,"university-content"),i=u.join(x,"university-ui");if(c.existsSync(t)&&c.existsSync(i))return {contentDir:e?.contentDir||t,uiDistPath:e?.uiDistPath||i};let s=G(x);return {contentDir:e?.contentDir||u.join(s,"src","content"),uiDistPath:e?.uiDistPath||u.join(s,"ui","dist")}}function T(e){let t=P();t.use(P.json()),t.use((r,n,o)=>{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"),o();});let{contentDir:i,uiDistPath:s}=B(e);return t.use("/api/courses",R(i)),t.use("/api/plsat",Z(i,e?.projectDir)),t.get("/api/reference",(r,n)=>{let o=u.join(i,"reference.json");if(c.existsSync(o)){let a=JSON.parse(c.readFileSync(o,"utf-8"));n.json(a);}else n.status(404).json({error:"Reference data not found"});}),t.get("/api/health",(r,n)=>{n.json({status:"ok",timestamp:new Date().toISOString()});}),c.existsSync(s)&&(t.use(P.static(s)),t.get("{*path}",(r,n)=>{r.path.startsWith("/api")||n.sendFile(u.join(s,"index.html"));})),t}async function H(e){let t=T({contentDir:e.contentDir,uiDistPath:e.uiDistPath,projectDir:e.projectDir});return h.component("university-server").info("Starting server",{port:e.port}),new Promise((i,s)=>{t.listen(e.port,()=>{h.component("university-server").success("Server running",{url:`http://localhost:${e.port}`}),e.open&&import('open').then(r=>{r.default(`http://localhost:${e.port}`),h.component("university-server").info("Opened browser");}).catch(()=>{h.component("university-server").warn("Could not open browser automatically");}),i();}).on("error",r=>{r.code==="EADDRINUSE"?h.component("university-server").error("Port already in use",{port:e.port}):h.component("university-server").error("Server error",{error:r.message}),s(r);});})}
7
- export{T as createApp,H as startServer};