vibedoc 1.0.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 (201) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/app-build-manifest.json +92 -0
  3. package/.next/app-path-routes-manifest.json +1 -0
  4. package/.next/build-manifest.json +32 -0
  5. package/.next/package.json +1 -0
  6. package/.next/prerender-manifest.js +1 -0
  7. package/.next/prerender-manifest.json +1 -0
  8. package/.next/react-loadable-manifest.json +282 -0
  9. package/.next/required-server-files.json +1 -0
  10. package/.next/routes-manifest.json +1 -0
  11. package/.next/server/app/(app)/activity/page.js +1 -0
  12. package/.next/server/app/(app)/activity/page.js.nft.json +1 -0
  13. package/.next/server/app/(app)/activity/page_client-reference-manifest.js +1 -0
  14. package/.next/server/app/(app)/board/page.js +2 -0
  15. package/.next/server/app/(app)/board/page.js.nft.json +1 -0
  16. package/.next/server/app/(app)/board/page_client-reference-manifest.js +1 -0
  17. package/.next/server/app/(app)/docs/page.js +2 -0
  18. package/.next/server/app/(app)/docs/page.js.nft.json +1 -0
  19. package/.next/server/app/(app)/docs/page_client-reference-manifest.js +1 -0
  20. package/.next/server/app/(app)/memory/page.js +7 -0
  21. package/.next/server/app/(app)/memory/page.js.nft.json +1 -0
  22. package/.next/server/app/(app)/memory/page_client-reference-manifest.js +1 -0
  23. package/.next/server/app/(app)/settings/page.js +21 -0
  24. package/.next/server/app/(app)/settings/page.js.nft.json +1 -0
  25. package/.next/server/app/(app)/settings/page_client-reference-manifest.js +1 -0
  26. package/.next/server/app/(app)/setup/page.js +1 -0
  27. package/.next/server/app/(app)/setup/page.js.nft.json +1 -0
  28. package/.next/server/app/(app)/setup/page_client-reference-manifest.js +1 -0
  29. package/.next/server/app/_not-found/page.js +1 -0
  30. package/.next/server/app/_not-found/page.js.nft.json +1 -0
  31. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
  32. package/.next/server/app/_not-found.html +1 -0
  33. package/.next/server/app/_not-found.meta +6 -0
  34. package/.next/server/app/_not-found.rsc +9 -0
  35. package/.next/server/app/activity.html +1 -0
  36. package/.next/server/app/activity.meta +5 -0
  37. package/.next/server/app/activity.rsc +13 -0
  38. package/.next/server/app/api/activity/route.js +1 -0
  39. package/.next/server/app/api/activity/route.js.nft.json +1 -0
  40. package/.next/server/app/api/backlinks/route.js +1 -0
  41. package/.next/server/app/api/backlinks/route.js.nft.json +1 -0
  42. package/.next/server/app/api/context/route.js +1 -0
  43. package/.next/server/app/api/context/route.js.nft.json +1 -0
  44. package/.next/server/app/api/decisions/route.js +1 -0
  45. package/.next/server/app/api/decisions/route.js.nft.json +1 -0
  46. package/.next/server/app/api/docs/route.js +1 -0
  47. package/.next/server/app/api/docs/route.js.nft.json +1 -0
  48. package/.next/server/app/api/events/route.js +3 -0
  49. package/.next/server/app/api/events/route.js.nft.json +1 -0
  50. package/.next/server/app/api/mcp/route.js +103 -0
  51. package/.next/server/app/api/mcp/route.js.nft.json +1 -0
  52. package/.next/server/app/api/memory/route.js +1 -0
  53. package/.next/server/app/api/memory/route.js.nft.json +1 -0
  54. package/.next/server/app/api/projects/route.js +1 -0
  55. package/.next/server/app/api/projects/route.js.nft.json +1 -0
  56. package/.next/server/app/api/projects.body +1 -0
  57. package/.next/server/app/api/projects.meta +1 -0
  58. package/.next/server/app/api/settings/route.js +1 -0
  59. package/.next/server/app/api/settings/route.js.nft.json +1 -0
  60. package/.next/server/app/api/setup/generate/route.js +130 -0
  61. package/.next/server/app/api/setup/generate/route.js.nft.json +1 -0
  62. package/.next/server/app/api/setup/write/route.js +1 -0
  63. package/.next/server/app/api/setup/write/route.js.nft.json +1 -0
  64. package/.next/server/app/api/summary/route.js +1 -0
  65. package/.next/server/app/api/summary/route.js.nft.json +1 -0
  66. package/.next/server/app/api/tasks/route.js +1 -0
  67. package/.next/server/app/api/tasks/route.js.nft.json +1 -0
  68. package/.next/server/app/board.html +1 -0
  69. package/.next/server/app/board.meta +5 -0
  70. package/.next/server/app/board.rsc +13 -0
  71. package/.next/server/app/docs.html +1 -0
  72. package/.next/server/app/docs.meta +5 -0
  73. package/.next/server/app/docs.rsc +13 -0
  74. package/.next/server/app/index.html +1 -0
  75. package/.next/server/app/index.meta +6 -0
  76. package/.next/server/app/index.rsc +6 -0
  77. package/.next/server/app/memory.html +1 -0
  78. package/.next/server/app/memory.meta +5 -0
  79. package/.next/server/app/memory.rsc +13 -0
  80. package/.next/server/app/page.js +1 -0
  81. package/.next/server/app/page.js.nft.json +1 -0
  82. package/.next/server/app/page_client-reference-manifest.js +1 -0
  83. package/.next/server/app/settings.html +1 -0
  84. package/.next/server/app/settings.meta +5 -0
  85. package/.next/server/app/settings.rsc +13 -0
  86. package/.next/server/app/setup.html +1 -0
  87. package/.next/server/app/setup.meta +5 -0
  88. package/.next/server/app/setup.rsc +13 -0
  89. package/.next/server/app-paths-manifest.json +24 -0
  90. package/.next/server/chunks/191.js +91 -0
  91. package/.next/server/chunks/357.js +2 -0
  92. package/.next/server/chunks/486.js +12 -0
  93. package/.next/server/chunks/491.js +2 -0
  94. package/.next/server/chunks/778.js +9 -0
  95. package/.next/server/chunks/80.js +60 -0
  96. package/.next/server/chunks/900.js +6 -0
  97. package/.next/server/chunks/945.js +20 -0
  98. package/.next/server/chunks/font-manifest.json +1 -0
  99. package/.next/server/font-manifest.json +1 -0
  100. package/.next/server/functions-config-manifest.json +1 -0
  101. package/.next/server/interception-route-rewrite-manifest.js +1 -0
  102. package/.next/server/middleware-build-manifest.js +1 -0
  103. package/.next/server/middleware-manifest.json +6 -0
  104. package/.next/server/middleware-react-loadable-manifest.js +1 -0
  105. package/.next/server/next-font-manifest.js +1 -0
  106. package/.next/server/next-font-manifest.json +1 -0
  107. package/.next/server/pages/404.html +1 -0
  108. package/.next/server/pages/500.html +1 -0
  109. package/.next/server/pages/_app.js +1 -0
  110. package/.next/server/pages/_app.js.nft.json +1 -0
  111. package/.next/server/pages/_document.js +1 -0
  112. package/.next/server/pages/_document.js.nft.json +1 -0
  113. package/.next/server/pages/_error.js +1 -0
  114. package/.next/server/pages/_error.js.nft.json +1 -0
  115. package/.next/server/pages-manifest.json +1 -0
  116. package/.next/server/server-reference-manifest.js +1 -0
  117. package/.next/server/server-reference-manifest.json +1 -0
  118. package/.next/server/webpack-runtime.js +1 -0
  119. package/.next/static/chunks/1088.464d783cc5eea9de.js +1 -0
  120. package/.next/static/chunks/1222.e874d92bfc1bc6c7.js +1 -0
  121. package/.next/static/chunks/1347.3e7d2ed21b663e48.js +1 -0
  122. package/.next/static/chunks/1433.2f2e32dffc1c27c8.js +1 -0
  123. package/.next/static/chunks/1472.5e71f95e6296fd63.js +36 -0
  124. package/.next/static/chunks/1594.09677134642da9ff.js +93 -0
  125. package/.next/static/chunks/1638.2e37b49b302bcb6a.js +174 -0
  126. package/.next/static/chunks/2244.cf7a2544ebeb1e19.js +82 -0
  127. package/.next/static/chunks/228-e44243a26f6475e2.js +9 -0
  128. package/.next/static/chunks/2306.509ed7c364442601.js +2 -0
  129. package/.next/static/chunks/2412.949844de7f2bbdc3.js +262 -0
  130. package/.next/static/chunks/2565.eb3605e7c90e3c7e.js +131 -0
  131. package/.next/static/chunks/2591.56cbda5d4e6e2943.js +56 -0
  132. package/.next/static/chunks/2597.ba1681ae114a4aa7.js +29 -0
  133. package/.next/static/chunks/2647.011471b532619487.js +59 -0
  134. package/.next/static/chunks/2794.65caa79043b402f7.js +1 -0
  135. package/.next/static/chunks/2861.4fff66e909869a6d.js +148 -0
  136. package/.next/static/chunks/2894.5a2b6bbc2c48843d.js +43 -0
  137. package/.next/static/chunks/3795.50eafedfcd5f01d6.js +24 -0
  138. package/.next/static/chunks/3904.54baab606637ae6e.js +1 -0
  139. package/.next/static/chunks/4236.17567db90ef651b7.js +1 -0
  140. package/.next/static/chunks/4316-6345e1b4bb694a29.js +1 -0
  141. package/.next/static/chunks/490-ed8ba8bf24ab2f3d.js +1 -0
  142. package/.next/static/chunks/4982.9f5dde29b741d6dd.js +63 -0
  143. package/.next/static/chunks/5083.ffcecc2fefa6de50.js +55 -0
  144. package/.next/static/chunks/5218.35990037cf2fd97c.js +155 -0
  145. package/.next/static/chunks/5340.5ddd859da4765a69.js +1 -0
  146. package/.next/static/chunks/5453.47f6d134b08a854e.js +4 -0
  147. package/.next/static/chunks/5808.d42ab07c5de599fd.js +1 -0
  148. package/.next/static/chunks/6429.08e2027051a6966c.js +1 -0
  149. package/.next/static/chunks/6482.03215b09c8639bc2.js +7 -0
  150. package/.next/static/chunks/6842-aed3c9b445ee77d1.js +2 -0
  151. package/.next/static/chunks/6864.4be1f9d162073932.js +1 -0
  152. package/.next/static/chunks/6886.f44c1de05dae9abc.js +1 -0
  153. package/.next/static/chunks/68bc8b64.37fd49721fa7b320.js +136 -0
  154. package/.next/static/chunks/6bded0d7-aec80afe2d60204d.js +1 -0
  155. package/.next/static/chunks/7123.fdc5241f4c912578.js +62 -0
  156. package/.next/static/chunks/7235.d4cff43d3f970540.js +1 -0
  157. package/.next/static/chunks/7241.499111c9d51ab606.js +1 -0
  158. package/.next/static/chunks/7251.17e3ab4cd5935b2e.js +166 -0
  159. package/.next/static/chunks/7283.d294d5aebfe1c65f.js +215 -0
  160. package/.next/static/chunks/7292.0dfaab300ca1050a.js +1 -0
  161. package/.next/static/chunks/7527.0ccae900ac492b8c.js +1 -0
  162. package/.next/static/chunks/7697-812a5639d661760b.js +1 -0
  163. package/.next/static/chunks/7722.d7a4456b068af3c0.js +24 -0
  164. package/.next/static/chunks/7725-63beec2ffb219859.js +16 -0
  165. package/.next/static/chunks/8130.609cf9a280803973.js +1 -0
  166. package/.next/static/chunks/8338.2415ec79a5f31092.js +1 -0
  167. package/.next/static/chunks/845-0e3438196b5ef62c.js +1 -0
  168. package/.next/static/chunks/8836.71b3f39cb9a95d62.js +5 -0
  169. package/.next/static/chunks/942c9eea.2013b980eeaebb14.js +53 -0
  170. package/.next/static/chunks/94c12b52-436125ce5f9c910a.js +1 -0
  171. package/.next/static/chunks/9528.4d4672f83c5035ab.js +1 -0
  172. package/.next/static/chunks/9580.942737df82878943.js +1 -0
  173. package/.next/static/chunks/9672.cb194a5bbad5f696.js +1 -0
  174. package/.next/static/chunks/app/(app)/activity/page-91b9d738c33e19b5.js +1 -0
  175. package/.next/static/chunks/app/(app)/board/page-33f5e3998a8445ca.js +1 -0
  176. package/.next/static/chunks/app/(app)/docs/page-17670ed46c3594e6.js +1 -0
  177. package/.next/static/chunks/app/(app)/layout-34b4046ccf919d3f.js +1 -0
  178. package/.next/static/chunks/app/(app)/memory/page-b3aa8c5e028caf75.js +1 -0
  179. package/.next/static/chunks/app/(app)/settings/page-f264516b9005f933.js +16 -0
  180. package/.next/static/chunks/app/(app)/setup/page-9fd82b10016eca64.js +16 -0
  181. package/.next/static/chunks/app/_not-found/page-73e8eefca2388c5f.js +1 -0
  182. package/.next/static/chunks/app/layout-7054561bfe7eec9c.js +1 -0
  183. package/.next/static/chunks/app/page-f71834a10930be30.js +1 -0
  184. package/.next/static/chunks/b09b44eb.fa180e586fdf600b.js +1 -0
  185. package/.next/static/chunks/ea0025a9.12db9045daafb0c1.js +1 -0
  186. package/.next/static/chunks/efcceb14.8fc58c5c4428a08e.js +1 -0
  187. package/.next/static/chunks/framework-20afca218c33ed8b.js +33 -0
  188. package/.next/static/chunks/main-6224705d81e790a3.js +1 -0
  189. package/.next/static/chunks/main-app-02ed5dd91baaafdc.js +1 -0
  190. package/.next/static/chunks/pages/_app-db7a259df1c8778b.js +1 -0
  191. package/.next/static/chunks/pages/_error-76163253f7e717d4.js +1 -0
  192. package/.next/static/chunks/polyfills-78c92fac7aa8fdd8.js +1 -0
  193. package/.next/static/chunks/webpack-648d3cb0a281bce5.js +1 -0
  194. package/.next/static/css/615004f0fff77145.css +5 -0
  195. package/.next/static/r-2w-yCd6mM7TOOETgGaA/_buildManifest.js +1 -0
  196. package/.next/static/r-2w-yCd6mM7TOOETgGaA/_ssgManifest.js +1 -0
  197. package/README.md +160 -0
  198. package/bin/vibedoc.js +54 -0
  199. package/next.config.js +7 -0
  200. package/package.json +80 -0
  201. package/ws-server.js +12 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3015],{69827:function(e,t,n){Promise.resolve().then(n.bind(n,3526))},3526:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ep}});var a=n(59533),s=n(31229),c=n(11180),l=n(21263),r=n(20508),o=n(86725),i=n(92560),d=n(39098),u=n(12794),h=n(25612),x=n(80261),m=n(35710),p=n(48354),f=n(76877),v=n(56622),j=n(46850),g=n(30445),b=n(52284),w=n(13191),N=n(8637),y=n(1815);let k=y.fC,C=y.wy,S=y.Fw;var P=n(83373);let Z=(0,s.createContext)({active:!1,selected:new Set,toggle:()=>{},onRename:()=>{},onDelete:()=>{},renamingPath:null,setRenamingPath:()=>{}});function D(e){return e.replace(/\\/g,"/")}function E(e){return e.replace(/^\d+-/,"").replace(/[-_]/g," ").toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())}function T(e){let{node:t,depth:n,selectedPath:c,onDocClick:m,folderPath:p}=e,{active:f,selected:v,toggle:j,onRename:g,onDelete:N,renamingPath:y,setRenamingPath:D}=(0,s.useContext)(Z),[L,R]=(0,s.useState)(t.name),U=!!t.docPath,A=t.docPath===c,O=!!t.docPath&&v.has(t.docPath),z=t.docPath===y,_=12*n;return U?z?(0,a.jsxs)("div",{style:{paddingLeft:"".concat(8+_,"px")},className:"flex items-center gap-2 h-7 pr-2",children:[(0,a.jsx)(l.Z,{className:"h-3.5 w-3.5 shrink-0 opacity-50"}),(0,a.jsx)(w.I,{autoFocus:!0,value:L,onChange:e=>R(e.target.value),onKeyDown:e=>{if("Enter"===e.key){let e=L.trim();if(e&&e!==t.name){let n=t.docPath.split("/").slice(0,-1).join("/");g(n?"".concat(n,"/").concat(e,".md"):"".concat(e,".md"))}D(null)}else"Escape"===e.key&&(R(t.name),D(null))},onBlur:()=>{R(t.name),D(null)},className:"h-5 text-xs px-1 py-0"})]}):(0,a.jsxs)("div",{className:(0,b.cn)("group w-full flex items-center gap-2 h-7 pr-1 rounded-md text-xs transition-colors",A&&!f?"bg-accent/10 text-accent font-medium":O?"bg-accent/10 text-accent":"text-muted hover:text-txt hover:bg-surface2"),children:[(0,a.jsxs)("button",{onClick:()=>f?j(t.docPath):m(t.docPath),style:{paddingLeft:"".concat(8+_,"px")},className:"flex-1 flex items-center gap-2 h-full truncate",children:[f?(0,a.jsx)("span",{className:(0,b.cn)("h-3.5 w-3.5 shrink-0 rounded border flex items-center justify-center transition-colors",O?"border-accent bg-accent/20":"border-border"),children:O&&(0,a.jsx)(r.Z,{className:"h-2.5 w-2.5 text-accent"})}):(0,a.jsx)(l.Z,{className:"h-3.5 w-3.5 shrink-0 opacity-50"}),(0,a.jsx)("span",{className:"truncate",children:E(t.name)})]}),!f&&(0,a.jsxs)(P.h_,{children:[(0,a.jsx)(P.$F,{asChild:!0,children:(0,a.jsx)("button",{className:"h-5 w-5 shrink-0 flex items-center justify-center rounded opacity-0 group-hover:opacity-100 hover:bg-surface2 transition-opacity",onClick:e=>e.stopPropagation(),children:(0,a.jsx)(o.Z,{className:"h-3.5 w-3.5"})})}),(0,a.jsxs)(P.AW,{align:"end",className:"w-32",children:[(0,a.jsxs)(P.Xi,{onClick:()=>{R(t.name.replace(/\.md$/,"")),D(t.docPath)},children:[(0,a.jsx)(i.Z,{className:"h-3.5 w-3.5 mr-2"})," Rename"]}),(0,a.jsxs)(P.Xi,{onClick:()=>N(t.docPath),className:"text-red-400 focus:text-red-400",children:[(0,a.jsx)(d.Z,{className:"h-3.5 w-3.5 mr-2"})," Delete"]})]})]})]}):(0,a.jsxs)(k,{defaultOpen:!0,className:"group/folder",children:[(0,a.jsx)(C,{asChild:!0,children:(0,a.jsxs)("button",{style:{paddingLeft:"".concat(8+_,"px")},className:"w-full flex items-center gap-2 h-7 pr-2 rounded-md text-xs font-medium text-muted hover:text-txt hover:bg-surface2 transition-colors",children:[(0,a.jsx)(u.Z,{className:"h-3 w-3 shrink-0 transition-transform duration-200 group-data-[state=open]/folder:rotate-90"}),(0,a.jsx)(h.Z,{className:"h-3.5 w-3.5 shrink-0 text-accent/70 group-data-[state=open]/folder:hidden"}),(0,a.jsx)(x.Z,{className:"h-3.5 w-3.5 shrink-0 text-accent/70 hidden group-data-[state=open]/folder:block"}),(0,a.jsx)("span",{className:"truncate",children:E(t.name)})]})}),(0,a.jsx)(S,{className:"overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",children:t.children.map(e=>{var t;return(0,a.jsx)(T,{node:e,depth:n+1,selectedPath:c,onDocClick:m,folderPath:"".concat(p,"/").concat(e.name)},null!==(t=e.docPath)&&void 0!==t?t:e.name)})})]})}function L(e){let{docs:t,selectedDocPath:n,searchValue:c,onSearchChange:o,onDocClick:i,onNewDocClick:d,onDocDeleted:u,onDocRenamed:h,rootParam:x=""}=e,[y,k]=(0,s.useState)(!1),[C,S]=(0,s.useState)(new Set),[P,L]=(0,s.useState)("idle"),[R,U]=(0,s.useState)(null),[A,O]=(0,s.useState)(null),z=(0,s.useMemo)(()=>t.filter(e=>{let t=D(e.path);return"CLAUDE.md"===t||"AGENTS.md"===t||t.endsWith("/CLAUDE.md")||t.endsWith("/AGENTS.md")}),[t]),_=(0,s.useMemo)(()=>t.filter(e=>{let t=D(e.path);return"CLAUDE.md"!==t&&"AGENTS.md"!==t&&!t.endsWith("/CLAUDE.md")&&!t.endsWith("/AGENTS.md")}),[t]),I=(0,s.useMemo)(()=>(function(e){let t={name:"",children:[]};for(let n of e){let e=D(n.path).split("/"),a=t;for(let t=0;t<e.length-1;t++){let n=a.children.find(n=>n.name===e[t]&&!n.docPath);n||(n={name:e[t],children:[]},a.children.push(n)),a=n}a.children.push({name:n.name,docPath:n.path,children:[]})}return t.children})(_),[_]),M=c.trim().length>0;function V(e){S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function F(){k(!1),S(new Set),L("idle")}async function H(e){if(R&&h){try{(await fetch("/api/docs".concat(x),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldPath:R,newPath:e})})).ok&&h(R,e)}catch(e){}U(null)}}async function W(e){if(u&&window.confirm("Delete ".concat(e,"?")))try{(await fetch("/api/docs".concat(x),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})})).ok&&u(e)}catch(e){}}async function B(){if(0!==C.size){L("copying");try{let e=await fetch("/api/context".concat(x),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:[...C]})}),{context:t}=await e.json();await navigator.clipboard.writeText(t),L("copied"),setTimeout(()=>L("idle"),2e3)}catch(e){L("idle")}}}return(0,a.jsx)(Z.Provider,{value:{active:y,selected:C,toggle:V,onRename:H,onDelete:W,renamingPath:R,setRenamingPath:U},children:(0,a.jsxs)("aside",{className:"w-56 flex flex-col border-r border-border flex-shrink-0 bg-sidebar",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[(0,a.jsx)("span",{className:"text-[10px] font-semibold text-muted uppercase tracking-wider",children:"Docs"}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("button",{onClick:()=>{y?F():k(!0)},className:(0,b.cn)("h-5 w-5 flex items-center justify-center rounded transition-colors",y?"bg-accent/20 text-accent":"hover:bg-surface2 text-muted hover:text-accent"),title:"Select docs",children:(0,a.jsx)(m.Z,{className:"h-3.5 w-3.5"})}),d&&(0,a.jsx)("button",{onClick:d,className:"h-5 w-5 flex items-center justify-center rounded hover:bg-surface2 text-muted hover:text-accent transition-colors",title:"New document",children:(0,a.jsx)(p.Z,{className:"h-3.5 w-3.5"})})]})]}),!y&&(0,a.jsx)("div",{className:"p-2 border-b border-border",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(f.Z,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted pointer-events-none"}),(0,a.jsx)(w.I,{id:"doc-search",value:c,onChange:e=>o(e.target.value),placeholder:"Search docs...",className:"pl-7 h-8 text-xs bg-surface2 border-transparent focus:border-border"})]})}),(0,a.jsx)(N.x,{className:"flex-1",children:(0,a.jsx)("div",{className:"p-1.5 space-y-0.5",children:y?t.map(e=>{let t=C.has(e.path);return(0,a.jsxs)("button",{onClick:()=>V(e.path),className:(0,b.cn)("w-full flex items-center gap-2 h-7 px-2 rounded-md text-xs transition-colors",t?"bg-accent/10 text-accent":"text-muted hover:text-txt hover:bg-surface2"),children:[(0,a.jsx)("span",{className:(0,b.cn)("h-3.5 w-3.5 shrink-0 rounded border flex items-center justify-center transition-colors",t?"border-accent bg-accent/20":"border-border"),children:t&&(0,a.jsx)(r.Z,{className:"h-2.5 w-2.5 text-accent"})}),(0,a.jsx)("span",{className:"truncate flex-1 text-left",children:e.name}),(0,a.jsx)("span",{className:"text-[10px] opacity-40 truncate max-w-[60px]",children:D(e.path).split("/").slice(0,-1).join("/")||"root"})]},e.path)}):(0,a.jsxs)(a.Fragment,{children:[!M&&z.length>0&&(0,a.jsxs)("div",{className:"mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[(0,a.jsx)(v.Z,{className:"h-3.5 w-3.5 text-amber-400 shrink-0"}),(0,a.jsx)("span",{className:"text-[10px] font-semibold text-muted uppercase tracking-wider",children:"Agent Config"}),(0,a.jsx)("span",{className:"ml-auto text-[9px] font-medium bg-amber-400/15 text-amber-400 px-1.5 py-0.5 rounded-full",children:"AI"})]}),z.map(e=>(0,a.jsxs)("button",{onClick:()=>i(e.path),className:(0,b.cn)("w-full flex items-center gap-2 h-7 px-2 rounded-md text-xs transition-colors",e.path===n?"bg-accent/10 text-accent font-medium":"text-muted hover:text-txt hover:bg-surface2"),children:[(0,a.jsx)(l.Z,{className:"h-3.5 w-3.5 shrink-0 opacity-50"}),(0,a.jsx)("span",{className:"truncate",children:e.name})]},e.path)),(0,a.jsx)("div",{className:"mt-2 border-t border-border"})]}),M?0===t.length?(0,a.jsx)("p",{className:"text-xs text-muted px-2 py-4 text-center",children:"No results"}):t.map(e=>(0,a.jsxs)("button",{onClick:()=>i(e.path),className:(0,b.cn)("w-full flex flex-col items-start gap-0.5 px-2 py-1.5 rounded-md text-xs transition-colors text-left",e.path===n?"bg-accent/10 text-accent":"text-muted hover:text-txt hover:bg-surface2"),children:[(0,a.jsx)("span",{className:"font-medium truncate w-full",children:E(e.name)}),(0,a.jsx)("span",{className:"text-[10px] opacity-50 truncate w-full",children:D(e.path).split("/").slice(0,-1).join("/")})]},e.path)):I.map(e=>{var t;return(0,a.jsx)(T,{node:e,depth:0,selectedPath:n,onDocClick:i,folderPath:e.name},null!==(t=e.docPath)&&void 0!==t?t:e.name)})]})})}),y&&(0,a.jsxs)("div",{className:"border-t border-border p-2 space-y-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between text-[11px] text-muted",children:[(0,a.jsxs)("span",{children:[C.size," selected"]}),(0,a.jsxs)("button",{onClick:F,className:"hover:text-txt transition-colors flex items-center gap-1",children:[(0,a.jsx)(j.Z,{className:"h-3 w-3"})," Clear"]})]}),(0,a.jsx)("button",{onClick:B,disabled:0===C.size||"copying"===P,className:(0,b.cn)("w-full flex items-center justify-center gap-1.5 h-7 rounded-md text-xs font-medium transition-colors","copied"===P?"bg-green-500/20 text-green-400":0===C.size?"bg-surface2 text-muted cursor-not-allowed":"bg-accent/20 text-accent hover:bg-accent/30"),children:"copied"===P?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.Z,{className:"h-3 w-3"})," Copied!"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.Z,{className:"h-3 w-3"})," Copy Context"]})})]})]})})}var R=n(8892),U=n(42008),A=n(89333),O=n(71301),z=n(220),_=n(60893);let I=_.fC,M=s.forwardRef((e,t)=>{let{className:n,...s}=e;return(0,a.jsx)(_.aV,{ref:t,className:(0,b.cn)("inline-flex h-10 items-center justify-center rounded-md bg-slate-100 p-1 text-slate-500 dark:bg-slate-800 dark:text-slate-400",n),...s})});M.displayName=_.aV.displayName;let V=s.forwardRef((e,t)=>{let{className:n,...s}=e;return(0,a.jsx)(_.xz,{ref:t,className:(0,b.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-white data-[state=active]:text-slate-950 data-[state=active]:shadow-sm dark:ring-offset-slate-950 dark:focus-visible:ring-slate-300 dark:data-[state=active]:bg-slate-950 dark:data-[state=active]:text-slate-50",n),...s})});V.displayName=_.xz.displayName,s.forwardRef((e,t)=>{let{className:n,...s}=e;return(0,a.jsx)(_.VY,{ref:t,className:(0,b.cn)("mt-2 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 dark:ring-offset-slate-950 dark:focus-visible:ring-slate-300",n),...s})}).displayName=_.VY.displayName;var F=n(17477),H=n(46366),W=n(58797),B=n(95371),J=n(92231),q=n(82772),$=n(60031),G=n(75255),K=n(25902),X=n(27881),Y=n(42921),Q=n(47953),ee=n(73473),et=n(69195),en=n(12301);function ea(e,t,n){let{from:a,to:s}=e.state.selection.main,c=e.state.sliceDoc(a,s);e.dispatch({changes:{from:a,to:s,insert:t+c+n},selection:{anchor:a+t.length,head:a+t.length+c.length}}),e.focus()}function es(e,t){let{from:n}=e.state.selection.main,a=e.state.doc.lineAt(n);e.dispatch({changes:{from:a.from,to:a.from,insert:t},selection:{anchor:n+t.length}}),e.focus()}function ec(e){let{icon:t,label:n,onClick:s}=e;return(0,a.jsxs)(F.u,{children:[(0,a.jsx)(F.aJ,{asChild:!0,children:(0,a.jsx)(z.z,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:s,children:t})}),(0,a.jsx)(F._v,{side:"bottom",children:n})]})}function el(e){let{editorView:t}=e;return(0,a.jsx)(F.pn,{delayDuration:300,children:(0,a.jsxs)("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-border bg-surface flex-shrink-0",children:[(0,a.jsx)(ec,{icon:(0,a.jsx)(H.Z,{className:"h-3.5 w-3.5"}),label:"Bold",onClick:function(){t&&ea(t,"**","**")}}),(0,a.jsx)(ec,{icon:(0,a.jsx)(W.Z,{className:"h-3.5 w-3.5"}),label:"Italic",onClick:function(){t&&ea(t,"*","*")}}),(0,a.jsx)(ec,{icon:(0,a.jsx)(B.Z,{className:"h-3.5 w-3.5"}),label:"Strikethrough",onClick:function(){t&&ea(t,"~~","~~")}}),(0,a.jsx)(en.Z,{orientation:"vertical",className:"h-4 mx-1"}),(0,a.jsx)(ec,{icon:(0,a.jsx)(J.Z,{className:"h-3.5 w-3.5"}),label:"Heading 1",onClick:function(){t&&es(t,"# ")}}),(0,a.jsx)(ec,{icon:(0,a.jsx)(q.Z,{className:"h-3.5 w-3.5"}),label:"Heading 2",onClick:function(){t&&es(t,"## ")}}),(0,a.jsx)(ec,{icon:(0,a.jsx)($.Z,{className:"h-3.5 w-3.5"}),label:"Heading 3",onClick:function(){t&&es(t,"### ")}}),(0,a.jsx)(en.Z,{orientation:"vertical",className:"h-4 mx-1"}),(0,a.jsx)(ec,{icon:(0,a.jsx)(G.Z,{className:"h-3.5 w-3.5"}),label:"Link",onClick:function(){if(!t)return;let{from:e,to:n}=t.state.selection.main,a=t.state.sliceDoc(e,n)||"link text";t.dispatch({changes:{from:e,to:n,insert:"[".concat(a,"](url)")},selection:{anchor:e+a.length+3,head:e+a.length+3+3}}),t.focus()}}),(0,a.jsx)(ec,{icon:(0,a.jsx)(K.Z,{className:"h-3.5 w-3.5"}),label:"Inline code",onClick:function(){t&&ea(t,"`","`")}}),(0,a.jsx)(ec,{icon:(0,a.jsx)(X.Z,{className:"h-3.5 w-3.5"}),label:"Code block",onClick:function(){t&&ea(t,"```\n","\n```")}}),(0,a.jsx)(ec,{icon:(0,a.jsx)(Y.Z,{className:"h-3.5 w-3.5"}),label:"Blockquote",onClick:function(){t&&es(t,"> ")}}),(0,a.jsx)(en.Z,{orientation:"vertical",className:"h-4 mx-1"}),(0,a.jsx)(ec,{icon:(0,a.jsx)(Q.Z,{className:"h-3.5 w-3.5"}),label:"Horizontal rule",onClick:function(){t&&function(e,t){let{from:n,to:a}=e.state.selection.main;e.dispatch({changes:{from:n,to:a,insert:t},selection:{anchor:n+t.length}}),e.focus()}(t,"\n---\n")}}),(0,a.jsx)(ec,{icon:(0,a.jsx)(ee.Z,{className:"h-3.5 w-3.5"}),label:"Unordered list",onClick:function(){t&&es(t,"- ")}}),(0,a.jsx)(ec,{icon:(0,a.jsx)(et.Z,{className:"h-3.5 w-3.5"}),label:"Ordered list",onClick:function(){t&&es(t,"1. ")}})]})})}var er=n(5763),eo=n(44492);function ei(e){var t,c;let{docPath:l,initialContent:o,onSave:i,onDirtyChange:d,onContentChange:u}=e,h=(0,s.useRef)(null),[x,m]=(0,s.useState)("split"),[p,f]=(0,s.useState)(o),[v,j]=(0,s.useState)("saved"),[g,b]=(0,s.useState)(1),[w,N]=(0,s.useState)([]),[y,k]=(0,s.useState)([]),[C,S]=(0,s.useState)(!1),P=(0,s.useRef)(void 0),Z=(0,s.useRef)(void 0),D=(0,s.useRef)(o);(0,s.useEffect)(()=>{D.current=p},[p]),(0,s.useEffect)(()=>{f(o),D.current=o,j("saved"),N([]),k([]),S(!1),b(1),clearTimeout(P.current),clearTimeout(Z.current),null==d||d(!1)},[l]),(0,s.useEffect)(()=>{let e=!1,t=null,a=null;return(async function(){var s;let[{Doc:c,UndoManager:r},{WebsocketProvider:i},{yCollab:d},{markdown:u},{oneDark:h},{EditorView:x}]=await Promise.all([Promise.all([n.e(787),n.e(6482)]).then(n.bind(n,79110)),Promise.all([n.e(787),n.e(6482),n.e(2306)]).then(n.bind(n,52306)),Promise.all([n.e(787),n.e(6482),n.e(9672)]).then(n.bind(n,49672)),n.e(8338).then(n.bind(n,40228)),Promise.resolve().then(n.bind(n,64880)),Promise.resolve().then(n.bind(n,47824))]);if(e)return;N([u(),h,x.lineWrapping]);let m=new c,p=m.getText("codemirror"),f=new r(p),v=new i(null!==(s=eo.env.NEXT_PUBLIC_WS_URL)&&void 0!==s?s:"ws://localhost:1234",l,m);a=m,t=v;let j="hsl(".concat(360*Math.random()|0,",70%,50%)");v.awareness.setLocalStateField("user",{color:j,colorLight:j+"44"}),v.awareness.on("change",()=>{b(v.awareness.getStates().size)}),v.on("sync",t=>{t&&!e&&(0===p.length&&p.insert(0,o),k([d(p,v.awareness,{undoManager:f})]),S(!0))})})().catch(console.error),()=>{e=!0,null==t||t.disconnect(),null==a||a.destroy()}},[l,o]),(0,s.useEffect)(()=>{if("unsaved"===v)return clearTimeout(P.current),P.current=setTimeout(async()=>{j("saving");try{await i(D.current),j("saved"),null==d||d(!1)}catch(e){j("unsaved")}},2e3),()=>clearTimeout(P.current)},[p,v]),(0,s.useEffect)(()=>{function e(e){(e.ctrlKey||e.metaKey)&&"s"===e.key&&(e.preventDefault(),clearTimeout(P.current),j("saving"),i(D.current).then(()=>{j("saved"),null==d||d(!1)}).catch(()=>j("unsaved")))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[i,d]);let E=(0,s.useCallback)(e=>{e!==D.current&&(f(e),j("unsaved"),null==d||d(!0),clearTimeout(Z.current),Z.current=setTimeout(()=>{null==u||u(e)},500))},[d,u]),T=null!==(c=null===(t=h.current)||void 0===t?void 0:t.view)&&void 0!==c?c:null,L="preview"!==x,_="edit"!==x,H=C?[...w,...y]:w,W="saving"===v?"text-muted":"saved"===v?"text-teal-400":"text-yellow-400";return(0,a.jsx)(F.pn,{delayDuration:300,children:(0,a.jsxs)("div",{className:"flex flex-col h-full overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border flex-shrink-0",children:[(0,a.jsx)("span",{className:"text-xs font-mono text-muted flex-1 truncate min-w-0",children:l}),(0,a.jsx)(I,{value:x,onValueChange:e=>m(e),children:(0,a.jsxs)(M,{className:"h-7 bg-surface2 p-0.5",children:[(0,a.jsx)(V,{value:"edit",className:"h-6 px-2.5 text-xs",children:"Edit"}),(0,a.jsx)(V,{value:"split",className:"h-6 px-2.5 text-xs",children:"Split"}),(0,a.jsx)(V,{value:"preview",className:"h-6 px-2.5 text-xs",children:"Preview"})]})}),g>1&&(0,a.jsxs)(O.C,{variant:"secondary",className:"h-5 gap-1 text-[10px] px-1.5",children:[(0,a.jsx)(R.Z,{className:"h-3 w-3"}),g]}),(0,a.jsxs)(F.u,{children:[(0,a.jsx)(F.aJ,{asChild:!0,children:(0,a.jsx)(z.z,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:function(){var e;let t=new Blob([D.current],{type:"text/markdown"}),n=URL.createObjectURL(t),a=document.createElement("a");a.href=n,a.download=null!==(e=l.split("/").pop())&&void 0!==e?e:"document.md",a.click(),URL.revokeObjectURL(n)},children:(0,a.jsx)(U.Z,{className:"h-3.5 w-3.5"})})}),(0,a.jsx)(F._v,{side:"bottom",children:"Download .md"})]}),(0,a.jsxs)("span",{className:"text-xs flex items-center gap-1 ".concat(W),children:["saved"===v&&(0,a.jsx)(r.Z,{className:"h-3 w-3"}),"saving"===v?"Saving…":"saved"===v?"Saved":"Unsaved"]})]}),"preview"!==x&&(0,a.jsx)(el,{editorView:T}),(0,a.jsxs)("div",{className:"flex-1 overflow-hidden ".concat(L&&_?"grid grid-cols-2 divide-x divide-border":"flex"),children:[L&&(0,a.jsx)("div",{className:"flex flex-col overflow-hidden min-h-0",children:0===w.length?(0,a.jsx)("div",{className:"flex-1 p-4 font-mono text-sm text-txt bg-[#282c34] overflow-auto whitespace-pre-wrap",children:p}):(0,a.jsx)(A.ZP,{ref:h,value:p,theme:"none",onChange:E,extensions:H,style:{height:"100%",overflow:"auto"},className:"h-full text-sm"},l)}),_&&(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-6 min-w-0",children:(0,a.jsx)(er.$,{content:p})})]})]})})}function ed(e){let{docPath:t,rootParam:n,onOpenDoc:c}=e,[r,o]=(0,s.useState)(null),[i,d]=(0,s.useState)(!1),[u,h]=(0,s.useState)(!1),x=(0,s.useCallback)(async()=>{if(!u){d(!0);try{var e;let a=await fetch("/api/backlinks".concat(n,"&path=").concat(encodeURIComponent(t))),s=await a.json();o(null!==(e=s.links)&&void 0!==e?e:[])}catch(e){o([])}finally{d(!1),h(!0)}}},[t,n,u]);return(0,a.jsxs)("div",{className:"fixed right-4 bottom-8 z-40 group",onMouseEnter:()=>{u||x()},children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full bg-surface border border-border flex items-center justify-center group-hover:opacity-0 transition-opacity duration-200 shadow-sm",children:(0,a.jsx)(G.Z,{className:"h-4 w-4 text-muted"})}),(0,a.jsxs)("div",{className:(0,b.cn)("absolute right-0 bottom-0 w-72 max-h-[50vh] bg-surface/95 backdrop-blur-sm border border-border rounded-lg shadow-xl","opacity-0 scale-95 origin-bottom-right pointer-events-none","group-hover:opacity-100 group-hover:scale-100 group-hover:pointer-events-auto","transition-all duration-200 ease-out"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[(0,a.jsx)(G.Z,{className:"h-3.5 w-3.5 text-accent"}),(0,a.jsx)("span",{className:"text-[11px] font-semibold text-muted uppercase tracking-wider",children:"Referenced by"}),null!==r&&(0,a.jsx)("span",{className:"text-[10px] text-muted/60 bg-accent/10 px-1.5 py-0.5 rounded-full ml-auto",children:r.length})]}),(0,a.jsxs)("div",{className:"overflow-y-auto max-h-[calc(50vh-44px)]",children:[i&&(0,a.jsxs)("div",{className:"px-3 py-6 text-center",children:[(0,a.jsx)("div",{className:"w-5 h-5 border-2 border-accent/30 border-t-accent rounded-full animate-spin mx-auto"}),(0,a.jsx)("p",{className:"text-xs text-muted/60 mt-2",children:"Scanning docs..."})]}),!i&&null!==r&&0===r.length&&(0,a.jsxs)("div",{className:"px-3 py-6 text-center",children:[(0,a.jsx)(G.Z,{className:"h-8 w-8 text-muted/30 mx-auto mb-2"}),(0,a.jsx)("p",{className:"text-xs text-muted/60",children:"No other docs link to this file"})]}),!i&&null!==r&&r.length>0&&(0,a.jsx)("div",{className:"py-1",children:r.map((e,t)=>{var n;return(0,a.jsxs)("button",{onClick:()=>c(e.file),className:"w-full text-left px-3 py-2 hover:bg-accent/10 transition-colors group/item",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(l.Z,{className:"h-3.5 w-3.5 text-muted shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-txt truncate",children:null===(n=e.file.split("/").pop())||void 0===n?void 0:n.replace(/\.md$/,"")}),(0,a.jsxs)("span",{className:"text-[10px] text-muted/50 shrink-0",children:["L",e.line]})]}),(0,a.jsx)("p",{className:"text-[11px] text-muted/70 mt-1 truncate pl-5",children:e.text})]},"".concat(e.file,"-").concat(e.line,"-").concat(t))})})]})]})]})}function eu(e){let{doc:t,onDirtyChange:n,onContentChange:s}=e,{rootParam:l,setSelectedDoc:r,openDoc:o}=(0,c.q)();if(!t)return(0,a.jsx)("div",{className:"flex items-center justify-center h-full text-muted text-sm",children:"Select a document to read"});async function i(e){let n=await fetch("/api/docs".concat(l),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t.path,content:e})});if(!n.ok){var a;throw Error(null!==(a=(await n.json()).error)&&void 0!==a?a:"Save failed")}r({...t,content:e})}return(0,a.jsxs)("div",{className:"flex flex-col h-full",children:[(0,a.jsx)(ei,{docPath:t.path,initialContent:t.content,onSave:i,onDirtyChange:n,onContentChange:s}),(0,a.jsx)(ed,{docPath:t.path,rootParam:l,onOpenDoc:o})]})}function eh(e){let{headings:t}=e;return 0===t.length?null:(0,a.jsxs)("div",{className:"fixed right-4 top-20 z-40 group",children:[(0,a.jsx)("div",{className:"w-1 h-32 bg-muted/20 rounded-full group-hover:opacity-0 transition-opacity duration-200"}),(0,a.jsxs)("div",{className:(0,b.cn)("absolute right-0 top-0 w-56 max-h-[70vh] bg-surface/95 backdrop-blur-sm border border-border rounded-lg shadow-xl","opacity-0 scale-95 origin-top-right pointer-events-none","group-hover:opacity-100 group-hover:scale-100 group-hover:pointer-events-auto","transition-all duration-200 ease-out"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[(0,a.jsx)(ee.Z,{className:"h-3.5 w-3.5 text-accent"}),(0,a.jsx)("span",{className:"text-[11px] font-semibold text-muted uppercase tracking-wider",children:"Outline"}),(0,a.jsx)("span",{className:"text-[10px] text-muted/60 bg-accent/10 px-1.5 py-0.5 rounded-full ml-auto",children:t.length})]}),(0,a.jsx)("div",{className:"overflow-y-auto max-h-[calc(70vh-44px)] py-2",children:t.map((e,t)=>(0,a.jsx)("button",{onClick:()=>{var t,n;return t=e.anchor,void(null===(n=document.getElementById(t))||void 0===n||n.scrollIntoView({behavior:"smooth",block:"start"}))},className:(0,b.cn)("w-full text-left text-[13px] py-1.5 px-3 hover:bg-accent/10 transition-colors truncate",1===e.level&&"font-medium text-txt",2===e.level&&"pl-5 text-muted hover:text-txt",3===e.level&&"pl-7 text-muted/70 text-[12px] hover:text-muted"),children:e.text},t))})]})]})}function ex(e){var t;let{docs:n,selectedDoc:c,docSearch:l,onSearchChange:r,onDocSelect:o,onDirtyChange:i,onNewDocClick:d,onDocDeleted:u,onDocRenamed:h,rootParam:x}=e,[m,p]=(0,s.useState)(null!==(t=null==c?void 0:c.content)&&void 0!==t?t:"");(0,s.useEffect)(()=>{var e;p(null!==(e=null==c?void 0:c.content)&&void 0!==e?e:"")},[null==c?void 0:c.path]);let f=(0,s.useMemo)(()=>m.split("\n").filter(e=>/^#{1,3} /.test(e)).flatMap(e=>{let t=e.match(/^(#{1,3}) (.+)/);if(!t)return[];let n=t[2].trim(),a=n.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-");return[{level:t[1].length,text:n,anchor:a}]}),[m]);return(0,a.jsxs)("div",{className:"flex h-full relative",style:{minHeight:"calc(100vh - 3rem)"},children:[(0,a.jsx)(L,{docs:n,selectedDocPath:null==c?void 0:c.path,searchValue:l,onSearchChange:r,onDocClick:o,onNewDocClick:d,onDocDeleted:u,onDocRenamed:h,rootParam:x}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,a.jsx)(eu,{doc:c,onDirtyChange:i,onContentChange:p})}),c&&(0,a.jsx)(eh,{headings:f})]})}var em=n(82825);function ep(){let{selectedDoc:e,setSelectedDoc:t,rootParam:n,activeProject:l}=(0,c.q)(),[r,o]=(0,s.useState)([]),[i,d]=(0,s.useState)(""),[u,h]=(0,s.useState)(!1),x=(0,s.useRef)(!1),m=(0,s.useCallback)(()=>{l&&fetch("/api/docs".concat(n)).then(e=>e.json()).then(e=>o(Array.isArray(e)?e:[])).catch(()=>{})},[l,n]);(0,s.useEffect)(()=>{m()},[m]);let p=(0,s.useCallback)(async e=>{var t;if(!e.trim()){m();return}let a=await fetch("/api/docs".concat(n,"&q=").concat(encodeURIComponent(e)));o((null===(t=(await a.json()).results)||void 0===t?void 0:t.map(e=>({path:e.file,section:"search",name:e.file})))||[])},[n,m]);async function f(e){if(x.current&&!window.confirm("You have unsaved changes. Discard?"))return;x.current=!1;let a=await fetch("/api/docs".concat(n,"&read=").concat(encodeURIComponent(e)));t(await a.json())}async function v(e){m(),await f(e)}async function j(t,n){m(),(null==e?void 0:e.path)===t&&await f(n)}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ex,{docs:r,selectedDoc:e,docSearch:i,onSearchChange:function(e){d(e),p(e)},onDocSelect:f,onDirtyChange:function(e){x.current=e},onNewDocClick:()=>h(!0),onDocDeleted:function(n){m(),(null==e?void 0:e.path)===n&&t(null)},onDocRenamed:j,rootParam:n}),(0,a.jsx)(em.t,{open:u,onOpenChange:h,rootParam:n,onDocCreated:v})]})}},5763:function(e,t,n){"use strict";n.d(t,{$:function(){return r}});var a=n(59533),s=n(31229),c=n(10228),l=n(52284);function r(e){let{content:t,className:r}=e,o=c.TU.parse(t).replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/\son\w+="[^"]*"/gi,"").replace(/\son\w+='[^']*'/gi,""),i=(0,s.useRef)(null);return(0,s.useEffect)(()=>{let e=i.current;if(!e)return;let t=!1,a=setTimeout(()=>{t||Promise.all([n.e(4655),n.e(5218)]).then(n.bind(n,45218)).then(n=>{if(t||!e.isConnected)return;let a=Array.from(e.querySelectorAll(".mermaid:not([data-processed])"));0!==a.length&&(n.default.initialize({startOnLoad:!1,theme:"dark",darkMode:!0,securityLevel:"antiscript"}),n.default.run({nodes:a,suppressErrors:!0}).catch(e=>{console.error("[mermaid]",e)}))})},120);return()=>{t=!0,clearTimeout(a)}},[o]),(0,a.jsx)("div",{ref:i,className:(0,l.cn)("prose-dark",r),dangerouslySetInnerHTML:{__html:o}})}c.TU.setOptions({gfm:!0,breaks:!1}),c.TU.use({renderer:{code(e,t){if("mermaid"===t){let t=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return'<div class="mermaid">'.concat(t,"</div>")}return!1}}}),c.TU.use({renderer:{heading(e,t){let n=e.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-");return"<h".concat(t,' id="').concat(n,'">').concat(e,"</h").concat(t,">\n")}}})}},function(e){e.O(0,[7069,490,228,7725,4316,845,4170,6842,1744],function(){return e(e.s=69827)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5814],{3921:function(e,t,a){Promise.resolve().then(a.bind(a,60985))},60985:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return eb}});var r=a(59533),s=a(31229),n=a(61250),i=a(11180);function d(){return(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"flex gap-1.5 justify-center mb-4",children:[0,1,2].map(e=>(0,r.jsx)("div",{className:"w-2 h-2 rounded-full bg-accent animate-pulse-dot",style:{animationDelay:"".concat(.15*e,"s")}},e))}),(0,r.jsx)("p",{className:"text-muted text-sm font-mono",children:"Loading project..."})]})})}var o=a(83373);function l(e){let{projects:t,activeProject:a,currentName:s,onSelect:n}=e;return(0,r.jsxs)(o.h_,{children:[(0,r.jsx)(o.$F,{asChild:!0,children:(0,r.jsxs)("button",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-surface2 border border-border text-sm hover:border-border2 transition-colors",children:[(0,r.jsx)("span",{className:"text-txt font-medium truncate max-w-[200px]",children:s||"Select project"}),(0,r.jsx)("span",{className:"text-muted text-xs",children:"▾"})]})}),(0,r.jsx)(o.AW,{className:"w-64 bg-surface border-border2 text-txt",align:"start",children:0===t.length?(0,r.jsx)("div",{className:"px-3 py-2 text-sm text-muted",children:"No projects found"}):t.map(e=>(0,r.jsx)(o.Xi,{onClick:()=>n(e.root),className:"cursor-pointer hover:bg-surface2 focus:bg-surface2 ".concat(e.root===a?"text-accent":""),children:(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-medium",children:e.name}),(0,r.jsx)("div",{className:"text-xs text-muted truncate font-mono",children:e.root})]})},e.root))})]})}var c=a(71301);function u(e){let{board:t}=e;return(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)(c.C,{variant:"secondary",className:"gap-1 text-xs font-mono text-amber",children:["\uD83D\uDD28 ",t["in-progress"]||0]}),(0,r.jsxs)(c.C,{variant:"secondary",className:"gap-1 text-xs font-mono text-muted",children:["\uD83D\uDCCB ",t.todo||0]}),(0,r.jsxs)(c.C,{variant:"secondary",className:"gap-1 text-xs font-mono text-teal",children:["✅ ",t.done||0]})]})}var m=a(52284);function f(e){let{active:t}=e;return(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-mono text-muted",children:[(0,r.jsx)("div",{className:(0,m.cn)("w-1.5 h-1.5 rounded-full transition-colors duration-500",t?"bg-teal shadow-[0_0_6px_#4fd8b4]":"bg-border2")}),(0,r.jsx)("span",{children:t?"live update":"connected"})]})}var x=a(38777),b=a(95084),p=a(19363),h=a(220),g=a(13191),v=a(12301),j=a(68778),w=a(46850);let N=j.fC;j.xz,j.x8;let y=j.h_,k=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(j.aV,{className:(0,m.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...s,ref:t})});k.displayName=j.aV.displayName;let S=(0,b.j)("fixed z-50 gap-4 bg-white p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 dark:bg-slate-950",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),C=s.forwardRef((e,t)=>{let{side:a="right",className:s,children:n,...i}=e;return(0,r.jsxs)(y,{children:[(0,r.jsx)(k,{}),(0,r.jsxs)(j.VY,{ref:t,className:(0,m.cn)(S({side:a}),s),...i,children:[n,(0,r.jsxs)(j.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-slate-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-slate-100 dark:ring-offset-slate-950 dark:focus:ring-slate-300 dark:data-[state=open]:bg-slate-800",children:[(0,r.jsx)(w.Z,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});C.displayName=j.VY.displayName;let R=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,m.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...a})};R.displayName="SheetHeader";let _=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(j.Dx,{ref:t,className:(0,m.cn)("text-lg font-semibold text-slate-950 dark:text-slate-50",a),...s})});_.displayName=j.Dx.displayName;let z=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(j.dk,{ref:t,className:(0,m.cn)("text-sm text-slate-500 dark:text-slate-400",a),...s})});function D(e){let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,m.cn)("animate-pulse rounded-md bg-slate-100 dark:bg-slate-800",t),...a})}z.displayName=j.dk.displayName;var E=a(17477);let M=s.createContext(null);function Z(){let e=s.useContext(M);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e}let P=s.forwardRef((e,t)=>{let{defaultOpen:a=!0,open:n,onOpenChange:i,className:d,style:o,children:l,...c}=e,u=function(){let[e,t]=s.useState(void 0);return s.useEffect(()=>{let e=window.matchMedia("(max-width: ".concat(767,"px)")),a=()=>{t(window.innerWidth<768)};return e.addEventListener("change",a),t(window.innerWidth<768),()=>e.removeEventListener("change",a)},[]),!!e}(),[f,x]=s.useState(!1),[b,p]=s.useState(a),h=null!=n?n:b,g=s.useCallback(e=>{let t="function"==typeof e?e(h):e;i?i(t):p(t),document.cookie="".concat("sidebar_state","=").concat(t,"; path=/; max-age=").concat(604800)},[i,h]),v=s.useCallback(()=>u?x(e=>!e):g(e=>!e),[u,g,x]);s.useEffect(()=>{let e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),v())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[v]);let j=h?"expanded":"collapsed",w=s.useMemo(()=>({state:j,open:h,setOpen:g,isMobile:u,openMobile:f,setOpenMobile:x,toggleSidebar:v}),[j,h,g,u,f,x,v]);return(0,r.jsx)(M.Provider,{value:w,children:(0,r.jsx)(E.pn,{delayDuration:0,children:(0,r.jsx)("div",{style:{"--sidebar-width":"16rem","--sidebar-width-icon":"3rem",...o},className:(0,m.cn)("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",d),ref:t,...c,children:l})})})});P.displayName="SidebarProvider";let A=s.forwardRef((e,t)=>{let{side:a="left",variant:s="sidebar",collapsible:n="offcanvas",className:i,children:d,...o}=e,{isMobile:l,state:c,openMobile:u,setOpenMobile:f}=Z();return"none"===n?(0,r.jsx)("div",{className:(0,m.cn)("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",i),ref:t,...o,children:d}):l?(0,r.jsx)(N,{open:u,onOpenChange:f,...o,children:(0,r.jsxs)(C,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":"18rem"},side:a,children:[(0,r.jsxs)(R,{className:"sr-only",children:[(0,r.jsx)(_,{children:"Sidebar"}),(0,r.jsx)(z,{children:"Displays the mobile sidebar."})]}),(0,r.jsx)("div",{className:"flex h-full w-full flex-col",children:d})]})}):(0,r.jsxs)("div",{ref:t,className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":"collapsed"===c?n:"","data-variant":s,"data-side":a,children:[(0,r.jsx)("div",{className:(0,m.cn)("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180","floating"===s||"inset"===s?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,r.jsx)("div",{className:(0,m.cn)("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex","left"===a?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]","floating"===s||"inset"===s?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",i),...o,children:(0,r.jsx)("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:d})})]})});A.displayName="Sidebar";let G=s.forwardRef((e,t)=>{let{className:a,onClick:s,...n}=e,{toggleSidebar:i}=Z();return(0,r.jsxs)(h.z,{ref:t,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:(0,m.cn)("h-7 w-7",a),onClick:e=>{null==s||s(e),i()},...n,children:[(0,r.jsx)(p.Z,{}),(0,r.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});G.displayName="SidebarTrigger",s.forwardRef((e,t)=>{let{className:a,...s}=e,{toggleSidebar:n}=Z();return(0,r.jsx)("button",{ref:t,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:(0,m.cn)("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",a),...s})}).displayName="SidebarRail";let I=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("main",{ref:t,className:(0,m.cn)("relative flex w-full flex-1 flex-col bg-white dark:bg-slate-950","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",a),...s})});I.displayName="SidebarInset",s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(g.I,{ref:t,"data-sidebar":"input",className:(0,m.cn)("h-8 w-full bg-white shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring dark:bg-slate-950",a),...s})}).displayName="SidebarInput";let T=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,"data-sidebar":"header",className:(0,m.cn)("flex flex-col gap-2 p-2",a),...s})});T.displayName="SidebarHeader",s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,"data-sidebar":"footer",className:(0,m.cn)("flex flex-col gap-2 p-2",a),...s})}).displayName="SidebarFooter";let B=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(v.Z,{ref:t,"data-sidebar":"separator",className:(0,m.cn)("mx-2 w-auto bg-sidebar-border",a),...s})});B.displayName="SidebarSeparator";let V=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,"data-sidebar":"content",className:(0,m.cn)("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",a),...s})});V.displayName="SidebarContent";let L=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,"data-sidebar":"group",className:(0,m.cn)("relative flex w-full min-w-0 flex-col p-2",a),...s})});L.displayName="SidebarGroup";let O=s.forwardRef((e,t)=>{let{className:a,asChild:s=!1,...n}=e,i=s?x.g7:"div";return(0,r.jsx)(i,{ref:t,"data-sidebar":"group-label",className:(0,m.cn)("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",a),...n})});O.displayName="SidebarGroupLabel",s.forwardRef((e,t)=>{let{className:a,asChild:s=!1,...n}=e,i=s?x.g7:"button";return(0,r.jsx)(i,{ref:t,"data-sidebar":"group-action",className:(0,m.cn)("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",a),...n})}).displayName="SidebarGroupAction";let K=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,"data-sidebar":"group-content",className:(0,m.cn)("w-full text-sm",a),...s})});K.displayName="SidebarGroupContent";let F=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("ul",{ref:t,"data-sidebar":"menu",className:(0,m.cn)("flex w-full min-w-0 flex-col gap-1",a),...s})});F.displayName="SidebarMenu";let q=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("li",{ref:t,"data-sidebar":"menu-item",className:(0,m.cn)("group/menu-item relative",a),...s})});q.displayName="SidebarMenuItem";let W=(0,b.j)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-white shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))] dark:bg-slate-950"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),U=s.forwardRef((e,t)=>{let{asChild:a=!1,isActive:s=!1,variant:n="default",size:i="default",tooltip:d,className:o,...l}=e,c=a?x.g7:"button",{isMobile:u,state:f}=Z(),b=(0,r.jsx)(c,{ref:t,"data-sidebar":"menu-button","data-size":i,"data-active":s,className:(0,m.cn)(W({variant:n,size:i}),o),...l});return d?("string"==typeof d&&(d={children:d}),(0,r.jsxs)(E.u,{children:[(0,r.jsx)(E.aJ,{asChild:!0,children:b}),(0,r.jsx)(E._v,{side:"right",align:"center",hidden:"collapsed"!==f||u,...d})]})):b});function $(e){let{summary:t,projects:a,activeProject:s,liveIndicator:n,onProjectChange:i}=e;return(0,r.jsxs)("header",{className:"h-12 border-b border-border flex items-center px-4 gap-4 flex-shrink-0 bg-surface/80 backdrop-blur-sm sticky top-0 z-50",children:[(0,r.jsx)(G,{className:"-ml-1"}),(0,r.jsx)(v.Z,{orientation:"vertical",className:"mr-2 h-4"}),(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,r.jsx)("div",{className:"w-6 h-6 rounded-md bg-gradient-to-br from-accent to-teal flex items-center justify-center text-xs",children:"⬡"}),(0,r.jsx)("span",{className:"font-mono text-xs text-muted tracking-widest uppercase",children:"VibeDoc"})]}),(0,r.jsx)(l,{projects:a,activeProject:s,currentName:(null==t?void 0:t.name)||"",onSelect:i}),t&&(0,r.jsx)(u,{board:t.tasks.board}),(0,r.jsx)("div",{className:"flex-1"}),(0,r.jsx)(f,{active:n}),(0,r.jsxs)("div",{className:"hidden md:flex items-center gap-1.5 px-2 py-1 rounded bg-surface2 border border-border",children:[(0,r.jsx)("span",{className:"text-xs font-mono text-muted",children:"MCP"}),(0,r.jsx)("code",{className:"text-xs font-mono text-accent",children:"localhost:3000/api/mcp"})]})]})}U.displayName="SidebarMenuButton",s.forwardRef((e,t)=>{let{className:a,asChild:s=!1,showOnHover:n=!1,...i}=e,d=s?x.g7:"button";return(0,r.jsx)(d,{ref:t,"data-sidebar":"menu-action",className:(0,m.cn)("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",a),...i})}).displayName="SidebarMenuAction",s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,"data-sidebar":"menu-badge",className:(0,m.cn)("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a),...s})}).displayName="SidebarMenuBadge",s.forwardRef((e,t)=>{let{className:a,showIcon:n=!1,...i}=e,d=s.useMemo(()=>"".concat(Math.floor(40*Math.random())+50,"%"),[]);return(0,r.jsxs)("div",{ref:t,"data-sidebar":"menu-skeleton",className:(0,m.cn)("flex h-8 items-center gap-2 rounded-md px-2",a),...i,children:[n&&(0,r.jsx)(D,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,r.jsx)(D,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":d}})]})}).displayName="SidebarMenuSkeleton",s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("ul",{ref:t,"data-sidebar":"menu-sub",className:(0,m.cn)("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",a),...s})}).displayName="SidebarMenuSub",s.forwardRef((e,t)=>{let{...a}=e;return(0,r.jsx)("li",{ref:t,...a})}).displayName="SidebarMenuSubItem",s.forwardRef((e,t)=>{let{asChild:a=!1,size:s="md",isActive:n,className:i,...d}=e,o=a?x.g7:"a";return(0,r.jsx)(o,{ref:t,"data-sidebar":"menu-sub-button","data-size":s,"data-active":n,className:(0,m.cn)("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground","sm"===s&&"text-xs","md"===s&&"text-sm","group-data-[collapsible=icon]:hidden",i),...d})}).displayName="SidebarMenuSubButton";var H=a(74809),X=a(94297),Y=a(77159),J=a(86239),Q=a(52874),ee=a(62994),et=a(36900),ea=a(44461),er=a(34753),es=a(96353);let en=[{href:"/board",icon:H.Z,label:"Board"},{href:"/docs",icon:X.Z,label:"Docs"},{href:"/activity",icon:Y.Z,label:"Activity"},{href:"/memory",icon:J.Z,label:"Memory"},{href:"/settings",icon:Q.Z,label:"Settings"}],ei=[{status:"in-progress",icon:ee.Z,label:"Active"},{status:"blocked",icon:et.Z,label:"Blocked"},{status:"todo",icon:ea.Z,label:"Todo"},{status:"done",icon:er.Z,label:"Done"}];function ed(e){let{board:t}=e,a=(0,n.usePathname)();return(0,r.jsxs)(A,{collapsible:"icon",children:[(0,r.jsx)(T,{children:(0,r.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1",children:[(0,r.jsx)("div",{className:"w-6 h-6 rounded-md bg-gradient-to-br from-accent to-teal flex items-center justify-center text-xs flex-shrink-0",children:"⬡"}),(0,r.jsx)("span",{className:"font-mono text-xs text-muted tracking-widest uppercase group-data-[collapsible=icon]:hidden",children:"VibeDoc"})]})}),(0,r.jsxs)(V,{children:[(0,r.jsx)(L,{children:(0,r.jsx)(K,{children:(0,r.jsx)(F,{children:en.map(e=>{let{href:t,icon:s,label:n}=e;return(0,r.jsx)(q,{children:(0,r.jsx)(U,{asChild:!0,isActive:a.startsWith(t),tooltip:n,children:(0,r.jsxs)(es.default,{href:t,children:[(0,r.jsx)(s,{}),(0,r.jsx)("span",{children:n})]})})},t)})})})}),t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(B,{}),(0,r.jsxs)(L,{children:[(0,r.jsx)(O,{children:"Board"}),(0,r.jsx)(K,{children:(0,r.jsx)(F,{children:ei.map(e=>{var a;let{status:s,icon:n,label:i}=e,d=(null===(a=t[s])||void 0===a?void 0:a.length)||0;return(0,r.jsx)(q,{children:(0,r.jsxs)(U,{tooltip:"".concat(i,": ").concat(d),children:[(0,r.jsx)(n,{}),(0,r.jsx)("span",{children:i}),(0,r.jsx)("span",{className:"ml-auto font-mono text-xs",children:d})]})},s)})})})]})]})]})]})}var eo=a(81160),el=a(46960),ec=a(76877),eu=a(72374),em=a(8637);function ef(e){let{open:t,onClose:a,onOpenDoc:i,onNewDoc:d,rootParam:o}=e,l=(0,n.useRouter)(),[c,u]=(0,s.useState)(""),[f,x]=(0,s.useState)([]),[b,p]=(0,s.useState)(0),h=[{label:"New Doc",icon:eo.Z,action:()=>{null==d||d(),a()}},{label:"Go to Board",icon:H.Z,action:()=>{l.push("/board"),a()}},{label:"Go to Activity",icon:el.Z,action:()=>{l.push("/activity"),a()}},{label:"Go to Memory",icon:J.Z,action:()=>{l.push("/memory"),a()}}];function v(e){i(e.path),a()}(0,s.useEffect)(()=>{t||(u(""),x([]),p(0))},[t]),(0,s.useEffect)(()=>{if(c.length<2){x([]),p(0);return}let e=setTimeout(async()=>{try{var e,t;let a=await fetch("/api/docs".concat(o,"&q=").concat(encodeURIComponent(c))),r=await a.json();x(null!==(t=null===(e=r.results)||void 0===e?void 0:e.map(e=>{var t,a;return{path:e.file,section:e.file.split("/").slice(0,-1).join("/"),name:null!==(a=null===(t=e.file.split("/").pop())||void 0===t?void 0:t.replace(/\.md$/,""))&&void 0!==a?a:e.file}}))&&void 0!==t?t:[]),p(0)}catch(e){}},300);return()=>clearTimeout(e)},[c,o]);let j=""===c;return(0,r.jsx)(eu.Vq,{open:t,onOpenChange:e=>{e||a()},children:(0,r.jsxs)(eu.cZ,{className:"max-w-lg p-0 overflow-hidden bg-surface border-border gap-0",children:[(0,r.jsx)(eu.$N,{className:"sr-only",children:"Command Palette"}),(0,r.jsxs)("div",{className:"flex items-center px-4 h-12",children:[(0,r.jsx)(ec.Z,{className:"h-4 w-4 text-muted shrink-0 mr-3"}),(0,r.jsx)(g.I,{autoFocus:!0,value:c,onChange:e=>u(e.target.value),onKeyDown:function(e){let t=f.length>0,a=t?f.length:h.length;"ArrowDown"===e.key?(e.preventDefault(),p(e=>Math.min(e+1,a-1))):"ArrowUp"===e.key?(e.preventDefault(),p(e=>Math.max(e-1,0))):"Enter"===e.key&&(t&&f[b]?v(f[b]):!t&&c.length<2&&h[b]&&h[b].action())},placeholder:"Search docs…",className:"border-0 bg-transparent h-full text-sm shadow-none focus-visible:ring-0 px-0 placeholder:text-muted"})]}),(0,r.jsx)("div",{className:"border-t border-border"}),(0,r.jsxs)(em.x,{className:"max-h-72",children:[j&&(0,r.jsx)("div",{className:"py-1",children:h.map((e,t)=>(0,r.jsxs)("button",{onClick:e.action,onMouseEnter:()=>p(t),className:(0,m.cn)("flex items-center gap-3 w-full px-4 py-2 text-sm text-left transition-colors",b===t?"bg-accent/10 text-txt":"text-muted hover:text-txt"),children:[(0,r.jsx)(e.icon,{className:"h-4 w-4 shrink-0"}),e.label]},e.label))}),!j&&f.length>0&&(0,r.jsx)("div",{className:"py-1",children:f.map((e,t)=>(0,r.jsxs)("button",{onClick:()=>v(e),onMouseEnter:()=>p(t),className:(0,m.cn)("flex items-center justify-between w-full px-4 py-2 text-sm text-left transition-colors",b===t?"bg-accent/10":"hover:bg-accent/5"),children:[(0,r.jsx)("span",{className:"font-medium text-txt truncate",children:e.name}),e.section&&(0,r.jsx)("span",{className:"text-xs text-muted ml-3 shrink-0 truncate max-w-[40%]",children:e.section})]},e.path))}),!j&&c.length>=2&&0===f.length&&(0,r.jsx)("div",{className:"px-4 py-6 text-center text-sm text-muted",children:"No docs found"})]})]})})}var ex=a(82825);function eb(e){let{children:t}=e;return(0,r.jsx)(i.w,{children:(0,r.jsx)(eh,{children:t})})}let ep=[{key:"Cmd+K",description:"Open command palette"},{key:"b",description:"Go to Board"},{key:"d",description:"Go to Docs"},{key:"a",description:"Go to Activity"},{key:"m",description:"Go to Memory"},{key:"/",description:"Focus doc search"},{key:"?",description:"Toggle this help"},{key:"Esc",description:"Close panel / modal"}];function eh(e){let{children:t}=e,{loading:a,summary:o,projects:l,activeProject:c,liveIndicator:u,onProjectChange:m,board:f,openDoc:x,rootParam:b}=(0,i.q)(),p=(0,n.useRouter)(),h=(0,n.usePathname)(),[g,v]=(0,s.useState)(!1),[j,w]=(0,s.useState)(!1),[N,y]=(0,s.useState)(!1);return((0,s.useEffect)(()=>{function e(e){var t,a;if((e.metaKey||e.ctrlKey)&&"k"===e.key){e.preventDefault(),w(e=>!e);return}let r=null===(t=e.target)||void 0===t?void 0:t.tagName;if("INPUT"!==r&&"TEXTAREA"!==r)switch(e.key){case"b":p.push("/board");break;case"d":p.push("/docs");break;case"a":p.push("/activity");break;case"m":p.push("/memory");break;case"?":v(e=>!e);break;case"Escape":v(!1);break;case"/":e.preventDefault(),"/docs"===h?null===(a=document.getElementById("doc-search"))||void 0===a||a.focus():p.push("/docs")}}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p,h]),a)?(0,r.jsx)(d,{}):(0,r.jsxs)(P,{children:[(0,r.jsx)(ed,{board:f}),(0,r.jsxs)(I,{children:[(0,r.jsx)($,{summary:o,projects:l,activeProject:c,liveIndicator:u,onProjectChange:m}),(0,r.jsx)("main",{className:"flex-1 overflow-y-auto",children:t}),(0,r.jsx)(ef,{open:j,onClose:()=>w(!1),onOpenDoc:x,onNewDoc:()=>{w(!1),y(!0)},rootParam:b}),(0,r.jsx)(ex.t,{open:N,onOpenChange:y,rootParam:b,onDocCreated:async e=>{await x(e)}}),g&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-black/60",onClick:()=>v(!1)}),(0,r.jsxs)("div",{className:"fixed z-50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-80 bg-surface border border-border rounded-xl shadow-2xl p-5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsx)("span",{className:"font-display text-sm font-semibold text-txt",children:"Keyboard shortcuts"}),(0,r.jsx)("button",{onClick:()=>v(!1),className:"text-muted hover:text-txt transition-colors text-lg leading-none",children:"\xd7"})]}),(0,r.jsx)("table",{className:"w-full text-xs",children:(0,r.jsx)("tbody",{children:ep.map(e=>{let{key:t,description:a}=e;return(0,r.jsxs)("tr",{className:"border-t border-border first:border-0",children:[(0,r.jsx)("td",{className:"py-1.5 pr-4",children:(0,r.jsx)("kbd",{className:"font-mono bg-surface2 border border-border rounded px-1.5 py-0.5 text-accent",children:t})}),(0,r.jsx)("td",{className:"py-1.5 text-muted",children:a})]},t)})})})]})]})]})]})}}},function(e){e.O(0,[490,7725,7697,845,4170,6842,1744],function(){return e(e.s=3921)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6448],{74738:function(e,t,r){Promise.resolve().then(r.bind(r,77285))},77285:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return i}});var n=r(59533),s=r(11180),a=r(5763),o=r(81306);function c(e){let{memory:t}=e;return(0,n.jsxs)("div",{className:"p-6 max-w-2xl",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,n.jsx)("h1",{className:"font-display text-xl",children:"Session Memory"}),(0,n.jsx)("span",{className:"text-xs font-mono text-muted",children:"memory/MEMORY.md"})]}),(null==t?void 0:t.exists)?(0,n.jsx)("div",{className:"bg-surface border border-border rounded-xl p-5",children:(0,n.jsx)(a.$,{content:t.content})}):(0,n.jsx)(o.u,{icon:"\uD83E\uDDE0",message:"No MEMORY.md yet.",subMessage:"AI will create one at the end of the first session.",bordered:!0}),(0,n.jsxs)("div",{className:"mt-4 p-4 bg-surface2 border border-border rounded-xl",children:[(0,n.jsx)("p",{className:"text-xs font-mono text-muted mb-2",children:"Add to your CLAUDE.md system prompt:"}),(0,n.jsx)("pre",{className:"text-xs font-mono text-accent/80 whitespace-pre-wrap leading-relaxed",children:"At session start:\n1. Call vibedoc_read_memory\n2. Call vibedoc_get_status\n\nAt session end:\n- Call vibedoc_update_memory with full handoff"})]})]})}function i(){var e;let{summary:t}=(0,s.q)();return(0,n.jsx)(c,{memory:null!==(e=null==t?void 0:t.memory)&&void 0!==e?e:null})}},5763:function(e,t,r){"use strict";r.d(t,{$:function(){return c}});var n=r(59533),s=r(31229),a=r(10228),o=r(52284);function c(e){let{content:t,className:c}=e,i=a.TU.parse(t).replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/\son\w+="[^"]*"/gi,"").replace(/\son\w+='[^']*'/gi,""),l=(0,s.useRef)(null);return(0,s.useEffect)(()=>{let e=l.current;if(!e)return;let t=!1,n=setTimeout(()=>{t||Promise.all([r.e(4655),r.e(5218)]).then(r.bind(r,45218)).then(r=>{if(t||!e.isConnected)return;let n=Array.from(e.querySelectorAll(".mermaid:not([data-processed])"));0!==n.length&&(r.default.initialize({startOnLoad:!1,theme:"dark",darkMode:!0,securityLevel:"antiscript"}),r.default.run({nodes:n,suppressErrors:!0}).catch(e=>{console.error("[mermaid]",e)}))})},120);return()=>{t=!0,clearTimeout(n)}},[i]),(0,n.jsx)("div",{ref:l,className:(0,o.cn)("prose-dark",c),dangerouslySetInnerHTML:{__html:i}})}a.TU.setOptions({gfm:!0,breaks:!1}),a.TU.use({renderer:{code(e,t){if("mermaid"===t){let t=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return'<div class="mermaid">'.concat(t,"</div>")}return!1}}}),a.TU.use({renderer:{heading(e,t){let r=e.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-");return"<h".concat(t,' id="').concat(r,'">').concat(e,"</h").concat(t,">\n")}}})},81306:function(e,t,r){"use strict";r.d(t,{u:function(){return a}});var n=r(59533),s=r(52284);function a(e){let{icon:t,message:r,subMessage:a,bordered:o}=e;return(0,n.jsxs)("div",{className:(0,s.cn)("text-center py-16 text-muted text-sm",o&&"border border-dashed border-border rounded-xl"),children:[(0,n.jsx)("p",{className:"text-3xl mb-3",children:t}),(0,n.jsx)("p",{children:r}),a&&(0,n.jsx)("p",{className:"text-xs mt-1",children:a})]})}},11180:function(e,t,r){"use strict";r.d(t,{q:function(){return c},w:function(){return i}});var n=r(59533),s=r(31229),a=r(61250);let o=(0,s.createContext)(null);function c(){let e=(0,s.useContext)(o);if(!e)throw Error("useApp must be used inside AppProvider");return e}function i(e){let{children:t}=e,r=(0,a.useRouter)(),[c,i]=(0,s.useState)([]),[l,u]=(0,s.useState)(""),[d,m]=(0,s.useState)(null),[f,p]=(0,s.useState)(null),[h,x]=(0,s.useState)([]),[b,y]=(0,s.useState)(!0),[v,j]=(0,s.useState)(!1),[g,w]=(0,s.useState)(null),C=(0,s.useRef)(null),N=l?"?root=".concat(encodeURIComponent(l)):"",_=(0,s.useCallback)(async e=>{let t=e||l;if(!t)return;let r="?root=".concat(encodeURIComponent(t));try{let[e,t,n]=await Promise.all([fetch("/api/summary".concat(r)).then(e=>e.json()),fetch("/api/tasks".concat(r)).then(e=>e.json()),fetch("/api/activity".concat(r,"&limit=30")).then(e=>e.json())]);m(e),p(t.board),x(Array.isArray(n)?n:[])}catch(e){}y(!1)},[l]);(0,s.useEffect)(()=>{fetch("/api/projects").then(e=>e.json()).then(e=>{i(e),e.length>0?(u(e[0].root),_(e[0].root)):y(!1)}).catch(()=>y(!1))},[]),(0,s.useEffect)(()=>{if(!l)return;let e=new EventSource("/api/events");return C.current=e,e.onmessage=e=>{try{let t=JSON.parse(e.data);if("connected"===t.type)return;j(!0),setTimeout(()=>j(!1),2e3),["task_updated","decision_logged","memory_updated","session_start"].includes(t.type)&&_()}catch(e){}},()=>{e.close()}},[l,_]);let k=(0,s.useCallback)(async(e,t)=>{p(r=>{let n;if(!r)return r;let s=structuredClone(r);for(let r of Object.keys(s)){let a=s[r].findIndex(t=>t.id===e);-1!==a&&(n={...s[r][a],status:t},s[r]=s[r].filter(t=>t.id!==e))}return n&&s[t]&&(s[t]=[n,...s[t]]),s});try{await fetch("/api/tasks".concat(N),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e,status:t,actor:"human"})}),_()}catch(e){_()}},[N,_]),S=(0,s.useCallback)(async e=>{let t=await fetch("/api/docs".concat(N,"&read=").concat(encodeURIComponent(e)));w(await t.json()),r.push("/docs")},[N,r]);return(0,n.jsx)(o.Provider,{value:{projects:c,activeProject:l,summary:d,board:f,activity:h,liveIndicator:v,loading:b,selectedDoc:g,setSelectedDoc:w,rootParam:N,onProjectChange:function(e){u(e),_(e)},refresh:_,moveTask:k,openDoc:S},children:t})}},52284:function(e,t,r){"use strict";r.d(t,{cn:function(){return a}});var n=r(27494),s=r(724);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,s.m6)((0,n.W)(t))}}},function(e){e.O(0,[490,228,4170,6842,1744],function(){return e(e.s=74738)}),_N_E=e.O()}]);
@@ -0,0 +1,16 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7558],{13714:function(e,t,s){Promise.resolve().then(s.bind(s,58397))},98009:function(e,t,s){"use strict";s.d(t,{Z:function(){return u}});var a=s(31229);/**
2
+ * @license lucide-react v0.575.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
+ */let n=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim()},r=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),l=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase()),c=e=>{let t=l(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
7
+ * @license lucide-react v0.575.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
+ */var i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
12
+ * @license lucide-react v0.575.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
+ */let o=e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1},d=(0,a.forwardRef)((e,t)=>{let{color:s="currentColor",size:r=24,strokeWidth:l=2,absoluteStrokeWidth:c,className:d="",children:u,iconNode:m,...x}=e;return(0,a.createElement)("svg",{ref:t,...i,width:r,height:r,stroke:s,strokeWidth:c?24*Number(l)/Number(r):l,className:n("lucide",d),...!u&&!o(x)&&{"aria-hidden":"true"},...x},[...m.map(e=>{let[t,s]=e;return(0,a.createElement)(t,s)}),...Array.isArray(u)?u:[u]])}),u=(e,t)=>{let s=(0,a.forwardRef)((s,l)=>{let{className:i,...o}=s;return(0,a.createElement)(d,{ref:l,iconNode:t,className:n("lucide-".concat(r(c(e))),"lucide-".concat(e),i),...o})});return s.displayName=c(e),s}},56622:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]])},20508:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},30445:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("copy",[["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"}]])},78764:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},92560:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("pencil",[["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"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},48354:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},52874:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("settings",[["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"}]])},39098:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},46850:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},77159:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},58397:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return U}});var a=s(59533),n=s(31229),r=s(11180),l=s(98009);let c=(0,l.Z)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]),i=(0,l.Z)("type",[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]),o=(0,l.Z)("folder-cog",[["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3",key:"128dxu"}],["path",{d:"m14.305 19.53.923-.382",key:"3m78fa"}],["path",{d:"m15.228 16.852-.923-.383",key:"npixar"}],["path",{d:"m16.852 15.228-.383-.923",key:"5xggr7"}],["path",{d:"m16.852 20.772-.383.924",key:"dpfhf9"}],["path",{d:"m19.148 15.228.383-.923",key:"1reyyz"}],["path",{d:"m19.53 21.696-.382-.924",key:"1goivc"}],["path",{d:"m20.772 16.852.924-.383",key:"htqkph"}],["path",{d:"m20.772 19.148.924.383",key:"9w9pjp"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]]),d=(0,l.Z)("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]);var u=s(77159),m=s(56622),x=s(52874),h=s(52284);let p=(0,l.Z)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]),f=(0,l.Z)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),b=(0,l.Z)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);var g=s(20508);let v=[{id:"blue",label:"Blue",class:"bg-blue-500"},{id:"purple",label:"Purple",class:"bg-purple-500"},{id:"green",label:"Green",class:"bg-green-500"},{id:"orange",label:"Orange",class:"bg-orange-500"}],j=[{id:"small",label:"Small"},{id:"medium",label:"Medium"},{id:"large",label:"Large"}];function N(e){let{settings:t,onSave:s}=e;return(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-txt mb-1",children:"Appearance"}),(0,a.jsx)("p",{className:"text-sm text-muted",children:"Customize the look and feel of the app."})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-txt",children:"Theme"}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-3",children:[{id:"dark",label:"Dark",icon:p},{id:"light",label:"Light",icon:f},{id:"system",label:"System",icon:b}].map(e=>{let n=e.icon,r=t.theme===e.id;return(0,a.jsxs)("button",{onClick:()=>s({...t,theme:e.id}),className:(0,h.cn)("flex flex-col items-center gap-2 p-4 rounded-lg border transition-all",r?"border-accent bg-accent/10":"border-border hover:border-accent/50"),children:[(0,a.jsx)(n,{className:(0,h.cn)("w-5 h-5",r?"text-accent":"text-muted")}),(0,a.jsx)("span",{className:(0,h.cn)("text-sm",r?"text-accent font-medium":"text-muted"),children:e.label})]},e.id)})})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-txt",children:"Accent Color"}),(0,a.jsx)("div",{className:"flex gap-3",children:v.map(e=>{let n=t.accentColor===e.id;return(0,a.jsx)("button",{onClick:()=>s({...t,accentColor:e.id}),className:(0,h.cn)("w-10 h-10 rounded-full flex items-center justify-center transition-transform",e.class,n?"ring-2 ring-offset-2 ring-offset-bg ring-white scale-110":"hover:scale-105"),title:e.label,children:n&&(0,a.jsx)(g.Z,{className:"w-5 h-5 text-white"})},e.id)})})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-txt",children:"Font Size"}),(0,a.jsx)("div",{className:"flex gap-2",children:j.map(e=>{let n=t.fontSize===e.id;return(0,a.jsx)("button",{onClick:()=>s({...t,fontSize:e.id}),className:(0,h.cn)("px-4 py-2 rounded-lg border text-sm transition-colors",n?"border-accent bg-accent/10 text-accent font-medium":"border-border text-muted hover:border-accent/50"),children:e.label},e.id)})})]})]})}let y=[{value:0,label:"Off"},{value:5,label:"5 seconds"},{value:10,label:"10 seconds"},{value:30,label:"30 seconds"}],k=[{id:"split",label:"Split View"},{id:"tab",label:"Tab View"},{id:"preview",label:"Preview Only"}];function w(e){let{settings:t,onSave:s}=e,n=(e,a)=>{s({...t,editor:{...t.editor,[e]:a}})};return(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-txt mb-1",children:"Editor"}),(0,a.jsx)("p",{className:"text-sm text-muted",children:"Configure the markdown editor behavior."})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-txt",children:"Auto-save"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:y.map(e=>{let s=t.editor.autoSave===e.value;return(0,a.jsx)("button",{onClick:()=>n("autoSave",e.value),className:(0,h.cn)("px-4 py-2 rounded-lg border text-sm transition-colors",s?"border-accent bg-accent/10 text-accent font-medium":"border-border text-muted hover:border-accent/50"),children:e.label},e.value)})})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-txt",children:"Preview Mode"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:k.map(e=>{let s=t.editor.previewMode===e.id;return(0,a.jsx)("button",{onClick:()=>n("previewMode",e.id),className:(0,h.cn)("px-4 py-2 rounded-lg border text-sm transition-colors",s?"border-accent bg-accent/10 text-accent font-medium":"border-border text-muted hover:border-accent/50"),children:e.label},e.id)})})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm font-medium text-txt",children:"Word Wrap"}),(0,a.jsx)("div",{className:"text-xs text-muted",children:"Wrap long lines in the editor"})]}),(0,a.jsx)("button",{onClick:()=>n("wordWrap",!t.editor.wordWrap),className:(0,h.cn)("w-11 h-6 rounded-full transition-colors relative",t.editor.wordWrap?"bg-accent":"bg-border"),children:(0,a.jsx)("span",{className:(0,h.cn)("absolute top-1 w-4 h-4 rounded-full bg-white transition-transform",t.editor.wordWrap?"left-6":"left-1")})})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm font-medium text-txt",children:"Line Numbers"}),(0,a.jsx)("div",{className:"text-xs text-muted",children:"Show line numbers in the editor"})]}),(0,a.jsx)("button",{onClick:()=>n("lineNumbers",!t.editor.lineNumbers),className:(0,h.cn)("w-11 h-6 rounded-full transition-colors relative",t.editor.lineNumbers?"bg-accent":"bg-border"),children:(0,a.jsx)("span",{className:(0,h.cn)("absolute top-1 w-4 h-4 rounded-full bg-white transition-transform",t.editor.lineNumbers?"left-6":"left-1")})})]})]})]})}let C=[{value:0,label:"Off"},{value:5,label:"5 seconds"},{value:10,label:"10 seconds"},{value:30,label:"30 seconds"}];function D(e){let{settings:t,onSave:s}=e,n=(e,a)=>{s({...t,project:{...t.project,[e]:a}})};return(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-txt mb-1",children:"Project"}),(0,a.jsx)("p",{className:"text-sm text-muted",children:"Configure project-level settings."})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-txt",children:"Auto-refresh Interval"}),(0,a.jsx)("p",{className:"text-xs text-muted",children:"How often to check for changes in the project files."}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:C.map(e=>{let s=t.project.autoRefresh===e.value;return(0,a.jsx)("button",{onClick:()=>n("autoRefresh",e.value),className:(0,h.cn)("px-4 py-2 rounded-lg border text-sm transition-colors",s?"border-accent bg-accent/10 text-accent font-medium":"border-border text-muted hover:border-accent/50"),children:e.label},e.value)})})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm font-medium text-txt",children:"Show Hidden Files"}),(0,a.jsx)("div",{className:"text-xs text-muted",children:"Display files starting with a dot"})]}),(0,a.jsx)("button",{onClick:()=>n("showHidden",!t.project.showHidden),className:(0,h.cn)("w-11 h-6 rounded-full transition-colors relative",t.project.showHidden?"bg-accent":"bg-border"),children:(0,a.jsx)("span",{className:(0,h.cn)("absolute top-1 w-4 h-4 rounded-full bg-white transition-transform",t.project.showHidden?"left-6":"left-1")})})]})]})}var S=s(78764),A=s(46850),Z=s(30445),_=s(13191);let M={"claude-code":{name:"Claude Code",config:'{\n "mcpServers": {\n "vibedoc": {\n "url": "{{ENDPOINT}}"\n }\n }\n}',path:"~/.claude/claude.json"},cursor:{name:"Cursor",config:'{\n "mcp": {\n "servers": {\n "vibedoc": {\n "url": "{{ENDPOINT}}"\n }\n }\n }\n}',path:".cursor/mcp.json"},windsurf:{name:"Windsurf",config:'{\n "mcpServers": {\n "vibedoc": {\n "url": "{{ENDPOINT}}"\n }\n }\n}',path:".windsurf/mcp.json"}};function I(e){let{settings:t,onSave:s}=e,[r,l]=(0,n.useState)(!1),[c,i]=(0,n.useState)(null),[o,u]=(0,n.useState)(null),m=(e,a)=>{s({...t,mcp:{...t.mcp,[e]:a}})},x=async()=>{l(!0),i(null);try{(await fetch(t.mcp.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/list"})})).ok?i("success"):i("error")}catch(e){i("error")}l(!1)},p=async e=>{let s=M[e].config.replace("{{ENDPOINT}}",t.mcp.endpoint);await navigator.clipboard.writeText(s),u(e),setTimeout(()=>u(null),2e3)};return(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-txt mb-1",children:"MCP Connection"}),(0,a.jsx)("p",{className:"text-sm text-muted",children:"Configure the Model Context Protocol server for AI agents."})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-txt",children:"MCP Endpoint"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(_.I,{value:t.mcp.endpoint,onChange:e=>m("endpoint",e.target.value),className:"bg-surface2 font-mono text-sm"}),(0,a.jsxs)("button",{onClick:x,disabled:r,className:"px-4 py-2 bg-accent text-white rounded-lg text-sm font-medium hover:bg-accent/90 transition-colors disabled:opacity-50 flex items-center gap-2",children:[r?(0,a.jsx)(S.Z,{className:"w-4 h-4 animate-spin"}):(0,a.jsx)(d,{className:"w-4 h-4"}),"Test"]})]}),c&&(0,a.jsx)("div",{className:(0,h.cn)("flex items-center gap-2 text-sm","success"===c?"text-green-400":"text-red-400"),children:"success"===c?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.Z,{className:"w-4 h-4"}),"Connection successful"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(A.Z,{className:"w-4 h-4"}),"Connection failed"]})})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-txt",children:"Agent Configuration"}),(0,a.jsx)("p",{className:"text-xs text-muted",children:"Copy the configuration for your coding agent:"}),(0,a.jsx)("div",{className:"space-y-2",children:Object.entries(M).map(e=>{let[t,s]=e;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 border border-border rounded-lg",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm font-medium text-txt",children:s.name}),(0,a.jsx)("div",{className:"text-xs text-muted font-mono",children:s.path})]}),(0,a.jsx)("button",{onClick:()=>p(t),className:(0,h.cn)("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",o===t?"bg-green-500/20 text-green-400":"bg-surface2 text-muted hover:text-txt"),children:o===t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.Z,{className:"w-3.5 h-3.5"}),"Copied"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Z.Z,{className:"w-3.5 h-3.5"}),"Copy"]})})]},t)})})]})]})}var E=s(48354),P=s(92560),z=s(39098);let T=["vibedoc_read_doc","vibedoc_write_doc","vibedoc_search_docs","vibedoc_list_docs","vibedoc_get_status","vibedoc_list_tasks","vibedoc_update_task","vibedoc_read_memory","vibedoc_update_memory"],O=["\uD83D\uDD27","\uD83D\uDCDD","\uD83E\uDDEA","\uD83D\uDD0D","\uD83D\uDCCA","\uD83D\uDD12","⚡","\uD83C\uDFAF","\uD83D\uDCA1","\uD83D\uDE80"];function W(e){let{skills:t,onSave:s}=e,[r,l]=(0,n.useState)(null),[c,i]=(0,n.useState)(null),[o,d]=(0,n.useState)(!1),m=e=>{l(e.id),i({...e}),d(!1)},x=()=>{l(null),i(null),d(!1)},p=()=>{c&&c.name.trim()&&(o?s([...t,c]):s(t.map(e=>e.id===c.id?c:e)),x())},f=e=>{confirm("Delete this skill?")&&s(t.filter(t=>t.id!==e))},b=e=>{if(!c)return;let t=c.tools.includes(e)?c.tools.filter(t=>t!==e):[...c.tools,e];i({...c,tools:t})};return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-txt mb-1",children:"Skills"}),(0,a.jsx)("p",{className:"text-sm text-muted",children:"Reusable capabilities for AI agents."})]}),(0,a.jsxs)("button",{onClick:()=>{let e={id:"skill-".concat(Date.now()),name:"",description:"",trigger:"/",prompt:"",tools:[],icon:"⚡"};l(e.id),i(e),d(!0)},className:"flex items-center gap-2 px-3 py-2 bg-accent text-white rounded-lg text-sm font-medium hover:bg-accent/90 transition-colors",children:[(0,a.jsx)(E.Z,{className:"w-4 h-4"}),"Add Skill"]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[t.map(e=>(0,a.jsx)("div",{children:r===e.id&&c?(0,a.jsxs)("div",{className:"border border-accent rounded-lg p-4 space-y-4 bg-accent/5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("select",{value:c.icon||"⚡",onChange:e=>i({...c,icon:e.target.value}),className:"w-12 h-10 text-center text-xl bg-surface2 border border-border rounded-lg",children:O.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}),(0,a.jsx)(_.I,{value:c.name,onChange:e=>i({...c,name:e.target.value}),placeholder:"Skill name",className:"bg-surface2"})]}),(0,a.jsx)(_.I,{value:c.description,onChange:e=>i({...c,description:e.target.value}),placeholder:"Description",className:"bg-surface2"}),(0,a.jsx)("div",{className:"flex gap-3",children:(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"text-xs text-muted mb-1 block",children:"Trigger"}),(0,a.jsx)(_.I,{value:c.trigger,onChange:e=>i({...c,trigger:e.target.value}),placeholder:"/command",className:"bg-surface2 font-mono"})]})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-muted mb-1 block",children:"System Prompt"}),(0,a.jsx)("textarea",{value:c.prompt,onChange:e=>i({...c,prompt:e.target.value}),placeholder:"Instructions for the AI when this skill is activated...",rows:4,className:"w-full px-3 py-2 bg-surface2 border border-border rounded-lg text-sm resize-none"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-muted mb-2 block",children:"Available Tools"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:T.map(e=>(0,a.jsx)("button",{onClick:()=>b(e),className:(0,h.cn)("px-2 py-1 rounded text-xs font-mono transition-colors",c.tools.includes(e)?"bg-accent/20 text-accent":"bg-surface2 text-muted hover:text-txt"),children:e.replace("vibedoc_","")},e))})]}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)("button",{onClick:x,className:"px-3 py-1.5 text-sm text-muted hover:text-txt transition-colors",children:"Cancel"}),(0,a.jsxs)("button",{onClick:p,disabled:!c.name.trim(),className:"flex items-center gap-2 px-3 py-1.5 bg-accent text-white rounded-lg text-sm font-medium hover:bg-accent/90 transition-colors disabled:opacity-50",children:[(0,a.jsx)(g.Z,{className:"w-4 h-4"}),"Save"]})]})]}):(0,a.jsxs)("div",{className:"flex items-start gap-3 p-4 border border-border rounded-lg hover:border-accent/30 transition-colors group",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-lg bg-surface2 flex items-center justify-center text-xl shrink-0",children:e.icon||"⚡"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-medium text-txt",children:e.name}),(0,a.jsx)("code",{className:"text-xs bg-surface2 px-1.5 py-0.5 rounded text-accent",children:e.trigger})]}),(0,a.jsx)("p",{className:"text-sm text-muted mt-0.5",children:e.description}),e.tools.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:e.tools.map(e=>(0,a.jsx)("span",{className:"text-xs bg-surface2 px-1.5 py-0.5 rounded text-muted",children:e.replace("vibedoc_","")},e))})]}),(0,a.jsxs)("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,a.jsx)("button",{onClick:()=>m(e),className:"p-1.5 rounded hover:bg-surface2 text-muted hover:text-txt transition-colors",children:(0,a.jsx)(P.Z,{className:"w-4 h-4"})}),(0,a.jsx)("button",{onClick:()=>f(e.id),className:"p-1.5 rounded hover:bg-red-500/10 text-muted hover:text-red-400 transition-colors",children:(0,a.jsx)(z.Z,{className:"w-4 h-4"})})]})]})},e.id)),o&&c&&(0,a.jsxs)("div",{className:"border border-accent rounded-lg p-4 space-y-4 bg-accent/5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("select",{value:c.icon||"⚡",onChange:e=>i({...c,icon:e.target.value}),className:"w-12 h-10 text-center text-xl bg-surface2 border border-border rounded-lg",children:O.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}),(0,a.jsx)(_.I,{value:c.name,onChange:e=>i({...c,name:e.target.value}),placeholder:"Skill name",className:"bg-surface2"})]}),(0,a.jsx)(_.I,{value:c.description,onChange:e=>i({...c,description:e.target.value}),placeholder:"Description",className:"bg-surface2"}),(0,a.jsx)("div",{className:"flex gap-3",children:(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"text-xs text-muted mb-1 block",children:"Trigger"}),(0,a.jsx)(_.I,{value:c.trigger,onChange:e=>i({...c,trigger:e.target.value}),placeholder:"/command",className:"bg-surface2 font-mono"})]})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-muted mb-1 block",children:"System Prompt"}),(0,a.jsx)("textarea",{value:c.prompt,onChange:e=>i({...c,prompt:e.target.value}),placeholder:"Instructions for the AI when this skill is activated...",rows:4,className:"w-full px-3 py-2 bg-surface2 border border-border rounded-lg text-sm resize-none"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-muted mb-2 block",children:"Available Tools"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:T.map(e=>(0,a.jsx)("button",{onClick:()=>b(e),className:(0,h.cn)("px-2 py-1 rounded text-xs font-mono transition-colors",c.tools.includes(e)?"bg-accent/20 text-accent":"bg-surface2 text-muted hover:text-txt"),children:e.replace("vibedoc_","")},e))})]}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)("button",{onClick:x,className:"px-3 py-1.5 text-sm text-muted hover:text-txt transition-colors",children:"Cancel"}),(0,a.jsxs)("button",{onClick:p,disabled:!c.name.trim(),className:"flex items-center gap-2 px-3 py-1.5 bg-accent text-white rounded-lg text-sm font-medium hover:bg-accent/90 transition-colors disabled:opacity-50",children:[(0,a.jsx)(g.Z,{className:"w-4 h-4"}),"Save"]})]})]}),0===t.length&&!o&&(0,a.jsxs)("div",{className:"text-center py-8 text-muted",children:[(0,a.jsx)(u.Z,{className:"w-10 h-10 mx-auto mb-3 opacity-30"}),(0,a.jsx)("p",{className:"text-sm",children:"No skills configured"}),(0,a.jsx)("p",{className:"text-xs mt-1",children:"Add a skill to give your agents capabilities"})]})]})]})}let R=["\uD83E\uDD16","\uD83D\uDCDA","\uD83D\uDD12","\uD83E\uDDEA","\uD83D\uDCDD","\uD83D\uDD27","\uD83D\uDCA1","\uD83C\uDFAF","\uD83D\uDE80","⚡"];function F(e){let{agents:t,skills:s,onSave:r}=e,[l,c]=(0,n.useState)(null),[i,o]=(0,n.useState)(null),[d,u]=(0,n.useState)(!1),x=e=>{c(e.id),o({...e}),u(!1)},p=()=>{c(null),o(null),u(!1)},f=()=>{i&&i.name.trim()&&(d?r([...t,i]):r(t.map(e=>e.id===i.id?i:e)),p())},b=e=>{confirm("Delete this agent?")&&r(t.filter(t=>t.id!==e))},v=e=>{r(t.map(t=>t.id===e?{...t,active:!t.active}:t))},j=e=>{if(!i)return;let t=i.skills.includes(e)?i.skills.filter(t=>t!==e):[...i.skills,e];o({...i,skills:t})},N=e=>(0,a.jsxs)("div",{className:"border border-accent rounded-lg p-4 space-y-4 bg-accent/5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("select",{value:e.icon,onChange:t=>o({...e,icon:t.target.value}),className:"w-12 h-10 text-center text-xl bg-surface2 border border-border rounded-lg",children:R.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}),(0,a.jsx)(_.I,{value:e.name,onChange:t=>o({...e,name:t.target.value}),placeholder:"Agent name",className:"bg-surface2"})]}),(0,a.jsx)(_.I,{value:e.description,onChange:t=>o({...e,description:t.target.value}),placeholder:"Description",className:"bg-surface2"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-muted mb-2 block",children:"Assigned Skills"}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[s.map(t=>(0,a.jsxs)("button",{onClick:()=>j(t.id),className:(0,h.cn)("flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-sm transition-colors",e.skills.includes(t.id)?"bg-accent/20 text-accent":"bg-surface2 text-muted hover:text-txt"),children:[(0,a.jsx)("span",{children:t.icon||"⚡"}),t.name]},t.id)),0===s.length&&(0,a.jsx)("span",{className:"text-xs text-muted",children:"No skills available. Create skills first."})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-muted mb-1 block",children:"Custom System Prompt"}),(0,a.jsx)("textarea",{value:e.prompt,onChange:t=>o({...e,prompt:t.target.value}),placeholder:"Additional instructions for this agent...",rows:3,className:"w-full px-3 py-2 bg-surface2 border border-border rounded-lg text-sm resize-none"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{onClick:()=>o({...e,active:!e.active}),className:(0,h.cn)("w-11 h-6 rounded-full transition-colors relative",e.active?"bg-accent":"bg-border"),children:(0,a.jsx)("span",{className:(0,h.cn)("absolute top-1 w-4 h-4 rounded-full bg-white transition-transform",e.active?"left-6":"left-1")})}),(0,a.jsx)("span",{className:"text-sm text-muted",children:e.active?"Active":"Inactive"})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:p,className:"px-3 py-1.5 text-sm text-muted hover:text-txt transition-colors",children:"Cancel"}),(0,a.jsxs)("button",{onClick:f,disabled:!e.name.trim(),className:"flex items-center gap-2 px-3 py-1.5 bg-accent text-white rounded-lg text-sm font-medium hover:bg-accent/90 transition-colors disabled:opacity-50",children:[(0,a.jsx)(g.Z,{className:"w-4 h-4"}),"Save"]})]})]})]});return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-txt mb-1",children:"Agents"}),(0,a.jsx)("p",{className:"text-sm text-muted",children:"AI agent profiles with assigned skills."})]}),(0,a.jsxs)("button",{onClick:()=>{let e={id:"agent-".concat(Date.now()),name:"",icon:"\uD83E\uDD16",description:"",skills:[],prompt:"",active:!0};c(e.id),o(e),u(!0)},className:"flex items-center gap-2 px-3 py-2 bg-accent text-white rounded-lg text-sm font-medium hover:bg-accent/90 transition-colors",children:[(0,a.jsx)(E.Z,{className:"w-4 h-4"}),"Add Agent"]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[t.map(e=>(0,a.jsx)("div",{children:l===e.id&&i?N(i):(0,a.jsxs)("div",{className:(0,h.cn)("flex items-start gap-3 p-4 border rounded-lg transition-colors group",e.active?"border-border hover:border-accent/30":"border-border/50 opacity-60"),children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-lg bg-surface2 flex items-center justify-center text-xl shrink-0",children:e.icon}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-medium text-txt",children:e.name}),!e.active&&(0,a.jsx)("span",{className:"text-xs bg-surface2 px-1.5 py-0.5 rounded text-muted",children:"Inactive"})]}),(0,a.jsx)("p",{className:"text-sm text-muted mt-0.5",children:e.description}),e.skills.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:e.skills.map(e=>{let t=s.find(t=>t.id===e);return t?(0,a.jsxs)("span",{className:"flex items-center gap-1 text-xs bg-surface2 px-1.5 py-0.5 rounded text-muted",children:[t.icon," ",t.name]},e):null})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{onClick:()=>v(e.id),className:(0,h.cn)("w-9 h-5 rounded-full transition-colors relative",e.active?"bg-accent":"bg-border"),children:(0,a.jsx)("span",{className:(0,h.cn)("absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform",e.active?"left-4":"left-0.5")})}),(0,a.jsxs)("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,a.jsx)("button",{onClick:()=>x(e),className:"p-1.5 rounded hover:bg-surface2 text-muted hover:text-txt transition-colors",children:(0,a.jsx)(P.Z,{className:"w-4 h-4"})}),(0,a.jsx)("button",{onClick:()=>b(e.id),className:"p-1.5 rounded hover:bg-red-500/10 text-muted hover:text-red-400 transition-colors",children:(0,a.jsx)(z.Z,{className:"w-4 h-4"})})]})]})]})},e.id)),d&&i&&N(i),0===t.length&&!d&&(0,a.jsxs)("div",{className:"text-center py-8 text-muted",children:[(0,a.jsx)(m.Z,{className:"w-10 h-10 mx-auto mb-3 opacity-30"}),(0,a.jsx)("p",{className:"text-sm",children:"No agents configured"}),(0,a.jsx)("p",{className:"text-xs mt-1",children:"Add an agent to define AI personas with skills"})]})]})]})}let H={theme:"dark",accentColor:"blue",fontSize:"medium",editor:{autoSave:10,wordWrap:!0,lineNumbers:!0,previewMode:"split"},project:{autoRefresh:10,showHidden:!1},mcp:{endpoint:"http://localhost:3000/api/mcp"}},V=[{id:"code-review",name:"Code Review",description:"Analyzes code for quality, security, and performance issues",trigger:"/review",prompt:"You are an expert code reviewer. Analyze the provided code for:\n- Code quality and best practices\n- Security vulnerabilities\n- Performance issues\n- Maintainability concerns\n\nProvide actionable feedback.",tools:["vibedoc_read_doc","vibedoc_search_docs"],icon:"\uD83D\uDD27"},{id:"doc-generator",name:"Documentation Generator",description:"Creates documentation from code and comments",trigger:"/docs",prompt:"You are a technical documentation writer. Generate clear, comprehensive documentation for the provided code or feature.",tools:["vibedoc_read_doc","vibedoc_write_doc"],icon:"\uD83D\uDCDD"},{id:"test-writer",name:"Test Writer",description:"Generates unit tests for functions and components",trigger:"/test",prompt:"You are a testing expert. Write comprehensive unit tests for the provided code, covering edge cases and ensuring good test coverage.",tools:["vibedoc_read_doc","vibedoc_search_docs"],icon:"\uD83E\uDDEA"}],q=[{id:"code-assistant",name:"Code Assistant",icon:"\uD83E\uDD16",description:"General-purpose coding help",skills:["code-review","test-writer"],prompt:"You are a helpful coding assistant. Help the user with their coding tasks.",active:!0},{id:"doc-bot",name:"Documentation Bot",icon:"\uD83D\uDCDA",description:"Focused on docs and comments",skills:["doc-generator"],prompt:"You are a documentation specialist. Focus on creating and improving documentation.",active:!0}],L=[{id:"appearance",label:"Appearance",icon:c},{id:"editor",label:"Editor",icon:i},{id:"project",label:"Project",icon:o},{id:"mcp",label:"MCP",icon:d},{id:"skills",label:"Skills",icon:u.Z},{id:"agents",label:"Agents",icon:m.Z}];function U(){let{rootParam:e}=(0,r.q)(),[t,s]=(0,n.useState)("appearance"),[l,c]=(0,n.useState)(H),[i,o]=(0,n.useState)(V),[d,u]=(0,n.useState)(q),[m,p]=(0,n.useState)(!0),[f,b]=(0,n.useState)(!1),g=(0,n.useCallback)(async()=>{try{let t=await fetch("/api/settings".concat(e,"&type=all")),s=await t.json();c(s.settings||H),o(s.skills||V),u(s.agents||q)}catch(e){}p(!1)},[e]);(0,n.useEffect)(()=>{g()},[g]);let v=async t=>{b(!0),c(t);try{await fetch("/api/settings".concat(e,"&type=settings"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}catch(e){}b(!1)},j=async t=>{b(!0),o(t);try{await fetch("/api/settings".concat(e,"&type=skills"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}catch(e){}b(!1)},y=async t=>{b(!0),u(t);try{await fetch("/api/settings".concat(e,"&type=agents"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}catch(e){}b(!1)};return m?(0,a.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,a.jsx)("div",{className:"text-muted",children:"Loading settings..."})}):(0,a.jsxs)("div",{className:"flex h-full",children:[(0,a.jsxs)("aside",{className:"w-56 border-r border-border bg-sidebar shrink-0",children:[(0,a.jsx)("div",{className:"p-4 border-b border-border",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(x.Z,{className:"w-5 h-5 text-accent"}),(0,a.jsx)("h1",{className:"font-semibold text-txt",children:"Settings"})]})}),(0,a.jsx)("nav",{className:"p-2",children:L.map(e=>{let n=e.icon;return(0,a.jsxs)("button",{onClick:()=>s(e.id),className:(0,h.cn)("w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",t===e.id?"bg-accent/10 text-accent font-medium":"text-muted hover:text-txt hover:bg-surface2"),children:[(0,a.jsx)(n,{className:"w-4 h-4"}),e.label]},e.id)})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,a.jsxs)("div",{className:"max-w-2xl mx-auto p-6",children:[f&&(0,a.jsx)("div",{className:"fixed top-4 right-4 bg-accent text-white px-3 py-1.5 rounded-lg text-sm shadow-lg",children:"Saving..."}),"appearance"===t&&(0,a.jsx)(N,{settings:l,onSave:v}),"editor"===t&&(0,a.jsx)(w,{settings:l,onSave:v}),"project"===t&&(0,a.jsx)(D,{settings:l,onSave:v}),"mcp"===t&&(0,a.jsx)(I,{settings:l,onSave:v}),"skills"===t&&(0,a.jsx)(W,{skills:i,onSave:j}),"agents"===t&&(0,a.jsx)(F,{agents:d,skills:i,onSave:y})]})})]})}},13191:function(e,t,s){"use strict";s.d(t,{I:function(){return l}});var a=s(59533),n=s(31229),r=s(52284);let l=n.forwardRef((e,t)=>{let{className:s,type:n,...l}=e;return(0,a.jsx)("input",{type:n,className:(0,r.cn)("flex h-10 w-full rounded-md border border-slate-200 bg-white px-3 py-2 text-base ring-offset-white file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-slate-950 placeholder:text-slate-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:border-slate-800 dark:bg-slate-950 dark:ring-offset-slate-950 dark:file:text-slate-50 dark:placeholder:text-slate-400 dark:focus-visible:ring-slate-300",s),ref:t,...l})});l.displayName="Input"},11180:function(e,t,s){"use strict";s.d(t,{q:function(){return c},w:function(){return i}});var a=s(59533),n=s(31229),r=s(61250);let l=(0,n.createContext)(null);function c(){let e=(0,n.useContext)(l);if(!e)throw Error("useApp must be used inside AppProvider");return e}function i(e){let{children:t}=e,s=(0,r.useRouter)(),[c,i]=(0,n.useState)([]),[o,d]=(0,n.useState)(""),[u,m]=(0,n.useState)(null),[x,h]=(0,n.useState)(null),[p,f]=(0,n.useState)([]),[b,g]=(0,n.useState)(!0),[v,j]=(0,n.useState)(!1),[N,y]=(0,n.useState)(null),k=(0,n.useRef)(null),w=o?"?root=".concat(encodeURIComponent(o)):"",C=(0,n.useCallback)(async e=>{let t=e||o;if(!t)return;let s="?root=".concat(encodeURIComponent(t));try{let[e,t,a]=await Promise.all([fetch("/api/summary".concat(s)).then(e=>e.json()),fetch("/api/tasks".concat(s)).then(e=>e.json()),fetch("/api/activity".concat(s,"&limit=30")).then(e=>e.json())]);m(e),h(t.board),f(Array.isArray(a)?a:[])}catch(e){}g(!1)},[o]);(0,n.useEffect)(()=>{fetch("/api/projects").then(e=>e.json()).then(e=>{i(e),e.length>0?(d(e[0].root),C(e[0].root)):g(!1)}).catch(()=>g(!1))},[]),(0,n.useEffect)(()=>{if(!o)return;let e=new EventSource("/api/events");return k.current=e,e.onmessage=e=>{try{let t=JSON.parse(e.data);if("connected"===t.type)return;j(!0),setTimeout(()=>j(!1),2e3),["task_updated","decision_logged","memory_updated","session_start"].includes(t.type)&&C()}catch(e){}},()=>{e.close()}},[o,C]);let D=(0,n.useCallback)(async(e,t)=>{h(s=>{let a;if(!s)return s;let n=structuredClone(s);for(let s of Object.keys(n)){let r=n[s].findIndex(t=>t.id===e);-1!==r&&(a={...n[s][r],status:t},n[s]=n[s].filter(t=>t.id!==e))}return a&&n[t]&&(n[t]=[a,...n[t]]),n});try{await fetch("/api/tasks".concat(w),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e,status:t,actor:"human"})}),C()}catch(e){C()}},[w,C]),S=(0,n.useCallback)(async e=>{let t=await fetch("/api/docs".concat(w,"&read=").concat(encodeURIComponent(e)));y(await t.json()),s.push("/docs")},[w,s]);return(0,a.jsx)(l.Provider,{value:{projects:c,activeProject:o,summary:u,board:x,activity:p,liveIndicator:v,loading:b,selectedDoc:N,setSelectedDoc:y,rootParam:w,onProjectChange:function(e){d(e),C(e)},refresh:C,moveTask:D,openDoc:S},children:t})}},52284:function(e,t,s){"use strict";s.d(t,{cn:function(){return r}});var a=s(27494),n=s(724);function r(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,n.m6)((0,a.W)(t))}}},function(e){e.O(0,[490,4170,6842,1744],function(){return e(e.s=13714)}),_N_E=e.O()}]);
@@ -0,0 +1,16 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7821],{31852:function(e,t,s){Promise.resolve().then(s.bind(s,2983))},98009:function(e,t,s){"use strict";s.d(t,{Z:function(){return m}});var a=s(31229);/**
2
+ * @license lucide-react v0.575.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
+ */let n=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim()},r=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),c=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase()),i=e=>{let t=c(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
7
+ * @license lucide-react v0.575.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
+ */var l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
12
+ * @license lucide-react v0.575.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
+ */let d=e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1},o=(0,a.forwardRef)((e,t)=>{let{color:s="currentColor",size:r=24,strokeWidth:c=2,absoluteStrokeWidth:i,className:o="",children:m,iconNode:x,...u}=e;return(0,a.createElement)("svg",{ref:t,...l,width:r,height:r,stroke:s,strokeWidth:i?24*Number(c)/Number(r):c,className:n("lucide",o),...!m&&!d(u)&&{"aria-hidden":"true"},...u},[...x.map(e=>{let[t,s]=e;return(0,a.createElement)(t,s)}),...Array.isArray(m)?m:[m]])}),m=(e,t)=>{let s=(0,a.forwardRef)((s,c)=>{let{className:l,...d}=s;return(0,a.createElement)(o,{ref:c,iconNode:t,className:n("lucide-".concat(r(i(e))),"lucide-".concat(e),l),...d})});return s.displayName=i(e),s}},94297:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])},56622:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]])},20508:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},12794:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},21263:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},78764:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},8892:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(98009).Z)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},2983:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return E}});var a=s(59533),n=s(31229),r=s(11180),c=s(98009);let i=(0,c.Z)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);var l=s(21263),d=s(20508),o=s(12794);let m=(0,c.Z)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var x=s(78764),u=s(52284),h=s(56622);let p=(0,c.Z)("building-2",[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]]),f=(0,c.Z)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);var b=s(94297);let j=(0,c.Z)("triangle-alert",[["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"}]]),g=(0,c.Z)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);var y=s(8892);let v=[{category:"Recommended",items:[{id:"claude-md",name:"CLAUDE.md",description:"AI agent instructions",icon:h.Z,path:"CLAUDE.md"},{id:"agents-md",name:"AGENTS.md",description:"Multi-agent config",icon:h.Z,path:"AGENTS.md"}]},{category:"Documentation",items:[{id:"prd",name:"PRD",description:"Product requirements",icon:l.Z,path:"docs/prd.md"},{id:"architecture-overview",name:"Architecture",description:"System overview",icon:p,path:"docs/architecture/overview.md"},{id:"api-reference",name:"API Reference",description:"Endpoints docs",icon:f,path:"docs/api-reference.md"},{id:"runbook",name:"Runbook",description:"Operations guide",icon:b.Z,path:"docs/runbook.md"},{id:"adr",name:"ADR",description:"Decision record",icon:j,path:"docs/architecture/decisions/ADR-001.md"},{id:"meeting-notes",name:"Meeting Notes",description:"Meeting template",icon:g,path:"docs/meetings/notes.md"},{id:"onboarding",name:"Onboarding",description:"Dev onboarding",icon:y.Z,path:"docs/onboarding.md"}]}];function N(e){let{selected:t,onChange:s}=e,n=e=>t.some(t=>t.id===e),r=e=>{n(e.id)?s(t.filter(t=>t.id!==e.id)):s([...t,{id:e.id,name:e.name,path:e.path}])},c=e=>{let a=v.find(t=>t.category===e);if(a){if(a.items.every(e=>n(e.id)))s(t.filter(e=>!a.items.some(t=>t.id===e.id)));else{let e=[...t];a.items.forEach(t=>{n(t.id)||e.push({id:t.id,name:t.name,path:t.path})}),s(e)}}};return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-txt mb-2",children:"Select Templates"}),(0,a.jsx)("p",{className:"text-muted",children:"Choose which documentation files to generate for your project."})]}),v.map(e=>(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h3",{className:"text-sm font-medium text-muted uppercase tracking-wider",children:e.category}),(0,a.jsx)("button",{onClick:()=>c(e.category),className:"text-xs text-accent hover:text-accent/80 transition-colors",children:e.items.every(e=>n(e.id))?"Deselect all":"Select all"})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:e.items.map(e=>{let t=e.icon,s=n(e.id);return(0,a.jsx)("button",{onClick:()=>r(e),className:(0,u.cn)("p-3 rounded-lg border text-left transition-all",s?"border-accent bg-accent/10":"border-border hover:border-accent/50"),children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)("div",{className:(0,u.cn)("w-8 h-8 rounded-lg flex items-center justify-center shrink-0",s?"bg-accent/20":"bg-surface2"),children:(0,a.jsx)(t,{className:(0,u.cn)("w-4 h-4",s?"text-accent":"text-muted")})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"font-medium text-sm text-txt truncate",children:e.name}),(0,a.jsx)("div",{className:"text-xs text-muted truncate",children:e.description})]}),s&&(0,a.jsx)(d.Z,{className:"w-4 h-4 text-accent shrink-0"})]})},e.id)})})]},e.category)),(0,a.jsxs)("div",{className:"text-sm text-muted",children:[t.length," template",1!==t.length?"s":""," selected"]})]})}var k=s(13191);let w=[{value:"web-app",label:"Web Application"},{value:"api-backend",label:"API / Backend"},{value:"cli-tool",label:"CLI Tool"},{value:"library",label:"Library / SDK"},{value:"mobile-app",label:"Mobile App"},{value:"monorepo",label:"Monorepo"}];function C(e){let{answers:t,onChange:s}=e,n=(e,a)=>{s({...t,[e]:a})};return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-txt mb-2",children:"Project Information"}),(0,a.jsx)("p",{className:"text-muted",children:"Tell us about your project to customize the documentation."})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-sm font-medium text-txt mb-1.5",children:["Project Name ",(0,a.jsx)("span",{className:"text-red-400",children:"*"})]}),(0,a.jsx)(k.I,{value:t.projectName,onChange:e=>n("projectName",e.target.value),placeholder:"My Awesome Project",className:"bg-surface2"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-txt mb-1.5",children:"Project Type"}),(0,a.jsx)("select",{value:t.projectType,onChange:e=>n("projectType",e.target.value),className:"w-full h-10 px-3 rounded-md border border-border bg-surface2 text-txt text-sm focus:outline-none focus:ring-2 focus:ring-accent/50",children:w.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-txt mb-1.5",children:"Tech Stack"}),(0,a.jsx)(k.I,{value:t.techStack,onChange:e=>n("techStack",e.target.value),placeholder:"Next.js, TypeScript, PostgreSQL, etc.",className:"bg-surface2"}),(0,a.jsx)("p",{className:"text-xs text-muted mt-1",children:"Comma-separated list of main technologies"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-txt mb-1.5",children:"Description"}),(0,a.jsx)("textarea",{value:t.description,onChange:e=>n("description",e.target.value),placeholder:"A brief description of what your project does...",rows:3,className:"w-full px-3 py-2 rounded-md border border-border bg-surface2 text-txt text-sm resize-none focus:outline-none focus:ring-2 focus:ring-accent/50"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-sm font-medium text-txt mb-1.5",children:["Key Features ",(0,a.jsx)("span",{className:"text-muted",children:"(optional)"})]}),(0,a.jsx)(k.I,{value:t.keyFeatures,onChange:e=>n("keyFeatures",e.target.value),placeholder:"Auth, payments, real-time sync, etc.",className:"bg-surface2"}),(0,a.jsx)("p",{className:"text-xs text-muted mt-1",children:"Comma-separated list of main features"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-sm font-medium text-txt mb-1.5",children:["Coding Conventions ",(0,a.jsx)("span",{className:"text-muted",children:"(optional)"})]}),(0,a.jsx)(k.I,{value:t.conventions,onChange:e=>n("conventions",e.target.value),placeholder:"ESLint, Prettier, Conventional Commits, etc.",className:"bg-surface2"})]})]})]})}let S=(0,c.Z)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),M=(0,c.Z)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);function Z(e){let{files:t,onWrite:s,isWriting:r}=e,[c,i]=(0,n.useState)(new Set),d=e=>{i(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},m=t.filter(e=>!e.skipped),x=t.filter(e=>e.skipped);return 0===t.length?(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)(S,{className:"w-12 h-12 text-muted mx-auto mb-4"}),(0,a.jsx)("h3",{className:"text-lg font-medium text-txt mb-2",children:"No files generated"}),(0,a.jsx)("p",{className:"text-muted",children:"Something went wrong. Please go back and try again."})]}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-txt mb-2",children:"Preview"}),(0,a.jsx)("p",{className:"text-muted",children:"Review the files that will be created. Click to expand and see the content."})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("h3",{className:"text-sm font-medium text-muted uppercase tracking-wider",children:["Files to create (",m.length,")"]}),(0,a.jsx)("div",{className:"border border-border rounded-lg divide-y divide-border overflow-hidden",children:m.map(e=>{let t=c.has(e.path);return(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{onClick:()=>d(e.path),className:"w-full flex items-center gap-3 p-3 hover:bg-surface2 transition-colors",children:[t?(0,a.jsx)(M,{className:"w-4 h-4 text-muted shrink-0"}):(0,a.jsx)(o.Z,{className:"w-4 h-4 text-muted shrink-0"}),(0,a.jsx)(l.Z,{className:"w-4 h-4 text-accent shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-mono text-txt",children:e.path})]}),t&&(0,a.jsx)("div",{className:"px-3 pb-3",children:(0,a.jsxs)("pre",{className:"p-3 bg-surface2 rounded-lg text-xs text-muted overflow-x-auto max-h-64 overflow-y-auto",children:[e.content.slice(0,2e3),e.content.length>2e3&&"\n\n...(truncated)"]})})]},e.path)})})]}),x.length>0&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("h3",{className:"text-sm font-medium text-muted uppercase tracking-wider",children:["Skipped (",x.length,")"]}),(0,a.jsx)("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-lg p-3 space-y-1",children:x.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(S,{className:"w-4 h-4 text-amber-400 shrink-0"}),(0,a.jsx)("span",{className:"font-mono text-amber-400",children:e.path}),(0,a.jsxs)("span",{className:"text-amber-400/70",children:["— ",e.reason||"already exists"]})]},e.path))})]}),(0,a.jsxs)("div",{className:"text-sm text-muted",children:[m.length," file",1!==m.length?"s":""," will be created",x.length>0&&", ".concat(x.length," skipped")]})]})}let A=[{id:"welcome",title:"Welcome"},{id:"templates",title:"Templates"},{id:"questions",title:"Project Info"},{id:"mode",title:"Generation"},{id:"preview",title:"Preview"},{id:"complete",title:"Complete"}];function P(){let{activeProject:e,rootParam:t,projects:s}=(0,r.q)(),c=s.find(t=>t.root===e),[h,p]=(0,n.useState)(0),[f,b]=(0,n.useState)([]),[j,g]=(0,n.useState)({projectName:"",projectType:"web-app",techStack:"",description:"",keyFeatures:"",conventions:""}),[y,v]=(0,n.useState)("quick"),[k,w]=(0,n.useState)([]),[S,M]=(0,n.useState)(!1),[P,E]=(0,n.useState)([]);(0,n.useEffect)(()=>{!async function(){try{let e=await fetch("/api/docs".concat(t)),s=(await e.json()).filter(e=>"CLAUDE.md"===e.path||"AGENTS.md"===e.path).map(e=>e.path);E(s)}catch(e){}}()},[t]);let T=async()=>{if(3===h){M(!0);try{let e=await fetch("/api/setup/generate".concat(t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({templates:f,answers:j,mode:y})}),s=await e.json();w(s.files||[])}catch(e){w([])}M(!1)}p(e=>Math.min(e+1,A.length-1))},I=async()=>{M(!0);try{await fetch("/api/setup/write".concat(t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:k})}),p(5)}catch(e){}M(!1)};return(0,a.jsxs)("div",{className:"min-h-screen bg-bg flex flex-col",children:[(0,a.jsx)("div",{className:"border-b border-border bg-surface",children:(0,a.jsxs)("div",{className:"max-w-3xl mx-auto px-6 py-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("h1",{className:"text-lg font-semibold text-txt",children:"Setup Wizard"}),(0,a.jsxs)("span",{className:"text-sm text-muted",children:["Step ",h+1," of ",A.length]})]}),(0,a.jsx)("div",{className:"flex gap-1",children:A.map((e,t)=>(0,a.jsx)("div",{className:(0,u.cn)("h-1 flex-1 rounded-full transition-colors",t<=h?"bg-accent":"bg-border")},e.id))})]})}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,a.jsxs)("div",{className:"max-w-3xl mx-auto px-6 py-8",children:[0===h&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"text-center space-y-4",children:[(0,a.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-accent/10 flex items-center justify-center mx-auto",children:(0,a.jsx)(i,{className:"w-8 h-8 text-accent"})}),(0,a.jsx)("h2",{className:"text-2xl font-bold text-txt",children:"Welcome to VibeDoc"}),(0,a.jsx)("p",{className:"text-muted max-w-md mx-auto",children:"Let's set up your project documentation. You can generate AI-optimized docs like CLAUDE.md, architecture overviews, and more."})]}),c&&(0,a.jsxs)("div",{className:"bg-surface border border-border rounded-lg p-4",children:[(0,a.jsx)("div",{className:"text-sm text-muted mb-1",children:"Current Project"}),(0,a.jsx)("div",{className:"font-medium text-txt",children:c.name}),(0,a.jsx)("div",{className:"text-xs text-muted mt-1 font-mono",children:c.root})]}),P.length>0&&(0,a.jsxs)("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-lg p-4",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-amber-400 mb-1",children:"Existing files detected"}),(0,a.jsxs)("div",{className:"text-sm text-amber-400/80",children:[P.join(", ")," already exist. They will be skipped during generation."]})]})]}),1===h&&(0,a.jsx)(N,{selected:f,onChange:b}),2===h&&(0,a.jsx)(C,{answers:j,onChange:g}),3===h&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-txt mb-2",children:"Choose Generation Mode"}),(0,a.jsx)("p",{className:"text-muted",children:"How would you like to generate your documentation?"})]}),(0,a.jsxs)("div",{className:"grid gap-4",children:[(0,a.jsx)("button",{onClick:()=>v("quick"),className:(0,u.cn)("p-4 rounded-lg border text-left transition-all","quick"===y?"border-accent bg-accent/10":"border-border hover:border-accent/50"),children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)(l.Z,{className:"w-5 h-5 text-accent mt-0.5"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"font-medium text-txt",children:"Quick Mode"}),(0,a.jsx)("div",{className:"text-sm text-muted mt-1",children:"Use templates with your project info filled in. Fast and reliable."})]}),"quick"===y&&(0,a.jsx)(d.Z,{className:"w-5 h-5 text-accent ml-auto"})]})}),(0,a.jsx)("button",{onClick:()=>v("ai"),className:(0,u.cn)("p-4 rounded-lg border text-left transition-all","ai"===y?"border-accent bg-accent/10":"border-border hover:border-accent/50"),children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)(i,{className:"w-5 h-5 text-accent mt-0.5"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"font-medium text-txt",children:"AI Mode"}),(0,a.jsx)("div",{className:"text-sm text-muted mt-1",children:"Generate custom content using your connected coding agent (Claude Code, Cursor, etc.)."}),(0,a.jsx)("div",{className:"text-xs text-accent mt-2",children:"Requires MCP connection"})]}),"ai"===y&&(0,a.jsx)(d.Z,{className:"w-5 h-5 text-accent ml-auto"})]})})]})]}),4===h&&(0,a.jsx)(Z,{files:k,onWrite:I,isWriting:S}),5===h&&(0,a.jsxs)("div",{className:"text-center space-y-6",children:[(0,a.jsx)("div",{className:"w-16 h-16 rounded-full bg-green-500/10 flex items-center justify-center mx-auto",children:(0,a.jsx)(d.Z,{className:"w-8 h-8 text-green-500"})}),(0,a.jsx)("h2",{className:"text-2xl font-bold text-txt",children:"Setup Complete!"}),(0,a.jsx)("p",{className:"text-muted max-w-md mx-auto",children:"Your documentation files have been created. You can now view and edit them in the Docs tab."}),(0,a.jsxs)("div",{className:"bg-surface border border-border rounded-lg p-4 text-left max-w-md mx-auto",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-txt mb-2",children:"Next steps:"}),(0,a.jsxs)("ul",{className:"text-sm text-muted space-y-2",children:[(0,a.jsx)("li",{children:"• Review generated files in the Docs tab"}),(0,a.jsx)("li",{children:"• Edit content to match your project specifics"}),(0,a.jsx)("li",{children:"• Connect your coding agent via MCP for AI assistance"})]})]}),(0,a.jsxs)("a",{href:"/docs",className:"inline-flex items-center gap-2 px-4 py-2 bg-accent text-white rounded-lg font-medium hover:bg-accent/90 transition-colors",children:["Go to Docs",(0,a.jsx)(o.Z,{className:"w-4 h-4"})]})]})]})}),h<5&&(0,a.jsx)("div",{className:"border-t border-border bg-surface",children:(0,a.jsxs)("div",{className:"max-w-3xl mx-auto px-6 py-4 flex items-center justify-between",children:[(0,a.jsxs)("button",{onClick:()=>{p(e=>Math.max(e-1,0))},disabled:0===h,className:(0,u.cn)("flex items-center gap-2 px-4 py-2 rounded-lg font-medium transition-colors",0===h?"text-muted cursor-not-allowed":"text-txt hover:bg-surface2"),children:[(0,a.jsx)(m,{className:"w-4 h-4"}),"Back"]}),4===h?(0,a.jsx)("button",{onClick:I,disabled:S||0===k.length,className:"flex items-center gap-2 px-4 py-2 bg-accent text-white rounded-lg font-medium hover:bg-accent/90 transition-colors disabled:opacity-50",children:S?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.Z,{className:"w-4 h-4 animate-spin"}),"Writing..."]}):(0,a.jsxs)(a.Fragment,{children:["Write Files",(0,a.jsx)(d.Z,{className:"w-4 h-4"})]})}):(0,a.jsx)("button",{onClick:T,disabled:!(()=>{switch(h){case 0:case 3:default:return!0;case 1:return f.length>0;case 2:return""!==j.projectName.trim();case 4:return k.length>0}})()||S,className:"flex items-center gap-2 px-4 py-2 bg-accent text-white rounded-lg font-medium hover:bg-accent/90 transition-colors disabled:opacity-50",children:S?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.Z,{className:"w-4 h-4 animate-spin"}),"Generating..."]}):(0,a.jsxs)(a.Fragment,{children:[3===h?"Generate":"Next",(0,a.jsx)(o.Z,{className:"w-4 h-4"})]})})]})})]})}function E(){return(0,a.jsx)(P,{})}},13191:function(e,t,s){"use strict";s.d(t,{I:function(){return c}});var a=s(59533),n=s(31229),r=s(52284);let c=n.forwardRef((e,t)=>{let{className:s,type:n,...c}=e;return(0,a.jsx)("input",{type:n,className:(0,r.cn)("flex h-10 w-full rounded-md border border-slate-200 bg-white px-3 py-2 text-base ring-offset-white file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-slate-950 placeholder:text-slate-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:border-slate-800 dark:bg-slate-950 dark:ring-offset-slate-950 dark:file:text-slate-50 dark:placeholder:text-slate-400 dark:focus-visible:ring-slate-300",s),ref:t,...c})});c.displayName="Input"},11180:function(e,t,s){"use strict";s.d(t,{q:function(){return i},w:function(){return l}});var a=s(59533),n=s(31229),r=s(61250);let c=(0,n.createContext)(null);function i(){let e=(0,n.useContext)(c);if(!e)throw Error("useApp must be used inside AppProvider");return e}function l(e){let{children:t}=e,s=(0,r.useRouter)(),[i,l]=(0,n.useState)([]),[d,o]=(0,n.useState)(""),[m,x]=(0,n.useState)(null),[u,h]=(0,n.useState)(null),[p,f]=(0,n.useState)([]),[b,j]=(0,n.useState)(!0),[g,y]=(0,n.useState)(!1),[v,N]=(0,n.useState)(null),k=(0,n.useRef)(null),w=d?"?root=".concat(encodeURIComponent(d)):"",C=(0,n.useCallback)(async e=>{let t=e||d;if(!t)return;let s="?root=".concat(encodeURIComponent(t));try{let[e,t,a]=await Promise.all([fetch("/api/summary".concat(s)).then(e=>e.json()),fetch("/api/tasks".concat(s)).then(e=>e.json()),fetch("/api/activity".concat(s,"&limit=30")).then(e=>e.json())]);x(e),h(t.board),f(Array.isArray(a)?a:[])}catch(e){}j(!1)},[d]);(0,n.useEffect)(()=>{fetch("/api/projects").then(e=>e.json()).then(e=>{l(e),e.length>0?(o(e[0].root),C(e[0].root)):j(!1)}).catch(()=>j(!1))},[]),(0,n.useEffect)(()=>{if(!d)return;let e=new EventSource("/api/events");return k.current=e,e.onmessage=e=>{try{let t=JSON.parse(e.data);if("connected"===t.type)return;y(!0),setTimeout(()=>y(!1),2e3),["task_updated","decision_logged","memory_updated","session_start"].includes(t.type)&&C()}catch(e){}},()=>{e.close()}},[d,C]);let S=(0,n.useCallback)(async(e,t)=>{h(s=>{let a;if(!s)return s;let n=structuredClone(s);for(let s of Object.keys(n)){let r=n[s].findIndex(t=>t.id===e);-1!==r&&(a={...n[s][r],status:t},n[s]=n[s].filter(t=>t.id!==e))}return a&&n[t]&&(n[t]=[a,...n[t]]),n});try{await fetch("/api/tasks".concat(w),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e,status:t,actor:"human"})}),C()}catch(e){C()}},[w,C]),M=(0,n.useCallback)(async e=>{let t=await fetch("/api/docs".concat(w,"&read=").concat(encodeURIComponent(e)));N(await t.json()),s.push("/docs")},[w,s]);return(0,a.jsx)(c.Provider,{value:{projects:i,activeProject:d,summary:m,board:u,activity:p,liveIndicator:g,loading:b,selectedDoc:v,setSelectedDoc:N,rootParam:w,onProjectChange:function(e){o(e),C(e)},refresh:C,moveTask:S,openDoc:M},children:t})}},52284:function(e,t,s){"use strict";s.d(t,{cn:function(){return r}});var a=s(27494),n=s(724);function r(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,n.m6)((0,a.W)(t))}}},function(e){e.O(0,[490,4170,6842,1744],function(){return e(e.s=31852)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7409],{9329:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return n(75320)}])},75320:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}}),n(68848);let i=n(59533);n(31229);let o={fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},l={display:"inline-block"},r={display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},d={fontSize:14,fontWeight:400,lineHeight:"49px",margin:0};function s(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("title",{children:"404: This page could not be found."}),(0,i.jsx)("div",{style:o,children:(0,i.jsxs)("div",{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,i.jsx)("h1",{className:"next-error-h1",style:r,children:"404"}),(0,i.jsx)("div",{style:l,children:(0,i.jsx)("h2",{style:d,children:"This page could not be found."})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},function(e){e.O(0,[4170,6842,1744],function(){return e(e.s=9329)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3185],{71745:function(n,e,u){Promise.resolve().then(u.t.bind(u,61183,23))},61183:function(){}},function(n){n.O(0,[2126,4170,6842,1744],function(){return n(n.s=71745)}),_N_E=n.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1931],{90172:function(){}},function(n){n.O(0,[4170,6842,1744],function(){return n(n.s=90172)}),_N_E=n.O()}]);