@capagents/forgeqe 2.6.2 → 2.6.3

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.
Files changed (87) hide show
  1. package/HOW_TO_USE.md +201 -13
  2. package/README.md +4 -2
  3. package/THIRD_PARTY_NOTICES.md +9 -0
  4. package/dist/docs-site/docs/architecture/index.html +2 -1
  5. package/dist/docs-site/docs/index.html +188 -10
  6. package/dist/docs-site/docs/search.js +1 -1
  7. package/dist/docs-site/docs/web-app/index.html +35 -6
  8. package/dist/forgeqe.js +1316 -1145
  9. package/dist/template.html +64 -64
  10. package/dist/web/assets/Agent-yd1DyMzR.js +4 -0
  11. package/dist/web/assets/ApiTests-BwOGta9J.js +10 -0
  12. package/dist/web/assets/Chat-P8GH_6gl.js +3 -0
  13. package/dist/web/assets/Data-D2iCqk3t.js +3 -0
  14. package/dist/web/assets/Features-Bu38clxs.js +1 -0
  15. package/dist/web/assets/Jobs-DymuaGeN.js +5 -0
  16. package/dist/web/assets/KindPage-zl6TBkEl.js +6 -0
  17. package/dist/web/assets/Migration-Cg_FUqS_.js +2 -0
  18. package/dist/web/assets/Quality-D3bSHP_B.js +1 -0
  19. package/dist/web/assets/Record-DkCLJos6.js +2 -0
  20. package/dist/web/assets/Regression-B2qMKjAE.js +5 -0
  21. package/dist/web/assets/Reports-D_G9yfDa.js +2 -0
  22. package/dist/web/assets/Response-BnPAefP-.js +4 -0
  23. package/dist/web/assets/Runs-DsDj9-LT.js +2 -0
  24. package/dist/web/assets/Shell-DlZHZN0d.js +3 -0
  25. package/dist/web/assets/TestData-qI1R5Q9v.js +2 -0
  26. package/dist/web/assets/WhatsNew-CoCHqSDm.js +1 -0
  27. package/dist/web/assets/accessibility-CH8EpEAV.svg +1 -0
  28. package/dist/web/assets/{arrow-down-BX18RHKM.js → arrow-down-BWCXlJU0.js} +1 -1
  29. package/dist/web/assets/arrow-right-CdxkQBV7.js +1 -0
  30. package/dist/web/assets/{bot-CLgiKzu9.js → bot-D8486kSA.js} +1 -1
  31. package/dist/web/assets/capgemini-mark-D6aZFnD3.png +0 -0
  32. package/dist/web/assets/chevron-up-CQz_ZmIK.js +1 -0
  33. package/dist/web/assets/circle-BqXBUsQS.js +1 -0
  34. package/dist/web/assets/{circle-dashed-CtRp9sew.js → circle-dashed-DlOiCbWD.js} +1 -1
  35. package/dist/web/assets/dataParts-bwNleJYd.js +3 -0
  36. package/dist/web/assets/forgeqe-logo-D3CwM2Jl.png +0 -0
  37. package/dist/web/assets/forgeqe-logo-white-CoE-hF2l.png +0 -0
  38. package/dist/web/assets/forgeqe-mark-ZLd4S3hw.png +0 -0
  39. package/dist/web/assets/index-Bh4NBbEU.js +37 -0
  40. package/dist/web/assets/index-DkgUrjyL.css +2 -0
  41. package/dist/web/assets/keyboard-wpCM6HMa.js +1 -0
  42. package/dist/web/assets/qualityParts-iy-mouSI.js +1 -0
  43. package/dist/web/assets/{thread-Y9TDe1cr.js → thread-BfW2V-2U.js} +1 -1
  44. package/dist/web/assets/upload-CwExsxOd.js +1 -0
  45. package/dist/web/assets/usePageChat-CzWbP_sa.js +1 -0
  46. package/dist/web/index.html +3 -3
  47. package/docs/ARCHITECTURE.md +2 -1
  48. package/docs/WEB_APP.md +36 -6
  49. package/docs/security-data-flow.html +3 -3
  50. package/docs/user-guide.html +188 -10
  51. package/forgeqe.example.yaml +8 -2
  52. package/package.json +5 -3
  53. package/prompts/api-tests.md +1 -1
  54. package/prompts/brain.md +8 -0
  55. package/prompts/browser-persona.md +14 -0
  56. package/prompts/db-agent.md +73 -0
  57. package/prompts/heal.md +1 -1
  58. package/prompts/migrate.md +54 -0
  59. package/prompts/test-agent.md +1 -0
  60. package/py/forgeqe_engine/cli.py +9 -1
  61. package/py/forgeqe_engine/copilot_gateway.py +162 -9
  62. package/py/forgeqe_engine/persona.py +435 -0
  63. package/py/forgeqe_engine/proceed.py +67 -0
  64. package/py/forgeqe_engine/service.py +93 -11
  65. package/skills/test-data/SKILL.md +4 -0
  66. package/dist/web/assets/Agent-CTDTMH3D.js +0 -3
  67. package/dist/web/assets/ApiTests-l1gZ56fZ.js +0 -10
  68. package/dist/web/assets/Chat-Dikg6l8H.js +0 -3
  69. package/dist/web/assets/Data-BwECmGVi.js +0 -4
  70. package/dist/web/assets/Features-B79B8aw4.js +0 -1
  71. package/dist/web/assets/Jobs-B0viFhNH.js +0 -5
  72. package/dist/web/assets/Quality-CjFsnbA2.js +0 -1
  73. package/dist/web/assets/Record-B-Eh1bgA.js +0 -2
  74. package/dist/web/assets/Regression-B7l83v3z.js +0 -5
  75. package/dist/web/assets/Reports-BuUlCohG.js +0 -2
  76. package/dist/web/assets/Response-BS_RT6Qd.js +0 -4
  77. package/dist/web/assets/Runs-C7TPphyI.js +0 -2
  78. package/dist/web/assets/Shell-Vg5t8ZK3.js +0 -3
  79. package/dist/web/assets/accessibility-BSaq_4Me.svg +0 -1
  80. package/dist/web/assets/capgemini-BO8ajcbd.svg +0 -21
  81. package/dist/web/assets/capgemini-white-ByjwPW8N.svg +0 -21
  82. package/dist/web/assets/circle-BF-xM9LZ.js +0 -1
  83. package/dist/web/assets/index-CDCzsK2N.css +0 -2
  84. package/dist/web/assets/index-DR8clS1u.js +0 -26
  85. package/dist/web/assets/markdown-CBbHCXbg.js +0 -10
  86. package/dist/web/assets/trending-up-DMQnalkJ.js +0 -1
  87. package/dist/web/assets/usePageChat-CSLmKGMO.js +0 -1
