@capagents/forgeqe 2.4.8 → 2.4.9

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 (58) hide show
  1. package/dist/docs-site/docs/search.js +1 -1
  2. package/dist/docs-site/docs/web-app/index.html +9 -6
  3. package/dist/web/assets/Agent-DJMzvP5e.js +1 -0
  4. package/dist/web/assets/ApiTests-CatQogdX.js +2 -0
  5. package/dist/web/assets/Chat-BnMf86ti.js +3 -0
  6. package/dist/web/assets/Data-Dv1J1F3q.js +4 -0
  7. package/dist/web/assets/Features-BoUfO669.js +1 -0
  8. package/dist/web/assets/Jobs-DHLGBQQg.js +3 -0
  9. package/dist/web/assets/Quality-D0xYMvar.js +1 -0
  10. package/dist/web/assets/Record-Dnt4y9hn.js +1 -0
  11. package/dist/web/assets/Regression-icTMw-63.js +2 -0
  12. package/dist/web/assets/{Reports-Ba9lfMyQ.js → Reports-C_IwjymA.js} +2 -2
  13. package/dist/web/assets/Response-DhcE4o_e.js +8 -0
  14. package/dist/web/assets/Runs-5qNwwohN.js +2 -0
  15. package/dist/web/assets/architecture-CIPs2iKH.svg +1 -0
  16. package/dist/web/assets/board-De4ZOyTx.svg +1 -0
  17. package/dist/web/assets/bug-B7pnPQ6u.svg +1 -0
  18. package/dist/web/assets/chat-ByKQUaZd.svg +1 -0
  19. package/dist/web/assets/{circle-dashed-Beydn7Cq.js → circle-dashed-DJoDKq93.js} +1 -1
  20. package/dist/web/assets/columns-Cdba5l8P.svg +1 -0
  21. package/dist/web/assets/database-BSuo036d.svg +1 -0
  22. package/dist/web/assets/{external-link-BXwuemHF.js → external-link-Cu8-HMUj.js} +1 -1
  23. package/dist/web/assets/file-BvaF4lYn.svg +1 -0
  24. package/dist/web/assets/folder-DoGRAApH.svg +1 -0
  25. package/dist/web/assets/frame-3JV5tjBP.js +3 -0
  26. package/dist/web/assets/index-C65qlV-q.css +2 -0
  27. package/dist/web/assets/index-XRjCGJfG.js +26 -0
  28. package/dist/web/assets/mail-BHhJmEvJ.svg +1 -0
  29. package/dist/web/assets/{markdown-DWLq2XDl.js → markdown-Bca_tHZ5.js} +8 -8
  30. package/dist/web/assets/scroll-DLy6uwQV.svg +1 -0
  31. package/dist/web/assets/server-CEXgEMcl.svg +1 -0
  32. package/dist/web/assets/{sticky-note-DJiszrzE.js → sticky-note-BHLEsD2N.js} +1 -1
  33. package/dist/web/assets/table-DhoLKkVp.svg +1 -0
  34. package/dist/web/assets/terminal-Dpps2Gv8.svg +1 -0
  35. package/dist/web/assets/ticket-BkD0O1SC.svg +1 -0
  36. package/dist/web/assets/{trending-up-5byphiAi.js → trending-up-DWgCJxJf.js} +1 -1
  37. package/dist/web/index.html +3 -3
  38. package/docs/WEB_APP.md +9 -6
  39. package/package.json +1 -1
  40. package/dist/web/assets/Agent-COwqDXqG.js +0 -1
  41. package/dist/web/assets/ApiTests-DXDWCYVP.js +0 -2
  42. package/dist/web/assets/Chat-D4j0iiCT.js +0 -3
  43. package/dist/web/assets/Data-CLQGBqYO.js +0 -4
  44. package/dist/web/assets/Features-DiA3wnqN.js +0 -1
  45. package/dist/web/assets/Jobs--r4q8NVv.js +0 -3
  46. package/dist/web/assets/Quality-Drs9CXKj.js +0 -1
  47. package/dist/web/assets/Record-d9QKksv8.js +0 -1
  48. package/dist/web/assets/Regression-DOqZepZc.js +0 -2
  49. package/dist/web/assets/Response-BfwCLngt.js +0 -8
  50. package/dist/web/assets/Runs-CjPA01Rn.js +0 -2
  51. package/dist/web/assets/architecture-DqdNWeJP.svg +0 -1
  52. package/dist/web/assets/file-chart-column-increasing-Cojvoj1H.js +0 -1
  53. package/dist/web/assets/frame-9YY74_9h.js +0 -3
  54. package/dist/web/assets/index-DeACZos_.css +0 -2
  55. package/dist/web/assets/index-bN_xd12c.js +0 -26
  56. package/dist/web/assets/message-square-Bc8pM79i.js +0 -1
  57. package/dist/web/assets/terminal-BwR_yOmJ.js +0 -1
  58. package/dist/web/assets/terminal-CJd2e68O.svg +0 -1
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="152" height="152" role="img" aria-label="scroll"><g><path d="M1 65L5 61L15 61L11 65Z" fill="#f0e0bf"/><rect x="1" y="65" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><rect x="11" y="65" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><rect x="21" y="65" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><rect x="31" y="65" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><rect x="41" y="65" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><rect x="51" y="65" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><path d="M61 65L65 61L75 61L71 65Z" fill="#f0e0bf"/><path d="M71 65L75 61L75 71L71 75Z" fill="#a2916d"/><rect x="61" y="65" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><rect x="11" y="55" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><path d="M21 55L25 51L35 51L31 55Z" fill="#c6a26a"/><rect x="21" y="55" width="10" height="10" fill="#a8701a" stroke="#a06a19" stroke-width=".25"/></g><g><path d="M31 55L35 51L45 51L41 55Z" fill="#c6a26a"/><rect x="31" y="55" width="10" height="10" fill="#a8701a" stroke="#a06a19" stroke-width=".25"/></g><g><path d="M41 55L45 51L55 51L51 55Z" fill="#c6a26a"/><rect x="41" y="55" width="10" height="10" fill="#a8701a" stroke="#a06a19" stroke-width=".25"/></g><g><path d="M61 55L65 51L65 61L61 65Z" fill="#a2916d"/><rect x="51" y="55" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><path d="M21 45L25 41L25 51L21 55Z" fill="#a2916d"/><rect x="11" y="45" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><path d="M61 45L65 41L65 51L61 55Z" fill="#a2916d"/><rect x="51" y="45" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><rect x="11" y="35" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><path d="M21 35L25 31L35 31L31 35Z" fill="#c6a26a"/><rect x="21" y="35" width="10" height="10" fill="#a8701a" stroke="#a06a19" stroke-width=".25"/></g><g><path d="M31 35L35 31L45 31L41 35Z" fill="#c6a26a"/><rect x="31" y="35" width="10" height="10" fill="#a8701a" stroke="#a06a19" stroke-width=".25"/></g><g><path d="M41 35L45 31L55 31L51 35Z" fill="#c6a26a"/><rect x="41" y="35" width="10" height="10" fill="#a8701a" stroke="#a06a19" stroke-width=".25"/></g><g><path d="M61 35L65 31L65 41L61 45Z" fill="#a2916d"/><rect x="51" y="35" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><path d="M21 25L25 21L25 31L21 35Z" fill="#a2916d"/><rect x="11" y="25" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><path d="M61 25L65 21L65 31L61 35Z" fill="#a2916d"/><rect x="51" y="25" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><rect x="11" y="15" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><rect x="21" y="15" width="10" height="10" fill="#a8701a" stroke="#a06a19" stroke-width=".25"/></g><g><rect x="31" y="15" width="10" height="10" fill="#a8701a" stroke="#a06a19" stroke-width=".25"/></g><g><rect x="41" y="15" width="10" height="10" fill="#a8701a" stroke="#a06a19" stroke-width=".25"/></g><g><path d="M61 15L65 11L65 21L61 25Z" fill="#a2916d"/><rect x="51" y="15" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><path d="M1 5L5 1L15 1L11 5Z" fill="#f0e0bf"/><rect x="1" y="5" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><path d="M11 5L15 1L25 1L21 5Z" fill="#f0e0bf"/><rect x="11" y="5" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><path d="M21 5L25 1L35 1L31 5Z" fill="#f0e0bf"/><rect x="21" y="5" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><path d="M31 5L35 1L45 1L41 5Z" fill="#f0e0bf"/><rect x="31" y="5" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><path d="M41 5L45 1L55 1L51 5Z" fill="#f0e0bf"/><rect x="41" y="5" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><path d="M51 5L55 1L65 1L61 5Z" fill="#f0e0bf"/><rect x="51" y="5" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g><g><path d="M61 5L65 1L75 1L71 5Z" fill="#f0e0bf"/><path d="M71 5L75 1L75 11L71 15Z" fill="#a2916d"/><rect x="61" y="5" width="10" height="10" fill="#e8cf9c" stroke="#dcc594" stroke-width=".25"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76" width="152" height="152" role="img" aria-label="server"><g><rect x="1" y="65" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="11" y="65" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="21" y="65" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M31 65L35 61L45 61L41 65Z" fill="#bdcedc"/><rect x="31" y="65" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="41" y="65" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M51 65L55 61L65 61L61 65Z" fill="#bdcedc"/><rect x="51" y="65" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M71 65L75 61L75 71L71 75Z" fill="#6c7d8d"/><rect x="61" y="65" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="1" y="55" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="11" y="55" width="10" height="10" fill="#45627d" stroke="#425d77" stroke-width=".25"/></g><g><path d="M31 55L35 51L35 61L31 65Z" fill="#304558"/><rect x="21" y="55" width="10" height="10" fill="#45627d" stroke="#425d77" stroke-width=".25"/></g><g><path d="M51 55L55 51L55 61L51 65Z" fill="#6c7d8d"/><rect x="41" y="55" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M71 55L75 51L75 61L71 65Z" fill="#6c7d8d"/><rect x="61" y="55" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="1" y="45" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="11" y="45" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="21" y="45" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M31 45L35 41L45 41L41 45Z" fill="#bdcedc"/><rect x="31" y="45" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="41" y="45" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M51 45L55 41L65 41L61 45Z" fill="#bdcedc"/><rect x="51" y="45" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M71 45L75 41L75 51L71 55Z" fill="#6c7d8d"/><rect x="61" y="45" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="1" y="35" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="11" y="35" width="10" height="10" fill="#45627d" stroke="#425d77" stroke-width=".25"/></g><g><path d="M31 35L35 31L35 41L31 45Z" fill="#304558"/><rect x="21" y="35" width="10" height="10" fill="#45627d" stroke="#425d77" stroke-width=".25"/></g><g><path d="M51 35L55 31L55 41L51 45Z" fill="#6c7d8d"/><rect x="41" y="35" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M71 35L75 31L75 41L71 45Z" fill="#6c7d8d"/><rect x="61" y="35" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="1" y="25" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="11" y="25" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="21" y="25" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M31 25L35 21L45 21L41 25Z" fill="#bdcedc"/><rect x="31" y="25" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="41" y="25" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M51 25L55 21L65 21L61 25Z" fill="#bdcedc"/><rect x="51" y="25" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M71 25L75 21L75 31L71 35Z" fill="#6c7d8d"/><rect x="61" y="25" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="1" y="15" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><rect x="11" y="15" width="10" height="10" fill="#45627d" stroke="#425d77" stroke-width=".25"/></g><g><path d="M31 15L35 11L35 21L31 25Z" fill="#304558"/><rect x="21" y="15" width="10" height="10" fill="#45627d" stroke="#425d77" stroke-width=".25"/></g><g><path d="M51 15L55 11L55 21L51 25Z" fill="#6c7d8d"/><rect x="41" y="15" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M71 15L75 11L75 21L71 25Z" fill="#6c7d8d"/><rect x="61" y="15" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M1 5L5 1L15 1L11 5Z" fill="#bdcedc"/><rect x="1" y="5" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M11 5L15 1L25 1L21 5Z" fill="#bdcedc"/><rect x="11" y="5" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M21 5L25 1L35 1L31 5Z" fill="#bdcedc"/><rect x="21" y="5" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M31 5L35 1L45 1L41 5Z" fill="#bdcedc"/><rect x="31" y="5" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M41 5L45 1L55 1L51 5Z" fill="#bdcedc"/><rect x="41" y="5" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M51 5L55 1L65 1L61 5Z" fill="#bdcedc"/><rect x="51" y="5" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g><g><path d="M61 5L65 1L75 1L71 5Z" fill="#bdcedc"/><path d="M71 5L75 1L75 11L71 15Z" fill="#6c7d8d"/><rect x="61" y="5" width="10" height="10" fill="#9ab3c9" stroke="#92aabf" stroke-width=".25"/></g></svg>
@@ -1 +1 @@
1
- import{_n as e}from"./frame-9YY74_9h.js";var t={name:`sticky-note`,size:24,node:[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]};t.node;var n=e(t);export{n as t};
1
+ import{ir as e}from"./frame-3JV5tjBP.js";var t={name:`sticky-note`,size:24,node:[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 66" width="152" height="132" role="img" aria-label="table"><g><rect x="1" y="55" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M11 55L15 51L25 51L21 55Z" fill="#bde6c1"/><rect x="11" y="55" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><rect x="21" y="55" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M31 55L35 51L45 51L41 55Z" fill="#bde6c1"/><rect x="31" y="55" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><rect x="41" y="55" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M51 55L55 51L65 51L61 55Z" fill="#bde6c1"/><rect x="51" y="55" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M71 55L75 51L75 61L71 65Z" fill="#6c9870"/><rect x="61" y="55" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M11 45L15 41L15 51L11 55Z" fill="#6c9870"/><rect x="1" y="45" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M31 45L35 41L35 51L31 55Z" fill="#6c9870"/><rect x="21" y="45" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M51 45L55 41L55 51L51 55Z" fill="#6c9870"/><rect x="41" y="45" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M71 45L75 41L75 51L71 55Z" fill="#6c9870"/><rect x="61" y="45" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><rect x="1" y="35" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M11 35L15 31L25 31L21 35Z" fill="#bde6c1"/><rect x="11" y="35" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><rect x="21" y="35" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M31 35L35 31L45 31L41 35Z" fill="#bde6c1"/><rect x="31" y="35" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><rect x="41" y="35" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M51 35L55 31L65 31L61 35Z" fill="#bde6c1"/><rect x="51" y="35" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M71 35L75 31L75 41L71 45Z" fill="#6c9870"/><rect x="61" y="35" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M11 25L15 21L15 31L11 35Z" fill="#6c9870"/><rect x="1" y="25" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M31 25L35 21L35 31L31 35Z" fill="#6c9870"/><rect x="21" y="25" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M51 25L55 21L55 31L51 35Z" fill="#6c9870"/><rect x="41" y="25" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M71 25L75 21L75 31L71 35Z" fill="#6c9870"/><rect x="61" y="25" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><rect x="1" y="15" width="10" height="10" fill="#2f8a3e" stroke="#2d833b" stroke-width=".25"/></g><g><rect x="11" y="15" width="10" height="10" fill="#2f8a3e" stroke="#2d833b" stroke-width=".25"/></g><g><rect x="21" y="15" width="10" height="10" fill="#2f8a3e" stroke="#2d833b" stroke-width=".25"/></g><g><rect x="31" y="15" width="10" height="10" fill="#2f8a3e" stroke="#2d833b" stroke-width=".25"/></g><g><rect x="41" y="15" width="10" height="10" fill="#2f8a3e" stroke="#2d833b" stroke-width=".25"/></g><g><rect x="51" y="15" width="10" height="10" fill="#2f8a3e" stroke="#2d833b" stroke-width=".25"/></g><g><path d="M71 15L75 11L75 21L71 25Z" fill="#21612b"/><rect x="61" y="15" width="10" height="10" fill="#2f8a3e" stroke="#2d833b" stroke-width=".25"/></g><g><path d="M1 5L5 1L15 1L11 5Z" fill="#bde6c1"/><rect x="1" y="5" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M11 5L15 1L25 1L21 5Z" fill="#bde6c1"/><rect x="11" y="5" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M21 5L25 1L35 1L31 5Z" fill="#bde6c1"/><rect x="21" y="5" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M31 5L35 1L45 1L41 5Z" fill="#bde6c1"/><rect x="31" y="5" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M41 5L45 1L55 1L51 5Z" fill="#bde6c1"/><rect x="41" y="5" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M51 5L55 1L65 1L61 5Z" fill="#bde6c1"/><rect x="51" y="5" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g><g><path d="M61 5L65 1L75 1L71 5Z" fill="#bde6c1"/><path d="M71 5L75 1L75 11L71 15Z" fill="#6c9870"/><rect x="61" y="5" width="10" height="10" fill="#9ad9a0" stroke="#92ce98" stroke-width=".25"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 76" width="192" height="152" role="img" aria-label="terminal"><g><rect x="1" y="65" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M11 65L15 61L25 61L21 65Z" fill="#a1c1f5"/><rect x="11" y="65" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M21 65L25 61L35 61L31 65Z" fill="#a1c1f5"/><rect x="21" y="65" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M31 65L35 61L45 61L41 65Z" fill="#a1c1f5"/><rect x="31" y="65" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M41 65L45 61L55 61L51 65Z" fill="#a1c1f5"/><rect x="41" y="65" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M51 65L55 61L65 61L61 65Z" fill="#a1c1f5"/><rect x="51" y="65" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M61 65L65 61L75 61L71 65Z" fill="#a1c1f5"/><rect x="61" y="65" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M71 65L75 61L85 61L81 65Z" fill="#a1c1f5"/><rect x="71" y="65" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M91 65L95 61L95 71L91 75Z" fill="#4e6fa8"/><rect x="81" y="65" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M11 55L15 51L15 61L11 65Z" fill="#4e6fa8"/><rect x="1" y="55" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M91 55L95 51L95 61L91 65Z" fill="#4e6fa8"/><rect x="81" y="55" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M11 45L15 41L15 51L11 55Z" fill="#4e6fa8"/><rect x="1" y="45" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M21 45L25 41L35 41L31 45Z" fill="#a1c1f5"/><path d="M31 45L35 41L35 51L31 55Z" fill="#4e6fa8"/><rect x="21" y="45" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M51 45L55 41L65 41L61 45Z" fill="#a1c1f5"/><rect x="51" y="45" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M61 45L65 41L75 41L71 45Z" fill="#a1c1f5"/><path d="M71 45L75 41L75 51L71 55Z" fill="#4e6fa8"/><rect x="61" y="45" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M91 45L95 41L95 51L91 55Z" fill="#4e6fa8"/><rect x="81" y="45" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M11 35L15 31L15 41L11 45Z" fill="#4e6fa8"/><rect x="1" y="35" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M31 35L35 31L45 31L41 35Z" fill="#a1c1f5"/><path d="M41 35L45 31L45 41L41 45Z" fill="#4e6fa8"/><rect x="31" y="35" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M91 35L95 31L95 41L91 45Z" fill="#4e6fa8"/><rect x="81" y="35" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M11 25L15 21L15 31L11 35Z" fill="#4e6fa8"/><rect x="1" y="25" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M31 25L35 21L35 31L31 35Z" fill="#4e6fa8"/><rect x="21" y="25" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M91 25L95 21L95 31L91 35Z" fill="#4e6fa8"/><rect x="81" y="25" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><rect x="1" y="15" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><rect x="11" y="15" width="10" height="10" fill="#2a5bbf" stroke="#2856b5" stroke-width=".25"/></g><g><rect x="21" y="15" width="10" height="10" fill="#2a5bbf" stroke="#2856b5" stroke-width=".25"/></g><g><rect x="31" y="15" width="10" height="10" fill="#2a5bbf" stroke="#2856b5" stroke-width=".25"/></g><g><rect x="41" y="15" width="10" height="10" fill="#2a5bbf" stroke="#2856b5" stroke-width=".25"/></g><g><rect x="51" y="15" width="10" height="10" fill="#2a5bbf" stroke="#2856b5" stroke-width=".25"/></g><g><rect x="61" y="15" width="10" height="10" fill="#2a5bbf" stroke="#2856b5" stroke-width=".25"/></g><g><rect x="71" y="15" width="10" height="10" fill="#2a5bbf" stroke="#2856b5" stroke-width=".25"/></g><g><path d="M91 15L95 11L95 21L91 25Z" fill="#4e6fa8"/><rect x="81" y="15" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M1 5L5 1L15 1L11 5Z" fill="#a1c1f5"/><rect x="1" y="5" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M11 5L15 1L25 1L21 5Z" fill="#a1c1f5"/><rect x="11" y="5" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M21 5L25 1L35 1L31 5Z" fill="#a1c1f5"/><rect x="21" y="5" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M31 5L35 1L45 1L41 5Z" fill="#a1c1f5"/><rect x="31" y="5" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M41 5L45 1L55 1L51 5Z" fill="#a1c1f5"/><rect x="41" y="5" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M51 5L55 1L65 1L61 5Z" fill="#a1c1f5"/><rect x="51" y="5" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M61 5L65 1L75 1L71 5Z" fill="#a1c1f5"/><rect x="61" y="5" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M71 5L75 1L85 1L81 5Z" fill="#a1c1f5"/><rect x="71" y="5" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g><g><path d="M81 5L85 1L95 1L91 5Z" fill="#a1c1f5"/><path d="M91 5L95 1L95 11L91 15Z" fill="#4e6fa8"/><rect x="81" y="5" width="10" height="10" fill="#6f9ff0" stroke="#6997e4" stroke-width=".25"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 56" width="152" height="112" role="img" aria-label="ticket"><g><rect x="1" y="45" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><rect x="11" y="45" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><path d="M21 45L25 41L35 41L31 45Z" fill="#f9d9b6"/><rect x="21" y="45" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><rect x="31" y="45" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><path d="M41 45L45 41L55 41L51 45Z" fill="#f9d9b6"/><rect x="41" y="45" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><rect x="51" y="45" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><path d="M71 45L75 41L75 51L71 55Z" fill="#ac8964"/><rect x="61" y="45" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><path d="M1 35L5 31L15 31L11 35Z" fill="#f9d9b6"/><rect x="1" y="35" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><path d="M21 35L25 31L25 41L21 45Z" fill="#8d511d"/><rect x="11" y="35" width="10" height="10" fill="#c9742a" stroke="#bf6e28" stroke-width=".25"/></g><g><path d="M41 35L45 31L45 41L41 45Z" fill="#8d511d"/><rect x="31" y="35" width="10" height="10" fill="#c9742a" stroke="#bf6e28" stroke-width=".25"/></g><g><rect x="51" y="35" width="10" height="10" fill="#c9742a" stroke="#bf6e28" stroke-width=".25"/></g><g><path d="M61 35L65 31L75 31L71 35Z" fill="#f9d9b6"/><path d="M71 35L75 31L75 41L71 45Z" fill="#ac8964"/><rect x="61" y="35" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><rect x="11" y="25" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><path d="M21 25L25 21L35 21L31 25Z" fill="#f9d9b6"/><rect x="21" y="25" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><rect x="31" y="25" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><path d="M41 25L45 21L55 21L51 25Z" fill="#f9d9b6"/><rect x="41" y="25" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><path d="M61 25L65 21L65 31L61 35Z" fill="#ac8964"/><rect x="51" y="25" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><rect x="1" y="15" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><path d="M21 15L25 11L25 21L21 25Z" fill="#8d511d"/><rect x="11" y="15" width="10" height="10" fill="#c9742a" stroke="#bf6e28" stroke-width=".25"/></g><g><path d="M41 15L45 11L45 21L41 25Z" fill="#8d511d"/><rect x="31" y="15" width="10" height="10" fill="#c9742a" stroke="#bf6e28" stroke-width=".25"/></g><g><rect x="51" y="15" width="10" height="10" fill="#c9742a" stroke="#bf6e28" stroke-width=".25"/></g><g><path d="M71 15L75 11L75 21L71 25Z" fill="#ac8964"/><rect x="61" y="15" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><path d="M1 5L5 1L15 1L11 5Z" fill="#f9d9b6"/><rect x="1" y="5" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><path d="M11 5L15 1L25 1L21 5Z" fill="#f9d9b6"/><rect x="11" y="5" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><path d="M21 5L25 1L35 1L31 5Z" fill="#f9d9b6"/><rect x="21" y="5" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><path d="M31 5L35 1L45 1L41 5Z" fill="#f9d9b6"/><rect x="31" y="5" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><path d="M41 5L45 1L55 1L51 5Z" fill="#f9d9b6"/><rect x="41" y="5" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><path d="M51 5L55 1L65 1L61 5Z" fill="#f9d9b6"/><rect x="51" y="5" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g><g><path d="M61 5L65 1L75 1L71 5Z" fill="#f9d9b6"/><path d="M71 5L75 1L75 11L71 15Z" fill="#ac8964"/><rect x="61" y="5" width="10" height="10" fill="#f6c48f" stroke="#eaba88" stroke-width=".25"/></g></svg>
@@ -1 +1 @@
1
- import{_n as e}from"./frame-9YY74_9h.js";var t={name:`trending-down`,size:24,node:[[`path`,{d:`M16 17h6v-6`,key:`t6n2it`}],[`path`,{d:`m22 17-8.5-8.5-5 5L2 7`,key:`x473p`}]]};t.node;var n=e(t),r={name:`trending-up`,size:24,node:[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]};r.node;var i=e(r);export{n,i as t};
1
+ import{ir as e}from"./frame-3JV5tjBP.js";var t={name:`trending-down`,size:24,node:[[`path`,{d:`M16 17h6v-6`,key:`t6n2it`}],[`path`,{d:`m22 17-8.5-8.5-5 5L2 7`,key:`x473p`}]]};t.node;var n=e(t),r={name:`trending-up`,size:24,node:[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]};r.node;var i=e(r);export{n,i as t};
@@ -5,9 +5,9 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <meta name="referrer" content="no-referrer" />
7
7
  <title>ForgeQE</title>
8
- <script type="module" crossorigin src="/assets/index-bN_xd12c.js"></script>
9
- <link rel="modulepreload" crossorigin href="/assets/frame-9YY74_9h.js">
10
- <link rel="stylesheet" crossorigin href="/assets/index-DeACZos_.css">
8
+ <script type="module" crossorigin src="/assets/index-XRjCGJfG.js"></script>
9
+ <link rel="modulepreload" crossorigin href="/assets/frame-3JV5tjBP.js">
10
+ <link rel="stylesheet" crossorigin href="/assets/index-C65qlV-q.css">
11
11
  </head>
12
12
  <body>
13
13
  <div id="root"></div>
package/docs/WEB_APP.md CHANGED
@@ -48,12 +48,14 @@ files: each person's are in their own credential store.
48
48
 
49
49
  ## The layout
50
50
 
51
- - **The sidebar, on the left.** New chat (opens Home, where a chat starts; earlier chats are in Runs); **Test**: Record, Regression, API tests, Quality, Data; **Agents**:
52
- a page for each of ForgeQE's agents (Orchestrator, Browser, Exploration, Planning, Coding, Search, Healing, API, API
51
+ - **The sidebar, on the left.** New chat (opens Home, where a chat starts; earlier chats are in Runs); **Agents**: a
52
+ page for each of ForgeQE's agents (Orchestrator, Browser, Exploration, Planning, Coding, Search, Healing, API, API
53
53
  planning, Review, PR review, Root-cause, Refine, Evaluation, Model-rating, and the Research and Helper agents the
54
- others call), in categories that fold on their own: Lead, Browser, Test code, API, Review and diagnosis, Support; **Results**: Runs, Reports, Jobs; **Context** (what the agents know and follow):
55
- Knowledge, Memory, Guardrails, Skills, Prompts. Each group folds from its title (Agents starts folded), and the
56
- group of the page you are on stays open; and at the bottom What's ready, Help (the docs, the same pages as forgeqe.github.io/docs/ with the architecture map, served by ForgeQE itself, so they work
54
+ others call), in categories that fold on their own: Lead, Browser, Test code, API, Review and diagnosis, Support;
55
+ **Context** (what the agents know and follow): Knowledge, Memory, Guardrails, Skills, Prompts; **Test**: Record,
56
+ Regression, API tests, Quality, Data; **Results**: Runs, Reports, Jobs. Each group folds from its title (Agents
57
+ starts folded), and the group of the page you are on stays open; and at the bottom What's ready, Help (the docs, the
58
+ same pages as forgeqe.github.io/docs/ with the architecture map, served by ForgeQE itself, so they work
57
59
  offline) and Settings. It closes to a narrow rail of its icons (each named when you point at it), with the small logo
