@codeyam/codeyam-cli 0.1.0-staging.ae0de75 → 0.1.0-staging.b8f4f94
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/analyzer-template/.build-info.json +7 -7
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +3 -3
- package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +13 -7
- package/analyzer-template/packages/analyze/src/lib/asts/index.ts +7 -2
- package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js +196 -0
- package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js.map +1 -0
- package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js +114 -0
- package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js.map +1 -0
- package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js +149 -0
- package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js.map +1 -0
- package/codeyam-cli/src/commands/default.js +3 -46
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/editor.js +254 -66
- package/codeyam-cli/src/commands/editor.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +234 -0
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +12 -1
- package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +29 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +1217 -0
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -0
- package/codeyam-cli/src/utils/backgroundServer.js +2 -2
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/editorAudit.js +45 -5
- package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
- package/codeyam-cli/src/utils/editorJournal.js +7 -0
- package/codeyam-cli/src/utils/editorJournal.js.map +1 -1
- package/codeyam-cli/src/utils/entityChangeStatus.js +255 -0
- package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -0
- package/codeyam-cli/src/utils/install-skills.js +1 -1
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +5 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/Terminal-nZNBALox.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-diff-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor-DTwKl1Xu.js +10 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.dev-D8ILZMR0.js → entity._sha.scenarios._scenarioId.dev-DjACbfdI.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-CdN8sCqs.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-h1-1oFYI.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/index-yHOVb4rc.js +15 -0
- package/codeyam-cli/src/webserver/build/client/assets/manifest-9422aeab.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{memory-FweZHj5U.js → memory-Dg0mvYrI.js} +4 -1
- package/codeyam-cli/src/webserver/build/client/assets/{root-DUKqhFlb.js → root-BzQgN2ff.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{index-BLhjL9Xi.js → index-Bh_pNxNA.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-Bqr22tlO.js +367 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/src/webserver/server.js +32 -6
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/src/webserver/terminalServer.js +23 -4
- package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
- package/codeyam-cli/templates/editor-step-hook.py +53 -6
- package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +10 -5
- package/codeyam-cli/templates/skills/codeyam-memory/SKILL.md +10 -10
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs +139 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +52 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/read-json-field.mjs +61 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +155 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.mjs +13 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +95 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +160 -0
- package/package.json +10 -10
- package/packages/analyze/src/lib/ProjectAnalyzer.js +10 -4
- package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/index.js +4 -2
- package/packages/analyze/src/lib/asts/index.js.map +1 -1
- package/scripts/npm-post-install.cjs +22 -0
- package/codeyam-cli/src/webserver/build/client/assets/Terminal-wkqC0AQk.js +0 -41
- package/codeyam-cli/src/webserver/build/client/assets/editor-CdjF_fX6.js +0 -8
- package/codeyam-cli/src/webserver/build/client/assets/git-CFCTYk9I.js +0 -15
- package/codeyam-cli/src/webserver/build/client/assets/globals-B17TBSS6.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-b8fd6b07.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-DyMuI5mU.js +0 -363
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.sh +0 -108
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.sh +0 -69
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.sh +0 -12
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter.jq +0 -45
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.sh +0 -139
package/codeyam-cli/src/webserver/build/client/assets/{memory-FweZHj5U.js → memory-Dg0mvYrI.js}
RENAMED
|
@@ -83,11 +83,14 @@ ${n}
|
|
|
83
83
|
Please review these rules in conjunction with one another as they all apply to this file.
|
|
84
84
|
|
|
85
85
|
Review each rule with the other rules in mind:
|
|
86
|
+
- Necessary: Is this rule really necessary to avoid confusion in future work sessions?
|
|
86
87
|
- Efficiency: Are the rules concise and well-structured?
|
|
87
88
|
- Effectiveness: Does the rules provide clear, actionable guidance?
|
|
88
89
|
- Context window impact: Can the rules be shortened without losing important information?
|
|
89
90
|
- Overlap: Is there any redundant information across the rules that can be consolidated?
|
|
90
91
|
- Duplication: Are there any rules that are nearly identical that can be merged or removed?
|
|
91
92
|
|
|
93
|
+
Remember that documenting past confusion isn't helpul unless that confusion will likely happen again.
|
|
94
|
+
|
|
92
95
|
Note: Each rule may apply to multiple files, not just the file listed above. Consider this when suggesting changes — modifications should not negatively impact the rule's usefulness for other files it covers.`}function Mh({filePath:e,rulePaths:t,onClose:n}){const[r,i]=I.useState(!1),o=Lh(e,t),l=()=>{navigator.clipboard.writeText(o),i(!0),setTimeout(()=>i(!1),2e3)};return s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:n,children:s.jsxs("div",{className:"bg-white rounded-lg p-8 max-w-xl w-full mx-4 relative",onClick:a=>a.stopPropagation(),children:[s.jsx("button",{onClick:n,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 cursor-pointer",children:s.jsx(tt,{className:"w-6 h-6"})}),s.jsx("h2",{className:"text-xl font-bold mb-1",children:"Audit Rules For File"}),s.jsx("p",{className:"font-mono text-sm text-gray-500 mb-4 truncate",title:e,children:e}),s.jsx("p",{className:"text-gray-600 text-sm mb-4",children:"Claude can audit these rules to try and make them as efficient and effective as possible, reducing the impact on the context window."}),s.jsx("textarea",{readOnly:!0,value:o,className:"w-full h-48 p-3 text-sm font-mono bg-gray-50 border border-gray-200 rounded-md resize-none focus:outline-none"}),s.jsx("div",{className:"flex justify-end mt-4",children:s.jsx("button",{onClick:l,className:"flex items-center gap-2 px-4 py-2 rounded-md hover:opacity-90 cursor-pointer font-mono uppercase text-xs font-semibold text-white",style:{backgroundColor:"#1A2332"},children:r?s.jsxs(s.Fragment,{children:[s.jsx(Oe,{className:"w-4 h-4"}),"Copied!"]}):s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"w-4 h-4"}),"Copy Prompt"]})})})]})})}function zh({refreshKey:e,reviewedStatus:t,memories:n,onViewRule:r}){const[i,o]=I.useState("unreviewed"),[l,a]=I.useState(null),[c,u]=I.useState(""),[f,h]=I.useState(0),[d,p]=I.useState(!1),[m,k]=I.useState(null),[C,y]=I.useState(null),j=I.useRef(null),N=I.useRef(null),[A,P]=I.useState({topPaths:[],totalFilesWithCoverage:0,allSourceFiles:[]}),[b,R]=I.useState(!0);I.useEffect(()=>{(async()=>{R(!0);try{const B=await(await fetch("/api/memory?action=audit")).json();P({topPaths:B.topPaths||[],totalFilesWithCoverage:B.totalFilesWithCoverage||0,allSourceFiles:B.allSourceFiles||[]})}catch(M){console.error("Failed to load audit data:",M)}finally{R(!1)}})()},[e]);const _=I.useMemo(()=>i==="all"?A.topPaths:A.topPaths.filter(v=>v.matchingRules.some(M=>!t[M.filePath])),[A.topPaths,i,t]);I.useMemo(()=>A.topPaths.filter(v=>v.matchingRules.some(M=>!t[M.filePath])).length,[A.topPaths,t]);const q=v=>v.split("/").pop()||v,w=I.useMemo(()=>{const v=new Map;for(const M of A.topPaths)v.set(M.filePath,M);return v},[A.topPaths]),F=I.useMemo(()=>{if(!c.trim())return[];const v=c.toLowerCase(),M=[],B=[];for(const K of A.allSourceFiles){const X=K.toLowerCase();if(!X.includes(v))continue;const g=w.get(K)||{filePath:K,matchingRules:[],totalTextLength:0};X.startsWith(v)?M.push(g):B.push(g)}return M.sort((K,X)=>K.filePath.localeCompare(X.filePath)),B.sort((K,X)=>K.filePath.localeCompare(X.filePath)),[...M,...B].slice(0,8)},[c,A.allSourceFiles,w]),D=I.useCallback(v=>{var M;k(v),a(v.filePath),u(v.filePath),p(!1),(M=j.current)==null||M.blur()},[]),Y=I.useCallback(()=>{var v;u(""),k(null),a(null),(v=j.current)==null||v.focus()},[]),L=I.useCallback(v=>{var M;!d||F.length===0||(v.key==="ArrowDown"?(v.preventDefault(),h(B=>Math.min(B+1,F.length-1))):v.key==="ArrowUp"?(v.preventDefault(),h(B=>Math.max(B-1,0))):v.key==="Enter"?(v.preventDefault(),D(F[f])):v.key==="Escape"&&(p(!1),(M=j.current)==null||M.blur()))},[d,F,f,D]);return I.useEffect(()=>{h(0)},[F]),s.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 flex flex-col",children:[s.jsxs("div",{className:"flex items-center gap-4 border-b border-[#e1e1e1] px-5",children:[s.jsx("button",{className:"py-3 border-b-2 border-[#232323] text-[#232323] bg-transparent cursor-pointer",children:s.jsx("span",{className:"text-[14px] leading-6",style:{fontFamily:"Sora",fontWeight:600},children:"Rule Audit"})}),s.jsxs("div",{className:"relative flex-1 max-w-[300px]",children:[s.jsx(kr,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400"}),s.jsx("input",{ref:j,type:"text",value:c,onChange:v=>{u(v.target.value),p(!0)},onFocus:()=>{c.trim()&&p(!0)},onBlur:()=>{setTimeout(()=>p(!1),200)},onKeyDown:L,placeholder:"Search files...",className:`w-full pl-8 ${c?"pr-7":"pr-3"} py-1 text-xs border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-[#005C75] focus:border-[#005C75] bg-gray-50`}),c&&s.jsx("button",{type:"button",onMouseDown:v=>{v.preventDefault(),Y()},className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 flex items-center justify-center text-gray-400 hover:text-gray-600 cursor-pointer",children:s.jsx("svg",{viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"w-3 h-3",children:s.jsx("path",{d:"M1 1l12 12M13 1L1 13"})})}),d&&F.length>0&&s.jsx("div",{ref:N,className:"absolute left-0 top-full mt-0.5 bg-white border border-gray-200 rounded-md shadow-lg z-10 max-h-75 overflow-y-auto min-w-75 max-w-120",children:F.map((v,M)=>s.jsxs("div",{onMouseDown:B=>{B.preventDefault(),D(v)},onMouseEnter:()=>h(M),className:`flex items-center gap-2 px-3 py-2 cursor-pointer text-sm ${M===f?"bg-[#f0f9ff]":"hover:bg-gray-50"}`,children:[s.jsx(Ot,{className:"w-3.5 h-3.5 text-gray-400 flex-shrink-0"}),s.jsx("span",{className:"text-gray-700 truncate",title:v.filePath,children:(()=>{const B=v.filePath.toLowerCase().indexOf(c.toLowerCase());if(B===-1)return v.filePath;const K=v.filePath.slice(0,B),X=v.filePath.slice(B,B+c.length),g=v.filePath.slice(B+c.length);return s.jsxs(s.Fragment,{children:[K,s.jsx("span",{className:"font-semibold text-[#005C75]",children:X}),g]})})()}),s.jsxs("span",{className:"text-xs text-gray-400 ml-auto flex-shrink-0",children:[v.matchingRules.length," rule",v.matchingRules.length!==1?"s":""]})]},v.filePath))})]}),s.jsx("div",{className:"flex-1"}),s.jsxs("button",{onClick:()=>o("unreviewed"),className:"flex items-center gap-1.5 bg-transparent cursor-pointer py-3",children:[s.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:i==="unreviewed"?"#005C75":"#d1d5db"}}),s.jsx("span",{className:"text-[12px] leading-5",style:{fontFamily:"Sora",fontWeight:i==="unreviewed"?600:400,color:i==="unreviewed"?"#005C75":"#626262"},children:"Unreviewed Rules"})]}),s.jsxs("button",{onClick:()=>o("all"),className:"flex items-center gap-1.5 bg-transparent cursor-pointer py-3",children:[s.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:i==="all"?"#005C75":"#d1d5db"}}),s.jsx("span",{className:"text-[12px] leading-5",style:{fontFamily:"Sora",fontWeight:i==="all"?600:400,color:i==="all"?"#005C75":"#626262"},children:"All"})]})]}),s.jsxs("div",{className:"grid grid-cols-[1fr_140px_150px] px-5 py-2 border-b border-gray-100",children:[s.jsx("span",{className:"text-[11px] uppercase tracking-wider text-gray-400 font-medium",children:"Source file"}),s.jsxs("span",{className:"text-[11px] uppercase tracking-wider text-gray-400 font-medium flex items-center justify-center gap-1 whitespace-nowrap",children:["Unreviewed Rules",s.jsxs("span",{className:"relative group",children:[s.jsx(Bt,{className:"w-3 h-3 text-gray-300 flex-shrink-0 cursor-help"}),s.jsx("span",{className:"absolute top-full left-1/2 -translate-x-1/2 mt-1.5 px-3 py-2 bg-gray-800 text-white text-[10px] leading-relaxed rounded shadow-lg w-48 text-center whitespace-normal opacity-0 pointer-events-none group-hover:opacity-100 transition-opacity z-20",children:"Number of rules not yet reviewed for this file / Total number of rules that apply to this file"})]})]}),s.jsxs("span",{className:"text-[11px] uppercase tracking-wider text-gray-400 font-medium flex items-center justify-center gap-1 whitespace-nowrap",children:["Unreviewed Tokens",s.jsxs("span",{className:"relative group",children:[s.jsx(Bt,{className:"w-3 h-3 text-gray-300 flex-shrink-0 cursor-help"}),s.jsx("span",{className:"absolute top-full right-0 mt-1.5 px-3 py-2 bg-gray-800 text-white text-[10px] leading-relaxed rounded shadow-lg w-52 text-center whitespace-normal opacity-0 pointer-events-none group-hover:opacity-100 transition-opacity z-20",children:"Estimated tokens from unreviewed rules / Total number of tokens from all rules that apply to this file"})]})]})]}),b&&s.jsx("div",{className:"px-5 py-6",children:s.jsxs("div",{className:"animate-pulse space-y-3",children:[s.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4"}),s.jsx("div",{className:"h-3 bg-gray-100 rounded w-1/2"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-2/3 mt-4"})]})}),!b&&(_.length>0||m)&&s.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:(m?[m,..._.filter(M=>M.filePath!==m.filePath)].slice(0,8):_.slice(0,8)).map((v,M)=>{const B=v.matchingRules.length,K=v.matchingRules.filter(G=>!t[G.filePath]),X=K.length,g=K.reduce((G,re)=>G+re.bodyLength,0),le=X>0,se=l===v.filePath,x=(m==null?void 0:m.filePath)===v.filePath;return s.jsxs("div",{children:[s.jsxs("div",{onClick:()=>a(se?null:v.filePath),className:`grid grid-cols-[1fr_140px_150px] px-5 py-2.5 items-center border-b border-gray-50 cursor-pointer ${x?"bg-[#f0f9ff] hover:bg-[#e0f2fe]":"hover:bg-gray-50"}`,children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[se?s.jsx(_t,{className:"w-3.5 h-3.5 text-gray-400 flex-shrink-0"}):s.jsx(Jt,{className:"w-3.5 h-3.5 text-gray-400 flex-shrink-0"}),s.jsx(Ot,{className:"w-3.5 h-3.5 text-gray-400 flex-shrink-0"}),s.jsx("span",{className:"text-sm text-gray-900 truncate",title:v.filePath,children:x?v.filePath:q(v.filePath)})]}),s.jsxs("span",{className:"text-sm text-center",children:[s.jsx("span",{className:le?"font-semibold text-[#1A5276]":"text-gray-400",children:X}),s.jsx("span",{className:"text-gray-300",children:" / "}),s.jsx("span",{className:"text-gray-500",children:B})]}),s.jsxs("span",{className:"text-sm text-center",children:[s.jsx("span",{className:le?"font-semibold text-[#1A5276]":"text-gray-400",children:Je(g).toLocaleString()}),s.jsx("span",{className:"text-gray-300",children:" / "}),s.jsx("span",{className:"text-gray-500",children:Je(v.totalTextLength).toLocaleString()})]})]}),se&&s.jsxs("div",{className:"bg-gray-50 border-b border-gray-100",children:[v.matchingRules.map(G=>{const re=n.find(z=>z.filePath===G.filePath),ne=t[G.filePath]??!1;return s.jsxs("div",{onClick:z=>{z.stopPropagation(),re&&r(re)},className:"flex items-center gap-2 px-5 pl-12 py-2 hover:bg-gray-100 cursor-pointer",children:[s.jsx(qi,{className:"w-3.5 h-3.5 text-gray-400 flex-shrink-0"}),s.jsx("span",{className:"text-sm text-gray-700 truncate flex-1",children:re?kt(re.body,re.filePath):G.filePath}),s.jsxs("span",{className:"text-xs text-gray-400 flex-shrink-0",children:[Je(G.bodyLength).toLocaleString()," ","tokens"]}),s.jsx("div",{className:`w-4 h-4 rounded-full border-2 flex items-center justify-center flex-shrink-0 ${ne?"bg-[#005C75] border-[#005C75]":"bg-white border-gray-300"}`,children:ne&&s.jsx("svg",{width:"8",height:"6",viewBox:"0 0 10 8",fill:"none",children:s.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},G.filePath)}),s.jsxs("div",{className:"flex items-center justify-center gap-3 px-5 py-2 border-t border-gray-200",children:[s.jsx("span",{className:"text-xs text-gray-400",children:"Have Claude audit these rules"}),s.jsx("button",{onClick:G=>{G.stopPropagation(),y({filePath:v.filePath,rulePaths:v.matchingRules.map(re=>re.filePath)})},className:"px-3 py-1 text-xs font-medium text-[#005C75] border border-[#005C75] rounded hover:bg-[#f0f9ff] cursor-pointer",children:"Prompt"})]})]})]},v.filePath)})}),!b&&_.length===0&&s.jsx("div",{className:"px-5 py-8 text-center text-sm text-gray-500",children:i==="unreviewed"?"No files have unreviewed rules":"No files have rule coverage yet"}),C&&s.jsx(Mh,{filePath:C.filePath,rulePaths:C.rulePaths,onClose:()=>y(null)})]})}function _h({rule:e,changeInfo:t,isReviewed:n,onApprove:r,onEdit:i,onDelete:o,onClose:l}){const a=kt(e.body,e.filePath),c=Je(e.body.length),u=e.frontmatter.category,f=`.claude/rules/${e.filePath}`,[h,d]=I.useState(null),p=(t==null?void 0:t.changeType)==="added"||h!=null&&h.commitCount!=null&&h.commitCount<=1&&!(h.commitCount===1&&h.isUncommitted);return I.useEffect(()=>{d(null),fetch(`/api/memory?action=rule-diff&filePath=${encodeURIComponent(e.filePath)}`).then(m=>m.json()).then(m=>{m.diff&&d(m.diff)}).catch(()=>{})},[e.filePath]),I.useEffect(()=>{const m=k=>{k.key==="Escape"&&l()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[l]),s.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[9999] p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.8)"},onClick:l,children:s.jsxs("div",{className:"rounded-lg shadow-xl max-w-4xl w-full max-h-[90vh] overflow-auto",style:{backgroundColor:"#F8F7F6"},onClick:m=>m.stopPropagation(),children:[s.jsx("div",{className:"px-6 pt-5 pb-4",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1.5 flex-wrap",children:[s.jsx("h2",{className:"text-[16px] font-bold text-gray-900",children:a}),t&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-xs text-gray-400 flex-shrink-0",children:Me(t.date)}),s.jsx("span",{className:`flex-shrink-0 text-[11px] uppercase font-semibold tracking-wider ${t.changeType==="added"?"text-green-600":t.changeType==="modified"?"text-orange-600":"text-red-600"}`,children:t.changeType})]})]}),u&&s.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[s.jsx("span",{className:"text-[11px] text-gray-400 uppercase tracking-wider font-medium",children:"TYPE:"}),s.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] uppercase font-semibold tracking-wider bg-[#E0F2F1] text-[#00796B]",children:u})]}),s.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[s.jsx("span",{className:"text-[11px] text-gray-400 uppercase tracking-wider font-medium",children:"FILE:"}),s.jsx("code",{className:"text-[11px] text-gray-600 font-mono",children:f}),s.jsx(br,{content:f,icon:!0,iconSize:12,className:"p-0.5 rounded text-gray-400 hover:text-gray-600 transition-colors",ariaLabel:"Copy file path"})]}),s.jsxs("div",{className:"text-[11px] text-gray-400 uppercase tracking-wider font-medium",children:["TOKENS: ~",c.toLocaleString()]})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 ml-4",children:[s.jsxs("button",{onClick:r,className:`flex items-center gap-1.5 px-3 py-1.5 rounded text-xs font-medium uppercase tracking-wider cursor-pointer transition-colors ${n?"bg-green-600 text-white":"border border-green-600 text-green-700 hover:bg-green-50"}`,children:[s.jsx(Oe,{className:"w-3.5 h-3.5"}),n?"Approved":"Approve"]}),s.jsx("button",{onClick:i,className:"px-3 py-1.5 rounded text-xs font-medium uppercase tracking-wider cursor-pointer border border-gray-300 text-gray-600 hover:bg-gray-50 transition-colors",children:"Edit"}),s.jsx("button",{onClick:o,className:"px-3 py-1.5 rounded text-xs font-medium uppercase tracking-wider cursor-pointer border border-red-300 text-red-600 hover:bg-red-50 transition-colors",children:"Delete"}),s.jsx("button",{onClick:l,className:"p-1.5 rounded text-gray-400 hover:text-gray-600 hover:bg-gray-200 cursor-pointer transition-colors ml-1",children:s.jsx(tt,{className:"w-5 h-5"})})]})]})}),e.frontmatter.paths&&e.frontmatter.paths.length>0&&s.jsxs("div",{className:"px-6 pb-4",children:[s.jsx("div",{className:"text-[13px] text-gray-700 font-semibold mb-2",children:"Applies to paths:"}),s.jsx("div",{className:"bg-white rounded-lg p-4 space-y-2.5",style:{border:"1px solid #E6E6E6"},children:e.frontmatter.paths.map((m,k)=>{const C=m.split("/"),y=C.pop()||m,j=C.length>0?C.join("/")+"/":"";return s.jsxs("div",{className:"flex items-center gap-2 text-[13px] font-mono",children:[s.jsx(Ot,{className:"w-4 h-4 text-[#005C75] flex-shrink-0"}),s.jsxs("span",{children:[j&&s.jsx("span",{className:"text-gray-500",children:j}),s.jsx("span",{className:"font-bold text-gray-900",children:y})]})]},k)})})]}),p?s.jsx("div",{className:"px-6 pb-4",children:s.jsxs("div",{className:"text-[13px] text-gray-500",children:["Created"," ",t!=null&&t.date?Me(t.date):h!=null&&h.date?Me(h.date):"recently"]})}):h&&s.jsx("div",{className:"px-6 pb-4",children:s.jsxs("details",{children:[s.jsxs("summary",{className:"text-[13px] text-gray-700 font-semibold cursor-pointer",children:["Recent change: ",h.commitMessage," —"," ",Me(h.date)]}),s.jsx("pre",{className:"mt-2 p-4 text-xs font-mono overflow-x-auto bg-gray-900 text-gray-100 max-h-64 overflow-y-auto rounded-md",children:h.diff.split(`
|
|
93
|
-
`).map((m,k)=>{let C="";return m.startsWith("+")&&!m.startsWith("+++")?C="text-green-400":m.startsWith("-")&&!m.startsWith("---")?C="text-red-400":m.startsWith("@@")&&(C="text-cyan-400"),s.jsx("div",{className:C,children:m},k)})})]})}),s.jsxs("div",{className:"px-6 pb-6",children:[s.jsx("div",{className:"text-[13px] text-gray-700 font-semibold mb-2",children:"Rule Text:"}),s.jsx("div",{className:"bg-white rounded-lg p-6",style:{border:"1px solid #E6E6E6"},children:s.jsx(Ni,{content:e.body})})]})]})})}function Oh(){return s.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 27 27",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("rect",{x:"12",y:"24",width:"3",height:"3",fill:"#232323"}),s.jsx("rect",{x:"12",width:"3",height:"3",fill:"#232323"}),s.jsx("rect",{x:"12",y:"3",width:"3",height:"3",fill:"#232323"}),s.jsx("rect",{x:"12",y:"6",width:"3",height:"3",fill:"#232323"}),s.jsx("rect",{x:"12",y:"18",width:"3",height:"3",fill:"#232323"}),s.jsx("rect",{x:"3",y:"12",width:"3",height:"3",transform:"rotate(90 3 12)",fill:"#232323"}),s.jsx("rect",{x:"27",y:"12",width:"3",height:"3",transform:"rotate(90 27 12)",fill:"#232323"}),s.jsx("rect",{x:"18",y:"24",width:"3",height:"3",transform:"rotate(90 18 24)",fill:"#232323"}),s.jsx("rect",{x:"18",width:"3",height:"3",transform:"rotate(90 18 0)",fill:"#232323"}),s.jsx("rect",{x:"3",y:"18",width:"3",height:"3",transform:"rotate(-180 3 18)",fill:"#232323"}),s.jsx("rect",{x:"27",y:"18",width:"3",height:"3",transform:"rotate(-180 27 18)",fill:"#232323"}),s.jsx("rect",{x:"21",y:"24",width:"3",height:"3",transform:"rotate(90 21 24)",fill:"#232323"}),s.jsx("rect",{x:"3",y:"21",width:"3",height:"3",transform:"rotate(-180 3 21)",fill:"#232323"}),s.jsx("rect",{x:"27",y:"21",width:"3",height:"3",transform:"rotate(-180 27 21)",fill:"#232323"}),s.jsx("rect",{x:"6",y:"24",width:"3",height:"3",transform:"rotate(90 6 24)",fill:"#232323"}),s.jsx("rect",{x:"6",width:"3",height:"3",transform:"rotate(90 6 0)",fill:"#232323"}),s.jsx("rect",{x:"3",y:"6",width:"3",height:"3",transform:"rotate(-180 3 6)",fill:"#232323"}),s.jsx("rect",{x:"21",y:"6",width:"3",height:"3",transform:"rotate(-180 21 6)",fill:"#232323"}),s.jsx("rect",{x:"24",y:"24",width:"3",height:"3",transform:"rotate(90 24 24)",fill:"#232323"}),s.jsx("rect",{x:"3",y:"24",width:"3",height:"3",transform:"rotate(-180 3 24)",fill:"#232323"}),s.jsx("rect",{x:"27",y:"24",width:"3",height:"3",transform:"rotate(-180 27 24)",fill:"#232323"}),s.jsx("rect",{x:"9",y:"24",width:"3",height:"3",transform:"rotate(90 9 24)",fill:"#232323"}),s.jsx("rect",{x:"9",width:"3",height:"3",transform:"rotate(90 9 0)",fill:"#232323"}),s.jsx("rect",{x:"9",y:"3",width:"3",height:"3",transform:"rotate(90 9 3)",fill:"#232323"}),s.jsx("rect",{x:"9",y:"6",width:"3",height:"3",transform:"rotate(90 9 6)",fill:"#232323"}),s.jsx("rect",{x:"9",y:"18",width:"3",height:"3",transform:"rotate(90 9 18)",fill:"#232323"}),s.jsx("rect",{x:"3",y:"9",width:"3",height:"3",transform:"rotate(-180 3 9)",fill:"#232323"}),s.jsx("rect",{x:"24",y:"9",width:"3",height:"3",transform:"rotate(-180 24 9)",fill:"#232323"}),s.jsx("rect",{x:"12",y:"24",width:"3",height:"3",transform:"rotate(90 12 24)",fill:"#232323"}),s.jsx("rect",{x:"12",width:"3",height:"3",transform:"rotate(90 12 0)",fill:"#232323"}),s.jsx("rect",{x:"12",y:"6",width:"3",height:"3",transform:"rotate(90 12 6)",fill:"#232323"}),s.jsx("rect",{x:"12",y:"18",width:"3",height:"3",transform:"rotate(90 12 18)",fill:"#232323"}),s.jsx("rect",{x:"3",y:"12",width:"3",height:"3",transform:"rotate(-180 3 12)",fill:"#232323"}),s.jsx("rect",{x:"27",y:"12",width:"3",height:"3",transform:"rotate(-180 27 12)",fill:"#232323"})]})}function Bh(){return s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 27 27",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("rect",{x:"12",y:"24",width:"3",height:"3",fill:"#005C75"}),s.jsx("rect",{x:"12",width:"3",height:"3",fill:"#005C75"}),s.jsx("rect",{x:"12",y:"3",width:"3",height:"3",fill:"#005C75"}),s.jsx("rect",{x:"12",y:"6",width:"3",height:"3",fill:"#005C75"}),s.jsx("rect",{x:"12",y:"18",width:"3",height:"3",fill:"#005C75"}),s.jsx("rect",{x:"3",y:"12",width:"3",height:"3",transform:"rotate(90 3 12)",fill:"#005C75"}),s.jsx("rect",{x:"27",y:"12",width:"3",height:"3",transform:"rotate(90 27 12)",fill:"#005C75"}),s.jsx("rect",{x:"18",y:"24",width:"3",height:"3",transform:"rotate(90 18 24)",fill:"#005C75"}),s.jsx("rect",{x:"18",width:"3",height:"3",transform:"rotate(90 18 0)",fill:"#005C75"}),s.jsx("rect",{x:"3",y:"18",width:"3",height:"3",transform:"rotate(-180 3 18)",fill:"#005C75"}),s.jsx("rect",{x:"27",y:"18",width:"3",height:"3",transform:"rotate(-180 27 18)",fill:"#005C75"}),s.jsx("rect",{x:"21",y:"24",width:"3",height:"3",transform:"rotate(90 21 24)",fill:"#005C75"}),s.jsx("rect",{x:"3",y:"21",width:"3",height:"3",transform:"rotate(-180 3 21)",fill:"#005C75"}),s.jsx("rect",{x:"27",y:"21",width:"3",height:"3",transform:"rotate(-180 27 21)",fill:"#005C75"}),s.jsx("rect",{x:"6",y:"24",width:"3",height:"3",transform:"rotate(90 6 24)",fill:"#005C75"}),s.jsx("rect",{x:"6",width:"3",height:"3",transform:"rotate(90 6 0)",fill:"#005C75"}),s.jsx("rect",{x:"3",y:"6",width:"3",height:"3",transform:"rotate(-180 3 6)",fill:"#005C75"}),s.jsx("rect",{x:"21",y:"6",width:"3",height:"3",transform:"rotate(-180 21 6)",fill:"#005C75"}),s.jsx("rect",{x:"24",y:"24",width:"3",height:"3",transform:"rotate(90 24 24)",fill:"#005C75"}),s.jsx("rect",{x:"3",y:"24",width:"3",height:"3",transform:"rotate(-180 3 24)",fill:"#005C75"}),s.jsx("rect",{x:"27",y:"24",width:"3",height:"3",transform:"rotate(-180 27 24)",fill:"#005C75"}),s.jsx("rect",{x:"9",y:"24",width:"3",height:"3",transform:"rotate(90 9 24)",fill:"#005C75"}),s.jsx("rect",{x:"9",width:"3",height:"3",transform:"rotate(90 9 0)",fill:"#005C75"}),s.jsx("rect",{x:"9",y:"3",width:"3",height:"3",transform:"rotate(90 9 3)",fill:"#005C75"}),s.jsx("rect",{x:"9",y:"6",width:"3",height:"3",transform:"rotate(90 9 6)",fill:"#005C75"}),s.jsx("rect",{x:"9",y:"18",width:"3",height:"3",transform:"rotate(90 9 18)",fill:"#005C75"}),s.jsx("rect",{x:"3",y:"9",width:"3",height:"3",transform:"rotate(-180 3 9)",fill:"#005C75"}),s.jsx("rect",{x:"24",y:"9",width:"3",height:"3",transform:"rotate(-180 24 9)",fill:"#005C75"}),s.jsx("rect",{x:"12",y:"24",width:"3",height:"3",transform:"rotate(90 12 24)",fill:"#005C75"}),s.jsx("rect",{x:"12",width:"3",height:"3",transform:"rotate(90 12 0)",fill:"#005C75"}),s.jsx("rect",{x:"12",y:"6",width:"3",height:"3",transform:"rotate(90 12 6)",fill:"#005C75"}),s.jsx("rect",{x:"12",y:"18",width:"3",height:"3",transform:"rotate(90 12 18)",fill:"#005C75"}),s.jsx("rect",{x:"3",y:"12",width:"3",height:"3",transform:"rotate(-180 3 12)",fill:"#005C75"}),s.jsx("rect",{x:"27",y:"12",width:"3",height:"3",transform:"rotate(-180 27 12)",fill:"#005C75"})]})}function $h(){return s.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:s.jsxs("div",{className:"px-6 sm:px-12 lg:px-20 py-8 lg:py-12 font-sans max-w-3xl mx-auto",children:[s.jsxs("div",{className:"text-center mb-10",children:[s.jsx("h1",{className:"text-[22px] font-semibold mb-4",style:{fontFamily:"Sora",color:"#232323"},children:"Get Started with CodeYam Memory"}),s.jsx("p",{className:"text-[15px] text-gray-500 leading-relaxed max-w-2xl mx-auto",children:"CodeYam Memory generates path-scoped Claude Rules that load automatically when Claude works on matching files. These rules capture any confusion, architectural decisions, and tribal knowledge from your as you work with Claude, ensuring sessions become more efficient and aligned with your codebase over time."})]}),s.jsxs("div",{className:"rounded-lg p-8 mb-6",style:{backgroundColor:"#EDF8FA",border:"1px solid #C8E6EC"},children:[s.jsx("h2",{className:"text-[18px] font-semibold mb-6",style:{fontFamily:"Sora",color:"#232323"},children:"Setup Steps"}),s.jsxs("ol",{className:"space-y-5",children:[s.jsxs("li",{className:"flex gap-3 items-start",children:[s.jsx("span",{className:"flex-shrink-0 w-7 h-7 rounded-md flex items-center justify-center text-sm font-semibold",style:{backgroundColor:"#005C75",color:"#fff"},children:"1"}),s.jsx("p",{className:"text-[14px] font-medium text-gray-900 pt-0.5",children:"Open Claude Code in your project terminal"})]}),s.jsxs("li",{className:"flex gap-3 items-start",children:[s.jsx("span",{className:"flex-shrink-0 w-7 h-7 rounded-md flex items-center justify-center text-sm font-semibold",style:{backgroundColor:"#005C75",color:"#fff"},children:"2"}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 pt-0.5",children:[s.jsx("span",{className:"text-[14px] font-medium text-gray-900",children:"Run"}),s.jsx(pr,{value:"/codeyam-memory"}),s.jsx("span",{className:"text-[14px] font-medium text-gray-900",children:"in the Claude Code session"})]}),s.jsx("p",{className:"text-[13px] text-gray-600 mt-1",children:"This kicks off analysis of your git history to find confusion patterns."})]})]}),s.jsxs("li",{className:"flex gap-3 items-start",children:[s.jsx("span",{className:"flex-shrink-0 w-7 h-7 rounded-md flex items-center justify-center text-sm font-semibold",style:{backgroundColor:"#005C75",color:"#fff"},children:"3"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[14px] font-medium text-gray-900 pt-0.5",children:"Return to this dashboard page to review the new rules"}),s.jsx("p",{className:"text-[13px] text-gray-600 mt-1",children:"You can review, edit, and approve the rules Claude creates."})]})]})]})]}),s.jsxs("div",{className:"rounded-lg p-8 mb-6",style:{backgroundColor:"#EDF8FA",border:"1px solid #C8E6EC"},children:[s.jsx("h2",{className:"text-[18px] font-semibold mb-6",style:{fontFamily:"Sora",color:"#232323"},children:"What Gets Created"}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute left-[15px] top-8 bottom-4",style:{borderLeft:"2px dotted #B0BEC5"}}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start gap-4 relative",children:[s.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded flex items-center justify-center",style:{backgroundColor:"#2C3E50"},children:s.jsx("div",{className:"w-3 h-3 rounded-sm bg-white/30"})}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-[14px] font-medium text-gray-900",children:[s.jsx("code",{className:"bg-gray-200/60 px-1.5 py-0.5 rounded text-[13px]",children:".claude/rules/*.md"}),s.jsx("span",{className:"text-gray-400 mx-1.5",children:"—"}),"path-scoped guidance files"]}),s.jsx("p",{className:"text-[13px] text-gray-500 mt-1",children:"Markdown files with frontmatter specifying which file paths they apply to."})]})]}),s.jsxs("div",{className:"flex items-start gap-4 relative",children:[s.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded flex items-center justify-center",style:{backgroundColor:"#2C3E50"},children:s.jsx("div",{className:"w-3 h-3 rounded-sm bg-white/30"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[14px] font-medium text-gray-900",children:"Rules load automatically when Claude works on matching files"}),s.jsx("p",{className:"text-[13px] text-gray-500 mt-1",children:"No manual steps needed — Claude picks up relevant rules based on the files it touches."})]})]}),s.jsxs("div",{className:"flex items-start gap-4 relative",children:[s.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded flex items-center justify-center",style:{backgroundColor:"#2C3E50"},children:s.jsx("div",{className:"w-3 h-3 rounded-sm bg-white/30"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[14px] font-medium text-gray-900",children:"Pre-commit hook to keep rules fresh and capture new patterns"}),s.jsx("p",{className:"text-[13px] text-gray-500 mt-1",children:"A git hook runs automatically to update rules when related code changes and looks for any new patterns of confusion in work sessions."})]})]})]})]})]}),s.jsxs("div",{className:"rounded-lg px-8 py-5 flex items-center justify-center gap-3",style:{backgroundColor:"#1A2332"},children:[s.jsx("span",{className:"text-white text-[15px] font-medium",children:"Run"}),s.jsx(pr,{value:"/codeyam-memory"}),s.jsx("span",{className:"text-white text-[15px] font-medium",children:"in Claude Code to get started"})]})]})})}function pr({value:e}){const[t,n]=I.useState(!1),r=()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)};return s.jsxs("button",{onClick:r,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-[13px] font-mono cursor-pointer border-0",style:{backgroundColor:"#2C3E50",color:"#E0E0E0"},title:"Copy to clipboard",children:[e,t?s.jsx(Oe,{className:"w-3.5 h-3.5 text-green-400"}):s.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-400",children:[s.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),s.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})]})}function ut({label:e,count:t,icon:n,bgColor:r,iconBgColor:i,textColor:o}){return s.jsx("div",{className:"rounded-lg p-4",style:{backgroundColor:r,border:"1px solid #EFEFEF"},children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center flex-shrink-0",style:{backgroundColor:i},children:n}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-[32px] font-semibold leading-none mb-1",style:{color:o},children:t}),s.jsx("div",{className:"text-[11px] uppercase tracking-wider font-medium",style:{color:o},children:e})]})]})})}function Hh({searchFilter:e,onSearchChange:t,onCreateNew:n,onLearnMore:r,reviewCounts:i}){return s.jsxs("div",{className:"mb-8",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 mb-6",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[s.jsx(Oh,{}),s.jsx("h1",{className:"text-[24px] font-semibold mb-0",style:{fontFamily:"Sora",color:"#232323"},children:"Memory"})]}),s.jsxs("p",{className:"text-[15px] text-gray-500",children:["Rules help Claude understand your codebase patterns and conventions."," ",s.jsx("button",{onClick:r,className:"text-[#005C75] underline cursor-pointer",children:"Learn more about rules."})]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(kr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),s.jsx("input",{type:"text",value:e,onChange:o=>t(o.target.value),placeholder:"Search rules...",className:"w-64 pl-10 pr-4 py-2 border border-gray-200 rounded-md bg-white focus:outline-none focus:ring-2 focus:ring-[#005C75] focus:border-transparent text-sm"})]}),s.jsxs("button",{onClick:n,className:"flex items-center gap-2 px-4 py-2 rounded-md hover:opacity-90 cursor-pointer font-mono uppercase text-xs font-semibold text-white",style:{backgroundColor:"#1A2332"},children:[s.jsx(Zt,{className:"w-4 h-4"}),"New Rule"]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[s.jsx(ut,{label:"Total Rules",count:i.total,icon:s.jsx(Bh,{}),bgColor:"#EDF1F3",iconBgColor:"#E0E9EC",textColor:"#005C75"}),s.jsx(ut,{label:"Unreviewed",count:i.unreviewed,icon:s.jsx(Yi,{className:"w-5 h-5 text-[#1A5276]"}),bgColor:"#E9F0FB",iconBgColor:"#DBE9FF",textColor:"#1A5276"}),s.jsx(ut,{label:"Reviewed",count:i.reviewed,icon:s.jsx(Oe,{className:"w-5 h-5 text-[#1B7A4A]"}),bgColor:"#EAFBEF",iconBgColor:"#D4EDDB",textColor:"#1B7A4A"}),s.jsx(ut,{label:"Stale",count:i.stale,icon:s.jsx(Ui,{className:"w-5 h-5 text-[#5B21B6]"}),bgColor:"#EDE9FB",iconBgColor:"#DDD6FE",textColor:"#5B21B6"})]})]})}function Vh({onClose:e,onCreateNew:t}){return s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:e,children:s.jsxs("div",{className:"bg-white rounded-lg p-8 max-w-xl w-full mx-4 relative",onClick:n=>n.stopPropagation(),children:[s.jsx("button",{onClick:e,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 cursor-pointer",children:s.jsx(tt,{className:"w-6 h-6"})}),s.jsx("h2",{className:"text-xl font-bold mb-4",children:"What are Claude Rules?"}),s.jsx("h3",{className:"mb-4 font-semibold",children:"And how does CodeYam Memory work with Claude Rules?"}),s.jsxs("div",{className:"text-gray-600 text-[15px] space-y-3 mb-6",children:[s.jsxs("p",{children:["Claude Rules are a component of"," ",s.jsx("a",{href:"https://code.claude.com/docs/en/memory#modular-rules-with-claude%2Frules%2F",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline",children:"Memory Management in Claude Code"}),'. The text of each rule is passed into the context window when working on the specific files described in the "paths" frontmatter field of the rule.']}),s.jsx("p",{children:"This allows you to provide context that is surgically specific to certain files in your codebase. They are a powerful tool but are harder to write and maintain than CLAUDE.md files."}),s.jsx("p",{children:"CodeYam Memory helps write and maintain Claude Rules. Hooks ensure that rules are reviewed and added during Claude Code working sessions. The CodeYam CLI Dashboard provides a page dedicated to Memory where you can view, edit, create, delete, and review Claude Rules."})]}),s.jsx("div",{className:"flex justify-center",children:s.jsxs("button",{onClick:t,className:"flex items-center gap-2 px-5 py-2.5 rounded-md hover:opacity-90 cursor-pointer font-mono uppercase text-xs font-semibold text-white",style:{backgroundColor:"#1A2332"},children:[s.jsx(Zt,{className:"w-4 h-4"}),"New Rule"]})})]})})}function Uh({rule:e,onConfirm:t,onCancel:n}){return s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",children:[s.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Delete Memory?"}),s.jsxs("p",{className:"text-gray-600 mb-4",children:["Are you sure you want to delete"," ",s.jsx("span",{className:"font-mono text-sm",children:e.filePath}),"? This cannot be undone."]}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx("button",{onClick:n,className:"px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-md cursor-pointer",children:"Cancel"}),s.jsx("button",{onClick:()=>t(e),className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700 cursor-pointer",children:"Delete"})]})]})})}const dr="Can you help me perform an interactive rules audit? Please look at all of the rules in `.claude/rules`. Are they organized properly? Ideally they should be in a folder that is the best representation of the files they impact (e.g. if the rule impacts `folder1/folder2/file1` and `folder1/folder2/folder3/file2` then the rule should be in `.claude/rules/folder1/folder2`). Do they make sense? Are they oriented toward avoiding future confusion (vs documenting bug fixes or temporary workarounds, etc)? Please literally read each one to ensure you understand what it is saying and learn something useful from it. Are they concise and efficient in their communication? We want to be respectful of the context window so any information in a rule that does not make sense, is not particularly helpful, or is repetitive should be removed. All other information should be presented as directly as possible. Bullets and tables can help with this as opposed to paragraphs. Take into consideration how rules interact as any one file may have multiple rules applied to it. Please look at the impacted files as well to ensure that it is an appropriate rule for them and to ensure the rules is not just repeating information that can be ascertained from the code. We don't want Claude to have to read a large number of files (or a single very large file) to figure out how everything works, so architectural guidance can be quite valuable, but information that is specific to one file and can be ascertained by the code and comments in that file is unnecessary. If you have any questions please ask!",mr="Can you mark all of these rules as reviewed in `.claude/codeyam-rule-state.json`?";function gr({text:e}){const[t,n]=I.useState(!1),r=()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)};return s.jsx("button",{onClick:r,className:"flex items-center gap-2 px-4 py-2 rounded-md hover:opacity-90 cursor-pointer font-mono uppercase text-xs font-semibold text-white",style:{backgroundColor:"#1A2332"},children:t?s.jsxs(s.Fragment,{children:[s.jsx(Oe,{className:"w-4 h-4"}),"Copied!"]}):s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"w-4 h-4"}),"Copy Prompt"]})})}function qh({onClose:e}){return s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:e,children:s.jsxs("div",{className:"bg-white rounded-lg p-8 max-w-xl w-full mx-4 relative max-h-[90vh] overflow-y-auto",onClick:t=>t.stopPropagation(),children:[s.jsx("button",{onClick:e,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 cursor-pointer",children:s.jsx(tt,{className:"w-6 h-6"})}),s.jsx("h2",{className:"text-xl font-bold mb-2",children:"Audit All Rules"}),s.jsx("p",{className:"text-gray-600 text-sm mb-4",children:"Claude can review all rules to look for information that is inconsistent, inappropriate, duplicative, inefficient, etc."}),s.jsx("textarea",{readOnly:!0,value:dr,className:"w-full h-48 p-3 text-sm font-mono bg-gray-50 border border-gray-200 rounded-md resize-none focus:outline-none"}),s.jsx("div",{className:"flex justify-end mt-3",children:s.jsx(gr,{text:dr})}),s.jsxs("div",{className:"border-t border-gray-200 mt-6 pt-5",children:[s.jsx("p",{className:"text-gray-500 text-sm mb-3",children:"If you would like to avoid reviewing all of the changes Claude makes you can ask Claude to mark all rules as reviewed."}),s.jsx("textarea",{readOnly:!0,value:mr,className:"w-full h-16 p-3 text-sm font-mono bg-gray-50 border border-gray-200 rounded-md resize-none focus:outline-none"}),s.jsx("div",{className:"flex justify-end mt-3",children:s.jsx(gr,{text:mr})})]})]})})}function Wh(){const[e,t]=I.useState(!1);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"border border-gray-200 rounded-lg px-5 py-4 mb-8 flex items-center gap-3",children:[s.jsx("h3",{className:"text-[14px] leading-6 text-[#232323] flex-shrink-0",style:{fontFamily:"Sora",fontWeight:600},children:"Audit All Rules"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Ask Claude to review, audit, and improve all rules."}),s.jsx("button",{onClick:()=>t(!0),className:"px-4 py-2 text-xs font-medium text-[#005C75] border border-[#005C75] rounded hover:bg-[#f0f9ff] cursor-pointer flex-shrink-0",children:"Get Prompt"})]}),e&&s.jsx(qh,{onClose:()=>t(!1)})]})}const rf=()=>[{title:"Memory - CodeYam"},{name:"description",content:"Manage Claude Memory documentation"}],lf=_i(function(){const{memories:t,reviewedStatus:n,memoryInitialized:r,error:i}=Oi(),o=Bi(),l=$i(),[a,c]=I.useState(""),[u,f]=I.useState(null),[h,d]=I.useState(new Set(["root"])),[p,m]=I.useState(null),[k,C]=I.useState(!1),[y,j]=I.useState(null),[N,A]=I.useState(0),[P,b]=I.useState(!1),[R,_]=I.useState(null),[q,w]=I.useState(null),[F,D]=I.useState({}),Y=z=>{d(H=>{const ee=new Set(H);return ee.has(z)?ee.delete(z):ee.add(z),ee})};Vi({source:"memory-page"});const L=I.useMemo(()=>({...n,...F}),[n,F]),v=I.useRef(o.state);I.useEffect(()=>{const z=v.current==="loading"||v.current==="submitting",H=o.state==="idle";z&&H&&o.data&&(l.revalidate(),m(null),C(!1),A(ee=>ee+1)),v.current=o.state},[o.state,o.data,l]),I.useEffect(()=>{D(z=>{const H={};for(const[ee,ue]of Object.entries(z))n[ee]!==ue&&(H[ee]=ue);return Object.keys(H).length===Object.keys(z).length?z:H})},[n]);const M=(z,H)=>{D(ee=>({...ee,[z]:!0})),o.submit({action:"mark-reviewed",filePath:z,lastModified:H},{method:"POST",action:"/api/memory",encType:"application/json"})},B=z=>{D(H=>({...H,[z]:!1})),o.submit({action:"mark-unreviewed",filePath:z},{method:"POST",action:"/api/memory",encType:"application/json"})},K=(z,H)=>{_(z),w(H??null)},X=I.useMemo(()=>{let z=t;if(a.trim()){const H=a.toLowerCase();z=z.filter(ee=>{var be;return(((be=ee.filePath.split("/").pop())==null?void 0:be.replace(".md",""))||"").toLowerCase().includes(H)||ee.body.toLowerCase().includes(H)})}return z},[t,a]),g=I.useMemo(()=>u?X.some(H=>H.filePath===u)?X.filter(H=>H.filePath===u):X.filter(H=>H.filePath.startsWith(u+"/")||H.filePath===u):X,[X,u]),le=(z,H)=>{const ee=p?"update":"create";o.submit({action:ee,filePath:z,content:H},{method:"POST",action:"/api/memory",encType:"application/json"})},se=z=>{o.submit({action:"delete",filePath:z.filePath},{method:"POST",action:"/api/memory",encType:"application/json"}),j(null)},x=I.useMemo(()=>{const z=t.filter(H=>L[H.filePath]).length;return{total:t.length,reviewed:z,unreviewed:t.length-z,stale:0}},[t,L]),G=I.useMemo(()=>{const z=new Set(["root"]);for(const H of X){const ee=H.filePath.split("/");ee.pop();let ue="";for(const be of ee)ue=ue?`${ue}/${be}`:be,z.add(ue)}return z},[X]),re=G.size===h.size&&[...G].every(z=>h.has(z)),ne=()=>{d(re?new Set(["root"]):new Set(G))};return i?s.jsx("div",{className:"bg-[#F8F7F6] min-h-screen",children:s.jsxs("div",{className:"px-12 py-6 font-sans",children:[s.jsx("h1",{className:"text-[28px] font-semibold text-gray-900",children:"Error"}),s.jsx("p",{className:"text-base text-gray-500",children:i})]})}):r?s.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:s.jsxs("div",{className:"px-6 sm:px-12 lg:px-20 py-8 lg:py-12 font-sans",children:[s.jsx(Hh,{searchFilter:a,onSearchChange:c,onCreateNew:()=>C(!0),onLearnMore:()=>b(!0),reviewCounts:x}),(k||p)&&s.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[9999] p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.8)"},onClick:()=>{C(!1),m(null)},children:s.jsx("div",{className:"bg-white rounded-lg shadow-xl max-w-4xl w-full max-h-[90vh] overflow-auto",onClick:z=>z.stopPropagation(),children:s.jsx(Ih,{rule:p,onSave:le,onCancel:()=>{C(!1),m(null)}})})}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 lg:gap-8 mb-8",children:[s.jsx(Dh,{memories:X,reviewedStatus:L,onViewRule:K,refreshKey:N}),s.jsx(zh,{onEditRule:m,onDeleteRule:j,refreshKey:N,reviewedStatus:L,onMarkReviewed:M,onMarkUnreviewed:B,memories:t,onViewRule:K})]}),s.jsx(Wh,{}),s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h2",{className:"text-xl leading-6 text-[#232323]",style:{fontFamily:"Sora",fontWeight:600},children:"All Rules"}),s.jsx("div",{className:"flex items-center gap-4",children:G.size>1&&s.jsx("button",{onClick:ne,className:"text-xs text-[#005C75] hover:underline cursor-pointer font-mono uppercase font-semibold",children:re?"Collapse All":"Expand All"})})]}),s.jsxs("div",{className:"flex gap-6",children:[s.jsx("div",{className:"hidden lg:block w-80 flex-shrink-0",children:s.jsx(Fh,{memories:X,selectedPath:u,onSelectPath:f,expandedFolders:h,onToggleFolder:Y})}),s.jsx("div",{className:"flex-1 min-w-0",children:t.length===0?s.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-12 text-center",children:[s.jsx(Xi,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No Rules Yet"}),s.jsxs("p",{className:"text-gray-500 mb-4",children:["Run"," ",s.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"/codeyam-memory"})," ","to generate initial memories for your codebase."]}),s.jsxs("button",{onClick:()=>C(!0),className:"inline-flex items-center gap-2 px-4 py-2 bg-[#005C75] text-white rounded-md hover:bg-[#004a5e] cursor-pointer",children:[s.jsx(Zt,{className:"w-4 h-4"}),"Create Your First Memory"]})]}):s.jsxs("div",{children:[u&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 mb-4",children:["Showing rules in"," ",s.jsx("span",{className:"font-mono bg-gray-100 px-1.5 py-0.5 rounded",children:u||"(root)"}),s.jsx("button",{onClick:()=>f(null),className:"text-[#005C75] hover:underline cursor-pointer",children:"Clear filter"})]}),s.jsx(Rh,{memories:g,onEdit:m,onDelete:j,expandedFolders:h,onToggleFolder:Y,reviewedStatus:L,onMarkReviewed:M,onMarkUnreviewed:B,onViewRule:K})]})})]}),s.jsx("div",{className:"mt-8 mb-8",children:s.jsx(Hi,{to:"/agent-transcripts",className:"block bg-white border border-gray-200 rounded-lg p-5 hover:border-[#005C75] hover:shadow-sm transition-all group",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#EDF1F3] flex items-center justify-center",children:s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#005C75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("polyline",{points:"4 17 10 11 4 5"}),s.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold text-[#232323] group-hover:text-[#005C75]",style:{fontFamily:"Sora"},children:"Agent Transcripts"}),s.jsx("p",{className:"text-xs text-gray-500",children:"View background agent transcripts and tool call history"})]})]})})}),R&&!p&&(()=>{const z=t.find(H=>H.filePath===R.filePath)??R;return s.jsx(_h,{rule:z,changeInfo:q??void 0,isReviewed:L[z.filePath]??!1,onApprove:()=>{L[z.filePath]??!1?B(z.filePath):M(z.filePath,z.lastModified),_(null)},onEdit:()=>{m(z)},onDelete:()=>{j(z),_(null)},onClose:()=>_(null)})})(),P&&s.jsx(Vh,{onClose:()=>b(!1),onCreateNew:()=>{b(!1),C(!0)}}),y&&s.jsx(Uh,{rule:y,onConfirm:se,onCancel:()=>j(null)})]})}):s.jsx($h,{})});export{lf as default,rf as meta};
|
|
96
|
+
`).map((m,k)=>{let C="";return m.startsWith("+")&&!m.startsWith("+++")?C="text-green-400":m.startsWith("-")&&!m.startsWith("---")?C="text-red-400":m.startsWith("@@")&&(C="text-cyan-400"),s.jsx("div",{className:C,children:m},k)})})]})}),s.jsxs("div",{className:"px-6 pb-6",children:[s.jsx("div",{className:"text-[13px] text-gray-700 font-semibold mb-2",children:"Rule Text:"}),s.jsx("div",{className:"bg-white rounded-lg p-6",style:{border:"1px solid #E6E6E6"},children:s.jsx(Ni,{content:e.body})})]})]})})}function Oh(){return s.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 27 27",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("rect",{x:"12",y:"24",width:"3",height:"3",fill:"#232323"}),s.jsx("rect",{x:"12",width:"3",height:"3",fill:"#232323"}),s.jsx("rect",{x:"12",y:"3",width:"3",height:"3",fill:"#232323"}),s.jsx("rect",{x:"12",y:"6",width:"3",height:"3",fill:"#232323"}),s.jsx("rect",{x:"12",y:"18",width:"3",height:"3",fill:"#232323"}),s.jsx("rect",{x:"3",y:"12",width:"3",height:"3",transform:"rotate(90 3 12)",fill:"#232323"}),s.jsx("rect",{x:"27",y:"12",width:"3",height:"3",transform:"rotate(90 27 12)",fill:"#232323"}),s.jsx("rect",{x:"18",y:"24",width:"3",height:"3",transform:"rotate(90 18 24)",fill:"#232323"}),s.jsx("rect",{x:"18",width:"3",height:"3",transform:"rotate(90 18 0)",fill:"#232323"}),s.jsx("rect",{x:"3",y:"18",width:"3",height:"3",transform:"rotate(-180 3 18)",fill:"#232323"}),s.jsx("rect",{x:"27",y:"18",width:"3",height:"3",transform:"rotate(-180 27 18)",fill:"#232323"}),s.jsx("rect",{x:"21",y:"24",width:"3",height:"3",transform:"rotate(90 21 24)",fill:"#232323"}),s.jsx("rect",{x:"3",y:"21",width:"3",height:"3",transform:"rotate(-180 3 21)",fill:"#232323"}),s.jsx("rect",{x:"27",y:"21",width:"3",height:"3",transform:"rotate(-180 27 21)",fill:"#232323"}),s.jsx("rect",{x:"6",y:"24",width:"3",height:"3",transform:"rotate(90 6 24)",fill:"#232323"}),s.jsx("rect",{x:"6",width:"3",height:"3",transform:"rotate(90 6 0)",fill:"#232323"}),s.jsx("rect",{x:"3",y:"6",width:"3",height:"3",transform:"rotate(-180 3 6)",fill:"#232323"}),s.jsx("rect",{x:"21",y:"6",width:"3",height:"3",transform:"rotate(-180 21 6)",fill:"#232323"}),s.jsx("rect",{x:"24",y:"24",width:"3",height:"3",transform:"rotate(90 24 24)",fill:"#232323"}),s.jsx("rect",{x:"3",y:"24",width:"3",height:"3",transform:"rotate(-180 3 24)",fill:"#232323"}),s.jsx("rect",{x:"27",y:"24",width:"3",height:"3",transform:"rotate(-180 27 24)",fill:"#232323"}),s.jsx("rect",{x:"9",y:"24",width:"3",height:"3",transform:"rotate(90 9 24)",fill:"#232323"}),s.jsx("rect",{x:"9",width:"3",height:"3",transform:"rotate(90 9 0)",fill:"#232323"}),s.jsx("rect",{x:"9",y:"3",width:"3",height:"3",transform:"rotate(90 9 3)",fill:"#232323"}),s.jsx("rect",{x:"9",y:"6",width:"3",height:"3",transform:"rotate(90 9 6)",fill:"#232323"}),s.jsx("rect",{x:"9",y:"18",width:"3",height:"3",transform:"rotate(90 9 18)",fill:"#232323"}),s.jsx("rect",{x:"3",y:"9",width:"3",height:"3",transform:"rotate(-180 3 9)",fill:"#232323"}),s.jsx("rect",{x:"24",y:"9",width:"3",height:"3",transform:"rotate(-180 24 9)",fill:"#232323"}),s.jsx("rect",{x:"12",y:"24",width:"3",height:"3",transform:"rotate(90 12 24)",fill:"#232323"}),s.jsx("rect",{x:"12",width:"3",height:"3",transform:"rotate(90 12 0)",fill:"#232323"}),s.jsx("rect",{x:"12",y:"6",width:"3",height:"3",transform:"rotate(90 12 6)",fill:"#232323"}),s.jsx("rect",{x:"12",y:"18",width:"3",height:"3",transform:"rotate(90 12 18)",fill:"#232323"}),s.jsx("rect",{x:"3",y:"12",width:"3",height:"3",transform:"rotate(-180 3 12)",fill:"#232323"}),s.jsx("rect",{x:"27",y:"12",width:"3",height:"3",transform:"rotate(-180 27 12)",fill:"#232323"})]})}function Bh(){return s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 27 27",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("rect",{x:"12",y:"24",width:"3",height:"3",fill:"#005C75"}),s.jsx("rect",{x:"12",width:"3",height:"3",fill:"#005C75"}),s.jsx("rect",{x:"12",y:"3",width:"3",height:"3",fill:"#005C75"}),s.jsx("rect",{x:"12",y:"6",width:"3",height:"3",fill:"#005C75"}),s.jsx("rect",{x:"12",y:"18",width:"3",height:"3",fill:"#005C75"}),s.jsx("rect",{x:"3",y:"12",width:"3",height:"3",transform:"rotate(90 3 12)",fill:"#005C75"}),s.jsx("rect",{x:"27",y:"12",width:"3",height:"3",transform:"rotate(90 27 12)",fill:"#005C75"}),s.jsx("rect",{x:"18",y:"24",width:"3",height:"3",transform:"rotate(90 18 24)",fill:"#005C75"}),s.jsx("rect",{x:"18",width:"3",height:"3",transform:"rotate(90 18 0)",fill:"#005C75"}),s.jsx("rect",{x:"3",y:"18",width:"3",height:"3",transform:"rotate(-180 3 18)",fill:"#005C75"}),s.jsx("rect",{x:"27",y:"18",width:"3",height:"3",transform:"rotate(-180 27 18)",fill:"#005C75"}),s.jsx("rect",{x:"21",y:"24",width:"3",height:"3",transform:"rotate(90 21 24)",fill:"#005C75"}),s.jsx("rect",{x:"3",y:"21",width:"3",height:"3",transform:"rotate(-180 3 21)",fill:"#005C75"}),s.jsx("rect",{x:"27",y:"21",width:"3",height:"3",transform:"rotate(-180 27 21)",fill:"#005C75"}),s.jsx("rect",{x:"6",y:"24",width:"3",height:"3",transform:"rotate(90 6 24)",fill:"#005C75"}),s.jsx("rect",{x:"6",width:"3",height:"3",transform:"rotate(90 6 0)",fill:"#005C75"}),s.jsx("rect",{x:"3",y:"6",width:"3",height:"3",transform:"rotate(-180 3 6)",fill:"#005C75"}),s.jsx("rect",{x:"21",y:"6",width:"3",height:"3",transform:"rotate(-180 21 6)",fill:"#005C75"}),s.jsx("rect",{x:"24",y:"24",width:"3",height:"3",transform:"rotate(90 24 24)",fill:"#005C75"}),s.jsx("rect",{x:"3",y:"24",width:"3",height:"3",transform:"rotate(-180 3 24)",fill:"#005C75"}),s.jsx("rect",{x:"27",y:"24",width:"3",height:"3",transform:"rotate(-180 27 24)",fill:"#005C75"}),s.jsx("rect",{x:"9",y:"24",width:"3",height:"3",transform:"rotate(90 9 24)",fill:"#005C75"}),s.jsx("rect",{x:"9",width:"3",height:"3",transform:"rotate(90 9 0)",fill:"#005C75"}),s.jsx("rect",{x:"9",y:"3",width:"3",height:"3",transform:"rotate(90 9 3)",fill:"#005C75"}),s.jsx("rect",{x:"9",y:"6",width:"3",height:"3",transform:"rotate(90 9 6)",fill:"#005C75"}),s.jsx("rect",{x:"9",y:"18",width:"3",height:"3",transform:"rotate(90 9 18)",fill:"#005C75"}),s.jsx("rect",{x:"3",y:"9",width:"3",height:"3",transform:"rotate(-180 3 9)",fill:"#005C75"}),s.jsx("rect",{x:"24",y:"9",width:"3",height:"3",transform:"rotate(-180 24 9)",fill:"#005C75"}),s.jsx("rect",{x:"12",y:"24",width:"3",height:"3",transform:"rotate(90 12 24)",fill:"#005C75"}),s.jsx("rect",{x:"12",width:"3",height:"3",transform:"rotate(90 12 0)",fill:"#005C75"}),s.jsx("rect",{x:"12",y:"6",width:"3",height:"3",transform:"rotate(90 12 6)",fill:"#005C75"}),s.jsx("rect",{x:"12",y:"18",width:"3",height:"3",transform:"rotate(90 12 18)",fill:"#005C75"}),s.jsx("rect",{x:"3",y:"12",width:"3",height:"3",transform:"rotate(-180 3 12)",fill:"#005C75"}),s.jsx("rect",{x:"27",y:"12",width:"3",height:"3",transform:"rotate(-180 27 12)",fill:"#005C75"})]})}function $h(){return s.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:s.jsxs("div",{className:"px-6 sm:px-12 lg:px-20 py-8 lg:py-12 font-sans max-w-3xl mx-auto",children:[s.jsxs("div",{className:"text-center mb-10",children:[s.jsx("h1",{className:"text-[22px] font-semibold mb-4",style:{fontFamily:"Sora",color:"#232323"},children:"Get Started with CodeYam Memory"}),s.jsx("p",{className:"text-[15px] text-gray-500 leading-relaxed max-w-2xl mx-auto",children:"CodeYam Memory generates path-scoped Claude Rules that load automatically when Claude works on matching files. These rules capture any confusion, architectural decisions, and tribal knowledge from your as you work with Claude, ensuring sessions become more efficient and aligned with your codebase over time."})]}),s.jsxs("div",{className:"rounded-lg p-8 mb-6",style:{backgroundColor:"#EDF8FA",border:"1px solid #C8E6EC"},children:[s.jsx("h2",{className:"text-[18px] font-semibold mb-6",style:{fontFamily:"Sora",color:"#232323"},children:"Setup Steps"}),s.jsxs("ol",{className:"space-y-5",children:[s.jsxs("li",{className:"flex gap-3 items-start",children:[s.jsx("span",{className:"flex-shrink-0 w-7 h-7 rounded-md flex items-center justify-center text-sm font-semibold",style:{backgroundColor:"#005C75",color:"#fff"},children:"1"}),s.jsx("p",{className:"text-[14px] font-medium text-gray-900 pt-0.5",children:"Open Claude Code in your project terminal"})]}),s.jsxs("li",{className:"flex gap-3 items-start",children:[s.jsx("span",{className:"flex-shrink-0 w-7 h-7 rounded-md flex items-center justify-center text-sm font-semibold",style:{backgroundColor:"#005C75",color:"#fff"},children:"2"}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 pt-0.5",children:[s.jsx("span",{className:"text-[14px] font-medium text-gray-900",children:"Run"}),s.jsx(pr,{value:"/codeyam-memory"}),s.jsx("span",{className:"text-[14px] font-medium text-gray-900",children:"in the Claude Code session"})]}),s.jsx("p",{className:"text-[13px] text-gray-600 mt-1",children:"This kicks off analysis of your git history to find confusion patterns."})]})]}),s.jsxs("li",{className:"flex gap-3 items-start",children:[s.jsx("span",{className:"flex-shrink-0 w-7 h-7 rounded-md flex items-center justify-center text-sm font-semibold",style:{backgroundColor:"#005C75",color:"#fff"},children:"3"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[14px] font-medium text-gray-900 pt-0.5",children:"Return to this dashboard page to review the new rules"}),s.jsx("p",{className:"text-[13px] text-gray-600 mt-1",children:"You can review, edit, and approve the rules Claude creates."})]})]})]})]}),s.jsxs("div",{className:"rounded-lg p-8 mb-6",style:{backgroundColor:"#EDF8FA",border:"1px solid #C8E6EC"},children:[s.jsx("h2",{className:"text-[18px] font-semibold mb-6",style:{fontFamily:"Sora",color:"#232323"},children:"What Gets Created"}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute left-[15px] top-8 bottom-4",style:{borderLeft:"2px dotted #B0BEC5"}}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start gap-4 relative",children:[s.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded flex items-center justify-center",style:{backgroundColor:"#2C3E50"},children:s.jsx("div",{className:"w-3 h-3 rounded-sm bg-white/30"})}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-[14px] font-medium text-gray-900",children:[s.jsx("code",{className:"bg-gray-200/60 px-1.5 py-0.5 rounded text-[13px]",children:".claude/rules/*.md"}),s.jsx("span",{className:"text-gray-400 mx-1.5",children:"—"}),"path-scoped guidance files"]}),s.jsx("p",{className:"text-[13px] text-gray-500 mt-1",children:"Markdown files with frontmatter specifying which file paths they apply to."})]})]}),s.jsxs("div",{className:"flex items-start gap-4 relative",children:[s.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded flex items-center justify-center",style:{backgroundColor:"#2C3E50"},children:s.jsx("div",{className:"w-3 h-3 rounded-sm bg-white/30"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[14px] font-medium text-gray-900",children:"Rules load automatically when Claude works on matching files"}),s.jsx("p",{className:"text-[13px] text-gray-500 mt-1",children:"No manual steps needed — Claude picks up relevant rules based on the files it touches."})]})]}),s.jsxs("div",{className:"flex items-start gap-4 relative",children:[s.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded flex items-center justify-center",style:{backgroundColor:"#2C3E50"},children:s.jsx("div",{className:"w-3 h-3 rounded-sm bg-white/30"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[14px] font-medium text-gray-900",children:"Pre-commit hook to keep rules fresh and capture new patterns"}),s.jsx("p",{className:"text-[13px] text-gray-500 mt-1",children:"A git hook runs automatically to update rules when related code changes and looks for any new patterns of confusion in work sessions."})]})]})]})]})]}),s.jsxs("div",{className:"rounded-lg px-8 py-5 flex items-center justify-center gap-3",style:{backgroundColor:"#1A2332"},children:[s.jsx("span",{className:"text-white text-[15px] font-medium",children:"Run"}),s.jsx(pr,{value:"/codeyam-memory"}),s.jsx("span",{className:"text-white text-[15px] font-medium",children:"in Claude Code to get started"})]})]})})}function pr({value:e}){const[t,n]=I.useState(!1),r=()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)};return s.jsxs("button",{onClick:r,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-[13px] font-mono cursor-pointer border-0",style:{backgroundColor:"#2C3E50",color:"#E0E0E0"},title:"Copy to clipboard",children:[e,t?s.jsx(Oe,{className:"w-3.5 h-3.5 text-green-400"}):s.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-400",children:[s.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),s.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})]})}function ut({label:e,count:t,icon:n,bgColor:r,iconBgColor:i,textColor:o}){return s.jsx("div",{className:"rounded-lg p-4",style:{backgroundColor:r,border:"1px solid #EFEFEF"},children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center flex-shrink-0",style:{backgroundColor:i},children:n}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-[32px] font-semibold leading-none mb-1",style:{color:o},children:t}),s.jsx("div",{className:"text-[11px] uppercase tracking-wider font-medium",style:{color:o},children:e})]})]})})}function Hh({searchFilter:e,onSearchChange:t,onCreateNew:n,onLearnMore:r,reviewCounts:i}){return s.jsxs("div",{className:"mb-8",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 mb-6",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[s.jsx(Oh,{}),s.jsx("h1",{className:"text-[24px] font-semibold mb-0",style:{fontFamily:"Sora",color:"#232323"},children:"Memory"})]}),s.jsxs("p",{className:"text-[15px] text-gray-500",children:["Rules help Claude understand your codebase patterns and conventions."," ",s.jsx("button",{onClick:r,className:"text-[#005C75] underline cursor-pointer",children:"Learn more about rules."})]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(kr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),s.jsx("input",{type:"text",value:e,onChange:o=>t(o.target.value),placeholder:"Search rules...",className:"w-64 pl-10 pr-4 py-2 border border-gray-200 rounded-md bg-white focus:outline-none focus:ring-2 focus:ring-[#005C75] focus:border-transparent text-sm"})]}),s.jsxs("button",{onClick:n,className:"flex items-center gap-2 px-4 py-2 rounded-md hover:opacity-90 cursor-pointer font-mono uppercase text-xs font-semibold text-white",style:{backgroundColor:"#1A2332"},children:[s.jsx(Zt,{className:"w-4 h-4"}),"New Rule"]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[s.jsx(ut,{label:"Total Rules",count:i.total,icon:s.jsx(Bh,{}),bgColor:"#EDF1F3",iconBgColor:"#E0E9EC",textColor:"#005C75"}),s.jsx(ut,{label:"Unreviewed",count:i.unreviewed,icon:s.jsx(Yi,{className:"w-5 h-5 text-[#1A5276]"}),bgColor:"#E9F0FB",iconBgColor:"#DBE9FF",textColor:"#1A5276"}),s.jsx(ut,{label:"Reviewed",count:i.reviewed,icon:s.jsx(Oe,{className:"w-5 h-5 text-[#1B7A4A]"}),bgColor:"#EAFBEF",iconBgColor:"#D4EDDB",textColor:"#1B7A4A"}),s.jsx(ut,{label:"Stale",count:i.stale,icon:s.jsx(Ui,{className:"w-5 h-5 text-[#5B21B6]"}),bgColor:"#EDE9FB",iconBgColor:"#DDD6FE",textColor:"#5B21B6"})]})]})}function Vh({onClose:e,onCreateNew:t}){return s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:e,children:s.jsxs("div",{className:"bg-white rounded-lg p-8 max-w-xl w-full mx-4 relative",onClick:n=>n.stopPropagation(),children:[s.jsx("button",{onClick:e,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 cursor-pointer",children:s.jsx(tt,{className:"w-6 h-6"})}),s.jsx("h2",{className:"text-xl font-bold mb-4",children:"What are Claude Rules?"}),s.jsx("h3",{className:"mb-4 font-semibold",children:"And how does CodeYam Memory work with Claude Rules?"}),s.jsxs("div",{className:"text-gray-600 text-[15px] space-y-3 mb-6",children:[s.jsxs("p",{children:["Claude Rules are a component of"," ",s.jsx("a",{href:"https://code.claude.com/docs/en/memory#modular-rules-with-claude%2Frules%2F",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline",children:"Memory Management in Claude Code"}),'. The text of each rule is passed into the context window when working on the specific files described in the "paths" frontmatter field of the rule.']}),s.jsx("p",{children:"This allows you to provide context that is surgically specific to certain files in your codebase. They are a powerful tool but are harder to write and maintain than CLAUDE.md files."}),s.jsx("p",{children:"CodeYam Memory helps write and maintain Claude Rules. Hooks ensure that rules are reviewed and added during Claude Code working sessions. The CodeYam CLI Dashboard provides a page dedicated to Memory where you can view, edit, create, delete, and review Claude Rules."})]}),s.jsx("div",{className:"flex justify-center",children:s.jsxs("button",{onClick:t,className:"flex items-center gap-2 px-5 py-2.5 rounded-md hover:opacity-90 cursor-pointer font-mono uppercase text-xs font-semibold text-white",style:{backgroundColor:"#1A2332"},children:[s.jsx(Zt,{className:"w-4 h-4"}),"New Rule"]})})]})})}function Uh({rule:e,onConfirm:t,onCancel:n}){return s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",children:[s.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Delete Memory?"}),s.jsxs("p",{className:"text-gray-600 mb-4",children:["Are you sure you want to delete"," ",s.jsx("span",{className:"font-mono text-sm",children:e.filePath}),"? This cannot be undone."]}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx("button",{onClick:n,className:"px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-md cursor-pointer",children:"Cancel"}),s.jsx("button",{onClick:()=>t(e),className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700 cursor-pointer",children:"Delete"})]})]})})}const dr="Can you help me perform an interactive rules audit? Please look at all of the rules in `.claude/rules`. Are they organized properly? Ideally they should be in a folder that is the best representation of the files they impact (e.g. if the rule impacts `folder1/folder2/file1` and `folder1/folder2/folder3/file2` then the rule should be in `.claude/rules/folder1/folder2`). Do they make sense? Are they oriented toward avoiding future confusion (vs documenting bug fixes or temporary workarounds, etc)? Please literally read each one to ensure you understand what it is saying and learn something useful from it. Are they concise and efficient in their communication? We want to be respectful of the context window so any information in a rule that does not make sense, is not particularly helpful, or is repetitive should be removed. All other information should be presented as directly as possible. Bullets and tables can help with this as opposed to paragraphs. Take into consideration how rules interact as any one file may have multiple rules applied to it. Please look at the impacted files as well to ensure that it is an appropriate rule for them and to ensure the rule is not just repeating information that can be ascertained from the code. We don't want Claude to have to read a large number of files (or a single very large file) to figure out how everything works, so architectural guidance can be quite valuable, but information that is specific to one file and can be ascertained by the code and comments in that file is unnecessary. Too often rules reflect past confusion that has been resolved and is unlikely to happen again. Content and rules like this should be removed. If you have any questions please ask!",mr="Can you mark all of these rules as reviewed in `.claude/codeyam-rule-state.json`?";function gr({text:e}){const[t,n]=I.useState(!1),r=()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)};return s.jsx("button",{onClick:r,className:"flex items-center gap-2 px-4 py-2 rounded-md hover:opacity-90 cursor-pointer font-mono uppercase text-xs font-semibold text-white",style:{backgroundColor:"#1A2332"},children:t?s.jsxs(s.Fragment,{children:[s.jsx(Oe,{className:"w-4 h-4"}),"Copied!"]}):s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"w-4 h-4"}),"Copy Prompt"]})})}function qh({onClose:e}){return s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:e,children:s.jsxs("div",{className:"bg-white rounded-lg p-8 max-w-xl w-full mx-4 relative max-h-[90vh] overflow-y-auto",onClick:t=>t.stopPropagation(),children:[s.jsx("button",{onClick:e,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 cursor-pointer",children:s.jsx(tt,{className:"w-6 h-6"})}),s.jsx("h2",{className:"text-xl font-bold mb-2",children:"Audit All Rules"}),s.jsx("p",{className:"text-gray-600 text-sm mb-4",children:"Claude can review all rules to look for information that is inconsistent, inappropriate, duplicative, inefficient, etc."}),s.jsx("textarea",{readOnly:!0,value:dr,className:"w-full h-48 p-3 text-sm font-mono bg-gray-50 border border-gray-200 rounded-md resize-none focus:outline-none"}),s.jsx("div",{className:"flex justify-end mt-3",children:s.jsx(gr,{text:dr})}),s.jsxs("div",{className:"border-t border-gray-200 mt-6 pt-5",children:[s.jsx("p",{className:"text-gray-500 text-sm mb-3",children:"If you would like to avoid reviewing all of the changes Claude makes you can ask Claude to mark all rules as reviewed."}),s.jsx("textarea",{readOnly:!0,value:mr,className:"w-full h-16 p-3 text-sm font-mono bg-gray-50 border border-gray-200 rounded-md resize-none focus:outline-none"}),s.jsx("div",{className:"flex justify-end mt-3",children:s.jsx(gr,{text:mr})})]})]})})}function Wh(){const[e,t]=I.useState(!1);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"border border-gray-200 rounded-lg px-5 py-4 mb-8 flex items-center gap-3",children:[s.jsx("h3",{className:"text-[14px] leading-6 text-[#232323] flex-shrink-0",style:{fontFamily:"Sora",fontWeight:600},children:"Audit All Rules"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Ask Claude to review, audit, and improve all rules."}),s.jsx("button",{onClick:()=>t(!0),className:"px-4 py-2 text-xs font-medium text-[#005C75] border border-[#005C75] rounded hover:bg-[#f0f9ff] cursor-pointer flex-shrink-0",children:"Get Prompt"})]}),e&&s.jsx(qh,{onClose:()=>t(!1)})]})}const rf=()=>[{title:"Memory - CodeYam"},{name:"description",content:"Manage Claude Memory documentation"}],lf=_i(function(){const{memories:t,reviewedStatus:n,memoryInitialized:r,error:i}=Oi(),o=Bi(),l=$i(),[a,c]=I.useState(""),[u,f]=I.useState(null),[h,d]=I.useState(new Set(["root"])),[p,m]=I.useState(null),[k,C]=I.useState(!1),[y,j]=I.useState(null),[N,A]=I.useState(0),[P,b]=I.useState(!1),[R,_]=I.useState(null),[q,w]=I.useState(null),[F,D]=I.useState({}),Y=z=>{d(H=>{const ee=new Set(H);return ee.has(z)?ee.delete(z):ee.add(z),ee})};Vi({source:"memory-page"});const L=I.useMemo(()=>({...n,...F}),[n,F]),v=I.useRef(o.state);I.useEffect(()=>{const z=v.current==="loading"||v.current==="submitting",H=o.state==="idle";z&&H&&o.data&&(l.revalidate(),m(null),C(!1),A(ee=>ee+1)),v.current=o.state},[o.state,o.data,l]),I.useEffect(()=>{D(z=>{const H={};for(const[ee,ue]of Object.entries(z))n[ee]!==ue&&(H[ee]=ue);return Object.keys(H).length===Object.keys(z).length?z:H})},[n]);const M=(z,H)=>{D(ee=>({...ee,[z]:!0})),o.submit({action:"mark-reviewed",filePath:z,lastModified:H},{method:"POST",action:"/api/memory",encType:"application/json"})},B=z=>{D(H=>({...H,[z]:!1})),o.submit({action:"mark-unreviewed",filePath:z},{method:"POST",action:"/api/memory",encType:"application/json"})},K=(z,H)=>{_(z),w(H??null)},X=I.useMemo(()=>{let z=t;if(a.trim()){const H=a.toLowerCase();z=z.filter(ee=>{var be;return(((be=ee.filePath.split("/").pop())==null?void 0:be.replace(".md",""))||"").toLowerCase().includes(H)||ee.body.toLowerCase().includes(H)})}return z},[t,a]),g=I.useMemo(()=>u?X.some(H=>H.filePath===u)?X.filter(H=>H.filePath===u):X.filter(H=>H.filePath.startsWith(u+"/")||H.filePath===u):X,[X,u]),le=(z,H)=>{const ee=p?"update":"create";o.submit({action:ee,filePath:z,content:H},{method:"POST",action:"/api/memory",encType:"application/json"})},se=z=>{o.submit({action:"delete",filePath:z.filePath},{method:"POST",action:"/api/memory",encType:"application/json"}),j(null)},x=I.useMemo(()=>{const z=t.filter(H=>L[H.filePath]).length;return{total:t.length,reviewed:z,unreviewed:t.length-z,stale:0}},[t,L]),G=I.useMemo(()=>{const z=new Set(["root"]);for(const H of X){const ee=H.filePath.split("/");ee.pop();let ue="";for(const be of ee)ue=ue?`${ue}/${be}`:be,z.add(ue)}return z},[X]),re=G.size===h.size&&[...G].every(z=>h.has(z)),ne=()=>{d(re?new Set(["root"]):new Set(G))};return i?s.jsx("div",{className:"bg-[#F8F7F6] min-h-screen",children:s.jsxs("div",{className:"px-12 py-6 font-sans",children:[s.jsx("h1",{className:"text-[28px] font-semibold text-gray-900",children:"Error"}),s.jsx("p",{className:"text-base text-gray-500",children:i})]})}):r?s.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:s.jsxs("div",{className:"px-6 sm:px-12 lg:px-20 py-8 lg:py-12 font-sans",children:[s.jsx(Hh,{searchFilter:a,onSearchChange:c,onCreateNew:()=>C(!0),onLearnMore:()=>b(!0),reviewCounts:x}),(k||p)&&s.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[9999] p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.8)"},onClick:()=>{C(!1),m(null)},children:s.jsx("div",{className:"bg-white rounded-lg shadow-xl max-w-4xl w-full max-h-[90vh] overflow-auto",onClick:z=>z.stopPropagation(),children:s.jsx(Ih,{rule:p,onSave:le,onCancel:()=>{C(!1),m(null)}})})}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 lg:gap-8 mb-8",children:[s.jsx(Dh,{memories:X,reviewedStatus:L,onViewRule:K,refreshKey:N}),s.jsx(zh,{onEditRule:m,onDeleteRule:j,refreshKey:N,reviewedStatus:L,onMarkReviewed:M,onMarkUnreviewed:B,memories:t,onViewRule:K})]}),s.jsx(Wh,{}),s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h2",{className:"text-xl leading-6 text-[#232323]",style:{fontFamily:"Sora",fontWeight:600},children:"All Rules"}),s.jsx("div",{className:"flex items-center gap-4",children:G.size>1&&s.jsx("button",{onClick:ne,className:"text-xs text-[#005C75] hover:underline cursor-pointer font-mono uppercase font-semibold",children:re?"Collapse All":"Expand All"})})]}),s.jsxs("div",{className:"flex gap-6",children:[s.jsx("div",{className:"hidden lg:block w-80 flex-shrink-0",children:s.jsx(Fh,{memories:X,selectedPath:u,onSelectPath:f,expandedFolders:h,onToggleFolder:Y})}),s.jsx("div",{className:"flex-1 min-w-0",children:t.length===0?s.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-12 text-center",children:[s.jsx(Xi,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No Rules Yet"}),s.jsxs("p",{className:"text-gray-500 mb-4",children:["Run"," ",s.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"/codeyam-memory"})," ","to generate initial memories for your codebase."]}),s.jsxs("button",{onClick:()=>C(!0),className:"inline-flex items-center gap-2 px-4 py-2 bg-[#005C75] text-white rounded-md hover:bg-[#004a5e] cursor-pointer",children:[s.jsx(Zt,{className:"w-4 h-4"}),"Create Your First Memory"]})]}):s.jsxs("div",{children:[u&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 mb-4",children:["Showing rules in"," ",s.jsx("span",{className:"font-mono bg-gray-100 px-1.5 py-0.5 rounded",children:u||"(root)"}),s.jsx("button",{onClick:()=>f(null),className:"text-[#005C75] hover:underline cursor-pointer",children:"Clear filter"})]}),s.jsx(Rh,{memories:g,onEdit:m,onDelete:j,expandedFolders:h,onToggleFolder:Y,reviewedStatus:L,onMarkReviewed:M,onMarkUnreviewed:B,onViewRule:K})]})})]}),s.jsx("div",{className:"mt-8 mb-8",children:s.jsx(Hi,{to:"/agent-transcripts",className:"block bg-white border border-gray-200 rounded-lg p-5 hover:border-[#005C75] hover:shadow-sm transition-all group",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#EDF1F3] flex items-center justify-center",children:s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#005C75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("polyline",{points:"4 17 10 11 4 5"}),s.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold text-[#232323] group-hover:text-[#005C75]",style:{fontFamily:"Sora"},children:"Agent Transcripts"}),s.jsx("p",{className:"text-xs text-gray-500",children:"View background agent transcripts and tool call history"})]})]})})}),R&&!p&&(()=>{const z=t.find(H=>H.filePath===R.filePath)??R;return s.jsx(_h,{rule:z,changeInfo:q??void 0,isReviewed:L[z.filePath]??!1,onApprove:()=>{L[z.filePath]??!1?B(z.filePath):M(z.filePath,z.lastModified),_(null)},onEdit:()=>{m(z)},onDelete:()=>{j(z),_(null)},onClose:()=>_(null)})})(),P&&s.jsx(Vh,{onClose:()=>b(!1),onCreateNew:()=>{b(!1),C(!0)}}),y&&s.jsx(Uh,{rule:y,onConfirm:se,onCancel:()=>j(null)})]})}):s.jsx($h,{})});export{lf as default,rf as meta};
|
|
@@ -64,4 +64,4 @@ Bug`})]})})]}),w&&e.jsx(ve,{isOpen:!0,onClose:k,context:S,defaultEmail:V,screens
|
|
|
64
64
|
opacity: 1;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
`}),t.map(n=>e.jsx(Ke,{toast:n,onClose:a},n.id))]})}function U({entity:t,nameSize:a="11px",pathSize:n="10px",pathMaxLength:c=50,showScenarioCount:r=!1,scenarioCount:d=0,additionalContent:i}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Le,{type:t.entityType||"other"}),e.jsxs(q,{to:`/entity/${t.sha}`,className:"hover:underline shrink-0 cursor-pointer",style:{fontSize:a,fontWeight:500,color:"#000",whiteSpace:"nowrap"},children:[t.name,r&&d>0&&` (${d})`]}),e.jsx(Ae,{filePath:t.filePath,maxLength:c,style:{fontSize:n,color:"#8E8E8E"}})]}),i]})}const Y={fontSize:"9px",color:"#005C75",fontStyle:"italic"};function et({currentRun:t,projectSlug:a,currentEntities:n=[],isAnalysisStarting:c=!1,queuedJobCount:r=0,queueJobs:d=[],currentlyExecuting:i=null,historicalRuns:w=[]}){var Q,X,K;const[M,g]=o.useState(!1),[m,_]=o.useState(!1),[N,j]=o.useState(null),[V,h]=o.useState(new Set),[T,B]=o.useState(new Set),[F,I]=o.useState(!1),k=!!i||d.length>0,S=!!i,y=(i==null?void 0:i.entities)||n,l=!!(t!=null&&t.analysisCompletedAt),u=(t==null?void 0:t.readyToBeCaptured)??0,x=(t==null?void 0:t.capturesCompleted)??0;t!=null&&t.captureCompletedAt||l&&(u===0||x>=u);const b=(t==null?void 0:t.currentEntityShas)&&t.currentEntityShas.length>0,H=k,{lastLine:D}=Ne(a,H),L=S||d.length>0,O=new Set(((Q=i==null?void 0:i.entities)==null?void 0:Q.map(s=>s.sha))||[]),W=w.filter(s=>!(s.currentEntityShas||[]).some(p=>O.has(p))),ie=(()=>{const f=Date.now()-1440*60*1e3;if(t!=null&&t.createdAt&&b){const p=t.analysisCompletedAt||t.createdAt;if(new Date(p).getTime()>f)return!0}if(W.length>0){const p=W[0],E=p.analysisCompletedAt||p.archivedAt||p.createdAt;if(E&&new Date(E).getTime()>f)return!0}return!1})();return o.useEffect(()=>{const s=(i==null?void 0:i.id)||null;k&&!m&&s!==N&&_(!0),!k&&N!==null&&j(null)},[k,i==null?void 0:i.id,m,N]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`fixed bottom-4 right-4 z-9998 bg-white rounded shadow-lg border-2 border-primary-100 transition-all duration-200 ${m?"min-w-[350px] max-w-[500px]":"w-auto"}`,children:[!m&&e.jsxs("div",{onClick:()=>{_(!0),j(null)},className:"flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-gray-50 transition-colors",title:"Click to expand",children:[L?e.jsx(G,{size:16,className:"animate-spin",style:{color:"#005C75"}}):e.jsx("div",{className:"flex items-center justify-center rounded",style:{backgroundColor:"#E0E9EC",width:"20px",height:"20px"},children:e.jsx(J,{size:16,style:{color:"#005C75"}})}),e.jsx("span",{style:{fontSize:"12px",fontWeight:500,color:"#343434"},children:L?"Analyzing...":"Activity: No Activity Yet"}),L&&e.jsx("button",{onClick:s=>{s.stopPropagation(),g(!0)},className:"ml-auto px-2 py-1 rounded transition-colors cursor-pointer",style:{backgroundColor:"#E0E9EC",color:"#005C75",fontSize:"10px",fontWeight:600},children:"View Logs"})]}),m&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[L?e.jsx(G,{size:16,className:"animate-spin",style:{color:"#005C75"}}):e.jsx("div",{className:"flex items-center justify-center rounded",style:{backgroundColor:"#E0E9EC",width:"20px",height:"20px"},children:e.jsx(J,{size:16,style:{color:"#005C75"}})}),e.jsx("span",{style:{fontSize:"12px",fontWeight:500,color:"#343434"},children:L?"Analyzing...":"Activity"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>g(!0),className:"px-2 py-1 rounded transition-colors cursor-pointer",style:{backgroundColor:"#E0E9EC",color:"#005C75",fontSize:"10px",fontWeight:600},children:"View Logs"}),e.jsx("button",{onClick:()=>{_(!1),j((i==null?void 0:i.id)||null)},className:"p-1 rounded transition-colors cursor-pointer",style:{backgroundColor:"#E0E9EC"},title:"Collapse","aria-label":"Collapse",children:e.jsx(ze,{size:16,style:{color:"#646464"}})})]})]}),e.jsx("div",{style:{height:"1px",backgroundColor:"#E0E9EC",margin:"0 12px"}}),e.jsxs("div",{className:"px-3 pt-2 pb-3 space-y-3",children:[L&&i&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(J,{size:12,style:{color:"#005C75"}}),e.jsx("h4",{style:{fontSize:"11px",fontWeight:600,color:"#343434"},children:"Current Activity"})]}),e.jsx("div",{className:"rounded p-2",style:{backgroundColor:"#f5f5f5"},children:y.length>0?e.jsxs("div",{className:"space-y-1.5",children:[(F?y:y.slice(0,3)).map(s=>e.jsx(U,{entity:s,nameSize:"11px",pathSize:"10px",pathMaxLength:150},s.sha)),y.length>3&&e.jsx("button",{onClick:()=>I(s=>!s),className:"cursor-pointer bg-transparent border-none p-0 hover:underline",style:Y,"aria-label":F?"Show fewer entities":`Show ${y.length-3} more entities`,children:F?"Show less":`+${y.length-3} more`}),D&&e.jsx("div",{style:{fontSize:"10px",color:"#005C75",marginTop:"4px"},children:D})]}):e.jsxs("div",{children:[i.entityNames&&i.entityNames.length>0?e.jsxs("div",{className:"space-y-0.5",children:[i.entityNames.slice(0,5).map((s,f)=>e.jsx("div",{style:{fontSize:"11px",color:"#343434"},children:s},f)),i.entityNames.length>5&&e.jsxs("div",{className:"italic",style:{fontSize:"10px",color:"#666"},children:["+",i.entityNames.length-5," ","more"]})]}):e.jsxs("div",{style:{fontSize:"11px",color:"#343434"},children:["Analyzing"," ",((X=i.entityShas)==null?void 0:X.length)||0," ",((K=i.entityShas)==null?void 0:K.length)===1?"entity":"entities","..."]}),D&&e.jsx("div",{style:{fontSize:"10px",color:"#005C75",marginTop:"4px"},children:D})]})})]}),d.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(Be,{size:12,style:{color:"#005C75"}}),e.jsx("h4",{style:{fontSize:"11px",fontWeight:600,color:"#343434"},children:"Queued Activity"})]}),e.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:d.map(s=>{var E,P;const f=V.has(s.id),p=f?s.entities:s.entities.slice(0,3);return e.jsx("div",{className:"rounded p-2",style:{backgroundColor:"#f5f5f5"},children:s.entities.length>0?e.jsxs("div",{className:"space-y-1.5",children:[p.map(A=>e.jsx(U,{entity:A,nameSize:"10px",pathSize:"9px",pathMaxLength:120},A.sha)),s.entities.length>3&&e.jsx("button",{onClick:()=>{h(A=>{const $=new Set(A);return $.has(s.id)?$.delete(s.id):$.add(s.id),$})},className:"cursor-pointer bg-transparent border-none p-0 hover:underline",style:Y,"aria-label":f?"Show fewer entities":`Show ${s.entities.length-3} more entities`,children:f?"Show less":`+${s.entities.length-3} more`})]}):e.jsxs("div",{style:{fontSize:"10px",color:"#343434"},children:[s.type==="analysis"&&e.jsx(e.Fragment,{children:s.entityNames&&s.entityNames.length>0?e.jsxs("div",{className:"space-y-0.5",children:[s.entityNames.slice(0,5).map((A,$)=>e.jsx("div",{children:A},$)),s.entityNames.length>5&&e.jsxs("div",{className:"italic",children:["+",s.entityNames.length-5," more"]})]}):`Analyzing ${((E=s.entityShas)==null?void 0:E.length)||0} ${((P=s.entityShas)==null?void 0:P.length)===1?"entity":"entities"}`}),s.type==="recapture"&&"Recapturing scenario",s.type==="debug-setup"&&"Setting up debug environment"]})},s.id)})})]}),ie&&W.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(Me,{size:12,style:{color:"#005C75"}}),e.jsx("h4",{style:{fontSize:"11px",fontWeight:600,color:"#343434"},children:"Recently Completed"})]}),e.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:W.slice(0,3).map((s,f)=>{const p=s.entities||[],E=s.analysisCompletedAt||s.archivedAt||s.createdAt||"",P=(()=>{if(!E)return"";const C=Date.now()-new Date(E).getTime(),v=Math.floor(C/6e4),R=Math.floor(C/36e5);return R>0?`${R}h ago`:v>0?`${v}m ago`:"just now"})(),A=T.has(f),ae=(A?p:p.slice(0,3)).map(C=>{var v,R,Z;return{...C,scenarioCount:((Z=(R=(v=C.analyses)==null?void 0:v[0])==null?void 0:R.scenarios)==null?void 0:Z.length)||0}});return e.jsx("div",{className:"rounded p-2",style:{backgroundColor:"#f5f5f5"},children:p.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[ae.map((C,v)=>e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(U,{entity:C,nameSize:"10px",pathSize:"9px",pathMaxLength:100,showScenarioCount:!0,scenarioCount:C.scenarioCount})}),v===0&&P&&e.jsx("div",{style:{fontSize:"9px",color:"#8E8E8E",whiteSpace:"nowrap",paddingTop:"2px"},children:P})]},C.sha)),p.length>3&&e.jsx("button",{onClick:()=>{B(C=>{const v=new Set(C);return v.has(f)?v.delete(f):v.add(f),v})},className:"cursor-pointer bg-transparent border-none p-0 hover:underline",style:Y,"aria-label":A?"Show fewer entities":`Show ${p.length-3} more entities`,children:A?"Show less":`+${p.length-3} more`})]})},f)})})]})]}),e.jsx("div",{style:{height:"1px",backgroundColor:"#E0E9EC",margin:"0 12px"}}),e.jsx("div",{className:"px-3 pb-2",children:e.jsx(q,{to:"/activity",className:"text-xs font-medium hover:underline cursor-pointer",style:{color:"#005C75"},children:"View All Activity →"})})]})]}),M&&a&&e.jsx(Se,{projectSlug:a,onClose:()=>g(!1)})]})}const tt="/assets/globals-B17TBSS6.css";function te({text:t,subtext:a,linkText:n,linkTo:c}){const[r,d]=o.useState(!1);return r?null:e.jsx("div",{className:"bg-blue-100 border rounded border-blue-800 shadow-sm mx-6 mt-6",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"shrink-0",children:e.jsx("svg",{className:"w-5 h-5 text-yellow-600",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-blue-900",children:t}),e.jsx("p",{className:"text-xs text-blue-700 mt-0.5",children:a})]}),e.jsx(q,{to:c,className:"shrink-0 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded hover:bg-blue-700 transition-colors",children:n})]}),e.jsx("button",{type:"button",onClick:()=>d(!0),className:"shrink-0 ml-4 p-1 rounded text-blue-600 hover:text-blue-800 hover:bg-blue-100 transition-colors cursor-pointer","aria-label":"Dismiss banner",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M6 18L18 6M6 6l12 12"})})})]})})}function st({version:t}){return e.jsx("div",{className:"px-6 sm:px-12 pb-8 mt-auto pt-8",children:e.jsxs("div",{className:"border-t border-cygray-30 pt-6 flex flex-wrap justify-between items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"font-mono text-sm font-semibold tracking-widest text-cyblack-100",children:"CODEYAM"}),t&&e.jsx("span",{className:"font-mono text-xs text-gray-400",children:t})]}),e.jsxs("div",{className:"flex items-center gap-4 font-mono text-xs uppercase tracking-widest",children:[e.jsx("a",{href:"https://blog.codeyam.com/",target:"_blank",rel:"noopener noreferrer",className:"text-cyblack-100 underline underline-offset-4 hover:text-primary-100",children:"Read the Blog"}),e.jsx("span",{className:"text-cygray-30",children:"|"}),e.jsx("a",{href:"https://discord.gg/x4uAgaRdwF",target:"_blank",rel:"noopener noreferrer",className:"text-cyblack-100 underline underline-offset-4 hover:text-primary-100",children:"Join Discord"})]})]})})}function it({serverVersion:t}){const[a,n]=o.useState("stale"),[c,r]=o.useState(null),d=async()=>{n("restarting"),r(null);try{if(!(await fetch("/api/restart-server",{method:"POST"})).ok)throw new Error("Failed to restart server");n("reconnecting");let w=0;const M=30,g=1e3,m=async()=>{try{if((await fetch("/api/health")).ok){window.location.reload();return}}catch{}w++,w<M?setTimeout(()=>void m(),g):(r("Server took too long to restart. Please refresh manually."),n("stale"))};setTimeout(()=>void m(),500)}catch(i){r(i instanceof Error?i.message:"Failed to restart server"),n("stale")}};return e.jsx("div",{className:"bg-amber-100 border rounded border-amber-700 shadow-sm mx-6 mt-6",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 py-3 flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"shrink-0",children:e.jsx("svg",{className:"w-5 h-5 text-amber-600",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),e.jsxs("div",{className:"flex-1",children:[a==="stale"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm font-medium text-amber-900",children:"Dashboard server is out of date"}),e.jsxs("p",{className:"text-xs text-amber-700 mt-0.5",children:["Server version: ",t,". A newer version of CodeYam CLI is installed. Restart the server to get the latest features."]}),c&&e.jsx("p",{className:"text-xs text-red-600 mt-1",children:c})]}),a==="restarting"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm font-medium text-amber-900",children:"Restarting server..."}),e.jsx("p",{className:"text-xs text-amber-700 mt-0.5",children:"Please wait while the server restarts."})]}),a==="reconnecting"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm font-medium text-amber-900",children:"Reconnecting..."}),e.jsx("p",{className:"text-xs text-amber-700 mt-0.5",children:"Waiting for the server to come back online."})]})]}),a==="stale"&&e.jsx("button",{type:"button",onClick:()=>void d(),className:"shrink-0 px-4 py-2 bg-amber-600 text-white text-sm font-medium rounded hover:bg-amber-700 transition-colors cursor-pointer",children:"Restart Server"}),(a==="restarting"||a==="reconnecting")&&e.jsxs("div",{className:"shrink-0 flex items-center gap-2 px-4 py-2 text-amber-700 text-sm",children:[e.jsxs("svg",{className:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),a==="restarting"?"Stopping...":"Reconnecting..."]})]})})})}function at({currentVersion:t,latestVersion:a}){const[n,c]=o.useState(!1);if(n)return null;const r="npm install -g @codeyam/codeyam-cli@latest && codeyam stop && codeyam";return e.jsx("div",{className:"bg-emerald-100 border rounded border-emerald-700 shadow-sm mx-6 mt-6",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"shrink-0",children:e.jsx("svg",{className:"w-5 h-5 text-emerald-600",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M7 11l5-5m0 0l5 5m-5-5v12"})})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-emerald-900",children:"A new version of CodeYam CLI is available"}),e.jsxs("p",{className:"text-xs text-emerald-700 mt-0.5",children:["Current: ",t," → Latest: ",a]})]}),e.jsxs("div",{className:"shrink-0 flex items-center gap-2",children:[e.jsx("code",{className:"text-xs bg-emerald-200 text-emerald-900 px-2 py-1.5 rounded font-mono",children:r}),e.jsx(Te,{content:r,label:"Copy",copiedLabel:"Copied!",className:"px-3 py-1.5 bg-emerald-600 text-white text-xs font-medium rounded hover:bg-emerald-700 transition-colors"})]})]}),e.jsx("button",{type:"button",onClick:()=>c(!0),className:"shrink-0 ml-4 p-1 rounded text-emerald-600 hover:text-emerald-800 hover:bg-emerald-200 transition-colors cursor-pointer","aria-label":"Dismiss banner",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M6 18L18 6M6 6l12 12"})})})]})})}const wt=()=>[{rel:"stylesheet",href:tt},{rel:"icon",type:"image/x-icon",href:"/favicon.ico"}];function nt(){const{currentRun:t,projectSlug:a,currentEntities:n,availableAPIKeys:c,queuedJobCount:r,queueJobs:d,currentlyExecuting:i,historicalRuns:w,isServerOutOfDate:M,serverVersion:g,npmUpdate:m,labs:_,simulationsEnabled:N,isSimulationsReady:j,isAdmin:V,editorMode:h,displayVersion:T}=he(),{toasts:B,closeToast:F}=we(),I=xe(),k=o.useRef(I),S=se();o.useEffect(()=>{k.current=I},[I]);const y=S.pathname.startsWith("/entity/")&&S.pathname.includes("/edit/")||S.pathname.startsWith("/dev/")||S.pathname.startsWith("/editor"),l=S.pathname.includes("/fullscreen")||S.pathname.startsWith("/editor");return o.useEffect(()=>{const u=new EventSource("/api/events");let x=null,b=0;const H=2e3;return u.addEventListener("message",D=>{const L=JSON.parse(D.data);if(L.type==="queue")k.current.revalidate(),b=Date.now();else if(L.type==="db-change"||L.type==="unknown"){const O=Date.now(),W=O-b;W<H?(x&&clearTimeout(x),x=setTimeout(()=>{k.current.revalidate(),b=Date.now(),x=null},H-W)):(k.current.revalidate(),b=O)}}),u.addEventListener("error",D=>{console.error("SSE connection error:",D)}),()=>{x&&clearTimeout(x),u.close()}},[]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`min-h-screen ${y?"":"grid"} bg-cygray-10`,style:y?void 0:{gridTemplateColumns:"65px minmax(0, 1fr)"},children:[!y&&e.jsx(Xe,{labs:_,isAdmin:V,editorMode:h}),e.jsxs("div",{className:"max-h-screen overflow-auto bg-cygray-10 flex flex-col min-h-screen",children:[M&&e.jsx(it,{serverVersion:g}),m&&m.currentVersion&&e.jsx(at,{currentVersion:m.currentVersion,latestVersion:m.latestVersion}),N&&c.length===0&&e.jsx(te,{text:"No AI API keys configured. Please provide an AI API key at your earliest convenience.",subtext:"An API key is required for stable, frequent use of CodeYam",linkText:"Configure API Keys",linkTo:"/settings"}),N&&!j&&e.jsx(te,{text:"Simulations enabled but not yet configured",subtext:"Run /codeyam-setup in Claude Code to install the analyzer and configure your dev server",linkText:"View Labs",linkTo:"/labs"}),e.jsx("div",{className:"flex-1",children:e.jsx(pe,{})}),e.jsx(st,{version:T})]})]}),e.jsx(Ze,{toasts:B,onClose:F}),!l&&N&&e.jsx(et,{currentRun:t,projectSlug:a,currentEntities:n,isAnalysisStarting:!1,queuedJobCount:r,queueJobs:d,currentlyExecuting:i,historicalRuns:w})]})}const Nt=re(function(){return e.jsxs("html",{lang:"en",children:[e.jsxs("head",{children:[e.jsx("meta",{charSet:"utf-8"}),e.jsx("meta",{name:"viewport",content:"width=device-width,initial-scale=1"}),e.jsx(le,{}),e.jsx(ce,{})]}),e.jsxs("body",{children:[e.jsx(Ce,{children:e.jsx(ke,{children:e.jsx(nt,{})})}),e.jsx(de,{}),e.jsx(me,{})]})]})});export{Nt as default,wt as links};
|
|
67
|
+
`}),t.map(n=>e.jsx(Ke,{toast:n,onClose:a},n.id))]})}function U({entity:t,nameSize:a="11px",pathSize:n="10px",pathMaxLength:c=50,showScenarioCount:r=!1,scenarioCount:d=0,additionalContent:i}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Le,{type:t.entityType||"other"}),e.jsxs(q,{to:`/entity/${t.sha}`,className:"hover:underline shrink-0 cursor-pointer",style:{fontSize:a,fontWeight:500,color:"#000",whiteSpace:"nowrap"},children:[t.name,r&&d>0&&` (${d})`]}),e.jsx(Ae,{filePath:t.filePath,maxLength:c,style:{fontSize:n,color:"#8E8E8E"}})]}),i]})}const Y={fontSize:"9px",color:"#005C75",fontStyle:"italic"};function et({currentRun:t,projectSlug:a,currentEntities:n=[],isAnalysisStarting:c=!1,queuedJobCount:r=0,queueJobs:d=[],currentlyExecuting:i=null,historicalRuns:w=[]}){var Q,X,K;const[M,g]=o.useState(!1),[m,_]=o.useState(!1),[N,j]=o.useState(null),[V,h]=o.useState(new Set),[T,B]=o.useState(new Set),[F,I]=o.useState(!1),k=!!i||d.length>0,S=!!i,y=(i==null?void 0:i.entities)||n,l=!!(t!=null&&t.analysisCompletedAt),u=(t==null?void 0:t.readyToBeCaptured)??0,x=(t==null?void 0:t.capturesCompleted)??0;t!=null&&t.captureCompletedAt||l&&(u===0||x>=u);const b=(t==null?void 0:t.currentEntityShas)&&t.currentEntityShas.length>0,H=k,{lastLine:D}=Ne(a,H),L=S||d.length>0,O=new Set(((Q=i==null?void 0:i.entities)==null?void 0:Q.map(s=>s.sha))||[]),W=w.filter(s=>!(s.currentEntityShas||[]).some(p=>O.has(p))),ie=(()=>{const f=Date.now()-1440*60*1e3;if(t!=null&&t.createdAt&&b){const p=t.analysisCompletedAt||t.createdAt;if(new Date(p).getTime()>f)return!0}if(W.length>0){const p=W[0],E=p.analysisCompletedAt||p.archivedAt||p.createdAt;if(E&&new Date(E).getTime()>f)return!0}return!1})();return o.useEffect(()=>{const s=(i==null?void 0:i.id)||null;k&&!m&&s!==N&&_(!0),!k&&N!==null&&j(null)},[k,i==null?void 0:i.id,m,N]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`fixed bottom-4 right-4 z-9998 bg-white rounded shadow-lg border-2 border-primary-100 transition-all duration-200 ${m?"min-w-[350px] max-w-[500px]":"w-auto"}`,children:[!m&&e.jsxs("div",{onClick:()=>{_(!0),j(null)},className:"flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-gray-50 transition-colors",title:"Click to expand",children:[L?e.jsx(G,{size:16,className:"animate-spin",style:{color:"#005C75"}}):e.jsx("div",{className:"flex items-center justify-center rounded",style:{backgroundColor:"#E0E9EC",width:"20px",height:"20px"},children:e.jsx(J,{size:16,style:{color:"#005C75"}})}),e.jsx("span",{style:{fontSize:"12px",fontWeight:500,color:"#343434"},children:L?"Analyzing...":"Activity: No Activity Yet"}),L&&e.jsx("button",{onClick:s=>{s.stopPropagation(),g(!0)},className:"ml-auto px-2 py-1 rounded transition-colors cursor-pointer",style:{backgroundColor:"#E0E9EC",color:"#005C75",fontSize:"10px",fontWeight:600},children:"View Logs"})]}),m&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[L?e.jsx(G,{size:16,className:"animate-spin",style:{color:"#005C75"}}):e.jsx("div",{className:"flex items-center justify-center rounded",style:{backgroundColor:"#E0E9EC",width:"20px",height:"20px"},children:e.jsx(J,{size:16,style:{color:"#005C75"}})}),e.jsx("span",{style:{fontSize:"12px",fontWeight:500,color:"#343434"},children:L?"Analyzing...":"Activity"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>g(!0),className:"px-2 py-1 rounded transition-colors cursor-pointer",style:{backgroundColor:"#E0E9EC",color:"#005C75",fontSize:"10px",fontWeight:600},children:"View Logs"}),e.jsx("button",{onClick:()=>{_(!1),j((i==null?void 0:i.id)||null)},className:"p-1 rounded transition-colors cursor-pointer",style:{backgroundColor:"#E0E9EC"},title:"Collapse","aria-label":"Collapse",children:e.jsx(ze,{size:16,style:{color:"#646464"}})})]})]}),e.jsx("div",{style:{height:"1px",backgroundColor:"#E0E9EC",margin:"0 12px"}}),e.jsxs("div",{className:"px-3 pt-2 pb-3 space-y-3",children:[L&&i&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(J,{size:12,style:{color:"#005C75"}}),e.jsx("h4",{style:{fontSize:"11px",fontWeight:600,color:"#343434"},children:"Current Activity"})]}),e.jsx("div",{className:"rounded p-2",style:{backgroundColor:"#f5f5f5"},children:y.length>0?e.jsxs("div",{className:"space-y-1.5",children:[(F?y:y.slice(0,3)).map(s=>e.jsx(U,{entity:s,nameSize:"11px",pathSize:"10px",pathMaxLength:150},s.sha)),y.length>3&&e.jsx("button",{onClick:()=>I(s=>!s),className:"cursor-pointer bg-transparent border-none p-0 hover:underline",style:Y,"aria-label":F?"Show fewer entities":`Show ${y.length-3} more entities`,children:F?"Show less":`+${y.length-3} more`}),D&&e.jsx("div",{style:{fontSize:"10px",color:"#005C75",marginTop:"4px"},children:D})]}):e.jsxs("div",{children:[i.entityNames&&i.entityNames.length>0?e.jsxs("div",{className:"space-y-0.5",children:[i.entityNames.slice(0,5).map((s,f)=>e.jsx("div",{style:{fontSize:"11px",color:"#343434"},children:s},f)),i.entityNames.length>5&&e.jsxs("div",{className:"italic",style:{fontSize:"10px",color:"#666"},children:["+",i.entityNames.length-5," ","more"]})]}):e.jsxs("div",{style:{fontSize:"11px",color:"#343434"},children:["Analyzing"," ",((X=i.entityShas)==null?void 0:X.length)||0," ",((K=i.entityShas)==null?void 0:K.length)===1?"entity":"entities","..."]}),D&&e.jsx("div",{style:{fontSize:"10px",color:"#005C75",marginTop:"4px"},children:D})]})})]}),d.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(Be,{size:12,style:{color:"#005C75"}}),e.jsx("h4",{style:{fontSize:"11px",fontWeight:600,color:"#343434"},children:"Queued Activity"})]}),e.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:d.map(s=>{var E,P;const f=V.has(s.id),p=f?s.entities:s.entities.slice(0,3);return e.jsx("div",{className:"rounded p-2",style:{backgroundColor:"#f5f5f5"},children:s.entities.length>0?e.jsxs("div",{className:"space-y-1.5",children:[p.map(A=>e.jsx(U,{entity:A,nameSize:"10px",pathSize:"9px",pathMaxLength:120},A.sha)),s.entities.length>3&&e.jsx("button",{onClick:()=>{h(A=>{const $=new Set(A);return $.has(s.id)?$.delete(s.id):$.add(s.id),$})},className:"cursor-pointer bg-transparent border-none p-0 hover:underline",style:Y,"aria-label":f?"Show fewer entities":`Show ${s.entities.length-3} more entities`,children:f?"Show less":`+${s.entities.length-3} more`})]}):e.jsxs("div",{style:{fontSize:"10px",color:"#343434"},children:[s.type==="analysis"&&e.jsx(e.Fragment,{children:s.entityNames&&s.entityNames.length>0?e.jsxs("div",{className:"space-y-0.5",children:[s.entityNames.slice(0,5).map((A,$)=>e.jsx("div",{children:A},$)),s.entityNames.length>5&&e.jsxs("div",{className:"italic",children:["+",s.entityNames.length-5," more"]})]}):`Analyzing ${((E=s.entityShas)==null?void 0:E.length)||0} ${((P=s.entityShas)==null?void 0:P.length)===1?"entity":"entities"}`}),s.type==="recapture"&&"Recapturing scenario",s.type==="debug-setup"&&"Setting up debug environment"]})},s.id)})})]}),ie&&W.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(Me,{size:12,style:{color:"#005C75"}}),e.jsx("h4",{style:{fontSize:"11px",fontWeight:600,color:"#343434"},children:"Recently Completed"})]}),e.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:W.slice(0,3).map((s,f)=>{const p=s.entities||[],E=s.analysisCompletedAt||s.archivedAt||s.createdAt||"",P=(()=>{if(!E)return"";const C=Date.now()-new Date(E).getTime(),v=Math.floor(C/6e4),R=Math.floor(C/36e5);return R>0?`${R}h ago`:v>0?`${v}m ago`:"just now"})(),A=T.has(f),ae=(A?p:p.slice(0,3)).map(C=>{var v,R,Z;return{...C,scenarioCount:((Z=(R=(v=C.analyses)==null?void 0:v[0])==null?void 0:R.scenarios)==null?void 0:Z.length)||0}});return e.jsx("div",{className:"rounded p-2",style:{backgroundColor:"#f5f5f5"},children:p.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[ae.map((C,v)=>e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(U,{entity:C,nameSize:"10px",pathSize:"9px",pathMaxLength:100,showScenarioCount:!0,scenarioCount:C.scenarioCount})}),v===0&&P&&e.jsx("div",{style:{fontSize:"9px",color:"#8E8E8E",whiteSpace:"nowrap",paddingTop:"2px"},children:P})]},C.sha)),p.length>3&&e.jsx("button",{onClick:()=>{B(C=>{const v=new Set(C);return v.has(f)?v.delete(f):v.add(f),v})},className:"cursor-pointer bg-transparent border-none p-0 hover:underline",style:Y,"aria-label":A?"Show fewer entities":`Show ${p.length-3} more entities`,children:A?"Show less":`+${p.length-3} more`})]})},f)})})]})]}),e.jsx("div",{style:{height:"1px",backgroundColor:"#E0E9EC",margin:"0 12px"}}),e.jsx("div",{className:"px-3 pb-2",children:e.jsx(q,{to:"/activity",className:"text-xs font-medium hover:underline cursor-pointer",style:{color:"#005C75"},children:"View All Activity →"})})]})]}),M&&a&&e.jsx(Se,{projectSlug:a,onClose:()=>g(!1)})]})}const tt="/assets/globals-h1-1oFYI.css";function te({text:t,subtext:a,linkText:n,linkTo:c}){const[r,d]=o.useState(!1);return r?null:e.jsx("div",{className:"bg-blue-100 border rounded border-blue-800 shadow-sm mx-6 mt-6",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"shrink-0",children:e.jsx("svg",{className:"w-5 h-5 text-yellow-600",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-blue-900",children:t}),e.jsx("p",{className:"text-xs text-blue-700 mt-0.5",children:a})]}),e.jsx(q,{to:c,className:"shrink-0 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded hover:bg-blue-700 transition-colors",children:n})]}),e.jsx("button",{type:"button",onClick:()=>d(!0),className:"shrink-0 ml-4 p-1 rounded text-blue-600 hover:text-blue-800 hover:bg-blue-100 transition-colors cursor-pointer","aria-label":"Dismiss banner",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M6 18L18 6M6 6l12 12"})})})]})})}function st({version:t}){return e.jsx("div",{className:"px-6 sm:px-12 pb-8 mt-auto pt-8",children:e.jsxs("div",{className:"border-t border-cygray-30 pt-6 flex flex-wrap justify-between items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"font-mono text-sm font-semibold tracking-widest text-cyblack-100",children:"CODEYAM"}),t&&e.jsx("span",{className:"font-mono text-xs text-gray-400",children:t})]}),e.jsxs("div",{className:"flex items-center gap-4 font-mono text-xs uppercase tracking-widest",children:[e.jsx("a",{href:"https://blog.codeyam.com/",target:"_blank",rel:"noopener noreferrer",className:"text-cyblack-100 underline underline-offset-4 hover:text-primary-100",children:"Read the Blog"}),e.jsx("span",{className:"text-cygray-30",children:"|"}),e.jsx("a",{href:"https://discord.gg/x4uAgaRdwF",target:"_blank",rel:"noopener noreferrer",className:"text-cyblack-100 underline underline-offset-4 hover:text-primary-100",children:"Join Discord"})]})]})})}function it({serverVersion:t}){const[a,n]=o.useState("stale"),[c,r]=o.useState(null),d=async()=>{n("restarting"),r(null);try{if(!(await fetch("/api/restart-server",{method:"POST"})).ok)throw new Error("Failed to restart server");n("reconnecting");let w=0;const M=30,g=1e3,m=async()=>{try{if((await fetch("/api/health")).ok){window.location.reload();return}}catch{}w++,w<M?setTimeout(()=>void m(),g):(r("Server took too long to restart. Please refresh manually."),n("stale"))};setTimeout(()=>void m(),500)}catch(i){r(i instanceof Error?i.message:"Failed to restart server"),n("stale")}};return e.jsx("div",{className:"bg-amber-100 border rounded border-amber-700 shadow-sm mx-6 mt-6",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 py-3 flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"shrink-0",children:e.jsx("svg",{className:"w-5 h-5 text-amber-600",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),e.jsxs("div",{className:"flex-1",children:[a==="stale"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm font-medium text-amber-900",children:"Dashboard server is out of date"}),e.jsxs("p",{className:"text-xs text-amber-700 mt-0.5",children:["Server version: ",t,". A newer version of CodeYam CLI is installed. Restart the server to get the latest features."]}),c&&e.jsx("p",{className:"text-xs text-red-600 mt-1",children:c})]}),a==="restarting"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm font-medium text-amber-900",children:"Restarting server..."}),e.jsx("p",{className:"text-xs text-amber-700 mt-0.5",children:"Please wait while the server restarts."})]}),a==="reconnecting"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm font-medium text-amber-900",children:"Reconnecting..."}),e.jsx("p",{className:"text-xs text-amber-700 mt-0.5",children:"Waiting for the server to come back online."})]})]}),a==="stale"&&e.jsx("button",{type:"button",onClick:()=>void d(),className:"shrink-0 px-4 py-2 bg-amber-600 text-white text-sm font-medium rounded hover:bg-amber-700 transition-colors cursor-pointer",children:"Restart Server"}),(a==="restarting"||a==="reconnecting")&&e.jsxs("div",{className:"shrink-0 flex items-center gap-2 px-4 py-2 text-amber-700 text-sm",children:[e.jsxs("svg",{className:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),a==="restarting"?"Stopping...":"Reconnecting..."]})]})})})}function at({currentVersion:t,latestVersion:a}){const[n,c]=o.useState(!1);if(n)return null;const r="npm install -g @codeyam/codeyam-cli@latest && codeyam stop && codeyam";return e.jsx("div",{className:"bg-emerald-100 border rounded border-emerald-700 shadow-sm mx-6 mt-6",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"shrink-0",children:e.jsx("svg",{className:"w-5 h-5 text-emerald-600",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M7 11l5-5m0 0l5 5m-5-5v12"})})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-emerald-900",children:"A new version of CodeYam CLI is available"}),e.jsxs("p",{className:"text-xs text-emerald-700 mt-0.5",children:["Current: ",t," → Latest: ",a]})]}),e.jsxs("div",{className:"shrink-0 flex items-center gap-2",children:[e.jsx("code",{className:"text-xs bg-emerald-200 text-emerald-900 px-2 py-1.5 rounded font-mono",children:r}),e.jsx(Te,{content:r,label:"Copy",copiedLabel:"Copied!",className:"px-3 py-1.5 bg-emerald-600 text-white text-xs font-medium rounded hover:bg-emerald-700 transition-colors"})]})]}),e.jsx("button",{type:"button",onClick:()=>c(!0),className:"shrink-0 ml-4 p-1 rounded text-emerald-600 hover:text-emerald-800 hover:bg-emerald-200 transition-colors cursor-pointer","aria-label":"Dismiss banner",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M6 18L18 6M6 6l12 12"})})})]})})}const wt=()=>[{rel:"stylesheet",href:tt},{rel:"icon",type:"image/x-icon",href:"/favicon.ico"}];function nt(){const{currentRun:t,projectSlug:a,currentEntities:n,availableAPIKeys:c,queuedJobCount:r,queueJobs:d,currentlyExecuting:i,historicalRuns:w,isServerOutOfDate:M,serverVersion:g,npmUpdate:m,labs:_,simulationsEnabled:N,isSimulationsReady:j,isAdmin:V,editorMode:h,displayVersion:T}=he(),{toasts:B,closeToast:F}=we(),I=xe(),k=o.useRef(I),S=se();o.useEffect(()=>{k.current=I},[I]);const y=S.pathname.startsWith("/entity/")&&S.pathname.includes("/edit/")||S.pathname.startsWith("/dev/")||S.pathname.startsWith("/editor"),l=S.pathname.includes("/fullscreen")||S.pathname.startsWith("/editor");return o.useEffect(()=>{const u=new EventSource("/api/events");let x=null,b=0;const H=2e3;return u.addEventListener("message",D=>{const L=JSON.parse(D.data);if(L.type==="queue")k.current.revalidate(),b=Date.now();else if(L.type==="db-change"||L.type==="unknown"){const O=Date.now(),W=O-b;W<H?(x&&clearTimeout(x),x=setTimeout(()=>{k.current.revalidate(),b=Date.now(),x=null},H-W)):(k.current.revalidate(),b=O)}}),u.addEventListener("error",D=>{console.error("SSE connection error:",D)}),()=>{x&&clearTimeout(x),u.close()}},[]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`min-h-screen ${y?"":"grid"} bg-cygray-10`,style:y?void 0:{gridTemplateColumns:"65px minmax(0, 1fr)"},children:[!y&&e.jsx(Xe,{labs:_,isAdmin:V,editorMode:h}),e.jsxs("div",{className:"max-h-screen overflow-auto bg-cygray-10 flex flex-col min-h-screen",children:[M&&e.jsx(it,{serverVersion:g}),m&&m.currentVersion&&e.jsx(at,{currentVersion:m.currentVersion,latestVersion:m.latestVersion}),N&&c.length===0&&e.jsx(te,{text:"No AI API keys configured. Please provide an AI API key at your earliest convenience.",subtext:"An API key is required for stable, frequent use of CodeYam",linkText:"Configure API Keys",linkTo:"/settings"}),N&&!j&&e.jsx(te,{text:"Simulations enabled but not yet configured",subtext:"Run /codeyam-setup in Claude Code to install the analyzer and configure your dev server",linkText:"View Labs",linkTo:"/labs"}),e.jsx("div",{className:"flex-1",children:e.jsx(pe,{})}),e.jsx(st,{version:T})]})]}),e.jsx(Ze,{toasts:B,onClose:F}),!l&&N&&e.jsx(et,{currentRun:t,projectSlug:a,currentEntities:n,isAnalysisStarting:!1,queuedJobCount:r,queueJobs:d,currentlyExecuting:i,historicalRuns:w})]})}const Nt=re(function(){return e.jsxs("html",{lang:"en",children:[e.jsxs("head",{children:[e.jsx("meta",{charSet:"utf-8"}),e.jsx("meta",{name:"viewport",content:"width=device-width,initial-scale=1"}),e.jsx(le,{}),e.jsx(ce,{})]}),e.jsxs("body",{children:[e.jsx(Ce,{children:e.jsx(ke,{children:e.jsx(nt,{})})}),e.jsx(de,{}),e.jsx(me,{})]})]})});export{Nt as default,wt as links};
|
package/codeyam-cli/src/webserver/build/server/assets/{index-BLhjL9Xi.js → index-Bh_pNxNA.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"fetch-retry";import{G as Z,H as _,I as $,J as aa,K as ta,L as oa,M as sa,P as ia,S as ra,d as ma,a as ea,b as pa,c as la,e as na,f as da,g as ba,h as ua,i as ca,j as Ca,k as Ta,C as ha,F as ya,E as Ba,D as Sa,l as Aa,m as ga,n as Ea,o as Fa,p as Pa,q as ja,r as Da,s as Ma,t as fa,u as qa,v as xa,w as Ga,x as Ha,y as Ja,z as La,A as Ua,B as ka}from"./server-build-
|
|
1
|
+
import"fetch-retry";import{G as Z,H as _,I as $,J as aa,K as ta,L as oa,M as sa,P as ia,S as ra,d as ma,a as ea,b as pa,c as la,e as na,f as da,g as ba,h as ua,i as ca,j as Ca,k as Ta,C as ha,F as ya,E as Ba,D as Sa,l as Aa,m as ga,n as Ea,o as Fa,p as Pa,q as ja,r as Da,s as Ma,t as fa,u as qa,v as xa,w as Ga,x as Ha,y as Ja,z as La,A as Ua,B as ka}from"./server-build-Bqr22tlO.js";import"typescript";import"kysely";import"react/jsx-runtime";import"node:stream";import"@react-router/node";import"react-router";import"isbot";import"react-dom/server";import"react";import"lucide-react";import"better-sqlite3";import"pg";import"fs";import"path";import"kysely/helpers/sqlite";import"kysely/helpers/postgres";import"fs/promises";import"os";import"prompts";import"chalk";import"crypto";import"child_process";import"url";import"util";import"dotenv";import"events";import"uuid";import"http";import"net";import"ws";import"node-pty";import"openai";import"p-queue";import"p-retry";import"@aws-sdk/client-dynamodb";import"lru-cache";import"pluralize";import"piscina";import"json5";import"@aws-sdk/util-dynamodb";import"v8";import"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"minimatch";import"react-markdown";import"remark-gfm";import"react-diff-viewer-continued";export{Z as AnalysisBranchesTableColumns,_ as BranchesTableColumns,$ as CommitsTableColumns,aa as CommitsTableColumnsLite,ta as EntitiesTableColumns,oa as EntityBranchesTableColumns,sa as FilesTableColumns,ia as ProjectsTableColumns,ra as ScenariosTableColumns,ma as dbToAnalysis,ea as dbToAnalysisBranch,pa as dbToBranch,la as dbToCommit,na as dbToEntity,da as dbToFile,ba as dbToProject,ua as dbToScenario,ca as dbToUserScenario,Ca as deleteScenarios,Ta as generateSha,ha as getDatabase,ya as getJsonHelper,Ba as getPostgreDatabase,Sa as getSqliteDatabase,Aa as loadAnalyses,ga as loadAnalysis,Ea as loadBranches,Fa as loadCommitBranches,Pa as loadCommits,ja as loadEntities,Da as loadEntity,Ma as loadFiles,fa as loadProject,qa as updateCommitMetadata,xa as updateFreshAnalysisMetadata,Ga as updateFreshAnalysisStatus,Ha as updateProjectMetadata,Ja as upsertCommitBranches,La as upsertCommits,Ua as upsertGithubUser,ka as upsertScenarios};
|