@@ -0,0 +1,2 @@
1
+ import{Bt as e,G as t,Gn as n,Hr as r,Ht as i,It as a,K as o,Lt as s,Rt as c,Sn as l,U as u,Vt as d,W as f,X as p,Y as m,at as h,ct as g,et as _,gr as v,kr as y,li as b,mr as x,n as S,ot as C,q as w,si as T,tt as E,ui as D,vt as O,w as k,zr as A}from"./Shell-DlZHZN0d.js";import{a as j,c as M,f as N,i as ee,n as P,o as F,p as I,r as L,s as R,t as z,u as B}from"./dataParts-bwNleJYd.js";import{j as V,t as H}from"./index-Bh4NBbEU.js";import{t as U}from"./when-CHnpLdYw.js";var W={name:`sprout`,size:24,node:[[`path`,{d:`M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3`,key:`139s4v`}],[`path`,{d:`M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4`,key:`1dlkgp`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]};W.node;var G=y(W),K=b({Requests:()=>$,TestData:()=>ie}),q=D(T(),1),J=e(),Y=[`requests`,`kept`,`specs`,`batches`],X={fetch:`kept`,request:`requests`,gen:`specs`,files:`specs`,insert:`specs`,batches:`batches`,clean:`batches`},Z=e=>Object.values(e.row_counts||{}).reduce((e,t)=>e+t,0);function Q({e,kept:t,busy:n,act:r}){return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 px-1 py-2`,children:[(0,J.jsxs)(`dl`,{className:`m-0 grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-[13px]`,children:[(0,J.jsx)(`dt`,{className:`text-muted`,children:`Asked for`}),(0,J.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:e.need}),(0,J.jsx)(`dt`,{className:`text-muted`,children:`When`}),(0,J.jsxs)(`dd`,{className:`m-0`,children:[new Date(e.at).toLocaleString(),e.ms===void 0?``:` · answered in ${(e.ms/1e3).toFixed(1)} s`]}),(0,J.jsx)(`dt`,{className:`text-muted`,children:`How`}),(0,J.jsxs)(`dd`,{className:`m-0`,children:[e.source===`fetch`?`A kept request fetched again, with no model`:`Asked the DB agent for ${e.asked===`existing`?`existing rows`:e.asked===`new`?`new rows`:`either`}`,e.name?(0,J.jsxs)(J.Fragment,{children:[` · `,(0,J.jsx)(`span`,{className:`font-mono text-[12px]`,children:e.name})]}):null]}),e.why&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`dt`,{className:`text-muted`,children:`The answer`}),(0,J.jsx)(`dd`,{className:`m-0`,children:e.why})]})]}),e.error&&(0,J.jsx)(M,{text:e.error}),Object.entries(e.sample||{}).map(([t,n])=>(0,J.jsx)(B,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium`,children:`The query`}),(0,J.jsx)(P,{label:`SQL`,children:e.sql})]}),e.script_preview?.length?(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium`,children:`INSERT script`}),(0,J.jsx)(P,{label:`INSERT script`,children:e.script_preview.join(`
2
+ `)})]}):null,t&&e.name&&(0,J.jsx)(`div`,{children:(0,J.jsxs)(a,{size:`sm`,disabled:n,onClick:()=>r(`fetch`,{name:e.name}),children:[(0,J.jsx)(I,{size:14,"aria-hidden":`true`}),`Fetch again`]})})]})}function $({view:e,log:n,busy:r,act:i}){let[a,s]=(0,q.useState)(`all`),[c,l]=(0,q.useState)(``),[_,y]=(0,q.useState)(``),[b,S]=(0,q.useState)(``),C=n??[],T=(0,q.useMemo)(()=>[...new Set(C.map(e=>e.requester))].sort(),[n]),D=(0,q.useMemo)(()=>[...new Set(C.map(e=>e.database).filter(Boolean))].sort(),[n]),O=C.filter(e=>!e.ok).length,k=C.filter(e=>(a===`all`||a===`ok`===e.ok)&&(!c||e.requester===c)&&(!_||e.database===_)),A=new Set(e.requests.map(e=>e.name));return n===null?(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading the requests…`}):C.length?(0,J.jsx)(u,{label:`Requests`,resetKey:`${a}|${c}|${_}`,minWidth:760,fixed:!0,placeholder:`Find a request`,tools:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(p,{value:a,onChange:s,items:[{id:`all`,label:`All`,n:C.length},{id:`ok`,label:`Answered`,n:C.length-O},{id:`failed`,label:`Failed`,n:O,alert:!0}]}),T.length>1&&(0,J.jsxs)(E,{"aria-label":`Who asked`,value:c,onChange:e=>l(e.target.value),className:`h-8 w-[180px] text-[13px]`,children:[(0,J.jsx)(`option`,{value:``,children:`Anyone`}),T.map(e=>(0,J.jsx)(`option`,{children:e},e))]}),D.length>1&&(0,J.jsxs)(E,{"aria-label":`Database`,value:_,onChange:e=>y(e.target.value),className:`h-8 w-[160px] text-[13px]`,children:[(0,J.jsx)(`option`,{value:``,children:`Any database`}),D.map(e=>(0,J.jsx)(`option`,{children:e},e))]})]}),head:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`th`,{className:d(o,`w-9`),children:(0,J.jsx)(`span`,{className:`sr-only`,children:`Open`})}),(0,J.jsx)(`th`,{className:d(o,`w-[110px]`),children:`When`}),(0,J.jsx)(`th`,{className:d(o,`w-[150px]`),children:`Who asked`}),(0,J.jsx)(`th`,{className:o,children:`What for`}),(0,J.jsx)(`th`,{className:d(o,`w-[110px]`),children:`Database`}),(0,J.jsx)(`th`,{className:d(o,`w-[140px]`),children:`Answer`}),(0,J.jsx)(`th`,{className:d(w,`w-[70px]`),children:`Rows`})]}),empty:`No requests match these filters. Pick All and Anyone to see every request.`,children:k.map(e=>{let n=b===e.id;return(0,J.jsxs)(q.Fragment,{children:[(0,J.jsxs)(`tr`,{className:d(m,n&&`bg-surface-muted`),onClick:()=>S(n?``:e.id),children:[(0,J.jsx)(`td`,{className:d(f,`pr-0`),children:(0,J.jsx)(`button`,{type:`button`,"aria-expanded":n,"aria-label":n?`Close the request`:`Open the request`,onClick:t=>(t.stopPropagation(),S(n?``:e.id)),className:`flex cursor-pointer items-center border-0 bg-transparent p-0 text-muted`,children:n?(0,J.jsx)(v,{size:16,"aria-hidden":`true`}):(0,J.jsx)(x,{size:16,"aria-hidden":`true`})})}),(0,J.jsx)(`td`,{className:d(f,`whitespace-nowrap text-muted`),title:new Date(e.at).toLocaleString(),children:U(e.at)}),(0,J.jsx)(`td`,{className:d(f,`truncate`),title:e.requester,children:e.requester}),(0,J.jsxs)(`td`,{className:d(f,`truncate`),title:e.need,children:[e.need,e.source===`fetch`?(0,J.jsx)(`span`,{className:`text-muted`,children:` · fetched again`}):null]}),(0,J.jsx)(`td`,{className:d(f,`truncate`),title:e.database,children:e.database||(0,J.jsx)(`span`,{className:`text-muted`,children:`—`})}),(0,J.jsx)(`td`,{className:d(f,`whitespace-nowrap`),children:(0,J.jsx)(h,{tone:e.ok?`pass`:`fail`,children:e.ok?F[e.kind||``]||`Answered`:`Failed`})}),(0,J.jsx)(`td`,{className:t,children:e.ok?Z(e):``})]}),n&&(0,J.jsx)(`tr`,{className:`border-t border-line-soft bg-surface-muted/40`,children:(0,J.jsx)(`td`,{colSpan:7,className:`max-w-0 px-4 py-2`,children:(0,J.jsx)(Q,{e,kept:!!e.name&&A.has(e.name),busy:r,act:i})})})]},e.id)})}):(0,J.jsxs)(`p`,{className:`m-0 rounded-[12px] border border-line-soft px-4 py-3 text-sm text-muted`,children:[`No test data was asked for yet. The agents ask before a test runs, or `,(0,J.jsx)(`a`,{href:g(`data`,`ask`,`test-data`),children:`ask for test data`}),` yourself.`]})}function te({view:e,job:t,busy:n,act:r,onNote:o}){let s=t&&!t.running&&t.kind===`fetch`?t:null,c=s?.result;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-muted`,children:`Each request is kept in test-data/requests with its query or INSERT script. Fetch one again to get the same data with no model: a query reads the rows there now, a spec makes the same rows.`}),s&&(0,J.jsxs)(`section`,{"aria-label":`Fetched ${s.target}`,className:`flex flex-col gap-3 rounded-[14px] border border-line-soft p-4`,children:[(0,J.jsx)(`h2`,{className:`m-0 text-base font-semibold [overflow-wrap:anywhere]`,children:s.target}),c&&!c.ok&&(0,J.jsx)(M,{text:c.error||`It could not fetch the data.`}),c?.ok&&(0,J.jsx)(z,{r:c,onNote:o})]}),e.requests.length===0?(0,J.jsxs)(`p`,{className:`m-0 rounded-[12px] border border-line-soft px-4 py-3 text-sm text-muted`,children:[`No kept requests yet. Each request the DB agent answers is kept here; `,(0,J.jsx)(`a`,{href:g(`data`,`ask`,`test-data`),children:`ask for test data`}),` to make the first.`]}):(0,J.jsx)(R,{items:e.requests,text:e=>`${e.need} ${e.name} ${e.database} ${e.requester||``}`,label:`Kept requests`,size:15,children:e=>(0,J.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-3 border-t border-line-soft py-2.5 text-sm first:border-t-0`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-0.5`,children:[(0,J.jsx)(`span`,{className:`text-[14px] font-medium [overflow-wrap:anywhere]`,children:e.need}),(0,J.jsxs)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:[(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` · `,e.database,` · `,F[e.kind],e.rows?` · ${i(e.rows,`row`)}`:``,e.created?` · ${U(e.created)}`:``,e.requester?` · asked by ${e.requester}`:``]})]}),(0,J.jsxs)(a,{size:`sm`,disabled:n,onClick:()=>r(`fetch`,{name:e.name}),children:[(0,J.jsx)(I,{size:14,"aria-hidden":`true`}),`Fetch again`]})]},e.name)})]})}function ne({view:e,job:t,busy:r,act:i,onNote:o}){let[s,u]=(0,q.useState)(e.specs[0]??``),[d,f]=(0,q.useState)(``),[p,m]=(0,q.useState)(``),[h,v]=(0,q.useState)(`csv`),[y,b]=(0,q.useState)(!1),x={spec:s,...d?{db:d}:{},...p?{seed:p}:{}},S=t&&!t.running?t:null,C=S&&[`gen`,`files`,`insert`].includes(S.kind)&&S.target===s?S.result:void 0,w=e.databases.find(e=>e.name===d),T=async()=>{try{let{id:e}=await A.start(`Write a test data spec for this project (a YAML file with tables: under test-data/), from the database's schema. Show me the spec and a preview before you save it.`,{});location.hash=g(`chats`,e)}catch(e){o(e.message)}};return(0,J.jsxs)(`section`,{"aria-labelledby":`spec-h`,className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,J.jsxs)(`h2`,{id:`spec-h`,className:`m-0 flex flex-1 items-center gap-2 text-lg font-semibold`,children:[(0,J.jsx)(c,{icon:n,size:18,className:`text-accent-fg`}),`Make test data from a spec`]}),(0,J.jsxs)(a,{variant:`ghost`,onClick:()=>void T(),children:[(0,J.jsx)(c,{icon:l,size:16}),`Write a spec in a chat`]})]}),(0,J.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-muted`,children:`A spec is a YAML file with tables: and what goes in each column. The same spec and seed make the same data again, so a test or a pipeline can rely on it. No model is used.`}),e.specs.length===0?(0,J.jsx)(`p`,{className:`m-0 rounded-[12px] border border-line-soft px-4 py-3 text-sm text-muted`,children:`No specs in this project yet: a YAML file with tables: in test-data/, data/ or specs/. Write one in a chat, from a database's schema.`}):(0,J.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-[14px] border border-line-soft p-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,J.jsxs)(`label`,{className:`flex min-w-0 flex-[2_1_260px] flex-col gap-1.5 text-sm font-medium`,children:[`Spec`,(0,J.jsx)(E,{value:s,onChange:e=>u(e.target.value),children:e.specs.map(e=>(0,J.jsx)(`option`,{children:e},e))})]}),(0,J.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_180px] flex-col gap-1.5 text-sm font-medium`,children:[`Database`,(0,J.jsxs)(E,{value:d,onChange:e=>f(e.target.value),children:[(0,J.jsx)(`option`,{value:``,children:`The spec's own`}),e.databases.map(e=>(0,J.jsxs)(`option`,{value:e.name,children:[e.name,e.writable?``:` (read only)`]},e.name))]})]}),(0,J.jsxs)(`label`,{className:`flex w-[120px] flex-col gap-1.5 text-sm font-medium`,children:[`Seed`,(0,J.jsx)(_,{value:p,inputMode:`numeric`,placeholder:`Random`,onChange:e=>m(e.target.value.replace(/\D/g,``).slice(0,9))})]})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(a,{variant:y?void 0:`primary`,disabled:r||!s,onClick:()=>i(`gen`,x),children:[(0,J.jsx)(c,{icon:n,size:16}),`Preview`]}),(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,J.jsx)(a,{disabled:r||!s,onClick:()=>i(`gen`,{...x,mode:`files`,format:h}),children:`Write files`}),(0,J.jsx)(E,{"aria-label":`File format`,value:h,onChange:e=>v(e.target.value),className:`w-[88px]`,children:[`csv`,`json`,`sql`].map(e=>(0,J.jsx)(`option`,{children:e},e))})]}),(0,J.jsxs)(a,{disabled:r||!s||!w?.writable,title:w?.writable?void 0:`Pick a writable database to insert into`,onClick:()=>b(!0),children:[(0,J.jsx)(G,{size:16,"aria-hidden":`true`}),`Insert into `,w?.writable?w.name:`a database`]})]}),y&&w&&(0,J.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Insert test data`,className:`flex flex-col gap-3 rounded-[12px] border border-warn bg-warn-soft p-4`,children:[(0,J.jsxs)(`span`,{className:`font-medium`,children:[`Insert the rows of `,s,` into `,w.name,`?`]}),(0,J.jsx)(`span`,{className:`text-sm text-ink-2`,children:`They go in as one batch, which you can remove again under Batches. Only on a test database.`}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,J.jsx)(a,{variant:`primary`,onClick:()=>{b(!1),i(`gen`,{...x,mode:`insert`,confirmed:!0})},children:`Insert`}),(0,J.jsx)(a,{onClick:()=>b(!1),children:`Don't insert`})]})]}),C&&!C.ok&&(0,J.jsx)(M,{text:C.error||`It did not make the data.`}),C?.ok&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[C.batch&&(0,J.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-3 py-2 text-sm text-pass`,children:[`Inserted as batch `,(0,J.jsx)(`span`,{className:`font-mono text-[13px]`,children:C.batch}),`.`]}),C.files?.length?(0,J.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[`Wrote`,C.files.map(e=>(0,J.jsx)(L,{file:e,onNote:o},e))]}):null,(0,J.jsx)(ee,{r:C})]})]})]})}function re({view:e,job:t,busy:n,act:r}){let i=e.databases.filter(e=>e.writable),[o,s]=(0,q.useState)(i[0]?.name??``),[l,u]=(0,q.useState)(``),d=t&&!t.running?t:null,f=d?.kind===`batches`?(Array.isArray(d.result)?d.result.flatMap(e=>e.batches||[]):d.result?.batches)??[]:null;return(0,J.jsxs)(`section`,{"aria-labelledby":`batch-h`,className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`h2`,{id:`batch-h`,className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[(0,J.jsx)(c,{icon:G,size:18,className:`text-accent-fg`}),`Inserted batches`]}),(0,J.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-muted`,children:`Rows inserted from a spec go in as a batch. Remove a batch to take exactly those rows out again, children first.`}),i.length===0?(0,J.jsx)(`p`,{className:`m-0 rounded-[12px] border border-line-soft px-4 py-3 text-sm text-muted`,children:`No writable database: test data is inserted only into one marked writable in Settings, Databases.`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(E,{"aria-label":`Database`,value:o,onChange:e=>s(e.target.value),className:`w-[220px]`,children:i.map(e=>(0,J.jsx)(`option`,{children:e.name},e.name))}),(0,J.jsx)(a,{disabled:n||!o,onClick:()=>r(`batches`,{db:o}),children:`List batches`})]}),f&&f.length===0&&(0,J.jsxs)(`p`,{className:`m-0 text-sm text-muted`,children:[`No batches in `,d?.target,`.`]}),f&&f.length>0&&(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:f.map(e=>(0,J.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-3 border-t border-line-soft py-2.5 text-sm first:border-t-0`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-0.5`,children:[(0,J.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.batch}),(0,J.jsxs)(`span`,{className:`text-[12px] text-muted`,children:[(0,J.jsx)(`span`,{title:new Date(e.created).toLocaleString(),children:U(e.created)}),e.spec?` · ${e.spec}`:``,` ·`,` `,Object.entries(e.rows).map(([e,t])=>`${e} ${t}`).join(`, `)]})]}),l===e.batch?(0,J.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`span`,{className:`text-[13px] text-warn`,children:[`Remove its rows from `,d?.target,`?`]}),(0,J.jsx)(a,{size:`sm`,className:`border-fail text-fail hover:bg-fail-soft`,onClick:()=>{u(``),r(`clean`,{db:d?.target,batch:e.batch,confirmed:!0})},children:`Remove`}),(0,J.jsx)(a,{size:`sm`,onClick:()=>u(``),children:`Keep`})]}):(0,J.jsxs)(a,{size:`sm`,disabled:n,onClick:()=>u(e.batch),children:[(0,J.jsx)(V,{size:14,"aria-hidden":`true`}),`Remove`]})]},e.batch))}),d?.kind===`clean`&&d.result?.ok&&(0,J.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-3 py-2 text-sm text-pass`,children:[`Removed:`,` `,Object.entries(d.result.removed||{}).map(([e,t])=>`${e} ${t}`).join(`, `)]})]})]})}function ie({sub:e}){let{view:t,error:a,busy:o,act:c,stop:l,job:u}=N(),[f,p]=(0,q.useState)(null),[m,h]=(0,q.useState)(``),_=Y.includes(e)?e:`requests`,v=u&&!u.running?u.endedAt:``;(0,q.useEffect)(()=>{r.log().then(p,e=>h(e.message))},[v]);let y=(f||[]).filter(e=>!e.ok).length,b=new Set((f||[]).map(e=>e.requester)).size,x={requests:`Requests${f?` (${f.length})`:``}`,kept:`Kept${t?` (${t.requests.length})`:``}`,specs:`Specs${t?` (${t.specs.length})`:``}`,batches:`Batches`};return(0,J.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,J.jsx)(S,{}),(0,J.jsxs)(`main`,{className:d(H,`@container flex-auto gap-4`),children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,J.jsx)(O,{pixel:C[`test-data`],size:`lg`}),(0,J.jsx)(`h1`,{className:`m-0 flex-1 text-[26px] font-semibold tracking-[-0.01em]`,children:`Test data`}),(0,J.jsxs)(`a`,{href:g(`data`,`ask`,`test-data`),className:d(s(),`no-underline`),children:[(0,J.jsx)(n,{size:16,"aria-hidden":`true`}),`Ask for test data`]})]}),(0,J.jsx)(`p`,{className:`m-0 max-w-[74ch] text-sm leading-relaxed text-muted`,children:`Every request for test data: which agent asked, what for, when, and what the DB agent sent back. Kept requests fetch the same data again with no model; specs make data you can insert as batches and remove again.`}),f&&f.length>0&&(0,J.jsxs)(`p`,{className:`m-0 text-sm text-ink-2 tabular-nums`,children:[i(f.length,`request`),` · `,i(b,`asker`),` · `,(0,J.jsxs)(`span`,{className:y?`text-fail`:``,children:[y,` failed`]}),t?` · ${t.requests.length} kept`:``]}),(a||m)&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:a||m}),!t&&!a&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),t&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(k,{label:`Test data`,current:_,onPick:e=>location.hash=g(`test-data`,e),tabs:Y.map(e=>({id:e,label:x[e]}))}),u&&(u.running?X[u.kind]!==void 0:X[u.kind]===_)&&(0,J.jsx)(j,{job:u,onStop:l}),(0,J.jsxs)(`div`,{role:`tabpanel`,id:`panel-${_}`,"aria-labelledby":`tab-${_}`,children:[_===`requests`&&(0,J.jsx)($,{view:t,log:f,busy:o,act:c}),_===`kept`&&(0,J.jsx)(te,{view:t,job:u,busy:o,act:c,onNote:h}),_===`specs`&&(0,J.jsx)(ne,{view:t,job:u,busy:o,act:c,onNote:h}),_===`batches`&&(0,J.jsx)(re,{view:t,job:u,busy:o,act:c})]})]})]})]})}export{K as n,$ as t};
@@ -0,0 +1 @@
1
+ import{Bt as e,Ht as t,Vt as n,at as r,mr as i,n as a,ot as o,si as s,ui as c,vt as l,yt as u}from"./Shell-DlZHZN0d.js";import{t as d}from"./arrow-right-CdxkQBV7.js";import{d as f,f as p,l as m,p as h,t as g,u as _}from"./index-Bh4NBbEU.js";var v=c(s(),1),y=e(),b={new:{label:`New`,tone:`running`},improved:{label:`Improved`,tone:`neutral`},fixed:{label:`Fixed`,tone:`pass`}};function x({change:e,id:t,first:a}){let[o,s]=(0,v.useState)(!1),c=f(e);return(0,y.jsxs)(`li`,{className:n(!a&&`border-t border-line-soft`),children:[(0,y.jsxs)(`button`,{type:`button`,"aria-expanded":o,"aria-controls":t,onClick:()=>s(!o),className:`flex min-h-11 w-full cursor-pointer items-center gap-3 border-0 bg-transparent px-3 py-2.5 text-left text-sm text-ink hover:bg-surface-muted`,children:[(0,y.jsx)(r,{tone:b[e.kind].tone,icon:!1,className:`w-[76px] justify-center`,children:b[e.kind].label}),(0,y.jsx)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,y.jsx)(i,{size:16,"aria-hidden":`true`,className:n(`flex-none text-muted transition-transform duration-200`,o&&`rotate-90`)})]}),(0,y.jsx)(u,{open:o,id:t,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-2 px-3 pt-1 pb-3 sm:pl-[100px]`,children:[(0,y.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:e.detail}),c&&(0,y.jsxs)(`a`,{href:c,className:`inline-flex items-center gap-1 self-start text-[13px] font-medium`,children:[`Open`,(0,y.jsx)(d,{size:13,"aria-hidden":`true`})]})]})})]})}function S({release:e}){let i=e===m;return(0,y.jsxs)(`li`,{className:`relative flex gap-4 pb-8`,children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,className:n(`relative mt-1.5 size-[15px] flex-none rounded-full border-[3px] border-bg`,i?`bg-accent`:`bg-line`)}),(0,y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,y.jsxs)(`h3`,{className:`m-0 text-[15px] font-semibold`,children:[`ForgeQE `,e.version]}),i&&(0,y.jsx)(r,{tone:`running`,icon:!1,children:`Latest`}),(0,y.jsxs)(`span`,{className:`text-sm text-muted`,children:[(0,y.jsx)(`time`,{dateTime:e.date,children:h(e.date)}),` · `,t(e.changes.length,`change`)]})]}),(0,y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:e.summary}),(0,y.jsx)(`ul`,{className:`m-0 flex list-none flex-col overflow-hidden rounded-[12px] border border-line-soft p-0`,children:e.changes.map((t,n)=>(0,y.jsx)(x,{change:t,first:n===0,id:`change-${e.version}-${n}`},n))})]})]})}function C(){(0,v.useEffect)(p,[]);let e=_();return(0,y.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,y.jsx)(a,{}),(0,y.jsxs)(`main`,{className:n(g,`flex-auto gap-5`),children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,y.jsx)(l,{pixel:o[`whats-new`],size:`lg`}),(0,y.jsx)(`h1`,{className:`m-0 flex-1 text-[26px] font-semibold tracking-[-0.01em]`,children:`What's new`})]}),(0,y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-muted`,children:`What each release of ForgeQE added, improved and fixed. Pick a change to read more.`}),(0,y.jsxs)(`div`,{className:`relative flex flex-col gap-2`,children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-[60px] bottom-10 left-[7px] w-px bg-line`}),e.map(e=>(0,y.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,y.jsx)(`h2`,{className:`m-0 pl-[31px] text-[22px] font-semibold`,children:e.month}),(0,y.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:e.releases.map(e=>(0,y.jsx)(S,{release:e},e.version))})]},e.month))]})]})]})}export{b as KIND,C as WhatsNew};
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 86 96" width="172" height="192" role="img" aria-label="accessibility"><g><path d="M1 85L5 81L15 81L11 85Z" fill="#94c7ef"/><rect x="1" y="85" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M21 85L25 81L25 91L21 95Z" fill="#3f76a1"/><rect x="11" y="85" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><rect x="61" y="85" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M71 85L75 81L85 81L81 85Z" fill="#94c7ef"/><path d="M81 85L85 81L85 91L81 95Z" fill="#3f76a1"/><rect x="71" y="85" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M11 75L15 71L25 71L21 75Z" fill="#94c7ef"/><path d="M21 75L25 71L25 81L21 85Z" fill="#3f76a1"/><rect x="11" y="75" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M61 75L65 71L75 71L71 75Z" fill="#94c7ef"/><path d="M71 75L75 71L75 81L71 85Z" fill="#3f76a1"/><rect x="61" y="75" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M31 65L35 61L35 71L31 75Z" fill="#3f76a1"/><rect x="21" y="65" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M61 65L65 61L65 71L61 75Z" fill="#3f76a1"/><rect x="51" y="65" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M21 55L25 51L35 51L31 55Z" fill="#94c7ef"/><path d="M31 55L35 51L35 61L31 65Z" fill="#3f76a1"/><rect x="21" y="55" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M51 55L55 51L65 51L61 55Z" fill="#94c7ef"/><path d="M61 55L65 51L65 61L61 65Z" fill="#3f76a1"/><rect x="51" y="55" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><rect x="31" y="45" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M51 45L55 41L55 51L51 55Z" fill="#3f76a1"/><rect x="41" y="45" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><rect x="1" y="35" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><rect x="11" y="35" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><rect x="21" y="35" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><rect x="31" y="35" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><rect x="41" y="35" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><rect x="51" y="35" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><rect x="61" y="35" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M81 35L85 31L85 41L81 45Z" fill="#3f76a1"/><rect x="71" y="35" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M1 25L5 21L15 21L11 25Z" fill="#94c7ef"/><rect x="1" y="25" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M11 25L15 21L25 21L21 25Z" fill="#94c7ef"/><rect x="11" y="25" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M21 25L25 21L35 21L31 25Z" fill="#94c7ef"/><rect x="21" y="25" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><rect x="31" y="25" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><rect x="41" y="25" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M51 25L55 21L65 21L61 25Z" fill="#94c7ef"/><rect x="51" y="25" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M61 25L65 21L75 21L71 25Z" fill="#94c7ef"/><rect x="61" y="25" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M71 25L75 21L85 21L81 25Z" fill="#94c7ef"/><path d="M81 25L85 21L85 31L81 35Z" fill="#3f76a1"/><rect x="71" y="25" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><rect x="31" y="15" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M51 15L55 11L55 21L51 25Z" fill="#3f76a1"/><rect x="41" y="15" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M31 5L35 1L45 1L41 5Z" fill="#94c7ef"/><rect x="31" y="5" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g><g><path d="M41 5L45 1L55 1L51 5Z" fill="#94c7ef"/><path d="M51 5L55 1L55 11L51 15Z" fill="#3f76a1"/><rect x="41" y="5" width="10" height="10" fill="#5aa9e6" stroke="#56a1da" stroke-width=".25"/></g></svg>
@@ -1 +1 @@
1
- import{Er as e}from"./Shell-Vg5t8ZK3.js";var t={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};t.node;var n=e(t);export{n as t};
1
+ import{kr as e}from"./Shell-DlZHZN0d.js";var t={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{kr as e}from"./Shell-DlZHZN0d.js";var t={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};t.node;var n=e(t);export{n as t};
@@ -1 +1 @@
1
- import{Er as e}from"./Shell-Vg5t8ZK3.js";var t={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};t.node;var n=e(t);export{n as t};
1
+ import{kr as e}from"./Shell-DlZHZN0d.js";var t={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{kr as e}from"./Shell-DlZHZN0d.js";var t={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{kr as e}from"./Shell-DlZHZN0d.js";var t={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};t.node;var n=e(t);export{n as t};
@@ -1 +1 @@
1
- import{Er as e}from"./Shell-Vg5t8ZK3.js";var t={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};t.node;var n=e(t);export{n as t};
1
+ import{kr as e}from"./Shell-DlZHZN0d.js";var t={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1,3 @@
1
+ import{$ as e,Bt as t,Hr as n,Ht as r,It as i,J as a,K as o,Lt as s,U as c,Vt as l,Z as u,at as d,bt as f,kr as p,q as m,si as h,ui as g}from"./Shell-DlZHZN0d.js";import{M as _}from"./index-Bh4NBbEU.js";var v={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};v.node;var y=p(v),b=g(h(),1),x=t(),S={test:[`Testing the connection`,`Tested the connection`,`waiting`],tables:[`Reading the tables`,`Read the tables`,`searching`],query:[`Running the query`,`Ran the query`,`working`],gen:[`Making a preview`,`Made a preview`,`writing`],files:[`Writing the files`,`Wrote the files`,`writing`],insert:[`Inserting test data`,`Inserted test data`,`working`],batches:[`Listing the batches`,`Listed the batches`,`searching`],clean:[`Removing a batch`,`Removed a batch`,`working`],request:[`Asking the DB agent for test data`,`Asked the DB agent for test data`,`thinking`],fetch:[`Fetching the request again`,`Fetched the request again`,`searching`],ask:[`Asking the DB agent`,`Asked the DB agent`,`thinking`],checks:[`Running the checks`,`Ran the checks`,`working`],map:[`Reading the schema`,`Read the schema`,`searching`],check:[`Checking the flows`,`Checked the flows`,`working`],trace:[`Following the record`,`Followed the record`,`searching`]};function C(){let[e,t]=(0,b.useState)(null),[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)(!1),s=(0,b.useCallback)(()=>{n.view().then(e=>{t(e),i(``)},e=>i(e.message))},[]);(0,b.useEffect)(s,[s]);let c=!!e?.job?.running;return(0,b.useEffect)(()=>{if(!c)return;let e=setInterval(s,1e3);return()=>clearInterval(e)},[c,s]),{view:e,error:r,busy:a||c,running:c,act:async(e,t)=>{o(!0),i(``);try{await n.run(e,t),s()}catch(e){i(e.message)}finally{o(!1)}},stop:()=>void n.stop().then(s),load:s,job:e?.job??null}}var w=e=>e==null?`NULL`:typeof e==`object`?JSON.stringify(e):String(e);function T({file:e,onNote:t}){return(0,x.jsx)(`button`,{type:`button`,title:e,onClick:async()=>t(await f(e)),className:l(s({size:`sm`}),`font-mono text-[12px]`),children:e.split(/[\\/]/).pop()})}function E({children:e,label:t}){return(0,x.jsx)(`pre`,{"aria-label":t,className:`m-0 max-h-[320px] overflow-auto rounded-[12px] bg-surface-muted p-3 font-mono text-[12px] leading-relaxed whitespace-pre text-ink-2`,children:e})}function D({job:e,onStop:t}){let[n,a,o]=S[e.kind]??[`Working`,`Done`,`working`],s=(0,b.useRef)(null);(0,b.useEffect)(()=>{s.current&&(s.current.scrollTop=s.current.scrollHeight)},[e.lines.length]);let c=e.exitCode===0,l=!c&&(e.kind===`check`||e.kind===`trace`)&&e.result!==void 0&&!e.result.error;return(0,x.jsxs)(`section`,{"aria-label":e.running?n:a,className:`flex flex-col gap-2 rounded-[14px] border border-line-soft p-4`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,x.jsxs)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:[e.running?n:a,e.target?(0,x.jsxs)(`span`,{className:`font-normal text-muted`,children:[` · `,e.target]}):null]}),(0,x.jsx)(d,{tone:e.running?`running`:c?`pass`:e.exitCode===2||l?`warn`:`fail`,orb:o,children:e.running?`Working`:c?`Done`:l?`Some broken`:e.exitCode===2?`Not done`:`Failed`}),e.running&&(0,x.jsxs)(i,{onClick:t,className:`border-fail text-fail hover:bg-fail-soft`,children:[(0,x.jsx)(_,{size:14,fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]}),(0,x.jsxs)(`details`,{open:e.running||!c&&!e.result,children:[(0,x.jsxs)(`summary`,{className:`cursor-pointer text-sm text-muted`,children:[`Output (`,r(e.lines.length,`line`),`)`]}),(0,x.jsx)(`code`,{className:`mt-2 block font-mono text-[12px] text-muted [overflow-wrap:anywhere]`,children:e.command}),(0,x.jsx)(`pre`,{ref:s,className:`mt-2 max-h-[240px] overflow-auto rounded-[10px] bg-surface-muted p-3 font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:e.lines.join(`
2
+ `)||`Starting…`})]})]})}function O({text:e}){return(0,x.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e})}function k({columns:e,rows:t}){let n=e.map((e,n)=>t.length>0&&t.every(e=>e[n]===null||e[n]===void 0||typeof e[n]==`number`)&&t.some(e=>typeof e[n]==`number`));return(0,x.jsx)(c,{label:`Rows`,resetKey:t,head:e.map((e,t)=>(0,x.jsx)(`th`,{className:n[t]?m:o,children:e},e)),children:t.map((e,t)=>(0,x.jsx)(`tr`,{className:a,children:e.map((e,t)=>(0,x.jsx)(`td`,{title:w(e),className:l(`px-3 py-1.5 font-mono text-[12px]`,n[t]?`text-right whitespace-nowrap tabular-nums`:`max-w-[320px] truncate`,e==null&&`text-muted`),children:w(e)},t))},t))})}function A({r:e}){return(0,x.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(e.order||[]).map(t=>{let n=e.preview?.[t],i=n?.sample||[],a=i.length?Object.keys(i[0]):[];return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,x.jsxs)(`span`,{className:`text-sm`,children:[(0,x.jsx)(`span`,{className:`font-medium`,children:t}),` · `,r(e.rows?.[t]??0,`row`),n?.database_fills?.length?(0,x.jsxs)(`span`,{className:`text-muted`,children:[` · the database fills `,n.database_fills.join(`, `)]}):null,e.masked?.[t]?.length?(0,x.jsxs)(`span`,{className:`text-muted`,children:[` · masked `,e.masked[t].join(`, `)]}):null]}),a.length>0&&(0,x.jsx)(k,{columns:a,rows:i.slice(0,3).map(e=>a.map(t=>e[t]))})]},t)}),(e.warnings||[]).map((e,t)=>(0,x.jsx)(`p`,{className:`m-0 text-[13px] text-warn`,children:e},t))]})}var j={query:`Existing rows`,generate:`New rows`};function M({r:e,onNote:t}){let n=Object.entries(e.rows||{});return(0,x.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,x.jsx)(d,{tone:`pass`,children:j[e.kind||``]||`Answered`}),(0,x.jsxs)(`span`,{className:`min-w-0 text-sm text-ink-2 [overflow-wrap:anywhere]`,children:[e.database,e.why?` · ${e.why}`:``]})]}),n.map(([t,n])=>(0,x.jsx)(N,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,x.jsx)(`span`,{className:`text-sm font-medium`,children:`The query, as the database checked it`}),(0,x.jsx)(E,{label:`SQL`,children:e.sql})]}),e.script_preview&&e.script_preview.length>0&&(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,x.jsx)(`span`,{className:`text-sm font-medium`,children:`INSERT script for these rows, not run`}),(0,x.jsx)(E,{label:`INSERT script`,children:e.script_preview.join(`
3
+ `)})]}),e.files?.length?(0,x.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[`Kept`,e.files.map(e=>(0,x.jsx)(T,{file:e,onNote:t},e))]}):null,e.replay&&(0,x.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Tests and pipelines get the same data with `,(0,x.jsx)(`code`,{className:`font-mono text-[12px] text-ink-2`,children:e.replay}),`, without a model.`]})]})}function N({title:e,rows:t,total:n}){let i=[...new Set(t.flatMap(e=>Object.keys(e)))];return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,x.jsxs)(`span`,{className:`text-sm`,children:[(0,x.jsx)(`span`,{className:`font-medium`,children:e}),` · `,r(n,`row`),n>t.length?(0,x.jsxs)(`span`,{className:`text-muted`,children:[` · `,t.length,` shown`]}):null]}),i.length>0?(0,x.jsx)(k,{columns:i,rows:t.map(e=>i.map(t=>e[t]))}):(0,x.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No rows match.`})]})}function P({items:t,text:n,label:r,size:i=10,children:a}){let[o,s]=(0,b.useState)(``),[c,l]=(0,b.useState)(0),d=o.toLowerCase().split(/\s+/).filter(Boolean),f=d.length?t.filter(e=>d.every(t=>n(e).toLowerCase().includes(t))):t;(0,b.useEffect)(()=>l(0),[o,t.length]);let p=Math.min(c,Math.max(0,Math.ceil(f.length/i)-1));return(0,x.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[t.length>i&&(0,x.jsx)(e,{id:`find-${r.toLowerCase().replace(/\W+/g,`-`)}`,label:`Find in ${r.toLowerCase()}`,value:o,onChange:s,className:`flex-none`}),f.length?(0,x.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:f.slice(p*i,p*i+i).map(a)}):(0,x.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing matches.`}),f.length>i&&(0,x.jsx)(u,{page:p,size:i,total:f.length,onPage:l,label:`Pages of ${r.toLowerCase()}`})]})}export{D as a,O as c,w as d,C as f,A as i,k as l,E as n,j as o,y as p,T as r,P as s,M as t,N as u};