@slycode/slycode 0.2.18 → 0.2.20

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 (85) hide show
  1. package/bin/sly-kanban.js +3 -3
  2. package/dist/bridge/claude-utils.d.ts +5 -0
  3. package/dist/bridge/claude-utils.js +8 -1
  4. package/dist/bridge/claude-utils.js.map +1 -1
  5. package/dist/bridge/pty-handler.js +24 -2
  6. package/dist/bridge/pty-handler.js.map +1 -1
  7. package/dist/data/scaffold-templates/mcp.json +1 -6
  8. package/dist/scripts/kanban.js +9 -3
  9. package/dist/web/.next/BUILD_ID +1 -1
  10. package/dist/web/.next/build-manifest.json +2 -2
  11. package/dist/web/.next/server/app/_global-error.html +2 -2
  12. package/dist/web/.next/server/app/_global-error.rsc +1 -1
  13. package/dist/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  14. package/dist/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  15. package/dist/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  16. package/dist/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  17. package/dist/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  18. package/dist/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/dist/web/.next/server/app/_not-found.html +1 -1
  20. package/dist/web/.next/server/app/_not-found.rsc +2 -2
  21. package/dist/web/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  22. package/dist/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  23. package/dist/web/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  24. package/dist/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  25. package/dist/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  26. package/dist/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  27. package/dist/web/.next/server/app/api/cli-assets/sync/route.js +3 -2
  28. package/dist/web/.next/server/app/api/cli-assets/sync/route.js.nft.json +1 -1
  29. package/dist/web/.next/server/app/page/react-loadable-manifest.json +1 -1
  30. package/dist/web/.next/server/app/page_client-reference-manifest.js +1 -1
  31. package/dist/web/.next/server/app/project/[id]/page/react-loadable-manifest.json +1 -1
  32. package/dist/web/.next/server/app/project/[id]/page_client-reference-manifest.js +1 -1
  33. package/dist/web/.next/server/chunks/[root-of-the-server]__12f6cd6f._.js +1 -1
  34. package/dist/web/.next/server/chunks/[root-of-the-server]__15fc9266._.js +1 -1
  35. package/dist/web/.next/server/chunks/[root-of-the-server]__279e9bf3._.js +1 -1
  36. package/dist/web/.next/server/chunks/[root-of-the-server]__2d1f0ed9._.js +1 -1
  37. package/dist/web/.next/server/chunks/[root-of-the-server]__3b9d3e43._.js +42 -23
  38. package/dist/web/.next/server/chunks/[root-of-the-server]__47dd878e._.js +1 -1
  39. package/dist/web/.next/server/chunks/[root-of-the-server]__5b8c9374._.js +3 -0
  40. package/dist/web/.next/server/chunks/[root-of-the-server]__5e08b942._.js +1 -1
  41. package/dist/web/.next/server/chunks/[root-of-the-server]__71bb3374._.js +1 -1
  42. package/dist/web/.next/server/chunks/[root-of-the-server]__7603305e._.js +1 -1
  43. package/dist/web/.next/server/chunks/[root-of-the-server]__7c476ad6._.js +1 -1
  44. package/dist/web/.next/server/chunks/[root-of-the-server]__846ca56f._.js +1 -1
  45. package/dist/web/.next/server/chunks/[root-of-the-server]__98d88050._.js +1 -1
  46. package/dist/web/.next/server/chunks/[root-of-the-server]__b273cc05._.js +1 -1
  47. package/dist/web/.next/server/chunks/[root-of-the-server]__d6362272._.js +1 -1
  48. package/dist/web/.next/server/chunks/[root-of-the-server]__de1277ee._.js +1 -1
  49. package/dist/web/.next/server/chunks/[root-of-the-server]__f3e501b6._.js +1 -1
  50. package/dist/web/.next/server/chunks/[root-of-the-server]__f97e93fa._.js +2 -2
  51. package/dist/web/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_234fda9c.js +3 -0
  52. package/dist/web/.next/server/chunks/src_lib_asset-scanner_ts_c599fd1c._.js +1 -1
  53. package/dist/web/.next/server/chunks/ssr/src_components_Dashboard_tsx_efc4dc27._.js +1 -1
  54. package/dist/web/.next/server/chunks/ssr/src_lib_registry_ts_2fc87c9c._.js +1 -1
  55. package/dist/web/.next/server/pages/404.html +1 -1
  56. package/dist/web/.next/server/pages/500.html +2 -2
  57. package/dist/web/.next/static/chunks/747f5e5f9dcf2621.css +1 -0
  58. package/dist/web/.next/static/chunks/{0a4b215957655f38.js → 7813de6392004c3f.js} +1 -1
  59. package/dist/web/.next/static/chunks/{c7a853519f3ebcb8.js → 94b526560cbd7bc0.js} +1 -1
  60. package/dist/web/.next/static/chunks/{e52d73ad4544e983.js → a199b72c0ad65aea.js} +1 -1
  61. package/dist/web/.next/static/chunks/f55f3c8c1a52f80c.js +1 -0
  62. package/dist/web/src/app/api/cli-assets/assistant/route.ts +30 -13
  63. package/dist/web/src/app/api/cli-assets/store/route.ts +5 -3
  64. package/dist/web/src/app/api/cli-assets/sync/route.ts +31 -1
  65. package/dist/web/src/app/api/file/route.ts +2 -1
  66. package/dist/web/src/components/AssetViewer.tsx +99 -0
  67. package/dist/web/src/components/CliAssetsTab.tsx +2 -2
  68. package/dist/web/src/components/StoreView.tsx +168 -61
  69. package/dist/web/src/components/Terminal.tsx +12 -0
  70. package/dist/web/src/lib/asset-scanner.ts +1 -1
  71. package/dist/web/src/lib/mcp-common.ts +76 -37
  72. package/dist/web/src/lib/provider-paths.ts +1 -1
  73. package/dist/web/src/lib/store-scanner.ts +1 -1
  74. package/dist/web/tsconfig.tsbuildinfo +1 -1
  75. package/lib/cli/update.d.ts.map +1 -1
  76. package/lib/cli/update.js +3 -0
  77. package/lib/cli/update.js.map +1 -1
  78. package/package.json +1 -1
  79. package/templates/kanban-seed.json +1 -1
  80. package/dist/web/.next/server/chunks/[root-of-the-server]__3c5ef8ec._.js +0 -3
  81. package/dist/web/.next/static/chunks/2744d72103f49934.css +0 -1
  82. package/dist/web/.next/static/chunks/e8b318caa49fce00.js +0 -1
  83. /package/dist/web/.next/static/{O_wqVAO7cnu-Tz0pWsDsk → tQdF18XbrwPnmXEMVlcfU}/_buildManifest.js +0 -0
  84. /package/dist/web/.next/static/{O_wqVAO7cnu-Tz0pWsDsk → tQdF18XbrwPnmXEMVlcfU}/_clientMiddlewareManifest.json +0 -0
  85. /package/dist/web/.next/static/{O_wqVAO7cnu-Tz0pWsDsk → tQdF18XbrwPnmXEMVlcfU}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58116,e=>{"use strict";var t=e.i(18050),s=e.i(71645),r=e.i(18566),d=e.i(21146),o=e.i(64103),a=e.i(84608),i=e.i(22016);let n={green:"bg-green-500",amber:"bg-amber-500",red:"bg-red-500"};function l({health:e,size:r="sm"}){let[d,o]=(0,s.useState)(!1);return e?(0,t.jsxs)("div",{className:"relative inline-flex",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[(0,t.jsx)("span",{className:`inline-block rounded-full ${"sm"===r?"h-2 w-2":"h-3 w-3"} ${n[e.level]}`,title:`Health: ${e.score}/100`}),d&&(0,t.jsxs)("div",{className:"absolute bottom-full left-1/2 z-50 mb-2 -translate-x-1/2 whitespace-nowrap rounded bg-void-800 px-3 py-2 text-xs text-void-200 shadow-(--shadow-overlay)",children:[(0,t.jsxs)("div",{className:"mb-1 font-medium",children:["Health: ",e.score,"/100 (",e.level,")"]}),e.factors.map(e=>(0,t.jsxs)("div",{className:"text-void-400",children:[e.name,": ",e.value,"/",e.maxValue]},e.name)),(0,t.jsx)("div",{className:"absolute left-1/2 top-full -translate-x-1/2 border-4 border-transparent border-t-void-800"})]})]}):null}let c={claude:{label:"Claude",bg:"bg-blue-100 dark:bg-blue-900/40",text:"text-blue-700 dark:text-blue-300"},gemini:{label:"Gemini",bg:"bg-purple-100 dark:bg-purple-900/40",text:"text-purple-700 dark:text-purple-300"},codex:{label:"Codex",bg:"bg-emerald-100 dark:bg-emerald-900/40",text:"text-emerald-700 dark:text-emerald-300"}};function x({platforms:e}){if(!e)return null;let s=Object.entries(e).filter(([,e])=>e);return 0===s.length?null:(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:s.map(([e])=>{let s=c[e];return(0,t.jsx)("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${s.bg} ${s.text}`,children:s.label},e)})})}function m({project:e,onDeleted:r,shortcutKey:d,onDragStart:o,onDragEnd:a}){let[n,c]=(0,s.useState)(!1),[m,p]=(0,s.useState)(!1),[u,h]=(0,s.useState)(e.name),[v,b]=(0,s.useState)(e.description),[f,g]=(0,s.useState)(e.path),[j,k]=(0,s.useState)(e.tags.join(", ")),[N,y]=(0,s.useState)(!1),[w,C]=(0,s.useState)(!1),S=e.assets?.skills.length??0,L=e.assets?.agents.length??0;async function $(){y(!0);try{let t=j.split(",").map(e=>e.trim()).filter(Boolean);(await fetch(`/api/projects/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:u.trim(),description:v.trim(),path:f.trim(),tags:t})})).ok&&(c(!1),r?.())}catch{}y(!1)}async function T(){C(!0);try{(await fetch(`/api/projects/${e.id}`,{method:"DELETE"})).ok&&(p(!1),r?.())}catch{}C(!1)}function I(e,t){e.preventDefault(),e.stopPropagation(),t()}let M=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)("h3",{className:"truncate font-semibold text-void-950 dark:text-void-100",children:e.name}),(0,t.jsx)(l,{health:e.healthScore})]}),(0,t.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-1",children:[e.masterCompliant&&(0,t.jsx)("span",{className:"rounded border border-green-500/20 bg-green-500/10 px-2 py-0.5 text-xs font-medium text-green-700 dark:text-green-400",children:"Compliant"}),(0,t.jsx)("button",{onClick:e=>I(e,()=>c(!0)),className:"rounded p-1 text-void-400 hover:bg-void-200 hover:text-void-600 dark:hover:bg-void-700 dark:hover:text-void-200",title:"Edit project",children:(0,t.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})})}),(0,t.jsx)("button",{onClick:e=>I(e,()=>p(!0)),className:"rounded p-1 text-void-400 hover:bg-red-100 hover:text-red-600 dark:hover:bg-red-900/50 dark:hover:text-red-400",title:"Remove project",children:(0,t.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,t.jsx)("p",{className:"mb-2 text-sm text-void-500 dark:text-void-400",children:e.description}),(0,t.jsx)(x,{platforms:e.platforms}),!e.accessible&&(0,t.jsx)("div",{className:"mt-2 rounded border border-red-500/20 bg-red-500/5 p-2 text-sm text-red-700 dark:text-red-300",children:e.error}),e.accessible&&(0,t.jsxs)(t.Fragment,{children:[S+L>0&&(0,t.jsxs)("div",{className:"mt-1.5 text-xs text-void-500 dark:text-void-400",children:[S>0&&(0,t.jsxs)("span",{children:[S," skill",1!==S?"s":""]}),S>0&&L>0&&(0,t.jsx)("span",{children:" / "}),L>0&&(0,t.jsxs)("span",{children:[L," agent",1!==L?"s":""]})]}),void 0!==e.gitUncommitted&&e.gitUncommitted>0&&(0,t.jsxs)("div",{className:"mt-1.5 text-xs text-neon-orange-500 dark:text-neon-orange-400",children:[e.gitUncommitted," uncommitted"]})]}),e.tags.length>0&&(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-1",children:e.tags.map(e=>(0,t.jsx)("span",{className:"rounded border border-void-200 bg-void-100 px-2 py-0.5 text-xs text-void-500 dark:border-void-600 dark:bg-void-800 dark:text-void-400",children:e},e))}),e.accessible&&e.areas.length>0&&(0,t.jsxs)("div",{className:"mt-3 border-t border-void-100 pt-3 dark:border-void-700",children:[(0,t.jsx)("p",{className:"mb-1 text-xs font-medium text-void-500 dark:text-void-500",children:"Areas"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:e.areas.map(e=>(0,t.jsx)("span",{className:"rounded border border-neon-blue-400/12 bg-neon-blue-400/8 px-2 py-0.5 text-xs text-neon-blue-600 dark:text-neon-blue-400/70",children:e},e))})]})]}),A=(e.activeSessions??0)>0,D=`block h-full rounded-xl border p-4 transition-all duration-200 hover:-translate-y-0.5 hover:shadow-[0_0_20px_-5px_rgba(0,191,255,0.1)] ${A?"active-glow-card":""}`;return(0,t.jsxs)(t.Fragment,{children:[e.accessible?(0,t.jsxs)(i.default,{href:`/project/${e.id}`,draggable:!0,onDragStart:t=>{t.dataTransfer.setData("text/plain",e.id),t.dataTransfer.effectAllowed="move",o?.()},onDragEnd:()=>{a?.()},className:`${D} relative cursor-pointer border-void-200 bg-white shadow-(--shadow-card) hover:border-neon-blue-400/40 hover:shadow-[0_8px_30px_rgba(0,0,0,0.18)] dark:hover:shadow-[0_8px_30px_rgba(0,0,0,0.7)] dark:border-void-700 dark:bg-void-800 dark:hover:border-neon-blue-400/30`,children:[void 0!==d&&(0,t.jsx)("span",{className:"absolute bottom-2 right-2 flex h-5 w-5 items-center justify-center rounded border border-neon-blue-400/15 bg-neon-blue-400/10 font-mono text-xs text-neon-blue-500 dark:text-neon-blue-400",children:d}),M]}):(0,t.jsx)("div",{className:`${D} border-red-500/20 bg-red-500/5 dark:border-red-500/20 dark:bg-red-500/5`,children:M}),n&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:(0,t.jsxs)("div",{className:"mx-4 w-full max-w-md rounded-lg border border-void-700 bg-void-900 p-6 shadow-(--shadow-overlay)",children:[(0,t.jsx)("h3",{className:"mb-4 text-lg font-semibold text-void-100",children:"Edit Project"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-sm text-void-300",children:"Name"}),(0,t.jsx)("input",{type:"text",value:u,onChange:e=>h(e.target.value),className:"w-full rounded border border-void-700 bg-void-800 px-3 py-2 text-sm text-void-100 focus:border-neon-blue-400 focus:outline-none"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-sm text-void-300",children:"Description"}),(0,t.jsx)("textarea",{value:v,onChange:e=>b(e.target.value),rows:2,className:"w-full rounded border border-void-700 bg-void-800 px-3 py-2 text-sm text-void-100 focus:border-neon-blue-400 focus:outline-none"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-sm text-void-300",children:"Path"}),(0,t.jsx)("input",{type:"text",value:f,onChange:e=>g(e.target.value),className:"w-full rounded border border-void-700 bg-void-800 px-3 py-2 font-mono text-sm text-void-100 focus:border-neon-blue-400 focus:outline-none"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-void-500",children:"Repoints registry only — files are not moved."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-sm text-void-300",children:"Tags"}),(0,t.jsx)("input",{type:"text",value:j,onChange:e=>k(e.target.value),className:"w-full rounded border border-void-700 bg-void-800 px-3 py-2 text-sm text-void-100 focus:border-neon-blue-400 focus:outline-none"})]})]}),(0,t.jsxs)("div",{className:"mt-4 flex justify-end gap-2",children:[(0,t.jsx)("button",{onClick:()=>c(!1),className:"rounded px-4 py-2 text-sm text-void-400 hover:text-void-200",children:"Cancel"}),(0,t.jsx)("button",{onClick:$,disabled:N,className:"rounded bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-500 disabled:opacity-50",children:N?"Saving...":"Save"})]})]})}),m&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:(0,t.jsxs)("div",{className:"mx-4 w-full max-w-sm rounded-lg border border-void-700 bg-void-900 p-6 shadow-(--shadow-overlay)",children:[(0,t.jsx)("h3",{className:"mb-2 text-lg font-semibold text-void-100",children:"Remove Project"}),(0,t.jsxs)("p",{className:"mb-4 text-sm text-void-400",children:["This will remove ",(0,t.jsx)("strong",{className:"text-void-200",children:e.name})," from Code Den. Project files will not be deleted."]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)("button",{onClick:()=>p(!1),className:"rounded px-4 py-2 text-sm text-void-400 hover:text-void-200",children:"Cancel"}),(0,t.jsx)("button",{onClick:T,disabled:w,className:"rounded bg-red-600 px-4 py-2 text-sm font-medium text-white hover:bg-red-500 disabled:opacity-50",children:w?"Removing...":"Remove"})]})]})})]})}var p=e.i(82721);let u=[{id:"claude",name:"Claude",filename:"CLAUDE.md",description:"Anthropic Claude Code",color:"neon-blue"},{id:"codex",name:"Codex",filename:"AGENTS.md",description:"OpenAI Codex CLI",color:"emerald"},{id:"gemini",name:"Gemini",filename:"GEMINI.md",description:"Google Gemini CLI",color:"amber"}];function h({open:e,onClose:r,onCreated:d}){let o,a,i,[n,l]=(0,s.useState)("details"),[c,x]=(0,s.useState)(""),[m,p]=(0,s.useState)(""),[h,v]=(0,s.useState)(""),[b,f]=(0,s.useState)(""),[g,j]=(0,s.useState)(""),[k,N]=(0,s.useState)(!1),[y,w]=(0,s.useState)(null),[C,S]=(0,s.useState)({}),[L,$]=(0,s.useState)(["claude"]),[T,I]=(0,s.useState)({}),[M,A]=(0,s.useState)(null);function D(){l("details"),x(""),p(""),v(""),f(""),j(""),N(!1),w(null),S({}),$(["claude"]),I({}),A(null),r()}async function P(){if(0===L.length)return void j("Select at least one provider");j(""),N(!0);try{let e=await fetch("/api/projects/analyze",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:h.trim(),providers:L})}),t=await e.json();if(!e.ok){j(t.error||"Analysis failed"),N(!1);return}w(t);let s={};for(let e of t.items)"missing"===e.status?s[e.path]="create":s[e.path]="skip";S(s);let r=!t.exists||t.empty,d={};for(let e of t.groups){let t=e.items.some(e=>"missing"===e.status);d[e.id]=!r&&t}I(d),l("review")}catch{j("Failed to analyze directory")}N(!1)}async function _(){l("creating"),j("");try{let e=b.split(",").map(e=>e.trim()).filter(Boolean),t=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c.trim(),description:m.trim(),path:h.trim(),tags:e,providers:L,scaffoldConfig:{items:C}})}),s=await t.json();if(!t.ok){j(s.error||"Failed to create project"),l("review");return}A(s),l("summary"),d()}catch{j("Failed to create project"),l("review")}}if((0,s.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&"creating"!==n&&(e.stopImmediatePropagation(),D())};return document.addEventListener("keydown",t,!0),()=>document.removeEventListener("keydown",t,!0)},[e,n]),!e)return null;let O=y&&(!y.exists||y.empty),E=[{key:"details",label:"Details"},{key:"providers",label:"Providers"},{key:"review",label:"Review"}],V=E.findIndex(e=>e.key===n);return(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:(0,t.jsxs)("div",{className:"mx-4 max-h-[80vh] w-full max-w-lg overflow-y-auto rounded-lg border border-void-700 bg-void-850 p-6 shadow-(--shadow-overlay)",children:[(0,t.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-void-100",children:"summary"===n?"Project Created":"Add Project"}),(0,t.jsx)("button",{onClick:D,className:"rounded p-1 text-void-400 hover:bg-void-800 hover:text-void-200",children:"×"})]}),V>=0&&(0,t.jsx)("div",{className:"mb-4 flex items-center gap-2",children:E.map((e,s)=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:`flex h-6 w-6 items-center justify-center rounded-full text-xs font-medium ${s<=V?"bg-blue-600 text-white":"bg-void-700 text-void-500"}`,children:s+1}),(0,t.jsx)("span",{className:`text-xs ${s<=V?"text-void-200":"text-void-500"}`,children:e.label}),s<E.length-1&&(0,t.jsx)("div",{className:`h-px w-4 ${s<V?"bg-blue-600":"bg-void-700"}`})]},e.key))}),g&&(0,t.jsx)("div",{className:"mb-4 rounded bg-red-900/50 p-3 text-sm text-red-300",children:g}),"details"===n&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"mb-1 block text-sm font-medium text-void-300",children:["Project Name ",(0,t.jsx)("span",{className:"text-red-400",children:"*"})]}),(0,t.jsx)("input",{type:"text",value:c,onChange:e=>x(e.target.value),placeholder:"My Project",className:"w-full rounded border border-void-700 bg-void-800 px-3 py-2 text-sm text-void-100 placeholder-void-500 focus:border-neon-blue-400 focus:outline-none","data-voice-target":!0})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-sm font-medium text-void-300",children:"Description"}),(0,t.jsx)("textarea",{value:m,onChange:e=>p(e.target.value),placeholder:"What is this project about?",rows:2,className:"w-full rounded border border-void-700 bg-void-800 px-3 py-2 text-sm text-void-100 placeholder-void-500 focus:border-neon-blue-400 focus:outline-none","data-voice-target":!0})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"mb-1 block text-sm font-medium text-void-300",children:["Directory Path ",(0,t.jsx)("span",{className:"text-red-400",children:"*"})]}),(0,t.jsx)("input",{type:"text",value:h,onChange:e=>v(e.target.value),placeholder:"/home/user/projects/my-project",className:"w-full rounded border border-void-700 bg-void-800 px-3 py-2 font-mono text-sm text-void-100 placeholder-void-500 focus:border-neon-blue-400 focus:outline-none","data-voice-target":!0}),(0,t.jsx)("p",{className:"mt-1 text-xs text-void-500",children:"Absolute path. Will be created if it doesn't exist."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-sm font-medium text-void-300",children:"Tags"}),(0,t.jsx)("input",{type:"text",value:b,onChange:e=>f(e.target.value),placeholder:"python, web, api (comma-separated)",className:"w-full rounded border border-void-700 bg-void-800 px-3 py-2 text-sm text-void-100 placeholder-void-500 focus:border-neon-blue-400 focus:outline-none","data-voice-target":!0})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)("button",{onClick:D,className:"rounded px-4 py-2 text-sm text-void-400 hover:text-void-200",children:"Cancel"}),(0,t.jsx)("button",{onClick:function(){c.trim()&&h.trim()?(j(""),l("providers")):j("Name and path are required")},className:"rounded bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-500",children:"Next"})]})]}),"providers"===n&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("p",{className:"text-sm text-void-400",children:"Which AI coding agents will you use with this project?"}),(0,t.jsx)("div",{className:"space-y-2",children:u.map(e=>{let s=L.includes(e.id);return(0,t.jsxs)("button",{onClick:()=>{var t;return t=e.id,void $(e=>e.includes(t)?1===e.length?e:e.filter(e=>e!==t):[...e,t])},className:`flex w-full items-center gap-3 rounded-lg border p-3 text-left transition-colors ${s?"border-blue-500/50 bg-blue-600/10":"border-void-700 bg-void-800/50 hover:border-void-600"}`,children:[(0,t.jsx)("div",{className:`flex h-5 w-5 flex-shrink-0 items-center justify-center rounded border ${s?"border-blue-500 bg-blue-600 text-white":"border-void-600 bg-void-800"}`,children:s&&(0,t.jsx)("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-void-100",children:e.name}),(0,t.jsx)("span",{className:"rounded bg-void-700 px-1.5 py-0.5 font-mono text-xs text-void-400",children:e.filename})]}),(0,t.jsx)("span",{className:"text-xs text-void-500",children:e.description})]})]},e.id)})}),(0,t.jsx)("p",{className:"text-xs text-void-500",children:"Each selected provider gets its own instruction file with shared project conventions and provider-specific tips."}),(0,t.jsxs)("div",{className:"flex justify-between pt-2",children:[(0,t.jsx)("button",{onClick:()=>l("details"),className:"rounded px-4 py-2 text-sm text-void-400 hover:text-void-200",children:"Back"}),(0,t.jsx)("button",{onClick:P,disabled:k,className:"rounded bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-500 disabled:opacity-50",children:k?"Analyzing...":"Next"})]})]}),"review"===n&&y&&(0,t.jsxs)("div",{className:"space-y-4",children:[O?(0,t.jsx)("div",{className:"rounded border border-void-700 bg-void-800/50 p-3",children:(0,t.jsx)("p",{className:"text-sm text-void-300",children:y.exists?"Directory is empty — full scaffolding will be applied.":"Directory does not exist — it will be created with full scaffolding."})}):(0,t.jsx)("p",{className:"text-sm text-void-400",children:"Existing project detected. Review what will be added:"}),(0,t.jsx)("div",{className:"space-y-2",children:y.groups.map(e=>{let s=T[e.id]??!1,r=e.items.filter(e=>"missing"===e.status).length,d=e.items.filter(e=>"present"===e.status).length,o=e.items.filter(e=>"missing"===e.status&&"skip"!==C[e.path]).length;return(0,t.jsxs)("div",{className:"overflow-hidden rounded border border-void-700 bg-void-800/30",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2",children:[(0,t.jsxs)("button",{onClick:()=>{var t;return t=e.id,void I(e=>({...e,[t]:!e[t]}))},className:"flex min-w-0 flex-1 items-center gap-2 text-left",children:[(0,t.jsx)("svg",{className:`h-3 w-3 flex-shrink-0 text-void-500 transition-transform ${s?"rotate-90":""}`,fill:"currentColor",viewBox:"0 0 20 20",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-void-200",children:e.name}),(0,t.jsxs)("span",{className:"ml-2 text-xs text-void-500",children:[e.items.length," items"]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[d>0&&(0,t.jsxs)("span",{className:"rounded-full bg-green-900/30 px-2 py-0.5 text-xs text-green-400",children:[d," ok"]}),r>0&&(0,t.jsxs)("span",{className:"rounded-full bg-blue-900/30 px-2 py-0.5 text-xs text-blue-400",children:[r," new"]}),r>0&&!O&&(0,t.jsx)("button",{onClick:()=>(function(e){if(!y)return;let t=y.groups.find(t=>t.id===e);if(!t)return;let s=t.items.filter(e=>"missing"===e.status);if(0===s.length)return;let r=s.every(e=>"create"===C[e.path]);S(e=>{let t={...e};for(let e of s)t[e.path]=r?"skip":"create";return t})})(e.id),className:`rounded px-2 py-0.5 text-xs font-medium ${o===r?"bg-blue-600/20 text-blue-400":0===o?"bg-void-700 text-void-400":"bg-blue-600/10 text-blue-400"}`,children:o===r?"All":0===o?"None":`${o}/${r}`})]})]}),s&&(0,t.jsx)("div",{className:"border-t border-void-700/50 px-3 py-1.5",children:(0,t.jsx)("p",{className:"text-xs text-void-500",children:e.description})}),s&&(0,t.jsx)("div",{className:"border-t border-void-700/50",children:[...e.items].sort((e,t)=>!!t.essential-!!e.essential).map(e=>{let s=C[e.path]||"skip",r="missing"===e.status,d="present"===e.status,o=d&&!1===e.match;return(0,t.jsxs)("div",{className:`flex flex-col border-b border-void-700/30 px-3 py-1.5 last:border-0 ${e.essential?"bg-amber-900/10":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[r&&(0,t.jsx)("span",{className:"flex-shrink-0 text-blue-400",title:"Will be created",children:"+"}),d&&(0,t.jsx)("span",{className:"flex-shrink-0 text-green-400",title:o?`Local: ${e.localVersion}, Store: ${e.masterVersion}`:"Up to date",children:"✓"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-void-300",children:e.path}),e.essential&&(0,t.jsx)("span",{className:"flex-shrink-0 rounded-full bg-amber-500/20 px-1.5 py-0.5 text-[10px] font-medium text-amber-400",children:"Required"}),o&&(0,t.jsxs)("span",{className:"flex-shrink-0 text-xs text-void-600",children:["v",e.localVersion]})]}),r&&(0,t.jsx)("button",{onClick:()=>{var t;return t=e.path,void S(e=>{let s=e[t];return"skip"===s?{...e,[t]:"create"}:"create"===s?{...e,[t]:"skip"}:e})},className:`flex-shrink-0 rounded px-2 py-0.5 text-xs font-medium ${"skip"===s?"bg-void-700 text-void-400":"bg-blue-600/20 text-blue-400"}`,children:"skip"===s?"Skip":"Create"})]}),e.essential&&r&&"skip"===s&&(0,t.jsx)("p",{className:"mt-1 text-[11px] text-amber-400/80",children:"SlyCode requires this skill to function properly."}),e.essential&&d&&(0,t.jsx)("p",{className:"mt-1 text-[11px] text-void-500",children:"Exists — will be kept. Updates are managed via CLI Assets."})]},e.path)})})]},e.id)})}),y.items.some(e=>e.essential&&"missing"===e.status&&"skip"===C[e.path])&&(0,t.jsxs)("div",{className:"rounded border border-amber-500/30 bg-amber-500/10 px-3 py-2",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-amber-400",children:"Essential skills skipped"}),(0,t.jsx)("p",{className:"mt-0.5 text-[11px] text-amber-400/70",children:"Kanban and messaging skills are required for SlyCode's core functionality (card management, Telegram integration). The project will scaffold but some features won't work."})]}),(0,t.jsxs)("div",{className:"flex justify-between pt-2",children:[(0,t.jsx)("button",{onClick:()=>l("providers"),className:"rounded px-4 py-2 text-sm text-void-400 hover:text-void-200",children:"Back"}),(0,t.jsx)("button",{onClick:_,className:"rounded bg-green-600 px-4 py-2 text-sm font-medium text-white hover:bg-green-500",children:"Create Project"})]})]}),"creating"===n&&(0,t.jsxs)("div",{className:"py-8 text-center",children:[(0,t.jsx)("div",{className:"mx-auto mb-3 h-8 w-8 animate-spin rounded-full border-2 border-void-600 border-t-neon-blue-400"}),(0,t.jsx)("p",{className:"text-sm text-void-400",children:"Scaffolding project..."})]}),"summary"===n&&M&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"rounded border border-green-800 bg-green-900/30 p-4",children:(0,t.jsxs)("p",{className:"font-medium text-green-300",children:['Project "',c,'" created successfully!']})}),(a=(o=M.scaffold?.results||[]).filter(e=>"created"===e.action||"copied"===e.action||"initialized"===e.action),i=o.filter(e=>"skipped"===e.action),(0,t.jsxs)("div",{className:"space-y-3",children:[a.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"mb-1 text-xs font-medium text-green-400",children:["Created (",a.length,")"]}),(0,t.jsx)("div",{className:"rounded border border-void-700 bg-void-800/30",children:a.map((e,s)=>(0,t.jsxs)("div",{className:"border-b border-void-700/30 px-3 py-1 last:border-0",children:[(0,t.jsx)("span",{className:"font-mono text-xs text-void-300",children:e.path}),null!=e.count&&(0,t.jsxs)("span",{className:"ml-2 text-xs text-void-500",children:["(",e.count," items)"]}),null!=e.seedCards&&(0,t.jsxs)("span",{className:"ml-2 text-xs text-void-500",children:["(",e.seedCards," seed cards)"]})]},s))})]}),i.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"mb-1 text-xs font-medium text-void-500",children:["Skipped (",i.length,")"]}),(0,t.jsx)("div",{className:"rounded border border-void-700/50 bg-void-800/20",children:i.map((e,s)=>(0,t.jsx)("div",{className:"border-b border-void-700/30 px-3 py-1 last:border-0",children:(0,t.jsx)("span",{className:"font-mono text-xs text-void-500",children:e.path})},s))})]})]})),(0,t.jsxs)("div",{className:"rounded border border-void-700 bg-void-800/30 p-3",children:[(0,t.jsx)("p",{className:"mb-2 text-xs font-medium text-void-300",children:"Next steps:"}),(0,t.jsxs)("ul",{className:"space-y-1 text-xs text-void-400",children:[(0,t.jsx)("li",{children:"• Navigate to the project to pick up your setup cards"}),(0,t.jsxs)("li",{children:["• Customize your"," ",L.map(e=>{let t=u.find(t=>t.id===e);return t?.filename}).filter(Boolean).join(", ")," ","with project-specific details"]}),(0,t.jsx)("li",{children:"• Run context-priming to initialize area references"})]})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)("button",{onClick:D,className:"rounded bg-void-700 px-4 py-2 text-sm font-medium text-void-200 hover:bg-void-600",children:"Close"})})]})]})})}var v=e.i(79951),b=e.i(5903),f=e.i(9308);let g={skill:"bg-purple-100 text-purple-700 dark:bg-purple-900/40 dark:text-purple-300",agent:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300",mcp:"bg-orange-100 text-orange-700 dark:bg-orange-900/40 dark:text-orange-300"};function j({asset:e,projectId:r,pathPrefix:d,onClose:o}){let[a,i]=(0,s.useState)(null),[n,l]=(0,s.useState)(!0);(0,s.useEffect)(()=>{!async function(){try{let t=(d??".claude/")+e.path,s=new URLSearchParams({path:t});r&&s.set("projectId",r);let o=await fetch(`/api/file?${s}`);if(o.ok){let e=await o.json();i(e.content)}else i("Failed to load asset content.")}catch{i("Failed to load asset content.")}l(!1)}()},[e.path]),(0,s.useEffect)(()=>{function e(e){"Escape"===e.key&&o()}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]);let c=a?function(e){if(!e.startsWith("---"))return e;let t=e.indexOf("---",3);return -1===t?e:e.slice(t+3).trimStart()}(a):"";return(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:e=>{e.target===e.currentTarget&&o()},children:(0,t.jsxs)("div",{className:"mx-4 flex max-h-[80vh] w-full max-w-2xl flex-col overflow-hidden rounded-lg border border-void-700 bg-void-850 shadow-(--shadow-overlay)",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-void-700 px-5 py-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold text-void-100",children:e.name}),(0,t.jsx)("span",{className:`rounded px-2 py-0.5 text-xs font-medium ${g[e.type]}`,children:e.type})]}),(0,t.jsx)("button",{onClick:o,className:"rounded p-1 text-void-400 hover:bg-void-800 hover:text-void-200",children:(0,t.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,t.jsx)("div",{className:"border-b border-void-800 px-5 py-3",children:e.frontmatter?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs",children:["version","updated","description"].map(s=>{let r=e.frontmatter?.[s];return(0,t.jsxs)("span",{className:r?"text-void-300":"version"===s?"text-red-400":"text-amber-400",children:[(0,t.jsxs)("span",{className:"text-void-500",children:[s,":"]})," ",r?"description"===s&&String(r).length>60?String(r).slice(0,60)+"...":String(r):(0,t.jsx)("span",{className:"italic",children:"missing"})]},s)})}),Object.keys(e.frontmatter).filter(e=>!["name","version","updated","description","converted_from"].includes(e)).length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-void-500",children:Object.entries(e.frontmatter).filter(([e])=>!["name","version","updated","description","converted_from"].includes(e)).map(([e,s])=>(0,t.jsxs)("span",{children:[e,": ",(0,t.jsx)("span",{className:"text-void-400",children:String(s)})]},e))})]}):(0,t.jsx)("span",{className:"text-xs text-red-400",children:"No frontmatter found"})}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:n?(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsx)("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-void-600 border-t-neon-blue-400"})}):(0,t.jsx)(f.MarkdownContent,{children:c})})]})})}let k={skill:"bg-purple-100 text-purple-700 dark:bg-purple-900/40 dark:text-purple-300",agent:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300"},N={current:{icon:"✓",color:"text-green-500"},outdated:{icon:"⚠",color:"text-amber-500"},missing:{icon:"✕",color:"text-void-400"}};function y(e,t){if(!e||!t)return 0;let s=e.split(".").map(Number),r=t.split(".").map(Number);for(let e=0;e<Math.max(s.length,r.length);e++){let t=s[e]||0,d=r[e]||0;if(t>d)return 1;if(t<d)return -1}return 0}function w(e,t,s,r){return e.find(e=>e.assetName===t&&e.assetType===s&&e.projectId===r)}function C({rows:e,projects:r,pendingChanges:d,onQueueChange:o,onImport:a,onFix:i,ignoredAssets:n,ignoreKeyFn:l,onIgnore:c,onUnignore:x}){let[m,p]=(0,s.useState)(null),[u,h]=(0,s.useState)(void 0);return 0===e.length?(0,t.jsx)("p",{className:"py-4 text-center text-sm text-void-500 dark:text-void-400",children:"No assets found"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-void-200 dark:border-void-700",children:[(0,t.jsx)("th",{className:"sticky left-0 z-10 bg-white px-3 py-2 text-left text-xs font-medium text-void-500 dark:bg-void-850 dark:text-void-400",children:"Asset"}),r.map(e=>(0,t.jsx)("th",{className:"px-3 py-2 text-center text-xs font-medium text-void-500 dark:text-void-400",children:e.name},e.id))]})}),(0,t.jsx)("tbody",{children:e.map(e=>{let s=e.isImported,r=!!n&&!!l&&n.has(l(e.name,e.type)),m=s?e.cells.filter(e=>"outdated"===e.status&&y(e.projectVersion,e.masterVersion)>0):[],u=m.length>0;return(0,t.jsxs)("tr",{className:`border-b border-void-100 dark:border-void-800 ${r?"opacity-40":!e.masterAsset.isValid&&s?"opacity-60":""}`,children:[(0,t.jsx)("td",{className:"sticky left-0 z-10 bg-white dark:bg-void-850",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2",children:[s?(0,t.jsx)("button",{onClick:()=>{h(void 0),p(e)},className:"text-left font-medium text-void-900 hover:text-blue-600 dark:text-void-100 dark:hover:text-blue-400",children:e.name}):(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{onClick:()=>{let t=e.cells.find(e=>"missing"!==e.status);h(t?.projectId),p(e)},className:"text-left font-medium text-void-600 hover:text-blue-600 dark:text-void-400 dark:hover:text-blue-400",children:e.name}),(0,t.jsx)("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${k[e.type]}`,children:e.type})]}),!e.masterAsset.isValid&&s&&(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"cursor-help text-amber-500",title:"Frontmatter missing required fields (name, version, updated, description)",children:"⚠"}),i&&(0,t.jsx)("button",{onClick:()=>i(e.name,e.type),className:"rounded border border-amber-400/30 bg-amber-400/10 px-1.5 py-0.5 text-[10px] font-medium text-amber-500 hover:bg-amber-400/20",children:"Fix"})]}),u&&a&&(0,t.jsxs)("button",{onClick:()=>{let t=[...m].sort((e,t)=>y(t.projectVersion,e.projectVersion))[0];a(e.name,e.type,t.projectId)},className:"rounded border border-blue-400/30 bg-blue-400/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-500 hover:bg-blue-400/20 dark:border-blue-400/30 dark:bg-blue-400/10 dark:text-blue-400 dark:hover:bg-blue-400/20",title:`Project v${m[0].projectVersion} is newer than store v${m[0].masterVersion}`,children:["↑"," Update Store"]}),(0,t.jsx)("div",{className:"flex-1"}),!s&&c&&x&&l&&n&&(n.has(l(e.name,e.type))?(0,t.jsx)("button",{onClick:()=>x(e.name,e.type),className:"rounded-md border border-void-300 bg-void-100 px-3 py-1 text-xs font-medium text-void-500 hover:bg-void-200 dark:border-void-700 dark:bg-void-800 dark:text-void-400 dark:hover:bg-void-700",children:"Unignore"}):(0,t.jsx)("button",{onClick:()=>c(e.name,e.type),className:"rounded-md border border-void-300 bg-void-50 px-3 py-1 text-xs font-medium text-void-400 hover:bg-void-100 dark:border-void-700 dark:bg-void-800/50 dark:text-void-500 dark:hover:bg-void-700",title:"Hide from Not in Store",children:"Ignore"})),!s&&a&&(0,t.jsx)("button",{onClick:()=>{let t=e.cells.find(e=>"missing"!==e.status);t&&a(e.name,e.type,t.projectId)},className:"rounded-md border border-purple-300 bg-purple-50 px-3 py-1 text-xs font-medium text-purple-700 hover:bg-purple-100 dark:border-purple-700 dark:bg-purple-900/30 dark:text-purple-300 dark:hover:bg-purple-900/50",children:"Import to Store"})]})}),e.cells.map(s=>{let r=w(d,e.name,e.type,s.projectId),a="outdated"===s.status&&y(s.projectVersion,s.masterVersion)>0,{icon:i,color:n}=a?{icon:"↑",color:"text-blue-500"}:N[s.status],l="";r?.action==="deploy"?l="bg-green-50 dark:bg-green-900/20":r?.action==="remove"&&(l="bg-red-50 dark:bg-red-900/20");let c="missing"===s.status?"Not installed":"current"===s.status?`Up to date (v${s.masterVersion||"?"})`:a?`Project v${s.projectVersion} is newer than store v${s.masterVersion}`:`Store: ${s.masterVersion||"?"} | Project: ${s.projectVersion||"?"}`;return(0,t.jsx)("td",{className:`px-3 py-2 text-center ${l}`,title:r?`Pending: ${r.action}`:c,children:(0,t.jsx)("button",{onClick:()=>{var t,r;let a;return t=s.projectId,r=s.status,void((a=w(d,e.name,e.type,t))?o(a):!(s&&"outdated"===r&&y(s.projectVersion,s.masterVersion)>0)&&("outdated"===r||"missing"===r)&&o({assetName:e.name,assetType:e.type,projectId:t,action:"deploy"}))},onContextMenu:t=>{var r,a;let i;return r=s.projectId,a=s.status,t.preventDefault(),void((i=w(d,e.name,e.type,r))?o(i):("current"===a||"outdated"===a)&&o({assetName:e.name,assetType:e.type,projectId:r,action:"remove"}))},className:`inline-flex h-7 w-7 items-center justify-center rounded transition-colors hover:bg-void-100 dark:hover:bg-void-800 ${r?.action==="remove"?"line-through text-red-500":n}`,children:r?.action==="deploy"?(0,t.jsx)("span",{className:"text-green-500",children:"↑"}):r?.action==="remove"?(0,t.jsx)("span",{className:"text-red-500",children:"✕"}):i})},s.projectId)})]},`${e.type}-${e.name}`)})})]})}),m&&(0,t.jsx)(j,{asset:m.masterAsset,projectId:u,onClose:()=>{p(null),h(void 0)}})]})}let S={skill:"bg-purple-100 text-purple-700 dark:bg-purple-900/40 dark:text-purple-300",agent:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300",mcp:"bg-orange-100 text-orange-700 dark:bg-orange-900/40 dark:text-orange-300"};function L({data:e,onFix:r,onAssistant:d,onRefresh:o}){let[a,i]=(0,s.useState)(null),[n,l]=(0,s.useState)(null),[c,x]=(0,s.useState)(!1),[m,p]=(0,s.useState)({skills:!0,agents:!0,mcp:!0});function u(e){p(t=>({...t,[e]:!t[e]}))}async function h(e,t){x(!0);try{(await fetch("/api/cli-assets/store",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({assetType:t,assetName:e})})).ok&&o?.()}catch{}x(!1),l(null)}let v=[{key:"skills",label:"Skills",assets:e.skills},{key:"agents",label:"Agents",assets:e.agents}];return(0,t.jsxs)("div",{className:"space-y-4",children:[v.map(({key:e,label:s,assets:o})=>(0,t.jsxs)("div",{className:"rounded-lg border border-void-200 bg-white shadow-(--shadow-card) dark:border-void-700 dark:bg-void-850",children:[(0,t.jsxs)("button",{onClick:()=>u(e),className:"flex w-full items-center justify-between px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-void-900 dark:text-void-100",children:s}),(0,t.jsx)("span",{className:"rounded-full bg-void-100 px-2 py-0.5 text-xs text-void-600 dark:bg-void-700 dark:text-void-300",children:o.length})]}),(0,t.jsx)("svg",{className:`h-4 w-4 text-void-400 transition-transform ${m[e]?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),m[e]&&o.length>0&&(0,t.jsx)("div",{className:"border-t border-void-100 dark:border-void-700",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-void-200 dark:border-void-700",children:[(0,t.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-void-500 dark:text-void-400",children:"Asset"}),(0,t.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-void-500 dark:text-void-400",children:"Version"}),(0,t.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-void-500 dark:text-void-400",children:"Description"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-xs font-medium text-void-500 dark:text-void-400",children:"Actions"})]})}),(0,t.jsx)("tbody",{children:o.map(e=>(0,t.jsxs)("tr",{className:"border-b border-void-100 dark:border-void-800",children:[(0,t.jsx)("td",{className:"px-4 py-2",children:(0,t.jsxs)("button",{onClick:()=>i(e),className:"flex items-center gap-2 text-left font-medium text-void-900 hover:text-blue-600 dark:text-void-100 dark:hover:text-blue-400",children:[e.name,(0,t.jsx)("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${S[e.type]}`,children:e.type}),!e.isValid&&(0,t.jsx)("span",{className:"rounded bg-amber-100 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",children:"!"})]})}),(0,t.jsx)("td",{className:"px-4 py-2 text-void-500 dark:text-void-400",children:e.frontmatter?.version?`v${e.frontmatter.version}`:"-"}),(0,t.jsx)("td",{className:"px-4 py-2 text-xs text-void-500 dark:text-void-400 max-w-xs truncate",children:e.frontmatter?.description||"-"}),(0,t.jsx)("td",{className:"px-4 py-2 text-right",children:(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,t.jsx)("button",{onClick:()=>l({name:e.name,type:e.type}),className:"rounded border border-red-400/30 bg-red-400/10 px-2 py-1 text-xs font-medium text-red-500 hover:bg-red-400/20",title:"Delete from store",children:"Del"}),!e.isValid&&r&&(0,t.jsx)("button",{onClick:()=>r(e.name,e.type),className:"rounded border border-amber-400/30 bg-amber-400/10 px-2 py-1 text-xs font-medium text-amber-500 hover:bg-amber-400/20",title:"Fix missing frontmatter",children:"Fix"}),d&&(0,t.jsx)("button",{onClick:()=>d("modify",e.name,e.type),className:"rounded border border-void-600 bg-void-800 px-2 py-1 text-xs font-medium text-void-300 hover:bg-void-700 hover:text-void-200",title:"Modify with LLM assistance",children:"Modify"})]})})]},e.name))})]})}),m[e]&&0===o.length&&(0,t.jsxs)("div",{className:"border-t border-void-100 py-4 text-center text-sm text-void-500 dark:border-void-700 dark:text-void-400",children:["No ",s.toLowerCase()," in store"]})]},e)),e.mcp.length>0&&(0,t.jsxs)("div",{className:"rounded-lg border border-void-200 bg-white shadow-(--shadow-card) dark:border-void-700 dark:bg-void-850",children:[(0,t.jsxs)("button",{onClick:()=>u("mcp"),className:"flex w-full items-center justify-between px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-void-900 dark:text-void-100",children:"MCP Configs"}),(0,t.jsx)("span",{className:"rounded-full bg-void-100 px-2 py-0.5 text-xs text-void-600 dark:bg-void-700 dark:text-void-300",children:e.mcp.length})]}),(0,t.jsx)("svg",{className:`h-4 w-4 text-void-400 transition-transform ${m.mcp?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),m.mcp&&(0,t.jsx)("div",{className:"border-t border-void-100 dark:border-void-700",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-void-200 dark:border-void-700",children:[(0,t.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-void-500 dark:text-void-400",children:"Name"}),(0,t.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-void-500 dark:text-void-400",children:"Description"}),(0,t.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-void-500 dark:text-void-400",children:"Version"})]})}),(0,t.jsx)("tbody",{children:e.mcp.map(e=>(0,t.jsxs)("tr",{className:"border-b border-void-100 dark:border-void-800",children:[(0,t.jsx)("td",{className:"px-4 py-2 font-medium text-void-900 dark:text-void-100",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[e.name,(0,t.jsx)("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${S.mcp}`,children:"mcp"})]})}),(0,t.jsx)("td",{className:"px-4 py-2 text-void-500 dark:text-void-400",children:e.frontmatter?.description||"-"}),(0,t.jsx)("td",{className:"px-4 py-2 text-void-500 dark:text-void-400",children:e.frontmatter?.version?`v${e.frontmatter.version}`:"-"})]},e.name))})]})})]}),n&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:e=>{e.target===e.currentTarget&&l(null)},children:(0,t.jsxs)("div",{className:"mx-4 w-full max-w-sm rounded-lg border border-void-700 bg-void-850 p-5 shadow-(--shadow-overlay)",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-void-100",children:"Delete from store?"}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-void-400",children:["This will permanently delete ",(0,t.jsx)("strong",{className:"text-void-200",children:n.name})," (",n.type,") from the canonical store."]}),(0,t.jsxs)("div",{className:"mt-4 flex justify-end gap-2",children:[(0,t.jsx)("button",{onClick:()=>l(null),className:"rounded px-3 py-1.5 text-sm text-void-400 hover:text-void-200",children:"Cancel"}),(0,t.jsx)("button",{onClick:()=>h(n.name,n.type),disabled:c,className:"rounded bg-red-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-red-500 disabled:opacity-50",children:c?"Deleting...":"Delete"})]})]})}),a&&(0,t.jsx)($,{asset:a,onClose:()=>i(null)})]})}function $({asset:e,onClose:s}){let r={name:e.name,type:e.type,path:e.path,frontmatter:e.frontmatter,isValid:e.isValid};return(0,t.jsx)(j,{asset:r,pathPrefix:"store/",onClose:s})}var T=e.i(71174);let I={add:"bg-emerald-950/40 text-emerald-300",remove:"bg-red-950/40 text-red-300",context:"text-void-300",header:"bg-neon-blue-950/30 text-neon-blue-300 font-medium"},M={add:"text-emerald-600",remove:"text-red-600",context:"text-void-600",header:"text-neon-blue-600"},A={add:"+",remove:"-",context:" ",header:""};function D({skillName:e,currentVersion:r,newVersion:d,currentContent:o,newContent:a,onClose:i}){let[n,l]=(0,s.useState)("diff");(0,s.useEffect)(()=>{function e(e){"Escape"===e.key&&i()}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]);let c=(0,s.useMemo)(()=>{let e=o??"";return function(e){let t=[],s=0,r=0;for(let d of e.split("\n"))if(d.startsWith("@@")){let e=d.match(/@@ -(\d+)/);if(e){s=parseInt(e[1],10)-1;let t=d.match(/\+(\d+)/);t&&(r=parseInt(t[1],10)-1)}t.push({type:"header",content:d})}else d.startsWith("---")||d.startsWith("+++")||d.startsWith("Index:")||d.startsWith("===")||(d.startsWith("+")?(r++,t.push({type:"add",content:d.slice(1),newLineNo:r})):d.startsWith("-")?(s++,t.push({type:"remove",content:d.slice(1),oldLineNo:s})):(d.startsWith(" ")||""===d)&&(s++,r++,t.push({type:"context",content:d.startsWith(" ")?d.slice(1):d,oldLineNo:s,newLineNo:r})));return t}((0,T.createTwoFilesPatch)("current/SKILL.md","updated/SKILL.md",e,a,r??"(none)",d,{context:4}))},[o,a,r,d]),x=null===o,m=(0,s.useMemo)(()=>{let e=0,t=0;for(let s of c)"add"===s.type&&e++,"remove"===s.type&&t++;return{additions:e,deletions:t}},[c]);return(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:e=>{e.target===e.currentTarget&&i()},children:(0,t.jsxs)("div",{className:"mx-4 flex max-h-[85vh] w-full max-w-4xl flex-col overflow-hidden rounded-lg border border-void-700 bg-void-850 shadow-(--shadow-overlay)",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-void-700 px-5 py-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold text-void-100",children:e}),x?(0,t.jsx)("span",{className:"rounded bg-emerald-900/40 px-2 py-0.5 text-xs font-medium text-emerald-300",children:"New skill"}):(0,t.jsxs)("span",{className:"rounded bg-amber-900/40 px-2 py-0.5 text-xs font-medium text-amber-300",children:["v",r," → v",d]}),(0,t.jsxs)("span",{className:"text-xs text-void-500",children:[(0,t.jsxs)("span",{className:"text-emerald-400",children:["+",m.additions]})," ",(0,t.jsxs)("span",{className:"text-red-400",children:["-",m.deletions]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[!x&&(0,t.jsxs)("div",{className:"flex gap-1 rounded-md border border-void-700 bg-void-900 p-0.5",children:[(0,t.jsx)("button",{onClick:()=>l("diff"),className:`rounded px-2.5 py-1 text-xs font-medium transition-colors ${"diff"===n?"bg-void-800 text-void-100 shadow-sm":"text-void-400 hover:text-void-200"}`,children:"Diff"}),(0,t.jsx)("button",{onClick:()=>l("new"),className:`rounded px-2.5 py-1 text-xs font-medium transition-colors ${"new"===n?"bg-void-800 text-void-100 shadow-sm":"text-void-400 hover:text-void-200"}`,children:"Full"})]}),(0,t.jsx)("button",{onClick:i,className:"rounded p-1 text-void-400 hover:bg-void-800 hover:text-void-200",children:(0,t.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsx)("div",{className:"font-mono text-xs leading-relaxed",children:"diff"===n||x?c.map((e,s)=>(0,t.jsxs)("div",{className:`flex ${I[e.type]}`,children:[(0,t.jsx)("span",{className:`w-10 flex-shrink-0 select-none px-2 text-right ${M[e.type]}`,children:"header"===e.type?"···":e.oldLineNo??e.newLineNo??""}),(0,t.jsx)("span",{className:`w-10 flex-shrink-0 select-none px-2 text-right ${M[e.type]}`,children:"header"===e.type?"···":e.newLineNo??""}),(0,t.jsx)("span",{className:`w-4 flex-shrink-0 select-none text-center ${M[e.type]}`,children:A[e.type]}),(0,t.jsx)("span",{className:"flex-1 whitespace-pre-wrap break-all px-2",children:(e.type,e.content)})]},s)):a.split("\n").map((e,s)=>(0,t.jsxs)("div",{className:"flex text-void-300",children:[(0,t.jsx)("span",{className:"w-10 flex-shrink-0 select-none px-2 text-right text-void-600",children:s+1}),(0,t.jsx)("span",{className:"flex-1 whitespace-pre-wrap break-all px-2",children:e})]},s))})})]})})}function P({entries:e,onAccept:r,onDismiss:d,onPushToProjects:o,onPushDeclined:a}){let[i,n]=(0,s.useState)(null),[l,c]=(0,s.useState)(null),[x,m]=(0,s.useState)(new Set),[p,u]=(0,s.useState)(new Map);async function h(e){try{let t=await fetch(`/api/file?${new URLSearchParams({path:`updates/${e.updatesPath}/SKILL.md`})}`),s=t.ok?await t.json():null,r=s?.content??"",d=null;if("update"===e.status){let t=await fetch(`/api/file?${new URLSearchParams({path:`store/${e.storePath}/SKILL.md`})}`),s=t.ok?await t.json():null;d=s?.content??null}n({entry:e,currentContent:d,newContent:r})}catch{}}async function v(e){c(e.name);try{await r(e);let t=e.name;m(e=>new Set(e).add(t)),u(s=>new Map(s).set(t,e))}finally{c(null)}}if(0===e.length&&0===x.size)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center rounded-lg border border-void-200 bg-white py-16 dark:border-void-700 dark:bg-void-850",children:[(0,t.jsx)("svg",{className:"mb-3 h-10 w-10 text-emerald-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,t.jsx)("p",{className:"text-sm font-medium text-void-400 dark:text-void-400",children:"All skills are up to date"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-void-400 dark:text-void-500",children:"No updates available"})]});let b=[...e];for(let[t,s]of p)x.has(t)&&!e.some(e=>e.name===t)&&b.push(s);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"space-y-3",children:b.map(e=>{let s=e.name,r=x.has(s),i=l===e.name;if(r){let r=()=>{m(e=>{let t=new Set(e);return t.delete(s),t}),u(e=>{let t=new Map(e);return t.delete(s),t})},d=!e.skillMdOnly;return(0,t.jsxs)("div",{className:"rounded-lg border border-emerald-500/30 bg-emerald-950/20 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("svg",{className:"h-5 w-5 text-emerald-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-sm font-medium text-emerald-300",children:e.name}),(0,t.jsxs)("span",{className:"ml-2 text-xs text-emerald-400/70",children:["Updated to v",e.availableVersion]})]})]}),d?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{onClick:()=>{o(e,!1),r()},className:"rounded-md border border-emerald-400/40 bg-emerald-400/15 px-3 py-1 text-xs font-medium text-emerald-400 hover:bg-emerald-400/25",children:"SKILL.md only"}),(0,t.jsx)("button",{onClick:()=>{o(e,!0),r()},className:"rounded-md border border-amber-400/40 bg-amber-400/15 px-3 py-1 text-xs font-medium text-amber-400 hover:bg-amber-400/25",children:"All files"}),(0,t.jsx)("button",{onClick:()=>{r(),a?.()},className:"rounded-md border border-void-600 bg-void-800 px-3 py-1 text-xs font-medium text-void-300 hover:bg-void-700",children:"Skip"})]}):(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs text-void-400",children:"Push to all projects?"}),(0,t.jsx)("button",{onClick:()=>{o(e,!1),r()},className:"rounded-md border border-emerald-400/40 bg-emerald-400/15 px-3 py-1 text-xs font-medium text-emerald-400 hover:bg-emerald-400/25",children:"Yes"}),(0,t.jsx)("button",{onClick:()=>{r(),a?.()},className:"rounded-md border border-void-600 bg-void-800 px-3 py-1 text-xs font-medium text-void-300 hover:bg-void-700",children:"No"})]})]}),d&&(0,t.jsxs)("div",{className:"mt-3 ml-8 rounded-md border border-void-700 bg-void-900/60 px-3 py-2",children:[(0,t.jsx)("p",{className:"mb-1.5 text-[10px] font-medium uppercase tracking-wider text-amber-400/70",children:"Push to projects will include:"}),(0,t.jsxs)("div",{className:"font-mono text-xs text-void-400",children:[(0,t.jsx)("div",{className:"text-emerald-400",children:"SKILL.md"}),e.filesAffected.filter(e=>"SKILL.md"!==e).sort().map((e,s,r)=>{let d=s===r.length-1;return(0,t.jsxs)("div",{className:"text-amber-400/70",children:[(0,t.jsx)("span",{className:"text-void-600",children:d?"└── ":"├── "}),e]},e)})]})]})]},s)}return(0,t.jsx)("div",{className:"rounded-lg border border-void-200 bg-white p-4 dark:border-void-700 dark:bg-void-850",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-void-900 dark:text-void-100",children:e.name}),"update"===e.status?(0,t.jsx)("span",{className:"rounded bg-amber-100 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",children:"Update"}):(0,t.jsx)("span",{className:"rounded bg-emerald-100 px-1.5 py-0.5 text-[10px] font-medium text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300",children:"New"}),e.skillMdOnly?(0,t.jsx)("span",{className:"text-[10px] text-void-400 dark:text-void-500",children:"SKILL.md only"}):(0,t.jsxs)("span",{className:"text-[10px] text-amber-500",title:e.filesAffected.join(", "),children:[e.filesAffected.length," files"]})]}),(0,t.jsx)("div",{className:"mt-1 flex items-center gap-2 text-xs text-void-500 dark:text-void-400",children:"update"===e.status?(0,t.jsxs)("span",{children:["v",e.currentVersion," → v",e.availableVersion]}):(0,t.jsxs)("span",{children:["v",e.availableVersion]})}),e.description&&(0,t.jsx)("p",{className:"mt-1.5 text-xs text-void-500 dark:text-void-400 line-clamp-2",children:e.description})]}),(0,t.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-1.5",children:[(0,t.jsx)("button",{onClick:()=>h(e),title:"Preview changes",className:"rounded-md border border-void-300 bg-void-50 p-1.5 text-void-500 transition-colors hover:bg-void-100 hover:text-void-700 dark:border-void-600 dark:bg-void-800 dark:hover:bg-void-700 dark:hover:text-void-200",children:(0,t.jsxs)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})}),(0,t.jsx)("button",{onClick:()=>v(e),disabled:i,title:"update"===e.status?`Update to v${e.availableVersion}`:"Import skill",className:"rounded-md border border-emerald-400/40 bg-emerald-400/15 p-1.5 text-emerald-400 transition-colors hover:bg-emerald-400/25 disabled:opacity-50",children:i?(0,t.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-emerald-600 border-t-emerald-300"}):(0,t.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),(0,t.jsx)("button",{onClick:()=>{d(e)},title:"Dismiss this version",className:"rounded-md border border-void-300 bg-void-50 p-1.5 text-void-400 transition-colors hover:bg-red-50 hover:text-red-500 dark:border-void-600 dark:bg-void-800 dark:hover:bg-red-950/30 dark:hover:text-red-400",children:(0,t.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})]})},s)})}),i&&(0,t.jsx)(D,{skillName:i.entry.name,currentVersion:i.entry.currentVersion,newVersion:i.entry.availableVersion,currentContent:i.currentContent,newContent:i.newContent,onClose:()=>n(null)})]})}let _=[{id:"skill",label:"Skill"},{id:"agent",label:"Agent"},{id:"mcp",label:"MCP Server"}];function O({mode:r,provider:d,assetType:o,assetName:a,onClose:i}){let n=d||"claude",[l,c]=(0,s.useState)(o||"skill"),[x,m]=(0,s.useState)(a||""),[p,u]=(0,s.useState)(""),[h,v]=(0,s.useState)(""),[b,f]=(0,s.useState)(null),[g,j]=(0,s.useState)(!1),[k,N]=(0,s.useState)(null),[y,w]=(0,s.useState)(!1),C="create"===r,S=C?"Create New Asset":`Modify: ${a}`;async function L(){j(!0),N(null);try{let e=C?{mode:r,provider:n,assetType:l,assetName:x,description:p}:{mode:r,provider:n,assetType:l,assetName:x,changes:h},t=await fetch("/api/cli-assets/assistant",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){let e=await t.json();N(e.error||"Failed to generate prompt");return}let s=await t.json();f(s.prompt)}catch{N("Failed to generate prompt")}j(!1)}async function $(){if(b)try{await navigator.clipboard.writeText(b),w(!0),setTimeout(()=>w(!1),2e3)}catch{}}(0,s.useEffect)(()=>{function e(e){"Escape"===e.key&&i()}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]);let T=C?x.trim()&&p.trim():x.trim();return(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:e=>{e.target===e.currentTarget&&i()},children:(0,t.jsxs)("div",{className:"mx-4 flex max-h-[85vh] w-full max-w-2xl flex-col overflow-hidden rounded-lg border border-void-700 bg-void-850 shadow-(--shadow-overlay)",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-void-700 px-5 py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-lg font-semibold text-void-100",children:S}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-void-400",children:C?"Design a new asset with LLM assistance":"Modify an existing asset with LLM assistance"})]}),(0,t.jsx)("button",{onClick:i,className:"rounded p-1 text-void-400 hover:bg-void-800 hover:text-void-200",children:(0,t.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:[!b&&!g&&!k&&(0,t.jsxs)("div",{className:"space-y-4",children:[C&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-xs font-medium text-void-400",children:"Asset Type"}),(0,t.jsx)("div",{className:"flex gap-1",children:_.map(e=>(0,t.jsx)("button",{onClick:()=>c(e.id),className:`rounded-md px-3 py-1.5 text-sm font-medium transition-colors ${l===e.id?"border border-neon-blue-400/40 bg-neon-blue-400/20 text-neon-blue-400":"border border-void-700 text-void-400 hover:border-void-600 hover:text-void-200"}`,children:e.label},e.id))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-xs font-medium text-void-400",children:"Name"}),(0,t.jsx)("input",{type:"text",value:x,onChange:e=>m(e.target.value),disabled:!C,placeholder:"e.g. code-review, testing-helper",className:"w-full rounded-md border border-void-700 bg-void-900 px-3 py-2 text-sm text-void-200 placeholder-void-500 focus:border-neon-blue-400/50 focus:outline-none disabled:opacity-60","data-voice-target":!0})]}),C?(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"mb-1 block text-xs font-medium text-void-400",children:["What should this ",l," do?"]}),(0,t.jsx)("textarea",{value:p,onChange:e=>u(e.target.value),placeholder:"mcp"===l?"Name or URL of the MCP server package (e.g. @anthropic/mcp-server-filesystem, github.com/org/mcp-server)...":"Describe the purpose, behavior, and key features...",rows:5,className:"w-full rounded-md border border-void-700 bg-void-900 px-3 py-2 text-sm text-void-200 placeholder-void-500 focus:border-neon-blue-400/50 focus:outline-none","data-voice-target":!0})]}):(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-xs font-medium text-void-400",children:"What changes do you want?"}),(0,t.jsx)("textarea",{value:h,onChange:e=>v(e.target.value),placeholder:"Describe what to change, add, or improve... (leave empty for general review)",rows:5,className:"w-full rounded-md border border-void-700 bg-void-900 px-3 py-2 text-sm text-void-200 placeholder-void-500 focus:border-neon-blue-400/50 focus:outline-none","data-voice-target":!0})]}),(0,t.jsx)("button",{onClick:L,disabled:!T,className:"rounded-md border border-neon-blue-400/40 bg-neon-blue-400/15 px-4 py-2 text-sm font-medium text-neon-blue-400 hover:bg-neon-blue-400/25 disabled:opacity-50 disabled:cursor-not-allowed",children:"Generate Prompt"})]}),g&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsx)("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-void-600 border-t-neon-blue-400"})}),k&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"rounded-md border border-red-400/30 bg-red-400/10 p-3 text-sm text-red-400",children:k}),(0,t.jsx)("button",{onClick:()=>{N(null),f(null)},className:"text-sm text-void-400 hover:text-void-200",children:"Back"})]}),b&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("p",{className:"text-sm text-void-300",children:[C?"Creation":"Modification"," prompt ready:"]}),(0,t.jsx)("textarea",{readOnly:!0,value:b,className:"h-64 w-full rounded-md border border-void-700 bg-void-900 p-3 font-mono text-xs text-void-300 focus:outline-none"})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 border-t border-void-700 px-5 py-3",children:[(0,t.jsx)("button",{onClick:i,className:"rounded px-4 py-1.5 text-sm text-void-400 hover:text-void-200",children:b?"Close":"Cancel"}),b&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:$,className:`rounded px-3 py-1.5 text-sm font-medium ${y?"bg-green-400/20 text-green-400":"bg-void-800 text-void-300 hover:bg-void-700"}`,children:y?"Copied!":"Copy"}),(0,t.jsx)("button",{onClick:function(){b&&e.A(90178).then(({pushToTerminal:e})=>{e(b),i()})},className:"rounded bg-neon-blue-600 px-4 py-1.5 text-sm font-medium text-white hover:bg-neon-blue-500",children:"Run in Terminal"})]})]})]})})}let E=[{id:"claude",label:"Claude"},{id:"agents",label:"Agents"},{id:"codex",label:"Codex"},{id:"gemini",label:"Gemini"}];function V(){let e,r,d,[a,i]=(0,s.useState)(null),[n,l]=(0,s.useState)(!1),[c,x]=(0,s.useState)(!1),[m,p]=(0,s.useState)(!1),[u,h]=(0,s.useState)([]),[v,b]=(0,s.useState)("projects"),[f,g]=(0,s.useState)("claude"),[j,k]=(0,s.useState)(null),[N,y]=(0,s.useState)(null),[w,S]=(0,s.useState)(null),[$,T]=(0,s.useState)(null),[I,M]=(0,s.useState)({skills:!0,agents:!0}),[A,D]=(0,s.useState)(!1),[_,V]=(0,s.useState)(()=>{try{let e=localStorage.getItem("cli-assets-ignored");return e?new Set(JSON.parse(e)):new Set}catch{return new Set}}),W=(0,s.useCallback)(async e=>{try{let[t,s]=await Promise.all([fetch(`/api/cli-assets?provider=${f}`,{signal:e}),fetch("/api/cli-assets/updates",{signal:e})]);if(t.ok){let e=await t.json();i(e)}if(s.ok){let e=await s.json();T(e)}}catch{}},[f]);(0,o.usePolling)(W,1e4);let B=(0,s.useRef)(f);async function U(){p(!0);let e=new AbortController;await W(e.signal),p(!1)}function z(e){h(t=>{let s=t.findIndex(t=>t.assetName===e.assetName&&t.assetType===e.assetType&&t.projectId===e.projectId);return s>=0?t.filter((e,t)=>t!==s):[...t,{...e,provider:f,source:"store"}]})}async function K(){if(0!==u.length){l(!0);try{(await fetch("/api/cli-assets/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({changes:u,fullSkillFolder:c})})).ok&&(h([]),await U())}catch{}l(!1)}}function J(e,t,s){"skill"!==t?G(e,t,s,!1):S({assetName:e,assetType:t,sourceProjectId:s,provider:f})}async function G(e,t,s,r){try{(await fetch("/api/cli-assets/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:f,assetType:t,assetName:e,sourceProjectId:s,skillMainOnly:!r})})).ok&&await U()}catch{}}function H(e,t,s){k({assetName:e,assetType:t,projectId:s,provider:f})}function q(e,t,s){y({mode:e,provider:f,assetType:s,assetName:t})}function Y(e,t){return`${f}:${t}:${e}`}if((0,s.useEffect)(()=>{B.current!==f&&(B.current=f,W(new AbortController().signal))},[f,W]),!a)return(0,t.jsxs)("div",{className:"flex min-h-[60vh] flex-col items-center justify-center gap-3 py-16",children:[(0,t.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-void-300 border-t-neon-blue-400"}),(0,t.jsx)("p",{className:"text-sm text-void-400 dark:text-void-500",children:"Scanning assets across projects, this can take a few seconds..."})]});let Q=a.projects,X=a.storeData?a.storeData.skills.length+a.storeData.agents.length+a.storeData.mcp.length:0,Z=[{key:"skills",label:"Skills",rows:a.skills},{key:"agents",label:"Agents",rows:a.agents}];return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"sticky top-0 z-30 -mx-4 px-4 pb-2 pt-2 bg-void-50 dark:bg-void-950 sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex gap-1 rounded-lg border border-void-200 bg-void-50 p-1 dark:border-void-700 dark:bg-void-900",children:[(0,t.jsxs)("button",{onClick:()=>b("projects"),className:`flex items-center gap-2 rounded-md px-4 py-1.5 text-sm font-medium transition-colors ${"projects"===v?"bg-white text-void-900 shadow-sm dark:bg-void-800 dark:text-void-100":"text-void-500 hover:text-void-700 dark:text-void-400 dark:hover:text-void-200"}`,children:["Project Assignment",a.totalOutdated>0&&(0,t.jsx)("span",{className:"rounded-full bg-amber-100 px-1.5 py-0.5 text-[10px] text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",children:a.totalOutdated})]}),(0,t.jsxs)("button",{onClick:()=>b("store"),className:`flex items-center gap-2 rounded-md px-4 py-1.5 text-sm font-medium transition-colors ${"store"===v?"bg-white text-void-900 shadow-sm dark:bg-void-800 dark:text-void-100":"text-void-500 hover:text-void-700 dark:text-void-400 dark:hover:text-void-200"}`,children:["Asset Store",(0,t.jsx)("span",{className:`rounded-full px-1.5 py-0.5 text-[10px] ${"store"===v?"bg-void-100 text-void-600 dark:bg-void-700 dark:text-void-300":"bg-void-200/50 text-void-400 dark:bg-void-800 dark:text-void-500"}`,children:X})]}),(0,t.jsxs)("button",{onClick:()=>b("updates"),className:`flex items-center gap-2 rounded-md px-4 py-1.5 text-sm font-medium transition-colors ${"updates"===v?"bg-white text-void-900 shadow-sm dark:bg-void-800 dark:text-void-100":"text-void-500 hover:text-void-700 dark:text-void-400 dark:hover:text-void-200"}`,children:["Updates",($?.totalAvailable??0)>0&&(0,t.jsx)("span",{className:`rounded-full px-1.5 py-0.5 text-[10px] ${$?.entries.some(e=>"new"===e.status)?"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300":"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300"}`,children:$.totalAvailable})]})]}),"projects"===v&&(0,t.jsx)("div",{className:"flex gap-1 rounded-lg border border-void-200 bg-void-50 p-1 dark:border-void-700 dark:bg-void-900",children:E.map(e=>(0,t.jsx)("button",{onClick:()=>g(e.id),className:`rounded-md px-3 py-1.5 text-sm font-medium transition-colors ${f===e.id?"bg-white text-void-900 shadow-sm dark:bg-void-800 dark:text-void-100":"text-void-500 hover:text-void-700 dark:text-void-400 dark:hover:text-void-200"}`,children:e.label},e.id))}),"store"===v&&(0,t.jsxs)("button",{onClick:()=>q("create"),className:"flex items-center gap-1.5 rounded-md border border-neon-blue-400/40 bg-neon-blue-400/15 px-3 py-1.5 text-sm font-medium text-neon-blue-400 hover:bg-neon-blue-400/25 whitespace-nowrap",children:[(0,t.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),"New"]}),(0,t.jsx)("button",{onClick:U,disabled:m,title:"Refresh assets",className:"rounded-md border border-void-200 bg-void-50 p-1.5 text-void-500 transition-colors hover:bg-void-100 hover:text-void-700 dark:border-void-700 dark:bg-void-900 dark:hover:bg-void-800 dark:hover:text-void-200 disabled:opacity-50",children:(0,t.jsx)("svg",{className:`h-4 w-4 ${m?"animate-spin":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]})}),(0,t.jsxs)("div",{className:"min-h-[70vh]",children:[(0,t.jsxs)("p",{className:"mb-3 text-xs text-void-400 dark:text-void-500",children:["projects"===v&&"Assign assets from the store to individual projects and keep them in sync.","store"===v&&"The canonical source for each asset. Deploy to projects across providers like Claude, Codex, and Gemini.","updates"===v&&"SlyCode updates land here. Review what changed and choose to accept or skip each one."]}),"agents"===f&&(0,t.jsxs)("div",{className:"mx-1 rounded-md border border-void-200 bg-void-50 px-3 py-2 text-xs text-void-500 dark:border-void-700 dark:bg-void-900 dark:text-void-400",children:[(0,t.jsx)("strong",{className:"text-void-700 dark:text-void-300",children:"Agents"})," deploys to ",(0,t.jsx)("code",{className:"rounded bg-void-200 px-1 dark:bg-void-800",children:".agents/skills/"})," — the universal cross-tool directory read by both Codex CLI and Gemini CLI. Use this for skills that should work across tools without provider-specific overrides."]}),"updates"===v&&(0,t.jsx)(P,{entries:$?.entries??[],onAccept:async e=>{await fetch("/api/cli-assets/updates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assetType:e.assetType,assetName:e.name})})},onDismiss:e=>{fetch("/api/cli-assets/updates",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({assetType:e.assetType,assetName:e.name,contentHash:e.contentHash})}).then(()=>{T(t=>{if(!t)return t;let s=t.entries.filter(t=>t.name!==e.name);return{entries:s,totalAvailable:s.length}})})},onPushToProjects:async(e,t)=>{let s=[];for(let{provider:t,rows:r}of(await Promise.all(["claude","agents","codex","gemini"].map(async e=>{try{let t=await fetch(`/api/cli-assets?provider=${e}`);if(!t.ok)return{provider:e,rows:[]};let s=await t.json();return{provider:e,rows:[...s.skills??[],...s.agents??[]]}}catch{return{provider:e,rows:[]}}})))){let d=r.find(t=>t.name===e.name&&t.type===e.assetType);if(d)for(let r of d.cells)"missing"!==r.status&&s.push({assetName:e.name,assetType:e.assetType,projectId:r.projectId,action:"deploy",provider:t,source:"store"})}s.length>0&&await fetch("/api/cli-assets/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({changes:s,fullSkillFolder:t})}),U()},onPushDeclined:()=>U()}),"store"===v&&a.storeData&&(0,t.jsx)(L,{data:a.storeData,onFix:H,onAssistant:q,onRefresh:U}),"projects"===v&&(0,t.jsxs)(t.Fragment,{children:[Z.map(({key:e,label:s,rows:r})=>(0,t.jsxs)("div",{className:"rounded-lg border border-void-200 bg-white shadow-(--shadow-card) dark:border-void-700 dark:bg-void-850",children:[(0,t.jsxs)("button",{onClick:()=>{M(t=>({...t,[e]:!t[e]}))},className:"flex w-full items-center justify-between px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-void-900 dark:text-void-100",children:s}),(0,t.jsx)("span",{className:"rounded-full bg-void-100 px-2 py-0.5 text-xs text-void-600 dark:bg-void-700 dark:text-void-300",children:r.length})]}),(0,t.jsx)("svg",{className:`h-4 w-4 text-void-400 transition-transform ${I[e]?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),I[e]&&(0,t.jsx)("div",{className:"border-t border-void-100 dark:border-void-700",children:(0,t.jsx)(C,{rows:r,projects:Q,pendingChanges:u,onQueueChange:z,onImport:J,onFix:H})})]},e)),(e=a.nonImported.filter(e=>!_.has(Y(e.name,e.type))),r=a.nonImported.filter(e=>_.has(Y(e.name,e.type))),d=A?a.nonImported:e,0===a.nonImported.length?null:(0,t.jsxs)("div",{className:"rounded-lg border border-dashed border-amber-300 bg-amber-50/50 dark:border-amber-700 dark:bg-amber-950/20",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-amber-700 dark:text-amber-400",children:"Not in Asset Store"}),(0,t.jsx)("span",{className:"rounded-full bg-amber-100 px-2 py-0.5 text-xs text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",children:e.length}),(0,t.jsx)("div",{className:"flex-1"}),r.length>0&&(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-void-500 dark:text-void-400 cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:A,onChange:e=>D(e.target.checked),className:"rounded border-void-400"}),"Show ignored (",r.length,")"]})]}),d.length>0&&(0,t.jsx)("div",{className:"border-t border-amber-200 dark:border-amber-800/50",children:(0,t.jsx)(C,{rows:d,projects:Q,pendingChanges:u,onQueueChange:z,onImport:J,onFix:H,ignoredAssets:_,ignoreKeyFn:Y,onIgnore:function(e,t){V(s=>{let r=new Set(s);return r.add(Y(e,t)),localStorage.setItem("cli-assets-ignored",JSON.stringify([...r])),r})},onUnignore:function(e,t){V(s=>{let r=new Set(s);return r.delete(Y(e,t)),localStorage.setItem("cli-assets-ignored",JSON.stringify([...r])),r})}})})]}))]})]}),u.length>0&&(0,t.jsxs)("div",{className:"fixed bottom-0 left-4 right-72 z-40 flex h-12 items-center justify-between rounded-t-lg border border-neon-blue-400/30 bg-neon-blue-50 px-4 shadow-(--shadow-card) dark:border-neon-blue-400/30 dark:bg-void-850",children:[(0,t.jsxs)("span",{className:"text-sm font-medium text-neon-blue-700 dark:text-neon-blue-300",children:[u.length," pending change",1!==u.length?"s":""]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[u.some(e=>"skill"===e.assetType&&"deploy"===e.action)&&(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-void-600 dark:text-void-400",children:[(0,t.jsx)("input",{type:"checkbox",checked:c,onChange:e=>x(e.target.checked),className:"h-3.5 w-3.5 rounded border-void-300 dark:border-void-600"}),"Copy entire skill folder"]}),(0,t.jsx)("button",{onClick:()=>h([]),className:"rounded px-4 py-1.5 text-sm text-void-600 hover:text-void-900 dark:text-void-400 dark:hover:text-void-200",children:"Cancel"}),(0,t.jsx)("button",{onClick:K,disabled:n,className:"rounded bg-neon-blue-600 px-4 py-1.5 text-sm font-medium text-white hover:bg-neon-blue-500 disabled:opacity-50",children:n?"Syncing...":"Apply Changes"})]})]}),j&&(0,t.jsx)(R,{assetName:j.assetName,assetType:j.assetType,provider:j.provider||"claude",projectId:j.projectId,onClose:()=>k(null)}),N&&(0,t.jsx)(O,{mode:N.mode,provider:N.provider,assetType:N.assetType,assetName:N.assetName,onClose:()=>y(null)}),w&&(0,t.jsx)(F,{target:w,onConfirm:async e=>{let{assetName:t,assetType:s,sourceProjectId:r}=w;S(null),await G(t,s,r,e)},onClose:()=>S(null)})]})}function F({target:e,onConfirm:r,onClose:d}){let[o,a]=(0,s.useState)(null),[i,n]=(0,s.useState)(!0);(0,s.useEffect)(()=>{let t=new URLSearchParams({provider:e.provider,assetType:e.assetType,assetName:e.assetName,sourceProjectId:e.sourceProjectId});fetch(`/api/cli-assets/store/preview?${t}`).then(e=>e.json()).then(e=>{a(e.files??[]),n(!1)}).catch(()=>{a([]),n(!1)})},[e]);let l=o&&o.length>1;o?.filter(e=>"SKILL.md"===e);let c=o?.filter(e=>"SKILL.md"!==e)??[];return(0,t.jsx)("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/60",onClick:d,children:(0,t.jsxs)("div",{className:"w-full max-w-lg rounded-xl bg-white p-6 shadow-(--shadow-overlay) dark:bg-void-800",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-purple-100 dark:bg-purple-900/30",children:(0,t.jsx)("svg",{className:"h-5 w-5 text-purple-600 dark:text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-lg font-semibold text-void-900 dark:text-void-100",children:"Import to Store"}),(0,t.jsx)("p",{className:"text-sm text-void-500 dark:text-void-400",children:e.assetName})]})]}),i?(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsx)("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-void-300 border-t-purple-500"})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mb-4 rounded-lg border border-void-200 bg-void-50 dark:border-void-700 dark:bg-void-900",children:[(0,t.jsxs)("div",{className:"px-3 py-2 text-xs font-medium text-void-500 dark:text-void-400 border-b border-void-200 dark:border-void-700",children:["Files in source (",o?.length??0,")"]}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto p-2",children:o?.map(e=>(0,t.jsxs)("div",{className:`flex items-center gap-2 rounded px-2 py-1 text-xs font-mono ${"SKILL.md"===e?"text-purple-700 dark:text-purple-300 font-semibold":"text-void-500 dark:text-void-400"}`,children:[(0,t.jsx)("svg",{className:"h-3.5 w-3.5 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:"SKILL.md"===e?(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"}):(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),e]},e))})]}),l&&(0,t.jsxs)("p",{className:"mb-4 text-xs text-void-500 dark:text-void-400",children:["This skill has ",c.length," supporting file",1!==c.length?"s":""," beyond SKILL.md. These may be project-specific (e.g. context-priming area references) and importing them would overwrite the store copies."]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("button",{onClick:()=>r(!1),className:"flex items-center justify-between rounded-lg border border-purple-300 bg-purple-50 px-4 py-3 text-left transition-colors hover:bg-purple-100 dark:border-purple-700 dark:bg-purple-900/20 dark:hover:bg-purple-900/40",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium text-purple-700 dark:text-purple-300",children:"SKILL.md only"}),(0,t.jsx)("div",{className:"text-xs text-purple-500 dark:text-purple-400",children:"Import only the skill definition — leave supporting files unchanged"})]}),!l&&(0,t.jsx)("span",{className:"rounded-full bg-purple-100 px-2 py-0.5 text-[10px] font-medium text-purple-600 dark:bg-purple-900/40 dark:text-purple-300",children:"Only file"})]}),l&&(0,t.jsx)("button",{onClick:()=>r(!0),className:"flex items-center justify-between rounded-lg border border-void-200 bg-void-50 px-4 py-3 text-left transition-colors hover:bg-void-100 dark:border-void-700 dark:bg-void-900 dark:hover:bg-void-800",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium text-void-700 dark:text-void-300",children:"Full folder"}),(0,t.jsxs)("div",{className:"text-xs text-void-500 dark:text-void-400",children:["Import all ",o?.length," files — overwrites existing store copies"]})]})}),(0,t.jsx)("button",{onClick:d,className:"mt-1 rounded-lg px-4 py-2 text-sm font-medium text-void-500 hover:text-void-700 dark:text-void-400 dark:hover:text-void-200",children:"Cancel"})]})]})]})})}function R({assetName:r,assetType:d,provider:o,projectId:a,onClose:i}){let[n,l]=(0,s.useState)(null),[c,x]=(0,s.useState)(!1),[m,p]=(0,s.useState)(null),[u,h]=(0,s.useState)(!1);async function v(){x(!0),p(null);try{let e=await fetch("/api/cli-assets/fix",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({assetName:r,assetType:d,provider:o,projectId:a})});if(!e.ok){let t=await e.json();p(t.error||"Failed to generate fix prompt");return}let t=await e.json();l(t.prompt)}catch{p("Failed to generate fix prompt")}x(!1)}async function b(){if(n)try{await navigator.clipboard.writeText(n),h(!0),setTimeout(()=>h(!1),2e3)}catch{}}return(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:e=>{e.target===e.currentTarget&&i()},children:(0,t.jsxs)("div",{className:"mx-4 flex max-h-[85vh] w-full max-w-2xl flex-col overflow-hidden rounded-lg border border-void-700 bg-void-850 shadow-(--shadow-overlay)",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-void-700 px-5 py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-lg font-semibold text-void-100",children:"Fix Asset Compliance"}),(0,t.jsxs)("p",{className:"mt-0.5 text-sm text-void-400",children:[r," (",d,") — missing or invalid frontmatter"]})]}),(0,t.jsx)("button",{onClick:i,className:"rounded p-1 text-void-400 hover:bg-void-800 hover:text-void-200",children:(0,t.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:[!n&&!c&&!m&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("p",{className:"text-sm text-void-300",children:"Generate a prompt that instructs an LLM to add proper frontmatter fields (name, version, updated, description, provider) to this asset."}),(0,t.jsx)("button",{onClick:v,className:"rounded-md border border-amber-400/40 bg-amber-400/15 px-4 py-2 text-sm font-medium text-amber-400 hover:bg-amber-400/25",children:"Generate Fix Prompt"})]}),c&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsx)("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-void-600 border-t-amber-400"})}),m&&(0,t.jsx)("div",{className:"rounded-md border border-red-400/30 bg-red-400/10 p-3 text-sm text-red-400",children:m}),n&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-sm text-void-300",children:"Fix prompt ready:"}),(0,t.jsx)("textarea",{readOnly:!0,value:n,className:"h-48 w-full rounded-md border border-void-700 bg-void-900 p-3 font-mono text-xs text-void-300 focus:outline-none"})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 border-t border-void-700 px-5 py-3",children:[(0,t.jsx)("button",{onClick:i,className:"rounded px-4 py-1.5 text-sm text-void-400 hover:text-void-200",children:"Close"}),n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:b,className:`rounded px-3 py-1.5 text-sm font-medium ${u?"bg-green-400/20 text-green-400":"bg-void-800 text-void-300 hover:bg-void-700"}`,children:u?"Copied!":"Copy"}),(0,t.jsx)("button",{onClick:function(){n&&e.A(90178).then(({pushToTerminal:e})=>{e(n),i()})},className:"rounded bg-neon-blue-600 px-4 py-1.5 text-sm font-medium text-white hover:bg-neon-blue-500",children:"Run in Terminal"})]})]})]})})}let W={card_created:"Created",card_moved:"Moved",card_updated:"Updated",problem_added:"Problem",problem_resolved:"Resolved",skill_deployed:"Deployed",skill_removed:"Removed",skill_imported:"Imported",session_started:"Session",session_stopped:"Session"},B={card_created:"text-green-500",card_moved:"text-neon-blue-500 dark:text-neon-blue-400",card_updated:"text-void-500",problem_added:"text-red-500",problem_resolved:"text-green-500",skill_deployed:"text-neon-blue-500 dark:text-neon-blue-400",skill_removed:"text-amber-500",skill_imported:"text-purple-500",session_started:"text-green-500",session_stopped:"text-void-500"},U={backlog:"text-void-500 dark:text-void-400",design:"text-neon-blue-600 dark:text-neon-blue-400",implementation:"text-neon-blue-500 dark:text-neon-blue-400",testing:"text-neon-orange-500 dark:text-neon-orange-400",done:"text-green-500 dark:text-green-400"};function z({projectFilter:e}){let[r,d]=(0,s.useState)([]),[a,i]=(0,s.useState)(!1),n=(0,s.useCallback)(async t=>{try{let s=new URLSearchParams({limit:"50"});e&&s.set("project",e);let r=await fetch(`/api/events?${s}`,{signal:t});if(r.ok){let e=await r.json();d(e.events||[])}}catch{}},[e]);(0,o.usePolling)(n,3e4);let l=r.reduce((e,t)=>{let s,r,d,o=(s=new Date(t.timestamp),((d=new Date(r=new Date)).setDate(d.getDate()-1),s.toDateString()===r.toDateString())?"Today":s.toDateString()===d.toDateString()?"Yesterday":s.toLocaleDateString("en-US",{month:"short",day:"numeric"}));return e[o]||(e[o]=[]),e[o].push(t),e},{});return(0,t.jsxs)("div",{className:"rounded-lg border border-void-200 bg-white shadow-(--shadow-surface) dark:border-void-700 dark:bg-void-850",children:[(0,t.jsxs)("button",{onClick:()=>i(!a),className:"flex w-full items-center justify-between px-4 py-3 text-left",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-void-900 dark:text-void-100",children:"Activity"}),(0,t.jsx)("svg",{className:`h-4 w-4 text-void-400 transition-transform ${a?"":"rotate-180"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),!a&&(0,t.jsx)("div",{className:"max-h-64 overflow-y-auto border-t border-void-100 dark:border-void-700",children:0===r.length?(0,t.jsx)("div",{className:"px-4 py-6 text-center text-sm text-void-500 dark:text-void-400",children:"No recent activity"}):Object.entries(l).map(([e,s])=>(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"sticky top-0 bg-void-50 px-4 py-1 text-xs font-medium text-void-500 dark:bg-void-800 dark:text-void-400",children:e}),s.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-2 px-4 py-2 text-xs",children:[(0,t.jsx)("span",{className:`mt-0.5 font-medium ${B[e.type]}`,children:W[e.type]}),(0,t.jsx)("span",{className:"flex-1 text-void-600 dark:text-void-400",children:"card_moved"===e.type?function(e){let s=e.match(/^Card '(.+)' moved from (\w+) to (\w+)$/);if(!s)return e;let[,r,d,o]=s,a=U[d]||"text-void-500",i=U[o]||"text-void-500";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-void-500 dark:text-void-400",children:"Card "}),(0,t.jsx)("span",{className:"font-medium text-void-700 dark:text-void-300",children:r}),(0,t.jsx)("span",{className:"text-void-500 dark:text-void-400",children:" moved from "}),(0,t.jsx)("span",{className:`font-medium ${a}`,children:d}),(0,t.jsx)("span",{className:"text-void-500 dark:text-void-400",children:" to "}),(0,t.jsx)("span",{className:`font-medium ${i}`,children:o})]})}(e.detail):e.detail}),(0,t.jsx)("span",{className:"flex-shrink-0 text-void-400 dark:text-void-500",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let r=Math.floor(s/24);return 1===r?"yesterday":`${r}d ago`}(e.timestamp)})]},e.id))]},e))})]})}var K=e.i(22530),J=e.i(68498),G=e.i(1088);function H({data:e}){let[i,n]=(0,s.useState)(e),[l,c]=(0,s.useState)(!1),x=(0,s.useRef)(null),[u,f]=(0,s.useState)(!1),g=(0,G.useVoice)(),[j,k]=(0,s.useState)(null),[N,y]=(0,s.useState)("projects"),[w,C]=(0,s.useState)(null),[S,L]=(0,s.useState)(null),$=(0,s.useRef)(null),[T,I]=(0,s.useState)(null);(0,s.useEffect)(()=>{fetch("/api/version-check").then(e=>e.ok?e.json():null).then(e=>{e?.current&&I(e.current)}).catch(()=>{})},[]);let M=i.projects.map(e=>({...e,activeSessions:null!==j?j[e.id]??0:e.activeSessions??0})),A=M.filter(e=>e.accessible),D=M.filter(e=>!e.accessible),[P,_]=(0,s.useState)(!1),O=(0,r.useRouter)();(0,a.useKeyboardShortcuts)({onNumberKey:e=>{let t=A[e-1];t&&O.push(`/project/${t.id}`)},enabled:"projects"===N&&!P});let E=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/dashboard");if(e.ok){let t=await e.json();n(t)}}catch(e){console.error("Failed to refresh dashboard:",e)}},[]),F=(0,s.useCallback)(async e=>{try{let t=await fetch("/api/bridge/stats",{signal:e});if(t.ok){let e=await t.json(),s=e.sessions.find(e=>"global:global"===e.name||/^global:[^:]+:global$/.test(e.name));f(s?.isActive??!1);let r={};for(let t of e.sessions)if(t.isActive){let e=t.name.split(":")[0];r[e]=(r[e]||0)+1}k(r)}}catch{}},[]);(0,o.usePolling)(F,1e3),(0,s.useEffect)(()=>(x.current=d.connectionManager.createManagedEventSource("/api/kanban/stream",{onOpen:()=>{c(!0)},onError:()=>{c(!1)},connected:()=>{c(!0)},update:()=>{E()}}),()=>{x.current&&(d.connectionManager.closeConnection(x.current),x.current=null),c(!1)}),[E]);let R=(0,s.useCallback)(e=>{e.preventDefault(),e.dataTransfer.dropEffect="move";let t=$.current;if(!t)return;let s=Array.from(t.children).filter(e=>null!==e.getAttribute("data-project-card"));if(0===s.length)return void L(0);let r=[];for(let e=0;e<s.length;e++){let t=s[e].getBoundingClientRect(),d=r.find(e=>10>Math.abs(e.top-t.top));d?(d.indices.push(e),d.rects.push(t),d.bottom=Math.max(d.bottom,t.bottom)):r.push({indices:[e],rects:[t],top:t.top,bottom:t.bottom})}let d=r[r.length-1];for(let t of r){let s=r.indexOf(t),o=r[s+1],a=o?(t.bottom+o.top)/2:1/0;if(e.clientY<a){d=t;break}}let o=d.indices[d.indices.length-1]+1;for(let t=0;t<d.rects.length;t++){let s=d.rects[t].left+d.rects[t].width/2;if(e.clientX<s){o=d.indices[t];break}}let a=A.findIndex(e=>e.id===w);-1!==a&&(o===a||o===a+1)?L(null):L(o)},[w,A]),W=(0,s.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect(),s=e.clientX,r=e.clientY;(s<t.left||s>t.right||r<t.top||r>t.bottom)&&L(null)},[]),B=(0,s.useCallback)(async e=>{e.preventDefault();let t=e.dataTransfer.getData("text/plain");if(!t||null===S){L(null),C(null);return}let s=A.map(e=>e.id),r=s.indexOf(t);if(-1===r){L(null),C(null);return}let d=[...s];d.splice(r,1),d.splice(S>r?S-1:S,0,t);let o=[...d,...D.map(e=>e.id)];L(null),C(null);let a=new Map(i.projects.map(e=>[e.id,e])),l=o.map(e=>a.get(e)).filter(e=>void 0!==e);n(e=>({...e,projects:l}));try{await fetch("/api/projects/reorder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectIds:o})})}catch(e){console.error("Failed to persist project order:",e)}},[S,A,D,i.projects]);function U(e,t){return void 0===e?"text-void-950 dark:text-void-100":e>t?"text-neon-orange-500 dark:text-neon-orange-400":"text-void-950 dark:text-void-100"}return(0,t.jsxs)("div",{className:"relative min-h-screen bg-void-50 dark:bg-void-950",children:[(0,t.jsx)("div",{className:"pointer-events-none fixed inset-0 hidden dark:block",style:{background:"radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0,191,255,0.04) 0%, rgba(255,140,0,0.02) 30%, transparent 70%)"}}),(0,t.jsx)(p.ConnectionStatusIndicator,{position:"top-right"}),(0,t.jsx)(J.VersionUpdateToast,{}),(0,t.jsx)("div",{className:"absolute right-4 top-4 z-10",children:(0,t.jsx)(K.ThemeToggle,{})}),(0,t.jsxs)("div",{className:"relative flex flex-col items-center pb-2 pt-10",children:[(0,t.jsx)("img",{src:"/slycode_light.webp",alt:"SlyCode",className:"logo-breathe h-auto w-[200px] mix-blend-multiply dark:hidden"}),(0,t.jsx)("img",{src:"/slycode.webp",alt:"SlyCode",className:"logo-breathe hidden h-auto w-[200px] mix-blend-lighten dark:block"}),(0,t.jsx)("p",{className:"mt-1 text-xs font-medium uppercase tracking-[0.3em] text-neon-blue-500 dark:text-neon-blue-400/70",style:{textShadow:"0 0 8px rgba(0,191,255,0.3)"},children:"Code Den"}),(0,t.jsxs)("div",{className:"mx-auto mt-6 flex w-full max-w-lg items-center gap-3",children:[(0,t.jsx)(b.SearchBar,{onResultClick:e=>{window.location.href=`/project/${e.projectId}?card=${e.cardId}`}}),l&&(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5 text-xs text-neon-blue-500 dark:text-neon-blue-400",children:[(0,t.jsx)("span",{className:"h-2 w-2 rounded-full bg-neon-blue-400 animate-pulse",style:{boxShadow:"0 0 6px rgba(0,191,255,0.6)"}}),"Live"]})]})]}),(0,t.jsx)("div",{className:"border-b border-void-100 dark:border-void-700",children:(0,t.jsx)("div",{className:"mx-auto max-w-5xl px-4 py-4 sm:px-6 lg:px-8",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[(0,t.jsxs)("button",{onClick:()=>y("projects"),className:"rounded-xl border border-void-200 bg-white p-4 text-left shadow-(--shadow-card) transition-all hover:border-neon-blue-400/30 hover:shadow-[0_8px_30px_rgba(0,0,0,0.18)] dark:hover:shadow-[0_8px_30px_rgba(0,0,0,0.7)] dark:border-void-700 dark:bg-void-850 dark:hover:border-neon-blue-400/25",children:[(0,t.jsx)("p",{className:"text-sm text-void-400",children:"Code Den"}),(0,t.jsx)("p",{className:"text-2xl font-bold text-void-950 dark:text-void-100",children:i.projects.length})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-void-200 bg-white p-4 shadow-(--shadow-card) dark:border-void-700 dark:bg-void-850",children:[(0,t.jsx)("p",{className:"text-sm text-void-400",children:"Backlog Items"}),(0,t.jsx)("p",{className:`text-2xl font-bold ${U(i.totalBacklogItems,20)}`,children:i.totalBacklogItems})]}),(0,t.jsxs)("button",{onClick:()=>y("cli-assets"),className:"rounded-xl border border-void-200 bg-white p-4 text-left shadow-(--shadow-card) transition-all hover:border-neon-blue-400/30 hover:shadow-[0_8px_30px_rgba(0,0,0,0.18)] dark:hover:shadow-[0_8px_30px_rgba(0,0,0,0.7)] dark:border-void-700 dark:bg-void-850 dark:hover:border-neon-blue-400/25",children:[(0,t.jsx)("p",{className:"text-sm text-void-400",children:"Outdated Assets"}),(0,t.jsx)("p",{className:`text-2xl font-bold ${U(i.totalOutdatedAssets,0)}`,children:i.totalOutdatedAssets??0})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-void-200 bg-white p-4 shadow-(--shadow-card) dark:border-void-700 dark:bg-void-850",children:[(0,t.jsx)("p",{className:"text-sm text-void-400",children:"Uncommitted"}),(0,t.jsx)("p",{className:`text-2xl font-bold ${U(i.totalUncommitted,0)}`,children:i.totalUncommitted??0})]})]})})}),(0,t.jsx)("div",{className:"border-b border-void-100 dark:border-void-700",children:(0,t.jsx)("div",{className:"mx-auto max-w-5xl px-4 sm:px-6 lg:px-8",children:(0,t.jsxs)("nav",{className:"flex gap-6",children:[(0,t.jsx)("button",{onClick:()=>y("projects"),className:`border-b-2 py-3 text-sm font-medium transition-colors ${"projects"===N?"border-neon-blue-400 text-neon-blue-500 dark:text-neon-blue-400":"border-transparent text-void-500 hover:text-void-300 dark:text-void-400 dark:hover:text-void-300"}`,children:"Code Den"}),(0,t.jsxs)("button",{onClick:()=>y("cli-assets"),className:`flex items-center gap-2 border-b-2 py-3 text-sm font-medium transition-colors ${"cli-assets"===N?"border-neon-blue-400 text-neon-blue-500 dark:text-neon-blue-400":"border-transparent text-void-500 hover:text-void-300 dark:text-void-400 dark:hover:text-void-300"}`,children:["CLI Assets",(i.totalOutdatedAssets??0)>0&&(0,t.jsx)("span",{className:"rounded-full border border-neon-orange-400/20 bg-neon-orange-400/10 px-2 py-0.5 text-xs font-medium text-neon-orange-500 dark:text-neon-orange-400",children:i.totalOutdatedAssets})]})]})})}),(0,t.jsxs)("main",{className:"mx-auto max-w-5xl px-4 py-8 sm:px-6 lg:px-8",children:["projects"===N?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"mb-6 text-sm text-void-400 dark:text-void-500",children:"Your registered projects and their kanban boards"}),(0,t.jsxs)("section",{className:"mb-8",children:[(0,t.jsx)("h2",{className:"mb-4 text-lg font-semibold text-void-950 dark:text-void-100",children:"Projects"}),(0,t.jsxs)("div",{ref:$,className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",onDragOver:R,onDragLeave:W,onDrop:B,children:[A.map((e,s)=>(0,t.jsxs)("div",{"data-project-card":!0,className:"relative",children:[w&&S===s&&(0,t.jsx)("div",{className:"pointer-events-none absolute -left-1 top-0 bottom-0 w-1 rounded-full bg-neon-blue-400 shadow-[0_0_8px_rgba(0,191,255,0.5)]"}),(0,t.jsx)(m,{project:e,onDeleted:E,shortcutKey:s<10?9===s?0:s+1:void 0,onDragStart:()=>C(e.id),onDragEnd:()=>{C(null),L(null)}})]},e.id)),(0,t.jsxs)("div",{className:"relative",children:[w&&S===A.length&&(0,t.jsx)("div",{className:"pointer-events-none absolute -left-1 top-0 bottom-0 w-1 rounded-full bg-neon-blue-400 shadow-[0_0_8px_rgba(0,191,255,0.5)]"}),(0,t.jsx)("button",{onClick:()=>_(!0),className:"flex min-h-[120px] w-full items-center justify-center rounded-xl border-2 border-dashed border-void-200 p-4 transition-all hover:border-neon-blue-400/30 dark:border-void-700 dark:hover:border-neon-blue-400/30",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("span",{className:"text-3xl text-void-400 dark:text-void-500",children:"+"}),(0,t.jsx)("p",{className:"mt-1 text-sm text-void-500 dark:text-void-400",children:"Add Project"})]})})]})]})]}),D.length>0&&(0,t.jsxs)("section",{className:"mb-8",children:[(0,t.jsx)("h2",{className:"mb-4 text-lg font-semibold text-void-500 dark:text-void-400",children:"Unavailable"}),(0,t.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:D.map(e=>(0,t.jsx)(m,{project:e,onDeleted:E},e.id))})]}),(0,t.jsx)("section",{children:(0,t.jsx)(z,{})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"mb-6 text-sm text-void-400 dark:text-void-500",children:"Reusable skills, agents, and configs — manage and deploy across projects"}),(0,t.jsx)(V,{})]}),(0,t.jsxs)("footer",{className:"mt-8 text-center text-sm text-void-400 dark:text-void-600",children:[(0,t.jsxs)("p",{children:["Last refresh: ",new Date(i.lastRefresh).toLocaleString()]}),(0,t.jsxs)("p",{className:"mt-2 text-xs text-void-500 dark:text-void-400",children:["© 2026 SlyCode (",(0,t.jsx)("a",{href:"https://slycode.ai",target:"_blank",rel:"noopener noreferrer",className:"hover:text-neon-blue-500 dark:hover:text-neon-blue-400 transition-colors",children:"slycode.ai"}),"). All rights reserved.",T&&(0,t.jsxs)("span",{className:"ml-2 text-void-400 dark:text-void-500",children:["v",T]})]})]})]}),(0,t.jsx)(h,{open:P,onClose:()=>_(!1),onCreated:E}),(0,t.jsx)(v.GlobalClaudePanel,{sessionNameOverride:"global:global",cwdOverride:i.slycodeRoot,terminalClassOverride:"global-terminal",isActive:u,label:"Global Terminal",voiceTerminalId:"dashboard-global",onTerminalReady:e=>{e?g.registerTerminal("dashboard-global",e):g.unregisterTerminal("dashboard-global")}})]})}e.s(["Dashboard",()=>H],58116)}]);