loki-mode 9.53.0 → 9.54.2
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/SKILL.md +2 -2
- package/VERSION +1 -1
- package/autonomy/completion-council.sh +28 -5
- package/autonomy/council-v2.sh +13 -7
- package/autonomy/lib/done-recognition.sh +24 -16
- package/autonomy/lib/proof-check.sh +11 -3
- package/autonomy/lib/proof-generator.py +36 -5
- package/autonomy/lib/voter-agents.sh +8 -3
- package/autonomy/lib/workspace_diff.py +106 -12
- package/autonomy/prd-checklist.sh +19 -11
- package/autonomy/run.sh +503 -52
- package/dashboard/__init__.py +1 -1
- package/dashboard/api_v2.py +4 -0
- package/dashboard/audit.py +9 -1
- package/dashboard/auth.py +16 -4
- package/dashboard/registry.py +34 -12
- package/dashboard/rigour_integration.py +25 -17
- package/dashboard/server.py +252 -104
- package/dashboard/static/cost.html +55 -26
- package/dashboard/static/index.html +475 -1544
- package/dashboard/static/proofs.html +1 -1
- package/docs/INSTALLATION.md +1 -1
- package/docs/air-gapped.md +7 -2
- package/docs/image-provenance.md +4 -2
- package/docs/v10/BACKLOG.md +82 -2
- package/docs/v10/BOARD.md +105 -0
- package/docs/v10/DECISIONS.md +71 -0
- package/docs/v10/METRICS.md +2 -1
- package/docs/v10/PROGRESS.md +60 -0
- package/docs/v10/SWARM-PROMPT.md +98 -0
- package/docs/v10/SWARM.md +237 -0
- package/loki-ts/dist/loki.js +323 -322
- package/mcp/__init__.py +1 -1
- package/package.json +1 -1
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
- package/providers/aider.sh +8 -0
- package/providers/cline.sh +8 -0
- package/providers/codex.sh +9 -0
- package/providers/opencode.sh +9 -0
- package/web-app/dist/assets/AdminPage-CZrBkzRF.js +32 -0
- package/web-app/dist/assets/Avatar-gQIp6FBI.js +11 -0
- package/web-app/dist/assets/{Badge-BF3mhT57.js → Badge-D2_fBTFY.js} +1 -1
- package/web-app/dist/assets/{Button-BDp9aJ9q.js → Button-D5qDd2ef.js} +1 -1
- package/web-app/dist/assets/CockpitPage-DVMk2RUK.js +47 -0
- package/web-app/dist/assets/ComparePage-NMLyE1xL.js +1 -0
- package/web-app/dist/assets/{ErrorBoundary-ut3wrUmu.js → ErrorBoundary-BRABI-BT.js} +1 -1
- package/web-app/dist/assets/EvidenceReceiptPanel-D2LNKqUx.js +1 -0
- package/web-app/dist/assets/GitHubIssuesPanel-BC5GzKUN.js +7 -0
- package/web-app/dist/assets/{GitHubPRsPanel-DurZgSaj.js → GitHubPRsPanel-BSlmoVTS.js} +3 -3
- package/web-app/dist/assets/HomePage-D_CDMoen.js +12 -0
- package/web-app/dist/assets/{LoginPage-HeRGJeZy.js → LoginPage-BBNA_N9t.js} +1 -1
- package/web-app/dist/assets/{MagicPage-CUKrqsZs.js → MagicPage-CnFRZCMx.js} +1 -1
- package/web-app/dist/assets/MetricsPage-CPfLMRlh.js +6 -0
- package/web-app/dist/assets/{NotFoundPage-BZDZ-B77.js → NotFoundPage-lA0XSGTz.js} +1 -1
- package/web-app/dist/assets/ProjectPage-CNAPbr9z.js +256 -0
- package/web-app/dist/assets/ProjectsPage-CMtm8goN.js +6 -0
- package/web-app/dist/assets/SettingsPage-BhIjVMYE.js +10 -0
- package/web-app/dist/assets/{ShowcasePage-BGS2jTGH.js → ShowcasePage-BndtGeYo.js} +1 -1
- package/web-app/dist/assets/SystemSettingsPage-euXI-KXE.js +1 -0
- package/web-app/dist/assets/TeamsPage-ClUKecun.js +11 -0
- package/web-app/dist/assets/TemplatesPage-BWHWVk0L.js +29 -0
- package/web-app/dist/assets/{TerminalOutput-togzv9Zl.js → TerminalOutput-Cv3N3Szf.js} +1 -1
- package/web-app/dist/assets/{activity-Dreyb_Kr.js → activity-dEhz-bXR.js} +1 -1
- package/web-app/dist/assets/{bell-DWH0drES.js → bell-B3XUMq1t.js} +1 -1
- package/web-app/dist/assets/{bot-78MoCuDl.js → bot-X-ssNlwR.js} +1 -1
- package/web-app/dist/assets/{check-ikfylPst.js → check-C_9Nx7kb.js} +1 -1
- package/web-app/dist/assets/{chevron-left-DXUqkd8J.js → chevron-left-tvNswo3A.js} +1 -1
- package/web-app/dist/assets/{circle-alert-Da74VO8P.js → circle-alert-CSB88nEs.js} +1 -1
- package/web-app/dist/assets/{clock-mlGCFq8l.js → clock-C8p2e4NI.js} +1 -1
- package/web-app/dist/assets/{cloud-B_Y5ZrIO.js → cloud-CKp2ZvhG.js} +1 -1
- package/web-app/dist/assets/{code-xml-Bbom7YWV.js → code-xml-dY70LCHD.js} +1 -1
- package/web-app/dist/assets/{database-CLcofiVp.js → database-DObn5fmn.js} +1 -1
- package/web-app/dist/assets/{dollar-sign-C5mkjXIM.js → dollar-sign-DSu6n3K3.js} +1 -1
- package/web-app/dist/assets/{file-code-corner-CVrkaOQP.js → file-code-corner-DpCnS73z.js} +1 -1
- package/web-app/dist/assets/{file-plus-BV9240gX.js → file-plus-D3IPKCf1.js} +1 -1
- package/web-app/dist/assets/{globe-aZ0Zso4I.js → globe-C9QXkgH_.js} +1 -1
- package/web-app/dist/assets/{hammer-EgOQNukG.js → hammer-D_FtWe1y.js} +1 -1
- package/web-app/dist/assets/index-CI54rara.css +1 -0
- package/web-app/dist/assets/{index-DvZ0Kk2x.js → index-Cz7q1bvC.js} +2 -2
- package/web-app/dist/assets/{layers-BOVKmepE.js → layers-DsW7jnJX.js} +1 -1
- package/web-app/dist/assets/{loader-circle-0K8yLgHl.js → loader-circle-B3HspjKR.js} +1 -1
- package/web-app/dist/assets/{lock-XzlDMy8M.js → lock-DSI29pct.js} +1 -1
- package/web-app/dist/assets/{package-BtXTKusI.js → package-CLNxtA2x.js} +1 -1
- package/web-app/dist/assets/{plus-PxeiD8ju.js → plus-DyI4WC4_.js} +1 -1
- package/web-app/dist/assets/{refresh-cw-CjqzYczt.js → refresh-cw-D2dv0xA0.js} +1 -1
- package/web-app/dist/assets/{rotate-ccw-CY0os4DH.js → rotate-ccw-CBvihA-a.js} +1 -1
- package/web-app/dist/assets/scroll-text-DvoOvAl_.js +6 -0
- package/web-app/dist/assets/{server-pIIs9vNp.js → server-DenWvSUt.js} +1 -1
- package/web-app/dist/assets/{shield-alert-CsDqKXwA.js → shield-alert-40cX_FvG.js} +1 -1
- package/web-app/dist/assets/{thumbs-up-CAh3HVzH.js → thumbs-up-BrjZ6QuV.js} +12 -7
- package/web-app/dist/assets/trash-2-C6evwkEH.js +16 -0
- package/web-app/dist/assets/{trending-down-DrtBd_C9.js → trending-down-CfbZis3O.js} +1 -1
- package/web-app/dist/assets/{trending-up-D-DbCHXm.js → trending-up-DWuEK3WC.js} +1 -1
- package/web-app/dist/assets/{upload-D4l6DCOt.js → upload-B9DFBcPG.js} +1 -1
- package/web-app/dist/assets/{usePolling-D0aoTX80.js → usePolling-BryVC-T1.js} +1 -1
- package/web-app/dist/assets/{user-BQf_XJO_.js → user-DMRXwZiw.js} +1 -1
- package/web-app/dist/index.html +2 -2
- package/web-app/server.py +122 -47
- package/web-app/dist/assets/AdminPage-y6_b2Xo4.js +0 -32
- package/web-app/dist/assets/Avatar-BFPkXhIJ.js +0 -6
- package/web-app/dist/assets/CockpitPage-5TKICCoA.js +0 -47
- package/web-app/dist/assets/ComparePage-BSuNsUHy.js +0 -1
- package/web-app/dist/assets/EvidenceReceiptPanel-CcaBwEI-.js +0 -1
- package/web-app/dist/assets/GitHubIssuesPanel-DJeYgzAa.js +0 -12
- package/web-app/dist/assets/HomePage-Bs451LAy.js +0 -28
- package/web-app/dist/assets/MetricsPage-DvY1csgz.js +0 -6
- package/web-app/dist/assets/ProjectPage-CqHkEZkl.js +0 -257
- package/web-app/dist/assets/ProjectsPage-CLvCK1Y8.js +0 -6
- package/web-app/dist/assets/SettingsPage-DP7OmdwP.js +0 -10
- package/web-app/dist/assets/SystemSettingsPage-P_rlLh0x.js +0 -1
- package/web-app/dist/assets/TeamsPage-DxtBDcBC.js +0 -11
- package/web-app/dist/assets/TemplatesPage-5e-faH3W.js +0 -29
- package/web-app/dist/assets/folder-open-D_6yV78G.js +0 -11
- package/web-app/dist/assets/index-BSgmPwC0.css +0 -1
- package/web-app/dist/assets/lightbulb-DdASgqOG.js +0 -6
- package/web-app/dist/assets/mail-COu670_W.js +0 -6
- package/web-app/dist/assets/minus-bQpUt9ff.js +0 -6
- package/web-app/dist/assets/save-v8qep5cY.js +0 -6
- package/web-app/dist/assets/trash-2-Dt6urTyY.js +0 -6
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as P,j as e,r as n,u as B,a as N,m as D,k as T,E as L,e as R}from"./index-Cz7q1bvC.js";import{B as w}from"./Button-D5qDd2ef.js";import{B as _}from"./Badge-D2_fBTFY.js";import{u as z}from"./usePolling-BryVC-T1.js";import{R as A}from"./refresh-cw-D2dv0xA0.js";import{P as C}from"./plus-DyI4WC4_.js";import{F as M,C as O,T as $}from"./trash-2-C6evwkEH.js";import"./clock-C8p2e4NI.js";import"./circle-alert-CSB88nEs.js";import"./check-C_9Nx7kb.js";/**
|
|
2
|
+
* @license lucide-react v0.577.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const U=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],I=P("ellipsis-vertical",U),Y={none:"p-0",sm:"p-3",md:"p-4",lg:"p-6"};function q({hover:s=!1,padding:a="md",className:o="",children:c,onClick:i}){return e.jsx("div",{role:i?"button":void 0,tabIndex:i?0:void 0,onClick:i,onKeyDown:i?r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),i())}:void 0,className:["bg-white border border-[#ECEAE3] rounded-[5px] shadow-card group",s&&"hover:shadow-card-hover transition-shadow duration-200",i&&"cursor-pointer",Y[a],o].filter(Boolean).join(" "),children:c})}function H({onRefresh:s,threshold:a=80,enabled:o=!0}){const c=n.useRef(null),[i,r]=n.useState(!1),[d,x]=n.useState(!1),[l,p]=n.useState(0),m=n.useRef(0),h=n.useRef(!1),g=n.useCallback(u=>{if(!o||d)return;const f=c.current;f&&f.scrollTop<=0&&(m.current=u.touches[0].clientY,h.current=!0)},[o,d]),j=n.useCallback(u=>{if(!o||!h.current||d)return;const f=u.touches[0].clientY-m.current;if(f>0){const b=Math.min(f*.5,120);p(b),r(!0)}else h.current=!1,r(!1),p(0)},[o,d]),v=n.useCallback(async()=>{if(!(!o||!h.current))if(h.current=!1,l>=a){x(!0),p(0),r(!1);try{await s()}finally{x(!1)}}else p(0),r(!1)},[o,l,a,s]);return n.useEffect(()=>{const u=c.current;if(!(!u||!o))return u.addEventListener("touchstart",g,{passive:!0}),u.addEventListener("touchmove",j,{passive:!0}),u.addEventListener("touchend",v,{passive:!0}),()=>{u.removeEventListener("touchstart",g),u.removeEventListener("touchmove",j),u.removeEventListener("touchend",v)}},[o,g,j,v]),{ref:c,pulling:i,refreshing:d,pullDistance:l}}function K(s){const a=X(s);return a==="completed"?"completed":a==="running"?"running":a==="failed"?"failed":a==="started"?"started":"empty"}const V={completed:"Completed",complete:"Completed",done:"Completed",completion_promise_fulfilled:"Completed",running:"Running",in_progress:"Running",planning:"Planning",started:"Started",error:"Failed",failed:"Failed",empty:"Empty"};function X(s){return{completion_promise_fulfilled:"completed",complete:"completed",done:"completed",in_progress:"running",planning:"running",error:"failed"}[s]||s}const G=[{key:"all",label:"All"},{key:"running",label:"Running"},{key:"completed",label:"Completed"},{key:"failed",label:"Failed"}];function ie(){const s=B(),[a,o]=n.useState(""),[c,i]=n.useState("all"),[r,d]=n.useState(null),[x,l]=n.useState(!1),[p,m]=n.useState(null),h=n.useCallback(()=>N.getSessionsHistory(),[]),{data:g,refresh:j}=z(h,15e3,!0),{ref:v,pulling:u,refreshing:f,pullDistance:b}=H({onRefresh:async()=>{j()},enabled:!0}),E=n.useMemo(()=>{if(!g)return[];let t=g;if(c!=="all"&&(t=t.filter(y=>y.status===c)),a.trim()){const y=a.trim().toLowerCase();t=t.filter(F=>F.prd_snippet.toLowerCase().includes(y))}return t},[g,c,a]),k=t=>{navigator.clipboard.writeText(t),m("Path copied"),setTimeout(()=>m(null),2e3)},S=async()=>{if(r){l(!0);try{await N.deleteSession(r.id),d(null),m("Project deleted"),setTimeout(()=>m(null),3e3),j()}catch(t){m(`Delete failed: ${t instanceof Error?t.message:"Unknown error"}`),setTimeout(()=>m(null),5e3)}finally{l(!1)}}};return e.jsxs("div",{ref:v,className:"max-w-[1400px] mx-auto px-6 max-md:px-4 py-8 overflow-auto h-full",children:[(u||f)&&e.jsx("div",{className:"flex items-center justify-center py-3",children:f?e.jsx("div",{className:"ptr-spinner"}):e.jsx(A,{size:20,className:"text-[#553DE9] transition-transform",style:{transform:`rotate(${Math.min(b*3,360)}deg)`,opacity:Math.min(b/80,1)}})}),e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h1",{className:"font-heading text-h1 max-md:text-h2 text-[#36342E]",children:"Projects"}),e.jsx(w,{icon:C,onClick:()=>s("/"),children:"New Project"})]}),e.jsxs("div",{className:"flex items-center max-md:flex-col gap-4 max-md:gap-3 mb-6",children:[e.jsxs("div",{className:"relative flex-1 max-w-sm",children:[e.jsx(D,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[#6B6960]"}),e.jsx("input",{type:"text",placeholder:"Search projects...","aria-label":"Search projects",value:a,onChange:t=>o(t.target.value),className:"w-full pl-9 pr-3 py-2 text-sm border border-[#ECEAE3] rounded-[5px] bg-white text-[#36342E] placeholder:text-[#939084] focus:outline-none focus:ring-2 focus:ring-[#553DE9]/20 focus:border-[#553DE9]"})]}),e.jsx("div",{className:"flex items-center gap-1",role:"tablist",children:G.map(t=>e.jsx("button",{role:"tab","aria-selected":c===t.key,onClick:()=>i(t.key),className:`px-3 py-1.5 text-xs font-semibold rounded-[3px] transition-colors ${c===t.key?"bg-[#553DE9] text-white":"text-[#6B6960] hover:text-[#36342E] hover:bg-[#F8F4F0]"}`,children:t.label},t.key))})]}),E.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[e.jsx("p",{className:"text-[#6B6960] text-sm mb-4",children:"No projects yet. Start building."}),e.jsx(w,{icon:C,onClick:()=>s("/"),children:"New Project"})]}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:E.map(t=>e.jsx(J,{session:t,onOpen:()=>s(`/project/${t.id}`),onDelete:()=>d(t),onCopyPath:()=>k(t.path)},t.id))}),r&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-md w-full mx-4 p-6",children:[e.jsxs("h2",{className:"text-base font-semibold text-[#36342E] mb-2",children:["Delete ",r.prd_snippet||"Untitled project","?"]}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-6",children:"This will remove all files, dependencies, and state. This cannot be undone."}),e.jsxs("div",{className:"flex items-center justify-end gap-3",children:[e.jsx("button",{onClick:()=>d(null),disabled:x,className:"px-4 py-2 text-sm font-medium text-[#6B6960] hover:text-[#36342E] rounded-[5px] hover:bg-[#F8F4F0] transition-colors disabled:opacity-50",children:"Cancel"}),e.jsx("button",{onClick:S,disabled:x,className:"px-4 py-2 text-sm font-medium text-white bg-red-600 hover:bg-red-700 rounded-[5px] transition-colors disabled:opacity-50",children:x?"Deleting...":"Delete"})]})]})}),p&&e.jsxs("div",{className:"fixed bottom-6 right-6 z-50 px-4 py-3 bg-[#36342E] text-white text-sm rounded-[5px] shadow-lg flex items-center gap-2",children:[p,e.jsx("button",{onClick:()=>m(null),className:"text-white/60 hover:text-white",children:e.jsx(T,{size:14})})]})]})}function J({session:s,onOpen:a,onDelete:o,onCopyPath:c}){const[i,r]=n.useState(!1),d=n.useRef(null);n.useEffect(()=>{if(!i)return;const l=p=>{d.current&&!d.current.contains(p.target)&&r(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[i]);const x=new Date(s.date).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"});return e.jsxs(q,{hover:!0,onClick:a,className:"relative",children:[e.jsxs("div",{className:"absolute top-2.5 right-2.5 z-10",ref:d,children:[e.jsx("button",{onClick:l=>{l.stopPropagation(),r(!i)},"aria-label":"Project options",className:"p-1 rounded-[3px] text-[#B8B5AD] hover:text-[#36342E] hover:bg-[#F8F4F0] transition-colors",children:e.jsx(I,{size:16})}),i&&e.jsxs("div",{className:"absolute right-0 top-8 w-44 bg-white border border-[#ECEAE3] rounded-[5px] shadow-lg py-1 z-20",children:[e.jsxs("button",{onClick:l=>{l.stopPropagation(),r(!1),a()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm text-[#36342E] hover:bg-[#F8F4F0] transition-colors text-left",children:[e.jsx(M,{size:14,className:"text-[#6B6960]"}),"Open project"]}),e.jsxs("button",{onClick:l=>{l.stopPropagation(),r(!1),window.open(`${R}/project/${s.id}`,"_blank")},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm text-[#36342E] hover:bg-[#F8F4F0] transition-colors text-left",children:[e.jsx(L,{size:14,className:"text-[#6B6960]"}),"Open in new tab"]}),e.jsxs("button",{onClick:l=>{l.stopPropagation(),r(!1),c()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm text-[#36342E] hover:bg-[#F8F4F0] transition-colors text-left",children:[e.jsx(O,{size:14,className:"text-[#6B6960]"}),"Copy path"]}),e.jsx("div",{className:"border-t border-[#ECEAE3] my-1"}),e.jsxs("button",{onClick:l=>{l.stopPropagation(),r(!1),o()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm text-red-600 hover:bg-red-50 transition-colors text-left",children:[e.jsx($,{size:14}),"Delete project"]})]})]}),e.jsxs("div",{className:"flex items-center justify-between mb-2 pr-6",children:[e.jsx("span",{className:"text-xs text-[#6B6960]",children:x}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(_,{status:K(s.status),children:V[s.status]||s.status})})]}),e.jsx("h3",{className:"text-sm font-medium text-[#36342E] line-clamp-2 mb-2",children:s.prd_snippet||"Untitled project"}),e.jsx("p",{className:"text-xs text-[#6B6960] truncate",children:s.path})]})}export{ie as default};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{c as st,j as e,r as t,y as he,a as ne,z as at,$ as nt,K as ot,I as it,m as lt,E as rt}from"./index-Cz7q1bvC.js";import{E as ct,R as dt}from"./rotate-ccw-CBvihA-a.js";import{H as ut}from"./hammer-D_FtWe1y.js";import{C as xt}from"./cloud-CKp2ZvhG.js";import{L as mt}from"./loader-circle-B3HspjKR.js";import{C as pt}from"./check-C_9Nx7kb.js";import{C as ft}from"./circle-alert-CSB88nEs.js";/**
|
|
2
|
+
* @license lucide-react v0.577.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const ht=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],bt=st("code",ht);function j({label:n,description:r,value:l,onChange:h,disabled:u=!1}){const g=`toggle-${n.replace(/\s+/g,"-").toLowerCase()}`;return e.jsxs("div",{className:"flex items-center justify-between py-3",children:[e.jsxs("div",{className:"flex-1 mr-4",children:[e.jsx("label",{htmlFor:g,className:"text-sm font-medium text-[#36342E] cursor-pointer",children:n}),r&&e.jsx("p",{className:"text-xs text-[#6B6960] mt-0.5",children:r})]}),e.jsx("button",{id:g,type:"button",role:"switch","aria-checked":l,"aria-label":n,disabled:u,onClick:()=>h(!l),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#553DE9]",l?"bg-[#553DE9]":"bg-[#ECEAE3]",u?"opacity-50 cursor-not-allowed":"cursor-pointer"].filter(Boolean).join(" "),children:e.jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow-sm transform transition-transform duration-200",l?"translate-x-5":"translate-x-0"].join(" ")})})]})}function f({label:n,description:r,options:l,value:h,onChange:u,disabled:g=!1}){const v=`select-${n.replace(/\s+/g,"-").toLowerCase()}`;return e.jsxs("div",{className:"flex items-center justify-between py-3",children:[e.jsxs("div",{className:"flex-1 mr-4",children:[e.jsx("label",{htmlFor:v,className:"text-sm font-medium text-[#36342E]",children:n}),r&&e.jsx("p",{className:"text-xs text-[#6B6960] mt-0.5",children:r})]}),e.jsx("select",{id:v,value:h,onChange:x=>u(x.target.value),disabled:g,"aria-label":n,className:["px-3 py-1.5 text-sm border border-[#ECEAE3] rounded-lg bg-white text-[#36342E] focus:border-[#553DE9] focus:outline-none focus:ring-1 focus:ring-[#553DE9] min-w-[140px]",g?"opacity-50 cursor-not-allowed":"cursor-pointer"].filter(Boolean).join(" "),children:l.map(x=>e.jsx("option",{value:x.value,children:x.label},x.value))})]})}function xe({label:n,description:r,min:l,max:h,value:u,onChange:g,step:v=1,unit:x="",disabled:y=!1}){const w=`slider-${n.replace(/\s+/g,"-").toLowerCase()}`,N=(u-l)/(h-l)*100;return e.jsxs("div",{className:"py-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:w,className:"text-sm font-medium text-[#36342E]",children:n}),r&&e.jsx("p",{className:"text-xs text-[#6B6960] mt-0.5",children:r})]}),e.jsxs("span",{className:"text-sm font-mono text-[#553DE9] min-w-[48px] text-right",children:[u,x]})]}),e.jsx("input",{id:w,type:"range",min:l,max:h,step:v,value:u,onChange:A=>g(Number(A.target.value)),disabled:y,"aria-label":n,"aria-valuemin":l,"aria-valuemax":h,"aria-valuenow":u,className:"w-full h-2 rounded-full appearance-none cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",style:{background:`linear-gradient(to right, #553DE9 0%, #553DE9 ${N}%, #ECEAE3 ${N}%, #ECEAE3 100%)`}}),e.jsxs("div",{className:"flex justify-between mt-1",children:[e.jsxs("span",{className:"text-[11px] text-[#939084]",children:[l,x]}),e.jsxs("span",{className:"text-[11px] text-[#939084]",children:[h,x]})]})]})}function oe({label:n,description:r,type:l="text",value:h,onChange:u,placeholder:g,disabled:v=!1}){const x=`input-${n.replace(/\s+/g,"-").toLowerCase()}`,[y,w]=t.useState(!1),N=l==="password",A=N&&y?"text":l;return e.jsxs("div",{className:"py-3",children:[e.jsxs("div",{className:"mb-1.5",children:[e.jsx("label",{htmlFor:x,className:"text-sm font-medium text-[#36342E]",children:n}),r&&e.jsx("p",{className:"text-xs text-[#6B6960] mt-0.5",children:r})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:x,type:A,value:h,onChange:C=>u(C.target.value),placeholder:g,disabled:v,"aria-label":n,className:["w-full px-3 py-2 text-sm border border-[#ECEAE3] rounded-lg bg-white text-[#36342E] focus:border-[#553DE9] focus:outline-none focus:ring-1 focus:ring-[#553DE9] placeholder:text-[#939084]",N&&"pr-10",v?"opacity-50 cursor-not-allowed":""].filter(Boolean).join(" ")}),N&&e.jsx("button",{type:"button",onClick:()=>w(!y),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-[#939084] hover:text-[#36342E] transition-colors","aria-label":y?"Hide password":"Show password",children:y?e.jsx(ct,{size:16}):e.jsx(he,{size:16})})]})]})}function gt({label:n,className:r=""}){return n?e.jsxs("div",{className:`flex items-center gap-3 ${r}`,children:[e.jsx("span",{className:"flex-1 border-t border-[#ECEAE3] dark:border-[#2A2A30]"}),e.jsx("span",{className:"text-xs text-muted font-medium",children:n}),e.jsx("span",{className:"flex-1 border-t border-[#ECEAE3] dark:border-[#2A2A30]"})]}):e.jsx("hr",{className:`border-t border-[#ECEAE3] dark:border-[#2A2A30] ${r}`})}const be="pl_settings_";function o(n,r){try{const l=localStorage.getItem(`${be}${n}`);return l===null?r:JSON.parse(l)}catch{return r}}function i(n,r){try{localStorage.setItem(`${be}${n}`,JSON.stringify(r))}catch{}}const me=[{id:"general",label:"General",icon:at},{id:"appearance",label:"Appearance",icon:nt},{id:"editor",label:"Editor",icon:bt},{id:"build",label:"Build",icon:ut},{id:"providers",label:"Providers",icon:xt},{id:"shortcuts",label:"Keyboard Shortcuts",icon:ot},{id:"accessibility",label:"Accessibility",icon:he},{id:"about",label:"About",icon:it}],pe=[{id:"claude",name:"Claude",description:"Anthropic Claude Code -- full features (Opus 4.7 default, 1M context)",models:["claude-opus-4-7","claude-sonnet-4-6","claude-haiku-4-5-20251001"],defaultModel:"claude-opus-4-7"},{id:"codex",name:"Codex",description:"OpenAI Codex CLI -- degraded mode",models:["gpt-5.3-codex","o3","o4-mini"],defaultModel:"gpt-5.3-codex"},{id:"gemini",name:"Gemini",description:"Google Gemini CLI -- degraded mode",models:["gemini-3-pro-medium","gemini-2.5-flash","gemini-2.5-pro"],defaultModel:"gemini-3-pro-medium"},{id:"cline",name:"Cline",description:"VS Code extension -- sequential mode",models:["claude-opus-4-7","claude-sonnet-4-6","gpt-4.1"],defaultModel:"claude-opus-4-7"},{id:"aider",name:"Aider",description:"Terminal-based pair programming",models:["claude-opus-4-7","claude-sonnet-4-6","gpt-4.1","ollama_chat/deepseek-coder"],defaultModel:"claude-opus-4-7"}],vt=typeof navigator<"u"&&/Mac/.test(navigator.userAgent),E=vt?"Cmd":"Ctrl",fe=[{action:"Save file",keys:`${E}+S`,category:"File"},{action:"Quick open file",keys:`${E}+P`,category:"File"},{action:"Command palette",keys:`${E}+K`,category:"Navigation"},{action:"Toggle terminal",keys:`${E}+\``,category:"Navigation"},{action:"Start / stop build",keys:`${E}+B`,category:"Build"},{action:"Show keyboard shortcuts",keys:`${E}+?`,category:"Help"},{action:"Close modals",keys:"Escape",category:"Navigation"},{action:"Focus search",keys:`${E}+F`,category:"Navigation"},{action:"Toggle sidebar",keys:`${E}+\\`,category:"Navigation"},{action:"New project",keys:`${E}+N`,category:"File"},{action:"Go to settings",keys:`${E}+,`,category:"Navigation"}];function d({children:n}){return e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-[#939084] mb-3 mt-6 first:mt-0",children:n})}function b(){return e.jsx(gt,{className:"my-1"})}function kt(){var ue;const[n,r]=t.useState("general"),[l,h]=t.useState(()=>o("projectDir","~/projects")),[u,g]=t.useState(()=>o("autoSave",!0)),[v,x]=t.useState(()=>o("autoSaveInterval","15")),[y,w]=t.useState(()=>o("language","en")),[N,A]=t.useState(()=>o("telemetry",!1)),[C,ge]=t.useState(()=>{const a=localStorage.getItem("pl_theme");return a==="light"||a==="dark"?a:"system"}),[B,ve]=t.useState(()=>o("accentColor","purple")),[M,je]=t.useState(()=>o("fontSize","medium")),[T,Ee]=t.useState(()=>o("sidebarPosition","left")),[H,ye]=t.useState(()=>o("compactMode",!1)),[G,Ne]=t.useState(()=>o("animationLevel","full")),[I,Ce]=t.useState(()=>o("editorFont","JetBrains Mono")),[$,Se]=t.useState(()=>o("editorFontSize",14)),[O,we]=t.useState(()=>o("tabSize","2")),[_,ke]=t.useState(()=>o("wordWrap",!0)),[V,Ae]=t.useState(()=>o("lineNumbers",!0)),[W,Fe]=t.useState(()=>o("minimap",!0)),[K,Pe]=t.useState(()=>o("bracketMatching",!0)),[q,De]=t.useState(()=>o("defaultProvider","claude")),[J,Le]=t.useState(()=>o("maxIterations",25)),[U,Be]=t.useState(()=>o("qualityStrictness","standard")),[Q,Me]=t.useState(()=>o("autoDeploy",!1)),[X,Ie]=t.useState(()=>o("budgetLimit","")),[Y,$e]=t.useState(()=>o("buildNotifications",!0)),[Z,ze]=t.useState(()=>o("providerKeys",{})),[ee,Re]=t.useState(()=>o("providerModels",{})),[z,Te]=t.useState(()=>o("providerPriority",["claude","codex","gemini","cline","aider"])),[ie,le]=t.useState(null),[R,te]=t.useState({}),[F,He]=t.useState(()=>o("highContrast",!1)),[P,Ge]=t.useState(()=>o("focusIndicator","default")),[k,Oe]=t.useState(()=>o("motionPref","full")),[se,_e]=t.useState(()=>o("screenReaderAnnouncements",!0)),[D,Ve]=t.useState(()=>o("fontScaling","100")),[re,We]=t.useState(""),[L,ce]=t.useState("");t.useEffect(()=>{i("projectDir",l)},[l]),t.useEffect(()=>{i("autoSave",u)},[u]),t.useEffect(()=>{i("autoSaveInterval",v)},[v]),t.useEffect(()=>{i("language",y)},[y]),t.useEffect(()=>{i("telemetry",N)},[N]),t.useEffect(()=>{if(C==="system"){const a=window.matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.classList.toggle("dark",a),localStorage.removeItem("pl_theme")}else document.documentElement.classList.toggle("dark",C==="dark"),localStorage.setItem("pl_theme",C)},[C]),t.useEffect(()=>{i("accentColor",B)},[B]),t.useEffect(()=>{i("fontSize",M)},[M]),t.useEffect(()=>{i("sidebarPosition",T)},[T]),t.useEffect(()=>{i("compactMode",H)},[H]),t.useEffect(()=>{i("animationLevel",G)},[G]),t.useEffect(()=>{i("editorFont",I)},[I]),t.useEffect(()=>{i("editorFontSize",$)},[$]),t.useEffect(()=>{i("tabSize",O)},[O]),t.useEffect(()=>{i("wordWrap",_)},[_]),t.useEffect(()=>{i("lineNumbers",V)},[V]),t.useEffect(()=>{i("minimap",W)},[W]),t.useEffect(()=>{i("bracketMatching",K)},[K]),t.useEffect(()=>{i("defaultProvider",q)},[q]),t.useEffect(()=>{i("maxIterations",J)},[J]),t.useEffect(()=>{i("qualityStrictness",U)},[U]),t.useEffect(()=>{i("autoDeploy",Q)},[Q]),t.useEffect(()=>{i("budgetLimit",X)},[X]),t.useEffect(()=>{i("buildNotifications",Y)},[Y]),t.useEffect(()=>{i("providerKeys",Z)},[Z]),t.useEffect(()=>{i("providerModels",ee)},[ee]),t.useEffect(()=>{i("providerPriority",z)},[z]),t.useEffect(()=>{i("highContrast",F)},[F]),t.useEffect(()=>{i("focusIndicator",P)},[P]),t.useEffect(()=>{i("motionPref",k)},[k]),t.useEffect(()=>{i("screenReaderAnnouncements",se)},[se]),t.useEffect(()=>{i("fontScaling",D)},[D]),t.useEffect(()=>{const a=parseInt(D,10);return document.documentElement.style.fontSize=`${15*a/100}px`,()=>{document.documentElement.style.fontSize=""}},[D]),t.useEffect(()=>{document.documentElement.classList.toggle("high-contrast",F)},[F]),t.useEffect(()=>{document.documentElement.classList.toggle("reduce-motion",k==="reduced"),document.documentElement.classList.toggle("no-motion",k==="none")},[k]),t.useEffect(()=>{document.documentElement.classList.toggle("enhanced-focus",P==="enhanced")},[P]),t.useEffect(()=>{ne.getStatus().then(a=>We(a.version||"")).catch(()=>{})},[]);const Ke=t.useCallback(async a=>{le(a),te(c=>{const s={...c};return delete s[a],s});try{await ne.setProvider(a);const c=await ne.getCurrentProvider();te(s=>({...s,[a]:c.provider===a?{ok:!0,message:"Set as default in ~/.loki/config.json"}:{ok:!1,message:`Server reports default is still ${c.provider}`}}))}catch(c){te(s=>({...s,[a]:{ok:!1,message:c instanceof Error?c.message:"Could not set default"}}))}finally{le(null)}},[]),de=t.useCallback((a,c)=>{Te(s=>{const m=s.indexOf(a);if(m===-1)return s;const S=c==="up"?m-1:m+1;if(S<0||S>=s.length)return s;const p=[...s];return[p[m],p[S]]=[p[S],p[m]],p})},[]);function qe(){switch(n){case"general":return e.jsx(Je,{});case"appearance":return e.jsx(Ue,{});case"editor":return e.jsx(Qe,{});case"build":return e.jsx(Xe,{});case"providers":return e.jsx(Ye,{});case"shortcuts":return e.jsx(Ze,{});case"accessibility":return e.jsx(et,{});case"about":return e.jsx(tt,{});default:return null}}function Je(){return e.jsxs("div",{children:[e.jsx(d,{children:"Project"}),e.jsx(oe,{label:"Default project directory",description:"New projects will be created in this directory",value:l,onChange:h,placeholder:"~/projects"}),e.jsx(b,{}),e.jsx(d,{children:"Saving"}),e.jsx(j,{label:"Auto-save",description:"Automatically save files when modified",value:u,onChange:g}),e.jsx(f,{label:"Auto-save interval",description:"How often to auto-save open files",options:[{value:"5",label:"5 seconds"},{value:"15",label:"15 seconds"},{value:"30",label:"30 seconds"},{value:"60",label:"60 seconds"}],value:v,onChange:x,disabled:!u}),e.jsx(b,{}),e.jsx(d,{children:"Preferences"}),e.jsx(f,{label:"Language",description:"Interface language",options:[{value:"en",label:"English"}],value:y,onChange:w}),e.jsx(j,{label:"Telemetry",description:"Help improve Purple Lab by sending anonymous usage data",value:N,onChange:A})]})}function Ue(){const a=[{id:"purple",color:"#553DE9",label:"Purple"},{id:"blue",color:"#2563EB",label:"Blue"},{id:"green",color:"#059669",label:"Green"},{id:"orange",color:"#D97706",label:"Orange"},{id:"pink",color:"#DB2777",label:"Pink"}],c={small:"text-xs",medium:"text-sm",large:"text-base"};return e.jsxs("div",{children:[e.jsx(d,{children:"Theme"}),e.jsxs("div",{className:"py-3",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E] block mb-3",children:"Color theme"}),e.jsx("div",{className:"flex gap-3",children:["light","dark","system"].map(s=>e.jsxs("button",{type:"button",onClick:()=>ge(s),className:["flex-1 flex flex-col items-center gap-2 p-3 rounded-lg border-2 transition-colors",C===s?"border-[#553DE9] bg-[#553DE9]/5":"border-[#ECEAE3] hover:border-[#553DE9]/30"].join(" "),"aria-pressed":C===s,children:[e.jsxs("div",{className:["w-full h-12 rounded border flex items-end px-1.5 pb-1.5 gap-1",s==="dark"?"bg-[#1A1A1E] border-[#2A2A30]":s==="light"?"bg-white border-[#ECEAE3]":"bg-gradient-to-r from-white to-[#1A1A1E] border-[#ECEAE3]"].join(" "),children:[e.jsx("div",{className:`w-2 h-4 rounded-sm ${s==="dark"?"bg-[#2A2A30]":"bg-[#ECEAE3]"}`}),e.jsx("div",{className:`w-4 h-3 rounded-sm ${s==="dark"?"bg-[#2A2A30]":"bg-[#ECEAE3]"}`}),e.jsx("div",{className:`w-3 h-5 rounded-sm ${s==="dark"?"bg-[#2A2A30]":"bg-[#ECEAE3]"}`})]}),e.jsx("span",{className:"text-xs font-medium text-[#36342E] capitalize",children:s})]},s))})]}),e.jsx(b,{}),e.jsx(d,{children:"Accent color"}),e.jsx("div",{className:"py-3",children:e.jsx("div",{className:"flex gap-3",children:a.map(s=>e.jsxs("button",{type:"button",onClick:()=>ve(s.id),className:"flex flex-col items-center gap-1.5 group","aria-label":s.label,"aria-pressed":B===s.id,children:[e.jsx("div",{className:["w-8 h-8 rounded-full transition-all",B===s.id?"ring-2 ring-offset-2 ring-[#553DE9] scale-110":"group-hover:scale-105"].join(" "),style:{backgroundColor:s.color}}),e.jsx("span",{className:"text-[11px] text-[#6B6960]",children:s.label})]},s.id))})}),e.jsx(b,{}),e.jsx(d,{children:"Layout"}),e.jsx(f,{label:"Font size",description:"Base font size for the interface",options:[{value:"small",label:"Small"},{value:"medium",label:"Medium"},{value:"large",label:"Large"}],value:M,onChange:je}),e.jsx("div",{className:"pl-4 pb-2",children:e.jsx("span",{className:`${c[M]} text-[#6B6960] italic`,children:"The quick brown fox jumps over the lazy dog."})}),e.jsx(f,{label:"Sidebar position",description:"Which side the navigation sidebar appears on",options:[{value:"left",label:"Left"},{value:"right",label:"Right"}],value:T,onChange:Ee}),e.jsx(j,{label:"Compact mode",description:"Reduce padding and spacing throughout the interface",value:H,onChange:ye}),e.jsx(f,{label:"Animations",description:"Control interface transition animations",options:[{value:"full",label:"Full"},{value:"reduced",label:"Reduced"},{value:"none",label:"None"}],value:G,onChange:Ne})]})}function Qe(){return e.jsxs("div",{children:[e.jsx(d,{children:"Font"}),e.jsx(f,{label:"Font family",description:"Font used in the code editor",options:[{value:"JetBrains Mono",label:"JetBrains Mono"},{value:"Fira Code",label:"Fira Code"},{value:"Source Code Pro",label:"Source Code Pro"},{value:"Consolas",label:"Consolas"}],value:I,onChange:Ce}),e.jsx(xe,{label:"Font size",description:"Size of text in the code editor",min:12,max:24,value:$,onChange:Se,unit:"px"}),e.jsxs("div",{className:"my-3 rounded-lg border border-[#ECEAE3] overflow-hidden",children:[e.jsx("div",{className:"bg-[#FAF9F6] px-3 py-1.5 border-b border-[#ECEAE3]",children:e.jsx("span",{className:"text-[11px] text-[#939084]",children:"Preview"})}),e.jsx("div",{className:"bg-white p-4",children:e.jsx("pre",{className:"text-[#36342E] leading-relaxed",style:{fontFamily:`"${I}", monospace`,fontSize:`${$}px`},children:`function greet(name) {
|
|
7
|
+
return \`Hello, \${name}!\`;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
greet("world");`})})]}),e.jsx(b,{}),e.jsx(d,{children:"Formatting"}),e.jsx(f,{label:"Tab size",description:"Number of spaces per tab",options:[{value:"2",label:"2 spaces"},{value:"4",label:"4 spaces"},{value:"8",label:"8 spaces"}],value:O,onChange:we}),e.jsx(j,{label:"Word wrap",description:"Wrap long lines to fit the editor width",value:_,onChange:ke}),e.jsx(b,{}),e.jsx(d,{children:"Display"}),e.jsx(j,{label:"Line numbers",description:"Show line numbers in the gutter",value:V,onChange:Ae}),e.jsx(j,{label:"Minimap",description:"Show a miniature overview of the file",value:W,onChange:Fe}),e.jsx(j,{label:"Bracket matching",description:"Highlight matching brackets",value:K,onChange:Pe})]})}function Xe(){return e.jsxs("div",{children:[e.jsx(d,{children:"Provider"}),e.jsx(f,{label:"Default provider",description:"AI provider to use for new builds",options:pe.map(a=>({value:a.id,label:a.name})),value:q,onChange:De}),e.jsx(b,{}),e.jsx(d,{children:"Execution"}),e.jsx(xe,{label:"Max iterations",description:"Maximum number of RARV iterations per build",min:5,max:50,value:J,onChange:Le,step:5}),e.jsx(f,{label:"Quality gate strictness",description:"How strict the quality gates are during builds",options:[{value:"relaxed",label:"Relaxed"},{value:"standard",label:"Standard"},{value:"strict",label:"Strict"}],value:U,onChange:Be}),e.jsx(b,{}),e.jsx(d,{children:"Automation"}),e.jsx(j,{label:"Auto-deploy on success",description:"Automatically deploy when build completes successfully",value:Q,onChange:Me}),e.jsx(oe,{label:"Budget limit",description:"Maximum spend per build (leave empty for unlimited)",type:"number",value:X,onChange:Ie,placeholder:"e.g. 10.00"}),e.jsx(j,{label:"Build notifications",description:"Show browser notifications for build events",value:Y,onChange:$e})]})}function Ye(){return e.jsxs("div",{children:[e.jsx(d,{children:"Configured providers"}),e.jsx("div",{className:"flex flex-col gap-4 mt-2",children:z.map((a,c)=>{var m,S;const s=pe.find(p=>p.id===a);return s?e.jsxs("div",{className:"border border-[#ECEAE3] rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-6 h-6 flex items-center justify-center rounded-full bg-[#553DE9]/10 text-[#553DE9] text-xs font-bold",children:c+1}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-[#36342E]",children:s.name}),e.jsx("p",{className:"text-xs text-[#6B6960]",children:s.description})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{type:"button",onClick:()=>de(s.id,"up"),disabled:c===0,className:"px-2 py-1 text-xs text-[#6B6960] hover:text-[#36342E] disabled:opacity-30 disabled:cursor-not-allowed","aria-label":`Move ${s.name} up`,children:"Up"}),e.jsx("button",{type:"button",onClick:()=>de(s.id,"down"),disabled:c===z.length-1,className:"px-2 py-1 text-xs text-[#6B6960] hover:text-[#36342E] disabled:opacity-30 disabled:cursor-not-allowed","aria-label":`Move ${s.name} down`,children:"Down"})]})]}),e.jsx(oe,{label:"API key",type:"password",value:Z[s.id]||"",onChange:p=>ze(ae=>({...ae,[s.id]:p})),placeholder:`Enter ${s.name} API key`}),e.jsx(f,{label:"Model",options:s.models.map(p=>({value:p,label:p})),value:ee[s.id]||s.defaultModel,onChange:p=>Re(ae=>({...ae,[s.id]:p}))}),e.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[e.jsxs("button",{type:"button",onClick:()=>Ke(s.id),disabled:ie!==null,title:"Writes the default provider to ~/.loki/config.json. Does not test a connection.",className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium border border-[#553DE9] text-[#553DE9] hover:bg-[#E8E4FD] rounded-lg transition-colors disabled:opacity-50",children:[ie===s.id?e.jsx(mt,{size:12,className:"animate-spin"}):null,"Set as default (~/.loki/config.json)"]}),((m=R[s.id])==null?void 0:m.ok)===!0&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-[#059669]",children:[e.jsx(pt,{size:12})," ",R[s.id].message]}),((S=R[s.id])==null?void 0:S.ok)===!1&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-[#C45B5B] break-all",children:[e.jsx(ft,{size:12,className:"flex-shrink-0"})," ",R[s.id].message]})]})]},s.id):null})}),e.jsx("div",{className:"mt-4 p-3 rounded-lg bg-[#FAF9F6] border border-[#ECEAE3]",children:e.jsxs("p",{className:"text-xs text-[#6B6960]",children:["The order, API keys and models on this page are saved in this browser only; builds do not read them. Provider failover is configured with ",e.jsx("code",{children:"loki failover --chain"}),'. "Set as default" is the only action here that writes to the server (the provider field in ~/.loki/config.json).']})})]})}function Ze(){const a=L?fe.filter(s=>s.action.toLowerCase().includes(L.toLowerCase())||s.keys.toLowerCase().includes(L.toLowerCase())||s.category.toLowerCase().includes(L.toLowerCase())):fe,c=[...new Set(a.map(s=>s.category))];return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(lt,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[#939084]"}),e.jsx("input",{type:"text",value:L,onChange:s=>ce(s.target.value),placeholder:"Search shortcuts...",className:"w-full pl-8 pr-3 py-2 text-sm border border-[#ECEAE3] rounded-lg bg-white text-[#36342E] focus:border-[#553DE9] focus:outline-none focus:ring-1 focus:ring-[#553DE9] placeholder:text-[#939084]","aria-label":"Search keyboard shortcuts"})]}),e.jsxs("button",{type:"button",onClick:()=>ce(""),className:"inline-flex items-center gap-1.5 px-3 py-2 text-xs text-[#6B6960] hover:text-[#36342E] border border-[#ECEAE3] rounded-lg hover:bg-[#F8F4F0] transition-colors",children:[e.jsx(dt,{size:12}),"Reset to defaults"]})]}),c.map(s=>e.jsxs("div",{children:[e.jsx(d,{children:s}),e.jsx("div",{className:"flex flex-col",children:a.filter(m=>m.category===s).map(m=>e.jsxs("div",{className:"flex items-center justify-between py-2.5 px-2 rounded-lg hover:bg-[#FAF9F6]",children:[e.jsx("span",{className:"text-sm text-[#36342E]",children:m.action}),e.jsx("kbd",{className:"px-2.5 py-1 text-xs font-mono bg-[#FAF9F6] border border-[#ECEAE3] rounded-md text-[#6B6960]",children:m.keys})]},m.action))})]},s)),e.jsx("div",{className:"mt-6 p-3 rounded-lg bg-[#FAF9F6] border border-[#ECEAE3]",children:e.jsxs("p",{className:"text-xs text-[#6B6960]",children:["Press ",e.jsxs("kbd",{className:"px-1.5 py-0.5 text-[11px] font-mono bg-white border border-[#ECEAE3] rounded",children:[E,"+?"]})," anywhere to see keyboard shortcuts."]})})]})}function et(){return e.jsxs("div",{children:[e.jsx(d,{children:"Vision"}),e.jsx(j,{label:"High contrast mode",description:"Increase contrast for text and UI elements",value:F,onChange:He}),e.jsx(f,{label:"Focus indicators",description:"Visibility of keyboard focus outlines",options:[{value:"default",label:"Default"},{value:"enhanced",label:"Enhanced (thicker, more visible)"}],value:P,onChange:Ge}),e.jsx(f,{label:"Font scaling",description:"Scale all text in the interface",options:[{value:"100",label:"100%"},{value:"125",label:"125%"},{value:"150",label:"150%"}],value:D,onChange:Ve}),e.jsx(b,{}),e.jsx(d,{children:"Motion"}),e.jsx(f,{label:"Motion preference",description:"Control animations and transitions",options:[{value:"full",label:"Full -- all animations enabled"},{value:"reduced",label:"Reduced -- minimal animations"},{value:"none",label:"None -- no animations"}],value:k,onChange:Oe}),e.jsx(b,{}),e.jsx(d,{children:"Screen reader"}),e.jsx(j,{label:"Screen reader announcements",description:"Enable additional ARIA live region announcements",value:se,onChange:_e}),e.jsx("div",{className:"mt-6 p-3 rounded-lg bg-[#FAF9F6] border border-[#ECEAE3]",children:e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Purple Lab is designed to work with assistive technologies. All interactive elements include proper ARIA labels and keyboard navigation support. If you encounter accessibility issues, please report them via the About section."})})]})}function tt(){return e.jsxs("div",{children:[e.jsx(d,{children:"Purple Lab"}),e.jsxs("div",{className:"py-3",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#553DE9] flex items-center justify-center",children:e.jsx("span",{className:"text-white font-heading font-bold text-lg",children:"PL"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-heading font-bold text-[#36342E]",children:"Purple Lab"}),e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Powered by Loki Mode"})]})]}),e.jsxs("div",{className:"border border-[#ECEAE3] rounded-lg divide-y divide-[#ECEAE3]",children:[re&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[e.jsx("span",{className:"text-sm text-[#6B6960]",children:"Version"}),e.jsxs("span",{className:"text-sm font-mono font-medium text-[#36342E]",children:["v",re]})]}),e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[e.jsx("span",{className:"text-sm text-[#6B6960]",children:"Build date"}),e.jsx("span",{className:"text-sm font-mono text-[#36342E]",children:"2026-03-24"})]}),e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[e.jsx("span",{className:"text-sm text-[#6B6960]",children:"License"}),e.jsx("span",{className:"text-sm text-[#36342E]",children:"MIT"})]})]})]}),e.jsx(b,{}),e.jsx(d,{children:"Links"}),e.jsx("div",{className:"flex flex-col gap-1 py-2",children:[{label:"Documentation",href:"https://www.autonomi.dev/docs"},{label:"GitHub",href:"https://github.com/asklokesh/loki-mode"},{label:"Changelog",href:"https://github.com/asklokesh/loki-mode/blob/main/CHANGELOG.md"},{label:"Report a bug",href:"https://github.com/asklokesh/loki-mode/issues/new"}].map(a=>e.jsxs("a",{href:a.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between px-3 py-2.5 rounded-lg text-sm text-[#36342E] hover:bg-[#FAF9F6] transition-colors group",children:[e.jsx("span",{children:a.label}),e.jsx(rt,{size:14,className:"text-[#939084] group-hover:text-[#553DE9] transition-colors"})]},a.label))}),e.jsx(b,{}),e.jsx(d,{children:"Updates"}),e.jsx("div",{className:"py-3",children:e.jsx("button",{type:"button",onClick:()=>{window.open("https://github.com/asklokesh/loki-mode/releases","_blank")},className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium border border-[#553DE9] text-[#553DE9] hover:bg-[#E8E4FD] rounded-lg transition-colors",children:"Check for updates"})})]})}return e.jsxs("div",{className:"flex h-full min-h-0",children:[e.jsx("nav",{className:"w-56 flex-shrink-0 border-r border-[#ECEAE3] bg-[#FAF9F6] overflow-y-auto","aria-label":"Settings categories",children:e.jsxs("div",{className:"px-4 py-5",children:[e.jsx("h1",{className:"font-heading text-lg font-bold text-[#36342E] mb-4",children:"Settings"}),e.jsx("ul",{className:"flex flex-col gap-0.5",children:me.map(a=>{const c=n===a.id;return e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>r(a.id),className:["flex items-center gap-2.5 w-full px-3 py-2 text-sm rounded-lg transition-colors text-left",c?"bg-[#553DE9]/10 text-[#553DE9] font-medium":"text-[#36342E] hover:bg-[#F8F4F0]"].join(" "),"aria-current":c?"page":void 0,children:[e.jsx(a.icon,{size:16}),e.jsx("span",{children:a.label})]})},a.id)})})]})}),e.jsx("main",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-[640px] mx-auto px-8 py-6",children:[e.jsx("h2",{className:"font-heading text-base font-bold text-[#36342E] mb-1",children:(ue=me.find(a=>a.id===n))==null?void 0:ue.label}),e.jsxs("p",{className:"text-xs text-[#6B6960] mb-6",children:[n==="general"&&"Manage general application preferences",n==="appearance"&&"Customize the look and feel of Purple Lab",n==="editor"&&"Configure the code editor behavior and display",n==="build"&&"Control build execution and automation settings",n==="providers"&&"Configure AI provider connections and fallback chain",n==="shortcuts"&&"View and manage keyboard shortcuts",n==="accessibility"&&"Adjust accessibility and assistive technology options",n==="about"&&"Version information and useful links"]}),n!=="shortcuts"&&n!=="about"&&e.jsx("p",{className:"mb-6 -mt-3 px-3 py-2 rounded-lg bg-[#FAF9F6] border border-[#ECEAE3] text-xs text-[#6B6960]",children:"Saved in this browser only. Builds and the server do not read these settings."}),qe()]})})]})}export{kt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,r as c,h as m,i as p,X as h,u}from"./index-DvZ0Kk2x.js";const x=[{label:"Q1 2026",period:"Jan - Mar",features:[{name:"Multi-provider support (5 providers)",status:"completed"},{name:"Memory system with vector search",status:"completed"},{name:"Purple Lab web UI",status:"completed"},{name:"Enterprise auth (OIDC, RBAC)",status:"completed"},{name:"Legacy system healing",status:"completed"}]},{label:"Q2 2026",period:"Apr - Jun",features:[{name:"Real-time collaboration (multi-user)",status:"in-progress"},{name:"Visual workflow builder",status:"in-progress"},{name:"Plugin marketplace",status:"planned"},{name:"Custom agent creation UI",status:"planned"}]},{label:"Q3 2026",period:"Jul - Sep",features:[{name:"Cloud deployment integration",status:"planned"},{name:"Team analytics dashboard",status:"planned"},{name:"AI-powered debugging assistant",status:"planned"},{name:"Mobile companion app",status:"planned"}]},{label:"Q4 2026",period:"Oct - Dec",features:[{name:"Multi-repo orchestration",status:"planned"},{name:"Custom model fine-tuning",status:"planned"},{name:"Compliance report generation",status:"planned"},{name:"On-prem cluster mode",status:"planned"}]}],l={completed:{dot:"bg-[#1FC5A8]",text:"text-[#36342E]",label:"Shipped"},"in-progress":{dot:"bg-[#553DE9]",text:"text-[#36342E]",label:"In Progress"},planned:{dot:"bg-[#939084]",text:"text-[#6B6960]",label:"Planned"}};function b(){return e.jsxs("div",{className:"py-8",children:[e.jsx("h3",{className:"text-xl font-bold text-[#36342E] mb-2",children:"Product Roadmap"}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-8",children:"Where we have been and where we are heading."}),e.jsx("div",{className:"flex gap-6 mb-6",children:["completed","in-progress","planned"].map(t=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${l[t].dot}`}),e.jsx("span",{className:"text-[#6B6960]",children:l[t].label})]},t))}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-[7px] top-2 bottom-2 w-0.5 bg-[#ECEAE3]"}),e.jsx("div",{className:"space-y-8",children:x.map((t,i)=>e.jsxs("div",{className:"relative pl-8",children:[e.jsx("div",{className:`absolute left-0 top-1 w-[15px] h-[15px] rounded-full border-2 border-white shadow-sm ${i===0?"bg-[#1FC5A8]":i===1?"bg-[#553DE9]":"bg-[#ECEAE3]"}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline gap-2 mb-3",children:[e.jsx("h4",{className:"text-base font-bold text-[#36342E]",children:t.label}),e.jsx("span",{className:"text-xs text-[#939084]",children:t.period}),i===1&&e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium rounded-full bg-[#553DE9]/10 text-[#553DE9]",children:"Current"})]}),e.jsx("div",{className:"space-y-2",children:t.features.map(a=>{const s=l[a.status];return e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${s.dot}`}),e.jsx("span",{className:`text-sm ${s.text}`,children:a.name})]},a.name)})})]})]},t.label))})]})]})}const n=[{version:"6.71.1",date:"Mar 24, 2026",features:["BuildProgressBar server integration with cost, ETA, and phase data","Sprint 1 complete: BuildProgressBar, CommandPalette, dark mode, sidebar theme toggle","Quick-start API, dark mode prep, theme hook foundation"]},{version:"6.70.0",date:"Mar 22, 2026",features:["Embedded Loki Dashboard in Purple Lab workspace","Panel toggles, modern UI, bigger fonts, smooth transitions","Sprint 1 foundation with quick-start API"]},{version:"6.69.0",date:"Mar 20, 2026",features:["Purple Lab IDE workspace with Monaco editor","AI chat panel for iterative development","Activity panel with build log and quality gates"]}];function g(){const[t,i]=c.useState(!1),a=t?n:n.slice(0,2);return e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-4 shadow-sm",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h4",{className:"text-sm font-bold text-[#36342E]",children:"Recent Changes"}),e.jsx("a",{href:"https://github.com/asklokesh/loki-mode/blob/main/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#553DE9] hover:text-[#4832c7] font-medium",children:"View all"})]}),e.jsx("div",{className:"space-y-3",children:a.map(s=>e.jsxs("div",{className:"pb-3 border-b border-[#ECEAE3] last:border-b-0 last:pb-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsxs("span",{className:"px-1.5 py-0.5 text-xs font-mono font-bold rounded bg-[#553DE9]/10 text-[#553DE9]",children:["v",s.version]}),e.jsx("span",{className:"text-xs text-[#939084]",children:s.date})]}),e.jsx("ul",{className:"space-y-1",children:s.features.map((r,o)=>e.jsx("li",{className:"text-xs text-[#6B6960] pl-3 relative before:content-[''] before:absolute before:left-0 before:top-[7px] before:w-1.5 before:h-1.5 before:rounded-full before:bg-[#ECEAE3]",children:r},o))})]},s.version))}),n.length>2&&e.jsxs("button",{onClick:()=>i(!t),className:"mt-2 flex items-center gap-1 text-xs text-[#6B6960] hover:text-[#36342E] transition-colors",children:[t?e.jsx(m,{size:12}):e.jsx(p,{size:12}),t?"Show less":`Show ${n.length-2} more`]})]})}const f={default:"bg-[#F8F4F0] text-[#36342E] border-[#ECEAE3] dark:bg-[#222228] dark:text-[#E8E6E3] dark:border-[#2A2A30]",primary:"bg-[#553DE9]/10 text-[#553DE9] border-[#553DE9]/20 dark:bg-[#553DE9]/20 dark:text-[#7B6BEF] dark:border-[#553DE9]/30",success:"bg-[#1FC5A8]/10 text-[#1FC5A8] border-[#1FC5A8]/20",warning:"bg-[#E5A940]/10 text-[#E5A940] border-[#E5A940]/20",danger:"bg-[#C45B5B]/10 text-[#C45B5B] border-[#C45B5B]/20",info:"bg-[#3B82F6]/10 text-[#3B82F6] border-[#3B82F6]/20"};function E({label:t,color:i="default",removable:a=!1,onClick:s,onRemove:r,className:o=""}){return e.jsxs("span",{className:`inline-flex items-center gap-1 px-2.5 py-0.5 text-xs font-medium rounded-full border transition-colors ${f[i]} ${s?"cursor-pointer hover:opacity-80":""} ${o}`,onClick:s,role:s?"button":void 0,children:[t,a&&e.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),r==null||r()},className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-full hover:bg-black/10 dark:hover:bg-white/10 transition-colors","aria-label":`Remove ${t}`,children:e.jsx(h,{size:10})})]})}const w=[{title:"SaaS Dashboard",description:"Admin dashboard with user analytics, charts, and real-time data visualization.",techStack:["React","Tailwind","Chart.js"],buildTime:"~25 min",gradient:"from-[#553DE9] to-[#7B6BEF]",prompt:"Build a SaaS admin dashboard with user analytics, charts showing MRR and churn, and a table of recent signups"},{title:"REST API Server",description:"Production-ready API with authentication, validation, and database integration.",techStack:["Node.js","Express","PostgreSQL"],buildTime:"~20 min",gradient:"from-[#1FC5A8] to-[#38D9A9]",prompt:"Build a REST API server with JWT authentication, user CRUD, input validation, and PostgreSQL database"},{title:"E-commerce Store",description:"Online store with product catalog, cart, checkout, and payment integration.",techStack:["Next.js","Stripe","Prisma"],buildTime:"~45 min",gradient:"from-[#E93D82] to-[#F06595]",prompt:"Build an e-commerce store with product listings, shopping cart, Stripe checkout, and order management"},{title:"Portfolio Website",description:"Personal portfolio with animations, project showcase, and contact form.",techStack:["React","Framer Motion","Tailwind"],buildTime:"~15 min",gradient:"from-[#F59F00] to-[#FCC419]",prompt:"Build a developer portfolio website with animated sections, project gallery, skills list, and contact form"},{title:"CLI Tool",description:"Command-line tool with subcommands, flags, configuration, and colorful output.",techStack:["Node.js","Commander","Chalk"],buildTime:"~15 min",gradient:"from-[#36342E] to-[#6B6960]",prompt:"Build a CLI tool with subcommands for file management: list, copy, move, and search with glob patterns"},{title:"Discord Bot",description:"Interactive bot with slash commands, moderation, and custom responses.",techStack:["Discord.js","Node.js","SQLite"],buildTime:"~20 min",gradient:"from-[#5865F2] to-[#7289DA]",prompt:"Build a Discord bot with slash commands for polls, reminders, moderation (kick/ban), and a leveling system"},{title:"Blog Platform",description:"Full-featured blog with markdown support, categories, and RSS feed.",techStack:["React","MDX","Tailwind"],buildTime:"~30 min",gradient:"from-[#845EF7] to-[#B197FC]",prompt:"Build a blog platform with MDX support, category filtering, search, RSS feed, and a clean reading experience"},{title:"Task Manager",description:"Kanban-style task board with drag-and-drop, labels, and persistence.",techStack:["React","DnD Kit","SQLite"],buildTime:"~25 min",gradient:"from-[#2F71E3] to-[#5C93E8]",prompt:"Build a task manager with kanban board, drag-and-drop cards, labels, due dates, and local SQLite storage"},{title:"Weather App",description:"Weather dashboard with location search, forecasts, and beautiful visualizations.",techStack:["React","OpenWeatherMap","Chart.js"],buildTime:"~15 min",gradient:"from-[#0EA5E9] to-[#38BDF8]",prompt:"Build a weather app with city search, 5-day forecast, current conditions, and temperature charts"},{title:"Chat Application",description:"Real-time chat with rooms, typing indicators, and message history.",techStack:["React","WebSocket","Node.js"],buildTime:"~30 min",gradient:"from-[#22C55E] to-[#4ADE80]",prompt:"Build a real-time chat application with chat rooms, user presence, typing indicators, and message history"},{title:"Landing Page",description:"Conversion-optimized landing page with hero, features, pricing, and CTA sections.",techStack:["HTML","Tailwind","Alpine.js"],buildTime:"~10 min",gradient:"from-[#F97316] to-[#FB923C]",prompt:"Build a SaaS landing page with hero section, feature grid, pricing table, testimonials, and email signup"},{title:"Mobile App",description:"Cross-platform mobile app with navigation, state management, and native features.",techStack:["React Native","Expo","TypeScript"],buildTime:"~35 min",gradient:"from-[#DC2626] to-[#F87171]",prompt:"Build a React Native mobile app with tab navigation, a home feed, profile page, and push notifications setup"}];function j(){const t=u(),i=a=>{sessionStorage.setItem("pl_showcase_prompt",a),t("/")};return e.jsx("div",{className:"min-h-screen bg-[#FAF9F6]",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-bold text-[#36342E]",children:"Showcase"}),e.jsx("p",{className:"text-[#6B6960] mt-1",children:'Explore example projects you can build with Loki Mode. Click "Build This" to start any project instantly.'})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:w.map(a=>e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl overflow-hidden shadow-sm hover:shadow-md transition-shadow flex flex-col",children:[e.jsx("div",{className:`h-28 bg-gradient-to-br ${a.gradient} flex items-end p-4`,children:e.jsx("h3",{className:"text-lg font-bold text-white drop-shadow-sm",children:a.title})}),e.jsxs("div",{className:"p-4 flex-1 flex flex-col",children:[e.jsx("p",{className:"text-sm text-[#6B6960] mb-3",children:a.description}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:a.techStack.map(s=>e.jsx(E,{label:s,color:"default"},s))}),e.jsxs("div",{className:"mt-auto pt-3 border-t border-[#ECEAE3] flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[#939084]",children:["Est. ",a.buildTime]}),e.jsx("button",{onClick:()=>i(a.prompt),className:"px-4 py-1.5 text-sm font-semibold rounded-lg bg-[#553DE9] text-white hover:bg-[#4832c7] transition-colors",children:"Build This"})]})]})]},a.title))}),e.jsx("div",{className:"mt-12",children:e.jsx(b,{})}),e.jsx("div",{className:"mt-8 max-w-md",children:e.jsx(g,{})})]})})}export{j as default};
|
|
1
|
+
import{j as e,r as c,g as m,h as p,X as h,u}from"./index-Cz7q1bvC.js";const x=[{label:"Q1 2026",period:"Jan - Mar",features:[{name:"Multi-provider support (5 providers)",status:"completed"},{name:"Memory system with vector search",status:"completed"},{name:"Purple Lab web UI",status:"completed"},{name:"Enterprise auth (OIDC, RBAC)",status:"completed"},{name:"Legacy system healing",status:"completed"}]},{label:"Q2 2026",period:"Apr - Jun",features:[{name:"Real-time collaboration (multi-user)",status:"in-progress"},{name:"Visual workflow builder",status:"in-progress"},{name:"Plugin marketplace",status:"planned"},{name:"Custom agent creation UI",status:"planned"}]},{label:"Q3 2026",period:"Jul - Sep",features:[{name:"Cloud deployment integration",status:"planned"},{name:"Team analytics dashboard",status:"planned"},{name:"AI-powered debugging assistant",status:"planned"},{name:"Mobile companion app",status:"planned"}]},{label:"Q4 2026",period:"Oct - Dec",features:[{name:"Multi-repo orchestration",status:"planned"},{name:"Custom model fine-tuning",status:"planned"},{name:"Compliance report generation",status:"planned"},{name:"On-prem cluster mode",status:"planned"}]}],l={completed:{dot:"bg-[#1FC5A8]",text:"text-[#36342E]",label:"Shipped"},"in-progress":{dot:"bg-[#553DE9]",text:"text-[#36342E]",label:"In Progress"},planned:{dot:"bg-[#939084]",text:"text-[#6B6960]",label:"Planned"}};function b(){return e.jsxs("div",{className:"py-8",children:[e.jsx("h3",{className:"text-xl font-bold text-[#36342E] mb-2",children:"Product Roadmap"}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-8",children:"Where we have been and where we are heading."}),e.jsx("div",{className:"flex gap-6 mb-6",children:["completed","in-progress","planned"].map(t=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${l[t].dot}`}),e.jsx("span",{className:"text-[#6B6960]",children:l[t].label})]},t))}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-[7px] top-2 bottom-2 w-0.5 bg-[#ECEAE3]"}),e.jsx("div",{className:"space-y-8",children:x.map((t,i)=>e.jsxs("div",{className:"relative pl-8",children:[e.jsx("div",{className:`absolute left-0 top-1 w-[15px] h-[15px] rounded-full border-2 border-white shadow-sm ${i===0?"bg-[#1FC5A8]":i===1?"bg-[#553DE9]":"bg-[#ECEAE3]"}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline gap-2 mb-3",children:[e.jsx("h4",{className:"text-base font-bold text-[#36342E]",children:t.label}),e.jsx("span",{className:"text-xs text-[#939084]",children:t.period}),i===1&&e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium rounded-full bg-[#553DE9]/10 text-[#553DE9]",children:"Current"})]}),e.jsx("div",{className:"space-y-2",children:t.features.map(a=>{const s=l[a.status];return e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${s.dot}`}),e.jsx("span",{className:`text-sm ${s.text}`,children:a.name})]},a.name)})})]})]},t.label))})]})]})}const n=[{version:"6.71.1",date:"Mar 24, 2026",features:["BuildProgressBar server integration with cost, ETA, and phase data","Sprint 1 complete: BuildProgressBar, CommandPalette, dark mode, sidebar theme toggle","Quick-start API, dark mode prep, theme hook foundation"]},{version:"6.70.0",date:"Mar 22, 2026",features:["Embedded Loki Dashboard in Purple Lab workspace","Panel toggles, modern UI, bigger fonts, smooth transitions","Sprint 1 foundation with quick-start API"]},{version:"6.69.0",date:"Mar 20, 2026",features:["Purple Lab IDE workspace with Monaco editor","AI chat panel for iterative development","Activity panel with build log and quality gates"]}];function g(){const[t,i]=c.useState(!1),a=t?n:n.slice(0,2);return e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-4 shadow-sm",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h4",{className:"text-sm font-bold text-[#36342E]",children:"Recent Changes"}),e.jsx("a",{href:"https://github.com/asklokesh/loki-mode/blob/main/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#553DE9] hover:text-[#4832c7] font-medium",children:"View all"})]}),e.jsx("div",{className:"space-y-3",children:a.map(s=>e.jsxs("div",{className:"pb-3 border-b border-[#ECEAE3] last:border-b-0 last:pb-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsxs("span",{className:"px-1.5 py-0.5 text-xs font-mono font-bold rounded bg-[#553DE9]/10 text-[#553DE9]",children:["v",s.version]}),e.jsx("span",{className:"text-xs text-[#939084]",children:s.date})]}),e.jsx("ul",{className:"space-y-1",children:s.features.map((r,o)=>e.jsx("li",{className:"text-xs text-[#6B6960] pl-3 relative before:content-[''] before:absolute before:left-0 before:top-[7px] before:w-1.5 before:h-1.5 before:rounded-full before:bg-[#ECEAE3]",children:r},o))})]},s.version))}),n.length>2&&e.jsxs("button",{onClick:()=>i(!t),className:"mt-2 flex items-center gap-1 text-xs text-[#6B6960] hover:text-[#36342E] transition-colors",children:[t?e.jsx(m,{size:12}):e.jsx(p,{size:12}),t?"Show less":`Show ${n.length-2} more`]})]})}const f={default:"bg-[#F8F4F0] text-[#36342E] border-[#ECEAE3] dark:bg-[#222228] dark:text-[#E8E6E3] dark:border-[#2A2A30]",primary:"bg-[#553DE9]/10 text-[#553DE9] border-[#553DE9]/20 dark:bg-[#553DE9]/20 dark:text-[#7B6BEF] dark:border-[#553DE9]/30",success:"bg-[#1FC5A8]/10 text-[#1FC5A8] border-[#1FC5A8]/20",warning:"bg-[#E5A940]/10 text-[#E5A940] border-[#E5A940]/20",danger:"bg-[#C45B5B]/10 text-[#C45B5B] border-[#C45B5B]/20",info:"bg-[#3B82F6]/10 text-[#3B82F6] border-[#3B82F6]/20"};function E({label:t,color:i="default",removable:a=!1,onClick:s,onRemove:r,className:o=""}){return e.jsxs("span",{className:`inline-flex items-center gap-1 px-2.5 py-0.5 text-xs font-medium rounded-full border transition-colors ${f[i]} ${s?"cursor-pointer hover:opacity-80":""} ${o}`,onClick:s,role:s?"button":void 0,children:[t,a&&e.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),r==null||r()},className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-full hover:bg-black/10 dark:hover:bg-white/10 transition-colors","aria-label":`Remove ${t}`,children:e.jsx(h,{size:10})})]})}const w=[{title:"SaaS Dashboard",description:"Admin dashboard with user analytics, charts, and real-time data visualization.",techStack:["React","Tailwind","Chart.js"],buildTime:"~25 min",gradient:"from-[#553DE9] to-[#7B6BEF]",prompt:"Build a SaaS admin dashboard with user analytics, charts showing MRR and churn, and a table of recent signups"},{title:"REST API Server",description:"Production-ready API with authentication, validation, and database integration.",techStack:["Node.js","Express","PostgreSQL"],buildTime:"~20 min",gradient:"from-[#1FC5A8] to-[#38D9A9]",prompt:"Build a REST API server with JWT authentication, user CRUD, input validation, and PostgreSQL database"},{title:"E-commerce Store",description:"Online store with product catalog, cart, checkout, and payment integration.",techStack:["Next.js","Stripe","Prisma"],buildTime:"~45 min",gradient:"from-[#E93D82] to-[#F06595]",prompt:"Build an e-commerce store with product listings, shopping cart, Stripe checkout, and order management"},{title:"Portfolio Website",description:"Personal portfolio with animations, project showcase, and contact form.",techStack:["React","Framer Motion","Tailwind"],buildTime:"~15 min",gradient:"from-[#F59F00] to-[#FCC419]",prompt:"Build a developer portfolio website with animated sections, project gallery, skills list, and contact form"},{title:"CLI Tool",description:"Command-line tool with subcommands, flags, configuration, and colorful output.",techStack:["Node.js","Commander","Chalk"],buildTime:"~15 min",gradient:"from-[#36342E] to-[#6B6960]",prompt:"Build a CLI tool with subcommands for file management: list, copy, move, and search with glob patterns"},{title:"Discord Bot",description:"Interactive bot with slash commands, moderation, and custom responses.",techStack:["Discord.js","Node.js","SQLite"],buildTime:"~20 min",gradient:"from-[#5865F2] to-[#7289DA]",prompt:"Build a Discord bot with slash commands for polls, reminders, moderation (kick/ban), and a leveling system"},{title:"Blog Platform",description:"Full-featured blog with markdown support, categories, and RSS feed.",techStack:["React","MDX","Tailwind"],buildTime:"~30 min",gradient:"from-[#845EF7] to-[#B197FC]",prompt:"Build a blog platform with MDX support, category filtering, search, RSS feed, and a clean reading experience"},{title:"Task Manager",description:"Kanban-style task board with drag-and-drop, labels, and persistence.",techStack:["React","DnD Kit","SQLite"],buildTime:"~25 min",gradient:"from-[#2F71E3] to-[#5C93E8]",prompt:"Build a task manager with kanban board, drag-and-drop cards, labels, due dates, and local SQLite storage"},{title:"Weather App",description:"Weather dashboard with location search, forecasts, and beautiful visualizations.",techStack:["React","OpenWeatherMap","Chart.js"],buildTime:"~15 min",gradient:"from-[#0EA5E9] to-[#38BDF8]",prompt:"Build a weather app with city search, 5-day forecast, current conditions, and temperature charts"},{title:"Chat Application",description:"Real-time chat with rooms, typing indicators, and message history.",techStack:["React","WebSocket","Node.js"],buildTime:"~30 min",gradient:"from-[#22C55E] to-[#4ADE80]",prompt:"Build a real-time chat application with chat rooms, user presence, typing indicators, and message history"},{title:"Landing Page",description:"Conversion-optimized landing page with hero, features, pricing, and CTA sections.",techStack:["HTML","Tailwind","Alpine.js"],buildTime:"~10 min",gradient:"from-[#F97316] to-[#FB923C]",prompt:"Build a SaaS landing page with hero section, feature grid, pricing table, testimonials, and email signup"},{title:"Mobile App",description:"Cross-platform mobile app with navigation, state management, and native features.",techStack:["React Native","Expo","TypeScript"],buildTime:"~35 min",gradient:"from-[#DC2626] to-[#F87171]",prompt:"Build a React Native mobile app with tab navigation, a home feed, profile page, and push notifications setup"}];function j(){const t=u(),i=a=>{sessionStorage.setItem("pl_showcase_prompt",a),t("/")};return e.jsx("div",{className:"min-h-screen bg-[#FAF9F6]",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-bold text-[#36342E]",children:"Showcase"}),e.jsx("p",{className:"text-[#6B6960] mt-1",children:'Explore example projects you can build with Loki Mode. Click "Build This" to start any project instantly.'})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:w.map(a=>e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl overflow-hidden shadow-sm hover:shadow-md transition-shadow flex flex-col",children:[e.jsx("div",{className:`h-28 bg-gradient-to-br ${a.gradient} flex items-end p-4`,children:e.jsx("h3",{className:"text-lg font-bold text-white drop-shadow-sm",children:a.title})}),e.jsxs("div",{className:"p-4 flex-1 flex flex-col",children:[e.jsx("p",{className:"text-sm text-[#6B6960] mb-3",children:a.description}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:a.techStack.map(s=>e.jsx(E,{label:s,color:"default"},s))}),e.jsxs("div",{className:"mt-auto pt-3 border-t border-[#ECEAE3] flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[#939084]",children:["Est. ",a.buildTime]}),e.jsx("button",{onClick:()=>i(a.prompt),className:"px-4 py-1.5 text-sm font-semibold rounded-lg bg-[#553DE9] text-white hover:bg-[#4832c7] transition-colors",children:"Build This"})]})]})]},a.title))}),e.jsx("div",{className:"mt-12",children:e.jsx(b,{})}),e.jsx("div",{className:"mt-8 max-w-md",children:e.jsx(g,{})})]})})}export{j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a0 as u,r as d,j as e,x as E,T as x,a as b}from"./index-Cz7q1bvC.js";import{S as h}from"./server-DenWvSUt.js";import{H as p}from"./hammer-D_FtWe1y.js";import{B as g}from"./bell-B3XUMq1t.js";import{D as f}from"./database-DObn5fmn.js";import{S as A}from"./shield-alert-40cX_FvG.js";const j=[{id:"claude",name:"Claude",secretKey:"ANTHROPIC_API_KEY",model:"claude-opus-4-7",fallbackOrder:1,enabled:!0},{id:"codex",name:"Codex",secretKey:"OPENAI_API_KEY",model:"gpt-5.3-codex",fallbackOrder:2,enabled:!0},{id:"gemini",name:"Gemini",secretKey:"GOOGLE_API_KEY",model:"gemini-3-pro-medium",fallbackOrder:3,enabled:!1}],k={maxIterations:25,timeoutMinutes:60,qualityGateThreshold:80,autoReview:!0,parallelAgents:3},y={sessionTimeoutMinutes:30,allowedOrigins:"*",rateLimitPerMinute:100,requireMFA:!1,ipAllowlist:""},N={emailEnabled:!1,emailAddress:"",browserEnabled:!0,slackEnabled:!1,slackWebhookUrl:"",notifyOnBuildComplete:!0,notifyOnBuildFailure:!0,notifyOnBudgetAlert:!0,notifyOnSecurityEvent:!0},v={logRetentionDays:30,auditRetentionDays:365,sessionRetentionDays:90,autoCleanupEnabled:!0};function C(){const[s,i]=d.useState(j),[a,t]=d.useState(void 0);return d.useEffect(()=>{b.getSecrets().then(r=>t(Object.keys(r))).catch(()=>t(null))},[]),e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Configure AI provider API keys, model preferences, and fallback chain."}),s.map((r,n)=>e.jsxs("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-6 h-6 rounded-full bg-[#553DE9]/10 flex items-center justify-center text-xs font-bold text-[#553DE9]",children:r.fallbackOrder}),e.jsx("span",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3]",children:r.name})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("span",{className:"text-xs text-[#939084]",children:r.enabled?"Enabled":"Disabled"}),e.jsx("input",{type:"checkbox",checked:r.enabled,onChange:o=>{const l=[...s];l[n]={...l[n],enabled:o.target.checked},i(l)},className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"API Key"}),e.jsx("p",{className:"px-3 py-2 text-xs font-mono text-[#6B6960]",children:a===void 0?"Checking...":a===null?"unknown (secrets store could not be read)":a.includes(r.secretKey)?`${r.secretKey} is in the Purple Lab secrets store`:`${r.secretKey} is not in the Purple Lab secrets store`})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Model"}),e.jsx("input",{value:r.model,onChange:o=>{const l=[...s];l[n]={...l[n],model:o.target.value},i(l)},className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] font-mono"})]})]})]},r.id))]})}function w(){const[s,i]=d.useState(k),a=(t,r)=>{i(n=>({...n,[t]:r}))};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Default settings for new builds. Individual projects can override these."}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Max Iterations"}),e.jsx("input",{type:"number",value:s.maxIterations,onChange:t=>a("maxIterations",parseInt(t.target.value)||0),min:1,max:100,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Timeout (minutes)"}),e.jsx("input",{type:"number",value:s.timeoutMinutes,onChange:t=>a("timeoutMinutes",parseInt(t.target.value)||0),min:5,max:480,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Quality Gate Threshold (%)"}),e.jsx("input",{type:"number",value:s.qualityGateThreshold,onChange:t=>a("qualityGateThreshold",parseInt(t.target.value)||0),min:0,max:100,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"}),e.jsx("div",{className:"mt-1 h-1.5 bg-[#F8F4F0] dark:bg-[#1A1A1E] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${s.qualityGateThreshold}%`,background:s.qualityGateThreshold>=80?"#1FC5A8":s.qualityGateThreshold>=60?"#F59E0B":"#C45B5B"}})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Parallel Agents"}),e.jsx("input",{type:"number",value:s.parallelAgents,onChange:t=>a("parallelAgents",parseInt(t.target.value)||1),min:1,max:10,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s.autoReview,onChange:t=>a("autoReview",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"}),e.jsx("span",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Auto-run code review after each build"})]})]})}function B(){const[s,i]=d.useState(y),a=(t,r)=>{i(n=>({...n,[t]:r}))};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Security settings for session management, rate limiting, and access control."}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Session Timeout (minutes)"}),e.jsx("input",{type:"number",value:s.sessionTimeoutMinutes,onChange:t=>a("sessionTimeoutMinutes",parseInt(t.target.value)||0),min:5,max:1440,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Rate Limit (requests/minute)"}),e.jsx("input",{type:"number",value:s.rateLimitPerMinute,onChange:t=>a("rateLimitPerMinute",parseInt(t.target.value)||0),min:10,max:1e4,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Allowed Origins"}),e.jsx("input",{type:"text",value:s.allowedOrigins,onChange:t=>a("allowedOrigins",t.target.value),placeholder:"* or comma-separated origins",className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084] font-mono"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"IP Allowlist"}),e.jsx("input",{type:"text",value:s.ipAllowlist,onChange:t=>a("ipAllowlist",t.target.value),placeholder:"Leave empty for no restriction",className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084] font-mono"})]})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s.requireMFA,onChange:t=>a("requireMFA",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"}),e.jsx("span",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Require MFA for all users"}),!s.requireMFA&&e.jsxs("span",{className:"text-xs text-[#F59E0B] flex items-center gap-1",children:[e.jsx(x,{size:12}),"Not recommended for production"]})]})]})}function D(){const[s,i]=d.useState(N),a=(t,r)=>{i(n=>({...n,[t]:r}))};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Configure how and when you receive notifications about system events."}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-xs font-semibold text-[#6B6960] uppercase tracking-wider",children:"Channels"}),e.jsxs("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg divide-y divide-[#ECEAE3] dark:divide-[#2A2A30]",children:[e.jsxs("div",{className:"p-3 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Browser Notifications"}),e.jsx("p",{className:"text-xs text-[#939084]",children:"Show desktop notifications"})]}),e.jsx("input",{type:"checkbox",checked:s.browserEnabled,onChange:t=>a("browserEnabled",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"})]}),e.jsxs("div",{className:"p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Email Notifications"}),e.jsx("p",{className:"text-xs text-[#939084]",children:"Send email for important events"})]}),e.jsx("input",{type:"checkbox",checked:s.emailEnabled,onChange:t=>a("emailEnabled",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"})]}),s.emailEnabled&&e.jsx("input",{type:"email",value:s.emailAddress,onChange:t=>a("emailAddress",t.target.value),placeholder:"notifications@company.com",className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084]"})]}),e.jsxs("div",{className:"p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Slack Webhook"}),e.jsx("p",{className:"text-xs text-[#939084]",children:"Post to a Slack channel"})]}),e.jsx("input",{type:"checkbox",checked:s.slackEnabled,onChange:t=>a("slackEnabled",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"})]}),s.slackEnabled&&e.jsx("input",{type:"url",value:s.slackWebhookUrl,onChange:t=>a("slackWebhookUrl",t.target.value),placeholder:"https://hooks.slack.com/services/...",className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084] font-mono"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-xs font-semibold text-[#6B6960] uppercase tracking-wider",children:"Events"}),e.jsx("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg divide-y divide-[#ECEAE3] dark:divide-[#2A2A30]",children:[{key:"notifyOnBuildComplete",label:"Build Complete",desc:"When a build finishes successfully"},{key:"notifyOnBuildFailure",label:"Build Failure",desc:"When a build fails or times out"},{key:"notifyOnBudgetAlert",label:"Budget Alert",desc:"When spending approaches the limit"},{key:"notifyOnSecurityEvent",label:"Security Event",desc:"Login from new device, key rotation, etc."}].map(t=>e.jsxs("div",{className:"p-3 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:t.label}),e.jsx("p",{className:"text-xs text-[#939084]",children:t.desc})]}),e.jsx("input",{type:"checkbox",checked:s[t.key],onChange:r=>a(t.key,r.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"})]},t.key))})]})]})}function S(){const[s,i]=d.useState(v),a=(t,r)=>{i(n=>({...n,[t]:r}))};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Configure how long different types of data are retained before automatic cleanup."}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Log Retention (days)"}),e.jsx("input",{type:"number",value:s.logRetentionDays,onChange:t=>a("logRetentionDays",parseInt(t.target.value)||0),min:7,max:365,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Audit Retention (days)"}),e.jsx("input",{type:"number",value:s.auditRetentionDays,onChange:t=>a("auditRetentionDays",parseInt(t.target.value)||0),min:30,max:3650,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Session Retention (days)"}),e.jsx("input",{type:"number",value:s.sessionRetentionDays,onChange:t=>a("sessionRetentionDays",parseInt(t.target.value)||0),min:7,max:365,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s.autoCleanupEnabled,onChange:t=>a("autoCleanupEnabled",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"}),e.jsx("span",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Enable automatic cleanup"})]})]})}const c=[{id:"providers",label:"Providers",icon:h},{id:"builds",label:"Build Defaults",icon:p},{id:"security",label:"Security",icon:E},{id:"notifications",label:"Notifications",icon:g},{id:"retention",label:"Data Retention",icon:f}];function I(){return e.jsxs("div",{className:"max-w-[500px] mx-auto px-6 py-20 text-center",children:[e.jsx(A,{size:48,className:"mx-auto text-[#C45B5B] mb-4"}),e.jsx("h1",{className:"font-heading text-h1 text-[#36342E] dark:text-[#E8E6E3] mb-2",children:"Access Denied"}),e.jsx("p",{className:"text-sm text-[#6B6960]",children:"You do not have permission to access system settings. Contact your organization administrator for access."})]})}function M(){var n,o;const{user:s,isLocalMode:i}=u(),[a,t]=d.useState("providers");return i||(s==null?void 0:s.authenticated)===!0?e.jsxs("div",{className:"max-w-[1000px] mx-auto px-6 py-8",children:[e.jsx("h1",{className:"font-heading text-h1 text-[#36342E] dark:text-[#E8E6E3] mb-6",children:"System Settings"}),e.jsxs("div",{className:"flex gap-6",children:[e.jsx("nav",{className:"w-48 flex-shrink-0 space-y-1",children:c.map(l=>e.jsxs("button",{onClick:()=>t(l.id),className:`w-full flex items-center gap-2 px-3 py-2 text-sm rounded-lg text-left transition-colors ${a===l.id?"bg-[#553DE9]/8 text-[#553DE9] font-medium":"text-[#6B6960] hover:bg-[#F8F4F0] dark:hover:bg-[#222228] hover:text-[#36342E] dark:hover:text-[#E8E6E3]"}`,children:[e.jsx(l.icon,{size:16}),l.label]},l.id))}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[((n=c.find(l=>l.id===a))==null?void 0:n.icon)&&(()=>{const l=c.find(m=>m.id===a).icon;return e.jsx(l,{size:18,className:"text-[#553DE9]"})})(),e.jsx("h2",{className:"text-sm font-semibold text-[#201515] dark:text-[#E8E6E3] uppercase tracking-wider",children:(o=c.find(l=>l.id===a))==null?void 0:o.label})]}),e.jsxs("div",{className:"mb-4 px-3 py-2 rounded-lg border border-[#F59E0B]/30 bg-[#F59E0B]/5 text-xs text-[#6B6960] flex items-start gap-2",children:[e.jsx(x,{size:14,className:"text-[#F59E0B] flex-shrink-0 mt-0.5"}),e.jsx("span",{children:"Not connected: the values below are built-in defaults, not read from the server, and this page cannot save changes. They do not affect builds."})]}),e.jsxs("fieldset",{disabled:!0,className:"min-w-0",children:[a==="providers"&&e.jsx(C,{}),a==="builds"&&e.jsx(w,{}),a==="security"&&e.jsx(B,{}),a==="notifications"&&e.jsx(D,{}),a==="retention"&&e.jsx(S,{})]})]})})]})]}):e.jsx(I,{})}export{M as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{c as M,r,j as e,U as w,X as $,h as D,y as H,a as A,x as q,p as K,g as O,M as X,R as Y,l as G,a1 as J,a2 as Q}from"./index-Cz7q1bvC.js";import{B as k}from"./Button-D5qDd2ef.js";import{U as I,M as W,A as S}from"./Avatar-gQIp6FBI.js";import{L as Z}from"./lock-DSI29pct.js";import{A as b}from"./activity-dEhz-bXR.js";import{U as ee}from"./user-DMRXwZiw.js";import{C as R}from"./clock-C8p2e4NI.js";import{F as te}from"./file-code-corner-DpCnS73z.js";import{F as se}from"./file-plus-D3IPKCf1.js";import{H as ae}from"./hammer-D_FtWe1y.js";import{P as re}from"./plus-DyI4WC4_.js";/**
|
|
2
|
+
* @license lucide-react v0.577.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const ie=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],le=M("crown",ie);/**
|
|
7
|
+
* @license lucide-react v0.577.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const ne=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],ce=M("pen-line",ne),de={admin:{label:"Admin",color:"bg-[#553DE9]/10 text-[#553DE9] border-[#553DE9]/20",Icon:le},editor:{label:"Editor",color:"bg-[#1FC5A8]/10 text-[#1FC5A8] border-[#1FC5A8]/20",Icon:ce},viewer:{label:"Viewer",color:"bg-[#6B6960]/10 text-[#6B6960] border-[#6B6960]/20",Icon:H}};function oe({role:l}){const n=de[l];return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium border ${n.color}`,children:[e.jsx(n.Icon,{size:12}),n.label]})}function xe({onInvite:l,onCancel:n}){const[a,i]=r.useState(""),[c,o]=r.useState("viewer"),p=x=>{x.preventDefault(),a.trim()&&(l(a.trim(),c),i(""))};return e.jsxs("form",{onSubmit:p,className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3]",children:"Add Member"}),e.jsx("button",{type:"button",onClick:n,className:"text-[#939084] hover:text-[#36342E] dark:hover:text-[#E8E6E3]",children:e.jsx($,{size:14})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(W,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[#939084]"}),e.jsx("input",{type:"email",value:a,onChange:x=>i(x.target.value),placeholder:"colleague@example.com",className:"w-full pl-9 pr-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084] focus:outline-none focus:ring-2 focus:ring-[#553DE9]/30",required:!0})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:c,onChange:x=>o(x.target.value),className:"appearance-none pl-3 pr-8 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] focus:outline-none focus:ring-2 focus:ring-[#553DE9]/30",children:[e.jsx("option",{value:"viewer",children:"Viewer"}),e.jsx("option",{value:"editor",children:"Editor"}),e.jsx("option",{value:"admin",children:"Admin"})]}),e.jsx(D,{size:14,className:"absolute right-2 top-1/2 -translate-y-1/2 text-[#939084] pointer-events-none"})]})]}),e.jsx(k,{type:"submit",size:"sm",icon:I,disabled:!a.trim(),children:"Add Member"})]})}function me({team:l,onInviteMember:n,onRemoveMember:a,onChangeRole:i,loading:c}){const[o,p]=r.useState(!1),x=r.useCallback((t,m)=>{n==null||n(t,m),p(!1)},[n]);return c?e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(w,{size:18,className:"text-[#553DE9]"}),e.jsx("h3",{className:"text-sm font-semibold text-[#201515] dark:text-[#E8E6E3] uppercase tracking-wider",children:"Team"})]}),e.jsx("div",{className:"text-center py-8 text-[#939084] text-sm",children:"Loading team data..."})]}):e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{size:18,className:"text-[#553DE9]"}),e.jsx("h3",{className:"text-sm font-semibold text-[#201515] dark:text-[#E8E6E3] uppercase tracking-wider",children:"Team"}),l&&e.jsxs("span",{className:"text-xs text-[#939084] font-mono",children:[l.members.length," member",l.members.length!==1?"s":""]})]}),!o&&n&&e.jsx(k,{size:"sm",variant:"secondary",icon:I,onClick:()=>p(!0),children:"Add Member"})]}),o&&e.jsx("div",{className:"mb-4",children:e.jsx(xe,{onInvite:x,onCancel:()=>p(!1)})}),!l&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-[#939084] text-sm",children:"No team configured"}),e.jsx("p",{className:"text-[#553DE9]/60 text-xs mt-1",children:"Create a team to start collaborating"})]}),l&&e.jsx("div",{className:"space-y-2",children:l.members.map(t=>e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] hover:bg-[#F8F4F0] dark:hover:bg-[#222228] transition-colors",children:[t.avatar_url?e.jsx("img",{src:t.avatar_url,alt:"",className:"w-8 h-8 rounded-full flex-shrink-0"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#553DE9] flex items-center justify-center text-white text-xs font-bold flex-shrink-0",children:(t.name||t.email)[0].toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3] truncate",children:t.name||t.email}),e.jsx("p",{className:"text-xs text-[#939084] truncate",children:t.email})]}),e.jsx(oe,{role:t.role}),i&&t.role!=="admin"&&e.jsxs("select",{value:t.role,onChange:m=>i(t.id,m.target.value),className:"text-xs border border-[#ECEAE3] dark:border-[#2A2A30] rounded px-1.5 py-1 bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]","aria-label":`Change role for ${t.name||t.email}`,children:[e.jsx("option",{value:"viewer",children:"Viewer"}),e.jsx("option",{value:"editor",children:"Editor"}),e.jsx("option",{value:"admin",children:"Admin"})]}),a&&t.role!=="admin"&&e.jsx("button",{onClick:()=>a(t.id),className:"text-[#939084] hover:text-[#C45B5B] transition-colors",title:`Remove ${t.name||t.email}`,children:e.jsx($,{size:14})})]},t.id))})]})}const _=[{id:"project.create",label:"Create Projects",description:"Create new projects"},{id:"project.edit",label:"Edit Projects",description:"Modify project files and settings"},{id:"project.delete",label:"Delete Projects",description:"Delete projects permanently"},{id:"project.view",label:"View Projects",description:"View project files and status"},{id:"project.deploy",label:"Deploy Projects",description:"Trigger deployments"},{id:"team.manage",label:"Manage Team",description:"Add/remove team members"},{id:"team.invite",label:"Invite Members",description:"Send team invitations"},{id:"role.manage",label:"Manage Roles",description:"Create and modify roles"},{id:"audit.view",label:"View Audit Log",description:"Access audit history"},{id:"settings.edit",label:"Edit Settings",description:"Modify team settings"}],pe=[{id:"admin",name:"Admin",description:"Full access to all features",permissions:_.map(l=>l.id),isSystem:!0},{id:"editor",name:"Editor",description:"Can create and edit projects",permissions:["project.create","project.edit","project.view","project.deploy","team.invite"],isSystem:!0},{id:"viewer",name:"Viewer",description:"Read-only access",permissions:["project.view"],isSystem:!0}];function he({entries:l,loading:n,error:a}){return n?e.jsx("div",{className:"text-center py-8 text-[#939084] text-sm",children:"Loading audit log..."}):a?e.jsx("div",{className:"text-center py-8 text-[#C45B5B] text-sm",children:"Could not load the audit log"}):l.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-[#939084] text-sm",children:"No audit entries"}),e.jsx("p",{className:"text-[#553DE9]/60 text-xs mt-1",children:"Actions will appear here as they occur"})]}):e.jsx("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg overflow-hidden",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#F8F4F0] dark:bg-[#222228]",children:[e.jsx("th",{className:"text-left px-3 py-2 text-xs font-medium text-[#6B6960]",children:"Action"}),e.jsx("th",{className:"text-left px-3 py-2 text-xs font-medium text-[#6B6960]",children:"User"}),e.jsx("th",{className:"text-left px-3 py-2 text-xs font-medium text-[#6B6960]",children:"Target"}),e.jsx("th",{className:"text-left px-3 py-2 text-xs font-medium text-[#6B6960]",children:"Timestamp"})]})}),e.jsx("tbody",{children:l.map(i=>e.jsxs("tr",{className:"border-t border-[#ECEAE3] dark:border-[#2A2A30] hover:bg-[#F8F4F0] dark:hover:bg-[#222228] transition-colors",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(b,{size:12,className:"text-[#553DE9]"}),e.jsx("span",{className:"text-[#201515] dark:text-[#E8E6E3] font-medium",children:i.action})]})}),e.jsx("td",{className:"px-3 py-2",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ee,{size:12,className:"text-[#939084]"}),e.jsx("span",{className:"text-[#201515] dark:text-[#E8E6E3]",children:i.user})]})}),e.jsx("td",{className:"px-3 py-2 text-[#6B6960]",children:i.target||"--"}),e.jsx("td",{className:"px-3 py-2",children:e.jsxs("div",{className:"flex items-center gap-1.5 text-[#939084]",children:[e.jsx(R,{size:12}),e.jsx("span",{className:"text-xs font-mono",children:i.timestamp})]})})]},i.id))})]})})}function ue({teamId:l}){const n=pe,[a,i]=r.useState([]),[c,o]=r.useState(!1),[p,x]=r.useState(!1),[t,m]=r.useState("roles"),[j,C]=r.useState(new Set);r.useEffect(()=>{t==="audit"&&(o(!0),x(!1),A.getAuditLog().then(d=>i(d)).catch(()=>{i([]),x(!0)}).finally(()=>o(!1)))},[t,l]);const v=d=>{C(h=>{const u=new Set(h);return u.has(d)?u.delete(d):u.add(d),u})};return e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(q,{size:18,className:"text-[#553DE9]"}),e.jsx("h3",{className:"text-sm font-semibold text-[#201515] dark:text-[#E8E6E3] uppercase tracking-wider",children:"Access Control"})]}),e.jsxs("div",{className:"flex items-center gap-1 border-b border-[#ECEAE3] dark:border-[#2A2A30] mb-4",children:[e.jsxs("button",{onClick:()=>m("roles"),className:`flex items-center gap-1.5 px-3 py-2 text-xs font-medium border-b-2 transition-colors ${t==="roles"?"border-[#553DE9] text-[#553DE9]":"border-transparent text-[#939084] hover:text-[#36342E] dark:hover:text-[#E8E6E3]"}`,children:[e.jsx(Z,{size:14}),"Roles & Permissions"]}),e.jsxs("button",{onClick:()=>m("audit"),className:`flex items-center gap-1.5 px-3 py-2 text-xs font-medium border-b-2 transition-colors ${t==="audit"?"border-[#553DE9] text-[#553DE9]":"border-transparent text-[#939084] hover:text-[#36342E] dark:hover:text-[#E8E6E3]"}`,children:[e.jsx(b,{size:14}),"Audit Log"]})]}),t==="roles"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-[#939084] mb-2",children:"Descriptive only: each member record carries one of these role labels, but the server does not enforce these permissions."}),n.map(d=>e.jsxs("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg overflow-hidden",children:[e.jsxs("button",{onClick:()=>v(d.id),className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-[#F8F4F0] dark:hover:bg-[#222228] transition-colors",children:[j.has(d.id)?e.jsx(D,{size:14,className:"text-[#939084]"}):e.jsx(K,{size:14,className:"text-[#939084]"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3]",children:d.name}),d.isSystem&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-[#F8F4F0] dark:bg-[#2A2A30] text-[#939084]",children:"System"})]}),e.jsx("p",{className:"text-xs text-[#939084]",children:d.description})]}),e.jsxs("span",{className:"text-xs text-[#939084] font-mono",children:[d.permissions.length," permissions"]})]}),j.has(d.id)&&e.jsx("div",{className:"px-4 pb-3 border-t border-[#ECEAE3] dark:border-[#2A2A30]",children:e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:d.permissions.map(h=>{const u=_.find(y=>y.id===h);return u?e.jsx("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs bg-[#553DE9]/10 text-[#553DE9]",title:u.description,children:u.label},h):null})})})]},d.id))]}),t==="audit"&&e.jsx(he,{entries:a,loading:c,error:p})]})}const L={build_started:{icon:ae,color:"text-primary",dotColor:"bg-primary"},build_completed:{icon:G,color:"text-success",dotColor:"bg-success"},file_created:{icon:se,color:"text-blue-500",dotColor:"bg-blue-500"},file_modified:{icon:te,color:"text-blue-400",dotColor:"bg-blue-400"},deploy:{icon:Y,color:"text-green-500",dotColor:"bg-green-500"},chat_sent:{icon:X,color:"text-primary",dotColor:"bg-primary"},system:{icon:b,color:"text-muted",dotColor:"bg-muted"}};function fe(l){const n=Date.now(),a=new Date(l).getTime(),i=Math.floor((n-a)/1e3);if(i<5)return"just now";if(i<60)return`${i}s ago`;const c=Math.floor(i/60);if(c<60)return`${c}m ago`;const o=Math.floor(c/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}let B=[];function je({maxItems:l=20,collapsible:n=!0}){const[a,i]=r.useState(B),[c,o]=r.useState(!1);r.useEffect(()=>{const t=()=>i([...B]);return window.addEventListener("pl_activity",t),()=>window.removeEventListener("pl_activity",t)},[]);const[,p]=r.useState(0);r.useEffect(()=>{const t=setInterval(()=>p(m=>m+1),3e4);return()=>clearInterval(t)},[]);const x=a.slice(0,l);return e.jsxs("div",{className:"bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[n?e.jsxs("button",{onClick:()=>o(!c),className:"w-full flex items-center gap-2 px-4 py-3 text-left hover:bg-hover transition-colors",children:[e.jsx(b,{size:14,className:"text-primary flex-shrink-0"}),e.jsx("span",{className:"text-sm font-heading font-bold text-ink flex-1",children:"Activity"}),a.length>0&&e.jsx("span",{className:"text-[11px] text-muted-accessible font-mono mr-2",children:a.length}),c?e.jsx(D,{size:14,className:"text-muted"}):e.jsx(O,{size:14,className:"text-muted"})]}):e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:[e.jsx(b,{size:14,className:"text-primary"}),e.jsx("span",{className:"text-sm font-heading font-bold text-ink",children:"Activity"})]}),!c&&e.jsx("div",{className:"max-h-[300px] overflow-y-auto terminal-scroll",children:x.length===0?e.jsxs("div",{className:"px-4 py-6 text-center",children:[e.jsx(R,{size:20,className:"text-muted/30 mx-auto mb-2"}),e.jsx("p",{className:"text-xs text-muted",children:"No activity yet"}),e.jsx("p",{className:"text-[11px] text-muted/70 mt-0.5",children:"Actions you take will appear here."})]}):e.jsx("div",{className:"px-3 py-2",children:x.map(t=>{const m=L[t.type]||L.system,j=m.icon;return e.jsxs("div",{className:"flex items-start gap-3 py-2 group",children:[e.jsx("div",{className:"flex flex-col items-center flex-shrink-0 pt-0.5",children:e.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center ${m.color} bg-hover`,children:e.jsx(j,{size:12})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs text-ink leading-relaxed",children:t.message}),e.jsx("span",{className:"text-[11px] text-muted",children:fe(t.timestamp)})]})]},t.id)})})})]})}function De(){const[l,n]=r.useState([]),[a,i]=r.useState(null),[c,o]=r.useState(!0),[p,x]=r.useState(!1),[t,m]=r.useState(!1),[j,C]=r.useState(""),[v,d]=r.useState(!1),[h,u]=r.useState("members"),[y,F]=r.useState(null),[P,z]=r.useState(!1),{notify:E}=J(),N=r.useCallback(s=>(o(!0),A.getTeams().then(f=>{n(f),x(!1),i(g=>f.find(V=>V.id===(s??(g==null?void 0:g.id)))??f[0]??null)}).catch(()=>{n([]),i(null),x(!0)}).finally(()=>o(!1))),[]);r.useEffect(()=>{N()},[N]),r.useEffect(()=>{if(!a||h!=="activity")return;let s=!1;return F(null),z(!1),A.getAuditLog().then(f=>{s||F(f.filter(g=>g.team_id===a.id))}).catch(()=>{s||z(!0)}),()=>{s=!0}},[a,h]);const T=r.useCallback(()=>{const s=j.trim();!s||v||(d(!0),A.createTeam(s).then(f=>N(f.id).then(()=>{C(""),m(!1),E({type:"success",title:"Team created",message:`"${s}" is ready`})})).catch(()=>E({type:"error",title:"Could not create team",message:"The server did not store it, so nothing was added."})).finally(()=>d(!1)))},[j,v,N,E]),U=r.useCallback((s,f)=>{if(!a)return;const g=a.id;A.addTeamMember(g,s,f).then(()=>N(g)).then(()=>E({type:"success",title:"Member added",message:`${s} added as ${f}`})).catch(()=>E({type:"error",title:"Could not add member",message:`${s} was not added`}))},[a,N,E]);return e.jsxs("div",{className:"max-w-6xl mx-auto px-6 max-md:px-4 py-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-[#201515] dark:text-[#E8E6E3]",children:"Teams"}),e.jsx("p",{className:"text-sm text-[#939084] mt-1",children:"Manage team members, roles, and access control"})]}),!t&&e.jsx(k,{icon:re,onClick:()=>m(!0),children:"New Team"})]}),t&&e.jsxs("div",{className:"card p-4 mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3] mb-3",children:"Create Team"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"text",value:j,onChange:s=>C(s.target.value),placeholder:"Team name",className:"flex-1 px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084] focus:outline-none focus:ring-2 focus:ring-[#553DE9]/30",autoFocus:!0,onKeyDown:s=>{s.key==="Enter"&&T()}}),e.jsx(k,{size:"sm",onClick:T,disabled:!j.trim()||v,children:v?"Creating...":"Create"}),e.jsx(k,{size:"sm",variant:"ghost",onClick:()=>m(!1),children:"Cancel"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6 max-md:gap-4",children:[e.jsx("div",{className:"md:col-span-1",children:e.jsxs("div",{className:"card p-4",children:[e.jsx("h3",{className:"text-xs font-semibold text-[#6B6960] uppercase tracking-wider mb-3",children:"Your Teams"}),c&&e.jsx("div",{className:"text-center py-4 text-[#939084] text-sm",children:"Loading..."}),!c&&p&&e.jsx("div",{className:"text-center py-4 text-[#C45B5B] text-sm",children:"Could not load teams"}),!c&&!p&&l.length===0&&e.jsx("div",{className:"text-center py-4 text-[#939084] text-sm",children:"No teams yet"}),e.jsx("div",{className:"space-y-1",children:l.map(s=>e.jsxs("button",{onClick:()=>i(s),className:`w-full flex items-center gap-2 px-3 py-2 text-left text-sm rounded-lg transition-colors ${(a==null?void 0:a.id)===s.id?"bg-[#553DE9]/10 text-[#553DE9] font-medium":"text-[#36342E] dark:text-[#C5C0B8] hover:bg-[#F8F4F0] dark:hover:bg-[#222228]"}`,children:[e.jsx(S,{name:s.name,size:"sm"}),e.jsx("span",{className:"truncate flex-1",children:s.name}),e.jsx("span",{className:"text-xs text-[#939084]",children:s.members.length})]},s.id))})]})}),e.jsxs("div",{className:"md:col-span-3 space-y-6",children:[a&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"card p-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(S,{name:a.name,size:"lg"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h2",{className:"text-lg font-semibold text-[#201515] dark:text-[#E8E6E3]",children:a.name}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-[#939084] mt-0.5",children:[e.jsxs("span",{children:[a.members.length," members"]}),e.jsxs("span",{children:["Created ",new Date(a.created_at).toLocaleDateString()]})]})]})]})}),e.jsx("div",{className:"flex items-center gap-1 border-b border-[#ECEAE3] dark:border-[#2A2A30]",children:[{id:"members",label:"Members",icon:w},{id:"roles",label:"Roles & Permissions",icon:Q},{id:"activity",label:"Activity",icon:b}].map(s=>e.jsxs("button",{onClick:()=>u(s.id),className:`flex items-center gap-1.5 px-4 py-2.5 text-sm font-medium border-b-2 transition-colors ${h===s.id?"border-[#553DE9] text-[#553DE9]":"border-transparent text-[#939084] hover:text-[#36342E] dark:hover:text-[#E8E6E3]"}`,children:[e.jsx(s.icon,{size:16}),s.label]},s.id))}),h==="members"&&e.jsx(me,{team:a,onInviteMember:U,loading:c}),h==="roles"&&e.jsx(ue,{teamId:a.id}),h==="activity"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(b,{size:18,className:"text-[#553DE9]"}),e.jsx("h3",{className:"text-sm font-semibold text-[#201515] dark:text-[#E8E6E3] uppercase tracking-wider",children:"Recent Activity"})]}),P?e.jsx("div",{className:"text-center py-8 text-[#C45B5B] text-sm",children:"Could not load activity"}):y===null?e.jsx("div",{className:"text-center py-8 text-[#939084] text-sm",children:"Loading..."}):y.length===0?e.jsx("div",{className:"text-center py-8 text-[#939084] text-sm",children:"No recent activity"}):e.jsx("div",{className:"space-y-3",children:y.map(s=>e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] hover:bg-[#F8F4F0] dark:hover:bg-[#222228] transition-colors",children:[e.jsx(S,{name:s.user,size:"sm"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:[s.action,s.target?` ${s.target}`:""]}),e.jsx("p",{className:"text-xs text-[#939084]",children:s.user})]}),e.jsx("span",{className:"text-xs text-[#939084] flex-shrink-0",children:new Date(s.timestamp).toLocaleString()})]},s.id))})]}),e.jsx(je,{maxItems:10,collapsible:!0})]})]}),!a&&!c&&e.jsxs("div",{className:"text-center py-16",children:[e.jsx(w,{size:48,className:"mx-auto text-[#939084]/40 mb-4"}),e.jsx("p",{className:"text-[#939084] text-sm",children:p?"Could not load teams. Is the server running?":"Select a team or create a new one"})]})]})]})]})}export{De as default};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{c as F,r as n,j as e,p as M,w as B,R as D,u as O,a as G,X as z,y as Y,F as C,v as Q,J as H,A as q,m as I,i as V}from"./index-Cz7q1bvC.js";import{B as N}from"./Button-D5qDd2ef.js";import{u as J}from"./usePolling-BryVC-T1.js";import{C as K}from"./chevron-left-tvNswo3A.js";import{C as T}from"./clock-C8p2e4NI.js";import{L as X}from"./layers-DsW7jnJX.js";import{C as S}from"./check-C_9Nx7kb.js";import{P}from"./package-CLNxtA2x.js";import{G as Z}from"./globe-C9QXkgH_.js";import{S as ee}from"./server-DenWvSUt.js";import{B as te}from"./bot-X-ssNlwR.js";import{D as se}from"./database-DObn5fmn.js";import{P as ie}from"./plus-DyI4WC4_.js";/**
|
|
2
|
+
* @license lucide-react v0.577.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const le=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],W=F("award",le);/**
|
|
7
|
+
* @license lucide-react v0.577.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const re=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],ae=F("lightbulb",re);/**
|
|
12
|
+
* @license lucide-react v0.577.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const oe=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ce=F("settings",oe),L=new Set(["saas-starter.md","rest-api-auth.md","discord-bot.md","full-stack-demo.md","data-pipeline.md","cli-tool.md","e-commerce.md","blog-platform.md"]),R={Website:"from-violet-600 via-purple-500 to-indigo-500",API:"from-teal-600 via-emerald-500 to-cyan-500",CLI:"from-slate-600 via-gray-500 to-blue-500",Bot:"from-orange-500 via-rose-500 to-pink-500",Data:"from-blue-600 via-indigo-500 to-purple-500",Other:"from-gray-500 via-slate-500 to-zinc-500"};function ne(l){return l.replace(/\.md$/i,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase())}function de({templates:l,onSelect:a,onPreview:d}){const p=n.useRef(null),[g,w]=n.useState(!1),[h,j]=n.useState(!0),m=l.filter(i=>L.has(i.filename)).slice(0,6),v=m.length>=4?m:[...m,...l.filter(i=>!L.has(i.filename))].slice(0,6),u=()=>{const i=p.current;i&&(w(i.scrollLeft>10),j(i.scrollLeft<i.scrollWidth-i.clientWidth-10))};n.useEffect(()=>{const i=p.current;if(i)return u(),i.addEventListener("scroll",u,{passive:!0}),()=>i.removeEventListener("scroll",u)},[v]);const f=i=>{const r=p.current;if(!r)return;const s=340;r.scrollBy({left:i==="left"?-s:s,behavior:"smooth"})};return v.length===0?null:e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{size:18,className:"text-[#D4A03C]"}),e.jsx("h2",{className:"text-lg font-bold text-[#36342E]",children:"Staff Picks"}),e.jsx("span",{className:"text-xs text-[#6B6960] bg-[#D4A03C]/10 text-[#D4A03C] font-semibold px-2 py-0.5 rounded",children:"Featured"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>f("left"),disabled:!g,className:`p-1.5 rounded-lg transition-colors ${g?"hover:bg-[#F8F4F0] text-[#6B6960]":"text-[#ECEAE3] cursor-not-allowed"}`,"aria-label":"Scroll left",children:e.jsx(K,{size:18})}),e.jsx("button",{onClick:()=>f("right"),disabled:!h,className:`p-1.5 rounded-lg transition-colors ${h?"hover:bg-[#F8F4F0] text-[#6B6960]":"text-[#ECEAE3] cursor-not-allowed"}`,"aria-label":"Scroll right",children:e.jsx(M,{size:18})})]})]}),e.jsx("div",{ref:p,className:"flex gap-4 overflow-x-auto pb-2 scrollbar-hide",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:v.map(i=>{const r=i.category||"Other",s=R[r]||R.Other,b=i.tech_stack||[];return e.jsxs("div",{className:"flex-shrink-0 w-[320px] bg-white border border-[#ECEAE3] rounded-xl shadow-card hover:shadow-card-hover transition-all duration-200 overflow-hidden cursor-pointer group",onClick:()=>d(i),children:[e.jsxs("div",{className:`h-36 bg-gradient-to-br ${s} relative overflow-hidden`,children:[e.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-[0.12]",viewBox:"0 0 320 144",children:[e.jsx("circle",{cx:"60",cy:"40",r:"25",fill:"none",stroke:"white",strokeWidth:"2"}),e.jsx("circle",{cx:"260",cy:"110",r:"35",fill:"none",stroke:"white",strokeWidth:"2"}),e.jsx("circle",{cx:"180",cy:"25",r:"10",fill:"white"}),e.jsx("rect",{x:"220",y:"15",width:"30",height:"30",rx:"6",fill:"none",stroke:"white",strokeWidth:"1.5",transform:"rotate(20 235 30)"}),e.jsx("line",{x1:"40",y1:"120",x2:"120",y2:"80",stroke:"white",strokeWidth:"1"}),e.jsx("circle",{cx:"100",cy:"100",r:"6",fill:"white",fillOpacity:"0.4"}),e.jsx("circle",{cx:"280",cy:"50",r:"15",fill:"none",stroke:"white",strokeWidth:"1",strokeDasharray:"3 3"})]}),e.jsx("div",{className:"absolute top-3 left-3",children:e.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-white bg-white/25 backdrop-blur-sm px-2.5 py-1 rounded-full uppercase tracking-wider",children:[e.jsx(W,{size:11}),"Featured"]})}),e.jsx("div",{className:"absolute top-3 right-3",children:e.jsx("span",{className:"text-[10px] font-semibold text-white/90 bg-white/20 backdrop-blur-sm px-2 py-0.5 rounded",children:r})}),b.length>0&&e.jsx("div",{className:"absolute bottom-3 left-3 right-3 flex flex-wrap gap-1",children:b.slice(0,4).map(y=>e.jsx("span",{className:"text-[10px] font-semibold text-white/90 bg-white/20 backdrop-blur-sm px-2 py-0.5 rounded",children:y},y))})]}),e.jsxs("div",{className:"p-4",children:[e.jsx("h3",{className:"text-base font-bold text-[#36342E] mb-1 group-hover:text-[#553DE9] transition-colors",children:ne(i.name)}),e.jsx("p",{className:"text-xs text-[#6B6960] line-clamp-2 mb-3 min-h-[2.4em]",children:i.description||i.filename}),i.build_time&&e.jsx("div",{className:"flex items-center gap-3 mb-3 text-[10px] text-[#6B6960]",children:e.jsxs("span",{className:"flex items-center gap-1",title:"Hand-written estimate, not a measured build",children:[e.jsx(T,{size:11}),"Est. ",i.build_time]})}),e.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-[#ECEAE3]",children:[e.jsx("div",{className:"flex items-center gap-1.5",children:i.difficulty&&e.jsxs(e.Fragment,{children:[e.jsx(B,{size:12,className:i.difficulty==="beginner"?"text-green-500":i.difficulty==="advanced"?"text-red-400":"text-yellow-500"}),e.jsx("span",{className:`text-[10px] font-medium capitalize ${i.difficulty==="beginner"?"text-green-500":i.difficulty==="advanced"?"text-red-400":"text-yellow-500"}`,children:i.difficulty})]})}),e.jsx(N,{size:"sm",icon:D,onClick:y=>{y.stopPropagation(),a(i.filename)},className:"opacity-0 group-hover:opacity-100 transition-opacity",children:"Use"})]})]})]},i.filename)})})]})}const _={Website:"from-violet-600 via-purple-500 to-indigo-600",API:"from-teal-600 via-emerald-500 to-cyan-600",CLI:"from-slate-600 via-gray-500 to-blue-600",Bot:"from-orange-500 via-rose-500 to-pink-600",Data:"from-blue-600 via-indigo-500 to-purple-600",Other:"from-slate-500 via-gray-500 to-zinc-600"},xe={React:"Component-based UI library","Node.js":"Server-side JavaScript runtime",Python:"General-purpose programming language",TypeScript:"Type-safe JavaScript superset",PostgreSQL:"Advanced relational database",MongoDB:"Document-oriented NoSQL database",Docker:"Container platform",Redis:"In-memory data store",Express:"Minimal Node.js web framework",FastAPI:"Modern async Python web framework",SQLite:"Lightweight embedded database",Tailwind:"Utility-first CSS framework",Discord:"Discord API integration",Slack:"Slack API integration",CLI:"Command-line interface tooling",Playwright:"End-to-end testing framework",Vite:"Next-gen frontend build tool",Next:"React framework with SSR/SSG",Prisma:"Type-safe ORM for Node.js",Stripe:"Payment processing platform"},he={beginner:{label:"Beginner",color:"text-green-500",bars:1,description:"Suitable for developers new to this stack. Simple setup and straightforward concepts."},intermediate:{label:"Intermediate",color:"text-yellow-500",bars:2,description:"Assumes familiarity with the core technologies. Moderate complexity with several integrated features."},advanced:{label:"Advanced",color:"text-red-400",bars:3,description:"Complex architecture with multiple services. Best for experienced developers comfortable with infrastructure."}};function me({template:l,onClose:a}){const d=O(),[p,g]=n.useState(null),[w,h]=n.useState(null),[j,m]=n.useState(!1);n.useEffect(()=>{h(null),G.getTemplateContent(l.filename).then(r=>g(r.content)).catch(r=>h(r instanceof Error?r.message:"Request failed"))},[l.filename]);const v=n.useCallback(()=>{sessionStorage.setItem("pl_template",l.filename),d("/"),a()},[l.filename,d,a]);n.useEffect(()=>{const r=s=>{s.key==="Escape"&&a()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[a]),n.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const u=l.category||"Other",f=_[u]||_.Other,i=l.difficulty?he[l.difficulty]:void 0;return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:r=>{r.target===r.currentTarget&&a()},children:[e.jsxs("div",{className:"relative bg-white rounded-xl shadow-2xl w-[95vw] max-w-[1100px] max-h-[90vh] overflow-hidden animate-in",style:{animation:"modal-enter 0.25s ease-out"},children:[e.jsx("button",{onClick:a,className:"absolute top-4 right-4 z-10 p-2 rounded-lg bg-white/90 hover:bg-white text-[#6B6960] hover:text-[#36342E] shadow-sm","aria-label":"Close preview",children:e.jsx(z,{size:18})}),e.jsxs("div",{className:"flex flex-col lg:flex-row h-full max-h-[90vh]",children:[e.jsxs("div",{className:"flex-1 lg:w-[60%] overflow-y-auto p-6 lg:p-8",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("div",{className:"flex items-center gap-2 mb-2",children:e.jsx("span",{className:"text-xs font-semibold text-[#553DE9] bg-[#553DE9]/10 px-2 py-0.5 rounded",children:u})}),e.jsx("h2",{className:"text-2xl font-bold text-[#36342E] mb-2",children:l.name.replace(/\.md$/i,"").replace(/[-_]/g," ").replace(/\b\w/g,r=>r.toUpperCase())}),e.jsx("p",{className:"text-[#6B6960] leading-relaxed",children:l.description||"A ready-to-use template to kickstart your project."})]}),e.jsxs("div",{className:"bg-[#553DE9]/5 rounded-lg border border-[#553DE9]/10 p-4",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-[#553DE9] mb-2",children:[e.jsx(ae,{size:15}),"How to Customize"]}),e.jsx("p",{className:"text-sm text-[#6B6960]",children:'After selecting this template, describe your specific requirements in the prompt. For example: "Add user authentication with Google OAuth" or "Change the database to MongoDB". The AI will adapt the template to your needs.'})]})]}),e.jsxs("div",{className:"lg:w-[40%] bg-[#FAF9F6] border-t lg:border-t-0 lg:border-l border-[#ECEAE3] p-6 lg:p-8 overflow-y-auto flex flex-col",children:[e.jsxs("div",{className:`h-40 rounded-xl bg-gradient-to-br ${f} relative overflow-hidden mb-6 shadow-lg`,children:[e.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-10",viewBox:"0 0 400 200",children:[e.jsx("circle",{cx:"50",cy:"50",r:"30",fill:"none",stroke:"white",strokeWidth:"2"}),e.jsx("circle",{cx:"350",cy:"150",r:"45",fill:"none",stroke:"white",strokeWidth:"2"}),e.jsx("circle",{cx:"200",cy:"30",r:"15",fill:"white"}),e.jsx("rect",{x:"300",y:"20",width:"40",height:"40",rx:"8",fill:"none",stroke:"white",strokeWidth:"2",transform:"rotate(15 320 40)"}),e.jsx("line",{x1:"50",y1:"180",x2:"150",y2:"120",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"100",cy:"140",r:"8",fill:"white",fillOpacity:"0.5"}),e.jsx("circle",{cx:"250",cy:"100",r:"20",fill:"none",stroke:"white",strokeWidth:"1.5",strokeDasharray:"4 4"})]}),e.jsx("div",{className:"absolute bottom-3 left-4 right-4",children:e.jsxs("span",{className:"text-white/90 text-xs font-semibold bg-white/20 backdrop-blur-sm px-3 py-1 rounded-full",children:[u," Template"]})})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h4",{className:"text-xs font-semibold text-[#36342E] uppercase tracking-wider mb-3",children:"Tech Stack"}),e.jsxs("div",{className:"space-y-2",children:[(l.tech_stack||[]).map(r=>e.jsxs("div",{className:"flex items-center justify-between bg-white rounded-lg border border-[#ECEAE3] px-3 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[#36342E]",children:r}),e.jsx("span",{className:"text-xs text-[#6B6960]",children:xe[r]||"Development tool"})]},r)),(!l.tech_stack||l.tech_stack.length===0)&&e.jsx("p",{className:"text-xs text-[#6B6960]",children:"No tech stack detected in this template"})]})]}),l.build_time&&e.jsxs("div",{className:"flex items-center gap-3 bg-white rounded-lg border border-[#ECEAE3] px-4 py-3 mb-3",children:[e.jsx(T,{size:16,className:"text-[#553DE9]"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-[#6B6960]",children:"Est. build time (not measured)"}),e.jsx("div",{className:"text-sm font-semibold text-[#36342E]",children:l.build_time})]})]}),i&&e.jsxs("div",{className:"bg-white rounded-lg border border-[#ECEAE3] px-4 py-3 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(B,{size:16,className:i.color}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-[#6B6960]",children:"Difficulty"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`text-sm font-semibold ${i.color}`,children:i.label}),e.jsx("div",{className:"flex gap-0.5",children:[1,2,3].map(r=>e.jsx("div",{className:`w-2 h-4 rounded-sm ${r<=i.bars?"bg-current "+i.color:"bg-[#ECEAE3]"}`},r))})]})]})]}),e.jsx("p",{className:"text-xs text-[#6B6960] leading-relaxed",children:i.description})]}),e.jsxs("div",{className:"mt-auto space-y-3",children:[e.jsx(N,{variant:"primary",size:"lg",icon:D,onClick:v,className:"w-full justify-center text-base",children:"Use This Template"}),e.jsx(N,{variant:"secondary",size:"md",icon:j?Y:C,onClick:()=>m(!j),className:"w-full justify-center",children:j?"Hide Spec":"View Spec"})]})]})]}),j&&e.jsxs("div",{className:"absolute inset-0 bg-white z-20 overflow-y-auto",children:[e.jsxs("div",{className:"sticky top-0 bg-white border-b border-[#ECEAE3] px-6 py-4 flex items-center justify-between z-10",children:[e.jsxs("h3",{className:"text-lg font-semibold text-[#36342E]",children:["Template Spec: ",l.name.replace(/\.md$/i,"").replace(/[-_]/g," ").replace(/\b\w/g,r=>r.toUpperCase())]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{variant:"ghost",size:"sm",onClick:()=>m(!1),children:"Back to Preview"}),e.jsx("button",{onClick:a,className:"p-2 rounded-lg hover:bg-[#F8F4F0] text-[#6B6960]","aria-label":"Close",children:e.jsx(z,{size:18})})]})]}),e.jsx("div",{className:"p-6 lg:p-8 max-w-4xl mx-auto",children:p?e.jsx("pre",{className:"whitespace-pre-wrap text-sm text-[#36342E] font-mono leading-relaxed",children:p}):w?e.jsxs("div",{className:"text-center py-12 text-[#C45B5B]",children:[e.jsx(C,{size:32,className:"mx-auto mb-3 opacity-30"}),e.jsxs("p",{className:"text-sm",children:["Could not load template content: ",w]})]}):e.jsxs("div",{className:"text-center py-12 text-[#6B6960]",children:[e.jsx(C,{size:32,className:"mx-auto mb-3 opacity-30"}),e.jsx("p",{className:"text-sm",children:"Loading template content..."})]})})]})]}),e.jsx("style",{children:`
|
|
17
|
+
@keyframes modal-enter {
|
|
18
|
+
from { opacity: 0; transform: scale(0.95) translateY(10px); }
|
|
19
|
+
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
20
|
+
}
|
|
21
|
+
`})]})}const $=[{label:"Basics",icon:C},{label:"Tech Stack",icon:X},{label:"Features",icon:ce},{label:"Review",icon:S}],E=[{id:"react",label:"React",group:"Frontend"},{id:"nextjs",label:"Next.js",group:"Frontend"},{id:"vue",label:"Vue",group:"Frontend"},{id:"svelte",label:"Svelte",group:"Frontend"},{id:"tailwind",label:"Tailwind CSS",group:"Frontend"},{id:"nodejs",label:"Node.js",group:"Backend"},{id:"python",label:"Python",group:"Backend"},{id:"fastapi",label:"FastAPI",group:"Backend"},{id:"express",label:"Express",group:"Backend"},{id:"typescript",label:"TypeScript",group:"Language"},{id:"postgresql",label:"PostgreSQL",group:"Database"},{id:"mongodb",label:"MongoDB",group:"Database"},{id:"sqlite",label:"SQLite",group:"Database"},{id:"redis",label:"Redis",group:"Database"},{id:"docker",label:"Docker",group:"DevOps"},{id:"prisma",label:"Prisma",group:"ORM"}],k=[{id:"auth",label:"Authentication",description:"Email/password and OAuth login"},{id:"database",label:"Database",description:"Schema, models, and migrations"},{id:"api",label:"REST API",description:"CRUD endpoints with validation"},{id:"tests",label:"Tests",description:"Unit and integration test setup"},{id:"docker",label:"Docker",description:"Dockerfile and compose setup"},{id:"ci",label:"CI/CD",description:"GitHub Actions workflow"},{id:"websockets",label:"WebSockets",description:"Real-time communication"},{id:"fileupload",label:"File Upload",description:"Image and document handling"},{id:"email",label:"Email",description:"Transactional email sending"},{id:"payments",label:"Payments",description:"Stripe payment integration"},{id:"admin",label:"Admin Panel",description:"Dashboard for management"},{id:"i18n",label:"Internationalization",description:"Multi-language support"}];function pe({onClose:l}){const a=O(),[d,p]=n.useState(0),[g,w]=n.useState(""),[h,j]=n.useState(""),[m,v]=n.useState(new Set),[u,f]=n.useState(new Set),i=n.useCallback(t=>{v(o=>{const x=new Set(o);return x.has(t)?x.delete(t):x.add(t),x})},[]),r=n.useCallback(t=>{f(o=>{const x=new Set(o);return x.has(t)?x.delete(t):x.add(t),x})},[]),s=()=>{switch(d){case 0:return g.trim().length>0;case 1:return m.size>0;case 2:return!0;case 3:return!0;default:return!1}},b=n.useCallback(()=>{const t=E.filter(c=>m.has(c.id)).map(c=>c.label),o=k.filter(c=>u.has(c.id)).map(c=>c.label),x=[`Build a project called "${g}"`,h?`: ${h}`:"",t.length?`
|
|
22
|
+
|
|
23
|
+
Tech stack: ${t.join(", ")}`:"",o.length?`
|
|
24
|
+
Features: ${o.join(", ")}`:""].join("");sessionStorage.setItem("pl_custom_prompt",x),a("/"),l()},[g,h,m,u,a,l]),y=E.reduce((t,o)=>(t[o.group]||(t[o.group]=[]),t[o.group].push(o),t),{});return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:t=>{t.target===t.currentTarget&&l()},children:[e.jsxs("div",{className:"relative bg-white rounded-xl shadow-2xl w-[95vw] max-w-[700px] overflow-hidden",style:{animation:"modal-enter 0.25s ease-out"},children:[e.jsxs("div",{className:"bg-[#FAF9F6] border-b border-[#ECEAE3] px-6 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h2",{className:"text-lg font-bold text-[#36342E]",children:"Create Custom Template"}),e.jsx("button",{onClick:l,className:"text-[#6B6960] hover:text-[#36342E] text-sm",children:"Cancel"})]}),e.jsx("div",{className:"flex items-center gap-2",children:$.map((t,o)=>{const x=t.icon,c=o===d,A=o<d;return e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsxs("div",{className:`flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium transition-colors ${c?"bg-[#553DE9] text-white":A?"bg-[#1FC5A8]/10 text-[#1FC5A8]":"bg-[#F8F4F0] text-[#6B6960]"}`,children:[A?e.jsx(S,{size:12}):e.jsx(x,{size:12}),e.jsx("span",{className:"hidden sm:inline",children:t.label})]}),o<$.length-1&&e.jsx("div",{className:`flex-1 h-0.5 rounded ${A?"bg-[#1FC5A8]":"bg-[#ECEAE3]"}`})]},o)})})]}),e.jsxs("div",{className:"p-6 min-h-[320px]",children:[d===0&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-[#36342E] mb-1.5",children:["Project Name ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx("input",{type:"text",value:g,onChange:t=>w(t.target.value),placeholder:"My Awesome App",className:"w-full px-4 py-2.5 text-sm bg-white border border-[#ECEAE3] rounded-lg outline-none focus:border-[#553DE9] transition-colors",autoFocus:!0})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-[#36342E] mb-1.5",children:["Description ",e.jsx("span",{className:"text-xs text-[#6B6960]",children:"(optional)"})]}),e.jsx("textarea",{value:h,onChange:t=>j(t.target.value),placeholder:"Describe what your project does...",rows:4,className:"w-full px-4 py-2.5 text-sm bg-white border border-[#ECEAE3] rounded-lg outline-none focus:border-[#553DE9] transition-colors resize-none"})]})]}),d===1&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-[#6B6960]",children:"Select the technologies for your project."}),Object.entries(y).map(([t,o])=>e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-[#6B6960] uppercase tracking-wider mb-2",children:t}),e.jsx("div",{className:"flex flex-wrap gap-2",children:o.map(x=>{const c=m.has(x.id);return e.jsxs("button",{onClick:()=>i(x.id),className:`px-3 py-1.5 text-sm rounded-lg border transition-colors ${c?"border-[#553DE9] bg-[#553DE9]/10 text-[#553DE9] font-medium":"border-[#ECEAE3] text-[#6B6960] hover:border-[#553DE9]/30 hover:text-[#36342E]"}`,children:[c&&e.jsx(S,{size:12,className:"inline mr-1"}),x.label]},x.id)})})]},t))]}),d===2&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-[#6B6960] mb-2",children:"Select features to include. All are optional."}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:k.map(t=>{const o=u.has(t.id);return e.jsxs("button",{onClick:()=>r(t.id),className:`text-left p-3 rounded-lg border transition-colors ${o?"border-[#553DE9] bg-[#553DE9]/5":"border-[#ECEAE3] hover:border-[#553DE9]/30"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 ${o?"bg-[#553DE9] border-[#553DE9]":"border-[#ECEAE3]"}`,children:o&&e.jsx(S,{size:10,className:"text-white"})}),e.jsx("span",{className:`text-sm font-medium ${o?"text-[#553DE9]":"text-[#36342E]"}`,children:t.label})]}),e.jsx("p",{className:"text-xs text-[#6B6960] ml-6",children:t.description})]},t.id)})})]}),d===3&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-[#FAF9F6] rounded-lg border border-[#ECEAE3] p-4",children:[e.jsx("h4",{className:"text-sm font-semibold text-[#36342E] mb-1",children:g||"Untitled Project"}),h&&e.jsx("p",{className:"text-xs text-[#6B6960] mb-3",children:h}),m.size>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("span",{className:"text-xs font-semibold text-[#6B6960] uppercase tracking-wider",children:"Tech Stack"}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:E.filter(t=>m.has(t.id)).map(t=>e.jsx("span",{className:"text-xs bg-[#553DE9]/10 text-[#553DE9] px-2 py-0.5 rounded font-medium",children:t.label},t.id))})]}),u.size>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-semibold text-[#6B6960] uppercase tracking-wider",children:"Features"}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:k.filter(t=>u.has(t.id)).map(t=>e.jsx("span",{className:"text-xs bg-[#1FC5A8]/10 text-[#1FC5A8] px-2 py-0.5 rounded font-medium",children:t.label},t.id))})]})]}),e.jsxs("div",{className:"bg-[#553DE9]/5 rounded-lg border border-[#553DE9]/10 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Q,{size:15,className:"text-[#553DE9]"}),e.jsx("span",{className:"text-sm font-semibold text-[#553DE9]",children:"Generated Prompt"})]}),e.jsxs("p",{className:"text-sm text-[#6B6960] font-mono bg-white rounded border border-[#ECEAE3] p-3 text-xs leading-relaxed",children:['Build a project called "',g,'"',h?`: ${h}`:"",m.size>0&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),"Tech stack: ",E.filter(t=>m.has(t.id)).map(t=>t.label).join(", ")]}),u.size>0&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),"Features: ",k.filter(t=>u.has(t.id)).map(t=>t.label).join(", ")]})]})]})]})]}),e.jsxs("div",{className:"border-t border-[#ECEAE3] px-6 py-4 flex items-center justify-between",children:[e.jsx(N,{variant:"ghost",size:"md",icon:H,onClick:()=>d>0?p(d-1):l(),children:d===0?"Cancel":"Back"}),d<3?e.jsx(N,{variant:"primary",size:"md",iconRight:q,onClick:()=>p(d+1),disabled:!s(),children:"Next"}):e.jsx(N,{variant:"primary",size:"md",icon:D,onClick:b,children:"Generate Template"})]})]}),e.jsx("style",{children:`
|
|
25
|
+
@keyframes modal-enter {
|
|
26
|
+
from { opacity: 0; transform: scale(0.95) translateY(10px); }
|
|
27
|
+
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
28
|
+
}
|
|
29
|
+
`})]})}const fe=[{key:"all",label:"All",icon:P},{key:"Website",label:"Web Apps",icon:Z},{key:"API",label:"APIs",icon:ee},{key:"CLI",label:"CLIs",icon:V},{key:"Bot",label:"Bots",icon:te},{key:"Data",label:"Data",icon:se},{key:"Other",label:"Other",icon:P}],U={Website:"from-violet-500 via-purple-500 to-indigo-500",API:"from-teal-500 via-emerald-500 to-cyan-500",CLI:"from-slate-500 via-gray-500 to-blue-500",Bot:"from-orange-500 via-rose-500 to-pink-500",Data:"from-blue-500 via-indigo-500 to-purple-500",Other:"from-slate-400 via-gray-400 to-zinc-500"},ue={React:"bg-sky-500/10 text-sky-600","Node.js":"bg-green-500/10 text-green-600",Python:"bg-yellow-500/10 text-yellow-700",TypeScript:"bg-blue-500/10 text-blue-600",PostgreSQL:"bg-indigo-500/10 text-indigo-600",MongoDB:"bg-green-600/10 text-green-700",Docker:"bg-cyan-500/10 text-cyan-600",Redis:"bg-red-500/10 text-red-600",Express:"bg-gray-500/10 text-gray-600",FastAPI:"bg-teal-500/10 text-teal-600",SQLite:"bg-blue-400/10 text-blue-500",Tailwind:"bg-cyan-400/10 text-cyan-600",Discord:"bg-indigo-400/10 text-indigo-500",Slack:"bg-purple-500/10 text-purple-600",CLI:"bg-amber-500/10 text-amber-600",Playwright:"bg-green-500/10 text-green-600",Vite:"bg-purple-400/10 text-purple-500",Next:"bg-gray-600/10 text-gray-700"},be={beginner:{label:"Beginner",color:"text-green-500",bars:1},intermediate:{label:"Intermediate",color:"text-yellow-500",bars:2},advanced:{label:"Advanced",color:"text-red-400",bars:3}};function ge({category:l}){switch(l){case"Website":return e.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-[0.15]",viewBox:"0 0 400 120",children:[e.jsx("rect",{x:"40",y:"15",width:"160",height:"90",rx:"6",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("line",{x1:"40",y1:"30",x2:"200",y2:"30",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"52",cy:"22",r:"3",fill:"white",fillOpacity:"0.6"}),e.jsx("circle",{cx:"62",cy:"22",r:"3",fill:"white",fillOpacity:"0.6"}),e.jsx("circle",{cx:"72",cy:"22",r:"3",fill:"white",fillOpacity:"0.6"}),e.jsx("rect",{x:"50",y:"38",width:"80",height:"8",rx:"2",fill:"white",fillOpacity:"0.4"}),e.jsx("rect",{x:"50",y:"52",width:"140",height:"5",rx:"1.5",fill:"white",fillOpacity:"0.25"}),e.jsx("rect",{x:"50",y:"62",width:"120",height:"5",rx:"1.5",fill:"white",fillOpacity:"0.25"}),e.jsx("rect",{x:"50",y:"78",width:"45",height:"16",rx:"4",fill:"white",fillOpacity:"0.35"}),e.jsx("circle",{cx:"300",cy:"30",r:"20",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("rect",{x:"270",y:"70",width:"25",height:"25",rx:"5",fill:"none",stroke:"white",strokeWidth:"1",transform:"rotate(15 282 82)"}),e.jsx("circle",{cx:"350",cy:"90",r:"8",fill:"white",fillOpacity:"0.3"})]});case"API":return e.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-[0.15]",viewBox:"0 0 400 120",children:[e.jsx("rect",{x:"30",y:"10",width:"180",height:"100",rx:"6",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("line",{x1:"30",y1:"25",x2:"210",y2:"25",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"42",cy:"17",r:"3",fill:"white",fillOpacity:"0.6"}),e.jsx("circle",{cx:"52",cy:"17",r:"3",fill:"white",fillOpacity:"0.6"}),e.jsx("text",{x:"40",y:"42",fill:"white",fillOpacity:"0.5",fontSize:"8",fontFamily:"monospace",children:"{"}),e.jsx("text",{x:"48",y:"54",fill:"white",fillOpacity:"0.4",fontSize:"7",fontFamily:"monospace",children:'"status": 200,'}),e.jsx("text",{x:"48",y:"66",fill:"white",fillOpacity:"0.4",fontSize:"7",fontFamily:"monospace",children:'"data": [...]'}),e.jsx("text",{x:"40",y:"80",fill:"white",fillOpacity:"0.5",fontSize:"8",fontFamily:"monospace",children:"}"}),e.jsx("circle",{cx:"290",cy:"35",r:"12",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"340",cy:"60",r:"12",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"290",cy:"85",r:"12",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("line",{x1:"302",y1:"35",x2:"328",y2:"60",stroke:"white",strokeWidth:"1"}),e.jsx("line",{x1:"302",y1:"85",x2:"328",y2:"60",stroke:"white",strokeWidth:"1"}),e.jsx("circle",{cx:"290",cy:"35",r:"4",fill:"white",fillOpacity:"0.4"}),e.jsx("circle",{cx:"340",cy:"60",r:"4",fill:"white",fillOpacity:"0.4"}),e.jsx("circle",{cx:"290",cy:"85",r:"4",fill:"white",fillOpacity:"0.4"})]});case"CLI":return e.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-[0.15]",viewBox:"0 0 400 120",children:[e.jsx("rect",{x:"40",y:"12",width:"170",height:"96",rx:"6",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("line",{x1:"40",y1:"27",x2:"210",y2:"27",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"52",cy:"19",r:"3",fill:"white",fillOpacity:"0.6"}),e.jsx("circle",{cx:"62",cy:"19",r:"3",fill:"white",fillOpacity:"0.6"}),e.jsx("text",{x:"50",y:"42",fill:"white",fillOpacity:"0.5",fontSize:"7",fontFamily:"monospace",children:"$ myapp --help"}),e.jsx("text",{x:"50",y:"54",fill:"white",fillOpacity:"0.35",fontSize:"7",fontFamily:"monospace",children:"Usage: myapp [cmd]"}),e.jsx("text",{x:"50",y:"66",fill:"white",fillOpacity:"0.35",fontSize:"7",fontFamily:"monospace",children:" init Setup"}),e.jsx("text",{x:"50",y:"78",fill:"white",fillOpacity:"0.35",fontSize:"7",fontFamily:"monospace",children:" run Execute"}),e.jsx("rect",{x:"50",y:"88",width:"6",height:"10",fill:"white",fillOpacity:"0.6"}),e.jsx("text",{x:"270",y:"50",fill:"white",fillOpacity:"0.3",fontSize:"24",fontFamily:"monospace",children:">_"}),e.jsx("circle",{cx:"350",cy:"80",r:"15",fill:"none",stroke:"white",strokeWidth:"1",strokeDasharray:"4 4"})]});case"Bot":return e.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-[0.15]",viewBox:"0 0 400 120",children:[e.jsx("rect",{x:"40",y:"15",width:"120",height:"28",rx:"14",fill:"white",fillOpacity:"0.2"}),e.jsx("rect",{x:"50",y:"22",width:"60",height:"5",rx:"2",fill:"white",fillOpacity:"0.4"}),e.jsx("rect",{x:"80",y:"55",width:"130",height:"28",rx:"14",fill:"white",fillOpacity:"0.3"}),e.jsx("rect",{x:"90",y:"62",width:"80",height:"5",rx:"2",fill:"white",fillOpacity:"0.4"}),e.jsx("rect",{x:"50",y:"93",width:"100",height:"20",rx:"10",fill:"white",fillOpacity:"0.15"}),e.jsx("rect",{x:"60",y:"99",width:"50",height:"5",rx:"2",fill:"white",fillOpacity:"0.35"}),e.jsx("circle",{cx:"310",cy:"55",r:"25",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"302",cy:"50",r:"4",fill:"white",fillOpacity:"0.5"}),e.jsx("circle",{cx:"318",cy:"50",r:"4",fill:"white",fillOpacity:"0.5"}),e.jsx("path",{d:"M300 62 Q310 70 320 62",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("line",{x1:"310",y1:"30",x2:"310",y2:"22",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"310",cy:"20",r:"3",fill:"white",fillOpacity:"0.5"})]});case"Data":return e.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-[0.15]",viewBox:"0 0 400 120",children:[e.jsx("ellipse",{cx:"80",cy:"30",rx:"35",ry:"10",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("line",{x1:"45",y1:"30",x2:"45",y2:"85",stroke:"white",strokeWidth:"1.5"}),e.jsx("line",{x1:"115",y1:"30",x2:"115",y2:"85",stroke:"white",strokeWidth:"1.5"}),e.jsx("ellipse",{cx:"80",cy:"85",rx:"35",ry:"10",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("ellipse",{cx:"80",cy:"55",rx:"35",ry:"10",fill:"none",stroke:"white",strokeWidth:"0.8",strokeDasharray:"3 3"}),e.jsx("line",{x1:"140",y1:"55",x2:"200",y2:"55",stroke:"white",strokeWidth:"1.5"}),e.jsx("polygon",{points:"200,50 210,55 200,60",fill:"white",fillOpacity:"0.5"}),e.jsx("rect",{x:"230",y:"70",width:"15",height:"35",rx:"3",fill:"white",fillOpacity:"0.25"}),e.jsx("rect",{x:"255",y:"50",width:"15",height:"55",rx:"3",fill:"white",fillOpacity:"0.3"}),e.jsx("rect",{x:"280",y:"60",width:"15",height:"45",rx:"3",fill:"white",fillOpacity:"0.25"}),e.jsx("rect",{x:"305",y:"40",width:"15",height:"65",rx:"3",fill:"white",fillOpacity:"0.35"}),e.jsx("rect",{x:"330",y:"55",width:"15",height:"50",rx:"3",fill:"white",fillOpacity:"0.2"})]});default:return e.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-[0.12]",viewBox:"0 0 400 120",children:[e.jsx("circle",{cx:"60",cy:"40",r:"25",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("circle",{cx:"340",cy:"80",r:"30",fill:"none",stroke:"white",strokeWidth:"1.5"}),e.jsx("rect",{x:"170",y:"20",width:"35",height:"35",rx:"8",fill:"none",stroke:"white",strokeWidth:"1.5",transform:"rotate(15 187 37)"}),e.jsx("circle",{cx:"260",cy:"30",r:"10",fill:"white",fillOpacity:"0.3"}),e.jsx("circle",{cx:"120",cy:"90",r:"15",fill:"none",stroke:"white",strokeWidth:"1",strokeDasharray:"4 4"})]})}}function ye({level:l}){const a=l?be[l]:void 0;return a?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(B,{size:12,className:a.color}),e.jsx("div",{className:"flex gap-0.5",children:[1,2,3].map(d=>e.jsx("div",{className:`w-1.5 h-3 rounded-sm ${d<=a.bars?"bg-current "+a.color:"bg-[#ECEAE3]"}`},d))}),e.jsx("span",{className:`text-[10px] font-medium ${a.color}`,children:a.label})]}):null}function je(l){return l.replace(/\.md$/i,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase())}function ze(){const l=O(),[a,d]=n.useState("all"),[p,g]=n.useState(""),[w,h]=n.useState(null),[j,m]=n.useState(!1),v=n.useCallback(()=>G.getTemplates(),[]),{data:u}=J(v,6e4,!0),f=u,i=n.useMemo(()=>{if(!f)return[];let s=f;if(a!=="all"&&(s=s.filter(b=>(b.category||"Other")===a)),p.trim()){const b=p.toLowerCase();s=s.filter(y=>y.name.toLowerCase().includes(b)||(y.description||"").toLowerCase().includes(b)||(y.tech_stack||[]).some(t=>t.toLowerCase().includes(b)))}return s},[f,a,p]),r=s=>{sessionStorage.setItem("pl_template",s),l("/")};return e.jsxs("div",{className:"max-w-[1400px] mx-auto px-6 py-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold mb-2",children:e.jsx("span",{className:"bg-gradient-to-r from-[#553DE9] via-[#7B6BEF] to-[#553DE9] bg-clip-text text-transparent",children:"Start with a Template"})}),e.jsx("p",{className:"text-[#6B6960] text-sm max-w-lg mx-auto mb-6",children:"Choose a starting point and customize with AI. Each template is a complete spec ready to become your next project."}),e.jsxs("div",{className:"relative max-w-xl mx-auto mb-5",children:[e.jsx(I,{size:18,className:"absolute left-4 top-1/2 -translate-y-1/2 text-[#6B6960]"}),e.jsx("input",{type:"text",value:p,onChange:s=>g(s.target.value),placeholder:"Search templates by name, tech, or category...",className:"w-full pl-11 pr-4 py-3 text-sm bg-white border border-[#ECEAE3] rounded-xl outline-none focus:border-[#553DE9] focus:ring-2 focus:ring-[#553DE9]/10 transition-all shadow-sm"}),p&&e.jsx("button",{onClick:()=>g(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-xs text-[#6B6960] hover:text-[#36342E] bg-[#F8F4F0] px-2 py-0.5 rounded",children:"Clear"})]}),e.jsx("div",{className:"flex items-center justify-center gap-1.5 flex-wrap",role:"tablist",children:fe.map(s=>{const b=s.icon,y=f?s.key==="all"?f.length:f.filter(t=>(t.category||"Other")===s.key).length:0;return e.jsxs("button",{role:"tab","aria-selected":a===s.key,onClick:()=>d(s.key),className:`flex items-center gap-1.5 px-3.5 py-2 text-xs font-semibold rounded-lg transition-all whitespace-nowrap ${a===s.key?"bg-[#553DE9] text-white shadow-sm":"text-[#6B6960] hover:text-[#36342E] hover:bg-[#F8F4F0] bg-white border border-[#ECEAE3]"}`,children:[e.jsx(b,{size:14}),s.label,f&&e.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded-full ${a===s.key?"bg-white/20 text-white":"bg-[#F8F4F0] text-[#6B6960]"}`,children:y})]},s.key)})})]}),!p&&a==="all"&&f&&f.length>0&&e.jsx(de,{templates:f,onSelect:r,onPreview:h}),f?i.length===0?e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(I,{size:32,className:"mx-auto text-[#ECEAE3] mb-3"}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-1",children:"No templates match your search."}),e.jsx("p",{className:"text-xs text-[#939084] mb-3",children:"Try different keywords or browse a category."}),p&&e.jsx("button",{onClick:()=>{g(""),d("all")},className:"text-xs text-[#553DE9] hover:underline font-medium",children:"Clear all filters"})]}):e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:[i.map(s=>{const b=s.category||"Other",y=U[b]||U.Other,t=s.tech_stack||[],o=s.difficulty,x=s.build_time;return e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>h(s),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),h(s))},className:"bg-white border border-[#ECEAE3] rounded-xl shadow-card hover:shadow-card-hover hover:-translate-y-0.5 transition-all duration-200 cursor-pointer overflow-hidden group",children:[e.jsxs("div",{className:`h-32 bg-gradient-to-br ${y} relative overflow-hidden`,children:[e.jsx(ge,{category:b}),e.jsx("div",{className:"absolute top-3 right-3",children:e.jsx("span",{className:"text-[10px] font-semibold text-white/90 bg-white/20 backdrop-blur-sm px-2 py-0.5 rounded",children:b})}),t.length>0&&e.jsxs("div",{className:"absolute bottom-3 left-3 right-3 flex items-center gap-1.5",children:[t.slice(0,3).map(c=>e.jsx("span",{className:"text-[10px] font-semibold text-white/90 bg-white/20 backdrop-blur-sm px-2 py-0.5 rounded",children:c},c)),t.length>3&&e.jsxs("span",{className:"text-[10px] text-white/70 bg-white/15 backdrop-blur-sm px-1.5 py-0.5 rounded",children:["+",t.length-3]})]})]}),e.jsxs("div",{className:"p-4",children:[e.jsx("h3",{className:"text-sm font-bold text-[#36342E] mb-1 group-hover:text-[#553DE9] transition-colors",children:je(s.name)}),e.jsx("p",{className:"text-xs text-[#6B6960] line-clamp-2 mb-3 min-h-[2.4em]",children:s.description||s.filename}),t.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mb-3",children:t.map(c=>e.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 text-[10px] font-medium rounded ${ue[c]||"bg-[#F8F4F0] text-[#6B6960]"}`,children:c},c))}),e.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-[#ECEAE3]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ye,{level:o}),x&&e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[#6B6960]",title:"Hand-written estimate, not a measured build",children:[e.jsx(T,{size:11}),e.jsxs("span",{children:["Est. ",x]})]})]}),e.jsx(N,{size:"sm",icon:D,onClick:c=>{c.stopPropagation(),r(s.filename)},className:"opacity-0 group-hover:opacity-100 transition-opacity",children:"Use"})]})]})]},s.filename)}),e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>m(!0),onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),m(!0))},className:"bg-white border-2 border-dashed border-[#ECEAE3] rounded-xl hover:border-[#553DE9]/30 hover:bg-[#553DE9]/[0.02] transition-all duration-200 cursor-pointer overflow-hidden group flex flex-col items-center justify-center min-h-[320px]",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-[#553DE9]/10 flex items-center justify-center mb-4 group-hover:bg-[#553DE9]/15 transition-colors",children:e.jsx(ie,{size:28,className:"text-[#553DE9]"})}),e.jsx("h3",{className:"text-sm font-bold text-[#36342E] mb-1 group-hover:text-[#553DE9] transition-colors",children:"Create Your Own"}),e.jsx("p",{className:"text-xs text-[#6B6960] text-center px-6 max-w-[200px]",children:"Design a custom template with your preferred stack and features"})]})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:[1,2,3,4,5,6].map(s=>e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl shadow-card overflow-hidden animate-pulse",children:[e.jsx("div",{className:"h-32 bg-gradient-to-br from-[#ECEAE3]/30 to-[#ECEAE3]/10"}),e.jsxs("div",{className:"p-4 space-y-2",children:[e.jsx("div",{className:"h-4 bg-[#ECEAE3]/40 rounded w-3/4"}),e.jsx("div",{className:"h-3 bg-[#ECEAE3]/30 rounded w-full"}),e.jsx("div",{className:"h-3 bg-[#ECEAE3]/20 rounded w-1/2"}),e.jsxs("div",{className:"flex gap-1 mt-2",children:[e.jsx("div",{className:"h-5 w-14 bg-[#ECEAE3]/30 rounded"}),e.jsx("div",{className:"h-5 w-14 bg-[#ECEAE3]/30 rounded"})]})]})]},s))}),w&&e.jsx(me,{template:w,onClose:()=>h(null)}),j&&e.jsx(pe,{onClose:()=>m(!1)})]})}export{ze as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as j,r as i,j as e}from"./index-
|
|
1
|
+
import{c as j,r as i,j as e}from"./index-Cz7q1bvC.js";import{L as w}from"./lock-DSI29pct.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|