@kabmo-labs/kabmo 0.38.1 → 0.38.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.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +219 -219
- package/dist/client/static/js/{CsvGrid-t1n057vw.js → CsvGrid-4dpsfdrf.js} +1 -1
- package/dist/client/static/js/{DocxView-c9g6teks.js → DocxView-crdgc0jd.js} +1 -1
- package/dist/client/static/js/{DrawioView-gd14j54m.js → DrawioView-1ts9y0yk.js} +1 -1
- package/dist/client/static/js/{ImageView-57f1ecdp.js → ImageView-w2hyp129.js} +1 -1
- package/dist/client/static/js/{LayoutWrapper-x7srbpz1.js → LayoutWrapper-pdvfkncm.js} +1 -1
- package/dist/client/static/js/{Modal-0bn3f77b.js → Modal-2sx1tgqr.js} +1 -1
- package/dist/client/static/js/{PdfView-cybz0xbj.js → PdfView-72c123a9.js} +1 -1
- package/dist/client/static/js/{SessionsView-gx5q68tp.js → SessionsView-a8921ysr.js} +1 -1
- package/dist/client/static/js/{SheetView-1kk5y326.js → SheetView-8xh69wgk.js} +1 -1
- package/dist/client/static/js/{SvgPreview-mp4tk37p.js → SvgPreview-z3fm87h6.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-78qb3can.js → abnfDiagram-O67JEVCF-25r2p3vh.js} +1 -1
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-n0fr4hb6.js → architectureDiagram-NJMV4G6O-z3n19xwk.js} +1 -1
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-2xemfrzh.js → blockDiagram-BEXU5L5S-vzamgz9s.js} +1 -1
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-zxfdx3eb.js → c4Diagram-YGBWAQC7-jejafgn0.js} +1 -1
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-z9sasy3k.js → classDiagram-v2-NBCMYWYE-qfa6mj0q.js} +1 -1
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-9byp0czh.js → cose-bilkent-JH36ORCC-9vzdgmk1.js} +1 -1
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-gnm129fx.js → cynefinDiagram-VND7K2PF-a3k3w1t5.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-sc5tfv1w.js → dagre-6A5THRUB-gf04dvxj.js} +1 -1
- package/dist/client/static/js/{diagram-22UHCM2B-hq11eek7.js → diagram-22UHCM2B-a9e0a684.js} +1 -1
- package/dist/client/static/js/{diagram-3UASUU5V-7bk532gd.js → diagram-3UASUU5V-fb73gfjd.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-yt8wxttm.js → diagram-ATOU4E4O-yb9n3t30.js} +1 -1
- package/dist/client/static/js/{diagram-CDSNMT55-n3978w6p.js → diagram-CDSNMT55-adhbhw28.js} +1 -1
- package/dist/client/static/js/{diagram-MLGK6HIB-004x4gyw.js → diagram-MLGK6HIB-v4yxyb8r.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-498nt489.js → diagram-MPIPVDR6-94ttsqy2.js} +1 -1
- package/dist/client/static/js/{dockerfile-6hbcmkc8.js → dockerfile-mrranatf.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-5fkmymqn.js → ebnfDiagram-ZINNZB2B-jj4f3pyq.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-6xrfa2kd.js → elk-276RUBZZ-mtnkhyte.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-byz4zbkn.js → erDiagram-OPXOYQCR-18qdkhm5.js} +1 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-zmz4grtx.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-4fkw1k01.js → ganttDiagram-FUAMR5RP-vz28h061.js} +1 -1
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-19g84yw8.js → gitGraphDiagram-X574FWY7-cgq3r4rz.js} +1 -1
- package/dist/client/static/js/{index-3y6krykq.js → index-12p63902.js} +1 -1
- package/dist/client/static/js/{index-1j1s91c4.js → index-1c7294vk.js} +1 -1
- package/dist/client/static/js/{index-sjnnv1gd.js → index-2xb54jt3.js} +1 -1
- package/dist/client/static/js/{index-57z8mtmx.js → index-4hsxaa87.js} +1 -1
- package/dist/client/static/js/{index-zj45wj1x.js → index-5v9v41ap.js} +2 -2
- package/dist/client/static/js/{index-e99ec2f0.js → index-6d5qj0kb.js} +1 -1
- package/dist/client/static/js/{index-gxtgyya0.js → index-6j9h1fa7.js} +1 -1
- package/dist/client/static/js/{index-7kafzae0.js → index-6k2x281j.js} +2 -2
- package/dist/client/static/js/{index-j314me09.js → index-6rt7gs1j.js} +1 -1
- package/dist/client/static/js/{index-dd4q54y0.js → index-737w2mqf.js} +1 -1
- package/dist/client/static/js/{index-kdgcbt17.js → index-95t1hwr8.js} +1 -1
- package/dist/client/static/js/{index-fpf1jkwd.js → index-a5ptb956.js} +1 -1
- package/dist/client/static/js/{index-pfwd0160.js → index-aa6qdgmv.js} +1 -1
- package/dist/client/static/js/{index-jbwns6sc.js → index-ajtd1q1h.js} +1 -1
- package/dist/client/static/js/{index-m4bjsyj2.js → index-arvqarv3.js} +1 -1
- package/dist/client/static/js/{index-89a2702q.js → index-bgcp21ed.js} +1 -1
- package/dist/client/static/js/{index-epbqzayj.js → index-d146s9g3.js} +1 -1
- package/dist/client/static/js/{index-3wpsr2bc.js → index-d8kjsgpt.js} +7 -7
- package/dist/client/static/js/{index-rgdhyry3.js → index-dr7nhha9.js} +1 -1
- package/dist/client/static/js/{index-20vhkcb9.js → index-enxfdvdq.js} +1 -1
- package/dist/client/static/js/{index-e3w46vsc.js → index-fqhpxzyb.js} +1 -1
- package/dist/client/static/js/{index-cj9193d5.js → index-gbdvr4rt.js} +1 -1
- package/dist/client/static/js/{index-baet2nv8.js → index-hp8kfk9z.js} +1 -1
- package/dist/client/static/js/{index-5gn56236.js → index-kf9t3mzv.js} +1 -1
- package/dist/client/static/js/{index-0v8b5pzb.js → index-naz3px72.js} +1 -1
- package/dist/client/static/js/{index-4jbbdq6n.js → index-njqpkcvw.js} +1 -1
- package/dist/client/static/js/{index-qntytvt0.js → index-qxb8k6py.js} +1 -1
- package/dist/client/static/js/{index-bhng2dax.js → index-rtd9frp1.js} +1 -1
- package/dist/client/static/js/{index-ehnztdd2.js → index-s16h2nmv.js} +1 -1
- package/dist/client/static/js/{index-74scnfpk.js → index-s910y31q.js} +1 -1
- package/dist/client/static/js/{index-8j90mdgz.js → index-we2ezmn7.js} +1 -1
- package/dist/client/static/js/{index-zw7qjx65.js → index-y5y7smet.js} +1 -1
- package/dist/client/static/js/{index-4qt2e84b.js → index-z72wf7q4.js} +1 -1
- package/dist/client/static/js/{index-g252205p.js → index-zdbvm01f.js} +1 -1
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-aw6ter0a.js → infoDiagram-VRGFBTTK-jjwckbr9.js} +1 -1
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-62gst5wh.js → ishikawaDiagram-OU5B5YK6-qzk5gejf.js} +1 -1
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-6kgv5a4j.js → journeyDiagram-ZHPQQLJL-maccpg3q.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-8p3515b7.js → kanban-definition-PNTS6WVX-xv2azgws.js} +1 -1
- package/dist/client/static/js/{mermaid.core-b6ga2y8y.js → mermaid.core-e4ys760s.js} +2 -2
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-na9e9b4a.js → mindmap-definition-NLK3R4M7-b779wz81.js} +1 -1
- package/dist/client/static/js/one-dark-pro-kckm8epj.js +1 -0
- package/dist/client/static/js/one-light-0v7rg9a7.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-d1hk7fnq.js → pegDiagram-GJSIUBJH-8sgdmhnw.js} +1 -1
- package/dist/client/static/js/{pieDiagram-5QR66LMP-7b9f4x0y.js → pieDiagram-5QR66LMP-nz6n95d6.js} +1 -1
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-q4wxgmhg.js → quadrantDiagram-O4NWA36T-47dpygk5.js} +1 -1
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-jngq1qx4.js → railroadDiagram-XR7U4H2S-wv0bvwve.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-6xph3b72.js → requirementDiagram-PLB6GJNP-w3r8r837.js} +1 -1
- package/dist/client/static/js/{rust-w6hen2h4.js → rust-42c4h7e4.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-ncfzgdj8.js → sankeyDiagram-IPEJSGJF-t55rjgad.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-sqz0yfg0.js → sequenceDiagram-PO4LG4MO-yfwjwy37.js} +1 -1
- package/dist/client/static/js/{sizeCapture-INFHLROL-vt8qp04d.js → sizeCapture-INFHLROL-nq6hy7ce.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-myjtrmfe.js → stateDiagram-v2-GCMORJYK-4xy0atqh.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-z9vx7z4j.js → swimlanes-2SLR337P-np47cy1q.js} +1 -1
- package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-5vha7thx.js → swimlanesDiagram-TC7HE7FX-56rk9kxv.js} +1 -1
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-z815np57.js → timeline-definition-EJHVYXUP-rb0gnm35.js} +1 -1
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-06ntggng.js → usecaseDiagram-POWQR4AR-gatkznan.js} +1 -1
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-nmtaf5rp.js → vennDiagram-UO4OBE2U-r3f5xjjq.js} +1 -1
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-zgsxmak8.js → wardleyDiagram-VNRHLVJA-tpass65t.js} +1 -1
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-8bg9qdra.js → xychartDiagram-PMCCYNJV-8xkh67cw.js} +1 -1
- package/package.json +1 -1
- package/src/server/lib/changes/capture-fs.server.ts +0 -8
- package/src/server/lib/changes/capture.server.ts +1 -2
- package/src/server/lib/changes/classify-command.test.ts +20 -0
- package/src/server/lib/changes/classify-command.ts +46 -23
- package/src/server/lib/changes/classify-git.ts +12 -11
- package/src/server/lib/changes/classify-tokenize.ts +9 -1
- package/src/server/lib/changes/scan.server.ts +19 -14
- package/dist/client/static/js/flowDiagram-KWPJA3E3-s3fbfwrz.js +0 -1
- package/dist/client/static/js/one-dark-pro-xp6ssk4z.js +0 -1
- package/dist/client/static/js/one-light-xgab7b02.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d,n,i,o,a,e,s,I,ne,De,Le,D,Vi,tt,Se,_e,b,ee,io,Bm}from"./index-3wpsr2bc.js";var F={name:"list-filter",size:24,node:[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]]},M=s(F);function T({title:t,options:r,methodLabel:p,badge:m,icon:x,onCancel:g}){let f=io({title:t,options:r})?Bm(t):null,h=f?`Allow ${f.tool}`:t||p;return e("div",{className:"flex items-center justify-between border-b border-ink/8 bg-canvas/40 px-5 py-3.5",children:[e("div",{className:"flex items-center gap-3 min-w-0",children:[e("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-ink/12 bg-paper text-ink shadow-xs",children:x}),e("div",{className:"min-w-0",children:[e("div",{className:"flex items-center gap-2",children:[e("h3",{className:"truncate text-[14px] font-semibold tracking-tight text-ink",children:h}),e("span",{className:"flex items-center gap-1 rounded-full border border-ink/10 bg-paper px-2 py-0.5 font-mono text-[10px] font-medium tracking-wider text-ink/60 uppercase",children:[e(Le,{size:9,className:"text-ink/40"}),m]})]}),e("p",{className:"mt-0.5 text-[11px] text-ink/50",children:f?"The agent wants to run this. Review it before you allow.":"Autonomous agent inquiry requiring user confirmation"})]})]}),e("button",{type:"button",onClick:g,"aria-label":"Close dialog (Esc)",title:"Cancel (Esc)",className:"flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-ink/10 text-ink/45 transition-colors hover:border-ink/25 hover:bg-ink/5 hover:text-ink",children:e(b,{size:14})})]})}function S({options:t,optionDetails:r,selectedOption:p,customValue:m,onCustomChange:x,customInputRef:g,onSelect:f,onConfirmOption:h,hideCustomAnswer:l=!1}){return e("div",{className:"space-y-2",children:[e("div",{className:"flex items-center justify-between text-[11px] font-medium tracking-wider text-ink/50 uppercase",children:[e("span",{children:"Available Options"}),e("span",{className:"font-mono text-[10px] text-ink/40",children:["Press [1-",Math.min(9,t.length),"] to choose"]})]}),e("div",{className:"grid gap-2",role:"radiogroup",children:t.map((k,y)=>{let u=p===k,v=r[y]?.description;return e("button",{type:"button",onClick:()=>f(k),onDblClick:()=>h(k),"aria-checked":u,role:"radio",className:`group flex w-full cursor-pointer items-start gap-3 rounded-xl border p-3.5 text-left transition-all ${u?"border-ink bg-paper shadow-sm ring-1 ring-ink/10":"border-ink/10 bg-canvas/30 hover:border-ink/25 hover:bg-paper"}`,children:[e("span",{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md font-mono text-[11px] font-semibold transition-colors ${u?"bg-ink text-paper":"border border-ink/15 bg-paper text-ink/60 group-hover:border-ink/30 group-hover:text-ink"}`,children:y+1}),e("div",{className:"min-w-0 flex-1",children:[e("div",{className:"flex items-center gap-2",children:e("span",{className:`text-[13px] font-medium leading-snug ${u?"text-ink font-semibold":"text-ink/85"}`,children:k})}),v&&e("div",{className:"mt-1 text-[11.5px] leading-relaxed text-ink/55",children:v})]}),e("span",{className:"mt-0.5 shrink-0",children:u?e(ne,{size:16,className:"text-ink"}):e(Vi,{size:16,className:"text-ink/20 group-hover:text-ink/40"})})]},k)})}),!l&&e("div",{className:"space-y-1.5 pt-1",children:[e("div",{className:"text-[11px] font-medium tracking-wider text-ink/50 uppercase",children:"Other: type your own answer"}),e("input",{ref:g,type:"text",value:m,placeholder:"Type a custom answer and press Enter...",onChange:(k)=>x(k.currentTarget.value),onKeyDown:(k)=>{if(k.key==="Enter"){if(k.preventDefault(),k.stopPropagation(),m.trim())h(m.trim())}},className:"w-full rounded-xl border border-ink/15 bg-paper px-4 py-3 text-[13.5px] text-ink placeholder:text-ink/35 outline-none transition-all focus:border-ink focus:ring-2 focus:ring-ink/15"})]})]})}function P({method:t,optionsLength:r,selectedOption:p,hasCustomAnswer:m=!1,onCancel:x,onSubmit:g}){let f=t==="select"&&!p&&!m;return e("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-ink/8 bg-canvas/40 px-5 py-3.5",children:[e("div",{className:"flex items-center gap-2 font-mono text-[11px] text-ink/50",children:[t==="select"&&e(d,{children:[e("span",{className:"hidden items-center gap-1 sm:inline-flex",children:[e("kbd",{className:"rounded border border-ink/15 bg-paper px-1.5 py-0.5 text-[10px] text-ink shadow-xs",children:["1-",Math.min(9,r)]}),e("span",{className:"text-ink/40",children:"choose"})]}),e("span",{className:"hidden text-ink/30 sm:inline",children:"•"}),e("span",{className:"inline-flex items-center gap-1",children:[e("kbd",{className:"rounded border border-ink/15 bg-paper px-1.5 py-0.5 text-[10px] text-ink shadow-xs",children:"↵"}),e("span",{className:"text-ink/40",children:"select"})]})]}),t==="confirm"&&e("span",{className:"inline-flex items-center gap-1",children:[e("kbd",{className:"rounded border border-ink/15 bg-paper px-1.5 py-0.5 text-[10px] text-ink shadow-xs",children:"↵"}),e("span",{className:"text-ink/40",children:"confirm"})]}),t==="editor"&&e("span",{className:"inline-flex items-center gap-1",children:[e("kbd",{className:"rounded border border-ink/15 bg-paper px-1.5 py-0.5 text-[10px] text-ink shadow-xs",children:"⌘↵"}),e("span",{className:"text-ink/40",children:"save buffer"})]}),e("span",{className:"text-ink/30",children:"•"}),e("span",{className:"inline-flex items-center gap-1",children:[e("kbd",{className:"rounded border border-ink/15 bg-paper px-1.5 py-0.5 text-[10px] text-ink shadow-xs",children:"Esc"}),e("span",{className:"text-ink/40",children:"cancel"})]})]}),e("div",{className:"flex items-center gap-2.5 ml-auto",children:[e("button",{type:"button",onClick:x,className:"flex cursor-pointer items-center gap-1 rounded-lg border border-ink/15 bg-paper px-3.5 py-1.5 text-[12px] font-medium text-ink/70 transition-colors hover:border-ink/30 hover:bg-canvas/50 hover:text-ink",children:[e(b,{size:12,className:"opacity-60"}),e("span",{children:"Cancel"})]}),e("button",{type:"button",onClick:g,disabled:f,className:"flex cursor-pointer items-center gap-1.5 rounded-lg bg-ink px-4 py-1.5 text-[12px] font-semibold text-paper shadow-xs transition-all hover:opacity-90 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-35",children:[e("span",{children:t==="confirm"?"Confirm":t==="select"?"Select Option":"Submit Response"}),e(tt,{size:12,className:"opacity-70"})]})]})]})}function R({title:t,options:r}){let p=io({title:t,options:r})?Bm(t):null;if(!p)return null;return e("div",{className:"space-y-2",children:[p.reason&&e("div",{className:"flex items-start gap-2 rounded-xl border border-warning/25 bg-warning/8 px-3.5 py-2.5 text-[12px] leading-relaxed text-ink/80",children:[e(D,{size:13,className:"mt-0.5 shrink-0 text-warning"}),e("span",{className:"min-w-0 break-words",children:p.reason})]}),p.details.length>0&&e("div",{className:"rounded-xl border border-ink/10 bg-canvas/40 px-3.5 py-2.5",children:p.details.map((m,x)=>e("div",{className:"font-mono text-[11.5px] leading-relaxed text-ink/75 break-all",children:m},`${x}-${m}`))})]})}function L({method:t,options:r,selectedOption:p,onSelectOption:m,customInputRef:x,onSubmit:g,onCancel:f}){i(()=>{let h=(l)=>{if(l.key==="Escape"){l.preventDefault(),l.stopPropagation(),f();return}if(t==="select"&&r.length>0){if(l.target instanceof HTMLInputElement&&l.target===x.current)return;let y=parseInt(l.key,10);if(!isNaN(y)&&y>=1&&y<=r.length){l.preventDefault(),m(r[y-1]);return}if(l.key==="ArrowDown"){l.preventDefault();let u=r.findIndex((N)=>N===p),v=u<r.length-1?u+1:0;m(r[v]);return}if(l.key==="ArrowUp"){l.preventDefault();let u=r.findIndex((N)=>N===p),v=u>0?u-1:r.length-1;m(r[v]);return}if(l.key==="Enter"&&p){l.preventDefault(),g();return}}if(t==="confirm"){if(l.key==="Enter"){l.preventDefault(),g();return}}if(t==="editor"){if((l.metaKey||l.ctrlKey)&&l.key==="Enter"){l.preventDefault(),g();return}}};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[f,g,t,r,p,m,x])}function O(t,r){switch(t){case"select":return{icon:e(M,{size:16,className:"text-ink"}),label:"Decision Required",badge:`${r} Choices`};case"confirm":return{icon:e(I,{size:16,className:"text-ink"}),label:"Confirmation Required",badge:"Confirm Action"};case"input":return{icon:e(_e,{size:16,className:"text-ink"}),label:"Prompt Input",badge:"Text Input"};case"editor":return{icon:e(Se,{size:16,className:"text-ink"}),label:"Buffer Editor",badge:"Multiline Buffer"};default:return{icon:e(De,{size:16,className:"text-ink"}),label:"Agent Request",badge:"Input"}}}function ke({request:t,onRespond:r}){let[p,m]=n(t.method==="editor"?t.prefill??"":""),[x,g]=n(null),[f,h]=n(""),l=o(null),k=o(null),y=o(null),u=o(null),v=t.options??[],N=t.optionDetails??[],E=io(t);i(()=>{let c=t.options??[];m(t.method==="editor"?t.prefill??"":""),g(c.length>0?c[0]:null),h("")},[t]),i(()=>{if(l.current?.focus(),t.method==="input")k.current?.focus();else if(t.method==="editor")y.current?.focus();else if(t.method==="select"){if((t.options??[]).some((B)=>/^other\b/i.test(B.trim())))u.current?.focus()}},[t]);let w=a(()=>{r(t,{cancelled:!0})},[r,t]),A=a(()=>{if(t.method==="confirm")r(t,{confirmed:!0});else if(t.method==="select"){if(f.trim()&&!E)r(t,{value:f.trim()});else if(x)r(t,{value:x})}else r(t,{value:p})},[r,t,x,p,f,E]),z=a((c)=>{if(/^other\b/i.test(c.trim())){g(c),u.current?.focus();return}r(t,{value:c})},[r,t]),H=a((c)=>{if(g(c),/^other\b/i.test(c.trim()))u.current?.focus()},[]);L({method:t.method,options:v,selectedOption:x,onSelectOption:g,customInputRef:u,onSubmit:A,onCancel:w});let C=O(t.method,v.length);return e("div",{className:"extension-dialog-backdrop modal-scrim fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6 backdrop-blur-[8px]",onMouseDown:(c)=>{if(c.target===c.currentTarget)w()},children:e("div",{ref:l,role:"dialog","aria-modal":"true","aria-label":t.title||C.label,tabIndex:-1,className:"glass-overlay extension-dialog-panel w-full max-w-[560px] overflow-hidden rounded-2xl border border-ink/15 bg-paper shadow-2xl outline-none",style:{boxShadow:"0 24px 64px -8px color-mix(in srgb, var(--theme-ink) 28%, transparent)"},children:[e(T,{title:t.title,options:v,methodLabel:C.label,badge:C.badge,icon:C.icon,onCancel:w}),e("div",{className:"max-h-[65vh] overflow-y-auto px-6 py-5 space-y-4",children:[e(R,{title:t.title,options:v}),t.message&&e("div",{className:"rounded-xl border border-ink/8 bg-canvas/40 p-4 text-[13px] leading-relaxed text-ink/85 select-text",children:e(ee,{content:t.message})}),t.method==="select"&&e(S,{options:v,optionDetails:N,selectedOption:x,customValue:f,onCustomChange:h,customInputRef:u,onSelect:H,onConfirmOption:z,hideCustomAnswer:E}),t.method==="confirm"&&e("div",{className:"flex items-center gap-3 rounded-xl border border-ink/10 bg-canvas/30 p-4",children:[e("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-ink/5 text-ink",children:e(ne,{size:18})}),e("div",{className:"text-[12.5px] leading-relaxed text-ink/75",children:["Confirming will allow the autonomous agent to proceed with this operation. Press ",e("kbd",{className:"rounded border border-ink/20 bg-paper px-1 py-0.2 font-mono text-[10.5px]",children:"Enter"})," to confirm or ",e("kbd",{className:"rounded border border-ink/20 bg-paper px-1 py-0.2 font-mono text-[10.5px]",children:"Esc"})," to abort."]})]}),t.method==="input"&&e("div",{className:"space-y-2",children:[e("div",{className:"flex items-center justify-between text-[11px] font-medium tracking-wider text-ink/50 uppercase",children:[e("span",{children:"Your Response"}),e("span",{className:"font-mono text-[10px] text-ink/40",children:"Press [Enter] to submit"})]}),e("input",{ref:k,type:t.secret===!0?"password":"text",value:p,placeholder:t.placeholder||"Type your response...",onChange:(c)=>m(c.currentTarget.value),onKeyDown:(c)=>{if(c.key==="Enter")c.preventDefault(),A()},className:"w-full rounded-xl border border-ink/15 bg-paper px-4 py-3 text-[13.5px] text-ink placeholder:text-ink/35 outline-none transition-all focus:border-ink focus:ring-2 focus:ring-ink/15"})]}),t.method==="editor"&&e("div",{className:"space-y-2",children:[e("div",{className:"flex items-center justify-between text-[11px] font-medium tracking-wider text-ink/50 uppercase",children:[e("span",{children:"Buffer Content"}),e("span",{className:"font-mono text-[10px] text-ink/40",children:[p.split(`
|
|
1
|
+
import{d,n,i,o,a,e,s,I,ne,De,Le,D,Vi,tt,Se,_e,b,ee,io,Bm}from"./index-d8kjsgpt.js";var F={name:"list-filter",size:24,node:[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]]},M=s(F);function T({title:t,options:r,methodLabel:p,badge:m,icon:x,onCancel:g}){let f=io({title:t,options:r})?Bm(t):null,h=f?`Allow ${f.tool}`:t||p;return e("div",{className:"flex items-center justify-between border-b border-ink/8 bg-canvas/40 px-5 py-3.5",children:[e("div",{className:"flex items-center gap-3 min-w-0",children:[e("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-ink/12 bg-paper text-ink shadow-xs",children:x}),e("div",{className:"min-w-0",children:[e("div",{className:"flex items-center gap-2",children:[e("h3",{className:"truncate text-[14px] font-semibold tracking-tight text-ink",children:h}),e("span",{className:"flex items-center gap-1 rounded-full border border-ink/10 bg-paper px-2 py-0.5 font-mono text-[10px] font-medium tracking-wider text-ink/60 uppercase",children:[e(Le,{size:9,className:"text-ink/40"}),m]})]}),e("p",{className:"mt-0.5 text-[11px] text-ink/50",children:f?"The agent wants to run this. Review it before you allow.":"Autonomous agent inquiry requiring user confirmation"})]})]}),e("button",{type:"button",onClick:g,"aria-label":"Close dialog (Esc)",title:"Cancel (Esc)",className:"flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-ink/10 text-ink/45 transition-colors hover:border-ink/25 hover:bg-ink/5 hover:text-ink",children:e(b,{size:14})})]})}function S({options:t,optionDetails:r,selectedOption:p,customValue:m,onCustomChange:x,customInputRef:g,onSelect:f,onConfirmOption:h,hideCustomAnswer:l=!1}){return e("div",{className:"space-y-2",children:[e("div",{className:"flex items-center justify-between text-[11px] font-medium tracking-wider text-ink/50 uppercase",children:[e("span",{children:"Available Options"}),e("span",{className:"font-mono text-[10px] text-ink/40",children:["Press [1-",Math.min(9,t.length),"] to choose"]})]}),e("div",{className:"grid gap-2",role:"radiogroup",children:t.map((k,y)=>{let u=p===k,v=r[y]?.description;return e("button",{type:"button",onClick:()=>f(k),onDblClick:()=>h(k),"aria-checked":u,role:"radio",className:`group flex w-full cursor-pointer items-start gap-3 rounded-xl border p-3.5 text-left transition-all ${u?"border-ink bg-paper shadow-sm ring-1 ring-ink/10":"border-ink/10 bg-canvas/30 hover:border-ink/25 hover:bg-paper"}`,children:[e("span",{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md font-mono text-[11px] font-semibold transition-colors ${u?"bg-ink text-paper":"border border-ink/15 bg-paper text-ink/60 group-hover:border-ink/30 group-hover:text-ink"}`,children:y+1}),e("div",{className:"min-w-0 flex-1",children:[e("div",{className:"flex items-center gap-2",children:e("span",{className:`text-[13px] font-medium leading-snug ${u?"text-ink font-semibold":"text-ink/85"}`,children:k})}),v&&e("div",{className:"mt-1 text-[11.5px] leading-relaxed text-ink/55",children:v})]}),e("span",{className:"mt-0.5 shrink-0",children:u?e(ne,{size:16,className:"text-ink"}):e(Vi,{size:16,className:"text-ink/20 group-hover:text-ink/40"})})]},k)})}),!l&&e("div",{className:"space-y-1.5 pt-1",children:[e("div",{className:"text-[11px] font-medium tracking-wider text-ink/50 uppercase",children:"Other: type your own answer"}),e("input",{ref:g,type:"text",value:m,placeholder:"Type a custom answer and press Enter...",onChange:(k)=>x(k.currentTarget.value),onKeyDown:(k)=>{if(k.key==="Enter"){if(k.preventDefault(),k.stopPropagation(),m.trim())h(m.trim())}},className:"w-full rounded-xl border border-ink/15 bg-paper px-4 py-3 text-[13.5px] text-ink placeholder:text-ink/35 outline-none transition-all focus:border-ink focus:ring-2 focus:ring-ink/15"})]})]})}function P({method:t,optionsLength:r,selectedOption:p,hasCustomAnswer:m=!1,onCancel:x,onSubmit:g}){let f=t==="select"&&!p&&!m;return e("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-ink/8 bg-canvas/40 px-5 py-3.5",children:[e("div",{className:"flex items-center gap-2 font-mono text-[11px] text-ink/50",children:[t==="select"&&e(d,{children:[e("span",{className:"hidden items-center gap-1 sm:inline-flex",children:[e("kbd",{className:"rounded border border-ink/15 bg-paper px-1.5 py-0.5 text-[10px] text-ink shadow-xs",children:["1-",Math.min(9,r)]}),e("span",{className:"text-ink/40",children:"choose"})]}),e("span",{className:"hidden text-ink/30 sm:inline",children:"•"}),e("span",{className:"inline-flex items-center gap-1",children:[e("kbd",{className:"rounded border border-ink/15 bg-paper px-1.5 py-0.5 text-[10px] text-ink shadow-xs",children:"↵"}),e("span",{className:"text-ink/40",children:"select"})]})]}),t==="confirm"&&e("span",{className:"inline-flex items-center gap-1",children:[e("kbd",{className:"rounded border border-ink/15 bg-paper px-1.5 py-0.5 text-[10px] text-ink shadow-xs",children:"↵"}),e("span",{className:"text-ink/40",children:"confirm"})]}),t==="editor"&&e("span",{className:"inline-flex items-center gap-1",children:[e("kbd",{className:"rounded border border-ink/15 bg-paper px-1.5 py-0.5 text-[10px] text-ink shadow-xs",children:"⌘↵"}),e("span",{className:"text-ink/40",children:"save buffer"})]}),e("span",{className:"text-ink/30",children:"•"}),e("span",{className:"inline-flex items-center gap-1",children:[e("kbd",{className:"rounded border border-ink/15 bg-paper px-1.5 py-0.5 text-[10px] text-ink shadow-xs",children:"Esc"}),e("span",{className:"text-ink/40",children:"cancel"})]})]}),e("div",{className:"flex items-center gap-2.5 ml-auto",children:[e("button",{type:"button",onClick:x,className:"flex cursor-pointer items-center gap-1 rounded-lg border border-ink/15 bg-paper px-3.5 py-1.5 text-[12px] font-medium text-ink/70 transition-colors hover:border-ink/30 hover:bg-canvas/50 hover:text-ink",children:[e(b,{size:12,className:"opacity-60"}),e("span",{children:"Cancel"})]}),e("button",{type:"button",onClick:g,disabled:f,className:"flex cursor-pointer items-center gap-1.5 rounded-lg bg-ink px-4 py-1.5 text-[12px] font-semibold text-paper shadow-xs transition-all hover:opacity-90 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-35",children:[e("span",{children:t==="confirm"?"Confirm":t==="select"?"Select Option":"Submit Response"}),e(tt,{size:12,className:"opacity-70"})]})]})]})}function R({title:t,options:r}){let p=io({title:t,options:r})?Bm(t):null;if(!p)return null;return e("div",{className:"space-y-2",children:[p.reason&&e("div",{className:"flex items-start gap-2 rounded-xl border border-warning/25 bg-warning/8 px-3.5 py-2.5 text-[12px] leading-relaxed text-ink/80",children:[e(D,{size:13,className:"mt-0.5 shrink-0 text-warning"}),e("span",{className:"min-w-0 break-words",children:p.reason})]}),p.details.length>0&&e("div",{className:"rounded-xl border border-ink/10 bg-canvas/40 px-3.5 py-2.5",children:p.details.map((m,x)=>e("div",{className:"font-mono text-[11.5px] leading-relaxed text-ink/75 break-all",children:m},`${x}-${m}`))})]})}function L({method:t,options:r,selectedOption:p,onSelectOption:m,customInputRef:x,onSubmit:g,onCancel:f}){i(()=>{let h=(l)=>{if(l.key==="Escape"){l.preventDefault(),l.stopPropagation(),f();return}if(t==="select"&&r.length>0){if(l.target instanceof HTMLInputElement&&l.target===x.current)return;let y=parseInt(l.key,10);if(!isNaN(y)&&y>=1&&y<=r.length){l.preventDefault(),m(r[y-1]);return}if(l.key==="ArrowDown"){l.preventDefault();let u=r.findIndex((N)=>N===p),v=u<r.length-1?u+1:0;m(r[v]);return}if(l.key==="ArrowUp"){l.preventDefault();let u=r.findIndex((N)=>N===p),v=u>0?u-1:r.length-1;m(r[v]);return}if(l.key==="Enter"&&p){l.preventDefault(),g();return}}if(t==="confirm"){if(l.key==="Enter"){l.preventDefault(),g();return}}if(t==="editor"){if((l.metaKey||l.ctrlKey)&&l.key==="Enter"){l.preventDefault(),g();return}}};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[f,g,t,r,p,m,x])}function O(t,r){switch(t){case"select":return{icon:e(M,{size:16,className:"text-ink"}),label:"Decision Required",badge:`${r} Choices`};case"confirm":return{icon:e(I,{size:16,className:"text-ink"}),label:"Confirmation Required",badge:"Confirm Action"};case"input":return{icon:e(_e,{size:16,className:"text-ink"}),label:"Prompt Input",badge:"Text Input"};case"editor":return{icon:e(Se,{size:16,className:"text-ink"}),label:"Buffer Editor",badge:"Multiline Buffer"};default:return{icon:e(De,{size:16,className:"text-ink"}),label:"Agent Request",badge:"Input"}}}function ke({request:t,onRespond:r}){let[p,m]=n(t.method==="editor"?t.prefill??"":""),[x,g]=n(null),[f,h]=n(""),l=o(null),k=o(null),y=o(null),u=o(null),v=t.options??[],N=t.optionDetails??[],E=io(t);i(()=>{let c=t.options??[];m(t.method==="editor"?t.prefill??"":""),g(c.length>0?c[0]:null),h("")},[t]),i(()=>{if(l.current?.focus(),t.method==="input")k.current?.focus();else if(t.method==="editor")y.current?.focus();else if(t.method==="select"){if((t.options??[]).some((B)=>/^other\b/i.test(B.trim())))u.current?.focus()}},[t]);let w=a(()=>{r(t,{cancelled:!0})},[r,t]),A=a(()=>{if(t.method==="confirm")r(t,{confirmed:!0});else if(t.method==="select"){if(f.trim()&&!E)r(t,{value:f.trim()});else if(x)r(t,{value:x})}else r(t,{value:p})},[r,t,x,p,f,E]),z=a((c)=>{if(/^other\b/i.test(c.trim())){g(c),u.current?.focus();return}r(t,{value:c})},[r,t]),H=a((c)=>{if(g(c),/^other\b/i.test(c.trim()))u.current?.focus()},[]);L({method:t.method,options:v,selectedOption:x,onSelectOption:g,customInputRef:u,onSubmit:A,onCancel:w});let C=O(t.method,v.length);return e("div",{className:"extension-dialog-backdrop modal-scrim fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6 backdrop-blur-[8px]",onMouseDown:(c)=>{if(c.target===c.currentTarget)w()},children:e("div",{ref:l,role:"dialog","aria-modal":"true","aria-label":t.title||C.label,tabIndex:-1,className:"glass-overlay extension-dialog-panel w-full max-w-[560px] overflow-hidden rounded-2xl border border-ink/15 bg-paper shadow-2xl outline-none",style:{boxShadow:"0 24px 64px -8px color-mix(in srgb, var(--theme-ink) 28%, transparent)"},children:[e(T,{title:t.title,options:v,methodLabel:C.label,badge:C.badge,icon:C.icon,onCancel:w}),e("div",{className:"max-h-[65vh] overflow-y-auto px-6 py-5 space-y-4",children:[e(R,{title:t.title,options:v}),t.message&&e("div",{className:"rounded-xl border border-ink/8 bg-canvas/40 p-4 text-[13px] leading-relaxed text-ink/85 select-text",children:e(ee,{content:t.message})}),t.method==="select"&&e(S,{options:v,optionDetails:N,selectedOption:x,customValue:f,onCustomChange:h,customInputRef:u,onSelect:H,onConfirmOption:z,hideCustomAnswer:E}),t.method==="confirm"&&e("div",{className:"flex items-center gap-3 rounded-xl border border-ink/10 bg-canvas/30 p-4",children:[e("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-ink/5 text-ink",children:e(ne,{size:18})}),e("div",{className:"text-[12.5px] leading-relaxed text-ink/75",children:["Confirming will allow the autonomous agent to proceed with this operation. Press ",e("kbd",{className:"rounded border border-ink/20 bg-paper px-1 py-0.2 font-mono text-[10.5px]",children:"Enter"})," to confirm or ",e("kbd",{className:"rounded border border-ink/20 bg-paper px-1 py-0.2 font-mono text-[10.5px]",children:"Esc"})," to abort."]})]}),t.method==="input"&&e("div",{className:"space-y-2",children:[e("div",{className:"flex items-center justify-between text-[11px] font-medium tracking-wider text-ink/50 uppercase",children:[e("span",{children:"Your Response"}),e("span",{className:"font-mono text-[10px] text-ink/40",children:"Press [Enter] to submit"})]}),e("input",{ref:k,type:t.secret===!0?"password":"text",value:p,placeholder:t.placeholder||"Type your response...",onChange:(c)=>m(c.currentTarget.value),onKeyDown:(c)=>{if(c.key==="Enter")c.preventDefault(),A()},className:"w-full rounded-xl border border-ink/15 bg-paper px-4 py-3 text-[13.5px] text-ink placeholder:text-ink/35 outline-none transition-all focus:border-ink focus:ring-2 focus:ring-ink/15"})]}),t.method==="editor"&&e("div",{className:"space-y-2",children:[e("div",{className:"flex items-center justify-between text-[11px] font-medium tracking-wider text-ink/50 uppercase",children:[e("span",{children:"Buffer Content"}),e("span",{className:"font-mono text-[10px] text-ink/40",children:[p.split(`
|
|
2
2
|
`).length," lines · ⌘↵ to save"]})]}),e("textarea",{ref:y,value:p,onChange:(c)=>m(c.currentTarget.value),rows:8,placeholder:t.placeholder||"Enter content...",className:"w-full rounded-xl border border-ink/15 bg-canvas/30 px-4 py-3 font-mono text-[12px] leading-relaxed text-ink placeholder:text-ink/35 outline-none transition-all focus:border-ink focus:bg-paper focus:ring-2 focus:ring-ink/15"})]})]}),e(P,{method:t.method,optionsLength:v.length,selectedOption:x,hasCustomAnswer:f.trim().length>0,onCancel:w,onSubmit:A})]})})}export{ke as ExtensionDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n,i,o,u,e,DA,we,S,I,f,B,C,F,ce,Me}from"./index-
|
|
1
|
+
import{n,i,o,u,e,DA,we,S,I,f,B,C,F,ce,Me}from"./index-d8kjsgpt.js";import{ea,ou,vs,ks,su,lu}from"./index-4hsxaa87.js";var R="usage-provider-listbox";function E({providers:r,value:s,onChange:y}){let[a,x]=n(!1),[v,b]=n(""),[l,c]=n(0),m=o(null),h=o(null),d=o(null),N=o([]),g=r.find((t)=>t.id===s)??r[0],k=u(()=>{let t=v.trim().toLowerCase();if(!t)return r;return r.filter((p)=>`${p.name} ${ks(p)} ${p.hint}`.toLowerCase().includes(t))},[r,v]),D=()=>{let t=Math.max(0,r.findIndex((p)=>p.id===s));b(""),c(t),x(!0)},P=(t=!1)=>{if(x(!1),b(""),t)h.current?.focus()},U=(t)=>{y(t),P(!0)};return i(()=>{if(!a)return;N.current[l]?.scrollIntoView({block:"nearest"})},[a,l]),ce(m,()=>x(!1)),e("div",{className:"relative min-w-0",ref:m,onKeyDown:(t)=>{let p=t.target===d.current;if(!a){if(t.key==="ArrowDown"||t.key==="Enter"||t.key===" ")t.preventDefault(),D();return}switch(t.key){case"Escape":t.preventDefault(),P(!0);break;case"ArrowDown":t.preventDefault(),c((w)=>Math.max(0,Math.min(k.length-1,w+1)));break;case"ArrowUp":t.preventDefault(),c((w)=>Math.max(0,w-1));break;case"Home":t.preventDefault(),c(0);break;case"End":t.preventDefault(),c(Math.max(0,k.length-1));break;case"Enter":if(t.preventDefault(),k[l])U(k[l].id);break;case" ":if(p)return;if(t.preventDefault(),k[l])U(k[l].id);break;default:break}},children:[e("button",{ref:h,type:"button",onClick:()=>a?P():D(),"aria-haspopup":"listbox","aria-expanded":a,"aria-controls":R,title:"Select usage provider",className:"flex w-full min-w-0 items-center justify-between gap-2 bg-paper border border-ink/15 rounded-lg px-3 py-1.5 text-xs text-ink hover:bg-ink/5 transition-colors",children:[e("span",{className:"flex min-w-0 items-center gap-2",children:[g&&e(Me,{provider:{slug:g.id,name:g.name,...g.iconUrl?{iconUrl:g.iconUrl}:{}},size:16}),e("span",{className:"truncate font-medium",children:g?.name??"Select provider"}),g&&e("span",{className:"truncate text-[10px] text-ink/50",children:ks(g)})]}),e(B,{size:12,className:`flex-shrink-0 text-ink/40 transition-transform ${a?"rotate-180":""}`})]}),a&&e("div",{className:"glass-popover absolute top-full left-0 mt-1 w-52 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:[e("div",{className:"px-2 py-1.5 border-b border-ink/10 flex items-center gap-1.5",children:[e(F,{size:11,className:"text-ink/40 flex-shrink-0"}),e("input",{ref:d,type:"text",value:v,onChange:(t)=>{b(t.currentTarget.value),c(0)},placeholder:"Search providers...",title:"Search providers",className:"w-full min-w-0 bg-transparent outline-none text-xs text-ink placeholder-ink/40",autoFocus:!0}),v&&e("button",{type:"button",onClick:()=>{b(""),c(0),d.current?.focus()},title:"Clear search",className:"text-ink/40 hover:text-ink flex-shrink-0",children:"×"})]}),e("div",{id:R,role:"listbox","aria-label":"Usage providers",className:"max-h-48 scrollbar-overlay-container py-1",children:k.length===0?e("div",{className:"px-3 py-2 text-ink/40 italic",children:"No providers found"}):k.map((t,p)=>e("button",{ref:(w)=>{N.current[p]=w},type:"button",role:"option","aria-selected":t.id===s,onClick:()=>U(t.id),onMouseEnter:()=>c(p),title:t.hint,className:`w-full text-left px-3 py-2 flex items-center justify-between gap-2 transition-colors ${p===l?"bg-ink/5":"hover:bg-ink/5"}`,children:[e("span",{className:"flex min-w-0 items-center gap-2",children:[e(Me,{provider:{slug:t.id,name:t.name,...t.iconUrl?{iconUrl:t.iconUrl}:{}},size:18}),e("span",{className:"min-w-0",children:[e("span",{className:"block truncate font-medium text-ink",children:t.name}),e("span",{className:"block truncate text-[10px] text-ink/50",children:[ks(t)," · ",t.hint]})]})]}),t.id===s&&e(f,{size:12,className:"flex-shrink-0 text-ink"})]},t.id))})]})]})}function M(r,s){if(!r)return s;if(!s)return r;let y=Date.parse(r.generatedAt),a=Date.parse(s.generatedAt);if(Number.isNaN(y)||Number.isNaN(a))return r;return a>y?s:r}function ne({className:r="",active:s=!0}){let{report:y,isLoading:a,error:x,reload:v}=lu(),[b,l]=S("usage.selectedProviderId",""),c=we(DA,{enabled:s}),m=M(c.data,y),h=m?vs(m):[],d=h.find((N)=>N.id===b)??h[0];if(i(()=>{if(d&&d.id!==b)l(d.id)},[d,b,l]),x&&!m)return e("div",{className:`flex h-full w-full flex-col items-center justify-center gap-2 p-8 text-center text-xs ${r}`,children:[e(I,{size:16,className:"text-error"}),e("p",{className:"text-error text-xs",children:x}),e("button",{type:"button",onClick:()=>v(),className:"text-[11px] font-semibold text-ink/70 hover:text-ink underline underline-offset-2",children:"Try again"})]});if(!m)return e("div",{className:`flex h-full w-full items-center justify-center text-ink/40 text-xs ${r}`,children:"Loading provider usage..."});return e("div",{className:`flex h-full w-full min-w-0 min-h-0 flex-col overflow-hidden bg-paper text-xs text-ink ${r}`,children:[e("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between gap-3 flex-shrink-0 min-w-0",children:[e("div",{className:"flex items-center gap-2 min-w-0",children:[e("h2",{className:"text-xs font-semibold text-ink uppercase tracking-wider",children:"Usage"}),e("span",{className:"text-[11px] text-ink/50 truncate",children:["Updated ",ea(m.generatedAt)]}),m.isMock&&e("span",{className:"text-[10px] font-mono uppercase tracking-wider bg-ink/5 border border-ink/15 rounded px-1.5 py-0.5 text-ink/60",children:"Mock"})]}),e("button",{type:"button",onClick:()=>v({force:!0}),disabled:a,className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors disabled:opacity-50 flex-shrink-0",title:"Refresh usage",children:e(C,{size:12,className:a||c.refreshing?"animate-spin text-ink":""})})]}),h.length>0&&e("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex-shrink-0 min-w-0",children:e("div",{className:"flex items-center gap-2 min-w-0",children:[e("span",{className:"text-[11px] font-semibold text-ink/60 flex-shrink-0",children:"Provider"}),e(E,{providers:h,value:d?.id??"",onChange:l})]})}),e("div",{className:"flex-1 min-w-0 min-h-0 w-full overflow-y-auto scrollbar-overlay-container p-3.5 space-y-4",children:[x&&e("p",{className:"text-error text-xs",children:x}),d?e(ou,{summary:d.summary}):e("p",{className:"text-[11px] text-ink/50 leading-relaxed",children:"No provider credentials detected. Add an API key in Settings → Providers and it will appear here."}),e(su,{})]})]})}export{ne as UsagePanel};
|