antigravity-mobile-proxy 0.1.6 → 0.1.7
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/.next/standalone/.next/app-path-routes-manifest.json +2 -0
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/routes-manifest.json +12 -0
- package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_global-error/page.js +2 -2
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +2 -2
- package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_not-found/page.js +5 -6
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/artifacts/active/route.js +5 -1
- package/.next/standalone/.next/server/app/api/v1/artifacts/active/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/changes/active/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/v1/changes/active/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/v1/changes/active/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/v1/changes/active/route.js +11 -0
- package/.next/standalone/.next/server/app/api/v1/changes/active/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/v1/changes/active/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/v1/changes/active/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/v1/changes/diff/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/v1/changes/diff/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/v1/changes/diff/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/v1/changes/diff/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/changes/diff/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/v1/changes/diff/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/v1/changes/diff/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/v1/chat/stream/route.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/chat/stream/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/windows/cdp-start/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/windows/cdp-status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/windows/close/route.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/windows/close/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/windows/open/route.js +2 -2
- package/.next/standalone/.next/server/app/api/v1/windows/open/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/debug/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/debug/page.js +5 -5
- package/.next/standalone/.next/server/app/debug/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/debug/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/page.js +5 -5
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +2 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__26662154._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__53c4f34d._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__851f6b5a._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__94275f7f._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__9a1969e6._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c34d50c8._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c696771d._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d13bbe3c._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d172e6aa._.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_v1_changes_active_route_actions_1bb9fc18.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_v1_changes_diff_route_actions_65d9ee16.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__d080cb3d._.js → [root-of-the-server]__012405ac._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__a457c799._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__f62d412e._.js → [root-of-the-server]__b9356576._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__52af585c._.js → [root-of-the-server]__ce78239f._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__ae6d24d9._.js → [root-of-the-server]__f47dc36d._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_524b2348._.js → _657ecbe9._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_fe4475aa._.js → _939145a4._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/app_layout_tsx_271801d7._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_not-found_tsx_ef35050a._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/components_chat-container_tsx_fcbc457f._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_ece394eb.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_dist_esm_build_templates_app-page_39f173ba.js → node_modules_next_dist_esm_build_templates_app-page_7f45f9bf.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_dist_f183c70b._.js → node_modules_next_dist_f21d913a._.js} +2 -2
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/500.html +2 -2
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/app/api/v1/artifacts/active/[filename]/route.ts +73 -23
- package/.next/standalone/app/api/v1/artifacts/active/route.ts +103 -52
- package/.next/standalone/app/api/v1/changes/active/route.ts +27 -0
- package/.next/standalone/app/api/v1/changes/diff/route.ts +119 -0
- package/.next/standalone/app/globals.css +424 -0
- package/.next/standalone/app/layout.tsx +3 -3
- package/.next/standalone/app/not-found.tsx +14 -23
- package/.next/standalone/components/artifact-panel.tsx +57 -13
- package/.next/standalone/components/changes-panel.tsx +178 -0
- package/.next/standalone/components/chat-container.tsx +44 -3
- package/.next/standalone/components/chat-input.tsx +44 -0
- package/.next/standalone/components/header.tsx +1 -13
- package/.next/standalone/hooks/use-changes.ts +61 -0
- package/.next/standalone/hooks/use-chat.ts +21 -3
- package/.next/standalone/hooks/use-conversations.ts +19 -11
- package/.next/standalone/lib/scraper/agent-state.ts +89 -54
- package/.next/standalone/lib/scraper/chat-history.ts +215 -85
- package/.next/standalone/lib/scraper/ide-artifacts.ts +212 -0
- package/.next/standalone/lib/scraper/ide-changes.ts +172 -0
- package/.next/standalone/lib/types.ts +11 -0
- package/.next/standalone/package-lock.json +2 -2
- package/.next/standalone/package.json +2 -2
- package/.next/standalone/scripts/check-send-button.js +126 -0
- package/.next/standalone/scripts/find-send-btn.js +65 -0
- package/.next/standalone/tsconfig.tsbuildinfo +1 -1
- package/.next/static/chunks/09dc2aa5c698c324.css +1 -0
- package/.next/static/chunks/{f7c83373e6561461.js → b9a0fabf54a78ef2.js} +1 -1
- package/.next/static/chunks/e2ccf5908cad5a88.js +5 -0
- package/.next/static/chunks/f7cc8fe5822bbc01.js +1 -0
- package/.next/static/chunks/{turbopack-3f34081d758747ed.js → turbopack-7b5dc393c5d3964b.js} +1 -1
- package/package.json +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__151eca3a._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ec32b318._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__f77eb371._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_9170b7a0._.js +0 -3
- package/.next/standalone/app/global-error.tsx +0 -42
- package/.next/static/chunks/2317ab948a7d90a4.js +0 -5
- package/.next/static/chunks/2d277a81099566c3.js +0 -1
- package/.next/static/chunks/ad1121f40e497811.css +0 -1
- package/.next/static/chunks/d5d4abede4bc89fd.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,20552,e=>{"use strict";var t=e.i(43476),s=e.i(71645);let n="/api/v1",a="/api/v1";function i({statusState:e,statusText:n,windows:a,conversations:i,activeConversation:l,cdpStatus:r,recentProjects:c,onSelectWindow:o,onSelectConversation:d,onNewChat:h,onStartCdp:m,onOpenWindow:u,onCloseWindow:x}){let[p,g]=(0,s.useState)(!1),[f,w]=(0,s.useState)(""),[j,v]=(0,s.useState)(!1),[y,N]=(0,s.useState)(!1),[k,b]=(0,s.useState)(null),C=(0,s.useRef)(null),S=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=e=>{C.current&&!C.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,s.useEffect)(()=>{if(k){let e=setTimeout(()=>b(null),4e3);return()=>clearTimeout(e)}},[k]);let $=async()=>{let e=c.length>0?c[0].path:".";N(!0),b(null);try{let t=await m(e,!0);b({text:t.message||(t.success?"CDP started!":"Failed to start CDP"),type:t.success?"success":"error"})}catch{b({text:"Failed to start CDP server",type:"error"})}finally{N(!1)}},W=async e=>{e.preventDefault();let t=f.trim();if(t&&!j){v(!0),b(null);try{let e=await u(t);b({text:e.message||(e.success?"Window opened!":"Failed to open"),type:e.success?"success":"error"}),e.success&&w("")}catch{b({text:"Failed to open window",type:"error"})}finally{v(!1)}}},A=async(e,t)=>{if(t.stopPropagation(),!window.confirm(`Close window "${a[e]?.title||e}"?`))return;let s=await x(e);b({text:s.message||(s.success?"Closed!":"Failed to close"),type:s.success?"success":"error"})};return(0,t.jsxs)("header",{className:"header",children:[(0,t.jsx)("div",{className:"header-left",children:(0,t.jsx)("div",{className:"logo",children:(0,t.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"url(#header-gradient)",strokeWidth:"1.5",children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"header-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,t.jsx)("stop",{offset:"0%",style:{stopColor:"#6366f1"}}),(0,t.jsx)("stop",{offset:"100%",style:{stopColor:"#a855f7"}})]})}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,t.jsx)("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"}),(0,t.jsx)("line",{x1:"2",y1:"12",x2:"22",y2:"12"})]})})}),(0,t.jsxs)("div",{className:"header-right",children:[(0,t.jsxs)("div",{ref:C,className:`window-selector-wrapper ${p?"open":""}`,children:[(0,t.jsxs)("button",{className:"window-selector-btn",onClick:()=>g(!p),title:"Manage Antigravity windows",children:[(0,t.jsx)("span",{className:`cdp-indicator ${r.active?"active":"inactive"}`}),(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),(0,t.jsx)("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),(0,t.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),(0,t.jsx)("span",{style:{maxWidth:"120px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"inline-block",verticalAlign:"bottom"},children:a.find(e=>e.active)?.title||"Windows"}),(0,t.jsx)("svg",{className:"chevron",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,t.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,t.jsxs)("div",{className:`window-dropdown ${p?"open":""}`,children:[(0,t.jsxs)("div",{className:"wm-cdp-status",children:[(0,t.jsxs)("div",{className:"wm-cdp-info",children:[(0,t.jsx)("span",{className:`wm-cdp-dot ${r.active?"active":"inactive"}`}),(0,t.jsx)("span",{children:r.active?`CDP Active \xb7 ${r.windowCount} window${1!==r.windowCount?"s":""}`:"CDP Inactive"})]}),!r.active&&(0,t.jsxs)("button",{className:"wm-cdp-start-btn",onClick:$,disabled:y,title:"Start Antigravity with CDP",children:[y?(0,t.jsx)("span",{className:"wm-spinner"}):(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,t.jsx)("polygon",{points:"5 3 19 12 5 21 5 3"})}),y?"Starting...":"Start CDP"]})]}),(0,t.jsx)("div",{className:"window-dropdown-header",children:"Open Windows"}),a.map(e=>(0,t.jsxs)("div",{className:`window-item ${e.active?"active":""}`,children:[(0,t.jsxs)("button",{className:"window-item-select",onClick:()=>{o(e.index),g(!1)},children:[(0,t.jsx)("span",{className:"window-dot"}),(0,t.jsx)("span",{className:"window-item-title",children:e.title})]}),(0,t.jsx)("button",{className:"window-item-close",onClick:t=>A(e.index,t),title:`Close "${e.title}"`,children:(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,t.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,t.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},e.index)),0===a.length&&(0,t.jsx)("div",{style:{padding:"12px",color:"var(--text-muted)",fontSize:"12px"},children:"No windows detected"}),c.length>0&&(0,t.jsxs)("div",{className:"wm-recent-section",children:[(0,t.jsx)("div",{className:"wm-recent-header",children:"Recent Projects"}),c.map(e=>(0,t.jsxs)("button",{className:"wm-recent-item",onClick:async()=>{v(!0),b(null);try{let t=await u(e.path);b({text:t.message||(t.success?"Opened!":"Failed"),type:t.success?"success":"error"})}catch{b({text:"Failed to open",type:"error"})}finally{v(!1)}},disabled:j,title:e.path,children:[(0,t.jsx)("svg",{className:"wm-recent-icon",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,t.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),(0,t.jsxs)("div",{className:"wm-recent-info",children:[(0,t.jsx)("span",{className:"wm-recent-name",children:e.name}),(0,t.jsx)("span",{className:"wm-recent-path",children:e.path})]})]},e.path))]}),(0,t.jsxs)("div",{className:"wm-open-section",children:[(0,t.jsx)("div",{className:"wm-open-label",children:"Open New Window"}),(0,t.jsxs)("form",{className:"wm-open-form",onSubmit:W,children:[(0,t.jsx)("input",{ref:S,type:"text",className:"wm-open-input",value:f,onChange:e=>w(e.target.value),placeholder:"/path/to/project",disabled:j}),(0,t.jsx)("button",{type:"submit",className:"wm-open-btn",disabled:j||!f.trim(),title:"Open directory in Antigravity",children:j?(0,t.jsx)("span",{className:"wm-spinner"}):(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,t.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,t.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})]}),k&&(0,t.jsx)("div",{className:`wm-action-message ${k.type}`,children:k.text})]})]}),(0,t.jsx)("button",{className:"icon-btn",onClick:h,title:"New Chat","aria-label":"New Chat",children:(0,t.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,t.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})]})}function l({onQuickPrompt:e}){return(0,t.jsxs)("div",{className:"welcome-screen",children:[(0,t.jsx)("div",{className:"welcome-icon",children:(0,t.jsxs)("svg",{width:"64",height:"64",viewBox:"0 0 24 24",fill:"none",stroke:"url(#gradient)",strokeWidth:"1.5",children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,t.jsx)("stop",{offset:"0%",style:{stopColor:"#6366f1"}}),(0,t.jsx)("stop",{offset:"100%",style:{stopColor:"#a855f7"}})]})}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,t.jsx)("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"}),(0,t.jsx)("line",{x1:"2",y1:"12",x2:"22",y2:"12"})]})}),(0,t.jsx)("h2",{children:"Antigravity Agent"}),(0,t.jsx)("p",{children:"Ask anything. The agent has access to your IDE — files, terminal, search, and more."}),(0,t.jsxs)("div",{className:"quick-prompts",children:[(0,t.jsx)("button",{className:"quick-prompt",onClick:()=>e("What files are in the current workspace?"),children:"📁 List workspace files"}),(0,t.jsx)("button",{className:"quick-prompt",onClick:()=>e("Explain the architecture of this project"),children:"🏗️ Explain architecture"}),(0,t.jsx)("button",{className:"quick-prompt",onClick:()=>e("Help me debug the most recent error"),children:"🐛 Debug last error"})]})]})}function r({content:e}){return(0,t.jsx)("div",{className:"user-message",children:(0,t.jsx)("div",{className:"message-content",children:e})})}let c={command:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg>',file:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>',search:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>',read:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>',browser:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>',mcp:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2v6M12 22v-6M4.93 4.93l4.24 4.24M14.83 14.83l4.24 4.24M2 12h6M22 12h-6M4.93 19.07l4.24-4.24M14.83 9.17l4.24-4.24"/><circle cx="12" cy="12" r="4"/></svg>'};function o({data:e}){let s,n=(s=(e.status||"").toLowerCase()).startsWith("running")||s.startsWith("editing")||s.startsWith("creating")||s.startsWith("search")?"running":s.startsWith("ran")||s.startsWith("edited")||s.startsWith("created")||s.startsWith("read")||s.startsWith("viewed")||s.startsWith("analyzed")||s.startsWith("wrote")||s.startsWith("replaced")||s.startsWith("deleted")?"done":s.includes("error")||s.includes("fail")?"error":s.startsWith("mcp")?"mcp":"running",a=c[e.type]||c.file;return(0,t.jsxs)("div",{className:`tool-call-card ${n}`,"data-tool-index":e.index,children:[(0,t.jsxs)("div",{className:"tool-header",children:[(0,t.jsx)("span",{className:"tool-icon",dangerouslySetInnerHTML:{__html:a}}),(0,t.jsx)("span",{className:"tool-status-text",children:e.status}),e.path&&(0,t.jsx)("span",{className:"tool-path",title:e.path,children:e.path})]}),e.command&&(0,t.jsx)("div",{className:"tool-command",children:(0,t.jsx)("code",{children:e.command})}),(e.additions||e.deletions)&&(0,t.jsxs)("div",{className:"tool-file-changes",children:[e.additions&&(0,t.jsx)("span",{className:"tool-additions",children:e.additions}),e.deletions&&(0,t.jsx)("span",{className:"tool-deletions",children:e.deletions})]}),e.exitCode&&(0,t.jsx)("div",{className:"tool-exit-code",children:e.exitCode}),e.terminalOutput&&(0,t.jsx)("div",{className:"tool-terminal",children:e.terminalOutput}),e.footerButtons&&e.footerButtons.length>0&&(0,t.jsx)("div",{className:"tool-footer-actions",children:e.footerButtons.map((s,n)=>(0,t.jsx)("button",{className:"tool-footer-btn",onClick:async()=>{try{await fetch("/api/v1/chat/action",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolId:e.id,buttonText:s})})}catch{}},children:s},n))})]})}function d({time:e}){return(0,t.jsxs)("div",{className:"thinking-block",children:[(0,t.jsx)("span",{className:"thinking-icon",children:"💭"}),(0,t.jsx)("span",{children:e})]})}function h(){return(0,t.jsxs)("div",{className:"typing-indicator",children:[(0,t.jsx)("div",{className:"typing-dot"}),(0,t.jsx)("div",{className:"typing-dot"}),(0,t.jsx)("div",{className:"typing-dot"})]})}function m({content:e,steps:s,isStreaming:n,onRetry:a}){return(0,t.jsxs)("div",{className:`agent-message ${n?"streaming":""}`,children:[(0,t.jsxs)("div",{className:"agent-steps",children:[s.map((e,s)=>{switch(e.type){case"thinking":return(0,t.jsx)(d,{time:e.data.time},`step-${s}`);case"tool_call":return(0,t.jsx)(o,{data:e.data},`step-${s}`);case"hitl":case"notification":default:return null;case"file_change":return(0,t.jsxs)("div",{className:"file-change-indicator",children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,t.jsx)("polyline",{points:"14 2 14 8 20 8"})]}),(0,t.jsx)("span",{className:"file-change-name",children:e.data.fileName})]},`step-${s}`);case"error":return(0,t.jsxs)("div",{className:"error-banner",children:[(0,t.jsxs)("div",{style:{marginBottom:!n&&a?"8px":"0"},children:["⚠️ ",String(e.data.message)]}),!n&&a&&(0,t.jsx)("button",{className:"px-3 py-1 bg-red-100 text-red-800 rounded hover:bg-red-200 transition-colors text-sm font-medium",onClick:a,children:"Try Again"})]},`step-${s}`)}}),n&&(0,t.jsx)(h,{})]}),e&&(0,t.jsx)("div",{className:"agent-response",dangerouslySetInnerHTML:{__html:e}})]})}function u({messages:e,currentSteps:s,currentResponse:n,isStreaming:a,onRetry:i}){return(0,t.jsxs)(t.Fragment,{children:[e.map((e,s)=>"user"===e.role?(0,t.jsx)(r,{content:e.content},`msg-${s}`):(0,t.jsx)(m,{content:e.content,steps:e.steps||[],isStreaming:!1,onRetry:i},`msg-${s}`)),a&&(0,t.jsx)(m,{content:n,steps:s,isStreaming:!0,onRetry:i})]})}function x({onSend:e,isStreaming:n,currentMode:a,onToggleMode:i,currentAgent:l,agents:r,isLoadingAgents:c,onFetchAgents:o,onSwitchAgent:d,onToggleArtifacts:h,artifactCount:m,artifactPanelOpen:u,onToggleChanges:x,changesCount:p,changesPanelOpen:g}){let[f,w]=(0,s.useState)(""),[j,v]=(0,s.useState)(!1),y=(0,s.useRef)(null),N=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=e=>{N.current&&!N.current.contains(e.target)&&v(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,s.useEffect)(()=>{y.current?.focus()},[]);let k=l?l.replace(/^(Claude\s+|Google\s+|OpenAI\s+)/i,"").substring(0,20):"Agent";return(0,t.jsxs)("footer",{className:"input-area",children:[(0,t.jsxs)("div",{className:"input-toolbar",children:[(0,t.jsxs)("div",{ref:N,className:"agent-selector-wrapper",children:[(0,t.jsxs)("button",{className:"agent-selector-btn",onClick:()=>{j||o(),v(!j)},title:l?`Agent: ${l} — Click to switch`:"Select AI agent","aria-label":`Switch agent (currently ${l||"unknown"})`,type:"button",children:[(0,t.jsx)("span",{className:"agent-icon",children:(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("path",{d:"M12 2a4 4 0 0 1 4 4v2a4 4 0 0 1-8 0V6a4 4 0 0 1 4-4z"}),(0,t.jsx)("path",{d:"M20 21v-2a4 4 0 0 0-3-3.87"}),(0,t.jsx)("path",{d:"M4 21v-2a4 4 0 0 1 3-3.87"}),(0,t.jsx)("circle",{cx:"12",cy:"17",r:"1"}),(0,t.jsx)("path",{d:"M9 17h6"})]})}),(0,t.jsx)("span",{className:"agent-label",children:k}),(0,t.jsx)("svg",{className:`agent-chevron ${j?"open":""}`,width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,t.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,t.jsxs)("div",{className:`agent-dropdown ${j?"open":""}`,children:[(0,t.jsx)("div",{className:"agent-dropdown-header",children:"Select Agent"}),c?(0,t.jsxs)("div",{className:"agent-dropdown-loading",children:[(0,t.jsx)("span",{className:"wm-spinner"}),(0,t.jsx)("span",{children:"Loading agents..."})]}):0===r.length?(0,t.jsx)("div",{className:"agent-dropdown-empty",children:"No agents detected. Make sure the IDE has a workbench open."}):(0,t.jsx)("div",{className:"agent-dropdown-list",children:r.map((e,s)=>(0,t.jsxs)("button",{className:`agent-option ${e.active?"active":""} ${l===e.name?"current":""}`,onClick:()=>{d(e.name),v(!1)},type:"button",children:[(0,t.jsx)("span",{className:"agent-option-name",children:e.name}),e.description&&(0,t.jsx)("span",{className:"agent-option-desc",children:e.description}),(e.active||l===e.name)&&(0,t.jsx)("svg",{className:"agent-check",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,t.jsx)("polyline",{points:"20 6 9 17 4 12"})})]},s))})]})]}),(0,t.jsxs)("button",{className:`mode-toggle ${a}`,onClick:i,title:`Mode: ${"planning"===a?"Planning":"Fast"} — Click to switch`,"aria-label":`Switch mode (currently ${a})`,type:"button",children:[(0,t.jsx)("span",{className:"mode-icon",children:"planning"===a?"📋":"⚡"}),(0,t.jsx)("span",{className:"mode-label",children:"planning"===a?"Plan":"Fast"})]}),(0,t.jsxs)("button",{className:`artifact-toggle-btn ${u?"active":""}`,onClick:h,title:`Artifacts${m>0?` (${m})`:""}`,"aria-label":"Toggle artifacts panel",type:"button",children:[(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,t.jsx)("polyline",{points:"14 2 14 8 20 8"}),(0,t.jsx)("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),(0,t.jsx)("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}),m>0&&(0,t.jsx)("span",{className:"artifact-badge",children:m})]}),(0,t.jsxs)("button",{className:`changes-toggle-btn ${g?"active":""}`,onClick:x,title:`Changes${p>0?` (${p})`:""}`,"aria-label":"Toggle changes panel",type:"button",children:[(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("path",{d:"M12 20h9"}),(0,t.jsx)("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]}),p>0&&(0,t.jsx)("span",{className:"changes-badge",children:p})]}),(0,t.jsx)("span",{className:"toolbar-agent-name",id:"model-info",children:l||""})]}),(0,t.jsxs)("div",{className:"input-wrapper",children:[(0,t.jsx)("textarea",{ref:y,value:f,onChange:e=>{w(e.target.value);let t=e.target;t.style.height="auto",t.style.height=Math.min(t.scrollHeight,150)+"px"},onKeyDown:t=>{"Enter"===t.key&&(!t.shiftKey||t.ctrlKey||t.metaKey)&&(t.preventDefault(),!n&&f.trim()&&(e(f),w(""),y.current&&(y.current.style.height="auto")))},placeholder:"Ask the Antigravity agent...",rows:1,"aria-label":"Chat message input",enterKeyHint:"send",autoComplete:"off"}),(0,t.jsx)("button",{className:"send-btn",onClick:()=>{!n&&f.trim()&&(e(f),w(""),y.current&&(y.current.style.height="auto"))},disabled:n||!f.trim(),"aria-label":"Send message",children:(0,t.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),(0,t.jsx)("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),(0,t.jsx)("div",{className:"input-hint",children:(0,t.jsx)("span",{children:"Enter to send · Shift+Enter for new line · Ctrl+N for new chat"})})]})}function p({open:e,onClose:n,activeConversation:a,files:i}){let[l,r]=(0,s.useState)(null),[c,o]=(0,s.useState)(""),[d,h]=(0,s.useState)(!1),m=async e=>{h(!0),r(e);try{let t=await fetch(`/api/v1/artifacts/active/${encodeURIComponent(e)}`);if(!t.ok){let e=await t.json().catch(()=>({error:"Unknown error"}));o(`Error: ${e.error||t.statusText}`);return}let s=await t.text();o(s)}catch(e){o(`Error loading file: ${e.message}`)}finally{h(!1)}},u=e=>!1!==e.isFile&&/\.\w{1,5}$/.test(e.name);return(0,t.jsxs)("div",{className:`artifact-panel ${e?"open":""}`,children:[(0,t.jsxs)("div",{className:"artifact-panel-header",children:[(0,t.jsx)("button",{className:"icon-btn",onClick:n,title:"Close panel",children:(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,t.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,t.jsx)("h3",{children:"Artifacts"})]}),a?(0,t.jsxs)("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)",background:"rgba(99,102,241,0.04)"},children:[(0,t.jsx)("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--text-primary)",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.title||"Untitled"}),(0,t.jsxs)("div",{style:{fontSize:"10px",fontFamily:"'JetBrains Mono', monospace",color:"var(--text-muted)"},children:[i.length," artifact",1!==i.length?"s":""]})]}):i.length>0?(0,t.jsx)("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)",background:"rgba(99,102,241,0.04)"},children:(0,t.jsxs)("div",{style:{fontSize:"10px",fontFamily:"'JetBrains Mono', monospace",color:"var(--text-muted)"},children:[i.length," artifact",1!==i.length?"s":""]})}):(0,t.jsx)("div",{style:{padding:"24px 16px",textAlign:"center",color:"var(--text-muted)",fontSize:"13px"},children:"No active conversation"}),l?(0,t.jsxs)("div",{className:"artifact-viewer",children:[(0,t.jsxs)("div",{className:"artifact-viewer-header",children:[(0,t.jsx)("button",{className:"artifact-back-btn",onClick:()=>{r(null),o("")},children:"← Back"}),(0,t.jsx)("span",{className:"artifact-viewer-title",children:l})]}),(0,t.jsx)("div",{className:"artifact-viewer-body",children:d?(0,t.jsx)("div",{style:{color:"var(--text-muted)",padding:"16px"},children:"Loading..."}):l.endsWith(".md")?(0,t.jsx)("div",{className:"agent-response",dangerouslySetInnerHTML:{__html:c.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.*$)/gim,"<li>$1</li>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br/>")}}):(0,t.jsx)("pre",{style:{margin:0,fontSize:"12px",lineHeight:1.6,color:"var(--text-secondary)",fontFamily:"'JetBrains Mono', monospace",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:c})})]}):(0,t.jsxs)("div",{className:"artifact-file-list",children:[i.map(e=>{var s;return(0,t.jsxs)("button",{className:`artifact-file-item ${!u(e)?"non-file":""}`,onClick:()=>{u(e)&&m(e.name)},disabled:!u(e),title:u(e)?`Open ${e.name}`:`${e.name} (IDE artifact — view in Antigravity)`,children:[(0,t.jsx)("span",{className:"artifact-file-icon",children:(e=>{if(u(e)){let t=e.name;return t.endsWith(".md")?"📄":t.endsWith(".json")?"📋":t.endsWith(".ts")||t.endsWith(".tsx")?"📘":t.endsWith(".css")?"🎨":t.endsWith(".js")||t.endsWith(".jsx")?"📜":"📄"}return"🖼️"})(e)}),(0,t.jsxs)("div",{style:{flex:1,overflow:"hidden"},children:[(0,t.jsx)("div",{className:"artifact-file-name",children:e.name}),(0,t.jsx)("div",{style:{fontSize:"10px",color:"var(--text-muted)"},children:(e=>{if(e.includes("T")||e.includes("-")){let t=new Date(e);if(!isNaN(t.getTime()))return t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})+" · "+t.toLocaleDateString()}return e})(e.mtime)})]}),(0,t.jsx)("span",{className:"artifact-file-size",children:(s=e.size)<=0?"":s<1024?`${s}B`:s<1048576?`${(s/1024).toFixed(1)}KB`:`${(s/1048576).toFixed(1)}MB`})]},e.name)}),0===i.length&&(0,t.jsx)("div",{style:{textAlign:"center",padding:"24px",color:"var(--text-muted)",fontSize:"13px"},children:"No artifacts in this conversation"})]})]})}function g({open:e,onClose:n,changes:a}){let[i,l]=(0,s.useState)(null),[r,c]=(0,s.useState)([]),[o,d]=(0,s.useState)(!1),[h,m]=(0,s.useState)(""),u=a.reduce((e,t)=>e+t.additions,0),x=a.reduce((e,t)=>e+t.deletions,0),p=async e=>{d(!0),l(e.filepath),m(e.filename),c([]);try{let t=await fetch(`/api/v1/changes/diff?filepath=${encodeURIComponent(e.filepath)}`),s=await t.json();s.diff?c(function(e){let t=[],s=0,n=0;for(let a of e.split("\n"))if(a.startsWith("diff --git")||a.startsWith("index ")||a.startsWith("new file")||a.startsWith("deleted file"))t.push({type:"meta",content:a});else if(a.startsWith("---")||a.startsWith("+++"))t.push({type:"meta",content:a});else if(a.startsWith("@@")){let e=a.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);e&&(n=parseInt(e[1]),s=parseInt(e[2])),t.push({type:"header",content:a})}else a.startsWith("+")?t.push({type:"add",content:a.substring(1),lineNum:s++}):a.startsWith("-")?t.push({type:"del",content:a.substring(1),lineNum:n++}):a.startsWith(" ")&&(t.push({type:"context",content:a.substring(1),lineNum:s}),s++,n++);return t}(s.diff)):c([{type:"meta",content:s.message||"No diff available"}])}catch(e){c([{type:"meta",content:`Error: ${e.message}`}])}finally{d(!1)}};return(0,t.jsxs)("div",{className:`changes-panel ${e?"open":""}`,children:[(0,t.jsxs)("div",{className:"changes-panel-header",children:[(0,t.jsx)("button",{className:"icon-btn",onClick:n,title:"Close panel",children:(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,t.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,t.jsx)("h3",{children:"Changes Overview"})]}),i?(0,t.jsxs)("div",{className:"diff-viewer",children:[(0,t.jsxs)("div",{className:"diff-viewer-header",children:[(0,t.jsx)("button",{className:"diff-back-btn",onClick:()=>{l(null),c([]),m("")},children:"← Back"}),(0,t.jsx)("span",{className:"diff-viewer-title",children:h}),(0,t.jsx)("span",{className:"diff-viewer-path",children:i})]}),(0,t.jsx)("div",{className:"diff-viewer-body",children:o?(0,t.jsx)("div",{style:{color:"var(--text-muted)",padding:"16px",fontStyle:"italic"},children:"Loading diff..."}):0===r.length?(0,t.jsx)("div",{style:{color:"var(--text-muted)",padding:"16px"},children:"No changes found"}):(0,t.jsx)("div",{className:"diff-lines",children:r.map((e,s)=>(0,t.jsxs)("div",{className:`diff-line diff-line-${e.type}`,children:[(0,t.jsx)("span",{className:"diff-line-num",children:void 0!==e.lineNum?e.lineNum:""}),(0,t.jsx)("span",{className:"diff-line-indicator",children:"add"===e.type?"+":"del"===e.type?"-":"header"===e.type?"@@":""}),(0,t.jsx)("span",{className:"diff-line-content",children:e.content})]},s))})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"changes-summary",children:[(0,t.jsxs)("span",{className:"changes-count",children:[a.length," file",1!==a.length?"s":""," changed"]}),(0,t.jsxs)("div",{className:"changes-stats",children:[u>0&&(0,t.jsxs)("span",{className:"changes-additions",children:["+",u]}),x>0&&(0,t.jsxs)("span",{className:"changes-deletions",children:["-",x]})]})]}),(0,t.jsxs)("div",{className:"changes-file-list",children:[a.map(e=>{var s;return(0,t.jsxs)("button",{className:"changes-file-item",onClick:()=>p(e),title:`View diff: ${e.filepath}`,children:[(0,t.jsx)("span",{className:"changes-file-icon",children:(s=e.filename).endsWith(".tsx")||s.endsWith(".jsx")?"⚛️":s.endsWith(".ts")||s.endsWith(".js")?"📘":s.endsWith(".css")?"🎨":s.endsWith(".md")?"📄":s.endsWith(".json")?"📋":"📝"}),(0,t.jsxs)("div",{className:"changes-file-info",children:[(0,t.jsx)("div",{className:"changes-file-name",children:e.filename}),(0,t.jsx)("div",{className:"changes-file-path",children:e.filepath})]}),(0,t.jsxs)("div",{className:"changes-file-diff",children:[e.additions>0&&(0,t.jsxs)("span",{className:"changes-additions",children:["+",e.additions]}),e.deletions>0&&(0,t.jsxs)("span",{className:"changes-deletions",children:["-",e.deletions]})]})]},e.filepath)}),0===a.length&&(0,t.jsx)("div",{style:{textAlign:"center",padding:"24px",color:"var(--text-muted)",fontSize:"13px"},children:"No file changes in this conversation"})]})]})]})}function f(){let e=function(){let[e,t]=(0,s.useState)([]),[i,l]=(0,s.useState)(!1),[r,c]=(0,s.useState)(!1),[o,d]=(0,s.useState)("Agent"),[h,m]=(0,s.useState)("connected"),[u,x]=(0,s.useState)(!0),[p,g]=(0,s.useState)(!1),[f,w]=(0,s.useState)([]),[j,v]=(0,s.useState)(""),[y,N]=(0,s.useState)("planning"),[k,b]=(0,s.useState)(null),[C,S]=(0,s.useState)([]),[$,W]=(0,s.useState)(!1),A=(0,s.useRef)(null),T=(0,s.useRef)(null),O=(0,s.useRef)(""),B=(0,s.useRef)([]),P=(0,s.useCallback)(()=>{requestAnimationFrame(()=>{T.current?.scrollIntoView({behavior:"smooth"})})},[]),M=(0,s.useCallback)((e,t)=>{m(e),d(t)},[]),E=(0,s.useCallback)(async()=>{g(!0),t([]);try{let e=await fetch(`${a}/chat/history`),s=await e.json();s.turns&&s.turns.length>0?(x(!1),t(s.turns.map(e=>({role:e.role,content:e.content})))):x(!0)}catch{}finally{g(!1)}},[]),{artifactFiles:R,artifactPanelOpen:F,toggleArtifactPanel:I,openArtifactPanel:z,loadArtifacts:L}=function(e){let[t,n]=(0,s.useState)([]),[a,i]=(0,s.useState)(!1),l=(0,s.useRef)(""),r=(0,s.useRef)(null),c=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/v1/artifacts/active"),t=(await e.json()).files||[],s=JSON.stringify(t.map(e=>e.name+e.size+e.mtime));s!==l.current&&(l.current=s,n(t))}catch{}},[]),o=(0,s.useCallback)(()=>{i(e=>!e)},[]),d=(0,s.useCallback)(()=>{i(!0)},[]);return(0,s.useEffect)(()=>(a?(c(),r.current=setInterval(c,3e3)):r.current&&(clearInterval(r.current),r.current=null),()=>{r.current&&(clearInterval(r.current),r.current=null)}),[a,c]),(0,s.useEffect)(()=>{},[void 0,c]),{artifactFiles:t,artifactPanelOpen:a,toggleArtifactPanel:o,openArtifactPanel:d,loadArtifacts:c}}(),{changeFiles:D,changesPanelOpen:J,toggleChangesPanel:H,loadChanges:_}=function(){let[e,t]=(0,s.useState)([]),[n,a]=(0,s.useState)(!1),i=(0,s.useRef)(""),l=(0,s.useRef)(null),r=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/v1/changes/active"),s=(await e.json()).changes||[],n=JSON.stringify(s.map(e=>`${e.filename}+${e.additions}-${e.deletions}`));n!==i.current&&(i.current=n,t(s))}catch{}},[]),c=(0,s.useCallback)(()=>{a(e=>!e)},[]);return(0,s.useEffect)(()=>(n?(r(),l.current=setInterval(r,5e3)):l.current&&(clearInterval(l.current),l.current=null),()=>{l.current&&(clearInterval(l.current),l.current=null)}),[n,r]),{changeFiles:e,changesPanelOpen:n,toggleChangesPanel:c,loadChanges:r}}(),{windows:K,conversations:V,activeConversation:U,cdpStatus:q,recentProjects:G,loadWindows:Q,selectWindow:X,loadConversations:Y,selectConversation:Z,checkCdpStatus:ee,startCdpServer:et,openNewWindow:es,closeWindowByIndex:en,loadRecentProjects:ea}=function(e,t,a){let[i,l]=(0,s.useState)([]),[r,c]=(0,s.useState)([]),[o,d]=(0,s.useState)(null),[h,m]=(0,s.useState)({active:!1,windowCount:0}),[u,x]=(0,s.useState)([]),p=(0,s.useCallback)(async()=>{try{let e=await fetch(`${n}/windows`),t=await e.json();l(t.windows||[])}catch{}},[]),g=(0,s.useCallback)(async()=>{try{let e=await fetch(`${n}/windows/cdp-status`),t=await e.json();return m({active:t.active,windowCount:t.windowCount,error:t.error}),t.active}catch{return m({active:!1,windowCount:0,error:"Failed to check"}),!1}},[]),f=(0,s.useCallback)(async(e,t)=>{try{let s=await fetch(`${n}/windows/cdp-start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectDir:e||".",killExisting:t||!1})}),a=await s.json();return a.success&&(await g(),await p()),a}catch(e){return{success:!1,message:e.message||"Failed to start CDP server"}}},[g,p]),w=(0,s.useCallback)(async e=>{try{let t=await fetch(`${n}/windows/open`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectDir:e})}),s=await t.json();return s.success&&(await p(),await g()),s}catch(e){return{success:!1,message:e.message||"Failed to open window"}}},[p,g]),j=(0,s.useCallback)(async e=>{try{let t=await fetch(`${n}/windows/close`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({index:e})}),s=await t.json();return s.success&&(await p(),await g()),s}catch(e){return{success:!1,message:e.message||"Failed to close window"}}},[p,g]),v=(0,s.useCallback)(async()=>{try{let e=await fetch(`${n}/conversations`),t=(await e.json()).conversations||[];c(t);let s=t.find(e=>e.active);s&&d(s)}catch{}},[]),y=(0,s.useCallback)(async s=>{try{t(!0),await fetch(`${n}/windows/select`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({index:s})}),await p(),await e(),await v(),a?.()}catch{}},[p,e,t,v,a]);return{windows:i,conversations:r,activeConversation:o,cdpStatus:h,recentProjects:u,loadWindows:p,selectWindow:y,loadConversations:v,selectConversation:(0,s.useCallback)(async s=>{try{let i=await fetch(`${n}/conversations/select`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:s})});if((await i.json()).success){t(!1);let i=0,l=async()=>{i++;try{let t=await fetch(`${n}/conversations`),l=(await t.json()).conversations||[],r=l.find(e=>e.active);if(r&&r.title===s||i>10){c(l),r&&d(r),await e(),a?.();return}}catch{}setTimeout(l,500)};l()}}catch{}},[e,t,a]),checkCdpStatus:g,startCdpServer:f,openNewWindow:w,closeWindowByIndex:j,loadRecentProjects:(0,s.useCallback)(async()=>{try{let e=await fetch(`${n}/windows/recent`),t=await e.json();x(t.recentProjects||[])}catch{}},[])}}(E,x,(0,s.useCallback)(()=>{z(),L(),_()},[z,L,_])),ei=(0,s.useCallback)(async()=>{try{let e=await fetch(`${a}/chat/mode`),t=await e.json();t.mode&&N(t.mode)}catch{}},[]),el=(0,s.useCallback)(async()=>{let e="planning"===y?"fast":"planning";N(e);try{let t=await fetch(`${a}/chat/mode`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e})}),s=await t.json();s.mode&&N(s.mode)}catch{N(y)}},[y]),er=(0,s.useCallback)(async()=>{try{let e=await fetch(`${a}/chat/agent`),t=await e.json();t.agent&&b(t.agent)}catch{}},[]),ec=(0,s.useCallback)(async()=>{W(!0);try{let e=await fetch(`${a}/chat/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"list"})}),t=await e.json();t.agents&&S(t.agents),t.currentAgent&&b(t.currentAgent)}catch{}W(!1)},[]),eo=(0,s.useCallback)(async e=>{b(e);try{let t=await fetch(`${a}/chat/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"switch",agent:e})}),s=await t.json();s.agent?b(s.agent):s.success||b(k)}catch{b(k)}},[k]),ed=(0,s.useCallback)(async()=>{try{let e=await fetch(`${a}/health`),t=await e.json();c(t.connected),M(t.connected?"connected":"disconnected",t.connected?"Agent":"Disconnected")}catch{c(!1),M("disconnected","Offline")}},[M]),eh=(0,s.useCallback)(e=>{let{type:t,...s}=e;switch(t){case"tool_call":w(e=>{let n,a=e.findIndex(e=>"tool_call"===e.type&&e.data?.id===s.id);return a>=0?(n=[...e])[a]={type:t,data:s}:n=[...e,{type:t,data:s}],B.current=n,n});break;case"thinking":case"hitl":case"file_change":case"error":case"notification":w(e=>{let n=[...e,{type:t,data:s}];return B.current=n,n});break;case"response":v(s.content||""),O.current=s.content||"";break;case"status":M(s.isRunning?"streaming":"connected",s.isRunning?"Agent working...":"Agent");break;case"done":s.finalResponse&&(v(s.finalResponse),O.current=s.finalResponse),M("connected","Agent"),l(!1)}P()},[M,P]),em=(0,s.useCallback)(async e=>{if(i||!e.trim())return;x(!1);let s=e.trim();t(e=>[...e,{role:"user",content:s}]),l(!0),w([]),v(""),O.current="",B.current=[],M("streaming","Agent typing...");let n=new AbortController;A.current=n;try{let e=(await fetch(`${a}/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:s}),signal:n.signal})).body.getReader(),t=new TextDecoder,i="";for(;;){let{done:s,value:n}=await e.read();if(s)break;let a=(i+=t.decode(n,{stream:!0})).split("\n");for(let e of(i=a.pop(),a))if(e.startsWith("data: "))try{let t=JSON.parse(e.slice(6));eh(t)}catch{}}}catch(e){"AbortError"!==e.name&&(w(t=>[...t,{type:"error",data:{message:e.message}}]),M("error","Error"))}finally{let e=O.current,s=[...B.current];l(!1),A.current=null,(e||s.length>0)&&t(t=>[...t,{role:"agent",content:e,steps:s}]),M("connected","Agent")}},[i,eh,M]),eu=(0,s.useCallback)(async()=>{A.current&&A.current.abort(),t([]),w([]),v(""),x(!0);try{let e=await fetch(`${a}/chat/new`,{method:"POST"});(await e.json()).success&&M("connected","New Chat")}catch{}},[M]),ex=(0,s.useCallback)(async()=>{try{await fetch(`${a}/chat/approve`,{method:"POST"}),M("streaming","Agent")}catch{}},[M]),ep=(0,s.useCallback)(async()=>{try{await fetch(`${a}/chat/reject`,{method:"POST"})}catch{}},[]);return(0,s.useEffect)(()=>{ed(),Q(),E(),Y(),L(),ei(),er(),ee(),ea();let e=setInterval(ed,3e4),t=setInterval(ee,15e3);return()=>{clearInterval(e),clearInterval(t)}},[ed,Q,E,Y,L,ei,er,ee,ea]),(0,s.useEffect)(P,[e,f,j,P]),{messages:e,isStreaming:i,isConnected:r,statusText:o,statusState:h,showWelcome:u,isLoadingHistory:p,currentSteps:f,currentResponse:j,windows:K,conversations:V,activeConversation:U,artifactFiles:R,artifactPanelOpen:F,changeFiles:D,changesPanelOpen:J,currentMode:y,currentAgent:k,agents:C,isLoadingAgents:$,cdpStatus:q,recentProjects:G,sendMessage:em,startNewChat:eu,approve:ex,reject:ep,selectWindow:X,selectConversation:Z,toggleArtifactPanel:I,openArtifactPanel:z,toggleChangesPanel:H,toggleMode:el,fetchAgentList:ec,switchAgent:eo,startCdpServer:et,openNewWindow:es,closeWindowByIndex:en,messagesEndRef:T,setShowWelcome:x}}();return(0,s.useEffect)(()=>{let t=t=>{"n"===t.key&&(t.ctrlKey||t.metaKey)&&(t.preventDefault(),e.startNewChat())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),(0,t.jsxs)("div",{className:"app-container",children:[(0,t.jsx)(i,{statusState:e.statusState,statusText:e.statusText,windows:e.windows,conversations:e.conversations,activeConversation:e.activeConversation,cdpStatus:e.cdpStatus,recentProjects:e.recentProjects,onSelectWindow:e.selectWindow,onSelectConversation:e.selectConversation,onNewChat:e.startNewChat,onStartCdp:e.startCdpServer,onOpenWindow:e.openNewWindow,onCloseWindow:e.closeWindowByIndex}),(0,t.jsxs)("main",{className:"messages-area",role:"log","aria-live":"polite",children:[e.isLoadingHistory?(0,t.jsxs)("div",{className:"history-loading",children:[(0,t.jsxs)("div",{className:"history-loading-header",children:[(0,t.jsx)("div",{className:"skeleton-shimmer skeleton-avatar"}),(0,t.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"45%"}})]}),(0,t.jsxs)("div",{className:"history-loading-block",children:[(0,t.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"80%"}}),(0,t.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"65%"}}),(0,t.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"72%"}})]}),(0,t.jsx)("div",{className:"history-loading-header right",children:(0,t.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"35%"}})}),(0,t.jsxs)("div",{className:"history-loading-block",children:[(0,t.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"90%"}}),(0,t.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"55%"}}),(0,t.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"68%"}}),(0,t.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"40%"}})]}),(0,t.jsxs)("div",{className:"history-loading-header",children:[(0,t.jsx)("div",{className:"skeleton-shimmer skeleton-avatar"}),(0,t.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"50%"}})]}),(0,t.jsxs)("div",{className:"history-loading-block",children:[(0,t.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"75%"}}),(0,t.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"60%"}})]}),(0,t.jsx)("p",{className:"history-loading-text",children:"Loading conversation history…"})]}):e.showWelcome?(0,t.jsx)(l,{onQuickPrompt:e.sendMessage}):(0,t.jsx)(u,{messages:e.messages,currentSteps:e.currentSteps,currentResponse:e.currentResponse,isStreaming:e.isStreaming,onRetry:async()=>{try{await fetch("/api/v1/health"),window.location.reload()}catch{}}}),(0,t.jsx)("div",{ref:e.messagesEndRef})]}),(0,t.jsx)(x,{onSend:e.sendMessage,isStreaming:e.isStreaming,currentMode:e.currentMode,onToggleMode:e.toggleMode,currentAgent:e.currentAgent,agents:e.agents,isLoadingAgents:e.isLoadingAgents,onFetchAgents:e.fetchAgentList,onSwitchAgent:e.switchAgent,onToggleArtifacts:e.toggleArtifactPanel,artifactCount:e.artifactFiles.length,artifactPanelOpen:e.artifactPanelOpen,onToggleChanges:e.toggleChangesPanel,changesCount:e.changeFiles.length,changesPanelOpen:e.changesPanelOpen}),(0,t.jsx)(p,{open:e.artifactPanelOpen,onClose:e.toggleArtifactPanel,activeConversation:e.activeConversation,files:e.artifactFiles}),(0,t.jsx)(g,{open:e.changesPanelOpen,onClose:e.toggleChangesPanel,changes:e.changeFiles})]})}e.s(["default",()=>f],20552)}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,{otherChunks:["static/chunks/
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,{otherChunks:["static/chunks/b9a0fabf54a78ef2.js","static/chunks/f2f58a7e93290fbb.js","static/chunks/e2ccf5908cad5a88.js"],runtimeModuleIds:[94553]}]),(()=>{let e;if(!Array.isArray(globalThis.TURBOPACK))return;let t="/_next/",r=(self.TURBOPACK_CHUNK_SUFFIX??document?.currentScript?.getAttribute?.("src")?.replace(/^(.*(?=\?)|^.*$)/,""))||"",n=new WeakMap;function o(e,t){this.m=e,this.e=t}let l=o.prototype,i=Object.prototype.hasOwnProperty,s="u">typeof Symbol&&Symbol.toStringTag;function u(e,t,r){i.call(e,t)||Object.defineProperty(e,t,r)}function a(e,t){let r=e[t];return r||(r=c(t),e[t]=r),r}function c(e){return{exports:{},error:void 0,id:e,namespaceObject:void 0}}function f(e,t){u(e,"__esModule",{value:!0}),s&&u(e,s,{value:"Module"});let r=0;for(;r<t.length;){let n=t[r++],o=t[r++];if("number"==typeof o)if(0===o)u(e,n,{value:t[r++],enumerable:!0,writable:!1});else throw Error(`unexpected tag: ${o}`);else"function"==typeof t[r]?u(e,n,{get:o,set:t[r++],enumerable:!0}):u(e,n,{get:o,enumerable:!0})}Object.seal(e)}l.s=function(e,t){let r,n;null!=t?n=(r=a(this.c,t)).exports:(r=this.m,n=this.e),r.namespaceObject=n,f(n,e)},l.j=function(e,t){var r,o;let l,s,u;null!=t?s=(l=a(this.c,t)).exports:(l=this.m,s=this.e);let c=(r=l,o=s,(u=n.get(r))||(n.set(r,u=[]),r.exports=r.namespaceObject=new Proxy(o,{get(e,t){if(i.call(e,t)||"default"===t||"__esModule"===t)return Reflect.get(e,t);for(let e of u){let r=Reflect.get(e,t);if(void 0!==r)return r}},ownKeys(e){let t=Reflect.ownKeys(e);for(let e of u)for(let r of Reflect.ownKeys(e))"default"===r||t.includes(r)||t.push(r);return t}})),u);"object"==typeof e&&null!==e&&c.push(e)},l.v=function(e,t){(null!=t?a(this.c,t):this.m).exports=e},l.n=function(e,t){let r;(r=null!=t?a(this.c,t):this.m).exports=r.namespaceObject=e};let p=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,h=[null,p({}),p([]),p(p)];function d(e,t,r){let n=[],o=-1;for(let t=e;("object"==typeof t||"function"==typeof t)&&!h.includes(t);t=p(t))for(let r of Object.getOwnPropertyNames(t))n.push(r,function(e,t){return()=>e[t]}(e,r)),-1===o&&"default"===r&&(o=n.length-1);return r&&o>=0||(o>=0?n.splice(o,1,0,e):n.push("default",0,e)),f(t,n),t}function m(e){let t=B(e,this.m);if(t.namespaceObject)return t.namespaceObject;let r=t.exports;return t.namespaceObject=d(r,"function"==typeof r?function(...e){return r.apply(this,e)}:Object.create(null),r&&r.__esModule)}function b(e){let t=e.indexOf("#");-1!==t&&(e=e.substring(0,t));let r=e.indexOf("?");return -1!==r&&(e=e.substring(0,r)),e}function y(){let e,t;return{promise:new Promise((r,n)=>{t=n,e=r}),resolve:e,reject:t}}l.i=m,l.A=function(e){return this.r(e)(m.bind(this))},l.t="function"==typeof require?require:function(){throw Error("Unexpected use of runtime require")},l.r=function(e){return B(e,this.m).exports},l.f=function(e){function t(t){if(t=b(t),i.call(e,t))return e[t].module();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r}return t.keys=()=>Object.keys(e),t.resolve=t=>{if(t=b(t),i.call(e,t))return e[t].id();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r},t.import=async e=>await t(e),t};let O=Symbol("turbopack queues"),g=Symbol("turbopack exports"),w=Symbol("turbopack error");function C(e){e&&1!==e.status&&(e.status=1,e.forEach(e=>e.queueCount--),e.forEach(e=>e.queueCount--?e.queueCount++:e()))}l.a=function(e,t){let r=this.m,n=t?Object.assign([],{status:-1}):void 0,o=new Set,{resolve:l,reject:i,promise:s}=y(),u=Object.assign(s,{[g]:r.exports,[O]:e=>{n&&e(n),o.forEach(e),u.catch(()=>{})}}),a={get:()=>u,set(e){e!==u&&(u[g]=e)}};Object.defineProperty(r,"exports",a),Object.defineProperty(r,"namespaceObject",a),e(function(e){let t=e.map(e=>{if(null!==e&&"object"==typeof e){if(O in e)return e;if(null!=e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then){let t=Object.assign([],{status:0}),r={[g]:{},[O]:e=>e(t)};return e.then(e=>{r[g]=e,C(t)},e=>{r[w]=e,C(t)}),r}}return{[g]:e,[O]:()=>{}}}),r=()=>t.map(e=>{if(e[w])throw e[w];return e[g]}),{promise:l,resolve:i}=y(),s=Object.assign(()=>i(r),{queueCount:0});function u(e){e!==n&&!o.has(e)&&(o.add(e),e&&0===e.status&&(s.queueCount++,e.push(s)))}return t.map(e=>e[O](u)),s.queueCount?l:r()},function(e){e?i(u[w]=e):l(u[g]),C(n)}),n&&-1===n.status&&(n.status=0)};let U=function(e){let t=new URL(e,"x:/"),r={};for(let e in t)r[e]=t[e];for(let t in r.href=e,r.pathname=e.replace(/[?#].*/,""),r.origin=r.protocol="",r.toString=r.toJSON=(...t)=>e,r)Object.defineProperty(this,t,{enumerable:!0,configurable:!0,value:r[t]})};function R(e,t){throw Error(`Invariant: ${t(e)}`)}U.prototype=URL.prototype,l.U=U,l.z=function(e){throw Error("dynamic usage of require is not supported")},l.g=globalThis;let j=o.prototype;var _,k=((_=k||{})[_.Runtime=0]="Runtime",_[_.Parent=1]="Parent",_[_.Update=2]="Update",_);let v=new Map;l.M=v;let $=new Map,P=new Map;async function S(e,t,r){let n;if("string"==typeof r)return E(e,t,K(r));let o=r.included||[],l=o.map(e=>!!v.has(e)||$.get(e));if(l.length>0&&l.every(e=>e))return void await Promise.all(l);let i=r.moduleChunks||[],s=i.map(e=>P.get(e)).filter(e=>e);if(s.length>0){if(s.length===i.length)return void await Promise.all(s);let r=new Set;for(let e of i)P.has(e)||r.add(e);for(let n of r){let r=E(e,t,K(n));P.set(n,r),s.push(r)}n=Promise.all(s)}else{for(let o of(n=E(e,t,K(r.path)),i))P.has(o)||P.set(o,n)}for(let e of o)$.has(e)||$.set(e,n);await n}j.l=function(e){return S(1,this.m.id,e)};let T=Promise.resolve(void 0),A=new WeakMap;function E(t,r,n){let o=e.loadChunkCached(t,n),l=A.get(o);if(void 0===l){let e=A.set.bind(A,o,T);l=o.then(e).catch(e=>{let o;switch(t){case 0:o=`as a runtime dependency of chunk ${r}`;break;case 1:o=`from module ${r}`;break;case 2:o="from an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}let l=Error(`Failed to load chunk ${n} ${o}${e?`: ${e}`:""}`,e?{cause:e}:void 0);throw l.name="ChunkLoadError",l}),A.set(o,l)}return l}function K(e){return`${t}${e.split("/").map(e=>encodeURIComponent(e)).join("/")}${r}`}j.L=function(e){return E(1,this.m.id,e)},j.R=function(e){let t=this.r(e);return t?.default??t},j.P=function(e){return`/ROOT/${e??""}`},j.b=function(e){let t=new Blob([`self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};
|
|
2
2
|
self.TURBOPACK_CHUNK_SUFFIX = ${JSON.stringify(r)};
|
|
3
3
|
self.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(e.reverse().map(K),null,2)};
|
|
4
4
|
importScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`],{type:"text/javascript"});return URL.createObjectURL(t)};let x=/\.js(?:\?[^#]*)?(?:#.*)?$/,N=/\.css(?:\?[^#]*)?(?:#.*)?$/;function M(e){return N.test(e)}l.w=function(t,r,n){return e.loadWebAssembly(1,this.m.id,t,r,n)},l.u=function(t,r){return e.loadWebAssemblyModule(1,this.m.id,t,r)};let L={};l.c=L;let B=(e,t)=>{let r=L[e];if(r){if(r.error)throw r.error;return r}return q(e,k.Parent,t.id)};function q(e,t,r){let n=v.get(e);if("function"!=typeof n)throw Error(function(e,t,r){let n;switch(t){case 0:n=`as a runtime entry of chunk ${r}`;break;case 1:n=`because it was required from module ${r}`;break;case 2:n="because of an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}return`Module ${e} was instantiated ${n}, but the module factory is not available.`}(e,t,r));let l=c(e),i=l.exports;L[e]=l;let s=new o(l,i);try{n(s,l,i)}catch(e){throw l.error=e,e}return l.namespaceObject&&l.exports!==l.namespaceObject&&d(l.exports,l.namespaceObject),l}function I(r){let n,o=function(e){if("string"==typeof e)return e;let r=decodeURIComponent(("u">typeof TURBOPACK_NEXT_CHUNK_URLS?TURBOPACK_NEXT_CHUNK_URLS.pop():e.getAttribute("src")).replace(/[?#].*$/,""));return r.startsWith(t)?r.slice(t.length):r}(r[0]);return 2===r.length?n=r[1]:(n=void 0,!function(e,t,r,n){let o=1;for(;o<e.length;){let t=e[o],n=o+1;for(;n<e.length&&"function"!=typeof e[n];)n++;if(n===e.length)throw Error("malformed chunk format, expected a factory function");if(!r.has(t)){let l=e[n];for(Object.defineProperty(l,"name",{value:"module evaluation"});o<n;o++)t=e[o],r.set(t,l)}o=n+1}}(r,0,v)),e.registerChunk(o,n)}let W=new Map;function H(e){let t=W.get(e);if(!t){let r,n;t={resolved:!1,loadingStarted:!1,promise:new Promise((e,t)=>{r=e,n=t}),resolve:()=>{t.resolved=!0,r()},reject:n},W.set(e,t)}return t}e={async registerChunk(e,t){if(H(K(e)).resolve(),null!=t){for(let e of t.otherChunks)H(K("string"==typeof e?e:e.path));if(await Promise.all(t.otherChunks.map(t=>S(0,e,t))),t.runtimeModuleIds.length>0)for(let r of t.runtimeModuleIds)!function(e,t){let r=L[t];if(r){if(r.error)throw r.error;return}q(t,k.Runtime,e)}(e,r)}},loadChunkCached:(e,t)=>(function(e,t){let r=H(t);if(r.loadingStarted)return r.promise;if(e===k.Runtime)return r.loadingStarted=!0,M(t)&&r.resolve(),r.promise;if("function"==typeof importScripts)if(M(t));else if(x.test(t))self.TURBOPACK_NEXT_CHUNK_URLS.push(t),importScripts(TURBOPACK_WORKER_LOCATION+t);else throw Error(`can't infer type of chunk from URL ${t} in worker`);else{let e=decodeURI(t);if(M(t))if(document.querySelectorAll(`link[rel=stylesheet][href="${t}"],link[rel=stylesheet][href^="${t}?"],link[rel=stylesheet][href="${e}"],link[rel=stylesheet][href^="${e}?"]`).length>0)r.resolve();else{let e=document.createElement("link");e.rel="stylesheet",e.href=t,e.onerror=()=>{r.reject()},e.onload=()=>{r.resolve()},document.head.appendChild(e)}else if(x.test(t)){let n=document.querySelectorAll(`script[src="${t}"],script[src^="${t}?"],script[src="${e}"],script[src^="${e}?"]`);if(n.length>0)for(let e of Array.from(n))e.addEventListener("error",()=>{r.reject()});else{let e=document.createElement("script");e.src=t,e.onerror=()=>{r.reject()},document.head.appendChild(e)}}else throw Error(`can't infer type of chunk from URL ${t}`)}return r.loadingStarted=!0,r.promise})(e,t),async loadWebAssembly(e,t,r,n,o){let l=fetch(K(r)),{instance:i}=await WebAssembly.instantiateStreaming(l,o);return i.exports},async loadWebAssemblyModule(e,t,r,n){let o=fetch(K(r));return await WebAssembly.compileStreaming(o)}};let F=globalThis.TURBOPACK;globalThis.TURBOPACK={push:I},F.forEach(I)})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antigravity-mobile-proxy",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "A web chat proxy for Antigravity IDE with ngrok OAuth tunnel support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antigravity",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
24
|
"dev": "next dev -p 5555",
|
|
25
|
-
"build": "next build",
|
|
25
|
+
"build": "NODE_ENV=production next build",
|
|
26
26
|
"postbuild": "node scripts/patch-next.js",
|
|
27
27
|
"start": "next start -p 5555",
|
|
28
28
|
"tunnel": "node bin/cli.js",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[6461,(e,t,r)=>{t.exports=e.x("zlib",()=>require("zlib"))},524,e=>{"use strict";class t{static create(e){return new Promise((r,n)=>{let o=new WebSocket(e);o.addEventListener("open",()=>r(new t(o))),o.addEventListener("error",n)})}#e;onmessage;onclose;constructor(e){this.#e=e,this.#e.addEventListener("message",e=>{this.onmessage&&this.onmessage.call(null,e.data)}),this.#e.addEventListener("close",()=>{this.onclose&&this.onclose.call(null)}),this.#e.addEventListener("error",()=>{})}send(e){this.#e.send(e)}close(){this.#e.close()}}e.s(["BrowserWebSocketTransport",()=>t])},40911,e=>{"use strict";let t=new class{level="info";constructor(){this.level=process.env.LOG_LEVEL||"info"}shouldLog(e){let t=["debug","info","warn","error"];return t.indexOf(e)>=t.indexOf(this.level)}debug(e,t){this.shouldLog("debug")&&console.debug(`[DEBUG] ${e}`,t||"")}info(e,t){this.shouldLog("info")&&console.info(`[INFO] ${e}`,t||"")}warn(e,t){this.shouldLog("warn")&&console.warn(`[WARN] ${e}`,t||"")}error(e,t){this.shouldLog("error")&&console.error(`[ERROR] ${e}`,t||"")}};e.s(["logger",0,t])},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},46786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93846,e=>{"use strict";let t=globalThis.__PROXY_CTX||{workbenchPage:null,browser:null,allWorkbenches:[],activeWindowIdx:0,activeConversationId:null,activeTitle:null,lastActionTimestamp:0};e.s(["default",0,t])},53506,e=>{"use strict";var t=e.i(29476),r=e.i(40911),n=e.i(93846);let o=!1,l=null;async function s(){o&&n.default.workbenchPage||(l||(l=(async()=>{try{await (0,t.connectToWorkbench)(n.default),o=!0,n.default.browser?.on("disconnected",()=>{r.logger.error("[CDP] Browser disconnected. Will reconnect on next request."),o=!1,l=null,n.default.workbenchPage=null,n.default.browser=null,n.default.allWorkbenches=[]}),n.default.workbenchPage?.on("close",()=>{r.logger.warn("[CDP] Workbench page closed. Will reconnect on next request."),o=!1,l=null,n.default.workbenchPage=null})}catch(e){r.logger.error("[CDP Init] Failed to connect:",e.message),l=null}})()),await l)}e.s(["ensureCdpConnection",()=>s])},41444,e=>{"use strict";function t(e){return new Promise(t=>setTimeout(t,e))}e.s(["sleep",()=>t])},40955,15198,e=>{"use strict";var t=e.i(22734),r=e.i(14747);let n={chatInput:'#antigravity\\.agentSidePanelInputBox [contenteditable="true"][role="textbox"]',messageList:"#conversation > div:first-child .mx-auto.w-full",conversation:"#conversation",spinner:".antigravity-agent-side-panel .animate-spin"};e.s(["SELECTORS",0,n],15198);let o=r.default.join("/tmp","proxy-debug-state.json");async function l(e){if(!e.workbenchPage)return{isRunning:!1,turnCount:0,stepGroupCount:0,thinking:[],toolCalls:[],responses:[],notifications:[],error:null,fileChanges:[],lastTurnResponseHTML:""};let r=await e.workbenchPage.evaluate(e=>{let t=e=>(e?.getAttribute?e.getAttribute("class"):"")||"",r=document.querySelector(".antigravity-agent-side-panel");if(!r)return{isRunning:!1,turnCount:0,stepGroupCount:0,thinking:[],toolCalls:[],responses:[],notifications:[],error:null,fileChanges:[],lastTurnResponseHTML:""};let n=!1,o=!1,l=document.querySelector("#antigravity\\.agentSidePanelInputBox");if(l||(l=r.querySelector('[id*="InputBox"]')),l){let e=l.closest(".flex")||l.parentElement?.parentElement||l.parentElement;if(e){window.__proxyInputBoxHTML=e.outerHTML;let t=e.querySelectorAll("button"),r=!1,l=!1;for(let e of t){let t=e.innerHTML||"",n=(e.getAttribute("aria-label")||"").toLowerCase(),o=(e.textContent||"").trim().toLowerCase(),s=(e.getAttribute("data-tooltip-id")||"").toLowerCase();(t.match(/lucide-square(?:[^a-z0-9-]|$)/i)||t.includes("lucide-circle-stop")||t.includes("lucide-octagon")||n.includes("stop")||n.includes("cancel")||"stop"===o||s.includes("stop"))&&(r=!0),(t.includes("lucide-send")||t.includes("lucide-arrow-up")||t.includes("lucide-arrow-right")||t.includes("codicon-send")||t.includes("lucide-corner-down-left")||n.includes("send")||n.includes("submit")||"send"===o||s.includes("send"))&&(l=!0)}n=!!r||!l&&!0,o=!0}}if(!o){for(let o of r.querySelectorAll(e)){let e=o,r=!1;for(;e;){let n=t(e);if(n.includes("invisible")||n.includes("opacity-0")){r=!0;break}e=e.parentElement}if(!r){n=!0;break}}if(!n)for(let e of r.querySelectorAll("button")){let t=(e.getAttribute("aria-label")||"").toLowerCase(),r=(e.textContent?.trim()||"").toLowerCase();if(("stop"===r||"abort"===r||t.includes("stop")||t.includes("abort")||t.includes("interrupt"))&&"none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility){n=!0;break}}}let s=r.querySelector("#conversation")||document.querySelector("#conversation"),i=s?.querySelector(".overflow-y-auto"),a=i?.querySelector(".mx-auto"),u=a?Array.from(a.children):[],c=u.length,d=u.length>0?u[u.length-1]:null,p=d?.querySelector(".relative.flex.flex-col.gap-y-3")||d,f=p?Array.from(p.children):[],m=f.length,h=d||r,x=["run","proceed","approve","allow","yes","accept","continue","save","confirm","deny","reject","cancel","no","allow once","allow this conversation"],g=["relocate","ask every time","show in explorer","open in editor","copy path","reveal"],y=e=>{if(!e)return!1;let t=e.trim().toLowerCase();return!g.some(e=>t===e||t.startsWith(e))&&x.some(e=>t===e||t.startsWith(e))},w=[];for(let e of Array.from(h.querySelectorAll("button")).filter(e=>e.textContent?.trim().startsWith("Thought for")))w.push({time:e.textContent.trim()});let b=[],C=h.querySelectorAll(".flex.flex-col.gap-2.border.rounded-lg.my-1"),v=window.__proxyToolCounter||0;for(let e of C){e.dataset.proxyToolId||(e.dataset.proxyToolId=String(v++));let t=e.dataset.proxyToolId,r=e.querySelector(".mb-1.px-2.py-1.text-sm"),n=r?.querySelector("span.opacity-60"),o=n?.textContent?.trim()||"",l=e.querySelector("span.font-mono.text-sm"),s=l?.textContent?.trim()||"",i="",a=e.querySelector("pre.whitespace-pre-wrap");if(a){let e=a.textContent?.trim()||"",t=e.indexOf("$");-1!==t&&(i=e.substring(t+1).trim())}let u=null;for(let t of e.querySelectorAll("span, div")){let e=t.textContent?.trim()||"";if(e.startsWith("Exit code")){u=e;break}}let c=Array.from(e.querySelectorAll("button")),d=c.some(e=>e.textContent?.trim()==="Cancel"),p=c.map(e=>e.textContent?.trim()||"").filter(y),f="unknown",m=o.toLowerCase();m.includes("command")?f="command":m.includes("file")||m.includes("edit")||m.includes("creat")||m.includes("writ")?f="file":m.includes("search")||m.includes("grep")?f="search":m.includes("read")||m.includes("view")?f="read":m.includes("brows")&&(f="browser");let h=e.querySelector(".component-shared-terminal"),x="";if(h){let e=h.querySelector(".xterm-rows")||h.querySelector(".xterm-screen")||h.querySelector('[class*="xterm"]');e&&(x=e.textContent?.substring(0,500)||""),x||(x=h.textContent?.substring(0,500)||"")}b.push({id:t,status:o,type:f,path:s,command:i||null,exitCode:u,hasCancelBtn:d,footerButtons:p,hasTerminal:!!h,terminalOutput:x||null})}window.__proxyToolCounter=v;let S=h.querySelectorAll(".flex.flex-col.space-y-2 > .flex.flex-row:not(.my-2)"),k=/^(Edited|Created|Analyzed|Read|Viewed|Wrote|Replaced|Searching|Deleted|Moved|Renamed|MCP Tool)/i;for(let e of S)try{let t=e.textContent?.trim()||"",r=t.match(k);if(!r)continue;let n=r[1];e.dataset.proxyToolId||(e.dataset.proxyToolId=String(v++));let o=e.dataset.proxyToolId,l=Array.from(e.querySelectorAll("span")),s="",i=null,a=null,u=null,c=null,d=null,p=null;if(n.startsWith("MCP")){let r=e.querySelector(".flex.flex-row.items-center.gap-1.overflow-hidden");if(r){let e=[];for(let t of r.childNodes)3===t.nodeType&&e.push(t.textContent.trim());p=e.join("").trim()||null}if(!p){let e=t.indexOf(":");if(e>-1){let r=t.substring(e+1).trim(),n=r.search(/\n|Show|Ran/);p=n>-1?r.substring(0,n).trim():r.substring(0,60).trim()}}s=p||"";let n=l.filter(e=>(e.className||"").startsWith("mtk"));n.length>0&&(c=n.map(e=>e.textContent).join("").trim()).length>500&&(c=c.substring(0,500)+"…");let o=l.find(e=>e.textContent?.trim()==="Output");if(o){let e=o.closest(".flex.flex-col")||o.parentElement;if(e){let t=e.textContent||"",r=t.indexOf("Output");r>-1&&(d=t.substring(r+6).trim()).length>500&&(d=d.substring(0,500)+"…")}}}else{let e=l.find(e=>{let t=e.className||"";return t.includes("inline-flex")&&t.includes("items-center")});s=e?.textContent?.trim()||"";let t=l.find(e=>(e.className||"").includes("text-green"));i=t?.textContent?.trim()||null;let r=l.find(e=>(e.className||"").includes("text-red"));a=r?.textContent?.trim()||null;let n=l.find(e=>/^#L\d/.test(e.textContent?.trim()||""));u=n?.textContent?.trim()||null}let f="file",m=n.toLowerCase();m.includes("search")||m.includes("grep")?f="search":m.includes("read")||m.includes("view")||m.includes("analyz")?f="read":m.startsWith("mcp")&&(f="mcp");let h=Array.from(e.querySelectorAll("button")),x=e.nextElementSibling;if(x)for(let e of Array.from(x.querySelectorAll("button"))){let t=(e.textContent||"").trim().toLowerCase();y(t)&&h.push(e)}let g=(h=[...new Set(h)]).map(e=>e.textContent?.trim()||"").filter(y),w=g.some(e=>"cancel"===e.toLowerCase());b.push({id:o,status:n,type:f,path:s,command:null,exitCode:null,hasCancelBtn:w,footerButtons:g,hasTerminal:!1,terminalOutput:null,additions:i,deletions:a,lineRange:u,mcpToolName:p,mcpArgs:c,mcpOutput:d})}catch{}window.__proxyToolCounter=v;try{for(let e of r.querySelectorAll(".flex.flex-col.space-y-2 > .flex.flex-row:not(.my-2)")){let t=e,r=Array.from(t.querySelectorAll("button")).map(e=>e.textContent?.trim()||"").filter(Boolean);if(!r.some(e=>/^(allow|deny|allow once|allow this conversation)$/i.test(e))||t.dataset?.proxyToolId&&b.some(e=>e.id===t.dataset.proxyToolId&&e.footerButtons.length>0))continue;let n=r.filter(y);if(0===n.length)continue;let o=[...b].reverse().find(e=>/^(Analyzed|Read|Viewed)/i.test(e.status));if(o&&0===o.footerButtons.length)o.footerButtons=n,o.hasCancelBtn=n.some(e=>"deny"===e.toLowerCase()||"cancel"===e.toLowerCase());else{t.dataset.proxyToolId||(t.dataset.proxyToolId=String(window.__proxyToolCounter++));let e=(t.textContent||"").match(/access to\s+(.+?)(?:\?|$)/i),r=e?e[1].trim():"";b.push({id:t.dataset.proxyToolId,status:"Permission Required",type:"read",path:r,command:null,exitCode:null,hasCancelBtn:!0,footerButtons:n,hasTerminal:!1,terminalOutput:null,additions:null,deletions:null,lineRange:null,mcpToolName:null,mcpArgs:null,mcpOutput:null})}}}catch{}if(!n&&b.some(e=>e.hasCancelBtn&&!e.exitCode)&&(n=!0),!n){let e=f[f.length-1];if(e){for(let r of e.querySelectorAll(".animate-spin")){if(r.classList.contains("w-4")&&r.classList.contains("h-4"))continue;let o=r,l=!1;for(;o&&o!==e;){let e=t(o);if(e.includes("invisible")||e.includes("opacity-0")||e.includes("hidden")){l=!0;break}o=o.parentElement}if(!l){n=!0;break}}if(!n)for(let r of e.querySelectorAll(".animate-pulse, .in-progress-checkbox, .typing-indicator")){let o=r,l=!1;for(;o&&o!==e;){let e=t(o);if(e.includes("invisible")||e.includes("opacity-0")||e.includes("hidden")){l=!0;break}o=o.parentElement}if(!l){n=!0;break}}if(!n)for(let r of e.querySelectorAll('[class*="text-sm"][class*="opacity"]')){if(t(r).includes("invisible"))continue;let e=(r.textContent||"").toLowerCase();if(e.includes("running")||e.includes("progress")||e.includes("navigat")||e.includes("executing")||e.includes("analyzing")||e.includes("processing")||e.includes("subagent")||e.includes("browser")){n=!0;break}}}}let q=[];for(let e of h.querySelectorAll(".notify-user-container")){let t=e.cloneNode(!0);t.querySelectorAll("style, script").forEach(e=>e.remove()),t.querySelectorAll('svg.cursor-pointer, [class*="cursor-pointer"][class*="opacity-70"], button[class*="opacity-70"]').forEach(e=>e.remove());let r=t.innerHTML?.trim();r&&q.push(r)}let _=[],T="",L=Array.from(h.querySelectorAll(".leading-relaxed.select-text")).filter(e=>{let r=e.parentElement,n=0;for(;r&&r!==h&&n<10;){if(t(r).includes("max-h-0"))return!1;r=r.parentElement,n++}return!!e.textContent?.trim()});for(let e of L){let t=e.cloneNode(!0);t.querySelectorAll("style, script").forEach(e=>e.remove()),t.querySelectorAll('svg.cursor-pointer, [class*="cursor-pointer"][class*="opacity-70"], button[class*="opacity-70"]').forEach(e=>e.remove());let r=t.innerHTML?.trim();r&&_.push(r)}L.length>0&&(T=L[L.length-1].innerHTML||"");let A=null,E=r.textContent||"";for(let e of["Agent terminated due to error","error persists","start a new conversation"])if(E.includes(e)){let e,t=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,null);for(;e=t.nextNode();)if(e.textContent.includes("Agent terminated")){A=e.textContent.trim();break}A||(A="[Agent terminated due to error]");break}let P=[];for(let e of r.querySelectorAll("svg.lucide-file-diff")){let t=e.closest(".flex.items-center");if(t){let e=t.querySelector("span");e&&P.push({fileName:e.textContent?.trim()||"",type:"diff"})}}return{isRunning:n,turnCount:c,stepGroupCount:m,thinking:w,toolCalls:b,responses:_,notifications:q,error:A,fileChanges:P,lastTurnResponseHTML:T,inputBoxHTML:window.__proxyInputBoxHTML||""}},n.spinner);try{let e={timestamp:new Date().toISOString(),isRunning:r.isRunning,turnCount:r.turnCount,toolCallsCount:r.toolCalls.length,responsesCount:r.responses.length,rawLastTurnResponseHTML:r.lastTurnResponseHTML,extractedResponses:r.responses,toolCalls:r.toolCalls,thinking:r.thinking,notifications:r.notifications,error:r.error,inputBoxHTML:r.inputBoxHTML||""};t.default.writeFileSync(o,JSON.stringify(e,null,2))}catch(e){console.error("Failed to write debug file",e)}return r}e.s(["getFullAgentState",()=>l],40955)},23099,e=>{"use strict";var t=e.i(15198),r=e.i(41444),n=e.i(40911);async function o(e,o){if(!e.workbenchPage)throw Error("Not connected to Antigravity");n.logger.info(`[Chat] Sending message (${o.length} chars)...`),await e.workbenchPage.click(t.SELECTORS.chatInput),await (0,r.sleep)(200),await e.workbenchPage.evaluate(e=>{let t=document.querySelector(e);t&&(t.textContent="",t.focus())},t.SELECTORS.chatInput),await e.workbenchPage.keyboard.type(o),await (0,r.sleep)(300),await e.workbenchPage.keyboard.press("Enter"),n.logger.info("[Chat] Sent.")}e.s(["sendMessage",()=>o])},82359,e=>{e.v(e=>Promise.resolve().then(()=>e(17293)))},6384,e=>{e.v(e=>Promise.resolve().then(()=>e(524)))},34561,e=>{e.v(e=>Promise.resolve().then(()=>e(73335)))},17952,e=>{e.v(t=>Promise.all(["server/chunks/node_modules_@puppeteer_browsers_lib_esm_main_83020de3.js"].map(t=>e.l(t))).then(()=>t(78893)))},56955,e=>{e.v(e=>Promise.resolve().then(()=>e(68213)))},11105,e=>{e.v(e=>Promise.resolve().then(()=>e(50227)))},97365,e=>{e.v(t=>Promise.all(["server/chunks/node_modules_1f8a2929._.js","server/chunks/node_modules_f81d3958._.js"].map(t=>e.l(t))).then(()=>t(66560)))},42394,e=>{e.v(t=>Promise.all(["server/chunks/node_modules_1f8a2929._.js","server/chunks/node_modules_151ca6ae._.js"].map(t=>e.l(t))).then(()=>t(78947)))},34844,e=>{e.v(t=>Promise.all(["server/chunks/node_modules_3b486fee._.js","server/chunks/node_modules_yargs_index_mjs_c4f6f97b._.js"].map(t=>e.l(t))).then(()=>t(91919)))},80113,e=>{e.v(t=>Promise.all(["server/chunks/node_modules_yargs_helpers_helpers_mjs_abe15519._.js","server/chunks/node_modules_64199bef._.js"].map(t=>e.l(t))).then(()=>t(25057)))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__151eca3a._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},46786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},93846,e=>{"use strict";let t=globalThis.__PROXY_CTX||{workbenchPage:null,browser:null,allWorkbenches:[],activeWindowIdx:0,activeConversationId:null,activeTitle:null,lastActionTimestamp:0};e.s(["default",0,t])},40298,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),i=e.i(61916),s=e.i(74677),o=e.i(69741),l=e.i(16795),d=e.i(87718),u=e.i(95169),c=e.i(47587),p=e.i(66012),f=e.i(70101),h=e.i(26937),x=e.i(10372),v=e.i(93695);e.i(52474);var m=e.i(220),R=e.i(89171),g=e.i(93846),y=e.i(22734),w=e.i(14747),E=e.i(46786);let C=w.default.join(E.default.homedir(),".gemini","antigravity","brain");async function T(){try{if(g.default.activeConversationId||g.default.activeTitle||(g.default.activeConversationId=function(){try{if(!y.default.existsSync(C))return null;let e=y.default.readdirSync(C,{withFileTypes:!0}),t=null;for(let r of e){if(!r.isDirectory()||r.name.startsWith("."))continue;let e=w.default.join(C,r.name),a=y.default.statSync(e);(!t||a.mtimeMs>t.mtime)&&(t={id:r.name,mtime:a.mtimeMs})}return t?.id??null}catch{return null}}()),!g.default.activeConversationId)return R.NextResponse.json({files:[]});let e=w.default.join(C,g.default.activeConversationId);if(!y.default.existsSync(e))return R.NextResponse.json({files:[]});let t=[];for(let r of y.default.readdirSync(e,{recursive:!0,withFileTypes:!0})){if(!r.isFile()||!r.name.endsWith(".md"))continue;let a=r.parentPath||r.path||e,n=w.default.join(a,r.name),i=w.default.relative(e,n).replace(/\\/g,"/");if(!i.split("/").some(e=>e.startsWith(".")))try{let e=y.default.statSync(n);t.push({name:i,size:e.size,mtime:e.mtime.toISOString()})}catch{continue}}return t.sort((e,t)=>new Date(t.mtime).getTime()-new Date(e.mtime).getTime()),R.NextResponse.json({files:t})}catch(e){return R.NextResponse.json({error:e.message},{status:500})}}e.s(["GET",()=>T,"dynamic",0,"force-dynamic"],66716);var b=e.i(66716);let A=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/v1/artifacts/active/route",pathname:"/api/v1/artifacts/active",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/v1/artifacts/active/route.ts",nextConfigOutput:"standalone",userland:b}),{workAsyncStorage:N,workUnitAsyncStorage:S,serverHooks:P}=A;function j(){return(0,a.patchFetch)({workAsyncStorage:N,workUnitAsyncStorage:S})}async function k(e,t,a){A.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let R="/api/v1/artifacts/active/route";R=R.replace(/\/index$/,"")||"/";let g=await A.prepare(e,t,{srcPage:R,multiZoneDraftMode:!1});if(!g)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:y,params:w,nextConfig:E,parsedUrl:C,isDraftMode:T,prerenderManifest:b,routerServerContext:N,isOnDemandRevalidate:S,revalidateOnlyGenerated:P,resolvedPathname:j,clientReferenceManifest:k,serverActionsManifest:q}=g,O=(0,o.normalizeAppPath)(R),_=!!(b.dynamicRoutes[O]||b.routes[j]),I=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,C,!1):t.end("This page could not be found"),null);if(_&&!T){let e=!!b.routes[j],t=b.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await I();throw new v.NoFallbackError}}let H=null;!_||A.isDev||T||(H="/index"===(H=j)?"/":H);let D=!0===A.isDev||!_,U=_&&!D;q&&k&&(0,s.setManifestsSingleton)({page:R,clientReferenceManifest:k,serverActionsManifest:q});let M=e.method||"GET",F=(0,i.getTracer)(),$=F.getActiveScopeSpan(),K={params:w,prerenderManifest:b,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:D,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:E.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>A.onRequestError(e,t,a,n,N)},sharedContext:{buildId:y}},W=new l.NodeNextRequest(e),B=new l.NodeNextResponse(t),L=d.NextRequestAdapter.fromNodeNextRequest(W,(0,d.signalFromNodeResponse)(t));try{let s=async e=>A.handle(L,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${M} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${M} ${R}`)}),o=!!(0,n.getRequestMeta)(e,"minimalMode"),l=async n=>{var i,l;let d=async({previousCacheEntry:r})=>{try{if(!o&&S&&P&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await s(n);e.fetchMetrics=K.renderOpts.fetchMetrics;let l=K.renderOpts.pendingWaitUntil;l&&a.waitUntil&&(a.waitUntil(l),l=void 0);let d=K.renderOpts.collectedTags;if(!_)return await (0,p.sendResponse)(W,B,i,K.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(i.headers);d&&(t[x.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=x.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,a=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=x.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await A.onRequestError(e,t,{routerKind:"App Router",routePath:R,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:S})},!1,N),t}},u=await A.handleResponse({req:e,nextConfig:E,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:b,isRoutePPREnabled:!1,isOnDemandRevalidate:S,revalidateOnlyGenerated:P,responseGenerator:d,waitUntil:a.waitUntil,isMinimalMode:o});if(!_)return null;if((null==u||null==(i=u.value)?void 0:i.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});o||t.setHeader("x-nextjs-cache",S?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),T&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let v=(0,f.fromNodeOutgoingHttpHeaders)(u.value.headers);return o&&_||v.delete(x.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||v.get("Cache-Control")||v.set("Cache-Control",(0,h.getCacheControlHeader)(u.cacheControl)),await (0,p.sendResponse)(W,B,new Response(u.value.body,{headers:v,status:u.value.status||200})),null};$?await l($):await F.withPropagatedContext(e.headers,()=>F.trace(u.BaseServerSpan.handleRequest,{spanName:`${M} ${R}`,kind:i.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},l))}catch(t){if(t instanceof v.NoFallbackError||await A.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:S})},!1,N),_)throw t;return await (0,p.sendResponse)(W,B,new Response(null,{status:500})),null}}e.s(["handler",()=>k,"patchFetch",()=>j,"routeModule",()=>A,"serverHooks",()=>P,"workAsyncStorage",()=>N,"workUnitAsyncStorage",()=>S],40298)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__ec32b318._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},42602,(a,b,c)=>{"use strict";b.exports=a.r(18622)},87924,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactJsxRuntime},3171,a=>{"use strict";var b=a.i(87924);function c({error:a,reset:c}){return(0,b.jsx)("html",{lang:"en",children:(0,b.jsxs)("body",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",backgroundColor:"#0a0a0f",color:"#888",fontFamily:"system-ui, sans-serif",margin:0},children:[(0,b.jsx)("h1",{style:{fontSize:"2rem",margin:0,color:"#fff"},children:"Something went wrong"}),(0,b.jsx)("p",{style:{fontSize:"1rem",marginTop:"0.5rem"},children:a.message}),(0,b.jsx)("button",{onClick:()=>c(),style:{marginTop:"1rem",padding:"0.5rem 1rem",backgroundColor:"#333",color:"#fff",border:"none",borderRadius:"6px",cursor:"pointer"},children:"Try again"})]})})}a.s(["default",()=>c])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__f77eb371._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[85546,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/app/global-error.tsx <module evaluation> from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/app/global-error.tsx <module evaluation>","default")},53128,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/app/global-error.tsx from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/app/global-error.tsx","default")},16893,a=>{"use strict";a.i(85546);var b=a.i(53128);a.n(b)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=app_global-error_tsx_9170b7a0._.js.map
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
export default function GlobalError({
|
|
4
|
-
error,
|
|
5
|
-
reset,
|
|
6
|
-
}: {
|
|
7
|
-
error: Error & { digest?: string };
|
|
8
|
-
reset: () => void;
|
|
9
|
-
}) {
|
|
10
|
-
return (
|
|
11
|
-
<html lang="en">
|
|
12
|
-
<body style={{
|
|
13
|
-
display: 'flex',
|
|
14
|
-
flexDirection: 'column' as const,
|
|
15
|
-
alignItems: 'center',
|
|
16
|
-
justifyContent: 'center',
|
|
17
|
-
height: '100vh',
|
|
18
|
-
backgroundColor: '#0a0a0f',
|
|
19
|
-
color: '#888',
|
|
20
|
-
fontFamily: 'system-ui, sans-serif',
|
|
21
|
-
margin: 0,
|
|
22
|
-
}}>
|
|
23
|
-
<h1 style={{ fontSize: '2rem', margin: 0, color: '#fff' }}>Something went wrong</h1>
|
|
24
|
-
<p style={{ fontSize: '1rem', marginTop: '0.5rem' }}>{error.message}</p>
|
|
25
|
-
<button
|
|
26
|
-
onClick={() => reset()}
|
|
27
|
-
style={{
|
|
28
|
-
marginTop: '1rem',
|
|
29
|
-
padding: '0.5rem 1rem',
|
|
30
|
-
backgroundColor: '#333',
|
|
31
|
-
color: '#fff',
|
|
32
|
-
border: 'none',
|
|
33
|
-
borderRadius: '6px',
|
|
34
|
-
cursor: 'pointer',
|
|
35
|
-
}}
|
|
36
|
-
>
|
|
37
|
-
Try again
|
|
38
|
-
</button>
|
|
39
|
-
</body>
|
|
40
|
-
</html>
|
|
41
|
-
);
|
|
42
|
-
}
|