loki-mode 6.71.0 → 6.72.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.md +9 -1
  2. package/SKILL.md +2 -2
  3. package/VERSION +1 -1
  4. package/autonomy/hooks/migration-hooks.sh +26 -0
  5. package/autonomy/loki +429 -92
  6. package/autonomy/run.sh +219 -38
  7. package/dashboard/__init__.py +1 -1
  8. package/dashboard/server.py +101 -19
  9. package/docs/INSTALLATION.md +20 -11
  10. package/docs/bug-fixes/agent-01-cli-fixes.md +101 -0
  11. package/docs/bug-fixes/agent-02-purplelab-fixes.md +88 -0
  12. package/docs/bug-fixes/agent-03-dashboard-fixes.md +119 -0
  13. package/docs/bug-fixes/agent-04-memory-fixes.md +105 -0
  14. package/docs/bug-fixes/agent-05-provider-fixes.md +86 -0
  15. package/docs/bug-fixes/agent-06-integration-fixes.md +101 -0
  16. package/docs/bug-fixes/agent-07-dash-run-fixes.md +101 -0
  17. package/docs/bug-fixes/agent-08-docker-fixes.md +164 -0
  18. package/docs/bug-fixes/agent-09-e2e-build-fixes.md +69 -0
  19. package/docs/bug-fixes/agent-10-e2e-fullstack-fixes.md +102 -0
  20. package/docs/bug-fixes/agent-11-e2e-session-fixes.md +70 -0
  21. package/docs/bug-fixes/agent-12-scenario-fixes.md +120 -0
  22. package/docs/bug-fixes/agent-13-enterprise-fixes.md +143 -0
  23. package/docs/bug-fixes/agent-14-uat-newuser-fixes.md +88 -0
  24. package/docs/bug-fixes/agent-15-uat-poweruser-fixes.md +132 -0
  25. package/docs/bug-fixes/agent-19-code-review.md +316 -0
  26. package/docs/bug-fixes/agent-20-architecture-review.md +331 -0
  27. package/docs/competitive/bolt-new-analysis.md +579 -0
  28. package/docs/competitive/emergence-others-analysis.md +605 -0
  29. package/docs/competitive/replit-lovable-analysis.md +622 -0
  30. package/docs/test-scenarios/edge-cases.md +813 -0
  31. package/docs/test-scenarios/enterprise-scenarios.md +732 -0
  32. package/mcp/__init__.py +1 -1
  33. package/mcp/server.py +49 -5
  34. package/memory/consolidation.py +33 -0
  35. package/memory/embeddings.py +10 -1
  36. package/memory/engine.py +83 -38
  37. package/memory/retrieval.py +36 -0
  38. package/memory/storage.py +56 -4
  39. package/memory/token_economics.py +14 -2
  40. package/memory/vector_index.py +36 -7
  41. package/package.json +1 -1
  42. package/providers/gemini.sh +89 -2
  43. package/templates/README.md +1 -1
  44. package/templates/cli-tool.md +30 -0
  45. package/templates/dashboard.md +4 -0
  46. package/templates/data-pipeline.md +4 -0
  47. package/templates/discord-bot.md +47 -0
  48. package/templates/game.md +4 -0
  49. package/templates/microservice.md +4 -0
  50. package/templates/npm-library.md +4 -0
  51. package/templates/rest-api-auth.md +50 -20
  52. package/templates/rest-api.md +15 -0
  53. package/templates/saas-starter.md +1 -1
  54. package/templates/slack-bot.md +36 -0
  55. package/templates/static-landing-page.md +9 -1
  56. package/templates/web-scraper.md +4 -0
  57. package/web-app/dist/assets/Badge-CeBkFjo6.js +1 -0
  58. package/web-app/dist/assets/Button-yuhqo8Fq.js +1 -0
  59. package/web-app/dist/assets/{Card-BMw7NSaV.js → Card-BG17vsX0.js} +1 -1
  60. package/web-app/dist/assets/{HomePage-QyvNpyFv.js → HomePage-BMSQ7Apj.js} +3 -3
  61. package/web-app/dist/assets/{LoginPage-CG_DkANw.js → LoginPage-aH_6iolg.js} +1 -1
  62. package/web-app/dist/assets/{NotFoundPage-CHBJTLTi.js → NotFoundPage-Di8cNtB1.js} +1 -1
  63. package/web-app/dist/assets/ProjectPage-BtRssmw9.js +285 -0
  64. package/web-app/dist/assets/ProjectsPage-B-FTFagc.js +6 -0
  65. package/web-app/dist/assets/{SettingsPage-Dq-c6kXj.js → SettingsPage-DIJPBla4.js} +1 -1
  66. package/web-app/dist/assets/TeamsPage--19fNX7w.js +36 -0
  67. package/web-app/dist/assets/TemplatesPage-ChUQNOOv.js +11 -0
  68. package/web-app/dist/assets/TerminalOutput-Dwrzecyl.js +31 -0
  69. package/web-app/dist/assets/activity-BNRWeu9N.js +6 -0
  70. package/web-app/dist/assets/{arrow-left-Dw9yRwL8.js → arrow-left-Ce6g1_YE.js} +1 -1
  71. package/web-app/dist/assets/circle-alert-LIndawHL.js +11 -0
  72. package/web-app/dist/assets/clock-Bpj4VPlP.js +6 -0
  73. package/web-app/dist/assets/{external-link-DGtaQZrg.js → external-link-BhhdF0iQ.js} +1 -1
  74. package/web-app/dist/assets/folder-open-CM2LgfxI.js +11 -0
  75. package/web-app/dist/assets/index-8-KpWWq7.css +1 -0
  76. package/web-app/dist/assets/index-kPDW4e_b.js +236 -0
  77. package/web-app/dist/assets/lock-sAk3Xe54.js +16 -0
  78. package/web-app/dist/assets/search-CR-2i9by.js +6 -0
  79. package/web-app/dist/assets/server-DuFh4ymA.js +26 -0
  80. package/web-app/dist/assets/trash-2-BmkkT8V_.js +11 -0
  81. package/web-app/dist/index.html +2 -2
  82. package/web-app/server.py +1345 -55
  83. package/web-app/dist/assets/Badge-BFLpnFZM.js +0 -6
  84. package/web-app/dist/assets/Button-BYY9clv_.js +0 -16
  85. package/web-app/dist/assets/ProjectPage-q65bhy76.js +0 -217
  86. package/web-app/dist/assets/ProjectsPage-d4mY9ewI.js +0 -21
  87. package/web-app/dist/assets/TemplatesPage-BEpY-p-Q.js +0 -1
  88. package/web-app/dist/assets/TerminalOutput-CFy7MnPO.js +0 -51
  89. package/web-app/dist/assets/clock-D4pcK_Eq.js +0 -11
  90. package/web-app/dist/assets/index-BnNomb7B.js +0 -196
  91. package/web-app/dist/assets/index-D452pFGl.css +0 -1
