whatisgoingon 1.0.0 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/cli.js CHANGED
@@ -1,39 +1,56 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { fileURLToPath } from 'url';
4
- import { dirname, join } from 'path';
3
+ import { fileURLToPath } from "url";
4
+ import { dirname, join } from "path";
5
5
 
6
6
  const __filename = fileURLToPath(import.meta.url);
7
7
  const __dirname = dirname(__filename);
8
8
 
9
9
  async function main() {
10
- console.log('\nšŸ” What Is Going On? - Cursor AI Chat History Browser\n');
10
+ console.log("\nšŸ” What Is Going On? - Cursor AI Chat History Browser\n");
11
+
12
+ const serverPath = join(__dirname, "..", "dist", "server.js");
11
13
 
12
- // Import and start the server
13
- const serverPath = join(__dirname, '..', 'dist', 'server.js');
14
-
15
14
  try {
16
15
  // Dynamic import the server module - this starts the server
17
- const { PORT } = await import(serverPath);
18
-
19
- // Wait a moment for server to start
20
- await new Promise(resolve => setTimeout(resolve, 500));
21
-
16
+ const serverModule = await import(serverPath);
17
+ const PORT = serverModule.PORT || 3456;
18
+
19
+ // Wait for server to be ready
20
+ await new Promise((resolve) => setTimeout(resolve, 1000));
21
+
22
22
  // Open browser
23
- const open = (await import('open')).default;
23
+ const open = (await import("open")).default;
24
24
  const url = `http://localhost:${PORT}`;
25
-
26
- console.log('šŸ“‚ Opening browser...\n');
27
- console.log('Press Ctrl+C to stop the server\n');
28
-
25
+
26
+ console.log("šŸ“‚ Opening browser...\n");
27
+ console.log("Press Ctrl+C to stop the server\n");
28
+
29
29
  await open(url);
30
+
31
+ // Keep the process alive - the server's listen() should do this,
32
+ // but we add explicit signal handlers to be safe
33
+ process.on("SIGINT", () => {
34
+ console.log("\nšŸ‘‹ Shutting down server...");
35
+ process.exit(0);
36
+ });
37
+
38
+ process.on("SIGTERM", () => {
39
+ console.log("\nšŸ‘‹ Shutting down server...");
40
+ process.exit(0);
41
+ });
42
+
43
+ // Keep alive by preventing the event loop from exiting
44
+ // The server.listen() should already do this, but just in case
45
+ setInterval(() => {}, 1 << 30); // ~12 days interval - keeps process alive
30
46
  } catch (error) {
31
- if (error.code === 'ERR_MODULE_NOT_FOUND') {
32
- console.error('āŒ Error: Server not built.\n');
33
- console.error('If you cloned this repo, run:');
34
- console.error(' pnpm install && pnpm build\n');
47
+ if (error.code === "ERR_MODULE_NOT_FOUND") {
48
+ console.error("āŒ Error: Server not built.\n");
49
+ console.error("If you cloned this repo, run:");
50
+ console.error(" pnpm install && pnpm build\n");
35
51
  } else {
36
- console.error('Error starting server:', error.message);
52
+ console.error("Error starting server:", error.message);
53
+ console.error(error.stack);
37
54
  }
38
55
  process.exit(1);
39
56
  }
@@ -41,4 +41,4 @@ Error generating stack: `+l.message+`
41
41
  `})}),o}function HS({selections:u,onRemove:c,onClearAll:o}){const[s,f]=x.useState(!1),[m,y]=x.useState(!1),[S,g]=x.useState([]),[h,N]=x.useState("");x.useEffect(()=>{s&&u.length>0&&(y(!0),(async()=>{const H=[];for(const[,q]of u)try{const k=await(await fetch(`/api/composers/${q.composer.composerId}/bubbles`)).json();H.push({composer:q,bubbles:k})}catch{H.push({composer:q,bubbles:[]})}g(H),N(jS(H)),y(!1)})())},[s,u]);const T=async()=>{if(h)await navigator.clipboard.writeText(h),alert(`Copied ${u.length} conversations to clipboard!`);else{const A=u.map(([,H])=>`- ${H.composer.name} (${H.workspaceName})`).join(`
42
42
  `);await navigator.clipboard.writeText(`# Selected Conversations
43
43
 
44
- ${A}`),alert(`Copied ${u.length} conversation titles to clipboard!`)}},M=async()=>{await navigator.clipboard.writeText(h),alert("Copied to clipboard!")};return z.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[z.jsxs("div",{className:"flex items-center justify-between px-4 py-4 border-b border-border shrink-0",children:[z.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[z.jsx("span",{children:"āœ… Selected"}),z.jsx("span",{className:"bg-success text-white text-xs px-2 py-0.5 rounded-full font-semibold",children:u.length})]}),z.jsx("button",{onClick:o,className:"text-xs px-2 py-1 rounded bg-bg-tertiary text-text-secondary border border-border hover:bg-bg-hover hover:text-text-primary transition-all",children:"Clear All"})]}),z.jsx("div",{className:"flex-1 overflow-y-auto p-3 min-h-0",children:u.length===0?z.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-muted py-10",children:[z.jsx("span",{className:"text-3xl opacity-50",children:"šŸ“‹"}),z.jsx("span",{className:"mt-2 text-sm font-medium text-text-secondary",children:"No selections yet"}),z.jsx("span",{className:"text-xs",children:"Click on conversations to select them"})]}):z.jsx("div",{className:"space-y-2",children:u.map(([A,H])=>{const q=ha(H.composer.mode);return z.jsxs("div",{className:"relative p-3 bg-bg-tertiary rounded-lg border border-border",children:[z.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[z.jsx("span",{className:`text-[9px] font-semibold px-1.5 py-0.5 rounded-full uppercase ${q.color==="terminal"?"bg-terminal/15 text-terminal":q.color==="agent"?"bg-agent/15 text-agent":"bg-chat/15 text-chat"}`,children:q.label}),z.jsx("span",{className:"text-[10px] text-text-muted truncate flex-1",children:H.workspaceName}),z.jsx("button",{onClick:()=>c(A),className:"text-text-muted hover:text-danger transition-colors text-sm leading-none",children:"Ɨ"})]}),z.jsx("div",{className:"font-medium text-xs text-text-primary line-clamp-2 mb-1",children:H.composer.name}),z.jsx("div",{className:"text-[10px] text-text-muted",children:Is(H.composer.lastUpdatedAt)})]},A)})})}),z.jsxs("div",{className:"p-3 border-t border-border space-y-2 shrink-0",children:[z.jsx("button",{onClick:()=>f(!0),disabled:u.length===0,className:"w-full py-2 px-4 rounded-lg bg-success text-white font-medium text-sm hover:bg-green-600 transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:"šŸ“‹ View Summary"}),z.jsx("button",{onClick:T,disabled:u.length===0,className:"w-full py-2 px-4 rounded-lg bg-accent-primary text-white font-medium text-sm hover:bg-accent-secondary transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:"šŸ“Ž Copy to Clipboard"})]}),z.jsx(_S,{open:s,onOpenChange:f,children:z.jsxs(bS,{children:[z.jsx(_0,{className:"fixed inset-0 bg-black/70 backdrop-blur-sm z-50"}),z.jsxs(vS,{className:"fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[90%] max-w-4xl max-h-[85vh] bg-bg-secondary rounded-2xl border border-border z-50 flex flex-col overflow-hidden animate-in fade-in zoom-in-95 duration-200",children:[z.jsxs(US,{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[z.jsxs("div",{children:[z.jsx("span",{className:"text-lg font-semibold",children:"šŸ“‹ Conversation Summary"}),z.jsxs("div",{className:"text-xs text-text-muted mt-1",children:[u.length," conversation",u.length!==1?"s":""," selected"]})]}),z.jsx(Eh,{className:"text-text-muted hover:text-text-primary text-2xl leading-none",children:"Ɨ"})]}),z.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:m?z.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[z.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-3 border-border border-t-accent-primary"}),z.jsx("div",{className:"mt-4 text-text-muted text-sm",children:"Loading conversations..."})]}):z.jsx("div",{className:"space-y-6",children:S.map((A,H)=>z.jsxs("div",{className:"bg-bg-tertiary rounded-xl p-4 border border-border",children:[z.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[z.jsx("span",{className:`text-[10px] font-semibold px-2 py-1 rounded-full uppercase ${ha(A.composer.composer.mode).color==="agent"?"bg-agent/15 text-agent":A.composer.composer.mode==="terminal"?"bg-terminal/15 text-terminal":"bg-chat/15 text-chat"}`,children:ha(A.composer.composer.mode).label}),z.jsxs("span",{className:"text-xs text-text-muted",children:["šŸ“ ",A.composer.workspaceName]})]}),z.jsx("h3",{className:"font-semibold text-text-primary mb-3",children:A.composer.composer.name}),z.jsx("div",{className:"space-y-3",children:A.bubbles.length===0?z.jsx("div",{className:"text-text-muted text-sm italic",children:"No messages found"}):A.bubbles.map(q=>z.jsxs("div",{className:`rounded-lg p-3 ${q.type===1?"bg-accent-primary/10 border-l-2 border-accent-primary":"bg-bg-secondary border-l-2 border-terminal"}`,children:[z.jsx("div",{className:"text-[10px] font-semibold mb-1.5 text-text-muted uppercase",children:q.type===1?"šŸ‘¤ User":"šŸ¤– AI"}),z.jsx("div",{className:"text-sm text-text-secondary whitespace-pre-wrap break-words leading-relaxed",children:q.text.length>500?q.text.substring(0,500)+"...":q.text})]},q.bubbleId))})]},H))})}),z.jsxs("div",{className:"flex justify-between items-center gap-3 px-6 py-4 border-t border-border",children:[z.jsxs("div",{className:"text-xs text-text-muted",children:[!m&&S.reduce((A,H)=>A+H.bubbles.length,0)," total messages"]}),z.jsxs("div",{className:"flex gap-3",children:[z.jsx(Eh,{className:"px-4 py-2 rounded-lg bg-bg-tertiary text-text-secondary border border-border hover:bg-bg-hover hover:text-text-primary transition-all text-sm font-medium",children:"Close"}),z.jsx("button",{onClick:M,disabled:m,className:"px-4 py-2 rounded-lg bg-accent-primary text-white hover:bg-accent-secondary transition-all text-sm font-medium flex items-center gap-2 disabled:opacity-50",children:"šŸ“‹ Copy as Markdown"})]})]})]})]})})]})}function BS({composer:u,onClose:c}){const{bubbles:o,loading:s}=yp(u?.composerId||null);if(!u)return z.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-muted py-10",children:[z.jsx("span",{className:"text-4xl opacity-50",children:"šŸ’¬"}),z.jsx("span",{className:"mt-3 text-sm font-medium text-text-secondary",children:"Select a conversation"}),z.jsx("span",{className:"text-xs",children:"Click on a conversation to view its content"})]});const f=ha(u.mode),m=u.workspaceFolder?$s(u.workspaceFolder,u.workspaceId||""):"Unknown workspace";return z.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[z.jsxs("div",{className:"px-4 py-3 border-b border-border bg-bg-secondary shrink-0",children:[z.jsxs("div",{className:"flex items-center justify-between mb-2",children:[z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsx("span",{className:`text-[10px] font-semibold px-2 py-1 rounded-full uppercase tracking-wide ${f.color==="terminal"?"bg-terminal/15 text-terminal":f.color==="agent"?"bg-agent/15 text-agent":"bg-chat/15 text-chat"}`,children:f.label}),z.jsx("span",{className:"text-xs text-text-muted",children:Is(u.lastUpdatedAt)})]}),z.jsx("button",{onClick:c,className:"text-text-muted hover:text-text-primary text-lg leading-none",children:"Ɨ"})]}),z.jsx("div",{className:"font-medium text-text-primary line-clamp-2",children:u.name}),z.jsxs("div",{className:"text-xs text-text-muted mt-1",children:["šŸ“ ",m]})]}),z.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 min-h-0",children:s?z.jsx("div",{className:"flex items-center justify-center py-10",children:z.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-border border-t-accent-primary"})}):o.length===0?z.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-text-muted",children:[z.jsx("span",{className:"text-3xl opacity-50",children:"šŸ“­"}),z.jsx("span",{className:"mt-2 text-sm",children:"No messages found"})]}):o.map(y=>z.jsxs("div",{className:`rounded-xl p-4 ${y.type===1?"bg-accent-primary/10 border border-accent-primary/30 ml-8":"bg-bg-secondary border border-border mr-8"}`,children:[z.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[z.jsx("span",{className:`text-[10px] font-semibold px-2 py-0.5 rounded-full ${y.type===1?"bg-accent-primary/20 text-accent-secondary":"bg-terminal/15 text-terminal"}`,children:y.type===1?"šŸ‘¤ You":"šŸ¤– AI"}),y.createdAt&&z.jsx("span",{className:"text-[10px] text-text-muted",children:new Date(y.createdAt).toLocaleTimeString()})]}),z.jsx("div",{className:"font-mono text-sm text-text-secondary whitespace-pre-wrap break-words leading-relaxed",children:y.text})]},y.bubbleId))}),z.jsx("div",{className:"px-4 py-3 border-t border-border bg-bg-secondary shrink-0",children:z.jsxs("div",{className:"text-xs text-text-muted",children:[o.length," messages in this conversation"]})})]})}function wS(){const[u,c]=x.useState(null),[o,s]=x.useState(null),{dates:f,loading:m}=mp(),{composers:y,loading:S}=hp(u),{selectedList:g,isSelected:h,toggleSelection:N,removeSelection:T,clearAll:M}=vp();x.useMemo(()=>{if(f.length>0&&!u){const V=new Date().toLocaleDateString("en-CA");f.find(W=>W.date===V)?c(V):f.length>0&&c(f[0].date)}},[f,u]);const A=(V,k)=>{o?.composerId===V.composerId?N(V,k):s({...V,workspaceFolder:V.workspaceFolder,workspaceId:V.workspaceId})},H=()=>{y.forEach(V=>{const k=V.workspaceFolder?$s(V.workspaceFolder,V.workspaceId||""):"Unknown";h(V.composerId)||N(V,k)})},q=f.find(V=>V.date===u);return z.jsxs("div",{className:"h-screen overflow-hidden grid grid-cols-[260px_1fr_400px_320px]",children:[z.jsxs("aside",{className:"bg-bg-secondary border-r border-border flex flex-col h-screen overflow-hidden",children:[z.jsx("div",{className:"p-4 border-b border-border shrink-0",children:z.jsxs("div",{className:"flex items-center gap-2.5",children:[z.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-accent-primary to-agent flex items-center justify-center text-base",children:"šŸ’¬"}),z.jsxs("div",{children:[z.jsx("div",{className:"font-semibold text-base leading-tight",children:"Chat Browser"}),z.jsx("div",{className:"text-[10px] text-text-muted",children:"Cursor AI History"})]})]})}),z.jsx("div",{className:"flex-1 overflow-y-auto p-2 min-h-0",children:z.jsx(Ep,{dates:f,selectedDate:u,onSelectDate:V=>{c(V),s(null)},loading:m})})]}),z.jsxs("div",{className:"bg-bg-primary border-r border-border flex flex-col h-screen overflow-hidden",children:[z.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between shrink-0",children:[z.jsxs("div",{children:[z.jsx("div",{className:"font-medium text-sm",children:u?bp(u):"Select a date"}),q&&z.jsxs("div",{className:"text-[10px] text-text-muted mt-0.5",children:[q.composerCount," conversations"]})]}),z.jsx("button",{onClick:H,disabled:y.length===0,className:"px-2 py-1 text-[10px] font-medium rounded bg-bg-tertiary text-text-secondary border border-border hover:bg-bg-hover hover:text-text-primary transition-all disabled:opacity-50",children:"Select All"})]}),z.jsx("div",{className:"flex-1 overflow-y-auto p-3 min-h-0",children:z.jsx(R0,{composers:y,isSelected:h,onToggle:A,onSelectAll:H,loading:S,showWorkspace:!0,activeComposerId:o?.composerId})})]}),z.jsx("div",{className:"bg-bg-primary border-r border-border h-screen overflow-hidden",children:z.jsx(BS,{composer:o,onClose:()=>s(null)})}),z.jsx("div",{className:"bg-bg-secondary h-screen overflow-hidden",children:z.jsx(HS,{selections:g,onRemove:T,onClearAll:M})})]})}dp.createRoot(document.getElementById("root")).render(z.jsx(x.StrictMode,{children:z.jsx(wS,{})}));
44
+ ${A}`),alert(`Copied ${u.length} conversation titles to clipboard!`)}},M=async()=>{await navigator.clipboard.writeText(h),alert("Copied to clipboard!")};return z.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[z.jsxs("div",{className:"flex items-center justify-between px-4 py-4 border-b border-border shrink-0",children:[z.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[z.jsx("span",{children:"āœ… Selected"}),z.jsx("span",{className:"bg-success text-white text-xs px-2 py-0.5 rounded-full font-semibold",children:u.length})]}),z.jsx("button",{onClick:o,className:"text-xs px-2 py-1 rounded bg-bg-tertiary text-text-secondary border border-border hover:bg-bg-hover hover:text-text-primary transition-all",children:"Clear All"})]}),z.jsx("div",{className:"flex-1 overflow-y-auto p-3 min-h-0",children:u.length===0?z.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-muted py-10",children:[z.jsx("span",{className:"text-3xl opacity-50",children:"šŸ“‹"}),z.jsx("span",{className:"mt-2 text-sm font-medium text-text-secondary",children:"No selections yet"}),z.jsx("span",{className:"text-xs",children:"Click on conversations to select them"})]}):z.jsx("div",{className:"space-y-2",children:u.map(([A,H])=>{const q=ha(H.composer.mode);return z.jsxs("div",{className:"relative p-3 bg-bg-tertiary rounded-lg border border-border",children:[z.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[z.jsx("span",{className:`text-[9px] font-semibold px-1.5 py-0.5 rounded-full uppercase ${q.color==="terminal"?"bg-terminal/15 text-terminal":q.color==="agent"?"bg-agent/15 text-agent":"bg-chat/15 text-chat"}`,children:q.label}),z.jsx("span",{className:"text-[10px] text-text-muted truncate flex-1",children:H.workspaceName}),z.jsx("button",{onClick:()=>c(A),className:"text-text-muted hover:text-danger transition-colors text-sm leading-none",children:"Ɨ"})]}),z.jsx("div",{className:"font-medium text-xs text-text-primary line-clamp-2 mb-1",children:H.composer.name}),z.jsx("div",{className:"text-[10px] text-text-muted",children:Is(H.composer.lastUpdatedAt)})]},A)})})}),z.jsxs("div",{className:"p-3 border-t border-border space-y-2 shrink-0",children:[z.jsx("button",{onClick:()=>f(!0),disabled:u.length===0,className:"w-full py-2 px-4 rounded-lg bg-success text-white font-medium text-sm hover:bg-green-600 transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:"šŸ“‹ View Summary"}),z.jsx("button",{onClick:T,disabled:u.length===0,className:"w-full py-2 px-4 rounded-lg bg-accent-primary text-white font-medium text-sm hover:bg-accent-secondary transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:"šŸ“Ž Copy to Clipboard"})]}),z.jsx(_S,{open:s,onOpenChange:f,children:z.jsxs(bS,{children:[z.jsx(_0,{className:"fixed inset-0 bg-black/70 backdrop-blur-sm z-50"}),z.jsxs(vS,{className:"fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[90%] max-w-4xl max-h-[85vh] bg-bg-secondary rounded-2xl border border-border z-50 flex flex-col overflow-hidden animate-in fade-in zoom-in-95 duration-200",children:[z.jsxs(US,{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[z.jsxs("div",{children:[z.jsx("span",{className:"text-lg font-semibold",children:"šŸ“‹ Conversation Summary"}),z.jsxs("div",{className:"text-xs text-text-muted mt-1",children:[u.length," conversation",u.length!==1?"s":""," selected"]})]}),z.jsx(Eh,{className:"text-text-muted hover:text-text-primary text-2xl leading-none",children:"Ɨ"})]}),z.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:m?z.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[z.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-3 border-border border-t-accent-primary"}),z.jsx("div",{className:"mt-4 text-text-muted text-sm",children:"Loading conversations..."})]}):z.jsx("div",{className:"space-y-6",children:S.map((A,H)=>z.jsxs("div",{className:"bg-bg-tertiary rounded-xl p-4 border border-border",children:[z.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[z.jsx("span",{className:`text-[10px] font-semibold px-2 py-1 rounded-full uppercase ${ha(A.composer.composer.mode).color==="agent"?"bg-agent/15 text-agent":A.composer.composer.mode==="terminal"?"bg-terminal/15 text-terminal":"bg-chat/15 text-chat"}`,children:ha(A.composer.composer.mode).label}),z.jsxs("span",{className:"text-xs text-text-muted",children:["šŸ“ ",A.composer.workspaceName]})]}),z.jsx("h3",{className:"font-semibold text-text-primary mb-3",children:A.composer.composer.name}),z.jsx("div",{className:"space-y-3",children:A.bubbles.length===0?z.jsx("div",{className:"text-text-muted text-sm italic",children:"No messages found"}):A.bubbles.map(q=>z.jsxs("div",{className:`rounded-lg p-3 ${q.type===1?"bg-accent-primary/10 border-l-2 border-accent-primary":"bg-bg-secondary border-l-2 border-terminal"}`,children:[z.jsx("div",{className:"text-[10px] font-semibold mb-1.5 text-text-muted uppercase",children:q.type===1?"šŸ‘¤ User":"šŸ¤– AI"}),z.jsx("div",{className:"text-sm text-text-secondary whitespace-pre-wrap break-words leading-relaxed",children:q.text.length>500?q.text.substring(0,500)+"...":q.text})]},q.bubbleId))})]},H))})}),z.jsxs("div",{className:"flex justify-between items-center gap-3 px-6 py-4 border-t border-border",children:[z.jsxs("div",{className:"text-xs text-text-muted",children:[!m&&S.reduce((A,H)=>A+H.bubbles.length,0)," total messages"]}),z.jsxs("div",{className:"flex gap-3",children:[z.jsx(Eh,{className:"px-4 py-2 rounded-lg bg-bg-tertiary text-text-secondary border border-border hover:bg-bg-hover hover:text-text-primary transition-all text-sm font-medium",children:"Close"}),z.jsx("button",{onClick:M,disabled:m,className:"px-4 py-2 rounded-lg bg-accent-primary text-white hover:bg-accent-secondary transition-all text-sm font-medium flex items-center gap-2 disabled:opacity-50",children:"šŸ“‹ Copy as Markdown"})]})]})]})]})})]})}function BS({composer:u,onClose:c}){const{bubbles:o,loading:s}=yp(u?.composerId||null);if(!u)return z.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-muted py-10",children:[z.jsx("span",{className:"text-4xl opacity-50",children:"šŸ’¬"}),z.jsx("span",{className:"mt-3 text-sm font-medium text-text-secondary",children:"Select a conversation"}),z.jsx("span",{className:"text-xs",children:"Click on a conversation to view its content"})]});const f=ha(u.mode),m=u.workspaceFolder?$s(u.workspaceFolder,u.workspaceId||""):"Unknown workspace";return z.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[z.jsxs("div",{className:"px-4 py-3 border-b border-border bg-bg-secondary shrink-0",children:[z.jsxs("div",{className:"flex items-center justify-between mb-2",children:[z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsx("span",{className:`text-[10px] font-semibold px-2 py-1 rounded-full uppercase tracking-wide ${f.color==="terminal"?"bg-terminal/15 text-terminal":f.color==="agent"?"bg-agent/15 text-agent":"bg-chat/15 text-chat"}`,children:f.label}),z.jsx("span",{className:"text-xs text-text-muted",children:Is(u.lastUpdatedAt)})]}),z.jsx("button",{onClick:c,className:"text-text-muted hover:text-text-primary text-lg leading-none",children:"Ɨ"})]}),z.jsx("div",{className:"font-medium text-text-primary line-clamp-2",children:u.name}),z.jsxs("div",{className:"text-xs text-text-muted mt-1",children:["šŸ“ ",m]})]}),z.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 min-h-0",children:s?z.jsx("div",{className:"flex items-center justify-center py-10",children:z.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-border border-t-accent-primary"})}):o.length===0?z.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-text-muted",children:[z.jsx("span",{className:"text-3xl opacity-50",children:"šŸ“­"}),z.jsx("span",{className:"mt-2 text-sm",children:"No messages found"})]}):o.map(y=>z.jsxs("div",{className:`rounded-xl p-4 ${y.type===1?"bg-accent-primary/10 border border-accent-primary/30 ml-8":"bg-bg-secondary border border-border mr-8"}`,children:[z.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[z.jsx("span",{className:`text-[10px] font-semibold px-2 py-0.5 rounded-full ${y.type===1?"bg-accent-primary/20 text-accent-secondary":"bg-terminal/15 text-terminal"}`,children:y.type===1?"šŸ‘¤ You":"šŸ¤– AI"}),y.createdAt&&z.jsx("span",{className:"text-[10px] text-text-muted",children:new Date(y.createdAt).toLocaleTimeString()})]}),z.jsx("div",{className:"font-mono text-sm text-text-secondary whitespace-pre-wrap break-words leading-relaxed",children:y.text})]},y.bubbleId))}),z.jsx("div",{className:"px-4 py-3 border-t border-border bg-bg-secondary shrink-0",children:z.jsxs("div",{className:"text-xs text-text-muted",children:[o.length," messages in this conversation"]})})]})}function wS(){const[u,c]=x.useState(null),[o,s]=x.useState(null),{dates:f,loading:m}=mp(),{composers:y,loading:S}=hp(u),{selectedList:g,isSelected:h,toggleSelection:N,removeSelection:T,clearAll:M}=vp();x.useMemo(()=>{if(f.length>0&&!u){const V=new Date().toLocaleDateString("en-CA");f.find(W=>W.date===V)?c(V):f.length>0&&c(f[0].date)}},[f,u]);const A=(V,k)=>{s({...V,workspaceFolder:V.workspaceFolder,workspaceId:V.workspaceId}),N(V,k)},H=()=>{y.forEach(V=>{const k=V.workspaceFolder?$s(V.workspaceFolder,V.workspaceId||""):"Unknown";h(V.composerId)||N(V,k)})},q=f.find(V=>V.date===u);return z.jsxs("div",{className:"h-screen overflow-hidden grid grid-cols-[260px_1fr_400px_320px]",children:[z.jsxs("aside",{className:"bg-bg-secondary border-r border-border flex flex-col h-screen overflow-hidden",children:[z.jsx("div",{className:"p-4 border-b border-border shrink-0",children:z.jsxs("div",{className:"flex items-center gap-2.5",children:[z.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-accent-primary to-agent flex items-center justify-center text-base",children:"šŸ’¬"}),z.jsxs("div",{children:[z.jsx("div",{className:"font-semibold text-base leading-tight",children:"Chat Browser"}),z.jsx("div",{className:"text-[10px] text-text-muted",children:"Cursor AI History"})]})]})}),z.jsx("div",{className:"flex-1 overflow-y-auto p-2 min-h-0",children:z.jsx(Ep,{dates:f,selectedDate:u,onSelectDate:V=>{c(V),s(null)},loading:m})})]}),z.jsxs("div",{className:"bg-bg-primary border-r border-border flex flex-col h-screen overflow-hidden",children:[z.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between shrink-0",children:[z.jsxs("div",{children:[z.jsx("div",{className:"font-medium text-sm",children:u?bp(u):"Select a date"}),q&&z.jsxs("div",{className:"text-[10px] text-text-muted mt-0.5",children:[q.composerCount," conversations"]})]}),z.jsx("button",{onClick:H,disabled:y.length===0,className:"px-2 py-1 text-[10px] font-medium rounded bg-bg-tertiary text-text-secondary border border-border hover:bg-bg-hover hover:text-text-primary transition-all disabled:opacity-50",children:"Select All"})]}),z.jsx("div",{className:"flex-1 overflow-y-auto p-3 min-h-0",children:z.jsx(R0,{composers:y,isSelected:h,onToggle:A,onSelectAll:H,loading:S,showWorkspace:!0,activeComposerId:o?.composerId})})]}),z.jsx("div",{className:"bg-bg-primary border-r border-border h-screen overflow-hidden",children:z.jsx(BS,{composer:o,onClose:()=>s(null)})}),z.jsx("div",{className:"bg-bg-secondary h-screen overflow-hidden",children:z.jsx(HS,{selections:g,onRemove:T,onClearAll:M})})]})}dp.createRoot(document.getElementById("root")).render(z.jsx(x.StrictMode,{children:z.jsx(wS,{})}));
@@ -8,7 +8,7 @@
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
9
  <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@300;400;500;600;700&display=swap" rel="stylesheet">
10
10
  <title>Cursor Chat Browser</title>
11
- <script type="module" crossorigin src="/assets/index-CGRhpi7l.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-BJkj8CDy.js"></script>
12
12
  <link rel="stylesheet" crossorigin href="/assets/index-BC9n2roG.css">
13
13
  </head>
14
14
  <body>
package/package.json CHANGED
@@ -1,20 +1,11 @@
1
1
  {
2
2
  "name": "whatisgoingon",
3
- "version": "1.0.0",
3
+ "version": "1.0.5",
4
4
  "description": "Browse and explore your Cursor AI chat history with a beautiful web UI",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "whatisgoingon": "./bin/cli.js"
8
8
  },
9
- "scripts": {
10
- "dev": "concurrently \"tsx watch src/server.ts\" \"cd frontend && pnpm dev\"",
11
- "build": "pnpm build:server && pnpm build:frontend",
12
- "build:frontend": "cd frontend && pnpm build && rm -rf ../dist/public && cp -r dist ../dist/public",
13
- "build:server": "tsc",
14
- "start": "node bin/cli.js",
15
- "prepublishOnly": "pnpm build",
16
- "postinstall": "cd frontend && pnpm install || true"
17
- },
18
9
  "keywords": [
19
10
  "cursor",
20
11
  "chat",
@@ -43,5 +34,12 @@
43
34
  "concurrently": "^9.1.2",
44
35
  "tsx": "^4.21.0",
45
36
  "typescript": "^5.9.3"
37
+ },
38
+ "scripts": {
39
+ "dev": "concurrently \"tsx watch src/server.ts\" \"cd frontend && pnpm dev\"",
40
+ "build": "pnpm build:server && pnpm build:frontend",
41
+ "build:frontend": "cd frontend && pnpm build && rm -rf ../dist/public && cp -r dist ../dist/public",
42
+ "build:server": "tsc",
43
+ "start": "node bin/cli.js"
46
44
  }
47
45
  }