gemini-cli-devtools 0.1.1 → 0.1.2

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.
@@ -48,7 +48,7 @@ Error generating stack: `+o.message+`
48
48
  ::-webkit-scrollbar-track { background: ${N.bgSecondary}; }
49
49
  ::-webkit-scrollbar-thumb { background: ${N.border}; border-radius: 4px; }
50
50
  ::-webkit-scrollbar-thumb:hover { background: ${N.textSecondary}; }
51
- `}),m.jsxs("div",{style:{display:"flex",background:N.bgSecondary,borderBottom:`1px solid ${N.border}`,height:"36px",alignItems:"center",padding:"0 8px",gap:"12px"},children:[m.jsxs("div",{style:{display:"flex",height:"100%"},children:[m.jsx(Yu,{active:e==="console",onClick:()=>t("console"),label:"Console",t:N}),m.jsx(Yu,{active:e==="network",onClick:()=>t("network"),label:"Network",t:N})]}),m.jsxs("div",{style:{marginLeft:"auto",fontSize:"11px",display:"flex",alignItems:"center",gap:"12px"},children:[o&&l.includes(o)&&m.jsx("button",{onClick:d,style:{fontSize:"11px",padding:"4px 8px",border:`1px solid ${N.border}`,background:N.bg,color:N.text,borderRadius:"4px",cursor:"pointer",fontWeight:600},children:"📤 Export"}),m.jsxs("label",{style:{padding:"2px 8px",borderRadius:"4px",border:`1px solid ${N.border}`,background:N.bg,cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",fontWeight:600,fontSize:"11px"},children:[m.jsx("span",{children:"📥 Import"}),m.jsx("input",{type:"file",accept:".jsonl",onChange:a,style:{display:"none"}})]}),m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"11px",color:N.textSecondary},children:"Session:"}),p.length>0?m.jsx("select",{value:o||"",onChange:g=>i(g.target.value),style:{fontSize:"11px",padding:"2px 8px",background:N.bg,color:N.text,border:`1px solid ${N.border}`,borderRadius:"3px",minWidth:"280px",outline:"none"},children:p.map(g=>m.jsxs("option",{value:g,children:[g," ",g===p[0]&&!g.startsWith("[Imported]")?"(Latest)":""]},g))}):m.jsx("span",{style:{fontSize:"11px",color:N.textSecondary,fontStyle:"italic"},children:"No Sessions"}),o&&m.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"11px",marginLeft:"8px"},children:[m.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:l.includes(o)?"#34a853":"#ea4335"}}),m.jsx("span",{style:{color:N.textSecondary},children:l.includes(o)?"Connected":"Disconnected"})]})]}),m.jsx("button",{onClick:f,style:{fontSize:"14px",padding:"2px 8px",border:`1px solid ${N.border}`,background:N.bg,color:N.text,borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",height:"24px",width:"32px"},title:S?"Switch to light mode":"Switch to dark mode",children:S?"🌙":"☀️"})]})]}),m.jsx("div",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:o?m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{display:e==="console"?"flex":"none",height:"100%"},children:m.jsx(Ad,{logs:w,t:N})}),m.jsx("div",{style:{display:e==="network"?"flex":"none",height:"100%"},children:m.jsx(Wd,{logs:E,t:N,isDark:S})})]}):m.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:N.textSecondary,fontSize:"14px"},children:"Please start Gemini CLI to begin debugging"})})]})}function Yu({active:e,onClick:t,label:n,t:r}){return m.jsx("div",{onClick:t,style:{padding:"4px 16px",cursor:"pointer",color:e?r.accent:r.textSecondary,fontWeight:600,fontSize:"12px",userSelect:"none",borderBottom:e?`2px solid ${r.accent}`:"2px solid transparent",height:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",transition:"all 0.2s"},children:n})}function $d({log:e,t}){const[n,r]=I.useState(!1),l=e.content||"",o=l.split(`
51
+ `}),m.jsxs("div",{style:{display:"flex",background:N.bgSecondary,borderBottom:`1px solid ${N.border}`,height:"36px",alignItems:"center",padding:"0 8px",gap:"12px"},children:[m.jsxs("div",{style:{display:"flex",height:"100%"},children:[m.jsx(Yu,{active:e==="console",onClick:()=>t("console"),label:"Console",t:N}),m.jsx(Yu,{active:e==="network",onClick:()=>t("network"),label:"Network",t:N})]}),m.jsxs("div",{style:{marginLeft:"auto",fontSize:"11px",display:"flex",alignItems:"center",gap:"12px"},children:[o&&l.includes(o)&&m.jsx("button",{onClick:d,style:{fontSize:"11px",padding:"4px 8px",border:`1px solid ${N.border}`,background:N.bg,color:N.text,borderRadius:"4px",cursor:"pointer",fontWeight:600},children:"📤 Export"}),m.jsxs("label",{style:{padding:"2px 8px",borderRadius:"4px",border:`1px solid ${N.border}`,background:N.bg,cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",fontWeight:600,fontSize:"11px"},children:[m.jsx("span",{children:"📥 Import"}),m.jsx("input",{type:"file",accept:".jsonl",onChange:a,style:{display:"none"}})]}),m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"11px",color:N.textSecondary},children:"Session:"}),p.length>0?m.jsx("select",{value:o||"",onChange:g=>i(g.target.value),style:{fontSize:"11px",padding:"2px 8px",background:N.bg,color:N.text,border:`1px solid ${N.border}`,borderRadius:"3px",minWidth:"280px",outline:"none"},children:p.map(g=>m.jsxs("option",{value:g,children:[g," ",g===p[0]&&!g.startsWith("[Imported]")?"(Latest)":""]},g))}):m.jsx("span",{style:{fontSize:"11px",color:N.textSecondary,fontStyle:"italic"},children:"No Sessions"}),o&&!o.startsWith("[Imported]")&&m.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"11px",marginLeft:"8px"},children:[m.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:l.includes(o)?"#34a853":"#ea4335"}}),m.jsx("span",{style:{color:N.textSecondary},children:l.includes(o)?"Connected":"Disconnected"})]})]}),m.jsx("button",{onClick:f,style:{fontSize:"14px",padding:"2px 8px",border:`1px solid ${N.border}`,background:N.bg,color:N.text,borderRadius:"4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",height:"24px",width:"32px"},title:S?"Switch to light mode":"Switch to dark mode",children:S?"🌙":"☀️"})]})]}),m.jsx("div",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:o?m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{display:e==="console"?"flex":"none",height:"100%"},children:m.jsx(Ad,{logs:w,t:N})}),m.jsx("div",{style:{display:e==="network"?"flex":"none",height:"100%"},children:m.jsx(Wd,{logs:E,t:N,isDark:S})})]}):m.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:N.textSecondary,fontSize:"14px"},children:"Please start Gemini CLI to begin debugging"})})]})}function Yu({active:e,onClick:t,label:n,t:r}){return m.jsx("div",{onClick:t,style:{padding:"4px 16px",cursor:"pointer",color:e?r.accent:r.textSecondary,fontWeight:600,fontSize:"12px",userSelect:"none",borderBottom:e?`2px solid ${r.accent}`:"2px solid transparent",height:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",transition:"all 0.2s"},children:n})}function $d({log:e,t}){const[n,r]=I.useState(!1),l=e.content||"",o=l.split(`
52
52
  `),i=500,u=5,s=l.length>i,c=o.length>u,v=s||c,y=e.type==="error",h=e.type==="warn",k=y?t.errorBg:h?t.warnBg:"transparent",C=y?"#f28b82":h?"#fdd663":t.text,S=y?"❌":h?"⚠️":" ";let N=l;return v&&!n&&(c?N=o.slice(0,u).join(`