58
60
  on top, to give the page the width; on a phone it is a drawer.
59
61
  - **The workspace panel, on the right.** The project, its repository and branch, and the test environment; the context
@@ -69,7 +71,8 @@ Home is one box: say what to test, in your words. Under it, suggestions (Run tes
69
71
  test, Review requirements) fill the box with an example; they do not send.
70
72
 
71
73
  **An agent's page** (Agents, in the sidebar) is the same box with the agent's icon, its name and what it does on
72
- top, suggestions of its own, **Tools it can use** (its own tools with what its permissions take away, and each tool
74
+ top, suggestions of its own, **Tools it can use** (the first five groups, folded, with **Show all** to its tools page,
75
+ `#/agents/<agent>/tools`, which lists every group and tool open; its own tools with what its permissions take away, and each tool
73
76
  server its session gets: the live browser, the code map, databases, ForgeQE's tools, and for the Orchestrator agent
74
77
  every capability and your systems' MCP servers; a group it cannot use here says why), **Connected to** (the test
75
78
  repository, databases, test environments and systems it reaches), its instructions (the prompt it starts from,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capagents/forgeqe",
3
- "version": "2.4.8",
3
+ "version": "2.4.9",
4
4
  "description": "ForgeQE: a browser agent CLI that runs goals and test cases in local Chrome or Chromium, or BrowserStack and TestMu AI/LambdaTest when configured, and turns passing runs into tests in your repo",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{Jt as e,Kn as t,Ln as n,Un as r,Z as i,_n as a,_t as o,an as s,bn as c,ft as l,mt as u,pt as d,r as f,st as p,vt as m,xn as h}from"./frame-9YY74_9h.js";import{a as g,j as _}from"./index-bN_xd12c.js";import{t as v}from"./when-CHnpLdYw.js";import{StatusIcon as y}from"./Runs-CjPA01Rn.js";var b={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};b.node;var x=a(b),S={name:`circle-slash`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]};S.node;var C=a(S),w=t(r(),1),T=d();function E({id:e}){let t=o(e);return t?(0,T.jsx)(g,{agent:t,below:(0,T.jsx)(D,{page:t})},t.id):(0,T.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,T.jsx)(f,{}),(0,T.jsxs)(`p`,{className:`m-0 px-6 py-10 text-sm text-muted`,children:[`There is no such agent. `,(0,T.jsx)(`a`,{href:i(),children:`Start a chat`}),` instead.`]})]})}function D({page:t}){let[r,a]=(0,w.useState)(null),[o,s]=(0,w.useState)([]),[d,f]=(0,w.useState)(null),[p,g]=(0,w.useState)(``);(0,w.useEffect)(()=>{let e=!1;return h.tools(t.agent).then(t=>!e&&f(t),t=>!e&&g(t.message)),n.list().then(n=>!e&&a(n.runs.filter(e=>e.agents.some(e=>t.runs.includes(e.name))).slice(0,6)),()=>!e&&a([])),c.prompts().then(n=>!e&&s(n.agents.filter(e=>t.runs.includes(e.name))),()=>{}),()=>{e=!0}},[t]);let _=m(t.agent).name,b=[...new Set(o.map(e=>e.prompt))];return(0,T.jsxs)(`div`,{className:`flex w-full flex-col gap-6 pt-2`,children:[(0,T.jsxs)(`section`,{"aria-labelledby":`agent-tools`,className:`flex flex-col gap-2`,children:[(0,T.jsx)(`h2`,{id:`agent-tools`,className:`m-0 text-[13px] font-semibold text-muted`,children:`Tools it can use`}),p?(0,T.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:p}):d?(0,T.jsx)(k,{view:d}):(0,T.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Reading its tools…`})]}),d&&d.connections.length>0&&(0,T.jsxs)(`section`,{"aria-labelledby":`agent-connected`,className:`flex flex-col gap-2`,children:[(0,T.jsx)(`h2`,{id:`agent-connected`,className:`m-0 text-[13px] font-semibold text-muted`,children:`Connected to`}),(0,T.jsx)(`ul`,{"aria-labelledby":`agent-connected`,className:`m-0 grid list-none grid-cols-1 gap-2 p-0 sm:grid-cols-2`,children:d.connections.map((e,t)=>(0,T.jsxs)(`li`,{className:u(`flex items-center gap-3 rounded-[12px] border border-line-soft px-3 py-2.5`,!e.on&&`bg-surface-muted`),children:[(0,T.jsx)(l,{name:O[e.kind],px:22,className:u(!e.on&&`opacity-50 grayscale`)}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsx)(`span`,{className:`truncate text-[14px] font-medium`,title:e.name,children:e.name}),(0,T.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.on?e.detail:`Not connected: ${e.why||`not set up`}`})]})]},`${e.kind}:${e.name}:${t}`))})]}),(0,T.jsxs)(`section`,{"aria-labelledby":`agent-prompt`,className:`flex flex-col gap-2`,children:[(0,T.jsx)(`h2`,{id:`agent-prompt`,className:`m-0 text-[13px] font-semibold text-muted`,children:`Its instructions`}),(0,T.jsxs)(`a`,{href:i(`prompts`),className:`flex items-center gap-3 rounded-[12px] border border-line-soft px-4 py-3 text-ink no-underline hover:bg-surface-muted hover:text-ink`,children:[(0,T.jsx)(e,{size:18,strokeWidth:1.8,"aria-hidden":`true`,className:`flex-none text-muted`}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsx)(`span`,{className:`text-[14px] font-medium`,children:b.length?b.map(e=>`${e}.md`).join(`, `):`The prompt it starts from`}),(0,T.jsxs)(`span`,{className:`text-[12.5px] text-muted`,children:[`What the `,_,` starts with, and your team's additions: change them in Prompts.`]})]}),(0,T.jsx)(x,{size:16,"aria-hidden":`true`,className:`flex-none text-muted`})]})]}),(0,T.jsxs)(`section`,{"aria-labelledby":`agent-runs`,className:`flex flex-col gap-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,T.jsx)(`h2`,{id:`agent-runs`,className:`m-0 flex-1 text-[13px] font-semibold text-muted`,children:`Recent runs`}),(0,T.jsx)(`a`,{href:i(`runs`),className:`text-[13px]`,children:`All runs`})]}),r===null?(0,T.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Reading the runs…`}):r.length===0?(0,T.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-3 text-sm text-ink-2`,children:[`The `,_,` has not worked in this project yet.`]}):(0,T.jsx)(`ul`,{"aria-label":`The ${_}'s recent runs`,className:`m-0 flex list-none flex-col rounded-[12px] border border-line-soft p-1.5`,children:r.map(e=>(0,T.jsx)(`li`,{children:(0,T.jsxs)(`a`,{href:i(`runs`,encodeURIComponent(e.name)),className:`flex min-h-11 items-center gap-3 rounded-[8px] px-3 py-1.5 text-ink no-underline hover:bg-surface-muted hover:text-ink`,children:[(0,T.jsx)(y,{status:e.status}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsx)(`span`,{className:`truncate text-[14px] font-medium`,title:e.title,children:e.title}),e.error&&(0,T.jsx)(`span`,{className:`truncate text-[12px] text-fail`,children:e.error})]}),(0,T.jsx)(`span`,{className:`flex-none text-[12.5px] text-muted tabular-nums`,children:v(e.startedAt)})]})},e.name))})]})]})}var O={repository:`branch`,database:`container`,environment:`web`,system:`plug`};function k({view:e}){let[t,n]=(0,w.useState)(()=>e.groups.slice(0,1).map(e=>e.id)),r=e.groups.filter(e=>e.on).length;return(0,T.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,T.jsxs)(`p`,{className:`m-0 text-[12.5px] text-muted`,children:[r,` of `,e.groups.length,` `,e.groups.length===1?`group`:`groups`,` usable here.`]}),(0,T.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] border border-line-soft p-0`,children:e.groups.map((e,r)=>{let i=t.includes(e.id);return(0,T.jsxs)(`li`,{className:u(r>0&&`border-t border-line-soft`),children:[(0,T.jsxs)(`button`,{type:`button`,"aria-expanded":i,"aria-controls":`tools-${r}`,disabled:!e.tools.length,onClick:()=>n(i?t.filter(t=>t!==e.id):[...t,e.id]),className:`flex w-full cursor-pointer items-center gap-3 border-0 bg-transparent px-3 py-2.5 text-left text-ink disabled:cursor-default`,children:[e.on?(0,T.jsx)(_,{size:16,"aria-label":`Usable`,className:`flex-none text-pass`}):(0,T.jsx)(C,{size:16,"aria-label":`Not usable here`,className:`flex-none text-muted`}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsxs)(`span`,{className:`text-[14px] font-medium`,children:[e.label,e.tools.length>0&&(0,T.jsxs)(`span`,{className:`font-normal text-muted`,children:[` · `,e.tools.length]})]}),(0,T.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:e.on?[e.about,e.limited].filter(Boolean).join(` · `):`Not here: ${e.why||`not set up`}`})]}),e.tools.length>0&&(0,T.jsx)(s,{size:16,"aria-hidden":`true`,className:u(`flex-none text-muted transition-transform duration-200`,i&&`rotate-90`)})]}),(0,T.jsx)(p,{open:i,id:`tools-${r}`,children:(0,T.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-1.5 px-3 pb-3 pl-10`,children:e.tools.map(e=>(0,T.jsxs)(`li`,{title:e.what||void 0,className:`rounded-[6px] bg-surface-strong px-2 py-1 font-mono text-[12px] text-ink-2`,children:[e.name,e.what&&(0,T.jsx)(`span`,{className:`ml-1.5 font-sans text-muted`,children:e.what})]},e.name))})})]},e.id)})})]})}export{E as Agent};
@@ -1,2 +0,0 @@
1
- import{Cn as e,Ct as t,G as n,J as r,K as i,Kn as a,Nt as o,Un as s,X as c,Y as l,Z as u,at as d,ct as f,ht as p,in as m,lt as h,mt as g,ot as _,pt as v,r as y,st as b,t as x,wn as S}from"./frame-9YY74_9h.js";import{t as C}from"./circle-dashed-Beydn7Cq.js";import"./markdown-DWLq2XDl.js";import{D as w,E as T,h as E,i as D,j as O,m as k,n as A,r as j,t as M}from"./index-bN_xd12c.js";import{t as N}from"./when-CHnpLdYw.js";var P=a(s(),1),F=v(),I={passed:`pass`,failed:`fail`,error:`fail`,skipped:`neutral`},L={GET:`text-pass`,POST:`text-accent-fg`,PUT:`text-warn`,PATCH:`text-warn`,DELETE:`text-fail`},ee={run:`a browser run's calls`,openapi:`OpenAPI`,swagger:`Swagger`,wsdl:`WSDL`,graphql:`GraphQL`,proto:`.proto`,case:`a test case`,text:`a description`},R=e=>new Date(e).toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`});function z({job:e,onStop:n}){let r=(0,P.useRef)(null);(0,P.useEffect)(()=>{r.current&&(r.current.scrollTop=r.current.scrollHeight)},[e.lines.length]);let[i,a]={contracts:[`Making contracts`,`Made contracts`],run:[`Running the contracts`,`Ran the contracts`],scenarios:[`Making scenarios`,`Made scenarios`],"run-scenarios":[`Running the scenarios`,`Ran the scenarios`]}[e.kind]??[`Working`,`Done`],o=(e.kind===`run`||e.kind===`run-scenarios`)&&e.exitCode===1;return(0,F.jsxs)(`section`,{"aria-label":e.running?i:a,className:`flex flex-col gap-2 rounded-[14px] border border-line-soft p-4`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,F.jsx)(`span`,{className:`flex-1 font-medium`,children:e.running?i:a}),(0,F.jsx)(D,{orb:e.kind===`contracts`?`handing`:e.kind===`scenarios`?`writing`:`working`,tone:e.running?`running`:e.exitCode===0?`pass`:o?`warn`:`fail`,children:e.running?`Working`:e.exitCode===0?`Done`:o?`Some failed`:`Did not finish`}),e.running&&(0,F.jsxs)(h,{onClick:n,className:`border-fail text-fail hover:bg-fail-soft`,children:[(0,F.jsx)(t,{size:14,fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]}),(0,F.jsx)(`code`,{className:`font-mono text-[12px] text-muted [overflow-wrap:anywhere]`,children:e.command}),(0,F.jsxs)(`details`,{open:e.running,children:[(0,F.jsxs)(`summary`,{className:`cursor-pointer text-sm text-muted`,children:[`Output (`,e.lines.length,` lines)`]}),(0,F.jsx)(`pre`,{ref:r,className:`mt-2 max-h-[300px] 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…`})]})]})}var B=({m:e})=>(0,F.jsx)(`span`,{className:g(`w-[58px] flex-none font-mono text-[12px] font-semibold`,L[e.toUpperCase()]||`text-ink-2`),children:e.toUpperCase()});function te({c:e,r:t}){let n=Array.isArray(e.expect.status)?e.expect.status.join(` or `):e.expect.status,r=t&&t.status!==`passed`?[t.reason,...t.checks.filter(e=>!e.ok).map(e=>`${e.name}${e.detail?`: ${e.detail}`:``}`)].filter(Boolean).join(` · `):``;return(0,F.jsxs)(`li`,{className:`grid min-h-11 grid-cols-[58px_minmax(0,1fr)_auto] items-center gap-x-3 rounded-[10px] px-3 py-1.5 hover:bg-surface-muted @3xl:grid-cols-[58px_minmax(0,1fr)_200px_auto]`,children:[(0,F.jsx)(B,{m:e.method}),(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,F.jsx)(`span`,{className:`truncate font-mono text-[13px]`,title:e.protocol===`rest`?e.path:e.name,children:e.protocol===`rest`?e.path:e.name}),r?(0,F.jsx)(`span`,{className:g(`truncate text-[12px]`,t?.status===`skipped`?`text-muted`:`text-fail`),title:r,children:r}):(e.writes||e.needsData?.length)&&(0,F.jsx)(`span`,{className:`truncate text-[12px] text-warn`,children:[e.writes?`Changes data`:``,e.needsData?.length?`Needs real ${e.needsData.join(`, `)}`:``].filter(Boolean).join(` · `)})]}),(0,F.jsx)(`span`,{className:`hidden truncate text-[12px] text-muted @3xl:block`,children:[n?`expects ${n}`:``,e.expect.contentType,e.auth?`${e.auth.type} auth`:``].filter(Boolean).join(` · `)}),(0,F.jsx)(`span`,{className:`flex justify-end`,children:t?(0,F.jsx)(D,{tone:I[t.status],children:t.status===`skipped`?`Skipped`:t.httpStatus?`${t.httpStatus}`:t.status}):(0,F.jsx)(`span`,{className:`text-[12px] text-muted`,children:`Not run`})})]})}function ne({s:e,r:t}){let[n,r]=(0,P.useState)(!1);return(0,F.jsxs)(`li`,{className:`border-t border-line-soft first:border-t-0`,children:[(0,F.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>r(!n),className:`flex min-h-[52px] w-full cursor-pointer items-center gap-3 border-0 bg-transparent px-1 py-2 text-left text-ink hover:bg-surface-muted`,children:[(0,F.jsx)(k,{size:16,"aria-hidden":`true`,className:`flex-none text-muted`}),(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,F.jsx)(`span`,{className:`text-sm [overflow-wrap:anywhere]`,children:e.name}),(0,F.jsxs)(`span`,{className:`truncate text-[12px] text-muted`,children:[e.kind,` · `,e.steps.length,` step`,e.steps.length===1?``:`s`,e.cleanup?.length?` · ${e.cleanup.length} cleanup`:``,e.caseId?` · ${e.caseId}`:``]})]}),e.writes&&(0,F.jsx)(D,{tone:`warn`,children:`Changes data`}),t&&(0,F.jsx)(D,{tone:I[t.status],children:t.status.charAt(0).toUpperCase()+t.status.slice(1)})]}),(0,F.jsx)(b,{open:n,children:(0,F.jsxs)(`ol`,{className:`m-0 mb-3 ml-8 flex list-none flex-col gap-1 border-l border-line pl-3 text-sm`,children:[e.steps.map((e,n)=>{let r=t?.steps[n];return(0,F.jsxs)(`li`,{className:`flex flex-col`,children:[(0,F.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,F.jsx)(B,{m:e.method}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 font-mono text-[12px] [overflow-wrap:anywhere]`,children:e.path}),r&&(0,F.jsx)(D,{tone:I[r.status],children:r.httpStatus?String(r.httpStatus):r.status})]}),(0,F.jsxs)(`span`,{className:`pl-[66px] text-[12px] text-muted`,children:[e.name,e.save&&Object.keys(e.save).length?` · keeps ${Object.keys(e.save).join(`, `)}`:``,e.noAuth?` · without credentials`:``]}),r&&r.checks.some(e=>!e.ok)&&(0,F.jsx)(`span`,{className:`pl-[66px] text-[12px] text-fail`,children:r.checks.filter(e=>!e.ok).map(e=>`${e.name}${e.detail?`: ${e.detail}`:``}`).join(` · `)})]},n)}),e.cleanup?.map((e,t)=>(0,F.jsxs)(`li`,{className:`flex items-center gap-2 text-muted`,children:[(0,F.jsx)(B,{m:e.method}),(0,F.jsx)(`span`,{className:`font-mono text-[12px]`,children:e.path}),(0,F.jsx)(`span`,{className:`text-[12px]`,children:`cleanup`})]},`c${t}`)),t?.reason&&(0,F.jsx)(`li`,{className:`text-[12px] text-fail [overflow-wrap:anywhere]`,children:t.reason})]})})]})}function V({what:e,writes:t,defaultUrl:r,onRun:i,onCancel:a,needsData:s}){let[c,l]=(0,P.useState)(r),[u,f]=(0,P.useState)(!1),[p,m]=(0,P.useState)(!1);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-[12px] border border-accent-line bg-accent-soft p-4`,children:[(0,F.jsx)(`span`,{className:`font-medium`,children:e}),(0,F.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[`Against`,(0,F.jsx)(n,{value:c,spellCheck:!1,placeholder:`https://qa.example.com/api`,onChange:e=>l(e.target.value),className:`max-w-[480px] bg-bg`})]}),t>0&&(0,F.jsxs)(`span`,{className:`flex items-start gap-3 text-sm`,children:[(0,F.jsx)(d,{checked:u,onChange:f,label:`Also run the calls that change data`}),(0,F.jsxs)(`span`,{className:`flex flex-col`,children:[`Also run the `,t,` call`,t===1?``:`s`,` that change data`,(0,F.jsx)(`span`,{className:`text-[13px] text-warn`,children:`Only on a test environment: they create, change or delete data there.`})]})]}),s?(0,F.jsxs)(`span`,{className:`flex items-center gap-3 text-sm`,children:[(0,F.jsx)(d,{checked:p,onChange:m,label:`Also run calls with made-up values`}),`Also run the `,s,` call`,s===1?``:`s`,` whose values were made up`]}):null,(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,F.jsxs)(h,{variant:`primary`,onClick:()=>i({...c.trim()?{baseUrl:c.trim()}:{},allowWrites:u,includeNeedsData:p}),children:[(0,F.jsx)(o,{size:16,"aria-hidden":`true`}),`Run`]}),(0,F.jsx)(h,{onClick:a,children:`Don't run`})]})]})}function re({open:e,onClose:t,view:a,set:o,onMake:s,busy:c}){let[l,u]=(0,P.useState)(`spec`),[f,m]=(0,P.useState)(``),[_,v]=(0,P.useState)(``),[y,b]=(0,P.useState)(``),[x,S]=(0,P.useState)(!0);(0,P.useEffect)(()=>{e&&(u(o.source.kind===`run`?`run`:`spec`),m(o.source.kind===`run`?``:a.runs[0]?.id??``))},[e,o.source.kind,a.runs]);let C=(e,t,n)=>(0,F.jsxs)(`label`,{className:g(`flex cursor-pointer items-start gap-3 rounded-[12px] border px-3 py-2.5`,l===e?`border-accent bg-accent-soft`:`border-line-soft hover:bg-surface-muted`),children:[(0,F.jsx)(`input`,{type:`radio`,name:`sc-from`,checked:l===e,onChange:()=>u(e),className:`mt-1 size-4 accent-accent`}),(0,F.jsxs)(`span`,{className:`flex flex-col`,children:[(0,F.jsx)(`span`,{className:`text-sm font-medium`,children:t}),(0,F.jsx)(`span`,{className:`text-[13px] text-muted`,children:n})]})]});return(0,F.jsx)(r,{open:e,onClose:t,title:`Make scenarios`,description:`API calls in order, where later calls use values earlier answers gave, added to ${o.name}. Nothing runs until you run them.`,footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(h,{onClick:t,children:`Cancel`}),(0,F.jsx)(h,{variant:`primary`,disabled:c||l===`cases`&&!_.trim()||l===`text`&&!y.trim(),onClick:()=>s({from:l,...l===`run`&&f?{run:f}:{},...l===`cases`?{cases:_}:{},...l===`text`?{text:y}:{},...l===`spec`?{negative:x}:{}}),children:`Make scenarios`})]}),children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 pt-3`,children:[C(`spec`,`From the API description`,`Each resource's lifecycle, browsing, the description's links, and negative cases (no model)`),l===`spec`&&(0,F.jsxs)(`span`,{className:`flex items-center gap-2 pl-10 text-sm`,children:[(0,F.jsx)(d,{checked:x,onChange:S,label:`Negative cases`}),` Negative cases: an id that does not exist, no credentials, an empty body`]}),C(`run`,`From a browser run`,`The calls the application made, in order, with the values passed on (no model)`),l===`run`&&(0,F.jsxs)(i,{"aria-label":`Browser run`,value:f,onChange:e=>m(e.target.value),className:`ml-10 max-w-[440px]`,children:[(0,F.jsx)(`option`,{value:``,children:`The latest run`}),a.runs.map(e=>(0,F.jsxs)(`option`,{value:e.id,children:[e.goal,` · `,p(e.calls,`call`),` · `,R(e.at)]},e.id))]}),C(`cases`,`From test cases`,`One scenario per case, planned by the model against the set's operations`),l===`cases`&&(0,F.jsx)(n,{"aria-label":`Test cases`,value:_,spellCheck:!1,placeholder:`ado:2238, jira:SHOP-12`,onChange:e=>v(e.target.value),className:`ml-10 max-w-[440px]`}),C(`text`,`From a description`,`In plain words, planned by the model; a step no operation does is listed, never invented`),l===`text`&&(0,F.jsx)(n,{"aria-label":`The scenario`,value:y,maxLength:1e3,placeholder:`Create a user, log in, add two items, check out, the total is the sum`,onChange:e=>b(e.target.value),className:`ml-10`})]})})}function H({open:e,onClose:t,view:a,onMake:o,busy:s}){let[c,l]=(0,P.useState)(`spec`),[u,d]=(0,P.useState)(``),[f,m]=(0,P.useState)(``),[g,_]=(0,P.useState)(``),[v,y]=(0,P.useState)(``);return(0,P.useEffect)(()=>{e&&(d(a.specs[0]??``),m(``),_(``),y(a.baseUrl??``),l(a.specs.length||!a.runs.length?`spec`:`run`))},[e,a]),(0,F.jsx)(r,{open:e,onClose:t,title:`New contract set`,description:`One contract per operation: an example call and what its answer must have (status, content type, schema, key fields). Making them runs nothing.`,footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(h,{onClick:t,children:`Cancel`}),(0,F.jsx)(h,{variant:`primary`,disabled:s||c===`spec`&&!u.trim(),onClick:()=>o({from:c,...c===`spec`?{spec:u.trim()}:f?{run:f}:{},...g.trim()?{name:g.trim()}:{},...v.trim()?{baseUrl:v.trim()}:{}}),children:`Make contracts`})]}),children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-4 pt-3`,children:[(0,F.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,F.jsx)(`legend`,{className:`mb-1.5 text-sm font-medium`,children:`From`}),(0,F.jsxs)(`label`,{className:`flex min-h-9 cursor-pointer items-center gap-2 text-sm`,children:[(0,F.jsx)(`input`,{type:`radio`,name:`set-from`,checked:c===`spec`,onChange:()=>l(`spec`),className:`size-4 accent-accent`}),`An API description: OpenAPI or Swagger, WSDL, GraphQL, .proto, or grpc://`]}),c===`spec`&&(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5 pl-6`,children:[(0,F.jsx)(n,{"aria-label":`API description`,value:u,spellCheck:!1,list:`spec-files`,placeholder:`https://shop.test/openapi.json, or a file in the project`,onChange:e=>d(e.target.value)}),(0,F.jsx)(`datalist`,{id:`spec-files`,children:a.specs.map(e=>(0,F.jsx)(`option`,{value:e},e))}),a.specs.length>0&&(0,F.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`In this project: `,a.specs.slice(0,6).join(`, `)]})]}),(0,F.jsxs)(`label`,{className:`flex min-h-9 cursor-pointer items-center gap-2 text-sm`,children:[(0,F.jsx)(`input`,{type:`radio`,name:`set-from`,checked:c===`run`,onChange:()=>l(`run`),className:`size-4 accent-accent`}),`The calls a browser run saw the application make`]}),c===`run`&&(0,F.jsxs)(i,{"aria-label":`Browser run`,value:f,onChange:e=>m(e.target.value),className:`ml-6 max-w-[440px]`,children:[(0,F.jsx)(`option`,{value:``,children:`The latest run`}),a.runs.map(e=>(0,F.jsxs)(`option`,{value:e.id,children:[e.goal,` · `,p(e.calls,`call`),` · `,R(e.at)]},e.id))]})]}),(0,F.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm font-medium`,children:[`Name`,(0,F.jsx)(n,{value:g,maxLength:120,placeholder:`Petstore`,onChange:e=>_(e.target.value)})]}),(0,F.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm font-medium`,children:[`Base URL`,(0,F.jsx)(n,{value:v,spellCheck:!1,placeholder:`https://qa.shop.test/api`,onChange:e=>y(e.target.value)}),(0,F.jsxs)(`span`,{className:`text-[13px] font-normal text-muted`,children:[`Where the contracts run when not where they were recorded or described.`,a.headers.length?` Each call sends ${a.headers.join(`, `)} from api.headers in forgeqe.yaml.`:` Credentials go in api.headers in forgeqe.yaml, as references to environment variables.`]})]})]})})}var U=50,ie=e=>e.length>48?`…/${e.split(/[\\/]/).filter(Boolean).slice(-2).join(`/`)}`:e;function W({label:e,last:t,onOpen:n}){if(!t)return(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[13px] text-muted`,children:[(0,F.jsx)(C,{size:14,"aria-hidden":`true`}),e,`: not run yet`]});let r=t.counts.failed+t.counts.error,i=t.counts.passed+r;return(0,F.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-x-1.5 text-[13px] text-ink-2`,children:[r?(0,F.jsx)(m,{size:14,"aria-label":`Failures`,className:`text-fail`}):(0,F.jsx)(O,{size:14,"aria-label":`Passed`,className:`text-pass`}),e,`:`,` `,(0,F.jsxs)(`b`,{className:g(`tabular-nums`,r?`text-fail`:`text-ink`),children:[t.counts.passed,`/`,i,` passed`]}),t.counts.skipped?(0,F.jsxs)(`span`,{className:`text-muted`,children:[`· `,t.counts.skipped,` skipped`]}):null,(0,F.jsxs)(`span`,{className:`text-muted`,children:[`· `,N(t.at)]}),t.report&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>n(t.report),className:`cursor-pointer border-0 bg-transparent p-0 text-[13px] text-accent-fg hover:underline`,children:`· Report`})]})}function G({id:t,view:n,busy:r,act:i,version:a}){let[s,c]=(0,P.useState)(null),[d,f]=(0,P.useState)(``),[m,_]=(0,P.useState)(null),[v,y]=(0,P.useState)(!1),[b,x]=(0,P.useState)(``),[C,w]=(0,P.useState)(`contracts`),[D,O]=(0,P.useState)(``),[k,N]=(0,P.useState)(`all`),[I,L]=(0,P.useState)(0);(0,P.useEffect)(()=>{let n=!1;return e.set(t).then(e=>!n&&(c(e),f(``)),e=>!n&&f(e.message)),()=>{n=!0}},[t,a]),(0,P.useEffect)(()=>{_(null),w(`contracts`),O(``),N(`all`)},[t]),(0,P.useEffect)(()=>L(0),[t,C,D,k]);let z=(0,P.useMemo)(()=>new Map((s?.last.contracts?.results??[]).map(e=>[e.id,e])),[s]),B=(0,P.useMemo)(()=>new Map((s?.last.scenarios?.results??[]).map(e=>[e.id,e])),[s]);if(d)return(0,F.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:d});if(!s)return(0,F.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Loading…`});let H=s.contracts.filter(e=>e.writes).length,G=s.contracts.filter(e=>e.needsData?.length).length,K=s.scenarios??[],q=s.last.contracts,ae=s.last.scenarios,J=n.baseUrl||s.baseUrl||``,Y=async e=>x(await l(e)),oe=async e=>{try{let{id:t}=await S.start(`Write the API contracts${e?` and scenarios`:``} of set ${s.id} as tests in the repository: call write_api_tests with set_id ${s.id}${e?` and scenarios ["all"]`:``}. Show me the plan before you write.`,{});location.hash=u(`chats`,t)}catch(e){x(e.message)}},X=e=>{let t=z.get(e.id);return!!t&&(t.status===`failed`||t.status===`error`)},Z=D.toLowerCase().split(/\s+/).filter(Boolean),Q=s.contracts.filter(e=>Z.every(t=>`${e.method} ${e.path} ${e.name}`.toLowerCase().includes(t))),se=[{id:`all`,label:`All`,n:Q.length},{id:`failed`,label:`Failed`,n:Q.filter(X).length,alert:!0},...H?[{id:`writes`,label:`Changes data`,n:Q.filter(e=>e.writes).length}]:[],...q?[{id:`unrun`,label:`Not run`,n:Q.filter(e=>!z.has(e.id)).length}]:[]],$=[...Q.filter(e=>k===`failed`?X(e):k===`writes`?e.writes:k!==`unrun`||!z.has(e.id))].sort((e,t)=>Number(X(t))-Number(X(e))),ce=K.filter(e=>Z.every(t=>e.name.toLowerCase().includes(t)));return(0,F.jsxs)(`section`,{"aria-labelledby":`set-h`,className:`flex min-w-0 flex-1 flex-col gap-4`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(`h2`,{id:`set-h`,className:`m-0 text-[22px] font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:s.name}),(0,F.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 text-[13px] text-muted`,children:[(0,F.jsxs)(`span`,{children:[`From `,ee[s.source.kind]||s.source.kind,` `,(0,F.jsx)(`span`,{className:`font-mono text-[12px]`,title:s.source.ref,children:ie(s.source.ref)})]}),`· `,(0,F.jsx)(`span`,{children:R(s.createdAt)}),s.baseUrl&&(0,F.jsxs)(F.Fragment,{children:[`· `,(0,F.jsx)(`span`,{className:`font-mono text-[12px] [overflow-wrap:anywhere]`,children:s.baseUrl})]})]})]}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsxs)(h,{variant:`primary`,size:`sm`,disabled:r||!s.contracts.length,onClick:()=>_(`contracts`),children:[(0,F.jsx)(o,{size:15,"aria-hidden":`true`}),`Run contracts`]}),(0,F.jsxs)(h,{size:`sm`,disabled:r||!K.length,onClick:()=>_(`scenarios`),children:[(0,F.jsx)(o,{size:15,"aria-hidden":`true`}),`Run scenarios`]}),(0,F.jsxs)(h,{size:`sm`,disabled:r,onClick:()=>y(!0),children:[(0,F.jsx)(T,{size:15,"aria-hidden":`true`}),`Make scenarios`]}),(0,F.jsxs)(h,{size:`sm`,variant:`ghost`,onClick:()=>void oe(K.length>0),children:[(0,F.jsx)(E,{size:15,"aria-hidden":`true`}),`Write them as tests`]})]}),b&&(0,F.jsx)(`p`,{className:`m-0 text-[13px] text-fail`,children:b}),m===`contracts`&&(0,F.jsx)(V,{what:`Run ${s.contracts.length} contract${s.contracts.length===1?``:`s`}`,writes:H,needsData:G,defaultUrl:J,onCancel:()=>_(null),onRun:t=>{_(null),i(()=>e.run(s.id,t))}}),m===`scenarios`&&(0,F.jsx)(V,{what:`Run ${K.length} scenario${K.length===1?``:`s`}`,writes:K.filter(e=>e.writes).length,defaultUrl:J,onCancel:()=>_(null),onRun:t=>{_(null),i(()=>e.runScenarios(s.id,{...t.baseUrl?{baseUrl:t.baseUrl}:{},allowWrites:t.allowWrites}))}}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-[12px] bg-surface-muted px-4 py-2.5`,children:[(0,F.jsx)(W,{label:`Contracts`,last:q,onOpen:e=>void Y(e)}),K.length>0&&(0,F.jsx)(W,{label:`Scenarios`,last:ae,onOpen:e=>void Y(e)})]}),(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-col rounded-[14px] border border-line-soft bg-bg`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-line-soft px-3 py-2.5`,children:[(0,F.jsx)(`div`,{role:`tablist`,"aria-label":`In this set`,className:`flex gap-1 rounded-[10px] bg-surface-strong p-1`,children:[[`contracts`,`Contracts`,s.contracts.length],[`scenarios`,`Scenarios`,K.length]].map(([e,t,n])=>(0,F.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":C===e,onClick:()=>w(e),className:g(`inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-[7px] border-0 px-3 text-sm font-medium`,C===e?`bg-bg text-ink shadow-sm`:`bg-transparent text-muted hover:text-ink`),children:[t,(0,F.jsx)(`span`,{className:`text-[12px] text-muted tabular-nums`,children:n})]},e))}),(0,F.jsx)(j,{id:`api-search`,label:C===`contracts`?`Find a call`:`Find a scenario`,placeholder:C===`contracts`?`Find a call by its path`:`Find a scenario`,value:D,onChange:O})]}),C===`contracts`?(0,F.jsxs)(F.Fragment,{children:[se.length>1&&(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5 px-3 pt-2.5`,children:(0,F.jsx)(M,{items:se,value:k,onChange:N})}),(0,F.jsxs)(`ul`,{"aria-label":`Contracts`,className:`@container m-0 flex list-none flex-col p-1.5`,children:[$.length===0&&(0,F.jsx)(`li`,{className:`px-3 py-4 text-sm text-muted`,children:s.contracts.length?`Nothing matches.`:`This set has no contracts.`}),$.slice(I*U,I*U+U).map(e=>(0,F.jsx)(te,{c:e,r:z.get(e.id)},e.id))]}),(0,F.jsx)(A,{page:I,size:U,total:$.length,onPage:L,label:`Pages of contracts`,children:s.skipped?.length?(0,F.jsxs)(`span`,{title:s.skipped.join(`; `),children:[` · `,p(s.skipped.length,`operation`),` left out`]}):null})]}):K.length?(0,F.jsxs)(`ul`,{"aria-label":`Scenarios`,className:`m-0 flex list-none flex-col px-3 py-1.5`,children:[ce.length===0&&(0,F.jsx)(`li`,{className:`py-4 text-sm text-muted`,children:`Nothing matches.`}),ce.map(e=>(0,F.jsx)(ne,{s:e,r:B.get(e.id)},e.id))]}):(0,F.jsxs)(`div`,{className:`flex flex-col items-start gap-2 px-4 py-5`,children:[(0,F.jsx)(`span`,{className:`text-sm text-muted`,children:`No scenarios yet. A scenario chains calls end to end, each using what the one before answered.`}),(0,F.jsxs)(h,{size:`sm`,disabled:r,onClick:()=>y(!0),children:[(0,F.jsx)(T,{size:15,"aria-hidden":`true`}),`Make scenarios`]})]})]}),(0,F.jsx)(re,{open:v,onClose:()=>y(!1),view:n,set:s,busy:r,onMake:t=>{y(!1),i(()=>e.scenarios(s.id,t))}})]})}function K({sub:t}){let[n,r]=(0,P.useState)(null),[i,a]=(0,P.useState)(``),[o,s]=(0,P.useState)(!1),[l,d]=(0,P.useState)(!1),v=(0,P.useCallback)(()=>{e.view().then(e=>{r(e),a(``)},e=>a(e.message))},[]);(0,P.useEffect)(v,[v]);let b=!!n?.job?.running;(0,P.useEffect)(()=>{if(!b)return;let e=setInterval(v,1500);return()=>clearInterval(e)},[b,v]);let S=async e=>{s(!0),a(``);try{await e(),v()}catch(e){a(e.message)}finally{s(!1)}},E=t?decodeURIComponent(t):``,D=n?.sets.find(e=>e.id===E)||n?.sets[0],k=`${n?.job?.endedAt??``}|${D?.at??``}`,[A,M]=(0,P.useState)(``),I=(n?.sets??[]).filter(e=>A.toLowerCase().split(/\s+/).filter(Boolean).every(t=>e.name.toLowerCase().includes(t)));return(0,F.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,F.jsx)(y,{}),(0,F.jsxs)(`main`,{className:g(x,`@container flex-auto gap-4`),children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,F.jsx)(_,{pixel:c[`api-tests`],size:`lg`}),(0,F.jsx)(`h1`,{className:`m-0 flex-1 text-[26px] font-semibold tracking-[-0.01em]`,children:`API tests`}),(0,F.jsxs)(h,{variant:`primary`,disabled:!n||b,onClick:()=>d(!0),children:[(0,F.jsx)(T,{size:16,"aria-hidden":`true`}),`New contract set`]})]}),(0,F.jsx)(`p`,{className:`m-0 max-w-[74ch] text-sm leading-relaxed text-muted`,children:`REST, GraphQL, SOAP and gRPC, tested straight against the API with no browser and no model. A contract is one call and what its answer must have; a scenario chains calls end to end.`}),i&&(0,F.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i}),!n&&!i&&(0,F.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),n?.job&&(0,F.jsx)(z,{job:n.job,onStop:()=>S(()=>e.stop())}),n&&(n.sets.length?(0,F.jsxs)(`div`,{className:`flex flex-col gap-6 @2xl:flex-row @2xl:items-start @2xl:gap-8`,children:[(0,F.jsxs)(`nav`,{"aria-label":`Contract sets`,className:`flex min-w-0 flex-col gap-2 @2xl:sticky @2xl:top-6 @2xl:w-[280px] @2xl:flex-none`,children:[(0,F.jsxs)(`span`,{className:`px-1 text-[13px] font-medium text-muted`,children:[`Contract sets (`,n.sets.length,`)`]}),n.sets.length>6&&(0,F.jsx)(j,{id:`set-search`,label:`Find a set`,value:A,onChange:M,className:`flex-none`}),(0,F.jsxs)(`ul`,{className:`m-0 flex max-h-[60vh] list-none flex-col overflow-y-auto p-0 @2xl:max-h-[calc(100vh-240px)]`,children:[I.length===0&&(0,F.jsx)(`li`,{className:`px-3 py-3 text-sm text-muted`,children:`Nothing matches.`}),I.map(e=>{let t=e.last?.contracts,r=!!t&&t.counts.failed+t.counts.error>0;return(0,F.jsx)(`li`,{children:(0,F.jsxs)(`a`,{href:u(`api-tests`,encodeURIComponent(e.id)),"aria-current":D?.id===e.id?`page`:void 0,className:g(`flex min-h-12 items-center gap-2.5 rounded-[10px] px-3 py-1.5 text-ink no-underline`,D?.id===e.id?`bg-surface-strong hover:text-ink`:`hover:bg-surface-muted hover:text-ink`),children:[n?.job?.running&&n.job.target===e.id?(0,F.jsx)(f,{state:`working`,label:`Working on it`,px:16}):t?r?(0,F.jsx)(m,{size:16,"aria-label":`Failures`,className:`flex-none text-fail`}):(0,F.jsx)(O,{size:16,"aria-label":`Passed`,className:`flex-none text-pass`}):(0,F.jsx)(C,{size:16,"aria-label":`Not run`,className:`flex-none text-muted`}),(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,F.jsx)(`span`,{className:`truncate text-[14px] font-medium`,children:e.name}),(0,F.jsxs)(`span`,{className:`truncate text-[12px] text-muted`,children:[p(e.contracts,`contract`),e.scenarios?` · ${p(e.scenarios,`scenario`)}`:``,t?` · ${t.counts.passed}/${t.counts.passed+t.counts.failed+t.counts.error} passed`:``]})]}),(0,F.jsx)(`span`,{className:`flex-none text-[12px] text-muted tabular-nums`,children:N(e.at)})]})},e.id)})]})]}),D&&(0,F.jsx)(G,{id:D.id,view:n,busy:o||b,act:S,version:k})]}):(0,F.jsxs)(`div`,{className:`flex flex-col items-start gap-3 rounded-[18px] border border-line p-6`,children:[(0,F.jsx)(w,{size:24,"aria-hidden":`true`,className:`text-muted`}),(0,F.jsxs)(`p`,{className:`m-0 max-w-[62ch] leading-relaxed text-ink-2`,children:[`No API contracts yet. Make a set from your OpenAPI, Swagger, WSDL, GraphQL or .proto description`,n.runs.length?`, or from the ${p(n.runs[0].calls,`call`)} the run "${n.runs[0].goal}" saw`:``,`.`]}),(0,F.jsx)(h,{onClick:()=>d(!0),children:`New contract set`})]}))]}),n&&(0,F.jsx)(H,{open:l,onClose:()=>d(!1),view:n,busy:o||b,onMake:t=>S(async()=>{await e.contracts(t),d(!1)})})]})}export{K as ApiTests};
@@ -1,3 +0,0 @@
1
- import{G as e,Kn as t,Sn as n,Un as r,X as i,Z as a,_n as o,ht as s,lt as c,mt as l,n as u,o as d,ot as f,pt as p,r as m,t as h,ut as g,wn as _}from"./frame-9YY74_9h.js";import{n as v,r as y}from"./Response-BfwCLngt.js";import{C as b,b as x,c as S,d as C,f as w,i as T,l as E,o as D,p as O,s as ee,u as te,x as ne,y as k}from"./index-bN_xd12c.js";import{n as A,t as j}from"./when-CHnpLdYw.js";var M={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};M.node;var re=o(M),N=t(r(),1),P=p();function F({id:e}){let[t,r]=(0,N.useState)([]),[i,o]=(0,N.useState)(null),[s,f]=(0,N.useState)(``),[p,m]=(0,N.useState)(``),[h,b]=(0,N.useState)(!1),T=(0,N.useRef)(null),k=(0,N.useRef)(null),A=(0,N.useRef)(!0),[j,M]=(0,N.useState)(!0);(0,N.useEffect)(()=>{let t=!1,n=0;return r([]),o(null),f(``),(async()=>{for(;!t;)try{let i=await _.events(e,n,n>0);if(t||(f(``),o({title:i.title,state:i.state,profile:i.profile}),i.events.length&&(n=i.events[i.events.length-1].n,r(e=>[...e,...i.events])),(i.state===`closed`||i.state===`failed`)&&!i.events.length))return}catch(e){if(t||(f(e.message),e.status===404))return;await new Promise(e=>setTimeout(e,2e3))}})(),()=>{t=!0}},[e]);let F=(0,N.useMemo)(()=>y(t),[t]),I=(0,N.useMemo)(()=>{let e=new Map;for(let t of F.turns.flatMap(e=>e.changes)){let n=e.get(t.path);e.set(t.path,n?{...n,added:n.added+t.added,removed:n.removed+t.removed}:{path:t.path,added:t.added,removed:t.removed})}return[...e.values()]},[F]),L=(0,N.useMemo)(()=>{let e=[];for(let t of F.turns){for(let n of t.tests)n.testFile&&e.push({label:n.ok?`Test`:`Test (failed)`,path:n.testFile,kind:`test`});for(let n of t.reports)e.push({label:/\.html?$/i.test(n.path)?`Report`:`Run report`,path:n.path,kind:`report`})}return e.filter((t,n)=>e.findIndex(e=>e.path===t.path)===n)},[F]),R=(0,N.useRef)(()=>{});d(F.context||F.usage||I.length||L.length?{context:F.context,usage:F.usage,model:F.model?.name,changes:I,outputs:L,busy:i?.state===`busy`||i?.state===`starting`,...I.length?{onCreatePr:()=>R.current()}:{}}:null);let z=i?.state,B=z===`busy`||z===`starting`,V=z===`closed`||z===`failed`,H=F.turns.at(-1),U=!!H&&!H.outcome&&(H.asks.some(e=>e.answer===void 0)||H.waits.some(e=>e.answer===void 0));(0,N.useEffect)(()=>{let e=document.documentElement,t=()=>window.innerHeight+window.scrollY>=e.scrollHeight-48,n=e=>{A.current=e,M(e)},r=window.scrollY,i=()=>{t()?n(!0):window.scrollY<r-2&&n(!1),r=window.scrollY},a=new ResizeObserver(()=>{A.current&&!t()&&window.scrollTo({top:e.scrollHeight,behavior:`instant`})});return T.current&&a.observe(T.current),k.current&&a.observe(k.current),window.addEventListener(`scroll`,i,{passive:!0}),()=>{a.disconnect(),window.removeEventListener(`scroll`,i)}},[]);let ie=()=>{A.current=!0,M(!0),window.scrollTo({top:document.documentElement.scrollHeight,behavior:`smooth`})},[W,G]=(0,N.useState)(null);(0,N.useEffect)(()=>void n.settings().then(G,()=>{}),[]);let[K,q]=(0,N.useState)(!1),[J,Y]=(0,N.useState)({});(0,N.useEffect)(()=>Y({}),[F.headed,F.writeTests]);let X={...ee(W),headed:J.headed??F.headed??!1,code:J.code??F.writeTests??!0},Z=(0,N.useCallback)(async e=>{try{await e()}catch(e){f(e.message)}},[]),Q=C(`chat-${e}`.replace(/[^\w-]/g,``).slice(0,80),e=>{m(e),te(`reply`)}),$=async t=>{if(t.trim()&&!h){b(!0),A.current=!0,M(!0);try{await _.send(e,t.trim()),m(``),f(``),Q.close()}catch(e){f(e.message)}finally{b(!1)}}};return R.current=()=>{if(i?.state===`busy`||i?.state===`starting`||h)return;let e=I.map(e=>`- ${e.path}`).join(`
2
- `);$(`Open a pull request with the changes you made in this chat:\n${e}\n\nUse a new branch, a clear title and description, and tell me its link.`)},(0,P.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,P.jsxs)(`header`,{className:`sticky top-0 z-20 flex items-center gap-1 border-b border-line-soft bg-bg py-3 pr-16 pl-5 md:pr-5`,children:[(0,P.jsx)(u,{}),(0,P.jsx)(`h1`,{className:`m-0 ml-2 min-w-0 flex-1 truncate text-base font-semibold`,children:i?.title||`Chat`}),F.model&&(0,P.jsxs)(`span`,{className:`hidden min-h-9 items-center gap-1.5 rounded-lg px-2 text-sm text-ink-2 sm:inline-flex`,title:`The model this chat uses`,children:[(0,P.jsx)(x,{size:14,fill:`currentColor`,"aria-hidden":`true`,className:`text-accent-fg`}),F.model.name]})]}),(0,P.jsxs)(`main`,{ref:T,className:`mx-auto box-border flex w-full max-w-[960px] flex-auto flex-col gap-8 px-6 pt-8 pb-6`,children:[!i&&!s&&(0,P.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Opening the chat…`}),F.turns.map((t,n)=>(0,P.jsxs)(`section`,{"aria-label":`Message ${n+1}`,className:`flex flex-col gap-5`,children:[(0,P.jsx)(`div`,{className:`ml-auto max-w-[min(85%,640px)] rounded-[18px] bg-surface-strong px-4 py-2.5 text-[15px] leading-relaxed whitespace-pre-wrap text-ink [overflow-wrap:anywhere]`,children:t.user}),(0,P.jsx)(v,{turn:t,live:n===F.turns.length-1&&!V,onAnswer:(t,n)=>Z(()=>_.answer(e,t,n)),onProceed:(t,n)=>Z(()=>_.proceed(e,t,n))})]},t.id)),H?.outcome===`done`&&H.next.length>0&&!B&&!V&&(0,P.jsx)(`div`,{className:`flex flex-wrap gap-2 pl-12`,children:H.next.map(e=>(0,P.jsx)(`button`,{type:`button`,title:e.request===e.label?void 0:e.request,onClick:()=>void $(e.request),className:`inline-flex min-h-10 cursor-pointer items-center rounded-[8px] border-0 bg-surface-strong px-4 text-sm font-medium text-ink-2 hover:bg-line hover:text-ink`,children:e.label},e.label))}),(F.fatal||V&&F.ended)&&(0,P.jsxs)(`div`,{role:`alert`,className:l(`flex flex-col gap-2 rounded-[14px] px-4 py-3 text-sm leading-relaxed`,F.fatal||z===`failed`?`bg-fail-soft text-fail`:`bg-surface-muted text-ink-2`),children:[(0,P.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:F.fatal||F.ended?.message||(z===`failed`?`ForgeQE stopped unexpectedly.`:`This chat has ended.`)}),F.ended?.stderr&&(0,P.jsx)(`pre`,{className:`m-0 max-h-[200px] overflow-auto rounded-lg bg-bg/60 px-3 py-2 font-mono text-[12px] whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,children:F.ended.stderr.join(`
3
- `)}),(0,P.jsxs)(`span`,{className:`flex flex-wrap gap-2`,children:[(0,P.jsx)(`a`,{className:g({size:`sm`}),href:a(),children:`Start a new chat`}),F.fatal&&/model|key|sign/i.test(F.fatal)&&(0,P.jsx)(`a`,{className:g({size:`sm`}),href:a(`settings`,`models`),children:`Models`}),F.fatal&&/runtime|engine|setup/i.test(F.fatal)&&(0,P.jsx)(`a`,{className:g({size:`sm`}),href:a(`settings`,`setup`),children:`Set up`})]})]}),F.notes.map((e,t)=>(0,P.jsx)(`p`,{className:`m-0 text-sm text-muted [overflow-wrap:anywhere]`,children:e},t))]}),(0,P.jsx)(`div`,{ref:k,className:`sticky bottom-0 z-10 bg-gradient-to-t from-bg from-70% to-transparent px-6 pt-4 pb-5`,children:(0,P.jsxs)(`div`,{className:`relative mx-auto flex w-full max-w-[880px] flex-col gap-2`,children:[!j&&B&&(0,P.jsxs)(`button`,{type:`button`,onClick:ie,className:`absolute -top-11 left-1/2 inline-flex min-h-8 -translate-x-1/2 cursor-pointer items-center gap-1.5 rounded-[8px] border-0 bg-surface-strong px-3 text-[13px] font-medium text-ink-2 shadow-sm hover:bg-line hover:text-ink`,children:[(0,P.jsx)(re,{size:14,"aria-hidden":`true`}),`Latest activity`]}),(0,P.jsx)(`div`,{"aria-live":`polite`,children:s&&(0,P.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:s})}),(0,P.jsx)(w,{id:`reply`,label:`Reply to ForgeQE`,rows:1,value:p,onChange:m,onSend:()=>void $(p),onStop:()=>Z(()=>_.stop(e)),busy:B&&!U,disabled:V||h||U||Q.running,top:Q.state&&(0,P.jsx)(E,{state:Q.state,onStop:()=>void Q.stop(),onUndo:Q.undo,onClose:Q.close}),left:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`relative`,children:[(0,P.jsxs)(c,{variant:`ghost`,className:`px-2.5 text-[15px]`,disabled:V,"aria-expanded":K,"aria-haspopup":`dialog`,onClick:()=>q(!K),children:[(0,P.jsx)(ne,{size:18,strokeWidth:1.8,"aria-hidden":`true`}),`Tools`,(X.headed||!X.code)&&(0,P.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 rounded-full bg-accent`})]}),(0,P.jsx)(O,{open:K,onClose:()=>q(!1),label:`Tools for this chat`,role:`dialog`,side:`auto`,className:`left-0 w-[min(380px,calc(100vw-48px))]`,children:(0,P.jsx)(D,{tools:X,chat:{model:F.model?.name,provider:F.model?.provider},onChange:t=>{let n={};t.headed!==X.headed&&(n.headed=t.headed),t.code!==X.code&&(n.writeTests=t.code),Object.keys(n).length&&(Y({headed:t.headed,code:t.code}),Z(()=>_.settings(e,n)))}})})]}),(0,P.jsx)(S,{running:Q.running,disabled:!p.trim()||V||h||U,onClick:()=>void Q.start(p)})]}),placeholder:V?`This chat has ended`:U?`Answer above to go on`:B?`ForgeQE is working…`:`Reply to ForgeQE…`})]})})]})}function I(e){return e.waiting||e.state===`ready`&&e.outcome===`needs_input`?`waiting`:e.state===`busy`||e.state===`starting`?`working`:e.state===`closed`||e.state===`failed`?`ended`:`done`}var L={working:{label:`Working`,tone:`running`},waiting:{label:`Needs you`,tone:`warn`},done:{label:`Your turn`,tone:`pass`},ended:{label:`Ended`,tone:`neutral`}},R=[{id:`all`,label:`All`},{id:`working`,label:`Working`},{id:`waiting`,label:`Needs you`},{id:`done`,label:`Your turn`},{id:`ended`,label:`Ended`}];function z({c:e}){let t=I(e),n=L[t];return(0,P.jsxs)(`a`,{href:a(`chats`,e.id),className:`group grid min-h-14 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 rounded-[10px] px-3 py-2 text-ink no-underline hover:bg-surface-muted hover:text-ink @3xl:grid-cols-[minmax(0,1fr)_120px_90px_150px_96px]`,children:[(0,P.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,P.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[t===`waiting`&&(0,P.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 flex-none rounded-full bg-warn`}),(0,P.jsx)(`span`,{className:`truncate text-[14px] font-medium`,children:e.title})]}),(0,P.jsx)(`span`,{className:l(`truncate text-[12.5px]`,e.lastReply?`text-muted`:`text-muted italic`),children:e.lastReply||(t===`working`?`Working on the first answer…`:`No answer yet`)})]}),(0,P.jsx)(`span`,{className:`justify-self-end @3xl:justify-self-start`,children:(0,P.jsx)(T,{tone:n.tone,orb:e.state===`starting`?`waiting`:`working`,children:n.label})}),(0,P.jsx)(`span`,{className:`hidden text-[13px] text-muted tabular-nums @3xl:block`,children:e.turns?s(e.turns,`message`):`—`}),(0,P.jsx)(`span`,{className:`hidden min-w-0 items-center gap-1 truncate text-[13px] text-muted @3xl:flex`,children:e.profile?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(x,{size:11,fill:`currentColor`,"aria-hidden":`true`,className:`flex-none text-accent-fg`}),(0,P.jsx)(`span`,{className:`truncate`,children:e.profile})]}):`Default model`}),(0,P.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:j(e.lastAt||e.started)})]})}var B=50;function V(){let[t,n]=(0,N.useState)(null),[r,o]=(0,N.useState)(``),[s,u]=(0,N.useState)(`all`),[d,p]=(0,N.useState)(``),[v,y]=(0,N.useState)(B);(0,N.useEffect)(()=>y(B),[s,d]),(0,N.useEffect)(()=>{let e=!1,t=()=>_.list().then(t=>!e&&n(t.chats),t=>!e&&o(t.message));t();let r=setInterval(t,5e3);return()=>{e=!0,clearInterval(r)}},[]);let x=(0,N.useMemo)(()=>{let e={all:0,working:0,waiting:0,done:0,ended:0};for(let n of t||[])e.all++,e[I(n)]++;return e},[t]),S=(0,N.useMemo)(()=>{let e=d.toLowerCase().split(/\s+/).filter(Boolean),n=e=>Date.parse(e.lastAt||e.started)||0;return(t||[]).filter(t=>(s===`all`||I(t)===s)&&e.every(e=>`${t.title} ${t.lastReply||``} ${t.profile||``}`.toLowerCase().includes(e))).sort((e,t)=>n(t)-n(e))},[t,s,d]),C=(0,N.useMemo)(()=>{let e=[];for(let t of S.slice(0,v)){let n=A(t.lastAt||t.started),r=e.find(e=>e.day===n);r?r.chats.push(t):e.push({day:n,chats:[t]})}return e},[S,v]);return(0,P.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,P.jsx)(m,{}),(0,P.jsxs)(`main`,{className:l(h,`gap-5`),children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,P.jsx)(f,{pixel:i.chats,size:`lg`}),(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,P.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Chats`}),(0,P.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Each one is its own ForgeQE agent in your project folder, for as long as forgeqe web runs.`})]}),(0,P.jsxs)(`a`,{className:l(g({variant:`primary`}),`gap-2`),href:a(),children:[(0,P.jsx)(k,{size:16,"aria-hidden":`true`}),`New chat`]})]}),t&&t.length>0&&(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,P.jsx)(`div`,{role:`radiogroup`,"aria-label":`Show`,className:`flex flex-wrap gap-1 rounded-[10px] bg-surface-strong p-1`,children:R.map(e=>(0,P.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":s===e.id,onClick:()=>u(e.id),className:l(`inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-[7px] border-0 px-3 text-sm font-medium`,s===e.id?`bg-bg text-ink shadow-sm`:`bg-transparent text-muted hover:text-ink`),children:[e.label,(0,P.jsx)(`span`,{className:l(`tabular-nums text-[12px]`,e.id===`waiting`&&x.waiting?`text-warn`:`text-muted`),children:x[e.id]})]},e.id))}),(0,P.jsxs)(`div`,{className:`relative min-w-0 flex-[1_1_240px]`,children:[(0,P.jsx)(b,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted`}),(0,P.jsx)(e,{type:`search`,"aria-label":`Find a chat`,value:d,placeholder:`Find a chat`,onChange:e=>p(e.target.value),className:`pl-9`})]})]}),r&&(0,P.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:r}),!t&&!r&&(0,P.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Loading…`}),t&&t.length===0&&(0,P.jsxs)(`div`,{className:`flex flex-col items-center gap-4 rounded-[18px] border border-dashed border-line px-6 py-14 text-center`,children:[(0,P.jsx)(f,{pixel:i.chats,size:`lg`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,P.jsx)(`span`,{className:`text-lg font-semibold`,children:`No chats yet`}),(0,P.jsx)(`span`,{className:`max-w-[48ch] text-sm text-muted`,children:`Ask ForgeQE to run test cases, explore a journey, write a test or review requirements. Each chat shows up here while forgeqe web runs.`})]}),(0,P.jsx)(`a`,{className:g({variant:`primary`}),href:a(),children:`Start a chat`})]}),t&&t.length>0&&S.length===0&&(0,P.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No chat matches.`}),S.length>0&&(0,P.jsxs)(`div`,{className:`@container rounded-[14px] border border-line-soft bg-bg`,children:[(0,P.jsxs)(`div`,{"aria-hidden":`true`,className:`hidden grid-cols-[minmax(0,1fr)_120px_90px_150px_96px] gap-x-4 border-b border-line-soft px-6 py-2 text-[12px] font-medium text-muted @3xl:grid`,children:[(0,P.jsx)(`span`,{children:`Chat`}),(0,P.jsx)(`span`,{children:`Status`}),(0,P.jsx)(`span`,{children:`Messages`}),(0,P.jsx)(`span`,{children:`Model`}),(0,P.jsx)(`span`,{className:`text-right`,children:`Last activity`})]}),C.map(e=>(0,P.jsxs)(`section`,{"aria-labelledby":`day-${e.day}`,children:[(0,P.jsxs)(`h2`,{id:`day-${e.day}`,className:`sticky top-0 z-[1] m-0 border-b border-line-soft bg-surface-muted/95 px-6 py-1.5 text-[12px] font-semibold tracking-wide text-muted uppercase backdrop-blur`,children:[e.day,` `,(0,P.jsxs)(`span`,{className:`font-normal tabular-nums`,children:[`· `,e.chats.length]})]}),(0,P.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-1.5`,children:e.chats.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsx)(z,{c:e})},e.id))})]},e.day)),S.length>v&&(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-line-soft px-6 py-3 text-[13px] text-muted`,children:[(0,P.jsxs)(`span`,{children:[`Showing `,v,` of `,S.length]}),(0,P.jsxs)(c,{size:`sm`,onClick:()=>y(v+B),children:[`Show `,Math.min(B,S.length-v),` more`]})]})]})]})]})}export{F as Chat,V as Chats};
@@ -1,4 +0,0 @@
1
- import{Ct as e,E as t,G as n,K as r,Kn as i,Kt as a,Nt as o,St as s,Tn as c,Un as l,X as u,Y as d,Z as f,_n as p,ht as m,kt as h,lt as g,mt as _,ot as v,pt as y,q as b,r as x,t as S,wn as C}from"./frame-9YY74_9h.js";import"./markdown-DWLq2XDl.js";import{t as w}from"./file-chart-column-increasing-Cojvoj1H.js";import{t as T}from"./message-square-Bc8pM79i.js";import{A as E,C as D,_ as O,i as k,j as A}from"./index-bN_xd12c.js";var j={name:`plug-zap`,size:24,node:[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]],aliases:[`plug-zap-2`]};j.node;var M=p(j),N={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`}]]};N.node;var P=p(N),F={name:`waypoints`,size:24,node:[[`path`,{d:`m10.586 5.414-5.172 5.172`,key:`4mc350`}],[`path`,{d:`m18.586 13.414-5.172 5.172`,key:`8c96vv`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`circle`,{cx:`12`,cy:`20`,r:`2`,key:`144qzu`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}],[`circle`,{cx:`20`,cy:`12`,r:`2`,key:`1xzzfp`}],[`circle`,{cx:`4`,cy:`12`,r:`2`,key:`1hvhnz`}]]};F.node;var I=p(F),L=i(l(),1),R=y(),z=[`databases`,`testdata`,`flows`],B={test:`databases`,tables:`databases`,query:`databases`,gen:`testdata`,files:`testdata`,insert:`testdata`,batches:`testdata`,clean:`testdata`,check:`flows`,trace:`flows`},V={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`],check:[`Checking the flows`,`Checked the flows`,`working`],trace:[`Following the record`,`Followed the record`,`searching`]},H=e=>e==null?`NULL`:typeof e==`object`?JSON.stringify(e):String(e),U=e=>(e?.keys||[]).map(e=>typeof e==`object`&&e?`${e.key}×${e.times}`:String(e)).join(`, `);function W({job:t,onStop:n}){let[r,i,a]=V[t.kind]??[`Working`,`Done`,`working`],o=(0,L.useRef)(null);(0,L.useEffect)(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[t.lines.length]);let s=t.exitCode===0,c=!s&&(t.kind===`check`||t.kind===`trace`)&&t.result!==void 0&&!t.result.error;return(0,R.jsxs)(`section`,{"aria-label":t.running?r:i,className:`flex flex-col gap-2 rounded-[14px] border border-line-soft p-4`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,R.jsxs)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:[t.running?r:i,t.target?(0,R.jsxs)(`span`,{className:`font-normal text-muted`,children:[` · `,t.target]}):null]}),(0,R.jsx)(k,{tone:t.running?`running`:s?`pass`:t.exitCode===2||c?`warn`:`fail`,orb:a,children:t.running?`Working`:s?`Done`:c?`Some broken`:t.exitCode===2?`Not done`:`Failed`}),t.running&&(0,R.jsxs)(g,{onClick:n,className:`border-fail text-fail hover:bg-fail-soft`,children:[(0,R.jsx)(e,{size:14,fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]}),(0,R.jsxs)(`details`,{open:t.running||!s&&!t.result,children:[(0,R.jsxs)(`summary`,{className:`cursor-pointer text-sm text-muted`,children:[`Output (`,m(t.lines.length,`line`),`)`]}),(0,R.jsx)(`code`,{className:`mt-2 block font-mono text-[12px] text-muted [overflow-wrap:anywhere]`,children:t.command}),(0,R.jsx)(`pre`,{ref:o,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:t.lines.join(`
2
- `)||`Starting…`})]})]})}function G({text:e}){return(0,R.jsx)(`p`,{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}){return(0,R.jsx)(`div`,{className:`max-h-[420px] overflow-auto rounded-[12px] border border-line-soft`,children:(0,R.jsxs)(`table`,{className:`w-full border-collapse text-[13px]`,children:[(0,R.jsx)(`thead`,{className:`sticky top-0 bg-surface-muted`,children:(0,R.jsx)(`tr`,{children:e.map(e=>(0,R.jsx)(`th`,{className:`px-3 py-2 text-left font-medium whitespace-nowrap text-muted`,children:e},e))})}),(0,R.jsx)(`tbody`,{children:t.map((e,t)=>(0,R.jsx)(`tr`,{className:`border-t border-line-soft`,children:e.map((e,t)=>(0,R.jsx)(`td`,{className:_(`max-w-[320px] px-3 py-1.5 align-top font-mono text-[12px] [overflow-wrap:anywhere]`,e===null&&`text-muted`),children:H(e)},t))},t))})]})})}function q({db:e,job:t,busy:i,act:a}){let[c,l]=(0,L.useState)(``),[u,d]=(0,L.useState)(``),[p,h]=(0,L.useState)(`200`),[_,v]=(0,L.useState)(``),[y,x]=(0,L.useState)(``),S=t&&!t.running&&t.target===e.name?t:null,w=S?.kind===`query`?S.result:void 0,E=async()=>{try{let{id:t}=await C.start(`On the ${e.name} database: ${_.trim()} Read the schema first, check the SQL with run_sql dry_run: true, then run it and show the rows. End with the final SQL in one sql code block.`,{});location.hash=f(`chats`,t)}catch(e){x(e.message)}};return(0,R.jsxs)(`section`,{"aria-labelledby":`db-h`,className:`flex min-w-0 flex-1 flex-col gap-5`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-1`,children:[(0,R.jsx)(`h2`,{id:`db-h`,className:`m-0 text-[22px] font-semibold tracking-[-0.01em]`,children:e.name}),(0,R.jsx)(`span`,{className:`text-sm text-muted [overflow-wrap:anywhere]`,children:[e.engine||`from its connection string`,e.where,e.auth===`password`?``:e.auth].filter(Boolean).join(` · `)}),e.description&&(0,R.jsx)(`span`,{className:`text-sm text-ink-2`,children:e.description})]}),(0,R.jsx)(k,{tone:e.writable?`warn`:`neutral`,icon:e.writable,children:e.writable?`Writable, after asking`:`Read only`})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsxs)(g,{disabled:i,onClick:()=>a(`test`,{db:e.name}),children:[(0,R.jsx)(M,{size:16,"aria-hidden":`true`}),`Test the connection`]}),(0,R.jsxs)(`form`,{className:`flex min-w-0 flex-[1_1_280px] items-center gap-2`,onSubmit:t=>{t.preventDefault(),a(`tables`,{db:e.name,...c.trim()?{search:c.trim()}:{}})},children:[(0,R.jsx)(n,{"aria-label":`Tables matching`,value:c,placeholder:`Tables matching…`,onChange:e=>l(e.target.value),className:`min-w-0 flex-1`}),(0,R.jsxs)(g,{type:`submit`,disabled:i,children:[(0,R.jsx)(s,{size:16,"aria-hidden":`true`}),`Show tables`]})]})]}),S&&(S.kind===`test`||S.kind===`tables`)&&(0,R.jsx)(`pre`,{className:`m-0 max-h-[320px] overflow-auto rounded-[12px] bg-surface-muted p-3 font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:S.lines.filter(e=>!/^args |^token /.test(e)).join(`
3
- `)}),(0,R.jsxs)(`section`,{"aria-labelledby":`query-h`,className:`flex flex-col gap-3`,children:[(0,R.jsx)(`h3`,{id:`query-h`,className:`m-0 text-base font-semibold`,children:`Query`}),(0,R.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`One read. A change to the data goes through a chat, which asks before it writes.`}),(0,R.jsx)(`label`,{className:`sr-only`,htmlFor:`sql`,children:`SQL`}),(0,R.jsx)(b,{id:`sql`,rows:5,value:u,spellCheck:!1,placeholder:e.engine===`mongodb`?`{"find": "orders", "filter": {"status": "open"}}`:`select * from orders where created_at > now() - interval '1 day'`,onChange:e=>d(e.target.value),className:`font-mono text-[13px]`}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsxs)(g,{variant:`primary`,disabled:i||!u.trim(),onClick:()=>a(`query`,{db:e.name,sql:u,maxRows:Number(p)}),children:[(0,R.jsx)(o,{size:16,"aria-hidden":`true`}),`Run`]}),(0,R.jsxs)(g,{disabled:i||!u.trim(),onClick:()=>a(`query`,{db:e.name,sql:u,dryRun:!0}),children:[(0,R.jsx)(A,{size:16,"aria-hidden":`true`}),`Check only`]}),(0,R.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-muted`,children:[`Rows`,(0,R.jsx)(r,{value:p,onChange:e=>h(e.target.value),className:`w-[96px]`,children:[`50`,`200`,`1000`].map(e=>(0,R.jsx)(`option`,{children:e},e))})]})]}),w&&!w.ok&&(0,R.jsx)(G,{text:w.needs_confirmation?`Only reads run here. Ask in a chat to change data: it shows the statement and asks first.`:w.error||`The query failed.`}),w?.ok&&w.dry_run&&(0,R.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-3 py-2 text-sm text-pass`,children:[w.note||`The database accepts it.`,w.columns?.length?` Columns: ${w.columns.join(`, `)}`:``]}),w?.ok&&!w.dry_run&&w.columns&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(K,{columns:w.columns,rows:w.rows||[]}),(0,R.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[m(w.row_count??w.rows?.length??0,`row`),w.truncated?` (more not shown)`:``,w.ms===void 0?``:` in ${w.ms} ms`]})]})]}),(0,R.jsxs)(`section`,{"aria-labelledby":`ask-h`,className:`flex flex-col gap-2`,children:[(0,R.jsx)(`h3`,{id:`ask-h`,className:`m-0 text-base font-semibold`,children:`Ask in your words`}),(0,R.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),_.trim()&&E()},children:[(0,R.jsx)(n,{"aria-label":`Your question`,value:_,maxLength:500,placeholder:`Which customers ordered more than twice last week?`,onChange:e=>v(e.target.value),className:`min-w-0 flex-[1_1_280px]`}),(0,R.jsxs)(g,{type:`submit`,disabled:!_.trim(),children:[(0,R.jsx)(T,{size:16,"aria-hidden":`true`}),`Ask in a chat`]})]}),y&&(0,R.jsx)(G,{text:y})]})]})}function J({view:e,job:t,busy:n,act:r,sub:i}){let a=e.databases.find(e=>e.name===i)||e.databases[0];return e.databases.length?(0,R.jsxs)(`div`,{className:`flex flex-col gap-6 @2xl:flex-row @2xl:items-start @2xl:gap-8`,children:[(0,R.jsxs)(`nav`,{"aria-label":`Databases`,className:`flex min-w-0 flex-col gap-1 @2xl:sticky @2xl:top-6 @2xl:w-[250px] @2xl:flex-none`,children:[(0,R.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.databases.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsxs)(`a`,{href:f(`data`,`databases/${encodeURIComponent(e.name)}`),"aria-current":a?.name===e.name?`page`:void 0,className:_(`flex min-h-[60px] items-center gap-3 rounded-[12px] px-3 py-2 text-ink no-underline`,a?.name===e.name?`bg-surface-strong hover:text-ink`:`hover:bg-surface-muted hover:text-ink`),children:[(0,R.jsx)(E,{size:18,"aria-hidden":`true`,className:`flex-none text-muted`}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,R.jsx)(`span`,{className:`truncate text-[15px] font-medium`,children:e.name}),(0,R.jsx)(`span`,{className:`truncate text-[13px] text-muted`,children:[e.engine||`connection string`,e.writable?`writable`:`read only`].join(` · `)})]})]})},e.name))}),(0,R.jsx)(`a`,{href:f(`settings`,`databases`),className:`px-3 pt-1 text-[13px]`,children:`Add or change in Settings`})]}),a&&(0,R.jsx)(q,{db:a,job:t,busy:n,act:r},a.name)]}):(0,R.jsxs)(`div`,{className:`flex flex-col items-start gap-3 rounded-[18px] border border-line p-6`,children:[(0,R.jsx)(E,{size:24,"aria-hidden":`true`,className:`text-muted`}),(0,R.jsx)(`p`,{className:`m-0 max-w-[62ch] leading-relaxed text-ink-2`,children:`No databases yet. Add one in Settings: a connection string, or its host, user and password, kept in your credential store.`}),(0,R.jsx)(`a`,{href:f(`settings`,`databases`),className:`text-sm font-medium`,children:`Settings, Databases`})]})}function Y({r:e}){return(0,R.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(e.order||[]).map(t=>{let n=e.preview?.[t],r=n?.sample||[],i=r.length?Object.keys(r[0]):[];return(0,R.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,R.jsxs)(`span`,{className:`text-sm`,children:[(0,R.jsx)(`span`,{className:`font-medium`,children:t}),` · `,m(e.rows?.[t]??0,`row`),n?.database_fills?.length?(0,R.jsxs)(`span`,{className:`text-muted`,children:[` · the database fills `,n.database_fills.join(`, `)]}):null,e.masked?.[t]?.length?(0,R.jsxs)(`span`,{className:`text-muted`,children:[` · masked `,e.masked[t].join(`, `)]}):null]}),i.length>0&&(0,R.jsx)(K,{columns:i,rows:r.slice(0,3).map(e=>i.map(t=>e[t]))})]},t)}),(e.warnings||[]).map((e,t)=>(0,R.jsx)(`p`,{className:`m-0 text-[13px] text-warn`,children:e},t))]})}function X({view:e,job:t,busy:i,act:o}){let s=e.databases.filter(e=>e.writable),[c,l]=(0,L.useState)(e.specs[0]??``),[u,p]=(0,L.useState)(``),[m,h]=(0,L.useState)(``),[_,v]=(0,L.useState)(`csv`),[y,b]=(0,L.useState)(!1),[x,S]=(0,L.useState)(s[0]?.name??``),[w,E]=(0,L.useState)(``),[D,k]=(0,L.useState)(``),A={spec:c,...u?{db:u}:{},...m?{seed:m}:{}},j=t&&!t.running?t:null,M=j&&[`gen`,`files`,`insert`].includes(j.kind)&&j.target===c?j.result:void 0,N=j?.kind===`batches`?(Array.isArray(j.result)?j.result.flatMap(e=>e.batches||[]):j.result?.batches)??[]:null,F=e.databases.find(e=>e.name===u),I=async()=>{try{let{id:e}=await C.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=f(`chats`,e)}catch(e){k(e.message)}};return(0,R.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,R.jsxs)(`section`,{"aria-labelledby":`spec-h`,className:`flex flex-col gap-4`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,R.jsx)(`h2`,{id:`spec-h`,className:`m-0 flex-1 text-lg font-semibold`,children:`Make test data`}),(0,R.jsxs)(g,{variant:`ghost`,onClick:()=>void I(),children:[(0,R.jsx)(T,{size:16,"aria-hidden":`true`}),`Write a spec in a chat`]})]}),(0,R.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.`}),D&&(0,R.jsx)(G,{text:D}),e.specs.length===0?(0,R.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,R.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-[14px] border border-line-soft p-4`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,R.jsxs)(`label`,{className:`flex min-w-0 flex-[2_1_260px] flex-col gap-1.5 text-sm font-medium`,children:[`Spec`,(0,R.jsx)(r,{value:c,onChange:e=>l(e.target.value),children:e.specs.map(e=>(0,R.jsx)(`option`,{children:e},e))})]}),(0,R.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_180px] flex-col gap-1.5 text-sm font-medium`,children:[`Database`,(0,R.jsxs)(r,{value:u,onChange:e=>p(e.target.value),children:[(0,R.jsx)(`option`,{value:``,children:`The spec's own`}),e.databases.map(e=>(0,R.jsxs)(`option`,{value:e.name,children:[e.name,e.writable?``:` (read only)`]},e.name))]})]}),(0,R.jsxs)(`label`,{className:`flex w-[120px] flex-col gap-1.5 text-sm font-medium`,children:[`Seed`,(0,R.jsx)(n,{value:m,inputMode:`numeric`,placeholder:`Random`,onChange:e=>h(e.target.value.replace(/\D/g,``).slice(0,9))})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsxs)(g,{variant:`primary`,disabled:i||!c,onClick:()=>o(`gen`,A),children:[(0,R.jsx)(a,{size:16,"aria-hidden":`true`}),`Preview`]}),(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,R.jsx)(g,{disabled:i||!c,onClick:()=>o(`gen`,{...A,mode:`files`,format:_}),children:`Write files`}),(0,R.jsx)(r,{"aria-label":`File format`,value:_,onChange:e=>v(e.target.value),className:`w-[88px]`,children:[`csv`,`json`,`sql`].map(e=>(0,R.jsx)(`option`,{children:e},e))})]}),(0,R.jsxs)(g,{disabled:i||!c||!F?.writable,title:F?.writable?void 0:`Pick a writable database to insert into`,onClick:()=>b(!0),children:[(0,R.jsx)(P,{size:16,"aria-hidden":`true`}),`Insert into `,F?.writable?F.name:`a database`]})]}),y&&F&&(0,R.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,R.jsxs)(`span`,{className:`font-medium`,children:[`Insert the rows of `,c,` into `,F.name,`?`]}),(0,R.jsx)(`span`,{className:`text-sm text-ink-2`,children:`They go in as one batch, which you can remove again below. Only on a test database.`}),(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,R.jsx)(g,{variant:`primary`,onClick:()=>{b(!1),o(`gen`,{...A,mode:`insert`,confirmed:!0})},children:`Insert`}),(0,R.jsx)(g,{onClick:()=>b(!1),children:`Don't insert`})]})]}),M&&!M.ok&&(0,R.jsx)(G,{text:M.error||`It did not make the data.`}),M?.ok&&(0,R.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[M.batch&&(0,R.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-3 py-2 text-sm text-pass`,children:[`Inserted as batch `,(0,R.jsx)(`span`,{className:`font-mono text-[13px]`,children:M.batch}),`.`]}),M.files?.length?(0,R.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[`Wrote`,M.files.map(e=>(0,R.jsx)(`button`,{type:`button`,onClick:async()=>k(await d(e)),className:`cursor-pointer rounded-md border border-line-soft bg-surface-muted px-1.5 py-0.5 font-mono text-[12px] text-ink-2 hover:bg-surface-strong`,children:e},e))]}):null,(0,R.jsx)(Y,{r:M})]})]})]}),(0,R.jsxs)(`section`,{"aria-labelledby":`batch-h`,className:`flex flex-col gap-3`,children:[(0,R.jsx)(`h2`,{id:`batch-h`,className:`m-0 text-lg font-semibold`,children:`Inserted batches`}),s.length===0?(0,R.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No writable database: test data is inserted only into one marked writable in Settings, Databases.`}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(r,{"aria-label":`Database`,value:x,onChange:e=>S(e.target.value),className:`w-[220px]`,children:s.map(e=>(0,R.jsx)(`option`,{children:e.name},e.name))}),(0,R.jsx)(g,{disabled:i||!x,onClick:()=>o(`batches`,{db:x}),children:`List batches`})]}),N&&N.length===0&&(0,R.jsxs)(`p`,{className:`m-0 text-sm text-muted`,children:[`No batches in `,j?.target,`.`]}),N&&N.length>0&&(0,R.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:N.map(e=>(0,R.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 border-t border-line-soft py-2.5 text-sm first:border-t-0`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-0.5`,children:[(0,R.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.batch}),(0,R.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[new Date(e.created).toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),e.spec?` · ${e.spec}`:``,` ·`,` `,Object.entries(e.rows).map(([e,t])=>`${e} ${t}`).join(`, `)]})]}),w===e.batch?(0,R.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`span`,{className:`text-[13px] text-warn`,children:[`Remove its rows from `,j?.target,`?`]}),(0,R.jsx)(g,{size:`sm`,className:`border-fail text-fail hover:bg-fail-soft`,onClick:()=>{E(``),o(`clean`,{db:j?.target,batch:e.batch,confirmed:!0})},children:`Remove`}),(0,R.jsx)(g,{size:`sm`,onClick:()=>E(``),children:`Keep`})]}):(0,R.jsxs)(g,{size:`sm`,disabled:i,onClick:()=>E(e.batch),children:[(0,R.jsx)(O,{size:14,"aria-hidden":`true`}),`Remove`]})]},e.batch))}),j?.kind===`clean`&&j.result?.ok&&(0,R.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-3 py-2 text-sm text-pass`,children:[`Removed:`,` `,Object.entries(j.result.removed||{}).map(([e,t])=>`${e} ${t}`).join(`, `)]})]})]})]})}function Z({c:e}){let t=e=>e?.count??0;return(0,R.jsxs)(`li`,{className:`flex flex-col gap-1 border-t border-line-soft py-3 text-sm first:border-t-0`,children:[(0,R.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(k,{tone:e.ok?`pass`:`fail`,children:e.ok?`Holds`:`Broken`}),(0,R.jsx)(`span`,{className:`font-medium`,children:e.flow}),(0,R.jsxs)(`span`,{className:`font-mono text-[12px] text-muted [overflow-wrap:anywhere]`,children:[e.from,` → `,e.to]})]}),e.error?(0,R.jsx)(`span`,{className:`text-fail [overflow-wrap:anywhere]`,children:e.error}):(0,R.jsxs)(`span`,{className:`text-ink-2`,children:[e.matched??0,` of `,e.source_rows??0,` arrived · `,e.late?`${t(e.late)} late (${t(e.in_flight)} in flight)`:`${t(e.missing)} missing`,` · `,e.wrong?.rows??0,` wrong · `,t(e.duplicates),` duplicated`,e.extra?` · ${t(e.extra)} with no source`:``]}),e.note&&(0,R.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.note}),U(e.late??e.missing)&&(0,R.jsxs)(`span`,{className:`text-[13px] text-fail [overflow-wrap:anywhere]`,children:[`Missing: `,U(e.late??e.missing)]}),(e.wrong?.examples||[]).map((e,t)=>(0,R.jsxs)(`span`,{className:`font-mono text-[12px] text-fail [overflow-wrap:anywhere]`,children:[String(e.key),`: `,e.column,` expected `,H(e.expected),`, found `,H(e.target)]},t))]})}function Q({view:e,job:t,busy:i,act:a}){let[o,s]=(0,L.useState)([]),l=(0,L.useMemo)(()=>[...new Set(e.flows.map(e=>e.from).filter(e=>!e.startsWith(`api:`)))],[e.flows]),[u,p]=(0,L.useState)(l[0]??e.flows[0]?.name??``),[_,v]=(0,L.useState)(``),[y,b]=(0,L.useState)(``),[x,S]=(0,L.useState)(``),[E,O]=(0,L.useState)(null),[j,M]=(0,L.useState)(``),N=t&&!t.running?t:null,P=N?.kind===`check`?N.result??null:null,F=N?.kind===`trace`?N.result??null:null;return e.flowsError?(0,R.jsx)(G,{text:`${e.flowsFile} does not read: ${e.flowsError}`}):e.flows.length?(0,R.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,R.jsxs)(`section`,{"aria-labelledby":`flows-h`,className:`flex flex-col gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsxs)(`h2`,{id:`flows-h`,className:`m-0 flex-1 text-lg font-semibold`,children:[`Flows `,(0,R.jsxs)(`span`,{className:`text-sm font-normal text-muted`,children:[`(`,e.flowsFile,`)`]})]}),(0,R.jsxs)(g,{variant:`primary`,disabled:i,onClick:()=>a(`check`,{flows:o}),children:[(0,R.jsx)(A,{size:16,"aria-hidden":`true`}),o.length?`Check ${m(o.length,`flow`)}`:`Check all`]}),N?.report&&(N.kind===`check`||N.kind===`trace`)&&(0,R.jsxs)(g,{onClick:async()=>M(await d(N.report)),children:[(0,R.jsx)(w,{size:16,"aria-hidden":`true`}),`Report`]})]}),(0,R.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Each hop: did every record arrive, complete, correct, on time.`}),j&&(0,R.jsx)(G,{text:j}),(0,R.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.flows.map(e=>(0,R.jsxs)(`li`,{className:`flex items-start gap-3 border-t border-line-soft py-2.5 first:border-t-0`,children:[(0,R.jsx)(`input`,{type:`checkbox`,"aria-label":`Check ${e.name}`,checked:o.includes(e.name),onChange:t=>s(t.target.checked?[...o,e.name]:o.filter(t=>t!==e.name)),className:`mt-1 size-5 flex-none accent-accent`}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5 text-sm`,children:[(0,R.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,R.jsxs)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:[e.from,` → `,e.to]}),(0,R.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[[e.mode,e.sla?`SLA ${e.sla}`:``,m(e.columns,`column`)].filter(Boolean).join(` · `),e.description?` · ${e.description}`:``]})]})]},e.name))}),P?.error&&(0,R.jsx)(G,{text:P.error}),P?.flows&&(0,R.jsx)(`ul`,{"aria-label":`Check results`,className:`m-0 flex list-none flex-col rounded-[14px] border border-line-soft px-4 py-1`,children:P.flows.map(e=>(0,R.jsx)(Z,{c:e},e.flow))})]}),(0,R.jsxs)(`section`,{"aria-labelledby":`trace-h`,className:`flex flex-col gap-3`,children:[(0,R.jsx)(`h2`,{id:`trace-h`,className:`m-0 text-lg font-semibold`,children:`Follow one record`}),(0,R.jsxs)(`form`,{className:`flex flex-wrap items-end gap-3`,onSubmit:e=>{e.preventDefault(),u&&_.trim()&&a(`trace`,{start:u,key:_.trim(),...y?{wait:Number(y)}:{}})},children:[(0,R.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_220px] flex-col gap-1.5 text-sm font-medium`,children:[`From`,(0,R.jsxs)(r,{value:u,onChange:e=>p(e.target.value),children:[(0,R.jsx)(`optgroup`,{label:`A table`,children:l.map(e=>(0,R.jsx)(`option`,{children:e},e))}),(0,R.jsx)(`optgroup`,{label:`A flow`,children:e.flows.map(e=>(0,R.jsx)(`option`,{children:e.name},e.name))})]})]}),(0,R.jsxs)(`label`,{className:`flex w-[160px] flex-col gap-1.5 text-sm font-medium`,children:[`Its key`,(0,R.jsx)(n,{value:_,maxLength:200,placeholder:`1042`,onChange:e=>v(e.target.value)})]}),(0,R.jsxs)(`label`,{className:`flex w-[130px] flex-col gap-1.5 text-sm font-medium`,children:[`Wait up to (s)`,(0,R.jsx)(n,{value:y,inputMode:`numeric`,placeholder:`0`,onChange:e=>b(e.target.value.replace(/\D/g,``).slice(0,3))})]}),(0,R.jsxs)(g,{type:`submit`,disabled:i||!u||!_.trim(),children:[(0,R.jsx)(h,{size:16,"aria-hidden":`true`}),`Follow it`]})]}),F?.error&&(0,R.jsx)(G,{text:F.error}),F?.hops&&(0,R.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-2 border-l border-line pl-4`,children:F.hops.map((e,t)=>(0,R.jsxs)(`li`,{className:`flex flex-col gap-0.5 text-sm`,children:[(0,R.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(k,{tone:e.ok?`pass`:`fail`,children:e.ok?`Arrived`:e.found_in_source===!1?`Not in the source`:e.arrived===!1?`Did not arrive`:`Differs`}),(0,R.jsx)(`span`,{className:`font-medium`,children:e.flow}),(0,R.jsxs)(`span`,{className:`font-mono text-[12px] text-muted`,children:[e.from,` → `,e.to,` · key `,H(e.key)]})]}),(e.differences||[]).map((e,t)=>(0,R.jsxs)(`span`,{className:`font-mono text-[12px] text-fail [overflow-wrap:anywhere]`,children:[e.column,`: expected `,H(e.expected),`, found `,H(e.target)]},t)),Number(e.copies)>1&&(0,R.jsxs)(`span`,{className:`text-[13px] text-warn`,children:[e.copies,` copies`]})]},t))})]}),(0,R.jsxs)(`section`,{"aria-labelledby":`impact-h`,className:`flex flex-col gap-3`,children:[(0,R.jsx)(`h2`,{id:`impact-h`,className:`m-0 text-lg font-semibold`,children:`What a change reaches`}),(0,R.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:async e=>{e.preventDefault();try{O(await c.impact(x.trim())),M(``)}catch(e){M(e.message)}},children:[(0,R.jsx)(n,{"aria-label":`A table or column`,value:x,spellCheck:!1,placeholder:`shop.orders.total`,onChange:e=>S(e.target.value),className:`min-w-0 flex-[1_1_260px] font-mono text-[13px]`}),(0,R.jsxs)(g,{type:`submit`,disabled:!x.trim(),children:[(0,R.jsx)(D,{size:16,"aria-hidden":`true`}),`Show what reads it`]})]}),E&&E.length===0&&(0,R.jsxs)(`p`,{className:`m-0 text-sm text-muted`,children:[`Nothing in the flows reads `,x,`.`]}),E&&E.length>0&&(0,R.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:E.map((e,t)=>(0,R.jsxs)(`li`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,style:{paddingLeft:`${(e.depth-1)*16}px`},children:[e.from,` → `,e.to,e.columns.length?` (${e.columns.join(`, `)})`:``,` `,(0,R.jsxs)(`span`,{className:`text-muted`,children:[`[`,e.flow,`]`]})]},t))}),e.map.length>0&&(0,R.jsxs)(`details`,{children:[(0,R.jsx)(`summary`,{className:`cursor-pointer text-sm text-muted`,children:`The whole map`}),(0,R.jsx)(`pre`,{className:`mt-2 overflow-auto rounded-[12px] bg-surface-muted p-3 font-mono text-[12px] leading-relaxed text-ink-2`,children:e.map.join(`
4
- `)})]})]})]}):(0,R.jsxs)(`div`,{className:`flex flex-col items-start gap-3 rounded-[18px] border border-line p-6`,children:[(0,R.jsx)(I,{size:24,"aria-hidden":`true`,className:`text-muted`}),(0,R.jsxs)(`p`,{className:`m-0 max-w-[62ch] leading-relaxed text-ink-2`,children:[`No data flows yet. A flow says how records move from one system to another (a table, a topic or an API), by which key, and what each column becomes; `,(0,R.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.flowsFile}),` holds them. ForgeQE can write them from your mapping documents.`]}),(0,R.jsxs)(g,{onClick:async()=>{try{let{id:e}=await C.start(`Write the data flows of this project into flows.yaml from our mapping documents and the databases' schemas. Show me each flow before you save it.`,{});location.hash=f(`chats`,e)}catch(e){M(e.message)}},children:[(0,R.jsx)(T,{size:16,"aria-hidden":`true`}),`Write flows in a chat`]}),j&&(0,R.jsx)(G,{text:j})]})}function $({sub:e}){let[n,r]=(0,L.useState)(null),[i,a]=(0,L.useState)(``),[o,s]=(0,L.useState)(!1),[l,...d]=(e||``).split(`/`),p=z.includes(l)?l:`databases`,m=(0,L.useCallback)(()=>{c.view().then(e=>{r(e),a(``)},e=>a(e.message))},[]);(0,L.useEffect)(m,[m]);let h=!!n?.job?.running;(0,L.useEffect)(()=>{if(!h)return;let e=setInterval(m,1e3);return()=>clearInterval(e)},[h,m]);let g=async(e,t)=>{s(!0),a(``);try{await c.run(e,t),m()}catch(e){a(e.message)}finally{s(!1)}},y=n?.job??null,b={databases:`Databases${n?` (${n.databases.length})`:``}`,testdata:`Test data${n?` (${n.specs.length})`:``}`,flows:`Data flows${n?` (${n.flows.length})`:``}`};return(0,R.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,R.jsx)(x,{}),(0,R.jsxs)(`main`,{className:_(S,`@container flex-auto gap-4`),children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,R.jsx)(v,{pixel:u.data,size:`lg`}),(0,R.jsx)(`h1`,{className:`m-0 flex-1 text-[26px] font-semibold tracking-[-0.01em]`,children:`Data`})]}),(0,R.jsx)(`p`,{className:`m-0 max-w-[74ch] text-sm leading-relaxed text-muted`,children:`The databases the agents may read, test data made from specs and inserted as batches you can remove again, and the data flows between systems: did every record arrive, complete and correct.`}),i&&(0,R.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i}),!n&&!i&&(0,R.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),n&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(t,{label:`Data`,current:p,onPick:e=>location.hash=f(`data`,e),tabs:z.map(e=>({id:e,label:b[e]}))}),y&&(y.running||B[y.kind]===p)&&(0,R.jsx)(W,{job:y,onStop:()=>void c.stop().then(m)}),(0,R.jsxs)(`div`,{role:`tabpanel`,id:`panel-${p}`,"aria-labelledby":`tab-${p}`,children:[p===`databases`&&(0,R.jsx)(J,{view:n,job:y,busy:o||h,act:g,sub:d[0]?decodeURIComponent(d[0]):void 0}),p===`testdata`&&(0,R.jsx)(X,{view:n,job:y,busy:o||h,act:g}),p===`flows`&&(0,R.jsx)(Q,{view:n,job:y,busy:o||h,act:g})]})]})]})]})}export{$ as Data};
@@ -1 +0,0 @@
1
- import{Dn as e,G as t,K as n,Kn as r,N as i,T as a,Un as o,X as s,Z as c,_n as l,ht as u,lt as d,mn as f,mt as p,ot as m,pt as h,r as g,t as _,wn as v}from"./frame-9YY74_9h.js";import{t as y}from"./circle-dashed-Beydn7Cq.js";import{n as b}from"./markdown-DWLq2XDl.js";import{t as x}from"./message-square-Bc8pM79i.js";import{C as S,S as C,i as w}from"./index-bN_xd12c.js";var T={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};T.node;var E=l(T),D=r(o(),1),O=h(),k={ready:{label:`Ready`,tone:`pass`},partial:{label:`Ready, some parts need setup`,tone:`warn`},needs_setup:{label:`Needs setup`,tone:`neutral`}},A={models:`Models`,integrations:`Integrations`,monitor:`Monitor`,notifications:`Notifications`,agents:`Agents`,environments:`Environments`,containers:`Containers`,databases:`Databases`};async function j(e,t){try{let{id:t}=await v.start(e,{});location.hash=c(`chats`,t)}catch(e){t(e.message)}}function M({f:t,onScope:r,busy:i}){let[a,o]=(0,D.useState)(null),[s,l]=(0,D.useState)(``),[f,m]=(0,D.useState)(``);(0,D.useEffect)(()=>{e.detail(t.id).then(o,e=>l(e.message))},[t.id]);let h=t.gaps.filter(e=>!e.optional),g=t.gaps.filter(e=>e.optional);return(0,O.jsxs)(`div`,{className:`flex flex-col gap-4 py-4`,children:[[[h,`Needs`],[g,`Would do more with`]].map(([e,t])=>e.length?(0,O.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,O.jsx)(`span`,{className:`text-sm font-medium`,children:t}),(0,O.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:e.map((e,n)=>(0,O.jsxs)(`li`,{className:`flex flex-col gap-0.5 rounded-[10px] bg-bg px-3 py-2 text-sm`,children:[(0,O.jsx)(`span`,{className:p(t===`Needs`?`text-ink`:`text-ink-2`),children:e.missing}),(0,O.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.fix}),e.settings&&(0,O.jsxs)(`a`,{href:c(`settings`,e.settings),className:`inline-flex items-center gap-1 self-start text-[13px] font-medium`,children:[(0,O.jsx)(C,{size:13,"aria-hidden":`true`}),`Set it up in Settings, `,A[e.settings]||e.settings]})]},n))})]},t):null),t.inputs.length>0&&(0,O.jsxs)(`p`,{className:`m-0 text-sm text-ink-2`,children:[`From your request: `,t.inputs.join(`; `),`.`]}),s&&(0,O.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:s}),a&&(0,O.jsxs)(O.Fragment,{children:[a.examples.length>0&&(0,O.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,O.jsx)(`span`,{className:`text-sm font-medium`,children:`Ask for it like this`}),(0,O.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:a.examples.slice(0,4).map(e=>(0,O.jsxs)(d,{size:`sm`,disabled:t.state===`needs_setup`,title:t.state===`needs_setup`?`Set it up first`:`Start a chat with this request`,onClick:()=>void j(e,m),className:`h-auto min-h-8 max-w-full py-1.5 text-left whitespace-normal`,children:[(0,O.jsx)(x,{size:14,"aria-hidden":`true`,className:`flex-none`}),e]},e))}),f&&(0,O.jsx)(`span`,{className:`text-[13px] text-fail`,children:f})]}),a.limits.length>0&&(0,O.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,O.jsx)(`span`,{className:`text-sm font-medium`,children:`What it does not do`}),(0,O.jsx)(`ul`,{className:`m-0 list-disc pl-5 text-sm text-ink-2`,children:a.limits.map(e=>(0,O.jsx)(`li`,{children:e},e))})]}),a.docs.length>0&&(0,O.jsxs)(`details`,{children:[(0,O.jsxs)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:[`How it works (`,u(a.docs.length,`section`),`)`]}),(0,O.jsx)(`div`,{className:`mt-2 flex flex-col gap-4`,children:a.docs.map(e=>(0,O.jsxs)(`section`,{className:`rounded-[12px] bg-bg px-4 py-3`,children:[(0,O.jsx)(`h4`,{className:`m-0 mb-1 text-sm font-semibold`,children:e.heading}),(0,O.jsx)(b,{text:e.text,className:`text-sm`})]},e.heading))})]}),(0,O.jsxs)(`span`,{className:`font-mono text-[11.5px] text-muted [overflow-wrap:anywhere]`,children:[`Tools: `,a.tools.join(`, `)]})]}),(0,O.jsxs)(`label`,{className:`flex flex-wrap items-center gap-3 border-t border-line-soft pt-3 text-sm`,children:[(0,O.jsxs)(`span`,{className:`flex-[1_1_240px]`,children:[`The agent gets its tools`,(0,O.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`agent.capabilities in forgeqe.yaml`})]}),(0,O.jsxs)(n,{value:t.scope,disabled:i,onChange:e=>r(e.target.value),className:`w-[240px]`,children:[(0,O.jsx)(`option`,{value:`auto`,children:`When a request is about it`}),(0,O.jsx)(`option`,{value:`always`,children:`Always`}),(0,O.jsx)(`option`,{value:`off`,children:`Never, in this project`})]})]})]})}function N(){let[n,r]=(0,D.useState)(null),[o,c]=(0,D.useState)(``),[l,u]=(0,D.useState)(``),[d,h]=(0,D.useState)(`all`),[v,b]=(0,D.useState)(``),[x,C]=(0,D.useState)(!1),T=(0,D.useCallback)(()=>e.view().then(r,e=>c(e.message)),[]);(0,D.useEffect)(()=>void T(),[T]);let A=(0,D.useMemo)(()=>{let e=v.toLowerCase().split(/\s+/).filter(Boolean);return(n?.areas||[]).map(t=>({...t,features:t.features.filter(n=>(d===`all`||(d===`ready`?n.state!==`needs_setup`:n.state!==`ready`))&&e.every(e=>`${n.title} ${n.summary} ${t.area}`.toLowerCase().includes(e)))})).filter(e=>e.features.length)},[n,d,v]),j=async(t,n)=>{C(!0);try{r(await e.scope(t,n)),c(``)}catch(e){c(e.message)}finally{C(!1)}},N=n?.counts;return(0,O.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,O.jsx)(g,{}),(0,O.jsxs)(`main`,{className:p(_,`flex-auto gap-5`),children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,O.jsx)(m,{pixel:s.features,size:`lg`}),(0,O.jsx)(`h1`,{className:`m-0 flex-1 text-[26px] font-semibold tracking-[-0.01em]`,children:`What's ready`})]}),(0,O.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-muted`,children:`Everything ForgeQE can do, and whether it works here: in this project, with these settings, on this machine. Each one says what it still needs and where to set it up, and how to ask for it.`}),o&&(0,O.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:o}),!n&&!o&&(0,O.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),n&&N&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,O.jsx)(a,{icon:f,label:`Ready`,value:String(N.ready)}),(0,O.jsx)(a,{icon:E,label:`Some parts need setup`,value:String(N.partial)}),(0,O.jsx)(a,{icon:y,label:`Need setup`,value:String(N.needs_setup)})]}),(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,O.jsx)(`div`,{role:`radiogroup`,"aria-label":`Show`,className:`flex gap-1 rounded-[10px] bg-surface-strong p-1`,children:[[`all`,`All`],[`needs`,`Needs setup`],[`ready`,`Ready`]].map(([e,t])=>(0,O.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":d===e,onClick:()=>h(e),className:p(`min-h-8 cursor-pointer rounded-[7px] border-0 px-3.5 text-sm font-medium`,d===e?`bg-bg text-ink shadow-sm`:`bg-transparent text-muted hover:text-ink`),children:t},e))}),(0,O.jsxs)(`div`,{className:`relative min-w-0 flex-[1_1_220px]`,children:[(0,O.jsx)(S,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted`}),(0,O.jsx)(t,{type:`search`,"aria-label":`Find a feature`,value:v,placeholder:`Find a feature`,onChange:e=>b(e.target.value),className:`pl-9`})]})]}),A.length===0&&(0,O.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing matches.`}),A.map(e=>(0,O.jsxs)(`section`,{"aria-labelledby":`area-${e.area}`,children:[(0,O.jsx)(`h2`,{id:`area-${e.area}`,className:`m-0 mb-1 text-base font-semibold`,children:e.area}),e.features.map(e=>(0,O.jsx)(i,{title:e.title,meta:(0,O.jsx)(`span`,{className:p(l!==e.id&&`line-clamp-2`),children:e.summary}),open:l===e.id,onToggle:()=>u(l===e.id?``:e.id),state:(0,O.jsxs)(`span`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[e.scope!==`auto`&&(0,O.jsx)(w,{tone:`neutral`,icon:!1,children:e.scope===`always`?`Always given`:`Off here`}),(0,O.jsx)(w,{tone:k[e.state].tone,icon:e.state!==`needs_setup`,children:k[e.state].label})]}),children:(0,O.jsx)(M,{f:e,busy:x,onScope:t=>void j(e.id,t)})},e.id))]},e.area)),n.outOfScope.length>0&&(0,O.jsxs)(`section`,{"aria-labelledby":`oos-h`,className:`flex flex-col gap-2 rounded-[14px] border border-line-soft px-4 py-3`,children:[(0,O.jsx)(`h2`,{id:`oos-h`,className:`m-0 text-base font-semibold`,children:`Not what ForgeQE does`}),(0,O.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-sm`,children:n.outOfScope.map(e=>(0,O.jsxs)(`li`,{children:[e.what,e.instead?(0,O.jsxs)(`span`,{className:`text-muted`,children:[`; instead: `,e.instead]}):null]},e.what))})]})]})]})]})}export{N as Features};
@@ -1,3 +0,0 @@
1
- import{An as e,At as t,Ct as n,Dt as r,G as i,In as a,J as o,K as s,Kn as c,Lt as l,Mt as u,Nt as d,T as f,Un as p,Wt as m,X as h,Y as g,Z as _,_n as v,at as y,ct as b,fn as x,lt as S,mt as C,ot as w,pn as T,pt as E,r as D,st as O,t as k}from"./frame-9YY74_9h.js";import{n as A,t as ee}from"./terminal-BwR_yOmJ.js";import{n as j,t as M}from"./markdown-DWLq2XDl.js";import{t as N}from"./external-link-BXwuemHF.js";import{E as P,O as F,_ as I,i as L,j as R}from"./index-bN_xd12c.js";var z={name:`calendar-plus`,size:24,node:[[`path`,{d:`M16 18h6`,key:`987eiv`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M19 15v6`,key:`10aioa`}],[`path`,{d:`M21 11.5V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h8.3`,key:`jgwkxf`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}]]};z.node;var B=v(z),V={name:`power`,size:24,node:[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]};V.node;var H=v(V),U={name:`search-check`,size:24,node:[[`path`,{d:`m8 11 2 2 4-4`,key:`1sed1v`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]};U.node;var W=v(U),G={name:`timer-off`,size:24,node:[[`path`,{d:`M10 2h4`,key:`n1abiw`}],[`path`,{d:`M4.6 11a8 8 0 0 0 1.7 8.7 8 8 0 0 0 8.7 1.7`,key:`10he05`}],[`path`,{d:`M7.4 7.4a8 8 0 0 1 10.3 1 8 8 0 0 1 .9 10.2`,key:`15f7sh`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M12 12v-2`,key:`fwoke6`}]]};G.node;var K=v(G),q=c(p(),1),J=E(),te={monitor:`Monitor`,suite:`Suite`,run:`Browser run`,heal:`Heal`,"pr-tests":`PR tests`,pack:`Pack`,pipeline:`Pipeline watch`},Y={running:{label:`Running`,tone:`running`},passed:{label:`Passed`,tone:`pass`},failed:{label:`Failed`,tone:`fail`},stopped:{label:`Stopped`,tone:`neutral`},timed_out:{label:`Timed out`,tone:`fail`},interrupted:{label:`Interrupted`,tone:`warn`}},X=e=>{if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString([],{month:`short`,day:`numeric`,...t.getFullYear()===new Date().getFullYear()?{}:{year:`numeric`},hour:`numeric`,minute:`2-digit`})},Z=e=>{if(!e.endedAt)return``;let t=Math.max(0,Math.round((Date.parse(e.endedAt)-Date.parse(e.startedAt))/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`};function Q(e){return e.running?Y.running:e.enabled?e.last?Y[e.last.status]:{label:`Not run yet`,tone:`neutral`}:{label:`Disabled`,tone:`neutral`}}var ne={pass:`bg-pass`,fail:`bg-fail`,warn:`bg-warn`,running:`bg-accent`,neutral:`bg-line`};function $({label:e,icon:t,children:n}){return(0,J.jsxs)(`div`,{className:`flex min-h-[48px] flex-wrap items-baseline gap-x-4 gap-y-1 border-t border-line-soft py-2.5`,children:[(0,J.jsxs)(`span`,{className:`flex w-[170px] flex-none items-center gap-2 text-sm text-muted`,children:[t&&(0,J.jsx)(t,{size:16,"aria-hidden":`true`,className:`flex-none`}),e]}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 text-sm [overflow-wrap:anywhere]`,children:n})]})}function re({m:e,rounds:t}){let[n,i]=(0,q.useState)(``);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsxs)(`h3`,{className:`m-0 mb-1 flex items-center gap-2 text-base font-semibold`,children:[(0,J.jsx)(F,{size:18,"aria-hidden":`true`,className:`text-accent-fg`}),`Monitor`]}),(0,J.jsx)($,{icon:l,label:`Checks`,children:e.checks.length?(0,J.jsx)(j,{text:e.checks.map(e=>`\`${e.replace(/`/g,``)}\``).join(`, `),className:`text-sm [&_p]:my-0`}):`The checks in forgeqe.yaml (monitor.checks)`}),(0,J.jsxs)($,{icon:T,label:`Alerts after`,children:[e.failAfter,` failing round`,e.failAfter===1?``:`s`,` in a row`,e.remind?`, again every ${e.remind} while it keeps failing`:``]}),(0,J.jsx)($,{icon:r,label:`Alerts go to`,children:e.alerts.length?e.alerts.join(` and `):`Nowhere yet: add Teams or email in Settings, Monitor`}),(0,J.jsxs)($,{icon:u,label:`Each round`,children:[e.parallel,` check`,e.parallel===1?``:`s`,` at once; a recorded run `,e.replay===`trust`?`is trusted`:e.replay===`off`?`is not replayed`:`is verified with one model call`]}),(0,J.jsx)($,{icon:m,label:`Rounds kept in`,children:(0,J.jsx)(M,{path:e.outDir})}),(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft py-2.5 text-sm`,children:(0,J.jsx)(`a`,{href:_(`settings`,`monitor`),children:`Change the monitor in Settings`})}),(0,J.jsx)(`h4`,{className:`m-0 mt-3 mb-1 text-sm font-semibold`,children:`Latest rounds`}),n&&(0,J.jsx)(`p`,{className:`m-0 text-[13px] text-fail`,children:n}),t.length===0?(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft py-3 text-sm text-muted`,children:`No rounds yet.`}):(0,J.jsx)(`ul`,{className:`m-0 list-none p-0`,children:t.slice(0,8).map(e=>(0,J.jsxs)(`li`,{className:`flex min-h-[48px] items-center gap-3 border-t border-line-soft py-2`,children:[(0,J.jsxs)(L,{tone:e.counts.failed?`fail`:`pass`,children:[e.counts.passed,`/`,e.counts.total,` passed`]}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:X(e.startedAt)}),e.report?(0,J.jsxs)(S,{size:`sm`,"aria-label":`Open the report of the round of ${X(e.startedAt)} in a new tab`,onClick:async()=>i(await g(e.report)),children:[(0,J.jsx)(N,{size:14,"aria-hidden":`true`}),`Open report`]}):(0,J.jsx)(M,{path:e.folder})]},e.key))})]})}function ie({jobId:t,run:n}){let[r,i]=(0,q.useState)(null),[a,o]=(0,q.useState)(``);(0,q.useEffect)(()=>{let r=!1;i(null);let a=()=>e.log(t,n.id).then(e=>!r&&i(e.lines),e=>!r&&o(e.message));a();let s=n.status===`running`?setInterval(a,2e3):void 0;return()=>{r=!0,s&&clearInterval(s)}},[t,n.id,n.status]);let s=Math.max(2,...(r||[]).map(e=>Math.max(0,...(e.match(/`+/g)||[]).map(e=>e.length)))),c="`".repeat(s+1),l=[`**${Y[n.status].label}**${n.endedAt?` after ${Z(n)}`:``}${n.exitCode!==void 0&&n.exitCode!==null?`, exit ${n.exitCode}`:``}. Started ${X(n.startedAt)}, ${n.reason===`asked`?`asked for`:`on schedule`}.`,...n.investigating?[``,`_Its failures are being investigated._`]:[],...n.findings?.length?[``,`**Investigated:**`,...n.findings.map(e=>`- ${e.verdict}: ${e.tests.map(e=>`\`${e.replace(/`/g,``)}\``).join(`, `)}${e.branch?` on branch \`${e.branch.replace(/`/g,``)}\``:``}`)]:[],...n.investigationNote?[``,n.investigationNote]:[],``,`${c}text`,...r||[],c].join(`
2
- `);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-[12px] border border-line-soft bg-surface-muted px-4 py-3`,children:[a&&(0,J.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:a}),!r&&!a?(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Reading its output…`}):(0,J.jsx)(j,{text:l,className:`text-sm [&_pre]:max-h-[320px] [&_pre]:overflow-auto`})]})}function ae({job:r,rounds:i,busy:a,act:o}){let[s,c]=(0,q.useState)(null),[l,u]=(0,q.useState)(null),[p,m]=(0,q.useState)(!1),h=`${r.running?.id}|${r.last?.id}|${r.last?.status}`;(0,q.useEffect)(()=>{let t=!1;return e.detail(r.id).then(e=>{t||(c(e.runs),u(t=>t??e.runs[0]?.id??null))},()=>{}),()=>{t=!0}},[r.id,h]),(0,q.useEffect)(()=>{u(null),m(!1)},[r.id]);let g=Q(r),_=s?.filter(e=>e.status===`passed`).length??0,v=s?.filter(e=>e.status!==`running`).length??0;return(0,J.jsxs)(`section`,{"aria-labelledby":`job-h`,className:`flex min-w-0 flex-1 flex-col gap-5`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-3`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1`,children:[(0,J.jsx)(`h2`,{id:`job-h`,className:`m-0 text-[22px] font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:r.name}),(0,J.jsxs)(`span`,{className:`text-sm text-muted`,children:[te[r.kind]||r.kind,` · `,r.schedule]})]}),(0,J.jsx)(L,{tone:g.tone,children:g.label}),r.running?(0,J.jsxs)(S,{disabled:a,onClick:()=>o(`stop`),children:[(0,J.jsx)(n,{size:14,fill:`currentColor`,"aria-hidden":`true`}),`Stop`]}):(0,J.jsxs)(S,{variant:`primary`,disabled:a,onClick:()=>o(`run`),children:[(0,J.jsx)(d,{size:16,"aria-hidden":`true`}),`Run now`]})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,J.jsx)(f,{icon:t,label:`Runs kept`,value:String(s?.length??`–`)}),(0,J.jsx)(f,{icon:R,label:`Passed`,value:v?`${Math.round(_/v*100)}%`:`–`,note:v?`${_} of ${v}`:void 0}),(0,J.jsx)(f,{icon:A,label:`Next run`,value:r.nextAt?new Date(r.nextAt).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`}):`–`,note:r.nextAt?X(r.nextAt):r.enabled?void 0:`Disabled`})]}),(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)($,{icon:ee,label:`Runs`,children:(0,J.jsx)(j,{text:`\`${r.command.replace(/`/g,``)}\``,className:`text-sm [&_p]:my-0`})}),(0,J.jsx)($,{icon:A,label:`When`,children:r.schedule}),(0,J.jsx)($,{icon:H,label:`Enabled`,children:(0,J.jsx)(y,{checked:r.enabled,disabled:a,onChange:e=>o(e?`enable`:`disable`),label:`${r.name} enabled`})}),(0,J.jsxs)($,{icon:K,label:`Stopped after`,children:[r.timeoutMs?r.timeoutMs%36e5==0?`${r.timeoutMs/36e5} hour${r.timeoutMs===36e5?``:`s`}`:`${Math.round(r.timeoutMs/6e4)} minutes`:`the service's default`,` of running`]}),(0,J.jsx)($,{icon:x,label:`Tells the team`,children:r.notify?`When it fails, recovers or ends (the notify channels that take job events)`:r.kind===`monitor`?`The monitor sends its own alerts`:`No`}),(0,J.jsx)($,{icon:W,label:`Investigates failures`,children:r.investigate?`Yes, on branches of their own`:`No`}),(0,J.jsxs)($,{icon:B,label:`Added`,children:[X(r.createdAt),` `,r.by===`agent`?`by ForgeQE's agent, after you agreed`:`from the command line or here`]})]}),r.monitor&&(0,J.jsx)(re,{m:r.monitor,rounds:i}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`h3`,{className:`m-0 mb-1 text-base font-semibold`,children:`Runs`}),s?s.length===0?(0,J.jsx)(`p`,{className:`m-0 border-t border-line-soft py-3 text-sm text-muted`,children:`No runs yet. Run now starts one.`}):(0,J.jsx)(`ul`,{className:`m-0 list-none p-0`,children:s.map(e=>(0,J.jsxs)(`li`,{className:`border-t border-line-soft`,children:[(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":l===e.id,onClick:()=>u(l===e.id?null:e.id),className:`flex min-h-[52px] w-full cursor-pointer items-center gap-3 border-0 bg-transparent px-1 py-2 text-left text-ink hover:bg-surface-muted`,children:[(0,J.jsx)(L,{tone:Y[e.status].tone,children:Y[e.status].label}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:[X(e.startedAt),(0,J.jsxs)(`span`,{className:`text-muted`,children:[` `,`· `,e.reason===`asked`?`asked for`:`scheduled`,Z(e)?` · ${Z(e)}`:``]})]}),e.summary?.length?(0,J.jsx)(`span`,{className:`hidden max-w-[40%] truncate text-[13px] text-muted sm:inline`,children:e.summary.at(-1)}):null]}),(0,J.jsx)(O,{open:l===e.id,children:(0,J.jsx)(`div`,{className:`pb-3`,children:(0,J.jsx)(ie,{jobId:r.id,run:e})})})]},e.id))}):(0,J.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Loading…`})]}),(0,J.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-line-soft pt-4`,children:p?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`span`,{className:`text-sm text-ink-2`,children:[`Remove `,r.name,`? Its runs and logs go with it.`]}),(0,J.jsx)(S,{disabled:a,onClick:()=>o(`remove`),className:`border-fail text-fail hover:bg-fail-soft`,children:`Remove`}),(0,J.jsx)(S,{onClick:()=>m(!1),children:`Keep it`})]}):(0,J.jsxs)(S,{variant:`ghost`,onClick:()=>m(!0),className:`text-fail`,children:[(0,J.jsx)(I,{size:16,"aria-hidden":`true`}),`Remove this job`]})})]})}function oe({open:t,onClose:n,commands:r,initial:a,onAdded:c}){let[l,u]=(0,q.useState)(``),[d,f]=(0,q.useState)(`suite`),[p,m]=(0,q.useState)(``),[h,g]=(0,q.useState)(`every`),[_,v]=(0,q.useState)(`30m`),[b,x]=(0,q.useState)(`0 2 * * 1-5`),[C,w]=(0,q.useState)(!0),[T,E]=(0,q.useState)(``),[D,O]=(0,q.useState)(!1);(0,q.useEffect)(()=>{t&&(u(a?.name??``),f(a?.command??`suite`),m(a?.args??``),g(`every`),v(a?.every??`30m`),w(a?.command!==`monitor`),E(``))},[t,a]);let k=async()=>{O(!0),E(``);try{c(await e.add({name:l.trim(),command:d,args:p,...h===`every`?{every:_}:h===`cron`?{cron:b}:{now:!0},notify:C}),l.trim())}catch(e){E(e.message)}finally{O(!1)}},A=`flex flex-col gap-1.5 py-3`;return(0,J.jsx)(o,{open:t,onClose:n,title:`Add a job`,description:`A ForgeQE command the jobs service runs on a schedule, or once now, in a process of its own; it keeps going with this page closed.`,footer:(0,J.jsxs)(J.Fragment,{children:[T&&(0,J.jsx)(`span`,{role:`alert`,className:`mr-auto self-center text-sm text-fail [overflow-wrap:anywhere]`,children:T}),(0,J.jsx)(S,{onClick:n,children:`Cancel`}),(0,J.jsx)(S,{variant:`primary`,disabled:D||!l.trim(),onClick:()=>void k(),children:D?`Adding…`:`Add job`})]}),children:(0,J.jsxs)(`div`,{className:`flex flex-col pt-3`,children:[(0,J.jsxs)(`div`,{className:A,children:[(0,J.jsx)(`label`,{htmlFor:`job-name`,className:`font-medium`,children:`Name`}),(0,J.jsx)(i,{id:`job-name`,value:l,spellCheck:!1,placeholder:`nightly-smoke`,onChange:e=>u(e.target.value)}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`Letters, digits and dashes.`})]}),(0,J.jsxs)(`div`,{className:A,children:[(0,J.jsx)(`label`,{htmlFor:`job-command`,className:`font-medium`,children:`Runs`}),(0,J.jsx)(s,{id:`job-command`,value:d,onChange:e=>f(e.target.value),children:r.map(e=>(0,J.jsxs)(`option`,{value:e,children:[`forgeqe `,e]},e))})]}),(0,J.jsxs)(`div`,{className:A,children:[(0,J.jsx)(`label`,{htmlFor:`job-args`,className:`font-medium`,children:`With`}),(0,J.jsx)(i,{id:`job-args`,value:p,spellCheck:!1,placeholder:d===`monitor`?`Empty: the checks in forgeqe.yaml`:`checks/smoke.yaml --parallel 2`,onChange:e=>m(e.target.value),className:`font-mono text-[13px]`}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`Test case sources and flags, as you would type them after the command. "…" keeps spaces in one. Nothing goes through a shell.`})]}),(0,J.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0 py-3`,children:[(0,J.jsx)(`legend`,{className:`mb-1 font-medium`,children:`When`}),[[`every`,`Every`],[`cron`,`On a schedule (cron, this machine's time)`],[`once`,`Once, now`]].map(([e,t])=>(0,J.jsxs)(`label`,{className:`flex min-h-10 cursor-pointer items-center gap-3`,children:[(0,J.jsx)(`input`,{type:`radio`,name:`job-when`,checked:h===e,onChange:()=>g(e),className:`size-4 accent-accent`}),(0,J.jsx)(`span`,{className:`flex-none`,children:t}),e===`every`&&h===`every`&&(0,J.jsx)(i,{"aria-label":`Every`,value:_,onChange:e=>v(e.target.value),placeholder:`30m`,className:`max-w-[120px] font-mono text-[13px]`}),e===`cron`&&h===`cron`&&(0,J.jsx)(i,{"aria-label":`Cron schedule`,value:b,onChange:e=>x(e.target.value),className:`max-w-[180px] font-mono text-[13px]`})]},e))]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-4 py-3`,children:[(0,J.jsxs)(`span`,{className:`flex flex-1 flex-col gap-0.5`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Tell the team`}),(0,J.jsx)(`span`,{className:`text-sm text-muted`,children:`When it fails, recovers or ends, on the notify channels that take job events. A monitor sends its own alerts.`})]}),(0,J.jsx)(y,{checked:C,onChange:w,label:`Tell the team`})]})]})})}function se({sub:t}){let[n,r]=(0,q.useState)(null),[i,o]=(0,q.useState)([]),[s,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(!1),[d,f]=(0,q.useState)(null),p=(0,q.useCallback)(()=>{e.list().then(e=>{r(e),c(``)},e=>c(e.message))},[]);(0,q.useEffect)(p,[p]),(0,q.useEffect)(()=>{a.list().then(e=>o(e.rows.filter(e=>e.scope===`monitor`)),()=>{})},[n?.jobs.map(e=>e.last?.id).join()]);let m=n?.jobs.some(e=>e.running);(0,q.useEffect)(()=>{let e=setInterval(p,m?3e3:2e4);return()=>clearInterval(e)},[p,m]);let g=t?decodeURIComponent(t):``,v=n?.jobs.find(e=>e.id===g)||n?.jobs[0],y=(0,q.useMemo)(()=>n?.jobs.filter(e=>e.kind===`monitor`)??[],[n]),x=(0,q.useMemo)(()=>n?.jobs.filter(e=>e.kind!==`monitor`)??[],[n]),T=async t=>{if(v){u(!0),c(``);try{r(t===`remove`?await e.remove(v.id):await e.act(v.id,t)),t===`remove`&&(location.hash=_(`jobs`))}catch(e){c(e.message)}finally{u(!1)}}},E=e=>{let t=Q(e),n=v?.id===e.id;return(0,J.jsx)(`li`,{children:(0,J.jsxs)(`a`,{href:_(`jobs`,encodeURIComponent(e.id)),"aria-current":n?`page`:void 0,className:C(`flex min-h-[60px] items-center gap-3 rounded-[12px] px-3 py-2 text-ink no-underline`,n?`bg-surface-strong hover:text-ink`:`hover:bg-surface-muted hover:text-ink`),children:[e.running?(0,J.jsx)(b,{label:t.label,px:16}):(0,J.jsx)(`span`,{"aria-label":t.label,className:C(`size-2.5 flex-none rounded-full`,ne[t.tone])}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,J.jsx)(`span`,{className:`truncate text-[15px] font-medium`,children:e.name}),(0,J.jsx)(`span`,{className:`truncate text-[13px] text-muted`,children:[t.label,e.schedule,e.nextAt&&e.enabled?`next ${X(e.nextAt)}`:``].filter(Boolean).join(` · `)})]})]})},e.id)};return(0,J.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,J.jsx)(D,{}),(0,J.jsxs)(`main`,{className:C(k,`@container flex-auto gap-4`),children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[(0,J.jsx)(w,{pixel:h.jobs,size:`lg`}),(0,J.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Jobs`}),n&&(0,J.jsx)(L,{tone:n.service.running?`pass`:`neutral`,children:n.service.running?`Service running since ${X(n.service.startedAt)}`:`Service stopped: jobs wait until it starts`}),(0,J.jsx)(`div`,{className:`flex-auto`}),(0,J.jsxs)(S,{variant:`primary`,disabled:!n,onClick:()=>f({}),children:[(0,J.jsx)(P,{size:16,"aria-hidden":`true`}),`Add a job`]})]}),(0,J.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-muted`,children:`ForgeQE commands that run on a schedule, or once, in a service of their own, so they keep going while you work on something else or with this page closed: monitors, suites, packs and pipeline watches.`}),s&&(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:s}),!n&&!s&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),n?.monitor&&!n.monitor.scheduled&&(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3 rounded-[14px] border border-accent-line bg-accent-soft px-4 py-3`,children:[(0,J.jsx)(F,{size:20,"aria-hidden":`true`,className:`flex-none text-accent-fg`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-0.5 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`The monitor in forgeqe.yaml is not scheduled`}),(0,J.jsxs)(`span`,{className:`text-ink-2`,children:[n.monitor.checks.length,` check`,n.monitor.checks.length===1?``:`s`,`, every `,n.monitor.every,`. As a job it runs a round each time, with this page closed.`]})]}),(0,J.jsx)(S,{onClick:()=>f({name:`monitor`,command:`monitor`,args:``,every:n.monitor.every}),children:`Schedule it`})]}),n&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-6 @2xl:flex-row @2xl:items-start @2xl:gap-8`,children:[(0,J.jsxs)(`nav`,{"aria-label":`Jobs`,className:`flex min-w-0 flex-col gap-4 @2xl:sticky @2xl:top-6 @2xl:w-[250px] @2xl:flex-none`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsxs)(`span`,{className:`flex items-center gap-2 px-3 text-[13px] font-medium text-muted`,children:[(0,J.jsx)(F,{size:14,"aria-hidden":`true`}),`Monitoring (`,y.length,`)`]}),y.length?(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:y.map(E)}):(0,J.jsx)(`p`,{className:`m-0 px-3 py-2 text-sm text-muted`,children:`No monitor jobs.`})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsxs)(`span`,{className:`flex items-center gap-2 px-3 text-[13px] font-medium text-muted`,children:[(0,J.jsx)(A,{size:14,"aria-hidden":`true`}),`Other jobs (`,x.length,`)`]}),x.length?(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:x.map(E)}):(0,J.jsx)(`p`,{className:`m-0 px-3 py-2 text-sm text-muted`,children:`None.`})]}),n.events.length>0&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`px-3 text-[13px] font-medium text-muted`,children:`Recent activity`}),(0,J.jsx)(j,{text:n.events.slice(0,12).map(e=>`- \`${X(e.at)}\` ${e.text.replace(/([\\`*_[\]<>#|~!])/g,`\\$1`)}`).join(`
3
- `),className:`px-3 text-[13px] text-ink-2 [&_li]:my-1 [&_ul]:my-0 [&_ul]:pl-4`})]})]}),v?(0,J.jsx)(ae,{job:v,rounds:i,busy:l,act:T}):(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-3 rounded-[18px] border border-line p-6`,children:[(0,J.jsx)(A,{size:24,"aria-hidden":`true`,className:`text-muted`}),(0,J.jsx)(`p`,{className:`m-0 max-w-[60ch] leading-relaxed text-ink-2`,children:`No jobs yet. Add one to run a suite every night, a monitor every 15 minutes, or watch a CI pipeline.`}),(0,J.jsx)(S,{onClick:()=>f({}),children:`Add a job`})]})]})]}),(0,J.jsx)(oe,{open:!!d,onClose:()=>f(null),commands:n?.commands??[],initial:d??void 0,onAdded:(e,t)=>{r(e),f(null);let n=e.jobs.find(e=>e.name===t);n&&(location.hash=_(`jobs`,encodeURIComponent(n.id)))}})]})}export{se as Jobs};
@@ -1 +0,0 @@
1
- import{E as e,G as t,Ht as n,Kn as r,Nn as i,Un as a,X as o,Z as s,_n as c,gn as l,in as u,lt as d,mt as f,ot as p,pt as m,r as h,st as g,t as _,wn as v,xt as y}from"./frame-9YY74_9h.js";import{t as b}from"./circle-dashed-Beydn7Cq.js";import{i as x,t as S}from"./markdown-DWLq2XDl.js";import{t as C}from"./external-link-BXwuemHF.js";import{t as w}from"./message-square-Bc8pM79i.js";import{n as T,t as E}from"./trending-up-5byphiAi.js";import{i as D,j as O,n as k,r as A,t as j}from"./index-bN_xd12c.js";import{n as M,t as N}from"./when-CHnpLdYw.js";var P={name:`image-off`,size:24,node:[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]};P.node;var F=c(P),I={name:`images`,size:24,node:[[`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`}]]};I.node;var L=c(I),R={name:`scan-eye`,size:24,node:[[`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`}]]};R.node;var ee=c(R),z=r(a(),1),B=m(),V=[`critical`,`serious`,`moderate`,`minor`],te={critical:`fail`,serious:`fail`,moderate:`warn`,minor:`neutral`},H=[{key:`lcp`,label:`LCP`,good:2500,poor:4e3,unit:`ms`},{key:`cls`,label:`CLS`,good:.1,poor:.25,unit:``},{key:`inp`,label:`INP`,good:200,poor:500,unit:`ms`},{key:`fcp`,label:`FCP`,good:1800,poor:3e3,unit:`ms`},{key:`ttfb`,label:`TTFB`,good:800,poor:1800,unit:`ms`},{key:`load`,label:`Load`,good:1/0,poor:1/0,unit:`ms`}],U={same:{label:`Same`,tone:`pass`},changed:{label:`Changed`,tone:`warn`},new:{label:`New baseline`,tone:`neutral`},no_baseline:{label:`No baseline`,tone:`neutral`}},W=e=>new Date(e).toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),G=(e,t)=>t?e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`:e.toFixed(3).replace(/0+$/,``).replace(/\.$/,``),K=(e,t)=>`${e} ${t}${e===1?``:`s`}`,q=e=>{try{let t=new URL(e);return`${t.host}${t.pathname}${t.search}`}catch{return e}};function ne(e){let t=[];return e.a11y&&t.push(e.a11y.failed?`${K(e.a11y.failed,`rule`)} failed`:`WCAG clean`),e.perf.over&&t.push(`${K(e.perf.over,`page`)} slow`),e.visual?.changed&&t.push(`${e.visual.changed} changed`),e.captured&&t.push(`not compared`),t.join(` · `)||`measured`}var J=e=>!!(e.breaches||e.a11y?.failed||e.perf.over||e.visual?.changed),Y=25;function X({run:e,standard:t}){let n=e.report,[r,i]=(0,z.useState)(null),[a,o]=(0,z.useState)(`all`);if(!n?.accessibility.pages)return(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`This run has no accessibility results: report.accessibility was off, or the run visited no page.`});let s=n.accessibility,c=n.breaches.filter(e=>e.kind===`accessibility`),l=a===`all`?s.failed:s.failed.filter(e=>e.impact===a),u=[{id:`all`,label:`All`,n:s.failed.length},...V.filter(e=>s.failed.some(t=>t.impact===e)).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1),n:s.failed.filter(t=>t.impact===e).length,alert:e===`critical`||e===`serious`}))];return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,B.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[t,` with `,n.engine||`axe`,`: `,K(s.passed.length,`rule`),` passed, `,s.failed.length,` failed, on `,K(s.pages,`page`),`. `,n.budgets.accessibility?c.length?`${K(c.length,`budget`)} exceeded.`:`Within the budget.`:`No budget set, so nothing here fails the run.`]}),c.map((e,t)=>(0,B.jsxs)(`p`,{className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:[q(e.page),`: `,e.text]},t)),s.failed.length?(0,B.jsxs)(B.Fragment,{children:[u.length>2&&(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,B.jsx)(j,{items:u,value:a,onChange:o})}),(0,B.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:l.map(t=>(0,B.jsx)(re,{f:t,examples:e.examples[t.rule]??[],open:r===t.rule,onToggle:()=>i(r===t.rule?null:t.rule)},t.rule))})]}):(0,B.jsx)(`p`,{className:`m-0 text-sm text-pass`,children:`No rule failed on the pages this run visited.`})]})}function re({f:e,examples:t,open:n,onToggle:r}){return(0,B.jsxs)(`li`,{className:`border-t border-line-soft first:border-t-0`,children:[(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:r,className:`flex min-h-12 w-full cursor-pointer items-center gap-3 border-0 bg-transparent px-1 py-1.5 text-left text-ink hover:bg-surface-muted`,children:[(0,B.jsx)(D,{tone:te[e.impact],className:`w-[88px] flex-none justify-center`,children:e.impact}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,B.jsx)(`span`,{className:`text-sm [overflow-wrap:anywhere]`,children:e.help}),(0,B.jsxs)(`span`,{className:`truncate text-[12px] text-muted`,children:[e.rule,e.wcag?` · WCAG ${e.wcag}${e.level?` (${e.level})`:``}`:``,` · `,K(e.count,`element`),` on `,K(e.pages,`page`)]})]})]}),(0,B.jsx)(g,{open:n,children:(0,B.jsxs)(`div`,{className:`mb-3 ml-[104px] flex flex-col gap-2 text-sm max-sm:ml-2`,children:[t.length?t.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-[10px] bg-surface-muted p-2.5`,children:[(0,B.jsxs)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:[q(e.page),e.target?` · ${e.target}`:``]}),e.html&&(0,B.jsx)(`code`,{className:`font-mono text-[12px] whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,children:e.html})]},t)):(0,B.jsx)(`span`,{className:`text-muted`,children:`No elements were kept for this rule.`}),e.helpUrl&&x(e.helpUrl)===`web`&&(0,B.jsxs)(`a`,{href:e.helpUrl,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-1 self-start text-[13px]`,children:[`How to fix it `,(0,B.jsx)(C,{size:13,"aria-hidden":`true`})]})]})})]})}function ie({run:e}){let t=e.report;if(!t?.performance.pages.length)return(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`This run has no timings: the run visited no page.`});let n=(e,t)=>e>t.poor?`poor`:e>t.good?`needs improvement`:`good`,r={poor:`text-fail`,"needs improvement":`text-warn`,good:`text-pass`};return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,B.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Core Web Vitals per page against Google's thresholds: `,(0,B.jsx)(`span`,{className:`text-pass`,children:`good`}),`, `,(0,B.jsx)(`span`,{className:`text-warn`,children:`needs improvement`}),`, `,(0,B.jsx)(`span`,{className:`text-fail`,children:`poor`}),`.`,` `,t.budgets.performance?`Pages over the budget in quality.budgets.performance are marked.`:`No performance budget set: nothing fails on timings (quality.budgets.performance).`]}),(0,B.jsx)(`div`,{className:`overflow-x-auto`,children:(0,B.jsxs)(`table`,{className:`w-full min-w-[640px] border-collapse text-sm`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{className:`text-left text-[12px] text-muted`,children:[(0,B.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:`Page`}),H.map(e=>(0,B.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:e.label},e.key)),(0,B.jsx)(`th`,{className:`py-2 pl-2 text-right font-medium`,children:`Requests`})]})}),(0,B.jsx)(`tbody`,{children:t.performance.pages.map((e,t)=>(0,B.jsxs)(`tr`,{className:`border-t border-line-soft align-top`,children:[(0,B.jsxs)(`td`,{className:`py-2 pr-3`,children:[(0,B.jsx)(`span`,{className:`block font-mono text-[12px] [overflow-wrap:anywhere]`,children:q(e.url)}),e.over.length>0&&(0,B.jsx)(`span`,{className:`text-[12px] text-fail`,children:e.over.join(`, `)})]}),H.map(t=>{let i=e[t.key];return(0,B.jsxs)(`td`,{className:f(`px-2 py-2 text-right tabular-nums`,typeof i==`number`&&t.good!==1/0?r[n(i,t)]:typeof i==`number`?`text-ink-2`:`text-muted`),children:[typeof i==`number`?G(i,t.unit):`–`,typeof i==`number`&&t.good!==1/0&&(0,B.jsxs)(`span`,{className:`sr-only`,children:[` (`,n(i,t),`)`]})]},t.key)}),(0,B.jsx)(`td`,{className:`py-2 pl-2 text-right text-muted tabular-nums`,children:e.requests?`${e.requests} · ${e.kb} KB`:`–`})]},t))})]})})]})}function Z({run:e,index:t,which:n,label:r}){let[a,o]=(0,z.useState)(``),[s,c]=(0,z.useState)(!1);return(0,z.useEffect)(()=>{let r=!1;return o(``),c(!1),i.image(e,t,n).then(e=>!r&&o(e),()=>!r&&c(!0)),()=>{r=!0}},[e,t,n]),(0,B.jsxs)(`figure`,{className:`m-0 flex min-w-0 flex-col gap-1.5`,children:[(0,B.jsx)(`figcaption`,{className:`text-[12px] font-medium text-muted`,children:r}),a?(0,B.jsx)(`img`,{src:a,alt:`${r} of the page`,className:`block h-auto w-full rounded-[10px] border border-line-soft bg-surface-muted`}):(0,B.jsx)(`span`,{className:`flex h-[120px] items-center justify-center gap-2 rounded-[10px] border border-line-soft bg-surface-muted text-[12px] text-muted`,children:s?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(F,{size:14,"aria-hidden":`true`}),` Not available`]}):`Loading…`})]})}function ae({run:e,budget:n,onChange:r}){let[a,o]=(0,z.useState)(null),[s,c]=(0,z.useState)(``),[l,u]=(0,z.useState)(!1),[p,m]=(0,z.useState)(``),[h,_]=(0,z.useState)(null),v=e.visual?.pages??[],y=v.find(e=>e.status===`changed`)?.index??null;(0,z.useEffect)(()=>_(y),[e.id,y]);let b=async e=>{u(!0),m(``);try{r(await e()),o(null),c(``)}catch(e){m(e.message)}finally{u(!1)}};if(!e.visual)return e.captured?(0,B.jsxs)(`div`,{className:`flex flex-col items-start gap-3`,children:[(0,B.jsxs)(`p`,{className:`m-0 text-sm text-ink-2`,children:[`This run captured `,K(e.captured,`page`),` but they were not compared with the baselines yet.`]}),(0,B.jsxs)(d,{variant:`primary`,disabled:l,onClick:()=>b(()=>i.compare(e.id)),children:[(0,B.jsx)(ee,{size:16,"aria-hidden":`true`}),`Compare with the baselines`]}),p&&(0,B.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:p})]}):(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`This run has no visual captures: quality.visual.enabled was off, or the run visited no page.`});let x=v.filter(e=>e.status===`changed`);return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsxs)(`p`,{className:`m-0 flex-1 text-[13px] text-muted`,children:[`Each page captured with animations frozen and masked regions hidden, against its approved baseline. `,n?`A page over quality.budgets.visual fails the run.`:`No visual budget set: a change does not fail the run (quality.budgets.visual).`]}),x.length>1&&(0,B.jsxs)(d,{disabled:l,onClick:()=>o(x.map(e=>e.url)),children:[`Approve all `,x.length,` changes`]})]}),a&&(0,B.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Approve as baseline`,className:`flex flex-col gap-3 rounded-[12px] border border-accent-line bg-accent-soft p-4`,children:[(0,B.jsxs)(`span`,{className:`font-medium`,children:[`Make this run's capture the baseline of `,a.length===1?q(a[0]):K(a.length,`page`),`?`]}),(0,B.jsx)(`span`,{className:`text-sm text-ink-2`,children:`Later runs are compared with it. Approve only a change that was intended; one that was not is a visual defect.`}),(0,B.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[`Why it changed (kept with the baseline)`,(0,B.jsx)(t,{value:s,maxLength:300,placeholder:`New checkout banner`,onChange:e=>c(e.target.value),className:`max-w-[480px] bg-bg`})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsxs)(d,{variant:`primary`,disabled:l,onClick:()=>b(()=>i.approve(e.id,a,s.trim()||void 0)),children:[(0,B.jsx)(O,{size:16,"aria-hidden":`true`}),`Approve`]}),(0,B.jsx)(d,{onClick:()=>o(null),children:`Cancel`})]})]}),p&&(0,B.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:p}),(0,B.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:v.map(t=>(0,B.jsxs)(`li`,{className:`border-t border-line-soft first:border-t-0`,children:[(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":h===t.index,onClick:()=>_(h===t.index?null:t.index),className:`flex min-h-[52px] w-full cursor-pointer items-center gap-3 border-0 bg-transparent px-1 py-2 text-left text-ink hover:bg-surface-muted`,children:[(0,B.jsx)(L,{size:16,"aria-hidden":`true`,className:`flex-none text-muted`}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,B.jsx)(`span`,{className:`text-sm [overflow-wrap:anywhere]`,children:t.title||q(t.url)}),(0,B.jsxs)(`span`,{className:`truncate text-[12px] text-muted`,children:[q(t.url),t.size?` · ${t.size}`:``,t.resized?` · resized ${t.resized}`:``]})]}),t.status===`changed`&&(0,B.jsxs)(`span`,{className:f(`text-sm tabular-nums`,t.over?`text-fail`:`text-warn`),children:[t.diffPercent,`%`,t.limit===void 0?``:` / ${t.limit}%`]}),(0,B.jsx)(D,{tone:t.over?`fail`:U[t.status].tone,children:t.over?`Over budget`:U[t.status].label})]}),(0,B.jsx)(g,{open:h===t.index,children:(0,B.jsxs)(`div`,{className:`mb-4 flex flex-col gap-3 px-1`,children:[(0,B.jsxs)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(160px,1fr))] gap-3`,children:[t.images.baseline&&(0,B.jsx)(Z,{run:e.id,index:t.index,which:`baseline`,label:`Baseline`}),t.images.current&&(0,B.jsx)(Z,{run:e.id,index:t.index,which:`current`,label:`This run`}),t.images.diff&&(0,B.jsx)(Z,{run:e.id,index:t.index,which:`diff`,label:`Difference (in red)`})]}),t.status===`changed`&&(0,B.jsxs)(d,{className:`self-start`,disabled:l,onClick:()=>o([t.url]),children:[(0,B.jsx)(O,{size:16,"aria-hidden":`true`}),`Approve as the new baseline`]})]})})]},t.index))})]})}function Q({values:e}){if(e.length<2)return null;let t=Math.max(1,...e),n=e.map((n,r)=>`${r/(e.length-1)*96+2},${22-n/t*20}`).join(` `);return(0,B.jsx)(`svg`,{width:`100`,height:`24`,viewBox:`0 0 100 24`,"aria-label":`Violations over the last ${e.length} runs: ${e.join(`, `)}`,role:`img`,className:`flex-none text-muted`,children:(0,B.jsx)(`polyline`,{points:n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinejoin:`round`})})}function $({icon:e,className:t,lines:n}){return n.length?(0,B.jsxs)(`span`,{className:f(`flex items-start gap-1.5 text-[13px]`,t),children:[(0,B.jsx)(e,{size:14,"aria-hidden":`true`,className:`mt-0.5 flex-none`}),(0,B.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:n.join(` · `)})]}):null}function oe({trends:e}){return e.length?(0,B.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.map(e=>{let t=e.a11y.latest?V.reduce((t,n)=>t+(e.a11y.latest[n]||0),0):void 0;return(0,B.jsxs)(`li`,{className:`flex flex-col gap-1.5 border-t border-line-soft py-3 first:border-t-0`,children:[(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-3`,children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-[1_1_240px] font-mono text-[13px] [overflow-wrap:anywhere]`,children:e.page}),(0,B.jsx)(Q,{values:e.a11y.trail}),(0,B.jsxs)(`span`,{className:`text-[12px] text-muted`,children:[K(e.runs,`run`),t===void 0?``:` · ${K(t,`violation`)} now`]})]}),(0,B.jsx)($,{icon:E,className:`text-fail`,lines:[...e.perf.worse.map(e=>`slower: ${e}`),...e.a11y.newRules.map(e=>`newly failing: ${e}`)]}),(0,B.jsx)($,{icon:T,className:`text-pass`,lines:[...e.perf.better.map(e=>`faster: ${e}`),...e.a11y.fixedRules.map(e=>`fixed: ${e}`)]})]},e.page)})}):(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No history yet: every browser run adds each page's accessibility and timings to quality-history.json in the reports folder.`})}function se({id:e,view:t,onChanged:r}){let[a,o]=(0,z.useState)(null),[c,p]=(0,z.useState)(``),[m,h]=(0,z.useState)(`accessibility`),[g,_]=(0,z.useState)(``);if((0,z.useEffect)(()=>{let t=!1;return o(null),i.run(e).then(e=>{if(t)return;o(e),p(``);let n=e.visual?.pages.some(e=>e.status===`changed`)||!e.visual&&e.captured;h(e.report?.breaches.some(e=>e.kind===`performance`)&&!e.report.accessibility.failed.length?`performance`:n&&!e.report?.accessibility.failed.length?`visual`:e.report?.accessibility.pages?`accessibility`:e.report?.performance.pages.length?`performance`:`visual`)},e=>!t&&p(e.message)),()=>{t=!0}},[e]),c)return(0,B.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:c});if(!a)return(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Loading…`});let x=async()=>{try{let{id:e}=await v.start(`Explain the accessibility, performance and visual results of the run in ${a.dir}: call quality_report and visual_compare with run_dir ${a.dir}. Say what matters most to fix first, and why.`,{});location.hash=s(`chats`,e)}catch(e){_(e.message)}},C=a.report,T=C?.accessibility.failed??[],E=V.find(e=>T.some(t=>t.impact===e)),D=C?.performance.pages.filter(e=>e.over.length).length??0,k=a.visual?.pages.filter(e=>e.status===`changed`).length??0,A=e=>!!C?.breaches.some(t=>t.kind===e),j=[{id:`accessibility`,label:`Accessibility`,icon:l,state:C?.accessibility.pages?A(`accessibility`)||E===`critical`?`fail`:T.length?`warn`:`pass`:`none`,headline:C?.accessibility.pages?T.length?`${K(T.length,`rule`)} failed`:`No rule failed`:`Not measured`,note:C?.accessibility.pages?V.filter(e=>C.accessibility.byImpact[e]).map(e=>`${C.accessibility.byImpact[e]} ${e}`).join(` · `)||`${K(C.accessibility.pages,`page`)} checked`:``},{id:`performance`,label:`Performance`,icon:n,state:C?.performance.pages.length?A(`performance`)?`fail`:D?`warn`:`pass`:`none`,headline:C?.performance.pages.length?D?`${K(D,`page`)} over budget`:`Within budget`:`Not measured`,note:C?.performance.pages.length?`${K(C.performance.pages.length,`page`)} timed`:``},{id:`visual`,label:`Visual`,icon:L,state:a.visual?A(`visual`)?`fail`:k?`warn`:`pass`:`none`,headline:a.visual?k?`${K(k,`page`)} changed`:`No change`:a.captured?`Not compared yet`:`Not captured`,note:a.visual?`${K(a.visual.pages.length,`page`)} against the baseline`:a.captured?`${K(a.captured,`page`)} captured`:``}],M={pass:O,warn:y,fail:u,none:b},N={pass:`text-pass`,warn:`text-warn`,fail:`text-fail`,none:`text-muted`};return(0,B.jsxs)(`section`,{"aria-labelledby":`run-h`,className:`flex min-w-0 flex-1 flex-col gap-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1`,children:[(0,B.jsx)(`h2`,{id:`run-h`,title:a.goal,className:`m-0 line-clamp-2 text-[20px] leading-snug font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:a.goal}),(0,B.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 text-[13px] text-muted`,children:[W(a.at),` · `,(0,B.jsx)(S,{path:a.dir})]})]}),(0,B.jsxs)(d,{size:`sm`,variant:`ghost`,onClick:()=>void x(),children:[(0,B.jsx)(w,{size:15,"aria-hidden":`true`}),`Ask in a chat`]})]}),g&&(0,B.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:g}),(0,B.jsx)(`div`,{role:`tablist`,"aria-label":`Results`,className:`grid gap-2 @xl:grid-cols-3`,children:j.map(e=>{let t=M[e.state];return(0,B.jsxs)(`button`,{type:`button`,role:`tab`,id:`tab-${e.id}`,"aria-selected":m===e.id,"aria-controls":`panel-${e.id}`,onClick:()=>h(e.id),className:f(`flex min-w-0 cursor-pointer flex-col gap-1 rounded-[14px] border px-4 py-3 text-left`,m===e.id?`border-accent bg-accent-soft`:`border-line-soft bg-bg hover:bg-surface-muted`),children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[13px] text-muted`,children:[(0,B.jsx)(e.icon,{size:14,"aria-hidden":`true`}),e.label]}),(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[16px] font-semibold text-ink`,children:[(0,B.jsx)(t,{size:16,"aria-hidden":`true`,className:f(`flex-none`,N[e.state])}),e.headline]}),e.note&&(0,B.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.note})]},e.id)})}),(0,B.jsxs)(`div`,{role:`tabpanel`,id:`panel-${m}`,"aria-labelledby":`tab-${m}`,className:`flex min-w-0 flex-col`,children:[m===`accessibility`&&(0,B.jsx)(X,{run:a,standard:t.standard}),m===`performance`&&(0,B.jsx)(ie,{run:a}),m===`visual`&&(0,B.jsx)(ae,{run:a,budget:t.budgets.visual,onChange:e=>{o(e),r()}})]}),m===`accessibility`&&a.report?.accessibility.pages?(0,B.jsx)(`p`,{className:`m-0 text-[12px] text-muted`,children:t.disclaimer}):null]})}function ce({sub:t}){let[n,r]=(0,z.useState)(null),[a,c]=(0,z.useState)(``),[d,m]=(0,z.useState)(t===`trends`?`trends`:`runs`),g=(0,z.useCallback)(()=>{i.view().then(e=>{r(e),c(``)},e=>c(e.message))},[]);(0,z.useEffect)(g,[g]);let v=t&&t!==`trends`?decodeURIComponent(t):``;(0,z.useEffect)(()=>{t===`trends`?m(`trends`):t&&m(`runs`)},[t]);let b=(0,z.useMemo)(()=>n?.runs.find(e=>e.id===v)||n?.runs[0],[n,v]),x=n?.trends.filter(e=>e.perf.worse.length||e.a11y.newRules.length).length??0,[S,C]=(0,z.useState)(``),[w,T]=(0,z.useState)(`all`),[E,D]=(0,z.useState)(0);(0,z.useEffect)(()=>D(0),[S,w]);let P=S.toLowerCase().split(/\s+/).filter(Boolean),F=(n?.runs??[]).filter(e=>P.every(t=>e.goal.toLowerCase().includes(t))),I=w===`attention`?F.filter(J):F;return(0,B.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,B.jsx)(h,{}),(0,B.jsxs)(`main`,{className:f(_,`@container flex-auto gap-4`),children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,B.jsx)(p,{pixel:o.quality,size:`lg`}),(0,B.jsx)(`h1`,{className:`m-0 flex-1 text-[26px] font-semibold tracking-[-0.01em]`,children:`Quality`})]}),(0,B.jsxs)(`p`,{className:`m-0 max-w-[74ch] text-sm leading-relaxed text-muted`,children:[`What each browser run measured on the pages it visited: accessibility (`,n?.standard||`WCAG`,`), Core Web Vitals, and visual changes against approved baselines. Budgets (quality.budgets) decide what fails a run.`]}),a&&(0,B.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}),!n&&!a&&(0,B.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),n&&(0,B.jsx)(e,{label:`Quality`,current:d,onPick:e=>{m(e),e===`trends`?location.hash=s(`quality`,`trends`):location.hash=b?s(`quality`,encodeURIComponent(b.id)):s(`quality`)},tabs:[{id:`runs`,label:`Runs (${n.runs.length})`},{id:`trends`,label:`Trends${x?` (${x} worse)`:``}`}]}),n&&d===`trends`&&(0,B.jsx)(`div`,{role:`tabpanel`,id:`panel-trends`,"aria-labelledby":`tab-trends`,children:(0,B.jsx)(oe,{trends:n.trends})}),n&&d===`runs`&&(n.runs.length?(0,B.jsxs)(`div`,{role:`tabpanel`,id:`panel-runs`,"aria-labelledby":`tab-runs`,className:`flex flex-col gap-6 @2xl:flex-row @2xl:items-start @2xl:gap-8`,children:[(0,B.jsxs)(`nav`,{"aria-label":`Runs`,className:`flex min-w-0 flex-col gap-2 @2xl:sticky @2xl:top-6 @2xl:w-[290px] @2xl:flex-none`,children:[(0,B.jsx)(A,{id:`quality-search`,label:`Find a run`,value:S,onChange:C,className:`flex-none`}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,B.jsx)(j,{items:[{id:`all`,label:`All`,n:F.length},{id:`attention`,label:`Needs a look`,n:F.filter(J).length,alert:!0}],value:w,onChange:T})}),(0,B.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[I.length===0&&(0,B.jsx)(`li`,{className:`px-3 py-3 text-sm text-muted`,children:`Nothing matches.`}),I.slice(E*Y,E*Y+Y).map((e,t,n)=>{let r=M(e.at),i=e.breaches?u:J(e)?y:O;return(0,B.jsxs)(`li`,{className:`contents`,children:[(t===0||M(n[t-1].at)!==r)&&(0,B.jsx)(`span`,{className:`block px-3 pt-2 pb-1 text-[12px] font-semibold text-muted`,children:r}),(0,B.jsxs)(`a`,{href:s(`quality`,encodeURIComponent(e.id)),"aria-current":b?.id===e.id?`page`:void 0,className:f(`flex min-h-12 items-center gap-2.5 rounded-[10px] px-3 py-1.5 text-ink no-underline`,b?.id===e.id?`bg-surface-strong hover:text-ink`:`hover:bg-surface-muted hover:text-ink`),children:[(0,B.jsx)(i,{size:16,"aria-label":e.breaches?`Over a budget`:J(e)?`Needs a look`:`Within budgets`,className:f(`flex-none`,e.breaches?`text-fail`:J(e)?`text-warn`:`text-pass`)}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,B.jsx)(`span`,{className:`truncate text-[14px] font-medium`,title:e.goal,children:e.goal}),(0,B.jsx)(`span`,{className:`truncate text-[12px] text-muted`,children:ne(e)})]}),(0,B.jsx)(`span`,{className:`flex-none text-[12px] text-muted tabular-nums`,children:N(e.at)})]})]},e.id)})]}),I.length>Y&&(0,B.jsx)(k,{page:E,size:Y,total:I.length,onPage:D,label:`Pages of runs`})]}),b&&(0,B.jsx)(se,{id:b.id,view:n,onChanged:g})]}):(0,B.jsxs)(`div`,{className:`flex flex-col items-start gap-3 rounded-[18px] border border-line p-6`,children:[(0,B.jsx)(l,{size:24,"aria-hidden":`true`,className:`text-muted`}),(0,B.jsx)(`p`,{className:`m-0 max-w-[62ch] leading-relaxed text-ink-2`,children:`No run has measured anything yet. Every browser run checks accessibility, timings and visual changes of the pages it visits; run a flow from a chat or the Record page, and its results show here.`})]}))]})]})}export{ce as Quality};