browsentic 0.4.0 → 0.4.6
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/cli.js +1365 -1125
- package/dist/daemon-main.js +1044 -597
- package/extension/chrome-mv3/background.js +13 -13
- package/extension/chrome-mv3/chunks/{globals-BACcA5Dk.js → globals-DIBegMWk.js} +13 -13
- package/extension/chrome-mv3/chunks/{popup-jkdMm_Wh.js → popup-yL0itqnF.js} +1 -1
- package/extension/chrome-mv3/chunks/{sidepanel-BiP2yaIs.js → sidepanel-WyGwqwXh.js} +1 -1
- package/extension/chrome-mv3/content-scripts/content.js +21 -21
- package/extension/chrome-mv3/manifest.json +1 -1
- package/extension/chrome-mv3/popup.html +2 -2
- package/extension/chrome-mv3/sidepanel.html +2 -2
- package/package.json +1 -1
- package/skills/browser-control.md +12 -2
- package/skills/page-diagnostics.md +52 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{$ as t,B as n,G as r,J as i,N as a,Q as o,R as s,V as c,_ as l,et as u,h as d,m as f,nt as p,p as m,q as h,r as g,t as _,v,y,z as b}from"./globals-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{$ as t,B as n,G as r,J as i,N as a,Q as o,R as s,V as c,_ as l,et as u,h as d,m as f,nt as p,p as m,q as h,r as g,t as _,v,y,z as b}from"./globals-DIBegMWk.js";var x=o(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),S=e(u(),1),C=e(p(),1),w=n(),T={unpaired:`Pair this browser to start`,offline:`The daemon isn’t answering — start browsentic`,agent:`That agent cannot run — pick another below`};function E(){let e=y(),n=g(),[o,u]=(0,C.useState)(!1),p=e?.paired??!1;async function S(){let e=await t.windows.getCurrent();e.id!=null&&(await m(e.id),window.close())}let E=_({active:o&&(e?.connected??!1),onSubmit:e=>{u(!1),n.send(e),S()}}),D=b(e,{running:n.running,listening:o&&E.listening}),O=D.ready;function k(){O&&E.submitNow()}function A(){if(E.supported){if(o&&E.error){E.retry();return}u(e=>!e)}}let j=D.blocker?T[D.blocker]:E.error?E.error:o&&E.listening?E.interim||`Listening… speak, then pause`:n.running?`Working — open the side panel to watch`:E.supported?`Tap to talk, or type below`:`Type your instruction below`;return(0,w.jsxs)(`div`,{className:`flex w-[22rem] flex-col`,children:[(0,w.jsxs)(`header`,{className:`flex items-center gap-2 px-4 py-3`,children:[(0,w.jsx)(l,{className:`flex-1`}),(0,w.jsx)(s,{tone:D.tone,children:D.label})]}),p&&(0,w.jsxs)(`main`,{className:`dot-grid flex flex-col items-center gap-4 border-y border-line px-4 py-6`,children:[(0,w.jsxs)(`button`,{type:`button`,"aria-label":o?`Stop listening`:`Start listening`,onClick:A,disabled:!O||!E.supported,className:c(`relative flex size-20 items-center justify-center rounded-full border transition-all outline-none`,`focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-2 focus-visible:ring-offset-ground`,(!O||!E.supported)&&`opacity-40`,o?`border-magenta/60 bg-magenta/15 text-magenta`:`glow-brand border-brand/50 bg-brand/10 text-brand enabled:hover:scale-105 enabled:hover:bg-brand/20`),children:[o&&E.listening&&(0,w.jsx)(`span`,{className:`absolute inset-0 animate-ping rounded-full bg-magenta/25`}),o?(0,w.jsx)(i,{className:`size-8`}):(0,w.jsx)(h,{className:`size-8`})]}),(0,w.jsx)(`p`,{className:c(`min-h-8 text-center text-xs leading-relaxed`,E.error||!D.ready?`text-amber`:`text-ink-dim`),children:j}),(0,w.jsxs)(`form`,{className:`flex w-full gap-1.5`,onSubmit:e=>{e.preventDefault(),k()},children:[(0,w.jsx)(d,{value:E.input,onChange:e=>E.setInput(e.target.value),placeholder:`What should I do?`,"aria-label":`Instruction for Browsentic`,className:`h-8 text-xs`,disabled:!O}),(0,w.jsx)(a,{type:`submit`,size:`sm`,"aria-label":`Send`,disabled:!O||!E.input.trim(),children:(0,w.jsx)(r,{})})]}),(0,w.jsxs)(a,{variant:`outline`,size:`sm`,className:`w-full`,onClick:S,children:[(0,w.jsx)(x,{}),` Open the side panel`]})]}),(0,w.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,w.jsx)(f,{}),(0,w.jsx)(v,{})]})]})}S.createRoot(document.getElementById(`root`)).render((0,w.jsx)(C.StrictMode,{children:(0,w.jsx)(E,{})}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{$ as t,A as n,B as r,C as i,D as a,E as o,F as s,G as c,H as l,I as u,J as d,K as f,L as p,M as m,N as h,O as g,P as _,Q as v,R as y,S as ee,T as b,U as x,V as S,W as C,X as w,Y as T,Z as E,_ as te,a as D,b as O,c as ne,d as re,et as k,f as ie,g as ae,h as A,i as oe,j,k as M,l as N,m as se,n as ce,nt as P,o as le,q as ue,r as de,s as fe,t as pe,tt as me,u as he,v as ge,w as _e,x as ve,y as ye,z as be}from"./globals-BACcA5Dk.js";var xe=v(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),F=v(`book-open`,[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]),Se=v(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),Ce=v(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),I=v(`clapperboard`,[[`path`,{d:`m12.296 3.464 3.02 3.956`,key:`qash78`}],[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z`,key:`1h7j8b`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`4lm6w1`}],[`path`,{d:`m6.18 5.276 3.1 3.899`,key:`zjj9t3`}]]),we=v(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),Te=v(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),Ee=v(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),De=v(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Oe=v(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),ke=v(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),Ae=v(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),je=v(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Me=v(`highlighter`,[[`path`,{d:`m9 11-6 6v3h9l3-3`,key:`1a3l36`}],[`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`,key:`14a9rk`}]]),Ne=v(`hourglass`,[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]),Pe=v(`images`,[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]),Fe=v(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Ie=v(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Le=v(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),Re=v(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),ze=v(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Be=v(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Ve=v(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),He=v(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),Ue=v(`move-vertical`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m8 18 4 4 4-4`,key:`bh5tu3`}],[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}]]),We=v(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),Ge=v(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),Ke=v(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),qe=v(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Je=v(`radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),Ye=v(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),Xe=v(`scan-eye`,[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`path`,{d:`M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0`,key:`11ak4c`}]]),Ze=v(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Qe=v(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),$e=v(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),et=v(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),tt=v(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),nt=v(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),rt=v(`text-cursor-input`,[[`path`,{d:`M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6`,key:`1528k5`}],[`path`,{d:`M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7`,key:`13ksps`}],[`path`,{d:`M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1`,key:`1n9rhb`}],[`path`,{d:`M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1`,key:`1mj8rg`}],[`path`,{d:`M9 6v12`,key:`velyjx`}]]),it=v(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),at=v(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),ot=v(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),st=v(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),L=v(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),ct=v(`zap`,[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]),R=e(P(),1),lt=e(k(),1),ut=[`general`,`site-exploration`],dt=/^[a-z0-9][a-z0-9-]{0,47}$/,ft=32*1024,pt=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/,mt=300,ht=3,gt=60;function _t(e){let t=/^---[ \t]*\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(e);if(!t)return{fields:{},body:e};let n={};for(let e of t[1].split(/\r?\n/)){let t=e.indexOf(`:`);t>0&&(n[e.slice(0,t).trim()]=e.slice(t+1).trim())}return{fields:n,body:e.slice(t[0].length)}}function vt(e){return e?e.replace(/^\[|\]$/g,``).split(`,`).map(e=>e.trim().replace(/^['"]|['"]$/g,``)).filter(Boolean):[]}function yt(e){return e?.trim()===`site-exploration`?`site-exploration`:`general`}function bt(e){return e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim()}function xt(e){try{return new URL(e).hostname.toLowerCase()}catch{return``}}function St(e){let t=e.trim().toLowerCase();return t?(t.includes(`://`)?xt(t):t).replace(/^\/+|\/+$/g,``).split(`/`)[0].split(`:`)[0].replace(/^\.+|\.+$/g,``):``}function Ct(e){return e===`localhost`||e.length<=253&&pt.test(e)}function wt(e,t){return Tt(e,t).length>0}function Tt(e,t){let n=e.toLowerCase();return n?t.filter(e=>n===e||n.endsWith(`.${e}`)).sort((e,t)=>t.length-e.length):[]}function Et(e,t={}){let n=e.name.trim().toLowerCase();if(!n)return z(`Give the skill a name.`);if(!dt.test(n))return z(`Names use lowercase letters, digits and hyphens only, starting with a letter or digit (max 48).`);if(t.reservedNames?.some(e=>e.toLowerCase()===n))return z(`"${n}" is the name of a built-in skill. Pick another.`);let r=bt(e.description).slice(0,mt),i=e.category;if(!ut.includes(i))return z(`Unknown category "${String(i)}".`);let a=kt(e.domains.map(St).filter(Boolean));if(i===`site-exploration`){if(!a.length)return z(`A site-exploration skill needs at least one domain, like acme.com.`);if(a.length>20)return z(`At most 20 domains.`);for(let e of a){if(e.includes(`*`))return z(`"${e}" — wildcards are not supported; subdomains match automatically.`);if(!Ct(e))return z(`"${e}" is not a domain. Use something like acme.com.`)}}let o=i===`site-exploration`?[]:kt(e.triggers.map(e=>bt(e).toLowerCase()).filter(Boolean));if(o.length>30)return z(`At most 30 triggers.`);for(let e of o)if(e.length<ht||e.length>gt)return z(`Trigger "${e}" must be ${ht}–${gt} characters.`);let s=_t(e.body.replace(/\r\n/g,`
|
|
1
|
+
import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{$ as t,A as n,B as r,C as i,D as a,E as o,F as s,G as c,H as l,I as u,J as d,K as f,L as p,M as m,N as h,O as g,P as _,Q as v,R as y,S as ee,T as b,U as x,V as S,W as C,X as w,Y as T,Z as E,_ as te,a as D,b as O,c as ne,d as re,et as k,f as ie,g as ae,h as A,i as oe,j,k as M,l as N,m as se,n as ce,nt as P,o as le,q as ue,r as de,s as fe,t as pe,tt as me,u as he,v as ge,w as _e,x as ve,y as ye,z as be}from"./globals-DIBegMWk.js";var xe=v(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),F=v(`book-open`,[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]),Se=v(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),Ce=v(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),I=v(`clapperboard`,[[`path`,{d:`m12.296 3.464 3.02 3.956`,key:`qash78`}],[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z`,key:`1h7j8b`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`4lm6w1`}],[`path`,{d:`m6.18 5.276 3.1 3.899`,key:`zjj9t3`}]]),we=v(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),Te=v(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),Ee=v(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),De=v(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Oe=v(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),ke=v(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),Ae=v(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),je=v(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Me=v(`highlighter`,[[`path`,{d:`m9 11-6 6v3h9l3-3`,key:`1a3l36`}],[`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`,key:`14a9rk`}]]),Ne=v(`hourglass`,[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]),Pe=v(`images`,[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]),Fe=v(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Ie=v(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Le=v(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),Re=v(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),ze=v(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Be=v(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Ve=v(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),He=v(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),Ue=v(`move-vertical`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m8 18 4 4 4-4`,key:`bh5tu3`}],[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}]]),We=v(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),Ge=v(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),Ke=v(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),qe=v(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Je=v(`radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),Ye=v(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),Xe=v(`scan-eye`,[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`path`,{d:`M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0`,key:`11ak4c`}]]),Ze=v(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Qe=v(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),$e=v(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),et=v(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),tt=v(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),nt=v(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),rt=v(`text-cursor-input`,[[`path`,{d:`M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6`,key:`1528k5`}],[`path`,{d:`M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7`,key:`13ksps`}],[`path`,{d:`M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1`,key:`1n9rhb`}],[`path`,{d:`M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1`,key:`1mj8rg`}],[`path`,{d:`M9 6v12`,key:`velyjx`}]]),it=v(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),at=v(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),ot=v(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),st=v(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),L=v(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),ct=v(`zap`,[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]),R=e(P(),1),lt=e(k(),1),ut=[`general`,`site-exploration`],dt=/^[a-z0-9][a-z0-9-]{0,47}$/,ft=32*1024,pt=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/,mt=300,ht=3,gt=60;function _t(e){let t=/^---[ \t]*\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(e);if(!t)return{fields:{},body:e};let n={};for(let e of t[1].split(/\r?\n/)){let t=e.indexOf(`:`);t>0&&(n[e.slice(0,t).trim()]=e.slice(t+1).trim())}return{fields:n,body:e.slice(t[0].length)}}function vt(e){return e?e.replace(/^\[|\]$/g,``).split(`,`).map(e=>e.trim().replace(/^['"]|['"]$/g,``)).filter(Boolean):[]}function yt(e){return e?.trim()===`site-exploration`?`site-exploration`:`general`}function bt(e){return e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim()}function xt(e){try{return new URL(e).hostname.toLowerCase()}catch{return``}}function St(e){let t=e.trim().toLowerCase();return t?(t.includes(`://`)?xt(t):t).replace(/^\/+|\/+$/g,``).split(`/`)[0].split(`:`)[0].replace(/^\.+|\.+$/g,``):``}function Ct(e){return e===`localhost`||e.length<=253&&pt.test(e)}function wt(e,t){return Tt(e,t).length>0}function Tt(e,t){let n=e.toLowerCase();return n?t.filter(e=>n===e||n.endsWith(`.${e}`)).sort((e,t)=>t.length-e.length):[]}function Et(e,t={}){let n=e.name.trim().toLowerCase();if(!n)return z(`Give the skill a name.`);if(!dt.test(n))return z(`Names use lowercase letters, digits and hyphens only, starting with a letter or digit (max 48).`);if(t.reservedNames?.some(e=>e.toLowerCase()===n))return z(`"${n}" is the name of a built-in skill. Pick another.`);let r=bt(e.description).slice(0,mt),i=e.category;if(!ut.includes(i))return z(`Unknown category "${String(i)}".`);let a=kt(e.domains.map(St).filter(Boolean));if(i===`site-exploration`){if(!a.length)return z(`A site-exploration skill needs at least one domain, like acme.com.`);if(a.length>20)return z(`At most 20 domains.`);for(let e of a){if(e.includes(`*`))return z(`"${e}" — wildcards are not supported; subdomains match automatically.`);if(!Ct(e))return z(`"${e}" is not a domain. Use something like acme.com.`)}}let o=i===`site-exploration`?[]:kt(e.triggers.map(e=>bt(e).toLowerCase()).filter(Boolean));if(o.length>30)return z(`At most 30 triggers.`);for(let e of o)if(e.length<ht||e.length>gt)return z(`Trigger "${e}" must be ${ht}–${gt} characters.`);let s=_t(e.body.replace(/\r\n/g,`
|
|
2
2
|
`)).body.trim();return s?Dt(s)>32768?z(`The skill is larger than ${Math.round(ft/1024)} KB. Trim it down.`):{ok:!0,draft:{name:n,description:r,category:i,domains:a,triggers:o,body:s}}:z(`The skill has no instructions — add some markdown below the front matter.`)}function Dt(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r<128?t+=1:r<2048?t+=2:r>=55296&&r<=56319?(t+=4,n++):t+=3}return t}function Ot(e,t){let{fields:n,body:r}=_t(e.replace(/\r\n/g,`
|
|
3
3
|
`)),i=St(t.replace(/\.(md|markdown)$/i,``)).replace(/[^a-z0-9-]+/g,`-`).replace(/^-+|-+$/g,``);return{name:(n.name||i).toLowerCase(),description:n.description??``,category:yt(n.category),domains:vt(n.domains).map(St).filter(Boolean),triggers:vt(n.triggers).map(e=>e.toLowerCase()),body:r.trim()}}function kt(e){return[...new Set(e)]}function z(e){return{ok:!1,message:e}}var B=r(),At={site:0,general:1,agent:2,"other-site":3};function jt(e,t,n){if(!e)return[];let r=xt(t),i=[];for(let t of e.skills){let e=t.category===`site-exploration`?r&&wt(r,t.domains)?`site`:`other-site`:`general`;i.push({key:`${e}:${t.name}`,group:e,name:t.name,description:t.description})}for(let t of e.agentSkills)i.push({key:`agent:${t.id}`,group:`agent`,name:t.name,description:t.description,agentSkillId:t.id});let a=n.trim().toLowerCase();return(a?i.filter(e=>e.name.toLowerCase().includes(a)||e.description.toLowerCase().includes(a)):i).sort((e,t)=>At[e.group]-At[t.group]||e.name.localeCompare(t.name))}function Mt({items:e,agent:t,highlight:n,onHover:r,onSelect:i}){let a={site:`On this site`,general:`Browsentic skills`,agent:`${t?l[t].label:`Agent`} skills`,"other-site":`Other sites`};return(0,B.jsx)(`div`,{role:`listbox`,"aria-label":`Skills`,className:`enters absolute inset-x-0 bottom-full z-20 mb-2 max-h-64 overflow-y-auto rounded-xl border border-line bg-surface shadow-lg`,children:e.length===0?(0,B.jsx)(`p`,{className:`px-3 py-2.5 text-[11px] text-ink-faint`,children:`No skills match — keep typing, or press Escape.`}):e.map((t,o)=>(0,B.jsxs)(`div`,{children:[(o===0||e[o-1].group!==t.group)&&(0,B.jsx)(`p`,{className:`px-3 pt-2 pb-1 font-mono text-[10px] tracking-[0.14em] text-ink-faint uppercase`,children:a[t.group]}),(0,B.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":o===n,onMouseEnter:()=>r(o),onMouseDown:e=>{e.preventDefault(),i(t)},className:S(`flex w-full items-start gap-2 px-3 py-1.5 text-left transition-colors`,o===n?`bg-brand/12`:`hover:bg-ground/40`),children:[t.group===`agent`?(0,B.jsx)($e,{className:`mt-0.5 size-3 shrink-0 text-brand`}):t.group===`general`?(0,B.jsx)(F,{className:`mt-0.5 size-3 shrink-0 text-ink-faint`}):(0,B.jsx)(je,{className:`mt-0.5 size-3 shrink-0 text-ink-faint`}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate text-xs font-medium text-ink`,children:t.name}),t.description&&(0,B.jsx)(`span`,{className:`block truncate text-[11px] text-ink-dim`,children:t.description})]})]})]},t.key))})}function Nt({className:e,...t}){return(0,B.jsx)(`textarea`,{"data-slot":`textarea`,className:S(`field-sizing-content flex min-h-16 w-full rounded-lg border border-line-strong bg-ground/60 px-3 py-2 text-sm text-ink outline-none transition-colors`,`placeholder:text-ink-faint selection:bg-brand/30 selection:text-ink`,`focus-visible:border-brand/55`,`disabled:cursor-not-allowed disabled:opacity-45`,e),...t})}async function Pt(){let e=await g(M);if(!e.ok)return e.error.code===`PICK_CANCELLED`?{cancelled:!0}:{error:e.error.message};let{element:t,content:n,truncated:r,url:i,title:a}=e.data;return{focus:{tag:t.tag,role:t.role,selector:t.selector,label:t.text,content:n,truncated:r,url:i,title:a}}}var Ft=e=>e.label?.trim()||e.role||e.tag;function It({voice:e,voiceEnabled:t,connected:n,running:r,files:i,attachError:a,catalog:o,tabUrl:s,attachedSkill:l,focus:u,picking:f,onAttachSkill:p,onSend:m,onStop:g,onToggleVoice:_,onPick:v,onClearFocus:y,onAttachPage:ee,onAttachFile:b,onRemoveFile:x}){let C=(0,R.useRef)(null),w=(0,R.useRef)(null),T=e.input.startsWith(`/`)?e.input.slice(1):null,E=T!==null&&n,[te,D]=(0,R.useState)(0),O=(0,R.useMemo)(()=>E?jt(o,s,T??``):[],[E,o,s,T]);(0,R.useEffect)(()=>D(0),[T]);let{cancelPending:ne}=e;(0,R.useEffect)(()=>{E&&ne()},[E,ne]);function re(t){t.agentSkillId?(p({id:t.agentSkillId,name:t.name}),e.setInput(``)):e.setInput(`@${t.name} `),w.current?.focus()}function k(e){e.target.closest(`button, textarea`)||w.current?.focus()}return(0,B.jsxs)(B.Fragment,{children:[a&&(0,B.jsx)(`p`,{className:`mb-2 rounded-lg border border-amber/40 bg-amber/10 px-2.5 py-1.5 text-[11px] text-amber`,children:a}),(0,B.jsx)(Lt,{focus:u,picking:f,onClear:y}),l&&(0,B.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 rounded-xl border border-brand/35 bg-brand/8 px-2.5 py-1.5 text-xs`,children:[(0,B.jsx)($e,{className:`size-3.5 shrink-0 text-brand`}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-ink`,children:[`Skill attached: `,(0,B.jsx)(`span`,{className:`font-medium`,children:l.name})]}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>p(null),"aria-label":`Detach ${l.name}`,className:`shrink-0 rounded-full p-1 text-ink-faint transition-colors hover:bg-surface hover:text-ink`,children:(0,B.jsx)(L,{className:`size-3`})})]}),(0,B.jsx)(zt,{files:i,onRemove:x}),(0,B.jsx)(Rt,{voice:e,voiceEnabled:t}),(0,B.jsxs)(`div`,{onClick:k,className:S(`panel-card relative flex flex-col rounded-2xl transition-colors has-[textarea:focus]:border-brand/50`,n&&`cursor-text`),children:[E&&(0,B.jsx)(Mt,{items:O,agent:o?.agent,highlight:te,onHover:D,onSelect:re}),(0,B.jsx)(Nt,{ref:w,value:e.input,onChange:t=>e.setInput(t.target.value),onKeyDown:t=>{if(E){if(t.key===`Escape`){t.preventDefault(),e.setInput(``);return}if(O.length>0){if(t.key===`ArrowDown`){t.preventDefault(),D(e=>(e+1)%O.length);return}if(t.key===`ArrowUp`){t.preventDefault(),D(e=>(e-1+O.length)%O.length);return}if(t.key===`Enter`||t.key===`Tab`){t.preventDefault(),re(O[Math.min(te,O.length-1)]);return}}}t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),m())},placeholder:n?`Tell me what to do on this page…`:`Pair the browser to get started`,disabled:!n,rows:2,className:`max-h-48 min-h-14 resize-none rounded-none border-0 bg-transparent px-3 pt-2.5 pb-0 focus-visible:border-0`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-0.5 px-1.5 pb-1.5`,children:[(0,B.jsx)(h,{variant:u||f?`subtle`:`ghost`,size:`icon-sm`,title:`A-Eye — point at an element on the page and send it with your next message`,"aria-label":`Point at an element with A-Eye`,onClick:v,disabled:!n||f,className:S(u||f?`text-ember`:void 0),children:(0,B.jsx)(Xe,{className:S(`size-3.5`,f&&`animate-pulse`)})}),(0,B.jsx)(h,{variant:`ghost`,size:`icon-sm`,title:`Add this page’s title, URL and selection to the message`,"aria-label":`Attach page context`,onClick:ee,disabled:!n,children:(0,B.jsx)(Ge,{className:`size-3.5`})}),(0,B.jsx)(h,{variant:`ghost`,size:`icon-sm`,title:`Attach a file for the agent to read`,"aria-label":`Attach a file`,onClick:()=>C.current?.click(),disabled:!n,children:(0,B.jsx)(ke,{className:`size-3.5`})}),(0,B.jsxs)(h,{variant:t&&!e.error?`subtle`:`ghost`,size:`icon-sm`,"aria-label":t?`Turn voice off`:`Turn voice on`,title:e.supported?`Speak instead of typing`:`Voice input is not available in this browser`,onClick:_,disabled:!e.supported,className:`relative`,children:[t&&e.listening&&(0,B.jsx)(`span`,{className:`absolute inset-0 animate-ping rounded-full bg-magenta/30`}),t&&!e.error?(0,B.jsx)(ue,{className:`size-3.5`}):(0,B.jsx)(d,{className:`size-3.5`})]}),r?(0,B.jsx)(h,{size:`icon-sm`,variant:`destructive`,className:`ml-auto`,"aria-label":`Stop the agent`,onClick:g,children:(0,B.jsx)(tt,{className:`size-3 fill-current`})}):(0,B.jsx)(h,{size:`icon-sm`,className:`ml-auto`,"aria-label":`Send message`,onClick:m,disabled:!e.input.trim()||!n,children:(0,B.jsx)(c,{className:`size-3.5`})})]})]}),(0,B.jsx)(`input`,{ref:C,type:`file`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&b(t)}}),(0,B.jsx)(`p`,{className:`mt-2 text-center font-mono text-[10px] text-ink-faint`,children:t&&e.supported?`Speak and pause to send · Enter sends now`:`Enter to send · Shift + Enter for a new line · / for skills`})]})}function Lt({focus:e,picking:t,onClear:n}){return!t&&!e?null:(0,B.jsxs)(`div`,{className:`enters mb-2 flex items-center gap-2 rounded-xl border border-ember/40 bg-ember/8 px-2.5 py-1.5 text-xs`,children:[(0,B.jsx)(Xe,{className:S(`size-3.5 shrink-0 text-ember`,t&&`animate-pulse`)}),t||!e?(0,B.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-ink-dim`,children:[`Point at anything on the page — `,(0,B.jsx)(`span`,{className:`text-ink-faint`,children:`Esc cancels`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-ink`,children:[`A-Eye: `,(0,B.jsx)(`span`,{className:`font-medium`,children:Ft(e)})]}),(0,B.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-ink-faint`,children:e.tag}),(0,B.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Drop the A-Eye selection`,className:`shrink-0 rounded-full p-1 text-ink-faint transition-colors hover:bg-surface hover:text-ink`,children:(0,B.jsx)(L,{className:`size-3`})})]})]})}function Rt({voice:e,voiceEnabled:t}){return t&&e.error?(0,B.jsx)(`p`,{className:`mb-2 rounded-lg border border-amber/40 bg-amber/10 px-2.5 py-1.5 text-[11px] text-amber`,children:e.error}):e.pendingSend?(0,B.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 rounded-lg bg-brand/10 px-2.5 py-1.5 text-[11px] text-brand`,children:[(0,B.jsx)(`span`,{className:`relative flex-1 overflow-hidden rounded-full bg-brand/20`,children:(0,B.jsx)(`span`,{className:`block h-1 rounded-full bg-brand`,style:{animation:`browsentic-countdown ${e.autoSendMs}ms linear forwards`}})}),(0,B.jsx)(`span`,{className:`shrink-0`,children:`Sending…`}),(0,B.jsxs)(`button`,{type:`button`,onClick:e.cancelPending,className:`flex shrink-0 items-center gap-0.5 rounded-full px-1.5 py-0.5 transition-colors hover:bg-brand/15`,"aria-label":`Cancel sending`,children:[(0,B.jsx)(L,{className:`size-3`}),` Edit`]})]}):t&&e.listening?(0,B.jsxs)(`p`,{className:`mb-2 flex items-center gap-1.5 px-1 text-[11px] text-ink-dim`,children:[(0,B.jsx)(`span`,{className:`glow-dot inline-flex size-1.5 shrink-0 animate-pulse rounded-full bg-magenta text-magenta`}),e.interim?(0,B.jsx)(`span`,{className:`truncate italic`,children:e.interim}):(0,B.jsx)(`span`,{children:`Listening…`})]}):t&&!e.supported?(0,B.jsx)(`p`,{className:`mb-2 px-1 text-[11px] text-ink-faint`,children:`Voice input isn’t available in this browser.`}):null}function zt({files:e,onRemove:t}){return e.length===0?null:(0,B.jsx)(`div`,{className:`mb-2 flex max-h-40 flex-col gap-1.5 overflow-y-auto`,children:e.map(e=>(0,B.jsxs)(`div`,{className:`flex items-start gap-2 rounded-xl border border-line bg-ground/40 px-2.5 py-1.5 text-xs`,children:[(0,B.jsx)(Oe,{className:`mt-0.5 size-3.5 shrink-0 text-ink-faint`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`span`,{className:`truncate font-medium text-ink`,children:e.name}),(0,B.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-ink-faint`,children:Bt(e.size)})]}),e.status===`pending`&&(0,B.jsxs)(`span`,{className:`mt-0.5 flex items-center gap-1 text-[11px] text-ink-faint`,children:[(0,B.jsx)(T,{className:`size-3 animate-spin`}),` Analyzing…`]}),e.status===`ready`&&e.summary&&(0,B.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[11px] text-ink-dim`,children:e.summary}),e.status===`error`&&(0,B.jsx)(`span`,{className:`mt-0.5 block text-[11px] text-destructive`,children:e.error??`Analysis failed`})]}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>t(e.id),"aria-label":`Remove ${e.name}`,className:`mt-0.5 shrink-0 rounded-full p-1 text-ink-faint transition-colors hover:bg-surface hover:text-ink`,children:(0,B.jsx)(L,{className:`size-3`})})]},e.id))})}function Bt(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Vt({onClose:e}){return(0,B.jsxs)(`div`,{className:`enters max-h-[60%] shrink-0 overflow-y-auto border-b border-line bg-ground-2/80 px-3 py-3 backdrop-blur`,children:[(0,B.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-2`,children:[(0,B.jsx)(`p`,{className:`text-xs font-medium text-ink`,children:`Connection`}),(0,B.jsx)(h,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close connection settings`,onClick:e,children:(0,B.jsx)(L,{className:`size-3.5`})})]}),(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(se,{}),(0,B.jsx)(ge,{})]})]})}var Ht=[`Summarise what this page says`,`Fill this form in with my details`,`Find the unpaid invoices and open the newest`],Ut={unpaired:`This browser isn’t paired yet, so nothing can drive it. Pairing takes one command and one code.`,offline:`Paired, but the daemon isn’t answering. Start browsentic and this reconnects on its own.`,agent:`The chosen agent can’t run on this machine. Pick another one, or let Browsentic fix it.`};function Wt({blocker:e,voiceOn:t,onGo:n,onFix:r,onUse:i}){return(0,B.jsxs)(`div`,{className:`dot-grid fade-bottom flex flex-col gap-4 p-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,B.jsx)(ae,{className:`mt-0.5 size-7 shrink-0 text-brand`}),(0,B.jsx)(`div`,{className:`panel-card min-w-0 rounded-2xl rounded-tl-md px-3 py-2.5 text-sm leading-relaxed text-ink`,children:e?Ut[e]:(0,B.jsxs)(B.Fragment,{children:[t?`Just talk`:`Tell me`,` what to do on this page — read it, fill something in, click through a flow — and every action shows up here as I take it.`]})})]}),e?(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,B.jsx)(Gt,{icon:Ze,label:e===`agent`?`Choose an agent`:`Set up the link`,onClick:r})}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:Ht.map(e=>(0,B.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:`rounded-xl border border-line bg-ground/40 px-3 py-2 text-left text-xs text-ink-dim transition-colors hover:border-brand/40 hover:bg-surface/60 hover:text-ink`,children:e},e))}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,B.jsx)(Gt,{icon:F,label:`Teach it this site`,onClick:()=>n(`skills`)}),(0,B.jsx)(Gt,{icon:I,label:`Record a flow`,onClick:()=>n(`recordings`)}),(0,B.jsx)(Gt,{icon:Ye,label:`Past chats`,onClick:()=>n(`history`)})]})]})]})}function Gt({icon:e,label:t,onClick:n}){return(0,B.jsxs)(`button`,{type:`button`,onClick:n,className:`inline-flex items-center gap-1.5 rounded-full border border-line bg-ground-2/70 px-2.5 py-1 text-[11px] text-ink-dim transition-colors hover:border-brand/40 hover:text-ink`,children:[(0,B.jsx)(e,{className:`size-3`}),t]})}function Kt({state:e,onStop:t}){let n=Jt(e.startedAt),r=Math.max(0,e.timeoutMs-n),i=e.percent==null?null:Math.round(e.percent);return(0,B.jsxs)(`div`,{className:`enters mb-2 rounded-xl border border-magenta/35 bg-magenta/8 p-2.5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(Je,{className:`size-3.5 shrink-0 animate-pulse text-magenta`}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium text-ink`,children:[`Watching `,e.label??e.host]}),(0,B.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px] tabular-nums text-ink-faint`,children:[Yt(n),i!=null&&` · ${i}%`]}),(0,B.jsxs)(h,{size:`sm`,variant:`ghost`,className:`shrink-0 text-magenta hover:text-magenta`,onClick:t,children:[(0,B.jsx)(tt,{className:`size-3 fill-current`}),` Stop`]})]}),i!=null&&(0,B.jsx)(`div`,{className:`mt-2 h-1 overflow-hidden rounded-full bg-magenta/15`,children:(0,B.jsx)(`div`,{className:`glow-dot h-full rounded-full bg-magenta text-magenta transition-[width] duration-500`,style:{width:`${i}%`}})}),(0,B.jsx)(`p`,{className:`mt-1.5 text-[11px] leading-relaxed text-ink-faint`,children:qt(e,r)})]})}function qt(e,t){return e.stalledForMs==null?e.percent!=null&&e.etaMs!=null?`${Math.round(e.percent)}% · ${j(e.etaMs)} left`:e.logs.at(-1)?.text??`Stops automatically in ${Yt(t)}.`:`No change for ${Yt(e.stalledForMs)}.`}function Jt(e){let[t,n]=(0,R.useState)(()=>Date.now());return(0,R.useEffect)(()=>{let e=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(e)},[]),Math.max(0,t-e)}function Yt(e){let t=Math.floor(e/1e3);return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`}var Xt=[{id:`chat`,label:`Chat`,icon:Ve},{id:`history`,label:`History`,icon:Ye},{id:`skills`,label:`Skills`,icon:F},{id:`recordings`,label:`Recordings`,icon:I},{id:`settings`,label:`Settings`,icon:Qe}];function Zt({tab:e,counts:t,onSelect:n}){let r=(0,R.useRef)(null),[i,a]=(0,R.useState)(`full`),o=(0,R.useRef)({full:0,active:0});return(0,R.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=!0,n=()=>{if(!t)return;let n=e.clientWidth;i!==`icons`&&(o.current[i]=Qt(e));let{full:r,active:s}=o.current;a(r>0&&n>=r?`full`:i===`full`||n>=s?`active`:`icons`)};n();let s=new ResizeObserver(n);return s.observe(e),document.fonts.ready.then(n),()=>{t=!1,s.disconnect()}},[i,e,Xt.map(({id:e})=>t[e]??0).join(`·`)]),(0,B.jsx)(`nav`,{ref:r,"aria-label":`Panel sections`,className:`flex shrink-0 items-center gap-0.5 overflow-x-auto border-b border-line px-2 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:Xt.map(({id:r,label:a,icon:o})=>{let s=e===r,c=t[r]??0,l=i===`full`||i===`active`&&s;return(0,B.jsxs)(`button`,{type:`button`,onClick:()=>n(r),title:l?void 0:a,"aria-label":a,"aria-current":s?`page`:void 0,className:S(`relative inline-flex shrink-0 items-center gap-1.5 rounded-full px-2.5 py-1.5 text-[11px] font-medium transition-colors`,s?`bg-brand/12 text-brand`:`text-ink-faint hover:bg-surface/60 hover:text-ink-dim`),children:[(0,B.jsx)(o,{className:`size-3.5`}),l&&a,c>0&&(l?(0,B.jsx)(`span`,{className:S(`rounded-full px-1 font-mono text-[9px] tabular-nums`,s?`bg-brand/20`:`bg-surface text-ink-faint`),children:c}):(0,B.jsx)(`span`,{className:S(`absolute top-1 right-1 size-1.5 rounded-full`,s?`bg-brand/70`:`bg-ink-faint/60`)}))]},r)})})}function Qt(e){let t=getComputedStyle(e),n=parseFloat(t.columnGap)||0,r=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),i=Array.from(e.children);return i.reduce((e,t)=>e+t.getBoundingClientRect().width,0)+n*Math.max(0,i.length-1)+r}function $t({state:e,onStop:t}){let n=en(e.startedAt),r=Math.max(0,a-n);return(0,B.jsxs)(`div`,{className:`enters mb-2 rounded-xl border border-destructive/40 bg-destructive/8 p-2.5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`glow-dot size-2 shrink-0 animate-pulse rounded-full bg-destructive text-destructive`}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium text-ink`,children:[`Recording `,e.host]}),(0,B.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px] tabular-nums text-ink-faint`,children:[tn(n),` · `,e.events,` `,e.events===1?`step`:`steps`]}),(0,B.jsxs)(h,{size:`sm`,variant:`ghost`,className:`shrink-0 text-destructive hover:text-destructive`,onClick:t,children:[(0,B.jsx)(tt,{className:`size-3 fill-current`}),` Stop`]})]}),(0,B.jsxs)(`p`,{className:`mt-1.5 text-[11px] leading-relaxed text-ink-faint`,children:[e.warning??`Stops automatically in ${tn(r)}.`,!e.captureValues&&` Typed values are not being saved.`]})]})}function en(e){let[t,n]=(0,R.useState)(()=>Date.now());return(0,R.useEffect)(()=>{let e=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(e)},[]),Math.max(0,t-e)}function tn(e){let t=Math.floor(e/1e3);return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`}var nn=_(`inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border px-2 py-0.5 font-mono text-[10px] tracking-[0.08em] whitespace-nowrap uppercase [&>svg]:pointer-events-none [&>svg]:size-2.5`,{variants:{variant:{default:`border-brand/35 bg-brand/12 text-brand`,secondary:`border-line-strong bg-surface/70 text-ink-dim`,destructive:`border-destructive/40 bg-destructive/12 text-destructive`,warning:`border-amber/40 bg-amber/12 text-amber`,outline:`border-line text-ink-faint`}},defaultVariants:{variant:`default`}});function V({className:e,variant:t,asChild:n=!1,...r}){return(0,B.jsx)(n?s:`span`,{"data-slot":`badge`,className:S(nn({variant:t}),e),...r})}function rn({recordings:e,busy:t,onReplay:n,onRemove:r}){return e.length===0?(0,B.jsxs)(`div`,{className:`dot-grid fade-bottom rounded-xl border border-line px-3 py-6 text-center`,children:[(0,B.jsx)(I,{className:`mx-auto size-5 text-ink-faint`}),(0,B.jsx)(`p`,{className:`mt-2 text-[11px] leading-relaxed text-ink-faint`,children:`No recordings yet. Press Record above and walk through the flow you want repeated.`})]}):(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[t&&(0,B.jsx)(`p`,{className:`px-1 pb-1 text-[11px] text-ink-faint`,children:`Waiting on the current run — stop it to replay a recording.`}),e.map(e=>(0,B.jsx)(an,{recording:e,busy:t===!0,onReplay:n,onRemove:r},e.id))]})}function an({recording:e,busy:t,onReplay:n,onRemove:r}){let[a,o]=(0,R.useState)(null),s=e.status===`ready`;return(0,B.jsxs)(`div`,{className:`flex items-start gap-2 rounded-xl border border-line bg-ground/40 px-2.5 py-2 text-xs`,children:[(0,B.jsx)(I,{className:`mt-0.5 size-3.5 shrink-0 text-ink-faint`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[a===null?(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`span`,{className:`truncate font-medium text-ink`,children:e.name}),e.capturedValues&&(0,B.jsxs)(V,{variant:`warning`,children:[(0,B.jsx)(Ie,{}),` values`]})]}):(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(A,{value:a,autoFocus:!0,onChange:e=>o(e.target.value),onKeyDown:t=>{t.key===`Escape`&&o(null),t.key===`Enter`&&(i(e.id,a),o(null))},"aria-label":`Recording name`,className:`h-7 text-xs`}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>{i(e.id,a),o(null)},"aria-label":`Save name`,className:`shrink-0 rounded-full p-1 text-ink-faint transition-colors hover:bg-surface hover:text-ink`,children:(0,B.jsx)(E,{className:`size-3`})})]}),(0,B.jsxs)(`span`,{className:`mt-0.5 flex items-center gap-1 font-mono text-[10px] text-ink-faint`,children:[(0,B.jsx)(je,{className:`size-2.5 shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.host})]}),e.goal&&e.goal!==e.name&&(0,B.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[11px] text-ink-dim`,children:e.goal}),(0,B.jsx)(`span`,{className:`mt-0.5 flex items-center gap-1 text-[11px] text-ink-faint`,children:e.status===`analyzing`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(T,{className:`size-3 animate-spin`}),` Splitting into steps…`]}):e.status===`error`?(0,B.jsx)(`span`,{className:`text-destructive`,children:e.error??`Could not read this recording`}):(0,B.jsxs)(B.Fragment,{children:[e.steps??0,` `,e.steps===1?`step`:`steps`,` · `,ln(e.durationMs),` ·`,` `,un(e.updatedAt)]})}),s&&(0,B.jsxs)(`button`,{type:`button`,onClick:()=>n(e),disabled:t,className:`mt-1.5 inline-flex items-center gap-1 rounded-full bg-brand/12 px-2 py-0.5 text-[11px] text-brand transition-colors hover:bg-brand/20 disabled:opacity-50`,children:[(0,B.jsx)(qe,{className:`size-3`}),` Do this again`]})]}),(0,B.jsxs)(`div`,{className:`mt-0.5 flex shrink-0 gap-0.5`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:()=>o(e.name),"aria-label":`Rename ${e.name}`,className:`rounded-full p-1 text-ink-faint transition-colors hover:bg-surface hover:text-ink`,children:(0,B.jsx)(Ke,{className:`size-3`})}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>r(e.id),"aria-label":`Delete ${e.name}`,className:`rounded-full p-1 text-ink-faint transition-colors hover:bg-surface hover:text-ink`,children:(0,B.jsx)(L,{className:`size-3`})})]})]})}var on=6e4,sn=60*on,cn=24*sn;function ln(e){let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${String(t%60).padStart(2,`0`)}s`}function un(e){let t=Date.now()-e;return t<on?`just now`:t<sn?`${Math.floor(t/on)}m ago`:t<cn?`${Math.floor(t/sn)}h ago`:t<7*cn?`${Math.floor(t/cn)}d ago`:new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function dn({tabUrl:e,recordings:t,recording:n,busy:r,onStart:i,onStop:a,onReplay:o,onRemove:s}){let[c,l]=(0,R.useState)(!1),u=xt(e),d=!r&&!n&&/^https?:/.test(e);return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 p-3`,children:[(0,B.jsx)(`p`,{className:`text-[11px] leading-relaxed text-ink-dim`,children:`Capture what you do on a site — the clicks, the fields you fill, the pages you move through — and the agent can repeat it later. A recording runs for at most 15 minutes.`}),n?(0,B.jsxs)(h,{variant:`destructive`,onClick:a,children:[(0,B.jsx)(tt,{className:`fill-current`}),` Stop recording`]}):(0,B.jsxs)(h,{variant:`destructive`,onClick:()=>i(c),disabled:!d,title:d?`Record what you do on ${u}`:`Open an http(s) page, with nothing else running`,children:[(0,B.jsx)(Ce,{className:`fill-current`}),(0,B.jsxs)(`span`,{className:`truncate`,children:[`Record `,u||`this page`]})]}),!n&&(0,B.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 rounded-xl border border-line bg-ground/40 px-2.5 py-2 text-[11px] leading-relaxed text-ink-dim`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:c,onChange:e=>l(e.target.checked),className:`mt-0.5 size-3 shrink-0 accent-destructive`}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`span`,{className:`font-medium text-ink`,children:`Save what I type.`}),` Off by default — every field becomes a placeholder the agent asks you to fill. Passwords and card numbers are never saved either way.`]})]}),(0,B.jsx)(rn,{recordings:t,busy:r,onReplay:o,onRemove:s})]})}function fn({text:e,streaming:t,className:n}){let r=(0,R.useRef)(!1);t&&(r.current=!0);let i=(0,R.useMemo)(()=>Cn(e).map(e=>({block:e,sig:JSON.stringify(e)})),[e]);return(0,B.jsx)(`div`,{"data-stream":t?`live`:r.current?`done`:void 0,className:S(`flex min-w-0 flex-col gap-2`,n),children:i.map(({block:e,sig:t},n)=>(0,B.jsx)(pn,{block:e,sig:t},n))})}var pn=(0,R.memo)(({block:e})=>Mn(e,`0`),(e,t)=>e.sig===t.sig),mn=/^ {0,3}(`{3,}|~{3,})[^\n]*$/,hn=/^ {0,3}(?:`{3,}|~{3,})[ \t]*([^\s`~]*)/,gn=/^ {0,3}(`{3,}|~{3,})[ \t]*$/,_n=/^ {0,3}(#{1,6})[ \t]+(.*?)[ \t]*#*[ \t]*$/,vn=/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/,yn=/^ {0,3}>[ \t]?/,bn=/^([ \t]*)(?:([-*+])|(\d{1,9})[.)])[ \t]+(.*)$/,xn=/^ {0,3}\|?[ \t]*:?-+:?[ \t]*(?:\|[ \t]*:?-+:?[ \t]*)+\|?[ \t]*$/,Sn=12;function Cn(e,t=0){let n=e.replace(/\r\n?/g,`
|
|
4
4
|
`).split(`
|