53
53
  `)+`
54
54
  ...`:N=l.substring(0,i)+"..."),m.jsxs("div",{style:{display:"flex",borderBottom:`1px solid ${t.rowBorder}`,padding:"4px 12px",backgroundColor:k,alignItems:"flex-start",gap:"8px"},children:[m.jsx("div",{style:{width:"16px",textAlign:"center",flexShrink:0,fontSize:"10px",marginTop:"2px"},children:S}),m.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:m.jsx("div",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",color:C,lineHeight:"1.5",fontSize:"11px"},children:N})}),m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:[v&&m.jsx("div",{onClick:()=>r(!n),style:{fontSize:"12px",color:t.text,cursor:"pointer",fontWeight:"bold",userSelect:"none",width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",border:`1px solid ${t.border}`,background:t.bgSecondary,transition:"all 0.1s"},onMouseOver:f=>{f.currentTarget.style.background=t.bgHover},onMouseOut:f=>{f.currentTarget.style.background=t.bgSecondary},title:n?"Collapse":"Expand",children:n?"−":"+"}),m.jsx("div",{style:{color:t.textSecondary,fontSize:"10px",userSelect:"none",textAlign:"right",minWidth:"70px"},children:new Date(e.timestamp).toLocaleTimeString([],{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})})]})]})}function Ad({logs:e,t}){const n=I.useRef(null);return I.useEffect(()=>{var r;(r=n.current)==null||r.scrollIntoView({behavior:"smooth"})},[e.length]),e.length===0?m.jsx("div",{style:{padding:"20px",color:t.textSecondary,fontSize:"11px",textAlign:"center",flex:1},children:"No console logs in this session"}):m.jsxs("div",{style:{flex:1,overflowY:"auto",fontFamily:'SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace',background:t.consoleBg,fontSize:"12px"},children:[e.map(r=>m.jsx($d,{log:r,t},r.id)),m.jsx("div",{ref:n})]})}function Wd({logs:e,t,isDark:n}){const[r,l]=I.useState(null),[o,i]=I.useState(""),[u,s]=I.useState(!0),[c,v]=I.useState({}),[y,h]=I.useState(400),k=I.useRef(!1);I.useEffect(()=>{const p=E=>{if(!k.current)return;const g=Math.max(200,Math.min(E.clientX,window.innerWidth-200));h(g)},w=()=>{k.current=!1,document.body.style.cursor="default",document.body.style.userSelect="auto"};return document.addEventListener("mousemove",p),document.addEventListener("mouseup",w),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",w)}},[]);const C=()=>{k.current=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none"},S=I.useMemo(()=>{let p=e;if(o){const w=o.toLowerCase();p=e.filter(E=>E.url.toLowerCase().includes(w))}return p},[e,o]),N=I.useMemo(()=>{if(!u)return null;const p={};return S.forEach(w=>{let E="Other";try{const g=new URL(w.url),_=g.pathname.lastIndexOf("/"),R=_!==-1?g.pathname.substring(0,_+1):"/";E=g.hostname+R}catch{}p[E]||(p[E]=[]),p[E].push(w)}),p},[S,u]);I.useEffect(()=>{N&&v(p=>{const w={...p};return Object.keys(N).forEach(E=>{w[E]===void 0&&(w[E]=!E.includes("play.googleapis.com"))}),w})},[N]);const f=p=>{v(w=>({...w,[p]:!w[p]}))},a=e.find(p=>p.id===r),d=(p,w)=>{const E=p.pending,g=p.response?p.response.status:p.error?"ERR":"...",_=p.error||p.response&&p.response.status>=400;let R=w||p.url;if(!w)try{const A=new URL(p.url);R=A.pathname+A.search}catch{}const L=p.id===r;return m.jsx("div",{onClick:()=>l(p.id),style:{padding:"8px 12px",cursor:"pointer",borderBottom:`1px solid ${t.rowBorder}`,display:"flex",flexDirection:"column",fontSize:"12px",backgroundColor:L?t.bgHover:"transparent",color:_?"#f28b82":t.text,paddingLeft:w?"24px":"12px"},children:m.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[m.jsx("span",{style:{fontWeight:"bold",width:"45px",flexShrink:0,fontSize:"10px",color:n?"#81c995":"#188038"},children:p.method}),m.jsx("span",{style:{flex:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",margin:"0 8px",fontWeight:500},title:p.url,children:R}),m.jsx("span",{style:{width:"40px",textAlign:"right",flexShrink:0,fontSize:"11px",color:E?t.accent:_?"#f28b82":"#81c995"},children:E?"⏳":g})]})},p.id)};return e.length===0?m.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:t.textSecondary,fontSize:"12px"},children:"No network activity in this session"}):m.jsxs("div",{style:{display:"flex",width:"100%",height:"100%"},children:[m.jsxs("div",{style:{width:`${y}px`,display:"flex",flexDirection:"column",borderRight:`1px solid ${t.border}`,background:t.bg},children:[m.jsxs("div",{style:{padding:"6px",background:t.bgSecondary,borderBottom:`1px solid ${t.border}`,display:"flex",gap:"6px"},children:[m.jsx("input",{type:"text",placeholder:"Filter...",value:o,onChange:p=>i(p.target.value),style:{flex:1,boxSizing:"border-box",padding:"4px 10px",background:t.bg,color:t.text,border:`1px solid ${t.border}`,borderRadius:"4px",fontSize:"12px"}}),m.jsx("button",{onClick:()=>s(!u),style:{background:u?t.accent:t.bg,color:u?"#fff":t.text,border:`1px solid ${t.border}`,borderRadius:"4px",cursor:"pointer",fontSize:"12px",padding:"0 8px"},title:"Group by Domain",children:"📂"})]}),m.jsx("div",{style:{flex:1,overflowY:"auto"},children:u&&N?Object.keys(N).map(p=>m.jsxs("div",{children:[m.jsxs("div",{onClick:()=>f(p),style:{padding:"6px 12px",background:t.bgSecondary,fontWeight:"bold",fontSize:"11px",borderBottom:`1px solid ${t.rowBorder}`,wordBreak:"break-all",cursor:"pointer",display:"flex",alignItems:"center",userSelect:"none"},children:[m.jsx("span",{style:{marginRight:"8px",fontSize:"9px",color:t.textSecondary},children:c[p]?"▼":"▶"}),p,m.jsx("span",{style:{marginLeft:"auto",fontWeight:"normal",color:t.textSecondary,fontSize:"10px",background:t.bg,padding:"0 6px",borderRadius:"10px"},children:N[p].length})]}),c[p]&&N[p].map(w=>{let E=w.url;try{const g=new URL(w.url),_=g.pathname.lastIndexOf("/");E=(g.pathname.substring(_+1)||"/")+g.search}catch{}return d(w,E)})]},p)):S.map(p=>d(p))})]}),m.jsx("div",{onMouseDown:C,style:{width:"2px",cursor:"col-resize",background:t.border,flexShrink:0,zIndex:10}}),m.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",background:t.bg},children:a?m.jsx(Vd,{log:a,t}):m.jsx("div",{style:{padding:"40px",textAlign:"center",color:t.textSecondary,fontSize:"14px"},children:"Select a request to view details"})})]})}function Vd({log:e,t}){var o;const[n,r]=I.useState("headers"),l=e.response?e.pending?"⏳":e.response.status:e.error?"Error":"⏳";return m.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},children:[m.jsxs("div",{style:{padding:"12px 16px",borderBottom:`1px solid ${t.border}`,background:t.bgSecondary},children:[m.jsx("div",{style:{fontWeight:"bold",fontSize:"13px",marginBottom:"6px",wordBreak:"break-all",color:t.text},children:e.url}),m.jsxs("div",{style:{fontSize:"11px",color:t.textSecondary,display:"flex",gap:"8px"},children:[m.jsx("span",{style:{background:t.bg,padding:"1px 6px",borderRadius:"3px",fontWeight:"bold"},children:e.method}),m.jsx("span",{children:"•"}),m.jsx("span",{style:{color:e.error?"#f28b82":"#81c995"},children:l}),m.jsx("span",{children:"•"}),m.jsx("span",{children:new Date(e.timestamp).toLocaleTimeString()}),e.response&&m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"•"}),m.jsxs("span",{style:{color:t.accent},children:[e.response.durationMs,"ms"]})]})]})]}),m.jsx("div",{style:{display:"flex",borderBottom:`1px solid ${t.border}`,background:t.bgSecondary,paddingLeft:"8px"},children:["headers","payload","response"].map(i=>m.jsx("div",{onClick:()=>r(i),style:{padding:"8px 16px",cursor:"pointer",fontWeight:600,fontSize:"12px",textTransform:"capitalize",borderBottom:n===i?`2px solid ${t.accent}`:"2px solid transparent",color:n===i?t.accent:t.textSecondary,transition:"all 0.2s"},children:i},i))}),m.jsxs("div",{style:{flex:1,overflowY:"auto",background:t.bg},children:[n==="headers"&&m.jsxs("div",{style:{padding:"16px"},children:[m.jsxs(Gl,{title:"General",t,children:[m.jsx(zn,{k:"Request URL",v:e.url,t}),m.jsx(zn,{k:"Request Method",v:e.method,t}),m.jsx(zn,{k:"Status Code",v:String(e.response?e.response.status:"Pending"),t,color:e.error?"#f28b82":"#81c995"}),e.error&&m.jsx(zn,{k:"Error",v:e.error,t,color:"#f28b82"})]}),m.jsx(Gl,{title:"Response Headers",t,children:e.response?m.jsx(Gu,{headers:e.response.headers,t}):m.jsx("span",{style:{fontStyle:"italic",color:t.textSecondary},children:"(no response yet)"})}),m.jsx(Gl,{title:"Request Headers",t,children:m.jsx(Gu,{headers:e.headers,t})})]}),n==="payload"&&m.jsx(Xu,{content:e.body,t}),n==="response"&&m.jsx(Xu,{content:(o=e.response)==null?void 0:o.body,t})]})]})}function Gl({title:e,children:t,t:n}){const[r,l]=I.useState(!1);return m.jsxs("div",{style:{marginBottom:"16px",border:`1px solid ${n.border}`,borderRadius:"6px",overflow:"hidden"},children:[m.jsxs("div",{onClick:()=>l(!r),style:{padding:"8px 12px",background:n.bgSecondary,fontWeight:"bold",fontSize:"11px",cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",gap:"8px"},children:[m.jsx("span",{style:{fontSize:"9px",color:n.textSecondary},children:r?"▶":"▼"}),e]}),!r&&m.jsx("div",{style:{padding:"12px",background:n.bg},children:t})]})}function zn({k:e,v:t,color:n,t:r}){return m.jsxs("div",{style:{display:"flex",fontSize:"12px",fontFamily:"monospace",marginBottom:"4px",lineHeight:"1.4"},children:[m.jsxs("div",{style:{fontWeight:"bold",color:r.textSecondary,width:"160px",flexShrink:0},children:[e,":"]}),m.jsx("div",{style:{flex:1,wordBreak:"break-all",color:n||r.text},children:t})]})}function Gu({headers:e,t}){return e?m.jsx(m.Fragment,{children:Object.entries(e).map(([n,r])=>m.jsx(zn,{k:n,v:String(r),t},n))}):m.jsx("div",{style:{color:t.textSecondary},children:"(none)"})}function Xu({content:e,t}){const[n,r]=I.useState("json"),l=e||"";return l?m.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[m.jsx("div",{style:{padding:"6px 12px",background:t.bgSecondary,borderBottom:`1px solid ${t.border}`,display:"flex",justifyContent:"flex-end",gap:"8px"},children:["json","raw"].map(o=>m.jsx("button",{onClick:()=>r(o),style:{fontSize:"11px",padding:"2px 8px",borderRadius:"4px",border:`1px solid ${t.border}`,background:n===o?t.accent:t.bg,color:n===o?"#fff":t.text,cursor:"pointer",textTransform:"uppercase",fontWeight:"bold"},children:o},o))}),m.jsx("div",{style:{flex:1,overflow:"auto",padding:"16px"},children:n==="raw"?m.jsx("pre",{style:{margin:0,fontSize:"12px",fontFamily:"SFMono-Regular, Consolas, monospace",whiteSpace:"pre-wrap",wordBreak:"break-all",color:t.text,lineHeight:"1.5"},children:l}):m.jsx(Hd,{content:l,t})})]}):m.jsx("div",{style:{padding:"40px",color:t.textSecondary,textAlign:"center"},children:"(No content)"})}function Hd({content:e,t}){const n=e||"";if(n.includes("data:")){const r=n.split(`
@@ -17,7 +17,7 @@
17
17
  overflow: hidden;
18
18
  }
19
19
  </style>
20
- <script type="module" crossorigin src="/assets/index-D1GYabok.js"></script>
20
+ <script type="module" crossorigin src="/assets/index-BCw3ir29.js"></script>
21
21
  </head>
22
22
  <body>
23
23
  <div id="root"></div>
package/dist/src/bin.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemini-cli-devtools",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",