@nivora/matrix 0.1.1 → 0.2.0
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.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +4 -4
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +2 -2
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/builder/page.js +11 -11
- package/.next/server/app/builder/page.js.nft.json +1 -1
- package/.next/server/app/builder/page_client-reference-manifest.js +1 -1
- package/.next/server/app/guide/page.js.nft.json +1 -1
- package/.next/server/app/guide/page_client-reference-manifest.js +1 -1
- package/.next/server/app/matrix/page.js.nft.json +1 -1
- package/.next/server/app/matrix/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/releases/[id]/page.js +6 -6
- package/.next/server/app/releases/[id]/page.js.nft.json +1 -1
- package/.next/server/app/releases/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/releases/page.js +3 -3
- package/.next/server/app/releases/page.js.nft.json +1 -1
- package/.next/server/app/releases/page_client-reference-manifest.js +1 -1
- package/.next/server/app/specs/[id]/page.js +2 -2
- package/.next/server/app/specs/[id]/page.js.nft.json +1 -1
- package/.next/server/app/specs/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +4 -4
- package/.next/server/chunks/135.js +1 -1
- package/.next/server/chunks/530.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/app/builder/{page-e0a24ae820fa2c06.js → page-29ef0d9ec753466c.js} +3 -3
- package/.next/static/chunks/app/releases/[id]/{page-ea66642a6a557b42.js → page-467d1893a4442eed.js} +1 -1
- package/.next/static/chunks/app/releases/{page-fc527101f56b36c5.js → page-6fc2e948b934fbb5.js} +1 -1
- package/.next/static/chunks/app/specs/[id]/page-b5f2c99269d194c4.js +1 -0
- package/bin/cli.js +37 -20
- package/bin/cli.ts +12 -12
- package/package.json +7 -2
- package/.next/diagnostics/build-diagnostics.json +0 -6
- package/.next/diagnostics/framework.json +0 -1
- package/.next/static/chunks/app/specs/[id]/page-49293bb634997108.js +0 -1
- package/.next/trace +0 -11
- package/.next/trace-build +0 -1
- package/.next/types/app/builder/page.ts +0 -86
- package/.next/types/app/guide/page.ts +0 -86
- package/.next/types/app/layout.ts +0 -86
- package/.next/types/app/matrix/page.ts +0 -86
- package/.next/types/app/page.ts +0 -86
- package/.next/types/app/releases/[id]/page.ts +0 -86
- package/.next/types/app/releases/page.ts +0 -86
- package/.next/types/app/specs/[id]/page.ts +0 -86
- package/.next/types/package.json +0 -1
- package/.next/types/routes.d.ts +0 -63
- package/.next/types/validator.ts +0 -115
- /package/.next/static/{zmL75rl5Hq4TyiNVaXe8R → p01ytei1EF9z6WCg6Sbk1}/_buildManifest.js +0 -0
- /package/.next/static/{zmL75rl5Hq4TyiNVaXe8R → p01ytei1EF9z6WCg6Sbk1}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[385],{5507:(e,t,a)=>{"use strict";a.d(t,{RiskDetailClient:()=>d});var r=a(5155),i=a(2115),s=a(8500),l=a.n(s),n=a(9339);let c=(0,n.createServerReference)("6006b5147757be7ff44bdbd037afdf883ea34b681c",n.callServer,void 0,n.findSourceMapURL,"updateRiskAction");function d({risk:e,linkedFS:t}){let[a,s]=(0,i.useState)(!1),[n,d]=(0,i.useTransition)(),[m,h]=(0,i.useState)({title:e.title,status:e.status,category:e.category,impact:e.impact,probability:e.probability,risk_level:e.risk_level,residual_risk:e.residual_risk}),u=e.title.includes("(Undefined)");return(0,r.jsxs)("div",{children:[(0,r.jsxs)("header",{className:"page-header",children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1rem",marginBottom:"0.5rem",flexWrap:"wrap"},children:[(0,r.jsx)("code",{style:{fontSize:"1.5rem",fontWeight:700,color:"#f97316",background:"rgba(249, 115, 22, 0.1)",padding:"0.5rem 1rem",borderRadius:"8px"},children:e.id}),a?(0,r.jsx)(({value:e,onChange:t,options:i})=>a?(0,r.jsx)("select",{value:e,onChange:e=>t(e.target.value),className:"input",children:i.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}):(0,r.jsx)("span",{style:{textTransform:"capitalize"},children:e}),{value:m.status,onChange:e=>h({...m,status:e}),options:[{value:"draft",label:"Draft"},{value:"review",label:"Review"},{value:"approved",label:"Approved"}]}):(0,r.jsx)("span",{className:`badge ${"approved"===e.status?"badge-success":"badge-warning"}`,children:m.status}),(0,r.jsx)(p,{level:m.risk_level}),u&&!a&&(0,r.jsx)("span",{className:"badge",style:{background:"rgba(239, 68, 68, 0.2)",color:"var(--error)"},children:"Needs Definition"}),(0,r.jsx)("div",{style:{marginLeft:"auto",display:"flex",gap:"0.5rem"},children:a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>{h({title:e.title,status:e.status,category:e.category,impact:e.impact,probability:e.probability,risk_level:e.risk_level,residual_risk:e.residual_risk}),s(!1)},className:"btn",disabled:n,children:"Cancel"}),(0,r.jsx)("button",{onClick:()=>{d(async()=>{await c(e.id,m),s(!1)})},className:"btn btn-primary",disabled:n,children:n?"Saving...":"\uD83D\uDCBE Save"})]}):(0,r.jsx)("button",{onClick:()=>s(!0),className:"btn btn-primary",children:"✏️ Edit"})})]}),a?(0,r.jsx)("input",{type:"text",value:m.title,onChange:e=>h({...m,title:e.target.value}),className:"input",style:{fontSize:"1.5rem",fontWeight:700,width:"100%",marginBottom:"0.5rem"}}):(0,r.jsx)("h1",{className:"page-title",children:m.title}),(0,r.jsxs)("p",{className:"page-subtitle",children:["Risk Assessment • Category: ",a?(0,r.jsx)("input",{type:"text",value:m.category,onChange:e=>h({...m,category:e.target.value}),className:"input",style:{width:"200px",display:"inline-block"}}):m.category," • GAMP Category ",e.gamp_category]})]}),u&&!a&&(0,r.jsx)("div",{className:"card",style:{marginBottom:"1.5rem",background:"rgba(239, 68, 68, 0.1)",borderLeft:"4px solid var(--error)"},children:(0,r.jsxs)("p",{style:{margin:0,color:"var(--error)"},children:["⚠️ This Risk was auto-created from FS references. Click ",(0,r.jsx)("strong",{children:"Edit"})," to define its details."]})}),(0,r.jsx)("div",{className:"card",style:{marginBottom:"1.5rem"},children:(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"1rem"},children:[(0,r.jsx)(o,{label:"Impact",value:m.impact,isEditing:a,onChange:e=>h({...m,impact:e}),options:["low","medium","high","critical"]}),(0,r.jsx)(o,{label:"Probability",value:m.probability,isEditing:a,onChange:e=>h({...m,probability:e}),options:["low","medium","high"]}),(0,r.jsx)(o,{label:"Risk Level",value:m.risk_level,isEditing:a,onChange:e=>h({...m,risk_level:e}),options:["low","medium","high","critical"]}),(0,r.jsx)(o,{label:"Residual Risk",value:m.residual_risk,isEditing:a,onChange:e=>h({...m,residual_risk:e}),options:["acceptable","unacceptable","pending"]})]})}),(0,r.jsxs)("div",{className:"card",style:{marginBottom:"1.5rem"},children:[(0,r.jsx)("h2",{className:"card-title",children:"⚙️ Linked Functional Specifications"}),(0,r.jsx)("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap"},children:t.map(e=>(0,r.jsx)(l(),{href:`/specs/${e.id}`,children:(0,r.jsxs)("span",{className:"badge",style:{background:"rgba(245, 158, 11, 0.15)",color:"var(--warning)",padding:"0.5rem 1rem"},children:[e.id," - ",e.title]})},e.id))})]}),(0,r.jsxs)("div",{className:"card",style:{marginBottom:"1.5rem"},children:[(0,r.jsx)("h2",{className:"card-title",children:"\uD83D\uDD34 Identified Risks"}),0===e.risks.length?(0,r.jsx)("p",{style:{color:"var(--text-secondary)",fontStyle:"italic"},children:"No risks defined yet"}):(0,r.jsx)("div",{style:{display:"grid",gap:"0.5rem"},children:e.risks.map((e,t)=>(0,r.jsxs)("div",{style:{padding:"0.75rem 1rem",background:"var(--bg-hover)",borderRadius:"6px",display:"flex",alignItems:"center",gap:"1rem"},children:[(0,r.jsx)("code",{style:{fontWeight:600,color:"#f97316"},children:e.id}),(0,r.jsx)("span",{style:{flex:1,color:"var(--text-secondary)"},children:e.description}),(0,r.jsx)(p,{level:e.impact,small:!0})]},t))})]}),(0,r.jsxs)("div",{className:"card",children:[(0,r.jsx)("h2",{className:"card-title",children:"\uD83D\uDEE1️ Mitigations"}),0===e.mitigations.length?(0,r.jsx)("p",{style:{color:"var(--text-secondary)",fontStyle:"italic"},children:"No mitigations defined yet"}):(0,r.jsxs)("table",{className:"table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Risk"}),(0,r.jsx)("th",{children:"Control"}),(0,r.jsx)("th",{children:"Test"})]})}),(0,r.jsx)("tbody",{children:e.mitigations.map((e,t)=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("code",{children:e.risk_id})}),(0,r.jsx)("td",{children:e.control}),(0,r.jsx)("td",{style:{color:"var(--text-secondary)"},children:e.test})]},t))})]})]})]})}function o({label:e,value:t,isEditing:a,onChange:i,options:s}){let l=m(t);return(0,r.jsxs)("div",{style:{textAlign:"center",padding:"1rem",background:"var(--bg-hover)",borderRadius:"8px"},children:[(0,r.jsx)("div",{style:{fontSize:"0.75rem",color:"var(--text-secondary)",marginBottom:"0.25rem"},children:e}),a?(0,r.jsx)("select",{value:t,onChange:e=>i(e.target.value),className:"input",style:{width:"100%",textAlign:"center"},children:s.map(e=>(0,r.jsx)("option",{value:e,style:{textTransform:"capitalize"},children:e},e))}):(0,r.jsx)("div",{style:{fontSize:"1.25rem",fontWeight:700,color:l,textTransform:"capitalize"},children:t})]})}function p({level:e,small:t}){let a=m(e);return(0,r.jsx)("span",{className:"badge",style:{background:`${a}20`,color:a,padding:t?"0.25rem 0.5rem":"0.5rem 1rem",fontSize:t?"0.75rem":"0.875rem",textTransform:"capitalize"},children:e})}function m(e){switch(e){case"critical":case"unacceptable":return"#dc2626";case"high":return"#f97316";case"medium":case"pending":return"#eab308";case"low":case"acceptable":return"#22c55e";default:return"var(--text-secondary)"}}},6164:(e,t,a)=>{Promise.resolve().then(a.t.bind(a,8500,23)),Promise.resolve().then(a.bind(a,5507)),Promise.resolve().then(a.bind(a,8169)),Promise.resolve().then(a.bind(a,8384))},8169:(e,t,a)=>{"use strict";a.d(t,{ScenarioList:()=>l});var r=a(5155),i=a(2115);function s({scenario:e,isHighlighted:t}){return(0,r.jsxs)("div",{style:{padding:"1rem",background:t?"rgba(96, 165, 250, 0.1)":"var(--bg-hover)",borderRadius:"8px",border:t?"2px solid var(--accent)":"1px solid var(--border)"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"0.75rem"},children:[(0,r.jsx)("span",{style:{color:"var(--accent)"},children:"\uD83E\uDDEA"}),(0,r.jsx)("span",{style:{fontWeight:600},children:e.name}),e.tags.length>0&&(0,r.jsx)("span",{style:{marginLeft:"auto",fontSize:"0.75rem",color:"var(--text-secondary)"},children:e.tags.join(" ")})]}),(0,r.jsx)("div",{style:{fontFamily:"monospace",fontSize:"0.8125rem",lineHeight:1.6},children:e.steps.map((e,t)=>{var a;return(0,r.jsx)("div",{style:{color:(a=e).startsWith("Given")?"#a78bfa":a.startsWith("When")?"#60a5fa":a.startsWith("Then")?"#34d399":"var(--text-secondary)"},children:e},t)})})]})}function l({scenarios:e,highlightScenario:t}){let a=(0,i.useRef)(null);return(0,i.useEffect)(()=>{t&&a.current&&setTimeout(()=>{a.current?.scrollIntoView({behavior:"smooth",block:"center"})},100)},[t]),(0,r.jsx)("div",{style:{display:"grid",gap:"0.75rem"},children:e.map((e,i)=>{let l=t===e.name;return(0,r.jsx)("div",{ref:l?a:void 0,children:(0,r.jsx)(s,{scenario:e,isHighlighted:l})},i)})})}a(8500)},8384:(e,t,a)=>{"use strict";a.d(t,{URSDetailClient:()=>d});var r=a(5155),i=a(2115),s=a(8500),l=a.n(s),n=a(9339);let c=(0,n.createServerReference)("6001d939b150c0d179141b174c280871a1034e995a",n.callServer,void 0,n.findSourceMapURL,"updateURSAction");function d({urs:e,linkedFS:t,linkedRisks:a}){let[s,n]=(0,i.useState)(!1),[d,p]=(0,i.useTransition)(),[m,h]=(0,i.useState)({title:e.title,status:e.status,priority:e.priority,owner:e.owner,category:e.category,business_need:e.business_need,intended_use:e.intended_use,acceptance_criteria:e.acceptance_criteria}),u=e.title.includes("(Undefined)"),g=({value:e,onChange:t,multiline:a,placeholder:i})=>s?a?(0,r.jsx)("textarea",{value:e,onChange:e=>t(e.target.value),rows:4,className:"input",style:{width:"100%",resize:"vertical"}}):(0,r.jsx)("input",{type:"text",value:e,onChange:e=>t(e.target.value),className:"input",style:{width:"100%"}}):(0,r.jsx)("span",{style:{whiteSpace:"pre-wrap",color:"var(--text-secondary)",fontStyle:e?"normal":"italic"},children:e||i||"Not defined"}),x=({value:e,onChange:t,options:a})=>s?(0,r.jsx)("select",{value:e,onChange:e=>t(e.target.value),className:"input",children:a.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}):(0,r.jsx)("span",{style:{textTransform:"capitalize"},children:e});return(0,r.jsxs)("div",{children:[(0,r.jsxs)("header",{className:"page-header",children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1rem",marginBottom:"0.5rem",flexWrap:"wrap"},children:[(0,r.jsx)("code",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--success)",background:"rgba(16, 185, 129, 0.1)",padding:"0.5rem 1rem",borderRadius:"8px"},children:e.id}),s?(0,r.jsx)(x,{value:m.status,onChange:e=>h({...m,status:e}),options:[{value:"draft",label:"Draft"},{value:"review",label:"Review"},{value:"approved",label:"Approved"}]}):(0,r.jsx)("span",{className:`badge ${"approved"===e.status?"badge-success":"badge-warning"}`,children:m.status}),s?(0,r.jsx)(x,{value:m.priority,onChange:e=>h({...m,priority:e}),options:[{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}]}):(0,r.jsx)("span",{className:"badge",style:{background:"var(--bg-hover)"},children:m.priority}),u&&!s&&(0,r.jsx)("span",{className:"badge",style:{background:"rgba(239, 68, 68, 0.2)",color:"var(--error)"},children:"Needs Definition"}),(0,r.jsx)("div",{style:{marginLeft:"auto",display:"flex",gap:"0.5rem"},children:s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>{h({title:e.title,status:e.status,priority:e.priority,owner:e.owner,category:e.category,business_need:e.business_need,intended_use:e.intended_use,acceptance_criteria:e.acceptance_criteria}),n(!1)},className:"btn",disabled:d,children:"Cancel"}),(0,r.jsx)("button",{onClick:()=>{p(async()=>{await c(e.id,m),n(!1)})},className:"btn btn-primary",disabled:d,children:d?"Saving...":"\uD83D\uDCBE Save"})]}):(0,r.jsx)("button",{onClick:()=>n(!0),className:"btn btn-primary",children:"✏️ Edit"})})]}),s?(0,r.jsx)("input",{type:"text",value:m.title,onChange:e=>h({...m,title:e.target.value}),className:"input",style:{fontSize:"1.5rem",fontWeight:700,width:"100%",marginBottom:"0.5rem"}}):(0,r.jsx)("h1",{className:"page-title",children:m.title}),(0,r.jsxs)("p",{className:"page-subtitle",children:["User Requirement Specification • Owner: ",s?(0,r.jsx)("input",{type:"text",value:m.owner,onChange:e=>h({...m,owner:e.target.value}),className:"input",style:{width:"200px",display:"inline-block"}}):m.owner]})]}),u&&!s&&(0,r.jsx)("div",{className:"card",style:{marginBottom:"1.5rem",background:"rgba(239, 68, 68, 0.1)",borderLeft:"4px solid var(--error)"},children:(0,r.jsxs)("p",{style:{margin:0,color:"var(--error)"},children:["⚠️ This URS was auto-created from FS references. Click ",(0,r.jsx)("strong",{children:"Edit"})," to define its details."]})}),(0,r.jsxs)("div",{className:"card",style:{marginBottom:"1.5rem"},children:[(0,r.jsx)("h2",{className:"card-title",children:"\uD83D\uDD17 Traceability"}),(0,r.jsxs)("div",{style:{display:"flex",gap:"2rem",flexWrap:"wrap"},children:[(0,r.jsx)(o,{label:"Functional Specs",count:t.length,color:"var(--warning)"}),(0,r.jsx)(o,{label:"Test Scenarios",count:t.reduce((e,t)=>e+t.scenarios.length,0),color:"var(--accent)"}),(0,r.jsx)(o,{label:"Risk Assessments",count:a.length,color:"#f97316"})]})]}),(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"1.5rem"},children:[(0,r.jsxs)("div",{className:"card",children:[(0,r.jsx)("h2",{className:"card-title",children:"\uD83D\uDCCB Business Need"}),(0,r.jsx)("div",{style:{lineHeight:1.7},children:(0,r.jsx)(g,{value:m.business_need,onChange:e=>h({...m,business_need:e}),multiline:!0,placeholder:"Not defined"})})]}),(0,r.jsxs)("div",{className:"card",children:[(0,r.jsx)("h2",{className:"card-title",children:"\uD83C\uDFAF Intended Use"}),(0,r.jsx)("div",{style:{lineHeight:1.7},children:(0,r.jsx)(g,{value:m.intended_use,onChange:e=>h({...m,intended_use:e}),multiline:!0,placeholder:"Not defined"})})]})]}),(0,r.jsxs)("div",{className:"card",style:{marginTop:"1.5rem"},children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1rem"},children:[(0,r.jsx)("h2",{className:"card-title",style:{margin:0},children:"✅ Acceptance Criteria"}),s&&(0,r.jsx)("button",{onClick:()=>h({...m,acceptance_criteria:[...m.acceptance_criteria,""]}),className:"btn",style:{padding:"0.25rem 0.75rem"},children:"+ Add"})]}),0===m.acceptance_criteria.length?(0,r.jsx)("p",{style:{color:"var(--text-secondary)",fontStyle:"italic"},children:"No acceptance criteria defined"}):s?(0,r.jsx)("div",{style:{display:"grid",gap:"0.5rem"},children:m.acceptance_criteria.map((e,t)=>(0,r.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,r.jsx)("input",{type:"text",value:e,onChange:e=>{let a=[...m.acceptance_criteria];a[t]=e.target.value,h({...m,acceptance_criteria:a})},className:"input",style:{flex:1},placeholder:`Criterion ${t+1}`}),(0,r.jsx)("button",{onClick:()=>h({...m,acceptance_criteria:m.acceptance_criteria.filter((e,a)=>a!==t)}),className:"btn",style:{padding:"0.5rem"},children:"\xd7"})]},t))}):(0,r.jsx)("ul",{style:{margin:0,paddingLeft:"1.5rem"},children:m.acceptance_criteria.map((e,t)=>(0,r.jsx)("li",{style:{marginBottom:"0.5rem",color:"var(--text-secondary)"},children:e},t))})]}),(0,r.jsxs)("div",{className:"card",style:{marginTop:"1.5rem"},children:[(0,r.jsx)("h2",{className:"card-title",children:"⚙️ Linked Functional Specifications"}),0===t.length?(0,r.jsx)("p",{style:{color:"var(--text-secondary)"},children:"No FS linked yet"}):(0,r.jsx)("div",{style:{display:"grid",gap:"1rem"},children:t.map(e=>(0,r.jsx)(l(),{href:`/specs/${e.id}`,style:{textDecoration:"none"},children:(0,r.jsx)("div",{style:{padding:"1rem",background:"var(--bg-hover)",borderRadius:"8px",borderLeft:"4px solid var(--warning)"},children:(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[(0,r.jsx)("code",{style:{fontWeight:600,color:"var(--warning)"},children:e.id}),(0,r.jsx)("span",{style:{color:"var(--text-primary)"},children:e.title}),(0,r.jsxs)("span",{className:"badge badge-success",style:{marginLeft:"auto"},children:[e.scenario_count," tests"]})]})})},e.id))})]})]})}function o({label:e,count:t,color:a}){return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:{fontSize:"0.75rem",color:"var(--text-secondary)",marginBottom:"0.25rem"},children:e}),(0,r.jsx)("div",{style:{fontSize:"1.5rem",fontWeight:700,color:a},children:t})]})}},9339:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={callServer:function(){return s.callServer},createServerReference:function(){return n.createServerReference},findSourceMapURL:function(){return l.findSourceMapURL}};for(var i in r)Object.defineProperty(t,i,{enumerable:!0,get:r[i]});let s=a(7304),l=a(4060),n=a(7197)}},e=>{e.O(0,[500,441,794,358],()=>e(e.s=6164)),_N_E=e.O()}]);
|
package/bin/cli.js
CHANGED
|
@@ -2142,7 +2142,7 @@ function getDbPath() {
|
|
|
2142
2142
|
if (process.env.MACHINE_DB_PATH) {
|
|
2143
2143
|
return process.env.MACHINE_DB_PATH;
|
|
2144
2144
|
}
|
|
2145
|
-
return join3(process.cwd(), "
|
|
2145
|
+
return join3(process.cwd(), "matrix.db");
|
|
2146
2146
|
}
|
|
2147
2147
|
function getDb() {
|
|
2148
2148
|
if (!db) {
|
|
@@ -3133,7 +3133,7 @@ import { existsSync, readFileSync } from "fs";
|
|
|
3133
3133
|
import { join, resolve } from "path";
|
|
3134
3134
|
var DEFAULT_CONFIG = {
|
|
3135
3135
|
specsDir: "./specs",
|
|
3136
|
-
dbPath: "./
|
|
3136
|
+
dbPath: "./matrix.db",
|
|
3137
3137
|
port: 3000,
|
|
3138
3138
|
rootDir: process.cwd()
|
|
3139
3139
|
};
|
|
@@ -3204,13 +3204,30 @@ async function serveCommand(config) {
|
|
|
3204
3204
|
};
|
|
3205
3205
|
const packageRoot = join2(__dirname2, "..", "..");
|
|
3206
3206
|
const hasProductionBuild = existsSync2(join2(packageRoot, ".next", "BUILD_ID"));
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3207
|
+
if (hasProductionBuild) {
|
|
3208
|
+
const nextBin = join2(packageRoot, "node_modules", ".bin", "next");
|
|
3209
|
+
const useLocalNext = existsSync2(nextBin);
|
|
3210
|
+
if (useLocalNext) {
|
|
3211
|
+
spawn(nextBin, ["start", "-p", String(config.port)], {
|
|
3212
|
+
cwd: packageRoot,
|
|
3213
|
+
env,
|
|
3214
|
+
stdio: "inherit"
|
|
3215
|
+
});
|
|
3216
|
+
} else {
|
|
3217
|
+
spawn("npx", ["next", "start", "-p", String(config.port)], {
|
|
3218
|
+
cwd: packageRoot,
|
|
3219
|
+
env,
|
|
3220
|
+
stdio: "inherit"
|
|
3221
|
+
});
|
|
3222
|
+
}
|
|
3223
|
+
} else {
|
|
3224
|
+
const runtime = hasBun() ? "bun" : "npm";
|
|
3225
|
+
spawn(runtime, ["run", "dev"], {
|
|
3226
|
+
cwd: packageRoot,
|
|
3227
|
+
env,
|
|
3228
|
+
stdio: "inherit"
|
|
3229
|
+
});
|
|
3230
|
+
}
|
|
3214
3231
|
}
|
|
3215
3232
|
|
|
3216
3233
|
// src/commands/sync.ts
|
|
@@ -3220,7 +3237,7 @@ import { join as join4 } from "path";
|
|
|
3220
3237
|
// src/config.ts
|
|
3221
3238
|
var DEFAULT_CONFIG2 = {
|
|
3222
3239
|
specsDir: "./specs",
|
|
3223
|
-
dbPath: "./
|
|
3240
|
+
dbPath: "./matrix.db",
|
|
3224
3241
|
port: 3000,
|
|
3225
3242
|
rootDir: process.cwd()
|
|
3226
3243
|
};
|
|
@@ -3585,7 +3602,7 @@ async function testCommand(config, action, options) {
|
|
|
3585
3602
|
// bin/cli.ts
|
|
3586
3603
|
var program2 = new Command;
|
|
3587
3604
|
program2.name("machine").description("Requirements documentation system with semantic search").version("0.1.0");
|
|
3588
|
-
program2.command("serve").description("Start the documentation server").option("-p, --port <port>", "Port to run server on", "3000").option("-s, --specs <dir>", "Specs directory", "./specs").option("-d, --db <path>", "Database path", "./
|
|
3605
|
+
program2.command("serve").description("Start the documentation server").option("-p, --port <port>", "Port to run server on", "3000").option("-s, --specs <dir>", "Specs directory", "./specs").option("-d, --db <path>", "Database path", "./matrix.db").action(async (options) => {
|
|
3589
3606
|
const config = await loadConfig({
|
|
3590
3607
|
port: parseInt(options.port, 10),
|
|
3591
3608
|
specsDir: options.specs,
|
|
@@ -3593,7 +3610,7 @@ program2.command("serve").description("Start the documentation server").option("
|
|
|
3593
3610
|
});
|
|
3594
3611
|
await serveCommand(config);
|
|
3595
3612
|
});
|
|
3596
|
-
program2.command("sync").description("Sync FS files to database and index steps").option("-s, --specs <dir>", "Specs directory", "./specs").option("-d, --db <path>", "Database path", "./
|
|
3613
|
+
program2.command("sync").description("Sync FS files to database and index steps").option("-s, --specs <dir>", "Specs directory", "./specs").option("-d, --db <path>", "Database path", "./matrix.db").action(async (options) => {
|
|
3597
3614
|
const config = await loadConfig({
|
|
3598
3615
|
specsDir: options.specs,
|
|
3599
3616
|
dbPath: options.db
|
|
@@ -3606,7 +3623,7 @@ program2.command("init").description("Initialize a new specs directory").option(
|
|
|
3606
3623
|
});
|
|
3607
3624
|
await initCommand(config);
|
|
3608
3625
|
});
|
|
3609
|
-
program2.command("search <query>").description("Semantic search for steps").option("-n, --limit <n>", "Number of results", "10").option("-s, --specs <dir>", "Specs directory", "./specs").option("-d, --db <path>", "Database path", "./
|
|
3626
|
+
program2.command("search <query>").description("Semantic search for steps").option("-n, --limit <n>", "Number of results", "10").option("-s, --specs <dir>", "Specs directory", "./specs").option("-d, --db <path>", "Database path", "./matrix.db").action(async (query, options) => {
|
|
3610
3627
|
const config = await loadConfig({
|
|
3611
3628
|
specsDir: options.specs,
|
|
3612
3629
|
dbPath: options.db
|
|
@@ -3614,11 +3631,11 @@ program2.command("search <query>").description("Semantic search for steps").opti
|
|
|
3614
3631
|
await searchCommand(config, query, parseInt(options.limit, 10));
|
|
3615
3632
|
});
|
|
3616
3633
|
var release = program2.command("release").description("Manage releases");
|
|
3617
|
-
release.command("list").description("List all releases").option("-d, --db <path>", "Database path", "./
|
|
3634
|
+
release.command("list").description("List all releases").option("-d, --db <path>", "Database path", "./matrix.db").action(async (options) => {
|
|
3618
3635
|
const config = await loadConfig({ dbPath: options.db });
|
|
3619
3636
|
await releaseCommand(config, "list");
|
|
3620
3637
|
});
|
|
3621
|
-
release.command("create").description("Create a new release").requiredOption("-v, --version <version>", "Release version (e.g., 1.0.0)").requiredOption("-n, --name <name>", "Release name").option("--notes <notes>", "Release notes").option("-d, --db <path>", "Database path", "./
|
|
3638
|
+
release.command("create").description("Create a new release").requiredOption("-v, --version <version>", "Release version (e.g., 1.0.0)").requiredOption("-n, --name <name>", "Release name").option("--notes <notes>", "Release notes").option("-d, --db <path>", "Database path", "./matrix.db").action(async (options) => {
|
|
3622
3639
|
const config = await loadConfig({ dbPath: options.db });
|
|
3623
3640
|
await releaseCommand(config, "create", {
|
|
3624
3641
|
version: options.version,
|
|
@@ -3626,24 +3643,24 @@ release.command("create").description("Create a new release").requiredOption("-v
|
|
|
3626
3643
|
notes: options.notes
|
|
3627
3644
|
});
|
|
3628
3645
|
});
|
|
3629
|
-
release.command("tag <releaseId>").description("Tag features to a release").requiredOption("--fs <fsIds...>", "FS IDs to tag").option("-d, --db <path>", "Database path", "./
|
|
3646
|
+
release.command("tag <releaseId>").description("Tag features to a release").requiredOption("--fs <fsIds...>", "FS IDs to tag").option("-d, --db <path>", "Database path", "./matrix.db").action(async (releaseId, options) => {
|
|
3630
3647
|
const config = await loadConfig({ dbPath: options.db });
|
|
3631
3648
|
await releaseCommand(config, "tag", { releaseId, fsIds: options.fs });
|
|
3632
3649
|
});
|
|
3633
|
-
release.command("status <releaseId>").description("Update release status").requiredOption("--status <status>", "New status (planning|testing|released)").option("-d, --db <path>", "Database path", "./
|
|
3650
|
+
release.command("status <releaseId>").description("Update release status").requiredOption("--status <status>", "New status (planning|testing|released)").option("-d, --db <path>", "Database path", "./matrix.db").action(async (releaseId, options) => {
|
|
3634
3651
|
const config = await loadConfig({ dbPath: options.db });
|
|
3635
3652
|
await releaseCommand(config, "status", { releaseId, status: options.status });
|
|
3636
3653
|
});
|
|
3637
|
-
release.command("import-results <file>").description("Import Cucumber JSON results into a release").requiredOption("--releaseId <id>", "Release ID").option("-d, --db <path>", "Database path", "./
|
|
3654
|
+
release.command("import-results <file>").description("Import Cucumber JSON results into a release").requiredOption("--releaseId <id>", "Release ID").option("-d, --db <path>", "Database path", "./matrix.db").action(async (file, options) => {
|
|
3638
3655
|
const config = await loadConfig({ dbPath: options.db });
|
|
3639
3656
|
await importResultsCommand(config, file, { releaseId: options.releaseId });
|
|
3640
3657
|
});
|
|
3641
3658
|
var test = program2.command("test").description("Manage test results");
|
|
3642
|
-
test.command("import <jsonPath>").description("Import Cucumber JSON test results").requiredOption("-r, --release <releaseId>", "Release ID").option("-d, --db <path>", "Database path", "./
|
|
3659
|
+
test.command("import <jsonPath>").description("Import Cucumber JSON test results").requiredOption("-r, --release <releaseId>", "Release ID").option("-d, --db <path>", "Database path", "./matrix.db").action(async (jsonPath, options) => {
|
|
3643
3660
|
const config = await loadConfig({ dbPath: options.db });
|
|
3644
3661
|
await testCommand(config, "import", { releaseId: options.release, jsonPath });
|
|
3645
3662
|
});
|
|
3646
|
-
test.command("list <releaseId>").description("List test runs for a release").option("-d, --db <path>", "Database path", "./
|
|
3663
|
+
test.command("list <releaseId>").description("List test runs for a release").option("-d, --db <path>", "Database path", "./matrix.db").action(async (releaseId, options) => {
|
|
3647
3664
|
const config = await loadConfig({ dbPath: options.db });
|
|
3648
3665
|
await testCommand(config, "list", { releaseId });
|
|
3649
3666
|
});
|
package/bin/cli.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
/**
|
|
3
|
-
* @nivora/
|
|
3
|
+
* @nivora/matrix CLI
|
|
4
4
|
*
|
|
5
5
|
* Commands:
|
|
6
6
|
* serve - Start the documentation server
|
|
@@ -25,7 +25,7 @@ import { testCommand } from '../src/commands/test';
|
|
|
25
25
|
const program = new Command();
|
|
26
26
|
|
|
27
27
|
program
|
|
28
|
-
.name('
|
|
28
|
+
.name('matrix')
|
|
29
29
|
.description('Requirements documentation system with semantic search')
|
|
30
30
|
.version('0.1.0');
|
|
31
31
|
|
|
@@ -34,7 +34,7 @@ program
|
|
|
34
34
|
.description('Start the documentation server')
|
|
35
35
|
.option('-p, --port <port>', 'Port to run server on', '3000')
|
|
36
36
|
.option('-s, --specs <dir>', 'Specs directory', './specs')
|
|
37
|
-
.option('-d, --db <path>', 'Database path', './
|
|
37
|
+
.option('-d, --db <path>', 'Database path', './matrix.db')
|
|
38
38
|
.action(async (options) => {
|
|
39
39
|
const config = await loadConfig({
|
|
40
40
|
port: parseInt(options.port, 10),
|
|
@@ -48,7 +48,7 @@ program
|
|
|
48
48
|
.command('sync')
|
|
49
49
|
.description('Sync FS files to database and index steps')
|
|
50
50
|
.option('-s, --specs <dir>', 'Specs directory', './specs')
|
|
51
|
-
.option('-d, --db <path>', 'Database path', './
|
|
51
|
+
.option('-d, --db <path>', 'Database path', './matrix.db')
|
|
52
52
|
.action(async (options) => {
|
|
53
53
|
const config = await loadConfig({
|
|
54
54
|
specsDir: options.specs,
|
|
@@ -73,7 +73,7 @@ program
|
|
|
73
73
|
.description('Semantic search for steps')
|
|
74
74
|
.option('-n, --limit <n>', 'Number of results', '10')
|
|
75
75
|
.option('-s, --specs <dir>', 'Specs directory', './specs')
|
|
76
|
-
.option('-d, --db <path>', 'Database path', './
|
|
76
|
+
.option('-d, --db <path>', 'Database path', './matrix.db')
|
|
77
77
|
.action(async (query, options) => {
|
|
78
78
|
const config = await loadConfig({
|
|
79
79
|
specsDir: options.specs,
|
|
@@ -90,7 +90,7 @@ const release = program
|
|
|
90
90
|
release
|
|
91
91
|
.command('list')
|
|
92
92
|
.description('List all releases')
|
|
93
|
-
.option('-d, --db <path>', 'Database path', './
|
|
93
|
+
.option('-d, --db <path>', 'Database path', './matrix.db')
|
|
94
94
|
.action(async (options) => {
|
|
95
95
|
const config = await loadConfig({ dbPath: options.db });
|
|
96
96
|
await releaseCommand(config, 'list');
|
|
@@ -102,7 +102,7 @@ release
|
|
|
102
102
|
.requiredOption('-v, --version <version>', 'Release version (e.g., 1.0.0)')
|
|
103
103
|
.requiredOption('-n, --name <name>', 'Release name')
|
|
104
104
|
.option('--notes <notes>', 'Release notes')
|
|
105
|
-
.option('-d, --db <path>', 'Database path', './
|
|
105
|
+
.option('-d, --db <path>', 'Database path', './matrix.db')
|
|
106
106
|
.action(async (options) => {
|
|
107
107
|
const config = await loadConfig({ dbPath: options.db });
|
|
108
108
|
await releaseCommand(config, 'create', {
|
|
@@ -116,7 +116,7 @@ release
|
|
|
116
116
|
.command('tag <releaseId>')
|
|
117
117
|
.description('Tag features to a release')
|
|
118
118
|
.requiredOption('--fs <fsIds...>', 'FS IDs to tag')
|
|
119
|
-
.option('-d, --db <path>', 'Database path', './
|
|
119
|
+
.option('-d, --db <path>', 'Database path', './matrix.db')
|
|
120
120
|
.action(async (releaseId, options) => {
|
|
121
121
|
const config = await loadConfig({ dbPath: options.db });
|
|
122
122
|
await releaseCommand(config, 'tag', { releaseId, fsIds: options.fs });
|
|
@@ -126,7 +126,7 @@ release
|
|
|
126
126
|
.command('status <releaseId>')
|
|
127
127
|
.description('Update release status')
|
|
128
128
|
.requiredOption('--status <status>', 'New status (planning|testing|released)')
|
|
129
|
-
.option('-d, --db <path>', 'Database path', './
|
|
129
|
+
.option('-d, --db <path>', 'Database path', './matrix.db')
|
|
130
130
|
.action(async (releaseId, options) => {
|
|
131
131
|
const config = await loadConfig({ dbPath: options.db });
|
|
132
132
|
await releaseCommand(config, 'status', { releaseId, status: options.status });
|
|
@@ -136,7 +136,7 @@ release
|
|
|
136
136
|
.command('import-results <file>')
|
|
137
137
|
.description('Import Cucumber JSON results into a release')
|
|
138
138
|
.requiredOption('--releaseId <id>', 'Release ID')
|
|
139
|
-
.option('-d, --db <path>', 'Database path', './
|
|
139
|
+
.option('-d, --db <path>', 'Database path', './matrix.db')
|
|
140
140
|
.action(async (file, options) => {
|
|
141
141
|
const config = await loadConfig({ dbPath: options.db });
|
|
142
142
|
await importResultsCommand(config, file, { releaseId: options.releaseId });
|
|
@@ -152,7 +152,7 @@ test
|
|
|
152
152
|
.command('import <jsonPath>')
|
|
153
153
|
.description('Import Cucumber JSON test results')
|
|
154
154
|
.requiredOption('-r, --release <releaseId>', 'Release ID')
|
|
155
|
-
.option('-d, --db <path>', 'Database path', './
|
|
155
|
+
.option('-d, --db <path>', 'Database path', './matrix.db')
|
|
156
156
|
.action(async (jsonPath, options) => {
|
|
157
157
|
const config = await loadConfig({ dbPath: options.db });
|
|
158
158
|
await testCommand(config, 'import', { releaseId: options.release, jsonPath });
|
|
@@ -161,7 +161,7 @@ test
|
|
|
161
161
|
test
|
|
162
162
|
.command('list <releaseId>')
|
|
163
163
|
.description('List test runs for a release')
|
|
164
|
-
.option('-d, --db <path>', 'Database path', './
|
|
164
|
+
.option('-d, --db <path>', 'Database path', './matrix.db')
|
|
165
165
|
.action(async (releaseId, options) => {
|
|
166
166
|
const config = await loadConfig({ dbPath: options.db });
|
|
167
167
|
await testCommand(config, 'list', { releaseId });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nivora/matrix",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Requirements documentation system with semantic search",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,7 +12,12 @@
|
|
|
12
12
|
"files": [
|
|
13
13
|
"bin",
|
|
14
14
|
"dist",
|
|
15
|
-
".next",
|
|
15
|
+
".next/*.json",
|
|
16
|
+
".next/*.js",
|
|
17
|
+
".next/BUILD_ID",
|
|
18
|
+
".next/package.json",
|
|
19
|
+
".next/server",
|
|
20
|
+
".next/static",
|
|
16
21
|
"public",
|
|
17
22
|
"next.config.ts"
|
|
18
23
|
],
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name":"Next.js","version":"16.1.1"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[385],{4839:(e,t,a)=>{"use strict";a.d(t,{RiskDetailClient:()=>d});var r=a(5155),i=a(2115),s=a(8500),l=a.n(s),n=a(9339);let c=(0,n.createServerReference)("605ab5a9e6bcfd5272e605b0b0bd7b2c90ce4d2856",n.callServer,void 0,n.findSourceMapURL,"updateRiskAction");function d({risk:e,linkedFS:t}){let[a,s]=(0,i.useState)(!1),[n,d]=(0,i.useTransition)(),[m,h]=(0,i.useState)({title:e.title,status:e.status,category:e.category,impact:e.impact,probability:e.probability,risk_level:e.risk_level,residual_risk:e.residual_risk}),u=e.title.includes("(Undefined)");return(0,r.jsxs)("div",{children:[(0,r.jsxs)("header",{className:"page-header",children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1rem",marginBottom:"0.5rem",flexWrap:"wrap"},children:[(0,r.jsx)("code",{style:{fontSize:"1.5rem",fontWeight:700,color:"#f97316",background:"rgba(249, 115, 22, 0.1)",padding:"0.5rem 1rem",borderRadius:"8px"},children:e.id}),a?(0,r.jsx)(({value:e,onChange:t,options:i})=>a?(0,r.jsx)("select",{value:e,onChange:e=>t(e.target.value),className:"input",children:i.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}):(0,r.jsx)("span",{style:{textTransform:"capitalize"},children:e}),{value:m.status,onChange:e=>h({...m,status:e}),options:[{value:"draft",label:"Draft"},{value:"review",label:"Review"},{value:"approved",label:"Approved"}]}):(0,r.jsx)("span",{className:`badge ${"approved"===e.status?"badge-success":"badge-warning"}`,children:m.status}),(0,r.jsx)(p,{level:m.risk_level}),u&&!a&&(0,r.jsx)("span",{className:"badge",style:{background:"rgba(239, 68, 68, 0.2)",color:"var(--error)"},children:"Needs Definition"}),(0,r.jsx)("div",{style:{marginLeft:"auto",display:"flex",gap:"0.5rem"},children:a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>{h({title:e.title,status:e.status,category:e.category,impact:e.impact,probability:e.probability,risk_level:e.risk_level,residual_risk:e.residual_risk}),s(!1)},className:"btn",disabled:n,children:"Cancel"}),(0,r.jsx)("button",{onClick:()=>{d(async()=>{await c(e.id,m),s(!1)})},className:"btn btn-primary",disabled:n,children:n?"Saving...":"\uD83D\uDCBE Save"})]}):(0,r.jsx)("button",{onClick:()=>s(!0),className:"btn btn-primary",children:"✏️ Edit"})})]}),a?(0,r.jsx)("input",{type:"text",value:m.title,onChange:e=>h({...m,title:e.target.value}),className:"input",style:{fontSize:"1.5rem",fontWeight:700,width:"100%",marginBottom:"0.5rem"}}):(0,r.jsx)("h1",{className:"page-title",children:m.title}),(0,r.jsxs)("p",{className:"page-subtitle",children:["Risk Assessment • Category: ",a?(0,r.jsx)("input",{type:"text",value:m.category,onChange:e=>h({...m,category:e.target.value}),className:"input",style:{width:"200px",display:"inline-block"}}):m.category," • GAMP Category ",e.gamp_category]})]}),u&&!a&&(0,r.jsx)("div",{className:"card",style:{marginBottom:"1.5rem",background:"rgba(239, 68, 68, 0.1)",borderLeft:"4px solid var(--error)"},children:(0,r.jsxs)("p",{style:{margin:0,color:"var(--error)"},children:["⚠️ This Risk was auto-created from FS references. Click ",(0,r.jsx)("strong",{children:"Edit"})," to define its details."]})}),(0,r.jsx)("div",{className:"card",style:{marginBottom:"1.5rem"},children:(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"1rem"},children:[(0,r.jsx)(o,{label:"Impact",value:m.impact,isEditing:a,onChange:e=>h({...m,impact:e}),options:["low","medium","high","critical"]}),(0,r.jsx)(o,{label:"Probability",value:m.probability,isEditing:a,onChange:e=>h({...m,probability:e}),options:["low","medium","high"]}),(0,r.jsx)(o,{label:"Risk Level",value:m.risk_level,isEditing:a,onChange:e=>h({...m,risk_level:e}),options:["low","medium","high","critical"]}),(0,r.jsx)(o,{label:"Residual Risk",value:m.residual_risk,isEditing:a,onChange:e=>h({...m,residual_risk:e}),options:["acceptable","unacceptable","pending"]})]})}),(0,r.jsxs)("div",{className:"card",style:{marginBottom:"1.5rem"},children:[(0,r.jsx)("h2",{className:"card-title",children:"⚙️ Linked Functional Specifications"}),(0,r.jsx)("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap"},children:t.map(e=>(0,r.jsx)(l(),{href:`/specs/${e.id}`,children:(0,r.jsxs)("span",{className:"badge",style:{background:"rgba(245, 158, 11, 0.15)",color:"var(--warning)",padding:"0.5rem 1rem"},children:[e.id," - ",e.title]})},e.id))})]}),(0,r.jsxs)("div",{className:"card",style:{marginBottom:"1.5rem"},children:[(0,r.jsx)("h2",{className:"card-title",children:"\uD83D\uDD34 Identified Risks"}),0===e.risks.length?(0,r.jsx)("p",{style:{color:"var(--text-secondary)",fontStyle:"italic"},children:"No risks defined yet"}):(0,r.jsx)("div",{style:{display:"grid",gap:"0.5rem"},children:e.risks.map((e,t)=>(0,r.jsxs)("div",{style:{padding:"0.75rem 1rem",background:"var(--bg-hover)",borderRadius:"6px",display:"flex",alignItems:"center",gap:"1rem"},children:[(0,r.jsx)("code",{style:{fontWeight:600,color:"#f97316"},children:e.id}),(0,r.jsx)("span",{style:{flex:1,color:"var(--text-secondary)"},children:e.description}),(0,r.jsx)(p,{level:e.impact,small:!0})]},t))})]}),(0,r.jsxs)("div",{className:"card",children:[(0,r.jsx)("h2",{className:"card-title",children:"\uD83D\uDEE1️ Mitigations"}),0===e.mitigations.length?(0,r.jsx)("p",{style:{color:"var(--text-secondary)",fontStyle:"italic"},children:"No mitigations defined yet"}):(0,r.jsxs)("table",{className:"table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Risk"}),(0,r.jsx)("th",{children:"Control"}),(0,r.jsx)("th",{children:"Test"})]})}),(0,r.jsx)("tbody",{children:e.mitigations.map((e,t)=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("code",{children:e.risk_id})}),(0,r.jsx)("td",{children:e.control}),(0,r.jsx)("td",{style:{color:"var(--text-secondary)"},children:e.test})]},t))})]})]})]})}function o({label:e,value:t,isEditing:a,onChange:i,options:s}){let l=m(t);return(0,r.jsxs)("div",{style:{textAlign:"center",padding:"1rem",background:"var(--bg-hover)",borderRadius:"8px"},children:[(0,r.jsx)("div",{style:{fontSize:"0.75rem",color:"var(--text-secondary)",marginBottom:"0.25rem"},children:e}),a?(0,r.jsx)("select",{value:t,onChange:e=>i(e.target.value),className:"input",style:{width:"100%",textAlign:"center"},children:s.map(e=>(0,r.jsx)("option",{value:e,style:{textTransform:"capitalize"},children:e},e))}):(0,r.jsx)("div",{style:{fontSize:"1.25rem",fontWeight:700,color:l,textTransform:"capitalize"},children:t})]})}function p({level:e,small:t}){let a=m(e);return(0,r.jsx)("span",{className:"badge",style:{background:`${a}20`,color:a,padding:t?"0.25rem 0.5rem":"0.5rem 1rem",fontSize:t?"0.75rem":"0.875rem",textTransform:"capitalize"},children:e})}function m(e){switch(e){case"critical":case"unacceptable":return"#dc2626";case"high":return"#f97316";case"medium":case"pending":return"#eab308";case"low":case"acceptable":return"#22c55e";default:return"var(--text-secondary)"}}},6161:(e,t,a)=>{"use strict";a.d(t,{URSDetailClient:()=>d});var r=a(5155),i=a(2115),s=a(8500),l=a.n(s),n=a(9339);let c=(0,n.createServerReference)("60e0719d8381c7cf2a369b814653fb6e2b5ef7f3c2",n.callServer,void 0,n.findSourceMapURL,"updateURSAction");function d({urs:e,linkedFS:t,linkedRisks:a}){let[s,n]=(0,i.useState)(!1),[d,p]=(0,i.useTransition)(),[m,h]=(0,i.useState)({title:e.title,status:e.status,priority:e.priority,owner:e.owner,category:e.category,business_need:e.business_need,intended_use:e.intended_use,acceptance_criteria:e.acceptance_criteria}),u=e.title.includes("(Undefined)"),g=({value:e,onChange:t,multiline:a,placeholder:i})=>s?a?(0,r.jsx)("textarea",{value:e,onChange:e=>t(e.target.value),rows:4,className:"input",style:{width:"100%",resize:"vertical"}}):(0,r.jsx)("input",{type:"text",value:e,onChange:e=>t(e.target.value),className:"input",style:{width:"100%"}}):(0,r.jsx)("span",{style:{whiteSpace:"pre-wrap",color:"var(--text-secondary)",fontStyle:e?"normal":"italic"},children:e||i||"Not defined"}),x=({value:e,onChange:t,options:a})=>s?(0,r.jsx)("select",{value:e,onChange:e=>t(e.target.value),className:"input",children:a.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}):(0,r.jsx)("span",{style:{textTransform:"capitalize"},children:e});return(0,r.jsxs)("div",{children:[(0,r.jsxs)("header",{className:"page-header",children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1rem",marginBottom:"0.5rem",flexWrap:"wrap"},children:[(0,r.jsx)("code",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--success)",background:"rgba(16, 185, 129, 0.1)",padding:"0.5rem 1rem",borderRadius:"8px"},children:e.id}),s?(0,r.jsx)(x,{value:m.status,onChange:e=>h({...m,status:e}),options:[{value:"draft",label:"Draft"},{value:"review",label:"Review"},{value:"approved",label:"Approved"}]}):(0,r.jsx)("span",{className:`badge ${"approved"===e.status?"badge-success":"badge-warning"}`,children:m.status}),s?(0,r.jsx)(x,{value:m.priority,onChange:e=>h({...m,priority:e}),options:[{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}]}):(0,r.jsx)("span",{className:"badge",style:{background:"var(--bg-hover)"},children:m.priority}),u&&!s&&(0,r.jsx)("span",{className:"badge",style:{background:"rgba(239, 68, 68, 0.2)",color:"var(--error)"},children:"Needs Definition"}),(0,r.jsx)("div",{style:{marginLeft:"auto",display:"flex",gap:"0.5rem"},children:s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>{h({title:e.title,status:e.status,priority:e.priority,owner:e.owner,category:e.category,business_need:e.business_need,intended_use:e.intended_use,acceptance_criteria:e.acceptance_criteria}),n(!1)},className:"btn",disabled:d,children:"Cancel"}),(0,r.jsx)("button",{onClick:()=>{p(async()=>{await c(e.id,m),n(!1)})},className:"btn btn-primary",disabled:d,children:d?"Saving...":"\uD83D\uDCBE Save"})]}):(0,r.jsx)("button",{onClick:()=>n(!0),className:"btn btn-primary",children:"✏️ Edit"})})]}),s?(0,r.jsx)("input",{type:"text",value:m.title,onChange:e=>h({...m,title:e.target.value}),className:"input",style:{fontSize:"1.5rem",fontWeight:700,width:"100%",marginBottom:"0.5rem"}}):(0,r.jsx)("h1",{className:"page-title",children:m.title}),(0,r.jsxs)("p",{className:"page-subtitle",children:["User Requirement Specification • Owner: ",s?(0,r.jsx)("input",{type:"text",value:m.owner,onChange:e=>h({...m,owner:e.target.value}),className:"input",style:{width:"200px",display:"inline-block"}}):m.owner]})]}),u&&!s&&(0,r.jsx)("div",{className:"card",style:{marginBottom:"1.5rem",background:"rgba(239, 68, 68, 0.1)",borderLeft:"4px solid var(--error)"},children:(0,r.jsxs)("p",{style:{margin:0,color:"var(--error)"},children:["⚠️ This URS was auto-created from FS references. Click ",(0,r.jsx)("strong",{children:"Edit"})," to define its details."]})}),(0,r.jsxs)("div",{className:"card",style:{marginBottom:"1.5rem"},children:[(0,r.jsx)("h2",{className:"card-title",children:"\uD83D\uDD17 Traceability"}),(0,r.jsxs)("div",{style:{display:"flex",gap:"2rem",flexWrap:"wrap"},children:[(0,r.jsx)(o,{label:"Functional Specs",count:t.length,color:"var(--warning)"}),(0,r.jsx)(o,{label:"Test Scenarios",count:t.reduce((e,t)=>e+t.scenarios.length,0),color:"var(--accent)"}),(0,r.jsx)(o,{label:"Risk Assessments",count:a.length,color:"#f97316"})]})]}),(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"1.5rem"},children:[(0,r.jsxs)("div",{className:"card",children:[(0,r.jsx)("h2",{className:"card-title",children:"\uD83D\uDCCB Business Need"}),(0,r.jsx)("div",{style:{lineHeight:1.7},children:(0,r.jsx)(g,{value:m.business_need,onChange:e=>h({...m,business_need:e}),multiline:!0,placeholder:"Not defined"})})]}),(0,r.jsxs)("div",{className:"card",children:[(0,r.jsx)("h2",{className:"card-title",children:"\uD83C\uDFAF Intended Use"}),(0,r.jsx)("div",{style:{lineHeight:1.7},children:(0,r.jsx)(g,{value:m.intended_use,onChange:e=>h({...m,intended_use:e}),multiline:!0,placeholder:"Not defined"})})]})]}),(0,r.jsxs)("div",{className:"card",style:{marginTop:"1.5rem"},children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1rem"},children:[(0,r.jsx)("h2",{className:"card-title",style:{margin:0},children:"✅ Acceptance Criteria"}),s&&(0,r.jsx)("button",{onClick:()=>h({...m,acceptance_criteria:[...m.acceptance_criteria,""]}),className:"btn",style:{padding:"0.25rem 0.75rem"},children:"+ Add"})]}),0===m.acceptance_criteria.length?(0,r.jsx)("p",{style:{color:"var(--text-secondary)",fontStyle:"italic"},children:"No acceptance criteria defined"}):s?(0,r.jsx)("div",{style:{display:"grid",gap:"0.5rem"},children:m.acceptance_criteria.map((e,t)=>(0,r.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,r.jsx)("input",{type:"text",value:e,onChange:e=>{let a=[...m.acceptance_criteria];a[t]=e.target.value,h({...m,acceptance_criteria:a})},className:"input",style:{flex:1},placeholder:`Criterion ${t+1}`}),(0,r.jsx)("button",{onClick:()=>h({...m,acceptance_criteria:m.acceptance_criteria.filter((e,a)=>a!==t)}),className:"btn",style:{padding:"0.5rem"},children:"\xd7"})]},t))}):(0,r.jsx)("ul",{style:{margin:0,paddingLeft:"1.5rem"},children:m.acceptance_criteria.map((e,t)=>(0,r.jsx)("li",{style:{marginBottom:"0.5rem",color:"var(--text-secondary)"},children:e},t))})]}),(0,r.jsxs)("div",{className:"card",style:{marginTop:"1.5rem"},children:[(0,r.jsx)("h2",{className:"card-title",children:"⚙️ Linked Functional Specifications"}),0===t.length?(0,r.jsx)("p",{style:{color:"var(--text-secondary)"},children:"No FS linked yet"}):(0,r.jsx)("div",{style:{display:"grid",gap:"1rem"},children:t.map(e=>(0,r.jsx)(l(),{href:`/specs/${e.id}`,style:{textDecoration:"none"},children:(0,r.jsx)("div",{style:{padding:"1rem",background:"var(--bg-hover)",borderRadius:"8px",borderLeft:"4px solid var(--warning)"},children:(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[(0,r.jsx)("code",{style:{fontWeight:600,color:"var(--warning)"},children:e.id}),(0,r.jsx)("span",{style:{color:"var(--text-primary)"},children:e.title}),(0,r.jsxs)("span",{className:"badge badge-success",style:{marginLeft:"auto"},children:[e.scenario_count," tests"]})]})})},e.id))})]})]})}function o({label:e,count:t,color:a}){return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:{fontSize:"0.75rem",color:"var(--text-secondary)",marginBottom:"0.25rem"},children:e}),(0,r.jsx)("div",{style:{fontSize:"1.5rem",fontWeight:700,color:a},children:t})]})}},6164:(e,t,a)=>{Promise.resolve().then(a.t.bind(a,8500,23)),Promise.resolve().then(a.bind(a,4839)),Promise.resolve().then(a.bind(a,8169)),Promise.resolve().then(a.bind(a,6161))},8169:(e,t,a)=>{"use strict";a.d(t,{ScenarioList:()=>l});var r=a(5155),i=a(2115);function s({scenario:e,isHighlighted:t}){return(0,r.jsxs)("div",{style:{padding:"1rem",background:t?"rgba(96, 165, 250, 0.1)":"var(--bg-hover)",borderRadius:"8px",border:t?"2px solid var(--accent)":"1px solid var(--border)"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"0.75rem"},children:[(0,r.jsx)("span",{style:{color:"var(--accent)"},children:"\uD83E\uDDEA"}),(0,r.jsx)("span",{style:{fontWeight:600},children:e.name}),e.tags.length>0&&(0,r.jsx)("span",{style:{marginLeft:"auto",fontSize:"0.75rem",color:"var(--text-secondary)"},children:e.tags.join(" ")})]}),(0,r.jsx)("div",{style:{fontFamily:"monospace",fontSize:"0.8125rem",lineHeight:1.6},children:e.steps.map((e,t)=>{var a;return(0,r.jsx)("div",{style:{color:(a=e).startsWith("Given")?"#a78bfa":a.startsWith("When")?"#60a5fa":a.startsWith("Then")?"#34d399":"var(--text-secondary)"},children:e},t)})})]})}function l({scenarios:e,highlightScenario:t}){let a=(0,i.useRef)(null);return(0,i.useEffect)(()=>{t&&a.current&&setTimeout(()=>{a.current?.scrollIntoView({behavior:"smooth",block:"center"})},100)},[t]),(0,r.jsx)("div",{style:{display:"grid",gap:"0.75rem"},children:e.map((e,i)=>{let l=t===e.name;return(0,r.jsx)("div",{ref:l?a:void 0,children:(0,r.jsx)(s,{scenario:e,isHighlighted:l})},i)})})}a(8500)},9339:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={callServer:function(){return s.callServer},createServerReference:function(){return n.createServerReference},findSourceMapURL:function(){return l.findSourceMapURL}};for(var i in r)Object.defineProperty(t,i,{enumerable:!0,get:r[i]});let s=a(7304),l=a(4060),n=a(7197)}},e=>{e.O(0,[500,441,794,358],()=>e(e.s=6164)),_N_E=e.O()}]);
|