@@ -1,21 +0,0 @@
1
- import{c as p,u as C,r as a,a as j,j as e}from"./index-BnNomb7B.js";import{B as b,P as y,F,T as S}from"./Button-BYY9clv_.js";import{C as P}from"./Card-BMw7NSaV.js";import{u as _,B}from"./Badge-BFLpnFZM.js";import{E as z}from"./external-link-DGtaQZrg.js";import"./clock-D4pcK_Eq.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 D=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],T=p("circle-x",D);/**
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 L=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],A=p("copy",L);/**
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 R=[["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"}]],$=p("ellipsis-vertical",R);/**
17
- * @license lucide-react v0.577.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const O=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],U=p("search",O);function M(s){const n=I(s);return n==="completed"?"completed":n==="running"?"running":n==="failed"?"failed":n==="started"?"started":"empty"}const q={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 I(s){return{completion_promise_fulfilled:"completed",complete:"completed",done:"completed",in_progress:"running",planning:"running",error:"failed"}[s]||s}const V=[{key:"all",label:"All"},{key:"running",label:"Running"},{key:"completed",label:"Completed"},{key:"failed",label:"Failed"}];function Y(){const s=C(),[n,u]=a.useState(""),[i,d]=a.useState("all"),[r,o]=a.useState(null),[x,l]=a.useState(!1),[m,c]=a.useState(null),N=a.useCallback(()=>j.getSessionsHistory(),[]),{data:h,refresh:v}=_(N,15e3,!0),g=a.useMemo(()=>{if(!h)return[];let t=h;if(i!=="all"&&(t=t.filter(f=>f.status===i)),n.trim()){const f=n.trim().toLowerCase();t=t.filter(E=>E.prd_snippet.toLowerCase().includes(f))}return t},[h,i,n]),w=t=>{navigator.clipboard.writeText(t),c("Path copied"),setTimeout(()=>c(null),2e3)},k=async()=>{if(r){l(!0);try{await j.deleteSession(r.id),o(null),c("Project deleted"),setTimeout(()=>c(null),3e3),v()}catch(t){c(`Delete failed: ${t instanceof Error?t.message:"Unknown error"}`),setTimeout(()=>c(null),5e3)}finally{l(!1)}}};return e.jsxs("div",{className:"max-w-[1400px] mx-auto px-6 py-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h1",{className:"font-heading text-h1 text-[#36342E]",children:"Projects"}),e.jsx(b,{icon:y,onClick:()=>s("/"),children:"New Project"})]}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsxs("div",{className:"relative flex-1 max-w-sm",children:[e.jsx(U,{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:n,onChange:t=>u(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:V.map(t=>e.jsx("button",{role:"tab","aria-selected":i===t.key,onClick:()=>d(t.key),className:`px-3 py-1.5 text-xs font-semibold rounded-[3px] transition-colors ${i===t.key?"bg-[#553DE9] text-white":"text-[#6B6960] hover:text-[#36342E] hover:bg-[#F8F4F0]"}`,children:t.label},t.key))})]}),g.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(b,{icon:y,onClick:()=>s("/"),children:"New Project"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:g.map(t=>e.jsx(H,{session:t,onOpen:()=>s(`/project/${t.id}`),onDelete:()=>o(t),onCopyPath:()=>w(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:()=>o(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:k,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"})]})]})}),m&&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:[m,e.jsx("button",{onClick:()=>c(null),className:"text-white/60 hover:text-white",children:e.jsx(T,{size:14})})]})]})}function H({session:s,onOpen:n,onDelete:u,onCopyPath:i}){const[d,r]=a.useState(!1),o=a.useRef(null);a.useEffect(()=>{if(!d)return;const l=m=>{o.current&&!o.current.contains(m.target)&&r(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[d]);const x=new Date(s.date).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"});return e.jsxs(P,{hover:!0,onClick:n,className:"relative",children:[e.jsxs("div",{className:"absolute top-2.5 right-2.5 z-10",ref:o,children:[e.jsx("button",{onClick:l=>{l.stopPropagation(),r(!d)},"aria-label":"Project options",className:"p-1 rounded-[3px] text-[#B8B5AD] hover:text-[#36342E] hover:bg-[#F8F4F0] transition-colors",children:e.jsx($,{size:16})}),d&&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),n()},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(F,{size:14,className:"text-[#6B6960]"}),"Open project"]}),e.jsxs("button",{onClick:l=>{l.stopPropagation(),r(!1),window.open(`/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(z,{size:14,className:"text-[#6B6960]"}),"Open in new tab"]}),e.jsxs("button",{onClick:l=>{l.stopPropagation(),r(!1),i()},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(A,{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),u()},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(S,{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(B,{status:M(s.status),children:q[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{Y as default};
@@ -1 +0,0 @@
1
- import{u as c,r,a as x,j as t}from"./index-BnNomb7B.js";import{C as p}from"./Card-BMw7NSaV.js";import{u as d,B as h}from"./Badge-BFLpnFZM.js";import"./clock-D4pcK_Eq.js";const g=[{key:"all",label:"All"},{key:"website",label:"Website"},{key:"api",label:"API"},{key:"cli",label:"CLI"},{key:"bot",label:"Bot"},{key:"data",label:"Data"},{key:"other",label:"Other"}];function u(l){return l.replace(/\.md$/i,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase())}function k(){const l=c(),[a,o]=r.useState("all"),n=r.useCallback(()=>x.getTemplates(),[]),{data:s}=d(n,6e4,!0),i=r.useMemo(()=>s?a==="all"?s:s.filter(e=>(e.category||"other")===a):[],[s,a]),m=e=>{sessionStorage.setItem("pl_template",e),l("/")};return t.jsxs("div",{className:"max-w-[1400px] mx-auto px-6 py-8",children:[t.jsx("h1",{className:"font-heading text-h1 text-[#36342E] mb-6",children:"Templates"}),t.jsx("div",{className:"flex items-center gap-1 mb-6",role:"tablist",children:g.map(e=>t.jsx("button",{role:"tab","aria-selected":a===e.key,onClick:()=>o(e.key),className:`px-3 py-1.5 text-xs font-semibold rounded-[3px] transition-colors ${a===e.key?"bg-[#553DE9] text-white":"text-[#6B6960] hover:text-[#36342E] hover:bg-[#F8F4F0]"}`,children:e.label},e.key))}),s?i.length===0?t.jsx("p",{className:"text-sm text-[#6B6960] py-12 text-center",children:"No templates in this category."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:i.map(e=>t.jsxs(p,{hover:!0,onClick:()=>m(e.filename),children:[t.jsx("div",{className:"mb-2",children:t.jsx(h,{status:"version",children:e.category||"other"})}),t.jsx("h3",{className:"text-sm font-medium text-[#36342E] mb-1",children:u(e.name)}),t.jsx("p",{className:"text-xs text-[#6B6960]",children:e.filename})]},e.filename))}):t.jsx("p",{className:"text-sm text-[#6B6960]",children:"Loading templates..."})]})}export{k as default};
@@ -1,51 +0,0 @@
1
- import{c as o,r as m,j as e}from"./index-BnNomb7B.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 j=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],v=o("arrow-down",j);/**
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 b=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],N=o("chevron-down",b);/**
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 S=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],_=o("chevron-right",S);/**
17
- * @license lucide-react v0.577.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const E=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],L=o("lock",E);/**
22
- * @license lucide-react v0.577.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const C=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],V=o("pause",C);/**
27
- * @license lucide-react v0.577.0 - ISC
28
- *
29
- * This source code is licensed under the ISC license.
30
- * See the LICENSE file in the root directory of this source tree.
31
- */const $=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],F=o("play",$);/**
32
- * @license lucide-react v0.577.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */const q=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],M=o("radio",q);/**
37
- * @license lucide-react v0.577.0 - ISC
38
- *
39
- * This source code is licensed under the ISC license.
40
- * See the LICENSE file in the root directory of this source tree.
41
- */const T=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],z=o("rotate-cw",T);/**
42
- * @license lucide-react v0.577.0 - ISC
43
- *
44
- * This source code is licensed under the ISC license.
45
- * See the LICENSE file in the root directory of this source tree.
46
- */const R=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],I=o("square",R);/**
47
- * @license lucide-react v0.577.0 - ISC
48
- *
49
- * This source code is licensed under the ISC license.
50
- * See the LICENSE file in the root directory of this source tree.
51
- */const A=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],D=o("triangle-alert",A);function H({error:s}){const[r,d]=m.useState(!1);return s?e.jsxs("div",{className:"mt-3 text-left w-full max-w-sm mx-auto",children:[e.jsxs("button",{onClick:()=>d(!r),className:"flex items-center gap-1 text-xs text-muted hover:text-ink transition-colors",children:[r?e.jsx(N,{size:12}):e.jsx(_,{size:12}),"Show Details"]}),r&&e.jsx("pre",{className:"mt-2 p-3 text-[11px] font-mono text-danger/80 bg-danger/5 border border-danger/10 rounded-btn overflow-x-auto max-h-40 overflow-y-auto whitespace-pre-wrap",children:s.stack||s.message})]}):null}class J extends m.Component{constructor(r){super(r),this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,d){console.error(`[${this.props.name||"Component"}] render error:`,r,d)}render(){var r;return this.state.hasError?this.props.fallback?this.props.fallback:e.jsxs("div",{className:"flex flex-col items-center justify-center p-6 h-full min-h-[120px]",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-danger/10 flex items-center justify-center mb-3",children:e.jsx(D,{size:20,className:"text-danger"})}),e.jsx("p",{className:"text-sm font-medium text-ink",children:"Something went wrong"}),e.jsx("p",{className:"text-xs text-muted mt-1 max-w-xs text-center",children:((r=this.state.error)==null?void 0:r.message)||"An unexpected error occurred in this section."}),e.jsxs("button",{onClick:()=>this.setState({hasError:!1,error:null}),className:"mt-3 inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-btn border border-primary/20 text-primary hover:bg-primary/5 transition-colors",children:[e.jsx(z,{size:12}),"Try Again"]}),e.jsx(H,{error:this.state.error})]}):this.props.children}}const B={info:"text-info",error:"text-danger",warning:"text-warning",debug:"text-muted",critical:"text-danger font-bold"};function O(s){if(!s)return"";if(s.includes("T")||s.includes("-"))try{return new Date(s).toLocaleTimeString("en-US",{hour12:!1})}catch{return s}return s}function U({logs:s,loading:r,subscribe:d}){const c=m.useRef(null),[l,f]=m.useState(!1),[g,k]=m.useState([]);m.useEffect(()=>d?d("log",a=>{const i=a;i!=null&&i.line&&k(h=>{const n=[...h,{message:i.line,timestamp:i.timestamp||""}];return n.length>500?n.slice(-500):n})}):void 0,[d]);const x=(()=>{const t=g.map(n=>{let u="info";const p=n.message.toLowerCase();return p.includes("error")||p.includes("fail")?u="error":p.includes("warn")?u="warning":p.includes("debug")&&(u="debug"),{timestamp:n.timestamp,level:u,message:n.message,source:"ws"}}),a=s||[];if(t.length===0)return a;if(a.length===0)return t;const i=new Set(t.map(n=>n.message));return[...a.filter(n=>!i.has(n.message)),...t]})();m.useEffect(()=>{!l&&c.current&&(c.current.scrollTop=c.current.scrollHeight)},[x,l]);const y=()=>{if(!c.current)return;const{scrollTop:t,scrollHeight:a,clientHeight:i}=c.current,h=a-t-i<50;f(!h)},w=()=>{var t;f(!1),(t=c.current)==null||t.scrollTo({top:c.current.scrollHeight,behavior:"smooth"})};return e.jsxs("div",{className:"card p-0 overflow-hidden flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border flex-shrink-0",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Terminal"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"font-mono text-xs text-muted",children:[x.length," lines"]}),e.jsxs("button",{onClick:l?w:()=>f(!0),className:`flex items-center gap-1.5 text-xs font-medium px-3 py-1.5 rounded-lg border transition-colors ${l?"border-warning/40 text-warning bg-warning/5 hover:bg-warning/10":"border-primary/20 text-primary hover:bg-primary/5"}`,title:l?"Scroll locked -- click to resume auto-scroll":"Auto-scrolling -- click to lock",children:[l?e.jsx(L,{size:14}):e.jsx(M,{size:14}),l?"Locked":"Live"]}),l&&e.jsxs("button",{onClick:w,className:"flex items-center gap-1.5 text-xs text-primary hover:text-primary transition-colors font-medium",children:[e.jsx(v,{size:14}),"Jump to bottom"]})]})]}),e.jsxs("div",{ref:c,onScroll:y,className:"flex-1 overflow-y-auto terminal-scroll bg-ink/[0.03] p-4 font-mono text-xs leading-relaxed",children:[r&&!s&&g.length===0&&e.jsx("div",{className:"text-muted animate-pulse",children:"Connecting to log stream..."}),x.length===0&&!r&&e.jsxs("div",{className:"text-muted/60",children:[e.jsx("p",{children:"No log output yet."}),e.jsx("p",{className:"mt-1",children:"Start a build to see terminal output here."})]}),x.map((t,a)=>e.jsxs("div",{className:"flex gap-2 hover:bg-hover rounded px-1 -mx-1",children:[e.jsx("span",{className:"text-muted flex-shrink-0 select-none w-16 text-right",children:O(t.timestamp)}),e.jsx("span",{className:`flex-shrink-0 w-12 text-right uppercase text-xs font-semibold ${B[t.level]||"text-muted"}`,children:t.level}),e.jsx("span",{className:`flex-1 break-all ${t.level==="error"||t.level==="critical"?"text-danger":"text-ink"}`,children:t.message})]},a)),x.length>0&&e.jsx("div",{className:"terminal-cursor mt-1"})]})]})}export{N as C,J as E,F as P,z as R,I as S,U as T,V as a,_ as b,D as c};
@@ -1,11 +0,0 @@
1
- import{c}from"./index-BnNomb7B.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 o=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],a=c("check",o);/**
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 e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],k=c("clock",e);export{k as C,a};