@piwitests/server 0.23.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{Clg2Qx0r.js → -COcylA_.js} +1 -1
- package/.output/public/_nuxt/03FA4-rI.js +1 -0
- package/.output/public/_nuxt/{B7tiBVLW.js → 5a7jHE9s.js} +1 -1
- package/.output/public/_nuxt/{roaTZkYi.js → 6Z_ZwH8I.js} +1 -1
- package/.output/public/_nuxt/{xZQGtnVA.js → 7ZHq6PCI.js} +1 -1
- package/.output/public/_nuxt/{5SkLJHl8.js → 98sAB6Gu.js} +1 -1
- package/.output/public/_nuxt/{DnxrNGE_.js → B--J7VNt.js} +1 -1
- package/.output/public/_nuxt/{DJzFYrBt.js → B1LUinhp.js} +1 -1
- package/.output/public/_nuxt/{axj2iIDK.js → B33YjaHr.js} +1 -1
- package/.output/public/_nuxt/B69RP95P.js +1 -0
- package/.output/public/_nuxt/{DNKZmhbX.js → B8H4XydJ.js} +1 -1
- package/.output/public/_nuxt/{DmqCquDx.js → B8Xm4_S_.js} +1 -1
- package/.output/public/_nuxt/{Ya8ZzWuY.js → BBhrClA9.js} +1 -1
- package/.output/public/_nuxt/{BZFiz2UB.js → BCGljaM0.js} +1 -1
- package/.output/public/_nuxt/{oSLbl-p0.js → BFxvHlO9.js} +1 -1
- package/.output/public/_nuxt/{PDSNX4Te.js → BKrWWV14.js} +1 -1
- package/.output/public/_nuxt/BN1zZw5b.js +9 -0
- package/.output/public/_nuxt/{Dbf8eT28.js → BPXqL9vK.js} +1 -1
- package/.output/public/_nuxt/{DgEa6_av.js → BUnwEAjq.js} +1 -1
- package/.output/public/_nuxt/{CUOS6S13.js → BVLqydCr.js} +1 -1
- package/.output/public/_nuxt/{CvVbKrcH.js → BWMSVSNM.js} +1 -1
- package/.output/public/_nuxt/{Wk7ZKG4B.js → B_r0xHVS.js} +1 -1
- package/.output/public/_nuxt/{DAhv9aNg.js → BakMHV79.js} +1 -1
- package/.output/public/_nuxt/{BDUfBn3i.js → Bd8B-yeR.js} +1 -1
- package/.output/public/_nuxt/{sqqg4oXL.js → BevElZaK.js} +1 -1
- package/.output/public/_nuxt/{B0tmRAhY.js → BfA6lfg4.js} +1 -1
- package/.output/public/_nuxt/{D3SJGdl4.js → Bg93Rnts.js} +1 -1
- package/.output/public/_nuxt/{Ck_fTH5z.js → BgABj4Ty.js} +1 -1
- package/.output/public/_nuxt/{B2L0-Lzp.js → BkM2KXUo.js} +1 -1
- package/.output/public/_nuxt/{CBJFORiZ.js → BkxRbXIj.js} +1 -1
- package/.output/public/_nuxt/{Bsc11YIJ.js → Bme1UkOl.js} +1 -1
- package/.output/public/_nuxt/{BfcMJBTf.js → BmzxRbcg.js} +1 -1
- package/.output/public/_nuxt/{D7fxV-UA.js → Bn0jaRxI.js} +1 -1
- package/.output/public/_nuxt/{C77tM5Hz.js → BoNKdx5o.js} +1 -1
- package/.output/public/_nuxt/{Bb2mDqKr.js → Bp3FRuEm.js} +1 -1
- package/.output/public/_nuxt/{BjOFxi54.js → BrUBOQ0y.js} +1 -1
- package/.output/public/_nuxt/{DXkFgrsT.js → BtSGUY-7.js} +1 -1
- package/.output/public/_nuxt/{QZYo3ErV.js → BtbpLWDs.js} +1 -1
- package/.output/public/_nuxt/{Bag08cIY.js → BvAfKk6C.js} +1 -1
- package/.output/public/_nuxt/{BOvtXn3m.js → BwEN1fJ1.js} +1 -1
- package/.output/public/_nuxt/{DYjxDsYC.js → C-XjxjG5.js} +1 -1
- package/.output/public/_nuxt/{RkNtgoTD.js → C3W_wyr9.js} +1 -1
- package/.output/public/_nuxt/{CNu3kken.js → C5TrTuWv.js} +3 -3
- package/.output/public/_nuxt/{B4mZElvM.js → C7D5Wl7T.js} +1 -1
- package/.output/public/_nuxt/{ZLfZolDM.js → C7fq_rHE.js} +1 -1
- package/.output/public/_nuxt/{B_JSV0yG.js → C8Paf_V1.js} +1 -1
- package/.output/public/_nuxt/{C2_7XZo0.js → CD8ZzAFC.js} +1 -1
- package/.output/public/_nuxt/{CTTmX4gy.js → CDTeSrLO.js} +1 -1
- package/.output/public/_nuxt/{CLWMETf9.js → CGHV0Y2d.js} +1 -1
- package/.output/public/_nuxt/{AQ86C4c2.js → CIpF9l75.js} +1 -1
- package/.output/public/_nuxt/{jR2xm3_t.js → CJ1rmnk4.js} +1 -1
- package/.output/public/_nuxt/{7_9fts7T.js → CMuzkARi.js} +1 -1
- package/.output/public/_nuxt/{a8Z6VC7V.js → COuZu9FO.js} +1 -1
- package/.output/public/_nuxt/{D7t0Dn3h.js → CX5Q0dZ8.js} +1 -1
- package/.output/public/_nuxt/{9_aJhhcm.js → CX_G-FHC.js} +14 -14
- package/.output/public/_nuxt/{C9I1Dp3S.js → Ce5_Tq63.js} +1 -1
- package/.output/public/_nuxt/{BtZNYmZO.js → Cf4MFOuf.js} +1 -1
- package/.output/public/_nuxt/{mi22nGUC.js → CgkXEZMo.js} +1 -1
- package/.output/public/_nuxt/{Ce89VyHE.js → CjBktNrC.js} +1 -1
- package/.output/public/_nuxt/{Bj_v57Zu.js → CjtjQV60.js} +1 -1
- package/.output/public/_nuxt/{BuGAn4f7.js → CpcrljrH.js} +1 -1
- package/.output/public/_nuxt/{6vX5JdHr.js → Cq33x7yV.js} +1 -1
- package/.output/public/_nuxt/{jxc14CqP.js → CsV7pmcT.js} +1 -1
- package/.output/public/_nuxt/{DTrPCv7R.js → Cu2Q4iPh.js} +1 -1
- package/.output/public/_nuxt/{DylyATWU.js → CyLcEDg2.js} +1 -1
- package/.output/public/_nuxt/{Ce_j5NtN.js → D0Kop4bS.js} +1 -1
- package/.output/public/_nuxt/{DCE2_MKD.js → D1Y43xM1.js} +1 -1
- package/.output/public/_nuxt/{499RbBSX.js → D1vqYZsL.js} +1 -1
- package/.output/public/_nuxt/{BjMo2tKC.js → D2rZosKf.js} +1 -1
- package/.output/public/_nuxt/D7jpwkRG.js +5 -0
- package/.output/public/_nuxt/{BFYkWpPx.js → D8NAb7VE.js} +1 -1
- package/.output/public/_nuxt/{CIQeRUSy.js → D8vguZKg.js} +1 -1
- package/.output/public/_nuxt/{Bq4_kqIp.js → DEvYVl9M.js} +1 -1
- package/.output/public/_nuxt/{DBWM_xs-.js → DF6Mes5z.js} +1 -1
- package/.output/public/_nuxt/{CGDPUNcO.js → DGq4A2Pd.js} +1 -1
- package/.output/public/_nuxt/{CF_eDZHu.js → DH5H1DJh.js} +1 -1
- package/.output/public/_nuxt/{kWnH8yJq.js → DL8knjzi.js} +1 -1
- package/.output/public/_nuxt/{CC8wk-N0.js → DM3bDZC6.js} +1 -1
- package/.output/public/_nuxt/{Ce47NgZw.js → DMAiMrNr.js} +1 -1
- package/.output/public/_nuxt/{HbnAkiyK.js → DMWfVJCj.js} +1 -1
- package/.output/public/_nuxt/{B3AG2m76.js → DMsm-RGQ.js} +1 -1
- package/.output/public/_nuxt/{DeewM3Wg.js → DMtrFQqi.js} +1 -1
- package/.output/public/_nuxt/{D1Ucra3E.js → DPZBpFOX.js} +1 -1
- package/.output/public/_nuxt/{DiWxW-w3.js → DVEGfqtt.js} +1 -1
- package/.output/public/_nuxt/{DZ-KbUZi.js → D_y2VS8k.js} +1 -1
- package/.output/public/_nuxt/DaNC-xl1.js +1 -0
- package/.output/public/_nuxt/{DZECGgZm.js → DbmGeOus.js} +1 -1
- package/.output/public/_nuxt/{HIGGZ_c-.js → DcLbz6DV.js} +1 -1
- package/.output/public/_nuxt/{B_MVJP17.js → DcR0Mmdl.js} +1 -1
- package/.output/public/_nuxt/{DNqm5cWU.js → DhYznn-U.js} +1 -1
- package/.output/public/_nuxt/DhuRRlmK.js +1 -0
- package/.output/public/_nuxt/{pZbe82l5.js → Drw8yQg6.js} +1 -1
- package/.output/public/_nuxt/{CPQRQqXU.js → DuO5wfAC.js} +1 -1
- package/.output/public/_nuxt/{FJTsZ5Aa.js → DuOH5jcQ.js} +1 -1
- package/.output/public/_nuxt/{BM5BPKlc.js → DvEsAuE9.js} +1 -1
- package/.output/public/_nuxt/{dUPMBJ4f.js → Dz6g_QJT.js} +1 -1
- package/.output/public/_nuxt/{BAbrtVp3.js → DzZpIs4W.js} +1 -1
- package/.output/public/_nuxt/DzzNS-K1.js +1 -0
- package/.output/public/_nuxt/{BwwfasRt.js → Fsw2W4TA.js} +1 -1
- package/.output/public/_nuxt/{CdEzDaDI.js → LwoTUb-r.js} +1 -1
- package/.output/public/_nuxt/{DuBtaw3j.js → OfPjZaky.js} +1 -1
- package/.output/public/_nuxt/{LTMoFvEY.js → P5uOaRUZ.js} +1 -1
- package/.output/public/_nuxt/{B3G-TIoP.js → Qo6oszaF.js} +1 -1
- package/.output/public/_nuxt/{DprkT7rM.js → T5UuMUxA.js} +1 -1
- package/.output/public/_nuxt/UY8pjaZA.js +1 -0
- package/.output/public/_nuxt/{CmTzxoQt.js → V9p3z39z.js} +1 -1
- package/.output/public/_nuxt/{5QBnDbs_.js → VACXezo0.js} +1 -1
- package/.output/public/_nuxt/{6sA-GK37.js → YmCeJkZ2.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/70224ee0-4d1f-45d2-b380-2ecb18064bf1.json +1 -0
- package/.output/public/_nuxt/entry.DzPSf_u5.css +1 -0
- package/.output/public/_nuxt/fXUwH_3d.js +1 -0
- package/.output/public/_nuxt/{CAoQUDI4.js → opwuUqHG.js} +1 -1
- package/.output/public/_nuxt/{2yLW7WU0.js → opyDpgSw.js} +1 -1
- package/.output/public/_nuxt/{B070fjS-.js → sVV8xB9f.js} +1 -1
- package/.output/public/_nuxt/{C6t4kxaa.js → xa5UHCot.js} +1 -1
- package/.output/server/chunks/_/collect.mjs +1 -1
- package/.output/server/chunks/_/markers.mjs +1 -1
- package/.output/server/chunks/_/quarantine.mjs +1 -1
- package/.output/server/chunks/_/users.mjs +1 -1
- package/.output/server/chunks/build/Checkbox-BisdHf8n.mjs +1 -1
- package/.output/server/chunks/build/CodeBlock-B8BNtZAe.mjs +1 -1
- package/.output/server/chunks/build/DashboardSidebarToggle-C3HdHvlE.mjs +1 -1
- package/.output/server/chunks/build/DiagnosisPanel-BVb2LgHu.mjs +1 -1
- package/.output/server/chunks/build/DiagnosisResult-xVgZlfKK.mjs +1 -1
- package/.output/server/chunks/build/EntityLinks-Dzn73fbq.mjs +1 -1
- package/.output/server/chunks/build/HelpHint-plioHKA0.mjs +27 -0
- package/.output/server/chunks/build/NavigationMenu-RfBOyS32.mjs +1 -1
- package/.output/server/chunks/build/OpenInIdeLink-Jp6SzEtD.mjs +1 -1
- package/.output/server/chunks/build/RunReports-nuLb-Nm3.mjs +1 -1
- package/.output/server/chunks/build/Select-CEyw7HGK.mjs +1 -1
- package/.output/server/chunks/build/SelectMenu-C02Hs2_F.mjs +1 -1
- package/.output/server/chunks/build/Table-qZdnm9t2.mjs +1 -1
- package/.output/server/chunks/build/Tooltip-BI3WQErw.mjs +1 -1
- package/.output/server/chunks/build/{_id_-D7UtAIPR.mjs → _id_-26komi8G.mjs} +15 -8
- package/.output/server/chunks/build/{_id_-D7UtAIPR.mjs.map → _id_-26komi8G.mjs.map} +1 -1
- package/.output/server/chunks/build/{_id_-CrGTZymJ.mjs → _id_-w7YCSiiy.mjs} +2 -2
- package/.output/server/chunks/build/{_id_-CrGTZymJ.mjs.map → _id_-w7YCSiiy.mjs.map} +1 -1
- package/.output/server/chunks/build/_id_-wiULjAVc.mjs +1 -1
- package/.output/server/chunks/build/ai-DYhpzbqp.mjs +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/{db.client-Bdqk_eYQ.mjs → db.client-DijpEH6i.mjs} +3 -1
- package/.output/server/chunks/build/db.client-DijpEH6i.mjs.map +1 -0
- package/.output/server/chunks/build/{default-DO1izI2V.mjs → default-CQa_bmAf.mjs} +2 -2
- package/.output/server/chunks/build/{default-DO1izI2V.mjs.map → default-CQa_bmAf.mjs.map} +1 -1
- package/.output/server/chunks/build/fetch-tkz5_OA-.mjs +1 -1
- package/.output/server/chunks/build/import-B27Sv7h5.mjs +1 -1
- package/.output/server/chunks/build/{index-vRwzDXLs.mjs → index-Dq6nk6OB.mjs} +367 -87
- package/.output/server/chunks/build/index-Dq6nk6OB.mjs.map +1 -0
- package/.output/server/chunks/build/isValueEqualOrExist-D4lZ8uRY.mjs +1 -1
- package/.output/server/chunks/build/login-hxCF06JT.mjs +1 -1
- package/.output/server/chunks/build/mcp-BVW1llyW.mjs +1 -1
- package/.output/server/chunks/build/server.mjs +6 -6
- package/.output/server/chunks/build/settings-metadata-DnAK4Rzg.mjs +1 -1
- package/.output/server/chunks/build/storage-zN92cA9q.mjs +1 -1
- package/.output/server/chunks/build/test-functions-DVRJgiWo.mjs +1 -1
- package/.output/server/chunks/build/{useCopyRich-CZxJ7IY_.mjs → useCopyRich-BM9GTjJi.mjs} +64 -18
- package/.output/server/chunks/build/{useCopyRich-CZxJ7IY_.mjs.map → useCopyRich-BM9GTjJi.mjs.map} +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +1037 -733
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/__piwi/session.get.mjs +1 -1
- package/.output/server/chunks/routes/api/ai/step-resolution.post.mjs +88 -0
- package/.output/server/chunks/routes/api/ai/step-resolution.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/analytics/_widget_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/change-password.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/forgot-password.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/login.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/logout.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/me.get.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/oauth/_provider/callback.get.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/oauth/_provider/login.get.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/oauth/_provider/unlink.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/reset-password.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/send-verify-email.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/setup.get.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/setup.post.mjs +1 -1
- package/.output/server/chunks/routes/api/auth/verify-email.get.mjs +1 -1
- package/.output/server/chunks/routes/api/channels/_id/test.post.mjs +1 -1
- package/.output/server/chunks/routes/api/channels/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/cluster-merge-suggestions/_id/approve.post.mjs +1 -1
- package/.output/server/chunks/routes/api/cluster-merge-suggestions/_id/reject.post.mjs +1 -1
- package/.output/server/chunks/routes/api/desktop/import-local.post.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/base-commit.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/branches.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/commit-diff.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/commits.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/context.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/diagnose/stream.post.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/diagnose.post.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/diagnoses.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/diagnosis.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/export.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/extract-cases.post.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/fix-plan.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/status.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-diagnoses/_id/feedback.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/files/_...path_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +1 -1
- package/.output/server/chunks/routes/api/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/index.get2.mjs +1 -1
- package/.output/server/chunks/routes/api/index.get3.mjs +1 -1
- package/.output/server/chunks/routes/api/index.get4.mjs +1 -1
- package/.output/server/chunks/routes/api/index.get5.mjs +1 -1
- package/.output/server/chunks/routes/api/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/index.post2.mjs +1 -1
- package/.output/server/chunks/routes/api/index.post3.mjs +1 -1
- package/.output/server/chunks/routes/api/index.post4.mjs +1 -1
- package/.output/server/chunks/routes/api/index.post5.mjs +1 -1
- package/.output/server/chunks/routes/api/index.post6.mjs +1 -1
- package/.output/server/chunks/routes/api/links/_id/refresh.post.mjs +1 -1
- package/.output/server/chunks/routes/api/links/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/links/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/markers/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/markers/_id_.put.mjs +1 -1
- package/.output/server/chunks/routes/api/notifications/stream.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/ai-steps.get.mjs +63 -0
- package/.output/server/chunks/routes/api/projects/_id/ai-steps.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/projects/_id/cluster-merge-suggestions.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/failure-clusters.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/flaky-classify.post.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/flaky-tests.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/latest-run.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/markers.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/markers.post.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/members.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/members.put.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/performance.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/quarantine/_testCaseId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/quarantine.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/quarantine.post.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/slow-tests.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/spec-health.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/test-cases.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/test-functions/extract.post.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/test-functions/validate-proposal.post.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/test-functions.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/test-functions.post.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/timeout-opportunities.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id_.put.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/menu.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/overview.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects.get.mjs +1 -1
- package/.output/server/chunks/routes/api/search.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/ai/limits.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/ai/limits.put.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/ai/test.post.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/ai/usage.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/ai.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/ai.put.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/pr-feedback.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/pr-feedback.put.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/smtp/test.post.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/smtp.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/timeout-hygiene.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/timeout-hygiene.put.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/wasted-waits.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/wasted-waits.put.mjs +1 -1
- package/.output/server/chunks/routes/api/setup-status.get.mjs +1 -1
- package/.output/server/chunks/routes/api/stream.get.mjs +1 -1
- package/.output/server/chunks/routes/api/subscriptions/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/subscriptions/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/tags/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/tags/_id_.put.mjs +1 -1
- package/.output/server/chunks/routes/api/test-cases/_id/history.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-cases/_id/stability-trend.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-cases/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-functions/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/test-functions/_id_.put.mjs +1 -1
- package/.output/server/chunks/routes/api/test-run-cases/_id/diagnose.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-run-cases/_id/diagnosis-context.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-run-cases/_id/diagnosis.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-run-cases/_id/export.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-run-cases/_id/traces.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-run-cases/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/begin.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/case-files.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/dom-snapshot.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/environment-diff.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/locator-healing.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/locator-pick.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/trace-network-body.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/trace-network.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/trace-stacks.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/visual-diff.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/events.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/failure-groups.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/finish.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/gate.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/heartbeat.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/insights.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/network-requests.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/regression-context.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/stream.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/summary.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/import/check.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/import.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/recent.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/setup.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/start.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/submit.post.mjs +3 -1
- package/.output/server/chunks/routes/api/test-runs/submit.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/test-runs/upload.post.mjs +2 -1
- package/.output/server/chunks/routes/api/test-runs/upload.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tests/cleanup.delete.mjs +2 -1
- package/.output/server/chunks/routes/api/tests/cleanup.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/traces/check.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id/api-keys/_keyId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id/invite.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id/projects.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id/projects.put.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/version.get.mjs +1 -1
- package/.output/server/chunks/routes/mcp.post.mjs +1 -1
- package/.output/server/chunks/routes/renderer.mjs +1 -1
- package/.output/server/database/migrations/0045_productive_stingray.sql +1 -0
- package/.output/server/database/migrations/meta/0045_snapshot.json +3779 -0
- package/.output/server/database/migrations/meta/_journal.json +7 -0
- package/.output/server/database/migrations-pg/0046_gorgeous_hercules.sql +1 -0
- package/.output/server/database/migrations-pg/meta/0046_snapshot.json +4486 -0
- package/.output/server/database/migrations-pg/meta/_journal.json +7 -0
- package/.output/server/index.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/package.json +1 -1
- package/.output/public/_nuxt/BNyTWIad.js +0 -9
- package/.output/public/_nuxt/BVyjw9Bi.js +0 -1
- package/.output/public/_nuxt/BZOykMLD.js +0 -1
- package/.output/public/_nuxt/CEai-PWF.js +0 -1
- package/.output/public/_nuxt/CYhm2FBS.js +0 -5
- package/.output/public/_nuxt/CfhOanaF.js +0 -1
- package/.output/public/_nuxt/Cz7SCzdW.js +0 -1
- package/.output/public/_nuxt/DFfqRQxk.js +0 -1
- package/.output/public/_nuxt/builds/meta/6d1766a0-0aba-46b8-9d97-7dd174130359.json +0 -1
- package/.output/public/_nuxt/eT2oObCh.js +0 -1
- package/.output/public/_nuxt/entry.D_eWXrnD.css +0 -1
- package/.output/server/chunks/build/db.client-Bdqk_eYQ.mjs.map +0 -1
- package/.output/server/chunks/build/index-vRwzDXLs.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as _,f as m,g as i,o as p,i as s,t as n,j as c,k as l,m as u,_ as x}from"./
|
|
1
|
+
import{d as _,f as m,g as i,o as p,i as s,t as n,j as c,k as l,m as u,_ as x}from"./C5TrTuWv.js";import{_ as f}from"./DMAiMrNr.js";import{a as b}from"./T5UuMUxA.js";const g={class:"space-y-4 text-sm"},v={class:"space-y-1"},y={class:"flex items-start gap-2"},C={class:"text-xs break-all flex-1"},k={class:"space-y-1"},D={class:"flex items-start gap-2"},B={class:"text-xs break-all flex-1"},h=_({__name:"DataLocationCard",props:{database:{},storage:{}},setup(a){const{copy:e}=b();return(N,t)=>{const o=x,r=f;return p(),m(r,{icon:"i-lucide-folder-open",title:"Data location"},{subtitle:i(()=>[...t[2]||(t[2]=[u(" Where this instance keeps its database and files on disk. ",-1)])]),default:i(()=>[s("div",g,[s("div",v,[t[3]||(t[3]=s("div",{class:"text-muted"},"Database",-1)),s("div",y,[s("code",C,n(a.database),1),c(o,{icon:"i-lucide-copy",color:"neutral",variant:"ghost",size:"xs","aria-label":"Copy database location",onClick:t[0]||(t[0]=d=>l(e)(a.database,{toast:!0}))})])]),s("div",k,[t[4]||(t[4]=s("div",{class:"text-muted"},"File storage",-1)),s("div",D,[s("code",B,n(a.storage),1),c(o,{icon:"i-lucide-copy",color:"neutral",variant:"ghost",size:"xs","aria-label":"Copy storage location",onClick:t[1]||(t[1]=d=>l(e)(a.storage,{toast:!0}))})])])])]),_:1})}}}),z=Object.assign(h,{__name:"DataLocationCard"});export{z as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as L}from"./
|
|
1
|
+
import{_ as L}from"./C7D5Wl7T.js";import{d as z,b as O,w as P,c as u,i as t,k as s,f as j,v as w,j as a,g as r,F as x,D as M,o as c,p as N,m as p,y as A,t as i,_ as W,l as q,r as y}from"./C5TrTuWv.js";import{_ as G}from"./COuZu9FO.js";import{_ as K}from"./DMAiMrNr.js";import{_ as Z}from"./Ce5_Tq63.js";import{_ as H}from"./DH5H1DJh.js";import{_ as J}from"./6Z_ZwH8I.js";import{f as B}from"./D-c8ZSws.js";import{e as Q,g as X}from"./B69RP95P.js";import{u as Y}from"./T5UuMUxA.js";import"./DuOH5jcQ.js";import"./C8Paf_V1.js";import"./DaNC-xl1.js";import"./D_y2VS8k.js";import"./BjaRappk.js";const ee={class:"space-y-6"},te={class:"space-y-3"},se={class:"flex items-center gap-2 text-sm text-muted"},oe={class:"grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"},ae={class:"text-muted"},ne={class:"flex items-center gap-2 font-mono"},le={class:"text-xs"},ie={key:0,class:"flex items-center gap-2 py-4 text-muted"},re={key:1,class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},de={class:"space-y-1"},ce={class:"text-2xl font-semibold"},me={class:"space-y-1"},ue={class:"text-2xl font-semibold"},pe={class:"space-y-1"},_e={class:"text-2xl font-semibold"},fe={class:"space-y-1"},ge={class:"text-2xl font-semibold"},ve={class:"space-y-1"},xe={class:"text-2xl font-semibold"},ye={class:"space-y-1"},be={class:"text-2xl font-semibold"},he={class:"space-y-1"},Ce={class:"text-2xl font-semibold"},ke={class:"flex flex-col sm:flex-row items-start sm:items-center gap-4"},je=z({__name:"storage",async setup(Se){let _,b;const h=O(),{data:n,refresh:C,pending:k}=([_,b]=P(()=>Y("/api/admin/stats","$phmoZI6KTi")),_=await _,b(),_),T=Q("storage").map(o=>({name:o,...X(o)})),$=[{label:"7 days",value:7},{label:"14 days",value:14},{label:"30 days",value:30},{label:"60 days",value:60},{label:"90 days",value:90},{label:"180 days",value:180},{label:"1 year",value:365}],d=y(30),m=y(!1),f=y(!1);async function D(){m.value=!1,f.value=!0;try{const o=await $fetch("/api/admin/cleanup",{method:"DELETE",body:{olderThanDays:d.value}});h.add({title:"Cleanup complete",description:`Deleted ${o.deletedRuns} test run(s) older than ${d.value} days.`,color:"success"}),await C()}catch(o){const e=o&&typeof o=="object"&&"data"in o?o.data?.message:void 0;h.add({title:"Cleanup failed",description:e||"An error occurred",color:"error"})}finally{f.value=!1}}return(o,e)=>{const V=L,S=N,E=G,v=K,g=W,F=Z,R=H,U=J,I=M;return c(),u(x,null,[t("div",ee,[s(n)?(c(),j(V,{key:0,database:s(n).databaseLocation,storage:s(n).storageLocation},null,8,["database","storage"])):w("",!0),a(v,{icon:"i-lucide-server",title:"Storage backend",help:"settings.storage-backend"},{subtitle:r(()=>[...e[5]||(e[5]=[p(" Configured through environment variables. The active backend is shown read-only. ",-1)])]),default:r(()=>[t("div",te,[t("div",se,[a(S,{name:"i-lucide-info",class:"size-4"}),e[6]||(e[6]=p(" Storage backend selection (local disk or S3) and its credentials are set via the environment. Each variable below is shown read-only — hover the lock to see what it controls. ",-1))]),t("div",oe,[(c(!0),u(x,null,A(s(T),l=>(c(),u(x,{key:l.name},[t("div",ae,i(l.name.replace("PIWI_S3_","S3 ").replace("PIWI_STORAGE_","Storage ")),1),t("div",ne,[t("code",le,i(l.name),1),a(E,{"env-vars":[l.name]},null,8,["env-vars"])])],64))),128))])])]),_:1}),a(v,{icon:"i-lucide-database",title:"Storage statistics",help:"settings.storage-stats"},{footer:r(()=>[a(g,{icon:"i-lucide-refresh-cw",variant:"outline",size:"sm",loading:s(k),label:"Refresh",onClick:e[0]||(e[0]=l=>s(C)())},null,8,["loading"])]),default:r(()=>[s(k)?(c(),u("div",ie,[a(S,{name:"i-lucide-loader-2",class:"animate-spin"}),e[7]||(e[7]=p(" Loading… ",-1))])):s(n)?(c(),u("div",re,[t("div",de,[e[8]||(e[8]=t("p",{class:"text-sm text-muted"},"Projects",-1)),t("p",ce,i(s(n).totalProjects),1)]),t("div",me,[e[9]||(e[9]=t("p",{class:"text-sm text-muted"},"Test runs",-1)),t("p",ue,i(s(n).totalRuns),1)]),t("div",pe,[e[10]||(e[10]=t("p",{class:"text-sm text-muted"},"Test cases (unique)",-1)),t("p",_e,i(s(n).totalTestCases),1)]),t("div",fe,[e[11]||(e[11]=t("p",{class:"text-sm text-muted"},"Test results",-1)),t("p",ge,i(s(n).totalRunsCases),1)]),t("div",ve,[e[12]||(e[12]=t("p",{class:"text-sm text-muted"},"Stored files",-1)),t("p",xe,i(s(n).totalFiles),1)]),t("div",ye,[e[13]||(e[13]=t("p",{class:"text-sm text-muted"},"File size (DB)",-1)),t("p",be,i(("formatBytes"in o?o.formatBytes:s(B))(s(n).totalFileSize)),1)]),t("div",he,[e[14]||(e[14]=t("p",{class:"text-sm text-muted"},"Storage on disk",-1)),t("p",Ce,i(("formatBytes"in o?o.formatBytes:s(B))(s(n).storageSizeOnDisk)),1)])])):w("",!0)]),_:1}),a(v,{icon:"i-lucide-trash-2",title:"Cleanup old test runs",help:"settings.cleanup"},{default:r(()=>[t("div",ke,[a(R,{label:"Delete runs older than",name:"period"},{default:r(()=>[a(F,{modelValue:s(d),"onUpdate:modelValue":e[1]||(e[1]=l=>q(d)?d.value=l:null),items:$},null,8,["modelValue"])]),_:1}),a(g,{icon:"i-lucide-trash-2",color:"error",variant:"soft",loading:s(f),label:"Run cleanup",class:"mt-4 sm:mt-5",onClick:e[2]||(e[2]=l=>m.value=!0)},null,8,["loading"])])]),_:1})]),a(I,null,{default:r(()=>[a(U,{open:s(m),title:"Confirm cleanup","onUpdate:open":e[4]||(e[4]=l=>m.value=l)},{body:r(()=>[t("p",null,[e[15]||(e[15]=p(" This will permanently delete all test runs older than ",-1)),t("strong",null,i(s(d))+" days",1),e[16]||(e[16]=p(", along with their associated reports, traces, and test results. This action cannot be undone. ",-1))])]),footer:r(()=>[a(g,{color:"neutral",variant:"ghost",label:"Cancel",onClick:e[3]||(e[3]=l=>m.value=!1)}),a(g,{color:"error",label:"Delete",icon:"i-lucide-trash-2",loading:s(f),onClick:D},null,8,["loading"])]),_:1},8,["open"])]),_:1})],64)}}});export{je as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a2 as m,a3 as y,a5 as g,o as i,f as h,g as b,k as t,c as l,q as o,V as d,m as u,t as c,v as n,X as k,h as x,a8 as q}from"./
|
|
1
|
+
import{a2 as m,a3 as y,a5 as g,o as i,f as h,g as b,k as t,c as l,q as o,V as d,m as u,t as c,v as n,X as k,h as x,a8 as q}from"./C5TrTuWv.js";const C={slots:{root:"rounded-lg overflow-hidden",header:"p-4 sm:px-6",title:"text-highlighted font-semibold",description:"mt-1 text-muted text-sm",body:"p-4 sm:p-6",footer:"p-4 sm:px-6"},variants:{variant:{solid:{root:"bg-inverted text-inverted",title:"text-inverted",description:"text-dimmed"},outline:{root:"bg-default ring ring-default divide-y divide-default"},soft:{root:"bg-elevated/50 divide-y divide-default"},subtle:{root:"bg-elevated/50 ring ring-default divide-y divide-default"}}},defaultVariants:{variant:"outline"}},V={__name:"UCard",props:{as:{type:null,required:!1},title:{type:String,required:!1},description:{type:String,required:!1},variant:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(p){const v=p,s=m(),e=y("card",v),f=g(),a=x(()=>q({extend:C,...f.ui?.card||{}})({variant:e.variant}));return(r,S)=>(i(),h(t(k),{as:t(e).as,"data-slot":"root",class:o(a.value.root({class:[t(e).ui?.root,t(e).class]}))},{default:b(()=>[s.header||t(e).title||s.title||t(e).description||s.description?(i(),l("div",{key:0,"data-slot":"header",class:o(a.value.header({class:t(e).ui?.header}))},[d(r.$slots,"header",{},()=>[t(e).title||s.title?(i(),l("div",{key:0,"data-slot":"title",class:o(a.value.title({class:t(e).ui?.title}))},[d(r.$slots,"title",{},()=>[u(c(t(e).title),1)])],2)):n("",!0),t(e).description||s.description?(i(),l("div",{key:1,"data-slot":"description",class:o(a.value.description({class:t(e).ui?.description}))},[d(r.$slots,"description",{},()=>[u(c(t(e).description),1)])],2)):n("",!0)])],2)):n("",!0),s.default?(i(),l("div",{key:1,"data-slot":"body",class:o(a.value.body({class:t(e).ui?.body}))},[d(r.$slots,"default")],2)):n("",!0),s.footer?(i(),l("div",{key:2,"data-slot":"footer",class:o(a.value.footer({class:t(e).ui?.footer}))},[d(r.$slots,"footer")],2)):n("",!0)]),_:3},8,["as","class"]))}};export{V as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as p,o as s,c as u,j as n,p as f,i as e,t as a,g as c,m as l,_ as x,f as g,v as y,V as k,q as b}from"./
|
|
1
|
+
import{d as p,o as s,c as u,j as n,p as f,i as e,t as a,g as c,m as l,_ as x,f as g,v as y,V as k,q as b}from"./C5TrTuWv.js";import{a as v}from"./B69RP95P.js";const B={class:"text-sm font-medium text-gray-600 dark:text-gray-300"},V={class:"text-sm max-w-md"},z={class:"flex items-center gap-3 mt-1"},C=p({__name:"FeatureUnavailable",props:{title:{},text:{},icon:{default:"i-lucide-plug-zap"},doc:{},to:{default:"/setup"},toLabel:{default:"How to enable"},padded:{type:Boolean,default:!0}},setup(i){const t=i;return(r,o)=>{const d=f,_=x,m=v;return s(),u("div",{class:b(["flex flex-col items-center justify-center gap-2 text-center text-gray-500",t.padded&&"py-8"])},[n(d,{name:t.icon,class:"size-6 opacity-60"},null,8,["name"]),e("p",B,a(t.title),1),e("p",V,a(t.text),1),e("div",z,[n(_,{to:t.to,size:"xs",variant:"soft",icon:"i-lucide-rocket"},{default:c(()=>[l(a(t.toLabel),1)]),_:1},8,["to"]),t.doc?(s(),g(m,{key:0,to:t.doc,class:"text-sm"},{default:c(()=>[...o[0]||(o[0]=[l("Docs",-1)])]),_:1},8,["to"])):y("",!0)]),k(r.$slots,"default")],2)}}}),h=Object.assign(C,{__name:"FeatureUnavailable"});export{h as _};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as F,B as W,o,f as u,g as n,i as e,c,F as E,y as N,k as a,q as C,p as O,t as y,v as m,s as R,m as s,_ as V,j as i,r as I,h as g,A as G}from"./
|
|
1
|
+
import{d as F,B as W,o,f as u,g as n,i as e,c,F as E,y as N,k as a,q as C,p as O,t as y,v as m,s as R,m as s,_ as V,j as i,r as I,h as g,A as G}from"./C5TrTuWv.js";import{a as T,d as K,_ as L}from"./B69RP95P.js";import{_ as Y}from"./B1LUinhp.js";import{_ as q}from"./C8Paf_V1.js";import{u as H}from"./fXUwH_3d.js";const M={class:"flex items-center gap-3"},J={class:"p-2 bg-primary/10 rounded-lg shrink-0"},Q={class:"text-xl font-semibold inline-flex items-center gap-1"},X={class:"text-sm text-gray-500 dark:text-gray-400"},Z={class:"flex flex-col items-center shrink-0"},tt={key:1},et={key:0,class:"w-px flex-1 mt-2 min-h-6 bg-gray-200 dark:bg-gray-700"},st={class:"flex-1 pb-6"},rt={class:"flex items-center gap-2 mb-1"},ot={class:"font-medium"},it={class:"text-sm text-gray-600 dark:text-gray-400 mb-3"},nt={class:"border-t border-gray-200 dark:border-gray-700 pt-4 mt-2"},at={key:0,class:"mt-4 space-y-6"},lt={class:"text-sm text-gray-600 dark:text-gray-400 mb-3"},dt={class:"flex items-center justify-between text-sm text-gray-500 dark:text-gray-400"},pt=`// tests/fixtures.ts
|
|
2
2
|
import { test as base, expect } from '@playwright/test'
|
|
3
3
|
import { piwiFixtures } from '@piwitests/reporter'
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ap as s}from"./
|
|
1
|
+
import{ap as s}from"./C5TrTuWv.js";let a=null;function i(){const t=s("ai-status",()=>null);async function u(){t.value===null&&(a||(a=$fetch("/api/ai/status").catch(()=>({configured:!1}))),t.value=await a)}return u(),{aiStatus:t}}export{i as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as me,a as de}from"./
|
|
1
|
+
import{_ as me,a as de}from"./Cu2Q4iPh.js";import{_ as pe,a as fe}from"./opyDpgSw.js";import{_ as he}from"./DcLbz6DV.js";import{d as H,o as n,c as a,F as B,y as T,i,t as c,k as s,v as g,m as R,f as U,h as x,az as _e,M as se,r as N,j as $,_ as Y,E as oe,l as Z,s as ee,g as P,q as Q,A as ae,p as xe,e as ye}from"./C5TrTuWv.js";import{_ as ge}from"./DcR0Mmdl.js";import{_ as be}from"./BBhrClA9.js";import{_ as ve}from"./Ce5_Tq63.js";import{_ as ke}from"./BfA6lfg4.js";import{_ as $e}from"./B1LUinhp.js";import{e as we}from"./DMtrFQqi.js";import{_ as Ae}from"./BFxvHlO9.js";import{a as je,u as Ue}from"./T5UuMUxA.js";import{u as re}from"./CsV7pmcT.js";import"./BCGljaM0.js";import"./DaNC-xl1.js";import"./fXUwH_3d.js";const Se=["get","post","put","patch","delete","head","options","trace"];function Ce(e){switch(e.toLowerCase()){case"get":return"success";case"post":return"info";case"put":case"patch":return"warning";case"delete":return"error";default:return"neutral"}}function Oe(e,t){return`op-${e}-${t}`.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function qe(e){const t=new Map;for(const[r,o]of Object.entries(e?.paths??{})){if(!o)continue;const u=o.parameters??[];for(const p of Se){const v=o[p];if(!v)continue;const f=v.tags?.[0]??"Other",y={path:r,method:p,operation:v,parameters:[...u,...v.parameters??[]],tag:f,anchor:Oe(p,r)},A=t.get(f);A?A.push(y):t.set(f,[y])}}return[...t.entries()].map(([r,o])=>({tag:r,operations:o})).sort((r,o)=>r.tag.localeCompare(o.tag))}function ie(e,t){return Array.isArray(e.security)?e.security.length>0:Array.isArray(t?.security)&&t.security.length>0}function Be(e){return Array.isArray(e.security)&&e.security.length===0}function D(e,t){if(!e?.$ref)return e;const r=/^#\/components\/schemas\/(.+)$/.exec(e.$ref);return r?.[1]?t?.components?.schemas?.[r[1]]??e:e}const Re=["administrator","reporter","user"];function ne(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Te(e){const t=e["x-required-roles"];if(!t||t.length===0)return null;const r=Re.every(o=>t.includes(o));return{roles:t,label:r?"Any signed-in user":t.map(ne).join(" or "),shortLabel:r?"Any user":t.map(o=>o==="administrator"?"Admin":ne(o)).join(" / "),elevated:!r&&!t.includes("user")}}function te(e){if(!e)return"any";if(e.$ref)return e.$ref.split("/").pop()??"object";const t=Array.isArray(e.type)?e.type.join(" | "):e.type;if(t==="array"){const r=e.items;return`array<${r?te(r):"any"}>`}return!t&&e.properties||!t&&(e.oneOf||e.anyOf||e.allOf)?"object":t??"any"}const Pe={class:"space-y-2"},Ve={class:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5"},Le={class:"font-mono text-primary"},ze={class:"text-xs text-muted font-mono"},Ie={key:0,class:"text-xs text-dimmed font-mono"},Ne={key:1,class:"text-xs font-medium text-error"},De={key:0,class:"text-muted mt-0.5"},Ee={key:1,class:"text-xs text-dimmed mt-0.5"},Je={class:"font-mono"},Me=H({__name:"ApiSchema",props:{schema:{},spec:{default:null},depth:{default:0}},setup(e){const t=e,r=x(()=>D(t.schema,t.spec)??t.schema),o=x(()=>{const f=r.value.type==="array"?D(r.value.items,t.spec):r.value,y=f?.properties;if(!y)return[];const A=new Set(f?.required??[]);return Object.entries(y).map(([h,j])=>({name:h,required:A.has(h),schema:D(j,t.spec)??j}))}),u=x(()=>(t.depth??0)<6);function p(f){const y=f.type==="array"?D(f.items,t.spec):f;return!!(y?.properties&&Object.keys(y.properties).length>0)}function v(f){return(f.enum??[]).map(y=>JSON.stringify(y)).join(", ")}return(f,y)=>{const A=le;return n(),a("div",Pe,[(n(!0),a(B,null,T(s(o),h=>(n(),a("div",{key:h.name,class:"text-sm"},[i("div",Ve,[i("code",Le,c(h.name),1),i("span",ze,c(("schemaTypeLabel"in f?f.schemaTypeLabel:s(te))(h.schema)),1),h.schema.format?(n(),a("span",Ie,"("+c(h.schema.format)+")",1)):g("",!0),h.required?(n(),a("span",Ne,"required")):g("",!0)]),h.schema.description?(n(),a("p",De,c(h.schema.description),1)):g("",!0),h.schema.enum?.length?(n(),a("p",Ee,[y[0]||(y[0]=R(" Allowed values: ",-1)),i("span",Je,c(v(h.schema)),1)])):g("",!0),s(u)&&p(h.schema)?(n(),U(A,{key:2,schema:h.schema,spec:e.spec,depth:(e.depth??0)+1,class:"mt-1.5 border-l border-default pl-3"},null,8,["schema","spec","depth"])):g("",!0)]))),128))])}}}),le=Object.assign(Me,{__name:"ApiSchema"});function He(){return{token:_e("piwi-api-token","")}}function We(e,t){return e.replace(/\{([^}]+)\}/g,(r,o)=>{const u=t[o];return u?encodeURIComponent(u):r})}function Fe(e){const t=new URLSearchParams;for(const[o,u]of Object.entries(e))u!==void 0&&u!==""&&t.append(o,u);const r=t.toString();return r?`?${r}`:""}function K(e,t,r=0){const o=D(e,t);if(!o||r>6)return null;if(o.example!==void 0)return o.example;if(o.default!==void 0)return o.default;if(o.enum?.length)return o.enum[0];const u=Array.isArray(o.type)?o.type.find(p=>p!=="null"):o.type;if(u==="object"||!u&&o.properties){const p={};for(const[v,f]of Object.entries(o.properties??{}))p[v]=K(f,t,r+1);return p}if(u==="array")return[K(o.items,t,r+1)];switch(u){case"string":return o.format==="date-time"?"2024-01-01T00:00:00Z":o.format==="date"?"2024-01-01":o.format==="uuid"?"00000000-0000-0000-0000-000000000000":"string";case"integer":case"number":return 0;case"boolean":return!1;default:return null}}function Qe(e,t){const r=e.requestBody?.content?.["application/json"]?.schema;return r?JSON.stringify(K(r,t),null,2):null}function Ge(e){return!!e.requestBody?.content?.["application/json"]}function X(e){return`'${e.replace(/'/g,"'\\''")}'`}function Xe({method:e,url:t,headers:r,body:o}){const u=["curl"];e.toUpperCase()!=="GET"&&u.push("-X",e.toUpperCase());for(const[p,v]of Object.entries(r))u.push("-H",X(`${p}: ${v}`));return o&&u.push("-d",X(o)),u.push(X(t)),u.join(" ")}function Ze({method:e,url:t,headers:r,body:o}){const u=[` method: ${JSON.stringify(e.toUpperCase())},`];return Object.keys(r).length&&u.push(` headers: ${JSON.stringify(r)},`),o&&u.push(` body: ${JSON.stringify(o)},`),`const res = await fetch(${JSON.stringify(t)}, {
|
|
2
2
|
${u.join(`
|
|
3
3
|
`)}
|
|
4
4
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as r,o as s,c as l,i as n,V as o,m as i,t,q as c,v as d}from"./
|
|
1
|
+
import{d as r,o as s,c as l,i as n,V as o,m as i,t,q as c,v as d}from"./C5TrTuWv.js";const m={class:"rounded-lg bg-gray-50 dark:bg-gray-900 p-3 min-w-0"},u={class:"text-xs font-medium text-gray-500 uppercase tracking-wider inline-flex items-center gap-1 max-w-full"},g={key:0,class:"text-xs text-gray-400 mt-1"},x=r({__name:"StatTile",props:{label:{},value:{},hint:{},size:{default:"lg"},valueClass:{default:""}},setup(e){return(a,f)=>(s(),l("div",m,[n("p",u,[o(a.$slots,"label",{},()=>[i(t(e.label),1)])]),n("p",{class:c(["mt-0.5 break-words",[e.size==="lg"?"text-xl font-bold":"text-sm font-semibold",e.valueClass]])},[o(a.$slots,"default",{},()=>[i(t(e.value??"—"),1)])],2),e.hint?(s(),l("p",g,t(e.hint),1)):d("",!0)]))}}),h=Object.assign(x,{__name:"StatTile"});export{h as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as z,k as n,o as a,c as x,f as s,s as C,g as r,m as l,t as c,v as i,F as B,y as M,j as y,p as O,x as j,C as I,h as m}from"./
|
|
1
|
+
import{d as z,k as n,o as a,c as x,f as s,s as C,g as r,m as l,t as c,v as i,F as B,y as M,j as y,p as O,x as j,C as I,h as m}from"./C5TrTuWv.js";import"./DMtrFQqi.js";const L={key:0,class:"inline-flex items-center gap-1 flex-wrap"},N=z({__name:"TestMetaBadges",props:{tags:{default:null},meta:{default:null},maxTags:{default:0}},setup(t){const e=t,_={critical:"error",high:"warning",medium:"info",low:"neutral"},u=m(()=>{const f=e.tags??[];return e.maxTags>0?f.slice(0,e.maxTags):f}),d=m(()=>Math.max(0,(e.tags?.length??0)-u.value.length)),p=m(()=>(e.tags??[]).slice(u.value.length).join(", ")),v=m(()=>e.meta?.priority?_[e.meta.priority]??"neutral":"neutral"),w=m(()=>u.value.length>0||!!(e.meta?.owner||e.meta?.priority||e.meta?.feature||e.meta?.link));return(f,k)=>{const o=C,g=O,T=j;return n(w)?(a(),x("div",L,[t.meta?.priority?(a(),s(o,{key:0,color:n(v),variant:"soft",size:"xs",class:"shrink-0 capitalize"},{default:r(()=>[l(c(t.meta.priority),1)]),_:1},8,["color"])):i("",!0),(a(!0),x(B,null,M(n(u),h=>(a(),s(o,{key:h,color:"primary",variant:"soft",size:"xs",class:"shrink-0 font-mono"},{default:r(()=>[l(" @"+c(h),1)]),_:2},1024))),128)),n(d)>0?(a(),s(o,{key:1,color:"neutral",variant:"soft",size:"xs",class:"shrink-0",title:n(p)},{default:r(()=>[l(" +"+c(n(d)),1)]),_:1},8,["title"])):i("",!0),t.meta?.owner?(a(),s(o,{key:2,color:"neutral",variant:"soft",size:"xs",class:"shrink-0 gap-1"},{default:r(()=>[y(g,{name:"i-lucide-user",class:"size-2.5 shrink-0"}),l(" "+c(t.meta.owner),1)]),_:1})):i("",!0),t.meta?.feature?(a(),s(o,{key:3,color:"neutral",variant:"outline",size:"xs",class:"shrink-0"},{default:r(()=>[l(c(t.meta.feature),1)]),_:1})):i("",!0),t.meta?.link?(a(),s(T,{key:4,to:t.meta.link,target:"_blank",rel:"noopener noreferrer",class:"text-gray-500 hover:text-primary shrink-0",title:t.meta.link,onClick:k[0]||(k[0]=I(()=>{},["stop"]))},{default:r(()=>[y(g,{name:"i-lucide-external-link",class:"size-3"})]),_:1},8,["to","title"])):i("",!0)])):i("",!0)}}}),V=Object.assign(N,{__name:"TestMetaBadges"});export{V as _};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as _,o as l,f as p,g as u,j as d,p as f,q as g,k as a,h as o}from"./
|
|
1
|
+
import{d as _,o as l,f as p,g as u,j as d,p as f,q as g,k as a,h as o}from"./C5TrTuWv.js";import{_ as v}from"./DuOH5jcQ.js";import{g as x}from"./B69RP95P.js";const h=_({__name:"EnvManagedBadge",props:{envVars:{},size:{default:"sm"}},setup(r){const s=r,c=o(()=>{switch(s.size){case"xs":return"size-3";case"md":return"size-4";default:return"size-3.5"}}),i=o(()=>{if(!s.envVars?.length)return"Managed by environment variable";const e=s.envVars.map(n=>{const t=x(n).description;return t?`${n} — ${t}`:n});return e.length===1?`Set via ${e[0]}`:["Set via environment variables:",...e].join(`
|
|
2
2
|
`)});return(e,n)=>{const t=f,m=v;return l(),p(m,{text:a(i),ui:{content:"whitespace-pre-line max-w-sm"}},{default:u(()=>[d(t,{name:"i-lucide-lock",class:g(["text-gray-400",a(c)])},null,8,["class"])]),_:1},8,["text"])}}}),b=Object.assign(h,{__name:"EnvManagedBadge"});export{b as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ak as $,b as H,B as L,J as T,r as R,ab as y,az as K,ap as O,h as M}from"./
|
|
1
|
+
import{ak as $,b as H,B as L,J as T,r as R,ab as y,az as K,ap as O,h as M}from"./C5TrTuWv.js";import{e as U}from"./DMtrFQqi.js";const J=4096;function F(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function k(e){return'"'+e.replace(/"/g,'\\"')+'"'}function m(e){return e.replace(/\\/g,"/")}function G(e){const n=new Map;for(const o of e){const i=o.projectName||"";n.has(i)||n.set(i,[]),n.get(i).push(o)}return n}function z(e){const n=new Set;return e.filter(o=>{const i=o.filePath;return n.has(i)?!1:(n.add(i),!0)}).map(o=>o.filePath)}function V(e,n){const o=n?.mode??"file-line",l=`${n?.pkgRunner??"npx"} playwright test`;if(e.length===0)return"";const f=G(e),j=[];for(const[u,c]of f){let s;if(o==="file"){const d=z(c).map(t=>k(m(t))).join(" ");s=`${l} ${d}`}else if(o==="file-line"){const p=new Set,d=c.filter(t=>{const r=t.filePath+":"+t.line;return t.line&&p.has(r)?!1:(t.line&&p.add(r),!0)}).map(t=>t.line?k(`${m(t.filePath)}:${t.line}`):k(m(t.filePath))).join(" ");s=`${l} ${d}`}else{const p=c.map(t=>F(t.title)),d=p.length===1?p[0]:`(${p.join("|")})`;s=`${l} --grep ${k(d)}`}u&&(s+=` --project=${k(u)}`),j.push(s)}let v=j.join(" && ");if(v.length>J){if(o==="grep")return V(e,{...n,mode:"file-line"});if(o==="file-line")return V(e,{...n,mode:"file"});const c=W(e).map(p=>k(m(p))).join(" ");let s=`${l} ${c}`;return s.length>J&&(s=s.slice(0,J-3)+"..."),s}return v}function W(e){const n=new Set;return e.reduce((o,i)=>(n.has(i.filePath)||(n.add(i.filePath),o.push(i.filePath)),o),[])}function _(e,n){return e==null?"":n==null?`:${e}`:`:${e}:${n}`}function E(e){return e.replace(/%/g,"%25").replace(/ /g,"%20").replace(/#/g,"%23").replace(/\?/g,"%3F")}function S(e,n){const o=m(e).replace(/\/+$/,""),i=m(n).replace(/^\.?\/+/,"");return o?`${o}/${i}`:i}function q(e){const n=E(m(e.absPath)),o=n.startsWith("/")?n:`/${n}`;return`${e.scheme}://file${o}${_(e.line,e.column)}`}function X(e){const n=E(m(e.relPath))+_(e.line,e.column);return`jetbrains://${e.product}/navigate/reference?project=${encodeURIComponent(e.projectName)}&path=${n}`}function Y(e){const n=E(m(e.path));return`http://localhost:${e.port}/api/file/${n}${_(e.line,e.column)}`}async function I(e){const n=$();if(!n||e==null||e==="")return null;try{return await n.invoke("desktop_get_project_link",{projectId:String(e)})}catch{return null}}function re(e){const n=H(),o=R(!1),i=R(null),l=R(!1);async function f(){i.value=await I(y(e))}L(()=>{o.value=!!$(),o.value&&f()}),T(()=>y(e),()=>{o.value&&f()});async function j(){const u=$(),c=y(e);if(!u||c==null||c==="")return!1;l.value=!0;try{const s=await u.invoke("desktop_pick_folder");return s?(await u.invoke("desktop_set_project_link",{projectId:String(c),path:s}),await f(),!0):!1}catch(s){return n.add({title:"Could not link the folder",description:U(s),color:"error"}),!1}finally{l.value=!1}}async function v(){const u=$(),c=y(e);if(!(!u||c==null||c==="")){l.value=!0;try{await u.invoke("desktop_set_project_link",{projectId:String(c),path:null}),i.value=null}catch(s){n.add({title:"Could not unlink the folder",description:U(s),color:"error"})}finally{l.value=!1}}}return{available:o,link:i,busy:l,refresh:f,pickAndLink:j,unlink:v}}const Q="piwi-ide-prefs",Z={method:"auto",vscodeScheme:"vscode",jetbrainsProduct:"idea",jetbrainsPort:63342,jetbrainsHttpUsesRelativePath:!1,defaultRoot:"",projectRoots:{},jetbrainsProjectNames:{}},ee={vscode:"VS Code","vscode-insiders":"VS Code Insiders",vscodium:"VSCodium",cursor:"Cursor"},ie={auto:"Auto (try all)",vscode:"VS Code","jetbrains-url":"JetBrains (URL)","jetbrains-http":"JetBrains (local server)"},se=["idea","webstorm","pycharm","phpstorm","goland","rubymine","clion","rider","rustrover"];function ae(){const e=K(Q,Z,{mergeDefaults:!0}),n=H(),o=O("piwi-ide-settings-open",()=>!1),i=O("piwi-ide-settings-context",()=>({}));function l(t){return t==null||t===""?null:String(t)}function f(t={}){i.value={projectKey:t.projectKey??null,projectName:t.projectName??null},o.value=!0}function j(t){const r=l(t);return((r?e.value.projectRoots[r]:void 0)||e.value.defaultRoot||"").trim()}function v(t,r){const a=l(t);return((a?e.value.jetbrainsProjectNames[a]:void 0)||r||"").trim()}function u(t,r){const a=j(r);return a?S(a,t):null}const c=M(()=>!!e.value.defaultRoot?.trim()||Object.keys(e.value.projectRoots).length>0||Object.keys(e.value.jetbrainsProjectNames).length>0);function s(t){try{const r=document.createElement("iframe");r.style.display="none",r.src=t,document.body.appendChild(r),setTimeout(()=>r.remove(),1e3)}catch{const r=document.createElement("a");r.href=t,r.style.display="none",document.body.appendChild(r),r.click(),setTimeout(()=>r.remove(),1e3)}}async function p(t,r,a){const b=Y({port:e.value.jetbrainsPort,path:t,line:r,column:a});try{return await fetch(b,{mode:"no-cors",signal:AbortSignal.timeout(1200)}),!0}catch{return!1}}async function d(t){const r=t.method??e.value.method,a=t.filePath,b=t.line??null,P=t.column??null;let h=j(t.projectKey);if(!h){const g=await I(t.projectKey);g?.exists&&(h=g.path)}const w=v(t.projectKey,t.projectName),x={projectKey:l(t.projectKey),projectName:t.projectName??null},C={label:"Configure",color:"info",onClick:()=>f(x)},N=()=>h?(s(q({scheme:e.value.vscodeScheme,absPath:S(h,a),line:b,column:P})),n.add({title:`Opening ${ee[e.value.vscodeScheme]}…`,description:"If nothing opens, the editor may not be installed or the workspace root is wrong.",color:"neutral",icon:"i-lucide-external-link"}),!0):(n.add({title:"Set a workspace root",description:"VS Code needs the local folder that contains this file.",color:"info",icon:"i-lucide-folder-cog",actions:[C]}),!1),A=()=>w?(s(X({product:e.value.jetbrainsProduct,projectName:w,relPath:a,line:b,column:P})),n.add({title:"Opening JetBrains…",description:"If nothing opens, JetBrains Toolbox may not be installed or the project is not open.",color:"neutral",icon:"i-lucide-external-link"}),!0):(n.add({title:"Set a JetBrains project name",description:"The jetbrains:// link needs the open IDE project name.",color:"info",icon:"i-lucide-folder-cog",actions:[C]}),!1),D=async()=>{const g=e.value.jetbrainsHttpUsesRelativePath?a:h?S(h,a):a,B=await p(g,b,P);return n.add(B?{title:"Opened in JetBrains",color:"success",icon:"i-lucide-check"}:{title:"JetBrains not reachable",description:`Nothing responded on localhost:${e.value.jetbrainsPort}. Start the IDE with the Remote Control plugin (and "Allow unsigned requests").`,color:"error",icon:"i-lucide-plug-zap"}),B};if(r==="vscode"){N();return}if(r==="jetbrains-url"){A();return}if(r==="jetbrains-http"){await D();return}if(e.value.jetbrainsHttpUsesRelativePath||!!h){const g=e.value.jetbrainsHttpUsesRelativePath?a:S(h,a);if(await p(g,b,P)){n.add({title:"Opened in JetBrains",color:"success",icon:"i-lucide-check"});return}}if(h){N();return}if(w){A();return}n.add({title:'Set up "Open in IDE"',description:"Add your local workspace folder (for VS Code) or a JetBrains project name to open files from here.",color:"info",icon:"i-lucide-folder-cog",actions:[C]})}return{prefs:e,isConfigured:c,openInIde:d,openInVscode:t=>d({...t,method:"vscode"}),openViaJetbrainsUrl:t=>d({...t,method:"jetbrains-url"}),openViaJetbrainsHttp:t=>d({...t,method:"jetbrains-http"}),resolveRoot:j,resolveJbProjectName:v,resolveAbsPath:u,settingsOpen:o,settingsContext:i,openSettings:f}}export{ie as I,se as J,ee as V,ae as a,V as b,F as e,m as t,re as u};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{r as ne,d as ce,o as p,c as f,k as c,i as x,V as We,j as S,p as ke,_ as _e,R as rt,F as j,y as Y,t as w,v as $,h as P,b as it,f as N,g as Q,m as
|
|
1
|
+
import{r as ne,d as ce,o as p,c as f,k as c,i as x,V as We,j as S,p as ke,_ as _e,R as rt,F as j,y as Y,t as w,v as $,h as P,b as it,f as N,g as Q,m as C,A as Tt,q as J,J as ye,L as zt,ao as It,l as Et,M as Pt,s as Lt}from"./C5TrTuWv.js";import{a as Be}from"./T5UuMUxA.js";import{e as Bt,f as Dt}from"./DMtrFQqi.js";import{_ as De}from"./B69RP95P.js";import{_ as qt}from"./6Z_ZwH8I.js";import{_ as Ft}from"./BBhrClA9.js";import{_ as Mt}from"./D0Kop4bS.js";import{h as Xe,_ as Nt}from"./B1LUinhp.js";import{_ as jt}from"./BfA6lfg4.js";function Ot(t,e=!1){const s=ne(e);try{const i=document.cookie.match(new RegExp(`(?:^|;\\s*)${t}=([^;]*)`));i&&(s.value=i[1]==="true")}catch{}function r(){document.cookie=`${t}=${s.value}; path=/; max-age=31536000; sameSite=lax`}function n(){s.value=!s.value,r()}function o(i){s.value=i,r()}return{folded:s,toggle:n,setFolded:o}}function Ht(t){return Ot(`piwi-summary-fold-${t}`,!1)}const Zt={class:"flex items-center gap-3"},Ut={class:"ml-auto shrink-0"},Vt={key:1,class:"relative"},Qt={class:"absolute top-1 right-1 z-10"},Gt=ce({__name:"FoldableSummary",props:{storageKey:{}},setup(t){const e=t,{folded:s,toggle:r}=Ht(e.storageKey);return(n,o)=>{const i=ke,l=_e;return p(),f("div",null,[c(s)?(p(),f("div",{key:0,class:"border border-gray-200 dark:border-gray-800 rounded-xl p-2.5 shadow-xs cursor-pointer select-none",onClick:o[0]||(o[0]=(...a)=>c(r)&&c(r)(...a))},[x("div",Zt,[We(n.$slots,"folded"),x("div",Ut,[S(i,{name:"i-lucide-chevron-down",class:"size-4 text-gray-400"})])])])):(p(),f("div",Vt,[x("div",Qt,[S(l,{icon:"i-lucide-chevron-up",size:"xs",color:"neutral",variant:"ghost",onClick:c(r),title:"Collapse summary"},null,8,["onClick"])]),We(n.$slots,"default")]))])}}}),zr=Object.assign(Gt,{__name:"FoldableSummary"}),Wt=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp"]),Xt=new Set(["image/png","image/jpeg","image/gif","image/svg+xml","image/webp"]),Kt=new Set([".webm",".mp4",".ogg",".mov"]),Jt=new Set(["video/webm","video/mp4","video/ogg","video/quicktime"]);function Ir(t,e){const s="."+(t.toLowerCase().split(".").pop()||"");return!!(Wt.has(s)||e&&Xt.has(e.toLowerCase()))}function Er(t,e){const s="."+(t.toLowerCase().split(".").pop()||"");return!!(Kt.has(s)||e&&Jt.has(e.toLowerCase()))}function Pr(t){return t.replace(/\x1b\[[0-9;]*[a-zA-Z]/g,"")}const Yt={class:"rounded-lg border border-default overflow-hidden bg-muted min-h-16"},es={key:0,class:"flex items-center gap-2 p-4 text-sm text-gray-500"},ts={key:0,class:"text-sm font-bold text-gray-900 dark:text-white mt-4 mb-0.5 first:mt-0"},ss={key:1,class:"font-semibold text-gray-700 dark:text-gray-200 mt-2 mb-0.5"},ns={key:2,class:"my-1 px-2 py-0.5 rounded bg-yellow-50 dark:bg-yellow-900/20 text-yellow-800 dark:text-yellow-300 italic"},rs={key:3,class:"text-gray-600 dark:text-gray-400 flex gap-1.5"},is={key:4,class:"text-gray-600 dark:text-gray-400"},os={key:5,class:"h-2"},as={key:6,class:"mt-2 px-2 py-0.5 bg-gray-200 dark:bg-gray-700 text-gray-500 dark:text-gray-400 rounded-t text-[10px] uppercase tracking-wide"},ls={key:7,class:"overflow-x-auto bg-gray-50 dark:bg-gray-900/40"},cs=["innerHTML"],us={key:8,class:"h-1 bg-gray-100 dark:bg-gray-800/50 rounded-b mb-2"},ps={key:2,class:"p-3 text-xs text-gray-400 italic"},ds=ce({__name:"MarkdownPreview",props:{text:{},loading:{type:Boolean},maxHeight:{}},setup(t){const e=t;function s(n){const o=[];let i=!1,l="",a=[];for(const d of n.split(`
|
|
2
2
|
`))if(!i)d.startsWith("```")?(i=!0,l=d.slice(3).trim(),a=[]):d.startsWith("## ")?o.push({kind:"h2",text:d.slice(3)}):d.startsWith("### ")?o.push({kind:"h3",text:d.slice(4)}):d.startsWith("> ")?o.push({kind:"note",text:d.slice(2)}):d.startsWith("- ")?o.push({kind:"bullet",text:d.slice(2)}):d.trim()===""?o.push({kind:"blank"}):o.push({kind:"text",text:d});else if(d==="```"){const h=a.join(`
|
|
3
3
|
`);if(a.length){const{html:m}=Xe(h,l);o.push({kind:"code-start",lang:l||"code"}),o.push({kind:"code-block",html:m}),o.push({kind:"code-end"})}i=!1}else a.push(d);if(i&&a.length){const{html:d}=Xe(a.join(`
|
|
4
|
-
`),l);o.push({kind:"code-start",lang:l||"code"}),o.push({kind:"code-block",html:d}),o.push({kind:"code-end"})}return o}const r=P(()=>e.text?s(e.text):[]);return(n,o)=>{const i=ke;return p(),f("div",Yt,[t.loading?(p(),f("div",es,[S(i,{name:"i-lucide-loader-2",class:"size-4 animate-spin"}),o[0]||(o[0]=x("span",null,"Fetching context… (includes SCM diff lookup)",-1))])):c(r).length?(p(),f("div",{key:1,class:"overflow-auto p-3 text-xs font-mono leading-relaxed",style:rt({maxHeight:t.maxHeight??"45vh"})},[(p(!0),f(j,null,Y(c(r),(l,a)=>(p(),f(j,{key:a},[l.kind==="h2"?(p(),f("div",ts,w(l.text),1)):l.kind==="h3"?(p(),f("div",ss,w(l.text),1)):l.kind==="note"?(p(),f("div",ns,w(l.text),1)):l.kind==="bullet"?(p(),f("div",rs,[o[1]||(o[1]=x("span",{class:"text-gray-400 shrink-0"},"·",-1)),x("span",null,w(l.text),1)])):l.kind==="text"?(p(),f("div",is,w(l.text),1)):l.kind==="blank"?(p(),f("div",os)):l.kind==="code-start"?(p(),f("div",as,w(l.lang||"code"),1)):l.kind==="code-block"?(p(),f("div",ls,[x("pre",{class:"hljs px-2 py-1 !bg-transparent whitespace-pre-wrap",innerHTML:l.html},null,8,cs)])):l.kind==="code-end"?(p(),f("div",us)):$("",!0)],64))),128))],4)):(p(),f("div",ps,"No context loaded"))])}}}),ot=Object.assign(ds,{__name:"MarkdownPreview"}),hs=ce({__name:"CopyAiPromptButton",props:{contextEndpoint:{}},setup(t){const e=t,{copy:s,copied:r}=Be(),n=it(),o=ne(!1),i=P(()=>(Tt().app?.baseURL??"/").replace(/\/$/,""));async function l(){o.value=!0;try{const a=await fetch(`${i.value}${e.contextEndpoint}?format=prompt`);if(!a.ok)throw new Error(`Request failed (${a.status})`);s(await a.text(),{toast:"AI prompt copied"})}catch(a){n.add({title:"Could not copy the prompt",description:Bt(a),color:"error"})}finally{o.value=!1}}return(a,d)=>{const h=_e;return p(),N(h,{icon:c(r)?"i-lucide-check":"i-lucide-clipboard-copy",size:"xs",color:"neutral",variant:"outline",loading:c(o),title:"Copy the exact request Piwi would send to the model — to reuse it elsewhere, or to check what it contains",onClick:l},{default:Q(()=>[A(w(c(r)?"Copied":"Copy prompt"),1)]),_:1},8,["icon","loading"])}}}),Lr=Object.assign(hs,{__name:"CopyAiPromptButton"}),Se=[{id:"clusterSummary",label:"Failure cluster summary",short:"Cluster"},{id:"sampleError",label:"Raw error message",short:"Error"},{id:"representativeExecution",label:"Representative execution overview",short:"Execution"},{id:"executionError",label:"Representative execution error",short:"Error"},{id:"runContext",label:"Run context (partial run, parallelism, flaky class)",short:"Run context"},{id:"testAnnotations",label:"Test annotations (@fixme/@flaky …)",short:"Annotations"},{id:"affectedTests",label:"Affected tests",short:"Tests"},{id:"testSource",label:"Test source code",short:"Source"},{id:"sourceFiles",label:"Full source files (suspect + imports)",short:"Files"},{id:"steps",label:"Test steps",short:"Steps"},{id:"failingSteps",label:"Failing steps",short:"Steps"},{id:"console",label:"Browser console logs",short:"Console"},{id:"networkRequests",label:"Network requests",short:"Network"},{id:"serverLogs",label:"Backend server logs",short:"Server logs"},{id:"serverTraces",label:"Server traces (spans)",short:"Traces"},{id:"webVitals",label:"Web vitals",short:"Web vitals"},{id:"appState",label:"App state at test end (URL/storage/cookies)",short:"App state"},{id:"ariaSnapshot",label:"ARIA snapshot",short:"ARIA"},{id:"domSnapshot",label:"DOM snapshot from trace (failure time)",short:"DOM"},{id:"screenshots",label:"Screenshots (attached as images)",short:"Screenshots"},{id:"visualDiff",label:"Visual diff vs last passing screenshot",short:"Visual diff"},{id:"browserDistribution",label:"Browser distribution",short:"Browsers"},{id:"recurrenceFlakiness",label:"Recurrence & flakiness",short:"Flakiness"},{id:"baselineComparison",label:"Compared to last pass (duration/vitals/steps)",short:"Baseline"},{id:"environmentDiff",label:"Environment diff vs last pass",short:"Env diff"},{id:"retryProgression",label:"Retry progression (per-attempt errors)",short:"Retries"},{id:"passedPeers",label:"Passing peers in same file",short:"Peers"},{id:"scmInvestigation",label:"SCM diff since last green",short:"SCM diff"},{id:"selectedCommits",label:"Manually selected commits",short:"Commits"},{id:"priorDiagnosis",label:"Prior diagnosis & triage",short:"Prior"},{id:"tracePointers",label:"Trace files",short:"Traces"},{id:"artifacts",label:"Attachments & artifacts (video, HAR)",short:"Artifacts"},{id:"nearestAriaNames",label:"Nearest matching ARIA names from snapshot",short:"Nearest ARIA"},{id:"alreadyGreen",label:"Baseline freshness / already-green check",short:"Already green"},{id:"topSuspectedCommit",label:"Top suspected commit",short:"Top commit"},{id:"failingAction",label:"Failing action from trace parsing",short:"Trace"},{id:"traceCallStack",label:"Full call stack with source (from trace)",short:"Call stack"},{id:"traceNetwork",label:"Network activity from trace (all requests)",short:"Trace net"},{id:"locatorHealing",label:"Alternative locators from prior success",short:"Alt locators"}],at=new Set(Se.map(t=>t.id)),lt=Object.fromEntries(Se.map(t=>[t.id,t.short]));function gs(t){return at.has(t)}function Br(t){const e=new Set;for(const s of t)if(s)for(const r of String(s).matchAll(/\[([a-zA-Z][a-zA-Z0-9]*)]/g))at.has(r[1])&&e.add(r[1]);return[...e]}const fs={class:"rounded-lg border border-default bg-elevated/30 px-2.5 py-2"},ks={key:0,class:"flex items-center gap-2 text-xs text-gray-400"},xs={key:1,class:"flex flex-wrap items-center gap-1.5"},ms={class:"text-xs font-medium text-gray-500 inline-flex items-center gap-1"},bs=["title","onClick"],ys={key:0,class:"text-xs text-gray-400"},ws=ce({__name:"DiagnosisCoverageStrip",props:{sections:{},notApplicable:{},tokenEstimate:{},loading:{type:Boolean}},emits:["view-section","open"],setup(t,{emit:e}){const s=t,r=e,n=P(()=>s.sections.map(l=>({id:l.id,short:lt[l.id]??l.title??l.id,truncated:l.truncated}))),o=P(()=>Math.max(0,Se.length-s.sections.length)),i=P(()=>{const l=s.tokenEstimate;return l?l>=1e3?`${(l/1e3).toFixed(1)}k`:String(l):""});return(l,a)=>{const d=ke,h=De;return p(),f("div",fs,[t.loading&&!t.sections.length?(p(),f("div",ks,[S(d,{name:"i-lucide-loader-circle",class:"size-3.5 animate-spin"}),a[1]||(a[1]=A(" Building context… ",-1))])):(p(),f("div",xs,[x("span",ms,[S(d,{name:"i-lucide-layers",class:"size-3.5"}),a[2]||(a[2]=A(" Context ",-1)),S(h,{topic:"cluster.coverage"})]),(p(!0),f(j,null,Y(c(n),m=>(p(),f("button",{key:m.id,type:"button",class:"inline-flex items-center gap-1 rounded-full border border-default bg-default px-2 py-0.5 text-xs hover:border-primary/50 transition-colors",title:m.truncated?`${m.short} (truncated)`:m.short,onClick:b=>r("view-section",m.id)},[S(d,{name:m.truncated?"i-lucide-scissors":"i-lucide-check",class:J(["size-3",m.truncated?"text-warning":"text-success"])},null,8,["name","class"]),A(" "+w(m.short),1)],8,bs))),128)),c(n).length?$("",!0):(p(),f("span",ys,"No evidence sections yet")),x("button",{type:"button",class:"ml-auto text-xs text-gray-400 hover:text-primary transition-colors whitespace-nowrap",onClick:a[0]||(a[0]=m=>r("open"))},[c(o)?(p(),f(j,{key:0},[A(w(c(o))+" not included · ",1)],64)):$("",!0),c(i)?(p(),f(j,{key:1},[A("~"+w(c(i))+" tokens",1)],64)):$("",!0),S(d,{name:"i-lucide-arrow-right",class:"size-3 inline align-text-bottom"})])]))])}}}),Dr=Object.assign(ws,{__name:"DiagnosisCoverageStrip"}),vs={class:"flex items-center justify-between w-full"},$s={class:"flex items-center gap-2"},_s={class:"font-semibold inline-flex items-center gap-1"},Ss={class:"text-xs text-gray-400"},Rs={class:"flex items-center gap-1"},Cs={class:"rounded-lg border border-default bg-elevated/30 p-3 mb-4"},As={class:"flex items-center justify-between gap-2 mb-2"},Ts={class:"text-xs font-medium text-gray-500 uppercase tracking-wide inline-flex items-center gap-1"},zs={class:"text-xs text-gray-400"},Is={class:"flex flex-wrap gap-1.5"},Es=["title"],Ps={class:"text-xs text-gray-400 mt-2"},Ls={class:"space-y-4"},Bs={class:"text-xs font-medium text-gray-500 uppercase tracking-wide mb-2"},Ds={class:"space-y-2"},qs=["data-section-id"],Fs={key:0,class:"text-center text-gray-400 py-8 text-sm"},Ms=ce({__name:"DiagnosisContextModal",props:{open:{type:Boolean},sections:{},tokenEstimate:{},imageTokenEstimate:{},loading:{type:Boolean},focusSection:{},citedSections:{},notApplicableSections:{}},emits:["update:open","refresh"],setup(t,{emit:e}){const s=t,r=P(()=>{const v=new Map;for(const y of s.sections)v.has(y.id)||v.set(y.id,y);return v}),n=P(()=>new Set(Object.keys(s.notApplicableSections??{}))),o=P(()=>new Set(s.citedSections??[])),i=P(()=>Se.map(v=>{if(n.value.has(v.id))return{id:v.id,short:v.short,label:v.label,state:"notApplicable",cited:o.value.has(v.id)};const y=r.value.get(v.id),L=y?y.truncated?"truncated":"present":"absent";return{id:v.id,short:v.short,label:v.label,state:L,cited:o.value.has(v.id)}})),l=P(()=>{const v={present:0,truncated:0,absent:0,notApplicable:0};for(const y of i.value)v[y.state]++;return v}),a={present:"bg-emerald-500",truncated:"bg-amber-500",absent:"bg-gray-300 dark:bg-gray-600",notApplicable:"bg-purple-400"};function d(v){if(v.state==="notApplicable"){const y=s.notApplicableSections?.[v.id];return`${v.label}: not applicable${y?` — ${y}`:""}`}return`${v.label}: ${v.state}${v.cited?" · cited by the diagnosis":""}`}const h=e,{copy:m,copied:b}=Be(),z=P(()=>{const v=[],y=["clusterSummary","sampleError","representativeExecution","executionError","runContext"],L=["testAnnotations","testSource","steps","failingSteps","console","networkRequests","serverLogs","serverTraces","webVitals","ariaSnapshot"],ee=["recurrenceFlakiness","baselineComparison","retryProgression","passedPeers","browserDistribution","affectedTests"],re=["scmInvestigation","selectedCommits"],te=["priorDiagnosis","tracePointers","artifacts"],q=(E,F)=>{const le=s.sections.filter(Ae=>E.includes(Ae.id));le.length>0&&v.push({label:F,items:le})};return q(y,"Primary"),q(L,"Test Evidence"),q(ee,"Analysis"),q(re,"SCM"),q(te,"Other"),v}),_=ne(null);ye(()=>[s.open,s.focusSection],async([v,y])=>{if(!v||!y)return;await zt();const L=document.querySelector(`[data-section-id="${y}"]`);L&&(L.scrollIntoView({behavior:"smooth",block:"start"}),_.value=y,setTimeout(()=>{_.value===y&&(_.value=null)},2500))});function H(v){let y=`## ${v.title}`;const L=[];return L.push(`${v.chars} chars`),v.truncated&&L.push("truncated"),v.items!=null&&L.push(`${v.items} items`),L.length&&(y+=` — ${L.join(", ")}`),y}return(v,y)=>{const L=De,ee=_e,re=ke,te=ot,q=qt;return p(),N(q,{open:t.open,title:"Context sent to AI",ui:{content:"max-w-5xl"},"onUpdate:open":y[2]||(y[2]=E=>h("update:open",E))},{header:Q(()=>[x("div",vs,[x("div",$s,[x("span",_s,[y[3]||(y[3]=A(" Context sent to AI ",-1)),S(L,{topic:"cluster.context-preview"})]),x("span",Ss,[A(" ~"+w(t.tokenEstimate)+" tokens",1),t.imageTokenEstimate?(p(),f(j,{key:0},[A(" ("+w(t.tokenEstimate-t.imageTokenEstimate)+" text + "+w(t.imageTokenEstimate)+" image)",1)],64)):$("",!0)])]),x("div",Rs,[S(ee,{icon:"i-lucide-refresh-cw",size:"xs",color:"neutral",variant:"ghost",loading:t.loading,onClick:y[0]||(y[0]=E=>h("refresh"))},null,8,["loading"]),S(ee,{icon:"i-lucide-x",size:"xs",color:"neutral",variant:"ghost",onClick:y[1]||(y[1]=E=>h("update:open",!1))})])])]),body:Q(()=>[y[7]||(y[7]=x("p",{class:"text-xs text-gray-500 dark:text-gray-400 mb-3"},"Copy individual sections or the full context below.",-1)),x("div",Cs,[x("div",As,[x("p",Ts,[y[4]||(y[4]=A(" Data coverage ",-1)),S(L,{topic:"cluster.coverage"})]),x("p",zs,w(c(l).present)+" present · "+w(c(l).truncated)+" truncated · "+w(c(l).absent)+" absent"+w(c(l).notApplicable?` · ${c(l).notApplicable} n/a`:""),1)]),x("div",Is,[(p(!0),f(j,null,Y(c(i),E=>(p(),f("span",{key:E.id,class:J(["inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-xs",[E.cited?"border-primary text-primary":"border-default",E.state==="absent"?"text-gray-400 opacity-70":"",E.state==="notApplicable"?"text-purple-500 border-purple-300 dark:border-purple-700":""]]),title:d(E)},[x("span",{class:J(["size-1.5 rounded-full shrink-0",a[E.state]])},null,2),A(" "+w(E.short)+" ",1),E.cited?(p(),N(re,{key:0,name:"i-lucide-quote",class:"size-2.5 shrink-0"})):$("",!0)],10,Es))),128))]),x("p",Ps,[y[5]||(y[5]=A(" Absent or truncated evidence lowers the diagnosis confidence. ",-1)),S(re,{name:"i-lucide-quote",class:"size-2.5 inline"}),y[6]||(y[6]=A(" marks sections the diagnosis cited. ",-1))])]),x("div",Ls,[(p(!0),f(j,null,Y(c(z),E=>(p(),f("div",{key:E.label},[x("p",Bs,w(E.label),1),x("div",Ds,[(p(!0),f(j,null,Y(E.items,F=>(p(),f("div",{key:F.id,"data-section-id":F.id,class:J(["relative rounded-lg transition-shadow",c(_)===F.id?"ring-2 ring-primary":c(o).has(F.id)?"ring-1 ring-primary/40":""])},[S(te,{text:H(F)+`
|
|
4
|
+
`),l);o.push({kind:"code-start",lang:l||"code"}),o.push({kind:"code-block",html:d}),o.push({kind:"code-end"})}return o}const r=P(()=>e.text?s(e.text):[]);return(n,o)=>{const i=ke;return p(),f("div",Yt,[t.loading?(p(),f("div",es,[S(i,{name:"i-lucide-loader-2",class:"size-4 animate-spin"}),o[0]||(o[0]=x("span",null,"Fetching context… (includes SCM diff lookup)",-1))])):c(r).length?(p(),f("div",{key:1,class:"overflow-auto p-3 text-xs font-mono leading-relaxed",style:rt({maxHeight:t.maxHeight??"45vh"})},[(p(!0),f(j,null,Y(c(r),(l,a)=>(p(),f(j,{key:a},[l.kind==="h2"?(p(),f("div",ts,w(l.text),1)):l.kind==="h3"?(p(),f("div",ss,w(l.text),1)):l.kind==="note"?(p(),f("div",ns,w(l.text),1)):l.kind==="bullet"?(p(),f("div",rs,[o[1]||(o[1]=x("span",{class:"text-gray-400 shrink-0"},"·",-1)),x("span",null,w(l.text),1)])):l.kind==="text"?(p(),f("div",is,w(l.text),1)):l.kind==="blank"?(p(),f("div",os)):l.kind==="code-start"?(p(),f("div",as,w(l.lang||"code"),1)):l.kind==="code-block"?(p(),f("div",ls,[x("pre",{class:"hljs px-2 py-1 !bg-transparent whitespace-pre-wrap",innerHTML:l.html},null,8,cs)])):l.kind==="code-end"?(p(),f("div",us)):$("",!0)],64))),128))],4)):(p(),f("div",ps,"No context loaded"))])}}}),ot=Object.assign(ds,{__name:"MarkdownPreview"}),hs=ce({__name:"CopyAiPromptButton",props:{contextEndpoint:{}},setup(t){const e=t,{copy:s,copied:r}=Be(),n=it(),o=ne(!1),i=P(()=>(Tt().app?.baseURL??"/").replace(/\/$/,""));async function l(){o.value=!0;try{const a=await fetch(`${i.value}${e.contextEndpoint}?format=prompt`);if(!a.ok)throw new Error(`Request failed (${a.status})`);s(await a.text(),{toast:"AI prompt copied"})}catch(a){n.add({title:"Could not copy the prompt",description:Bt(a),color:"error"})}finally{o.value=!1}}return(a,d)=>{const h=_e;return p(),N(h,{icon:c(r)?"i-lucide-check":"i-lucide-clipboard-copy",size:"xs",color:"neutral",variant:"outline",loading:c(o),title:"Copy the exact request Piwi would send to the model — to reuse it elsewhere, or to check what it contains",onClick:l},{default:Q(()=>[C(w(c(r)?"Copied":"Copy prompt"),1)]),_:1},8,["icon","loading"])}}}),Lr=Object.assign(hs,{__name:"CopyAiPromptButton"}),Se=[{id:"clusterSummary",label:"Failure cluster summary",short:"Cluster"},{id:"sampleError",label:"Raw error message",short:"Error"},{id:"representativeExecution",label:"Representative execution overview",short:"Execution"},{id:"executionError",label:"Representative execution error",short:"Error"},{id:"runContext",label:"Run context (partial run, parallelism, flaky class)",short:"Run context"},{id:"testAnnotations",label:"Test annotations (@fixme/@flaky …)",short:"Annotations"},{id:"affectedTests",label:"Affected tests",short:"Tests"},{id:"testSource",label:"Test source code",short:"Source"},{id:"sourceFiles",label:"Full source files (suspect + imports)",short:"Files"},{id:"steps",label:"Test steps",short:"Steps"},{id:"failingSteps",label:"Failing steps",short:"Steps"},{id:"aiSteps",label:"AI-step prompts (natural-language intents)",short:"AI steps"},{id:"console",label:"Browser console logs",short:"Console"},{id:"networkRequests",label:"Network requests",short:"Network"},{id:"serverLogs",label:"Backend server logs",short:"Server logs"},{id:"serverTraces",label:"Server traces (spans)",short:"Traces"},{id:"webVitals",label:"Web vitals",short:"Web vitals"},{id:"appState",label:"App state at test end (URL/storage/cookies)",short:"App state"},{id:"ariaSnapshot",label:"ARIA snapshot",short:"ARIA"},{id:"domSnapshot",label:"DOM snapshot from trace (failure time)",short:"DOM"},{id:"screenshots",label:"Screenshots (attached as images)",short:"Screenshots"},{id:"visualDiff",label:"Visual diff vs last passing screenshot",short:"Visual diff"},{id:"browserDistribution",label:"Browser distribution",short:"Browsers"},{id:"recurrenceFlakiness",label:"Recurrence & flakiness",short:"Flakiness"},{id:"baselineComparison",label:"Compared to last pass (duration/vitals/steps)",short:"Baseline"},{id:"environmentDiff",label:"Environment diff vs last pass",short:"Env diff"},{id:"retryProgression",label:"Retry progression (per-attempt errors)",short:"Retries"},{id:"passedPeers",label:"Passing peers in same file",short:"Peers"},{id:"scmInvestigation",label:"SCM diff since last green",short:"SCM diff"},{id:"selectedCommits",label:"Manually selected commits",short:"Commits"},{id:"priorDiagnosis",label:"Prior diagnosis & triage",short:"Prior"},{id:"tracePointers",label:"Trace files",short:"Traces"},{id:"artifacts",label:"Attachments & artifacts (video, HAR)",short:"Artifacts"},{id:"nearestAriaNames",label:"Nearest matching ARIA names from snapshot",short:"Nearest ARIA"},{id:"alreadyGreen",label:"Baseline freshness / already-green check",short:"Already green"},{id:"topSuspectedCommit",label:"Top suspected commit",short:"Top commit"},{id:"failingAction",label:"Failing action from trace parsing",short:"Trace"},{id:"traceCallStack",label:"Full call stack with source (from trace)",short:"Call stack"},{id:"traceNetwork",label:"Network activity from trace (all requests)",short:"Trace net"},{id:"locatorHealing",label:"Alternative locators from prior success",short:"Alt locators"}],at=new Set(Se.map(t=>t.id)),lt=Object.fromEntries(Se.map(t=>[t.id,t.short]));function gs(t){return at.has(t)}function Br(t){const e=new Set;for(const s of t)if(s)for(const r of String(s).matchAll(/\[([a-zA-Z][a-zA-Z0-9]*)]/g))at.has(r[1])&&e.add(r[1]);return[...e]}const fs={class:"rounded-lg border border-default bg-elevated/30 px-2.5 py-2"},ks={key:0,class:"flex items-center gap-2 text-xs text-gray-400"},xs={key:1,class:"flex flex-wrap items-center gap-1.5"},ms={class:"text-xs font-medium text-gray-500 inline-flex items-center gap-1"},bs=["title","onClick"],ys={key:0,class:"text-xs text-gray-400"},ws=ce({__name:"DiagnosisCoverageStrip",props:{sections:{},notApplicable:{},tokenEstimate:{},loading:{type:Boolean}},emits:["view-section","open"],setup(t,{emit:e}){const s=t,r=e,n=P(()=>s.sections.map(l=>({id:l.id,short:lt[l.id]??l.title??l.id,truncated:l.truncated}))),o=P(()=>Math.max(0,Se.length-s.sections.length)),i=P(()=>{const l=s.tokenEstimate;return l?l>=1e3?`${(l/1e3).toFixed(1)}k`:String(l):""});return(l,a)=>{const d=ke,h=De;return p(),f("div",fs,[t.loading&&!t.sections.length?(p(),f("div",ks,[S(d,{name:"i-lucide-loader-circle",class:"size-3.5 animate-spin"}),a[1]||(a[1]=C(" Building context… ",-1))])):(p(),f("div",xs,[x("span",ms,[S(d,{name:"i-lucide-layers",class:"size-3.5"}),a[2]||(a[2]=C(" Context ",-1)),S(h,{topic:"cluster.coverage"})]),(p(!0),f(j,null,Y(c(n),m=>(p(),f("button",{key:m.id,type:"button",class:"inline-flex items-center gap-1 rounded-full border border-default bg-default px-2 py-0.5 text-xs hover:border-primary/50 transition-colors",title:m.truncated?`${m.short} (truncated)`:m.short,onClick:b=>r("view-section",m.id)},[S(d,{name:m.truncated?"i-lucide-scissors":"i-lucide-check",class:J(["size-3",m.truncated?"text-warning":"text-success"])},null,8,["name","class"]),C(" "+w(m.short),1)],8,bs))),128)),c(n).length?$("",!0):(p(),f("span",ys,"No evidence sections yet")),x("button",{type:"button",class:"ml-auto text-xs text-gray-400 hover:text-primary transition-colors whitespace-nowrap",onClick:a[0]||(a[0]=m=>r("open"))},[c(o)?(p(),f(j,{key:0},[C(w(c(o))+" not included · ",1)],64)):$("",!0),c(i)?(p(),f(j,{key:1},[C("~"+w(c(i))+" tokens",1)],64)):$("",!0),S(d,{name:"i-lucide-arrow-right",class:"size-3 inline align-text-bottom"})])]))])}}}),Dr=Object.assign(ws,{__name:"DiagnosisCoverageStrip"}),vs={class:"flex items-center justify-between w-full"},$s={class:"flex items-center gap-2"},_s={class:"font-semibold inline-flex items-center gap-1"},Ss={class:"text-xs text-gray-400"},As={class:"flex items-center gap-1"},Rs={class:"rounded-lg border border-default bg-elevated/30 p-3 mb-4"},Cs={class:"flex items-center justify-between gap-2 mb-2"},Ts={class:"text-xs font-medium text-gray-500 uppercase tracking-wide inline-flex items-center gap-1"},zs={class:"text-xs text-gray-400"},Is={class:"flex flex-wrap gap-1.5"},Es=["title"],Ps={class:"text-xs text-gray-400 mt-2"},Ls={class:"space-y-4"},Bs={class:"text-xs font-medium text-gray-500 uppercase tracking-wide mb-2"},Ds={class:"space-y-2"},qs=["data-section-id"],Fs={key:0,class:"text-center text-gray-400 py-8 text-sm"},Ms=ce({__name:"DiagnosisContextModal",props:{open:{type:Boolean},sections:{},tokenEstimate:{},imageTokenEstimate:{},loading:{type:Boolean},focusSection:{},citedSections:{},notApplicableSections:{}},emits:["update:open","refresh"],setup(t,{emit:e}){const s=t,r=P(()=>{const v=new Map;for(const y of s.sections)v.has(y.id)||v.set(y.id,y);return v}),n=P(()=>new Set(Object.keys(s.notApplicableSections??{}))),o=P(()=>new Set(s.citedSections??[])),i=P(()=>Se.map(v=>{if(n.value.has(v.id))return{id:v.id,short:v.short,label:v.label,state:"notApplicable",cited:o.value.has(v.id)};const y=r.value.get(v.id),L=y?y.truncated?"truncated":"present":"absent";return{id:v.id,short:v.short,label:v.label,state:L,cited:o.value.has(v.id)}})),l=P(()=>{const v={present:0,truncated:0,absent:0,notApplicable:0};for(const y of i.value)v[y.state]++;return v}),a={present:"bg-emerald-500",truncated:"bg-amber-500",absent:"bg-gray-300 dark:bg-gray-600",notApplicable:"bg-purple-400"};function d(v){if(v.state==="notApplicable"){const y=s.notApplicableSections?.[v.id];return`${v.label}: not applicable${y?` — ${y}`:""}`}return`${v.label}: ${v.state}${v.cited?" · cited by the diagnosis":""}`}const h=e,{copy:m,copied:b}=Be(),z=P(()=>{const v=[],y=["clusterSummary","sampleError","representativeExecution","executionError","runContext"],L=["testAnnotations","testSource","steps","failingSteps","console","networkRequests","serverLogs","serverTraces","webVitals","ariaSnapshot"],ee=["recurrenceFlakiness","baselineComparison","retryProgression","passedPeers","browserDistribution","affectedTests"],re=["scmInvestigation","selectedCommits"],te=["priorDiagnosis","tracePointers","artifacts"],q=(E,F)=>{const le=s.sections.filter(Ce=>E.includes(Ce.id));le.length>0&&v.push({label:F,items:le})};return q(y,"Primary"),q(L,"Test Evidence"),q(ee,"Analysis"),q(re,"SCM"),q(te,"Other"),v}),_=ne(null);ye(()=>[s.open,s.focusSection],async([v,y])=>{if(!v||!y)return;await zt();const L=document.querySelector(`[data-section-id="${y}"]`);L&&(L.scrollIntoView({behavior:"smooth",block:"start"}),_.value=y,setTimeout(()=>{_.value===y&&(_.value=null)},2500))});function H(v){let y=`## ${v.title}`;const L=[];return L.push(`${v.chars} chars`),v.truncated&&L.push("truncated"),v.items!=null&&L.push(`${v.items} items`),L.length&&(y+=` — ${L.join(", ")}`),y}return(v,y)=>{const L=De,ee=_e,re=ke,te=ot,q=qt;return p(),N(q,{open:t.open,title:"Context sent to AI",ui:{content:"max-w-5xl"},"onUpdate:open":y[2]||(y[2]=E=>h("update:open",E))},{header:Q(()=>[x("div",vs,[x("div",$s,[x("span",_s,[y[3]||(y[3]=C(" Context sent to AI ",-1)),S(L,{topic:"cluster.context-preview"})]),x("span",Ss,[C(" ~"+w(t.tokenEstimate)+" tokens",1),t.imageTokenEstimate?(p(),f(j,{key:0},[C(" ("+w(t.tokenEstimate-t.imageTokenEstimate)+" text + "+w(t.imageTokenEstimate)+" image)",1)],64)):$("",!0)])]),x("div",As,[S(ee,{icon:"i-lucide-refresh-cw",size:"xs",color:"neutral",variant:"ghost",loading:t.loading,onClick:y[0]||(y[0]=E=>h("refresh"))},null,8,["loading"]),S(ee,{icon:"i-lucide-x",size:"xs",color:"neutral",variant:"ghost",onClick:y[1]||(y[1]=E=>h("update:open",!1))})])])]),body:Q(()=>[y[7]||(y[7]=x("p",{class:"text-xs text-gray-500 dark:text-gray-400 mb-3"},"Copy individual sections or the full context below.",-1)),x("div",Rs,[x("div",Cs,[x("p",Ts,[y[4]||(y[4]=C(" Data coverage ",-1)),S(L,{topic:"cluster.coverage"})]),x("p",zs,w(c(l).present)+" present · "+w(c(l).truncated)+" truncated · "+w(c(l).absent)+" absent"+w(c(l).notApplicable?` · ${c(l).notApplicable} n/a`:""),1)]),x("div",Is,[(p(!0),f(j,null,Y(c(i),E=>(p(),f("span",{key:E.id,class:J(["inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-xs",[E.cited?"border-primary text-primary":"border-default",E.state==="absent"?"text-gray-400 opacity-70":"",E.state==="notApplicable"?"text-purple-500 border-purple-300 dark:border-purple-700":""]]),title:d(E)},[x("span",{class:J(["size-1.5 rounded-full shrink-0",a[E.state]])},null,2),C(" "+w(E.short)+" ",1),E.cited?(p(),N(re,{key:0,name:"i-lucide-quote",class:"size-2.5 shrink-0"})):$("",!0)],10,Es))),128))]),x("p",Ps,[y[5]||(y[5]=C(" Absent or truncated evidence lowers the diagnosis confidence. ",-1)),S(re,{name:"i-lucide-quote",class:"size-2.5 inline"}),y[6]||(y[6]=C(" marks sections the diagnosis cited. ",-1))])]),x("div",Ls,[(p(!0),f(j,null,Y(c(z),E=>(p(),f("div",{key:E.label},[x("p",Bs,w(E.label),1),x("div",Ds,[(p(!0),f(j,null,Y(E.items,F=>(p(),f("div",{key:F.id,"data-section-id":F.id,class:J(["relative rounded-lg transition-shadow",c(_)===F.id?"ring-2 ring-primary":c(o).has(F.id)?"ring-1 ring-primary/40":""])},[S(te,{text:H(F)+`
|
|
5
5
|
|
|
6
|
-
`+F.markdown},null,8,["text"]),S(ee,{icon:c(b)?"i-lucide-check":"i-lucide-clipboard",size:"xs",color:"neutral",variant:"ghost",class:"absolute top-1 right-1",onClick:le=>c(m)(F.markdown)},null,8,["icon","onClick"])],10,qs))),128))])]))),128)),t.sections.length===0&&!t.loading?(p(),f("div",Fs," No context sections available. ")):$("",!0)])]),_:1},8,["open"])}}}),qr=Object.assign(Ms,{__name:"DiagnosisContextModal"});function qe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ae=qe();function ct(t){ae=t}var ie={exec:()=>null};function
|
|
7
|
-
]`).replace("lheading",pt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ys=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,en=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ht=/^( {2,}|\\)\n(?!\s*$)/,tn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ue=/[\p{P}\p{S}]/u,
|
|
6
|
+
`+F.markdown},null,8,["text"]),S(ee,{icon:c(b)?"i-lucide-check":"i-lucide-clipboard",size:"xs",color:"neutral",variant:"ghost",class:"absolute top-1 right-1",onClick:le=>c(m)(F.markdown)},null,8,["icon","onClick"])],10,qs))),128))])]))),128)),t.sections.length===0&&!t.loading?(p(),f("div",Fs," No context sections available. ")):$("",!0)])]),_:1},8,["open"])}}}),qr=Object.assign(Ms,{__name:"DiagnosisContextModal"});function qe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ae=qe();function ct(t){ae=t}var ie={exec:()=>null};function A(t,e=""){let s=typeof t=="string"?t:t.source,r={replace:(n,o)=>{let i=typeof o=="string"?o:o.source;return i=i.replace(O.caret,"$1"),s=s.replace(n,i),r},getRegex:()=>new RegExp(s,e)};return r}var Ns=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),O={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},js=/^(?:[ \t]*(?:\n|$))+/,Os=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Hs=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,xe=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Zs=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Fe=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ut=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,pt=A(ut).replace(/bull/g,Fe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Us=A(ut).replace(/bull/g,Fe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Me=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Vs=/^[^\n]+/,Ne=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Qs=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ne).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Gs=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Fe).getRegex(),Ae="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",je=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ws=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",je).replace("tag",Ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),dt=A(Me).replace("hr",xe).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ae).getRegex(),Xs=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",dt).getRegex(),Oe={blockquote:Xs,code:Os,def:Qs,fences:Hs,heading:Zs,hr:xe,html:Ws,lheading:pt,list:Gs,newline:js,paragraph:dt,table:ie,text:Vs},Ke=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",xe).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ae).getRegex(),Ks={...Oe,lheading:Us,table:Ke,paragraph:A(Me).replace("hr",xe).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ke).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ae).getRegex()},Js={...Oe,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",je).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ie,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(Me).replace("hr",xe).replace("heading",` *#{1,6} *[^
|
|
7
|
+
]`).replace("lheading",pt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ys=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,en=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ht=/^( {2,}|\\)\n(?!\s*$)/,tn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ue=/[\p{P}\p{S}]/u,Re=/[\s\p{P}\p{S}]/u,He=/[^\s\p{P}\p{S}]/u,sn=A(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Re).getRegex(),gt=/(?!~)[\p{P}\p{S}]/u,nn=/(?!~)[\s\p{P}\p{S}]/u,rn=/(?:[^\s\p{P}\p{S}]|~)/u,on=A(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ns?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ft=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,an=A(ft,"u").replace(/punct/g,ue).getRegex(),ln=A(ft,"u").replace(/punct/g,gt).getRegex(),kt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",cn=A(kt,"gu").replace(/notPunctSpace/g,He).replace(/punctSpace/g,Re).replace(/punct/g,ue).getRegex(),un=A(kt,"gu").replace(/notPunctSpace/g,rn).replace(/punctSpace/g,nn).replace(/punct/g,gt).getRegex(),pn=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,He).replace(/punctSpace/g,Re).replace(/punct/g,ue).getRegex(),dn=A(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ue).getRegex(),hn="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",gn=A(hn,"gu").replace(/notPunctSpace/g,He).replace(/punctSpace/g,Re).replace(/punct/g,ue).getRegex(),fn=A(/\\(punct)/,"gu").replace(/punct/g,ue).getRegex(),kn=A(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),xn=A(je).replace("(?:-->|$)","-->").getRegex(),mn=A("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",xn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),we=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,bn=A(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",we).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xt=A(/^!?\[(label)\]\[(ref)\]/).replace("label",we).replace("ref",Ne).getRegex(),mt=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ne).getRegex(),yn=A("reflink|nolink(?!\\()","g").replace("reflink",xt).replace("nolink",mt).getRegex(),Je=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ze={_backpedal:ie,anyPunctuation:fn,autolink:kn,blockSkip:on,br:ht,code:en,del:ie,delLDelim:ie,delRDelim:ie,emStrongLDelim:an,emStrongRDelimAst:cn,emStrongRDelimUnd:pn,escape:Ys,link:bn,nolink:mt,punctuation:sn,reflink:xt,reflinkSearch:yn,tag:mn,text:tn,url:ie},wn={...Ze,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",we).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",we).getRegex()},Ee={...Ze,emStrongRDelimAst:un,emStrongLDelim:ln,delLDelim:dn,delRDelim:gn,url:A(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Je).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:A(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Je).getRegex()},vn={...Ee,br:A(ht).replace("{2,}","*").getRegex(),text:A(Ee.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},be={normal:Oe,gfm:Ks,pedantic:Js},he={normal:Ze,gfm:Ee,breaks:vn,pedantic:wn},$n={"&":"&","<":"<",">":">",'"':""","'":"'"},Ye=t=>$n[t];function K(t,e){if(e){if(O.escapeTest.test(t))return t.replace(O.escapeReplace,Ye)}else if(O.escapeTestNoEncode.test(t))return t.replace(O.escapeReplaceNoEncode,Ye);return t}function et(t){try{t=encodeURI(t).replace(O.percentDecode,"%")}catch{return null}return t}function tt(t,e){let s=t.replace(O.findPipe,(o,i,l)=>{let a=!1,d=i;for(;--d>=0&&l[d]==="\\";)a=!a;return a?"|":" |"}),r=s.split(O.splitPipe),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(O.slashPipe,"|");return r}function ge(t,e,s){let r=t.length;if(r===0)return"";let n=0;for(;n<r&&t.charAt(r-n-1)===e;)n++;return t.slice(0,r-n)}function _n(t,e){if(t.indexOf(e[1])===-1)return-1;let s=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])s++;else if(t[r]===e[1]&&(s--,s<0))return r;return s>0?-2:-1}function Sn(t,e=0){let s=e,r="";for(let n of t)if(n===" "){let o=4-s%4;r+=" ".repeat(o),s+=o}else r+=n,s++;return r}function st(t,e,s,r,n){let o=e.href,i=e.title||null,l=t[1].replace(n.other.outputLinkReplace,"$1");r.state.inLink=!0;let a={type:t[0].charAt(0)==="!"?"image":"link",raw:s,href:o,title:i,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}function An(t,e,s){let r=t.match(s.other.indentCodeCompensation);if(r===null)return e;let n=r[1];return e.split(`
|
|
8
8
|
`).map(o=>{let i=o.match(s.other.beginningSpace);if(i===null)return o;let[l]=i;return l.length>=n.length?o.slice(n.length):o}).join(`
|
|
9
9
|
`)}var ve=class{options;rules;lexer;constructor(t){this.options=t||ae}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let s=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?s:ge(s,`
|
|
10
|
-
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let s=e[0],r=
|
|
10
|
+
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let s=e[0],r=An(s,e[3]||"",this.rules);return{type:"code",raw:s,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let s=e[2].trim();if(this.rules.other.endingHash.test(s)){let r=ge(s,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(s=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:ge(e[0],`
|
|
11
11
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let s=ge(e[0],`
|
|
12
12
|
`).split(`
|
|
13
13
|
`),r="",n="",o=[];for(;s.length>0;){let i=!1,l=[],a;for(a=0;a<s.length;a++)if(this.rules.other.blockquoteStart.test(s[a]))l.push(s[a]),i=!0;else if(!i)l.push(s[a]);else break;s=s.slice(a);let d=l.join(`
|
|
@@ -61,19 +61,19 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
61
61
|
${t}</tr>
|
|
62
62
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),s=t.header?"th":"td";return(t.align?`<${s} align="${t.align}">`:`<${s}>`)+e+`</${s}>
|
|
63
63
|
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${K(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:s}){let r=this.parser.parseInline(s),n=et(t);if(n===null)return r;t=n;let o='<a href="'+t+'"';return e&&(o+=' title="'+K(e)+'"'),o+=">"+r+"</a>",o}image({href:t,title:e,text:s,tokens:r}){r&&(s=this.parser.parseInline(r,this.parser.textRenderer));let n=et(t);if(n===null)return K(s);t=n;let o=`<img src="${t}" alt="${K(s)}"`;return e&&(o+=` title="${K(e)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:K(t.text)}},Ue=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},W=class Le{options;renderer;textRenderer;constructor(e){this.options=e||ae,this.options.renderer=this.options.renderer||new $e,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ue}static parse(e,s){return new Le(s).parse(e)}static parseInline(e,s){return new Le(s).parseInline(e)}parse(e){this.renderer.parser=this;let s="";for(let r=0;r<e.length;r++){let n=e[r];if(this.options.extensions?.renderers?.[n.type]){let i=n,l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){s+=l||"";continue}}let o=n;switch(o.type){case"space":{s+=this.renderer.space(o);break}case"hr":{s+=this.renderer.hr(o);break}case"heading":{s+=this.renderer.heading(o);break}case"code":{s+=this.renderer.code(o);break}case"table":{s+=this.renderer.table(o);break}case"blockquote":{s+=this.renderer.blockquote(o);break}case"list":{s+=this.renderer.list(o);break}case"checkbox":{s+=this.renderer.checkbox(o);break}case"html":{s+=this.renderer.html(o);break}case"def":{s+=this.renderer.def(o);break}case"paragraph":{s+=this.renderer.paragraph(o);break}case"text":{s+=this.renderer.text(o);break}default:{let i='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return s}parseInline(e,s=this.renderer){this.renderer.parser=this;let r="";for(let n=0;n<e.length;n++){let o=e[n];if(this.options.extensions?.renderers?.[o.type]){let l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){r+=l||"";continue}}let i=o;switch(i.type){case"escape":{r+=s.text(i);break}case"html":{r+=s.html(i);break}case"link":{r+=s.link(i);break}case"image":{r+=s.image(i);break}case"checkbox":{r+=s.checkbox(i);break}case"strong":{r+=s.strong(i);break}case"em":{r+=s.em(i);break}case"codespan":{r+=s.codespan(i);break}case"br":{r+=s.br(i);break}case"del":{r+=s.del(i);break}case"text":{r+=s.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},fe=class{options;block;constructor(t){this.options=t||ae}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?G.lex:G.lexInline}provideParser(t=this.block){return t?W.parse:W.parseInline}},bt=class{defaults=qe();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=W;Renderer=$e;TextRenderer=Ue;Lexer=G;Tokenizer=ve;Hooks=fe;constructor(...t){this.use(...t)}walkTokens(t,e){let s=[];for(let r of t)switch(s=s.concat(e.call(this,r)),r.type){case"table":{let n=r;for(let o of n.header)s=s.concat(this.walkTokens(o.tokens,e));for(let o of n.rows)for(let i of o)s=s.concat(this.walkTokens(i.tokens,e));break}case"list":{let n=r;s=s.concat(this.walkTokens(n.items,e));break}default:{let n=r;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(o=>{let i=n[o].flat(1/0);s=s.concat(this.walkTokens(i,e))}):n.tokens&&(s=s.concat(this.walkTokens(n.tokens,e)))}}return s}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(s=>{let r={...s};if(r.async=this.defaults.async||r.async||!1,s.extensions&&(s.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let o=e.renderers[n.name];o?e.renderers[n.name]=function(...i){let l=n.renderer.apply(this,i);return l===!1&&(l=o.apply(this,i)),l}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=e[n.level];o?o.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),r.extensions=e),s.renderer){let n=this.defaults.renderer||new $e(this.defaults);for(let o in s.renderer){if(!(o in n))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let i=o,l=s.renderer[i],a=n[i];n[i]=(...d)=>{let h=l.apply(n,d);return h===!1&&(h=a.apply(n,d)),h||""}}r.renderer=n}if(s.tokenizer){let n=this.defaults.tokenizer||new ve(this.defaults);for(let o in s.tokenizer){if(!(o in n))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let i=o,l=s.tokenizer[i],a=n[i];n[i]=(...d)=>{let h=l.apply(n,d);return h===!1&&(h=a.apply(n,d)),h}}r.tokenizer=n}if(s.hooks){let n=this.defaults.hooks||new fe;for(let o in s.hooks){if(!(o in n))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let i=o,l=s.hooks[i],a=n[i];fe.passThroughHooks.has(o)?n[i]=d=>{if(this.defaults.async&&fe.passThroughHooksRespectAsync.has(o))return(async()=>{let m=await l.call(n,d);return a.call(n,m)})();let h=l.call(n,d);return a.call(n,h)}:n[i]=(...d)=>{if(this.defaults.async)return(async()=>{let m=await l.apply(n,d);return m===!1&&(m=await a.apply(n,d)),m})();let h=l.apply(n,d);return h===!1&&(h=a.apply(n,d)),h}}r.hooks=n}if(s.walkTokens){let n=this.defaults.walkTokens,o=s.walkTokens;r.walkTokens=function(i){let l=[];return l.push(o.call(this,i)),n&&(l=l.concat(n.call(this,i))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return G.lex(t,e??this.defaults)}parser(t,e){return W.parse(t,e??this.defaults)}parseMarkdown(t){return(e,s)=>{let r={...s},n={...this.defaults,...r},o=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&r.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=t),n.async)return(async()=>{let i=n.hooks?await n.hooks.preprocess(e):e,l=await(n.hooks?await n.hooks.provideLexer(t):t?G.lex:G.lexInline)(i,n),a=n.hooks?await n.hooks.processAllTokens(l):l;n.walkTokens&&await Promise.all(this.walkTokens(a,n.walkTokens));let d=await(n.hooks?await n.hooks.provideParser(t):t?W.parse:W.parseInline)(a,n);return n.hooks?await n.hooks.postprocess(d):d})().catch(o);try{n.hooks&&(e=n.hooks.preprocess(e));let i=(n.hooks?n.hooks.provideLexer(t):t?G.lex:G.lexInline)(e,n);n.hooks&&(i=n.hooks.processAllTokens(i)),n.walkTokens&&this.walkTokens(i,n.walkTokens);let l=(n.hooks?n.hooks.provideParser(t):t?W.parse:W.parseInline)(i,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(i){return o(i)}}}onError(t,e){return s=>{if(s.message+=`
|
|
64
|
-
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+K(s.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(s);throw s}}},oe=new bt;function T(t,e){return oe.parse(t,e)}T.options=T.setOptions=function(t){return oe.setOptions(t),T.defaults=oe.defaults,ct(T.defaults),T};T.getDefaults=qe;T.defaults=ae;T.use=function(...t){return oe.use(...t),T.defaults=oe.defaults,ct(T.defaults),T};T.walkTokens=function(t,e){return oe.walkTokens(t,e)};T.parseInline=oe.parseInline;T.Parser=W;T.parser=W.parse;T.Renderer=$e;T.TextRenderer=Ue;T.Lexer=G;T.lexer=G.lex;T.Tokenizer=ve;T.Hooks=fe;T.parse=T;T.options;T.setOptions;T.use;T.walkTokens;T.parseInline;W.parse;G.lex;function B(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const
|
|
64
|
+
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+K(s.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(s);throw s}}},oe=new bt;function T(t,e){return oe.parse(t,e)}T.options=T.setOptions=function(t){return oe.setOptions(t),T.defaults=oe.defaults,ct(T.defaults),T};T.getDefaults=qe;T.defaults=ae;T.use=function(...t){return oe.use(...t),T.defaults=oe.defaults,ct(T.defaults),T};T.walkTokens=function(t,e){return oe.walkTokens(t,e)};T.parseInline=oe.parseInline;T.Parser=W;T.parser=W.parse;T.Renderer=$e;T.TextRenderer=Ue;T.Lexer=G;T.lexer=G.lex;T.Tokenizer=ve;T.Hooks=fe;T.parse=T;T.options;T.setOptions;T.use;T.walkTokens;T.parseInline;W.parse;G.lex;function B(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const Rn=/^(?:https?:|mailto:|tel:|[/#?]|[^a-z0-9+.-]|$)/i;function nt(t){return Rn.test(t.trim().replace(/[-]/g,""))}function yt(t){return new bt({renderer:{html:e=>B(typeof e=="string"?e:e.text),link:e=>{const s=B(e.text||e.href);return t==="text"||!nt(e.href)?e.text&&e.text!==e.href?`${s} (${B(e.href)})`:s:`<a href="${B(e.href)}">${s}</a>`},image:e=>t==="text"||!nt(e.href)?B(e.text||e.href):`<img src="${B(e.href)}" alt="${B(e.text??"")}">`}})}yt("anchor");yt("text");const Cn=Symbol("clusterSectionLocator");function Tn(){return It(Cn,{canLocate:()=>!1,open:()=>{}})}const zn={class:"space-y-3"},In={key:2,class:"space-y-3 rounded-lg border border-default p-4 bg-elevated/30"},En={class:"flex items-start gap-3"},Pn=["title"],Ln={class:"relative size-12"},Bn={viewBox:"0 0 36 36",class:"size-12 -rotate-90"},Dn=["stroke-dasharray"],qn={class:"absolute inset-0 flex items-center justify-center text-xs font-semibold"},Fn={class:"flex-1 min-w-0"},Mn={class:"flex items-start justify-between gap-2"},Nn={class:"flex flex-wrap items-center gap-1.5"},jn={key:4,class:"text-xs text-gray-500 inline-flex items-center gap-1"},On={class:"flex items-center gap-1 shrink-0"},Hn={key:0,class:"text-sm font-medium mt-1.5"},Zn={key:0,class:"text-sm text-gray-600 dark:text-gray-400"},Un={key:1,class:"space-y-1"},Vn={class:"flex flex-wrap items-baseline gap-x-1.5 gap-y-1"},Qn=["title","onClick"],Gn=["title","onClick"],Wn={key:2},Xn={class:"text-sm text-gray-600 dark:text-gray-400"},Kn={key:1,class:"mt-2"},Jn={class:"flex items-center justify-between mb-1"},Yn={class:"flex items-center gap-1.5"},er={class:"flex items-center gap-1"},tr={key:0,class:"text-xs text-rose-600 dark:text-rose-400 mt-1"},sr={key:2,class:"mt-2"},nr={key:3,class:"space-y-1.5"},rr={class:"flex items-center gap-1"},ir={key:0,class:"space-y-1.5"},or={class:"flex items-center gap-1.5"},ar={key:1,class:"flex items-center gap-1.5 flex-1 min-w-0"},lr={class:"h-1.5 flex-1 max-w-24 rounded-full bg-gray-200 dark:bg-gray-700 overflow-hidden"},cr={class:"text-xs text-gray-400 shrink-0"},ur={key:0,class:"text-sm text-gray-600 dark:text-gray-400 mt-1"},pr={class:"space-y-1"},dr=["onClick"],hr={key:5,class:"space-y-1"},gr={class:"flex items-start justify-between gap-3 pt-1 border-t border-default"},fr={class:"flex items-start gap-2"},kr={class:"flex items-center gap-1 shrink-0 pt-0.5"},xr={key:0,class:"flex items-start gap-1.5"},mr={class:"flex items-center gap-1.5 text-xs text-gray-400 shrink-0 pt-0.5"},br={key:3,class:"flex flex-col items-center justify-center p-8 text-center text-gray-400 border border-dashed border-default rounded-lg"},yr=ce({__name:"DiagnosisResult",props:{diagnosis:{},lastSeenRunId:{}},emits:["view-section","prefill-context"],setup(t,{emit:e}){const s=t,{copy:r,copied:n}=Be(),o=Tn(),i=P(()=>s.diagnosis?.details);function l(u,g){return u==null&&g==null?"":`${u??0} in / ${g??0} out tokens`}function a(u){return u.status==="running"&&Date.now()-new Date(u.updatedAt).getTime()>300*1e3}const d=ne(!1),h=ne(!1),m=ne(!1),b=ne(null),z=ne(void 0),_=Pt(new Set);ye(()=>s.diagnosis?.id,()=>_.clear()),ye(()=>s.diagnosis?.feedback,u=>{b.value=u??null},{immediate:!0}),ye(()=>s.diagnosis?.feedbackNote,u=>{z.value=u??void 0},{immediate:!0});async function H(u){if(!s.diagnosis)return;const g=b.value===u?null:u;b.value=g,g||(m.value=!1),d.value=!0;try{await $fetch(`/api/failure-diagnoses/${s.diagnosis.id}/feedback`,{method:"PATCH",body:{feedback:g,feedbackNote:z.value||null}})}catch{b.value=s.diagnosis.feedback??null}finally{d.value=!1}}async function v(){if(s.diagnosis){h.value=!0;try{await $fetch(`/api/failure-diagnoses/${s.diagnosis.id}/feedback`,{method:"PATCH",body:{feedback:b.value,feedbackNote:z.value||null}}),m.value=!1}catch{}finally{h.value=!1}}}const y=P(()=>{const u=s.diagnosis;return!u||u.status!=="completed"||s.lastSeenRunId==null?!1:new Date(u.updatedAt).getTime()<Date.now()-300*1e3});function L(){if(!s.diagnosis||s.diagnosis.status!=="completed")return"";const u=s.diagnosis,g=i.value,k=[];u.category&&k.push(`**Category:** ${u.category}`),u.confidence&&k.push(`**Confidence:** ${u.confidence}${g?.confidenceScore!=null?` (${g.confidenceScore}/100)`:""}`),g?.severity&&k.push(`**Severity:** ${g.severity}`),g?.affectedArea&&k.push(`**Affected area:** ${g.affectedArea}`),k.push(""),u.summary&&k.push(`${u.summary}
|
|
65
65
|
`),u.rootCause&&k.push(`**Root cause:** ${u.rootCause}
|
|
66
|
-
`);const D=g?.evidence??[];D.length&&(k.push("**Evidence:**"),D.forEach(V=>k.push(`- ${V}`)),k.push(""));const
|
|
67
|
-
${
|
|
68
|
-
\`\`\``):
|
|
69
|
-
${
|
|
66
|
+
`);const D=g?.evidence??[];D.length&&(k.push("**Evidence:**"),D.forEach(V=>k.push(`- ${V}`)),k.push(""));const R=g?.suggestedFix;R&&(k.push("**Suggested fix:**"),R.description&&k.push(`${R.description}`),R.file&&k.push(`\`${R.file}\``),R.patch?k.push(`\`\`\`diff
|
|
67
|
+
${R.patch}
|
|
68
|
+
\`\`\``):R.code&&k.push(`\`\`\`
|
|
69
|
+
${R.code}
|
|
70
70
|
\`\`\``),k.push(""));const M=g?.hypotheses?.slice(1)??[];M.length&&(k.push("**Other hypotheses considered:**"),M.forEach(V=>k.push(`- (${V.category??"unknown"}, ${V.likelihood??"?"}/100) ${V.rootCause??""}`)),k.push(""));const Z=g?.investigationSteps??[];Z.length&&(k.push("**To confirm this diagnosis:**"),Z.forEach(V=>k.push(`- ${V}`)),k.push(""));const X=g?.preventionTips??[];return X.length&&(k.push("**Prevention tips:**"),X.forEach(V=>k.push(`- ${V}`)),k.push("")),u.model&&k.push(`_${u.model}_`),k.join(`
|
|
71
|
-
`)}function ee(){if(!s.diagnosis||s.diagnosis.status!=="completed")return"";const u=s.diagnosis,g=i.value,k=["<dl>"];u.category&&k.push(`<dt>Category</dt><dd>${B(u.category)}</dd>`),u.confidence&&k.push(`<dt>Confidence</dt><dd>${B(u.confidence)}${g?.confidenceScore!=null?` (${g.confidenceScore}/100)`:""}</dd>`),g?.severity&&k.push(`<dt>Severity</dt><dd>${B(String(g.severity))}</dd>`),g?.affectedArea&&k.push(`<dt>Affected area</dt><dd>${B(String(g.affectedArea))}</dd>`),k.push("</dl>"),u.summary&&k.push(`<p><strong>${B(u.summary)}</strong></p>`),u.rootCause&&k.push(`<p><strong>Root cause:</strong> ${B(u.rootCause)}</p>`);const D=g?.evidence??[];D.length&&(k.push("<p><strong>Evidence:</strong></p><ul>"),D.forEach(X=>k.push(`<li>${B(X)}</li>`)),k.push("</ul>"));const
|
|
71
|
+
`)}function ee(){if(!s.diagnosis||s.diagnosis.status!=="completed")return"";const u=s.diagnosis,g=i.value,k=["<dl>"];u.category&&k.push(`<dt>Category</dt><dd>${B(u.category)}</dd>`),u.confidence&&k.push(`<dt>Confidence</dt><dd>${B(u.confidence)}${g?.confidenceScore!=null?` (${g.confidenceScore}/100)`:""}</dd>`),g?.severity&&k.push(`<dt>Severity</dt><dd>${B(String(g.severity))}</dd>`),g?.affectedArea&&k.push(`<dt>Affected area</dt><dd>${B(String(g.affectedArea))}</dd>`),k.push("</dl>"),u.summary&&k.push(`<p><strong>${B(u.summary)}</strong></p>`),u.rootCause&&k.push(`<p><strong>Root cause:</strong> ${B(u.rootCause)}</p>`);const D=g?.evidence??[];D.length&&(k.push("<p><strong>Evidence:</strong></p><ul>"),D.forEach(X=>k.push(`<li>${B(X)}</li>`)),k.push("</ul>"));const R=g?.suggestedFix;R&&(k.push("<p><strong>Suggested fix:</strong></p>"),R.description&&k.push(`<p>${B(String(R.description))}</p>`),R.file&&k.push(`<code>${B(String(R.file))}</code>`),R.patch?k.push(`<pre>${B(String(R.patch))}</pre>`):R.code&&k.push(`<pre>${B(String(R.code))}</pre>`));const M=g?.investigationSteps??[];M.length&&(k.push("<p><strong>To confirm this diagnosis:</strong></p><ul>"),M.forEach(X=>k.push(`<li>${B(X)}</li>`)),k.push("</ul>"));const Z=g?.preventionTips??[];return Z.length&&(k.push("<p><strong>Prevention tips:</strong></p><ul>"),Z.forEach(X=>k.push(`<li>${B(X)}</li>`)),k.push("</ul>")),k.join(`
|
|
72
72
|
`)}async function re(){const u=L(),g=ee();if(!(!u&&!g))try{await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([u],{type:"text/plain"}),"text/html":new Blob([g],{type:"text/html"})})]),it().add({title:"Diagnosis copied",icon:"i-lucide-check",color:"success",duration:2e3})}catch{r(u,{toast:"Diagnosis copied"})}}function te(){const u=s.diagnosis;if(!u)return;const g=u.details?.suggestedFix?.patch;if(!g)return;const k=`git apply <<'EOF'
|
|
73
73
|
${g}
|
|
74
74
|
EOF`;r(k,{toast:"git apply command copied"})}function q(){const u=i.value?.suggestedFix?.patch;if(!u)return;const g=u.endsWith(`
|
|
75
75
|
`)?u:u+`
|
|
76
|
-
`,k=new Blob([g],{type:"text/x-patch"}),D=URL.createObjectURL(k),
|
|
76
|
+
`,k=new Blob([g],{type:"text/x-patch"}),D=URL.createObjectURL(k),R=document.createElement("a");R.href=D,R.download=`piwi-diagnosis-${s.diagnosis?.id??"fix"}.patch`,document.body.appendChild(R),R.click(),setTimeout(()=>{R.remove(),URL.revokeObjectURL(D)},1e3)}const E=P(()=>{const u=i.value?.patchValidation;return u&&typeof u=="object"?u:null}),F=P(()=>{const u=E.value;if(!u)return null;switch(u.status){case"applies":return{color:"success",icon:"i-lucide-badge-check",label:"Applies cleanly",title:"Verified against the real file at the failing commit"};case"applies-with-offset":return{color:"warning",icon:"i-lucide-badge-check",label:"Applies with offset",title:"Context matched at a shifted line — apply should still succeed"};case"stale-file":return{color:"error",icon:"i-lucide-badge-alert",label:"Does not apply",title:u.errors.join(`
|
|
77
77
|
`)||"The file changed since — patch context did not match"};case"invalid":return{color:"error",icon:"i-lucide-badge-alert",label:"Invalid diff",title:u.errors.join(`
|
|
78
|
-
`)||"Could not parse the patch as a unified diff"};default:return{color:"neutral",icon:"i-lucide-badge-help",label:"Unverified",title:"The source file was not in context, so the patch could not be validated"}}}),le={"app-bug":"error","test-bug":"warning","flaky-test":"warning",infrastructure:"info",environment:"secondary",unknown:"neutral"},
|
|
79
|
-
`);Ve("prefill-context",g)}const pe=P(()=>{const u=i.value?.confidenceScore;return typeof u=="number"?u:null}),de=P(()=>{const u=pe.value;return u!==null?u<50:s.diagnosis?.confidence==="low"||s.diagnosis?.category==="unknown"}),$t={"app-bug":"i-lucide-bug","test-bug":"i-lucide-flask-conical","flaky-test":"i-lucide-dice-5",infrastructure:"i-lucide-server",environment:"i-lucide-settings-2",unknown:"i-lucide-circle-help"},_t=P(()=>{const u=s.diagnosis?.confidence;return u==="high"?"text-emerald-500":u==="medium"?"text-amber-500":"text-rose-500"});function Te(u){return lt[u]??u}function St(u){const g=[];return{text:u.replace(/\[([a-zA-Z][a-zA-Z0-9]*)\]/g,(D,C)=>gs(C)?(g.push(C),""):D).replace(/\s{2,}/g," ").trim(),citations:g}}const Qe=P(()=>{const u=i.value?.evidence;return Array.isArray(u)?u.map(St):[]}),ze=P(()=>{const u=i.value?.hypotheses;return Array.isArray(u)?u.slice(1):[]}),me=ne(!1),Ie=P(()=>{const u=i.value?.pipeline;return Array.isArray(u)?u:[]}),Ge=P(()=>Ie.value.reduce((u,g)=>u+(g.cacheReadInputTokens??0),0));return(u,g)=>{const k=Ft,D=Lt,C=De,M=ke,Z=_e,X=Mt,V=ot,Rt=Nt,Ct=jt;return p(),f("div",zn,[t.diagnosis&&(t.diagnosis.status==="failed"||a(t.diagnosis))?(p(),N(k,{key:0,color:"error",title:"Diagnosis failed",description:t.diagnosis.error||"Unknown error"},null,8,["description"])):$("",!0),c(y)?(p(),N(k,{key:1,color:"warning",icon:"i-lucide-clock",title:"Diagnosis may be stale",description:"New evidence may have appeared since this diagnosis was made. Consider re-running."})):$("",!0),t.diagnosis&&t.diagnosis.status==="completed"?(p(),f("div",In,[x("div",En,[c(pe)!==null?(p(),f("div",{key:0,class:"shrink-0",title:`Confidence ${c(pe)}/100`},[x("div",Ln,[(p(),f("svg",Bn,[g[6]||(g[6]=x("circle",{cx:"18",cy:"18",r:"15.9155",fill:"none",class:"text-gray-200 dark:text-gray-700",stroke:"currentColor","stroke-width":"3"},null,-1)),x("circle",{cx:"18",cy:"18",r:"15.9155",fill:"none",class:J(c(_t)),stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-dasharray":`${c(pe)} 100`},null,10,Dn)])),x("span",qn,w(c(pe)),1)])],8,Pn)):$("",!0),x("div",Fn,[x("div",Mn,[x("div",Nn,[t.diagnosis.category?(p(),N(D,{key:0,color:le[t.diagnosis.category]||"neutral",variant:"subtle",size:"sm",icon:$t[t.diagnosis.category]},{default:Q(()=>[A(w(t.diagnosis.category),1)]),_:1},8,["color","icon"])):$("",!0),t.diagnosis.confidence?(p(),N(D,{key:1,color:Ae[t.diagnosis.confidence]||"neutral",variant:"outline",size:"sm"},{default:Q(()=>[A(w(t.diagnosis.confidence)+" confidence ",1)]),_:1},8,["color"])):$("",!0),t.diagnosis.confidence?(p(),N(C,{key:2,topic:"cluster.confidence"})):$("",!0),c(i)?.severity?(p(),N(D,{key:3,color:wt[c(i).severity]||"neutral",variant:"soft",size:"sm"},{default:Q(()=>[A(w(c(i).severity)+" severity ",1)]),_:1},8,["color"])):$("",!0),c(i)?.affectedArea?(p(),f("span",jn,[S(M,{name:"i-lucide-crosshair",class:"size-3 shrink-0"}),A(" "+w(c(i).affectedArea),1)])):$("",!0)]),x("div",On,[S(C,{topic:"cluster.result"}),S(Z,{icon:c(n)?"i-lucide-check":"i-lucide-clipboard",size:"xs",color:"neutral",variant:"ghost",title:"Copy full diagnosis (Markdown + HTML)",onClick:re},null,8,["icon"])])]),t.diagnosis.summary?(p(),f("p",Hn,w(t.diagnosis.summary),1)):$("",!0)])]),t.diagnosis.rootCause?(p(),f("p",Zn,w(t.diagnosis.rootCause),1)):$("",!0),c(Qe).length?(p(),f("ul",Un,[(p(!0),f(j,null,Y(c(Qe),(I,U)=>(p(),f("li",{key:U,class:"text-sm text-gray-600 dark:text-gray-400 flex gap-1.5"},[g[7]||(g[7]=x("span",{class:"text-gray-400 shrink-0 leading-5"},"•",-1)),x("span",Vn,[x("span",null,w(I.text),1),(p(!0),f(j,null,Y(I.citations,se=>(p(),f("span",{key:se,class:"inline-flex items-center"},[x("button",{class:J(["inline-flex items-center gap-0.5 border border-default px-1.5 text-xs text-gray-500 hover:text-primary hover:border-primary transition-colors",c(o).canLocate(se)?"rounded-l bg-elevated":"rounded bg-elevated"]),title:`View ${Te(se)} in the AI context`,onClick:At=>Ve("view-section",se)},[S(M,{name:"i-lucide-link",class:"size-2.5"}),A(" "+w(Te(se)),1)],10,Qn),c(o).canLocate(se)?(p(),f("button",{key:0,class:"inline-flex items-center rounded-r border border-l-0 border-default bg-elevated px-1 text-xs text-gray-500 hover:text-primary hover:border-primary transition-colors",title:`Show ${Te(se)} on the page`,onClick:At=>c(o).open(se)},[S(M,{name:"i-lucide-map-pin",class:"size-2.5"})],8,Gn)):$("",!0)]))),128))])]))),128))])):$("",!0),c(i)?.suggestedFix?(p(),f("div",Wn,[g[9]||(g[9]=x("p",{class:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"},"Suggested fix",-1)),x("p",Xn,w(c(i).suggestedFix.description),1),c(i).suggestedFix.file&&!c(i).suggestedFix.patch?(p(),N(X,{key:0,"file-path":c(i).suggestedFix.file,class:"text-xs mt-1"},null,8,["file-path"])):$("",!0),c(i).suggestedFix.patch?(p(),f("div",Kn,[x("div",Jn,[x("div",Yn,[g[8]||(g[8]=x("span",{class:"text-xs text-gray-500 font-mono"},"patch",-1)),c(F)?(p(),N(D,{key:0,color:c(F).color,variant:"subtle",size:"sm",icon:c(F).icon,title:c(F).title},{default:Q(()=>[A(w(c(F).label),1)]),_:1},8,["color","icon","title"])):$("",!0)]),x("div",er,[S(Z,{size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-download",title:"Download .patch file",onClick:q}),S(Z,{size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-terminal",title:"Copy git apply command",onClick:te}),S(Z,{icon:c(n)?"i-lucide-check":"i-lucide-clipboard",size:"xs",color:"neutral",variant:"ghost",title:"Copy patch",onClick:g[0]||(g[0]=I=>c(r)(c(i).suggestedFix.patch))},null,8,["icon"])])]),S(V,{text:"```diff\n"+c(i).suggestedFix.patch+"\n```"},null,8,["text"]),c(E)&&(c(E).status==="stale-file"||c(E).status==="invalid")?(p(),f("p",tr,w(c(E).errors[0]||"This patch could not be verified against the source."),1)):$("",!0)])):c(i).suggestedFix.code?(p(),f("div",sr,[S(Rt,{code:c(i).suggestedFix.code},null,8,["code"])])):$("",!0)])):$("",!0),c(ze).length?(p(),f("div",nr,[x("div",rr,[x("button",{class:"flex items-center gap-1.5 text-xs font-medium text-gray-500 uppercase tracking-wide hover:text-gray-700 dark:hover:text-gray-300",onClick:g[1]||(g[1]=I=>me.value=!c(me))},[S(M,{name:c(me)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3.5"},null,8,["name"]),A(" Other hypotheses considered ("+w(c(ze).length)+") ",1)]),S(C,{topic:"cluster.hypotheses"})]),c(me)?(p(),f("div",ir,[(p(!0),f(j,null,Y(c(ze),(I,U)=>(p(),f("div",{key:U,class:"rounded-md border border-default bg-elevated/40 px-2.5 py-1.5"},[x("div",or,[I.category?(p(),N(D,{key:0,color:le[I.category]||"neutral",variant:"subtle",size:"sm"},{default:Q(()=>[A(w(I.category),1)]),_:2},1032,["color"])):$("",!0),typeof I.likelihood=="number"?(p(),f("div",ar,[x("div",lr,[x("div",{class:"h-full rounded-full bg-gray-400 dark:bg-gray-500",style:rt({width:`${I.likelihood}%`})},null,4)]),x("span",cr,w(I.likelihood)+"/100",1)])):$("",!0)]),I.rootCause?(p(),f("p",ur,w(I.rootCause),1)):$("",!0)]))),128))])):$("",!0)])):$("",!0),c(i)?.investigationSteps?.length?(p(),f("div",{key:4,class:J(["space-y-1.5",c(de)?"rounded-lg border border-amber-300/60 dark:border-amber-500/30 bg-amber-50/60 dark:bg-amber-500/10 p-3":""])},[x("p",{class:J(["text-xs font-medium uppercase tracking-wide flex items-center gap-1.5",c(de)?"text-amber-700 dark:text-amber-400":"text-gray-500"])},[c(de)?(p(),N(M,{key:0,name:"i-lucide-flask-conical",class:"size-3.5 shrink-0"})):$("",!0),A(" "+w(c(de)?"Low confidence — gather more evidence":"To confirm this diagnosis"),1)],2),x("ul",pr,[(p(!0),f(j,null,Y(c(i).investigationSteps,(I,U)=>(p(),f("li",{key:U,class:J(["text-sm flex gap-2 items-start cursor-pointer select-none",c(_).has(Number(U))?"text-gray-400 dark:text-gray-500 line-through":"text-gray-600 dark:text-gray-400"]),onClick:se=>c(_).has(Number(U))?c(_).delete(Number(U)):c(_).add(Number(U))},[S(M,{name:c(_).has(Number(U))?"i-lucide-check-square":"i-lucide-square",class:J(["size-4 shrink-0 mt-0.5",c(_).has(Number(U))?"text-primary":"text-gray-400"])},null,8,["name","class"]),A(" "+w(I),1)],10,dr))),128))]),c(de)?(p(),N(Z,{key:0,size:"xs",color:"warning",variant:"soft",icon:"i-lucide-clipboard-pen",class:"mt-1",title:"Pre-fill the additional-context box with these checks, then re-diagnose",onClick:vt},{default:Q(()=>[...g[10]||(g[10]=[A(" Add to context & refine ",-1)])]),_:1})):$("",!0)],2)):$("",!0),c(i)?.preventionTips?.length?(p(),f("ul",hr,[g[11]||(g[11]=x("li",{class:"text-xs font-medium text-gray-500 uppercase tracking-wide"},"Prevention tips",-1)),(p(!0),f(j,null,Y(c(i).preventionTips,(I,U)=>(p(),f("li",{key:U,class:"text-sm text-gray-600 dark:text-gray-400 flex gap-1.5"},[S(M,{name:"i-lucide-lightbulb",class:"size-3.5 shrink-0 mt-0.5 text-yellow-500"}),A(" "+w(I),1)]))),128))])):$("",!0),x("div",gr,[x("div",fr,[x("div",kr,[S(Z,{icon:(c(b)==="up","i-lucide-thumbs-up"),color:c(b)==="up"?"success":"neutral",variant:"ghost",size:"xs",loading:c(d),onClick:g[2]||(g[2]=I=>H("up"))},null,8,["icon","color","loading"]),S(Z,{icon:(c(b)==="down","i-lucide-thumbs-down"),color:c(b)==="down"?"error":"neutral",variant:"ghost",size:"xs",loading:c(d),onClick:g[3]||(g[3]=I=>H("down"))},null,8,["icon","color","loading"]),c(b)?(p(),f("button",{key:0,class:"text-xs text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 ml-1 transition-colors",onClick:g[4]||(g[4]=I=>m.value=!c(m))},[S(M,{name:c(m)?"i-lucide-chevron-up":"i-lucide-chevron-down",class:"size-3"},null,8,["name"]),A(" "+w(c(z)?"Edit note":"Note"),1)])):$("",!0)]),c(m)?(p(),f("div",xr,[S(Ct,{modelValue:c(z),"onUpdate:modelValue":g[5]||(g[5]=I=>Et(z)?z.value=I:null),size:"xs",placeholder:"Add a note about this feedback…",class:"max-w-64",ui:{base:"text-xs"},rows:2},null,8,["modelValue"]),S(Z,{size:"xs",color:"primary",variant:"solid",loading:c(h),onClick:v},{default:Q(()=>[...g[12]||(g[12]=[A(" Save ",-1)])]),_:1},8,["loading"])])):$("",!0)]),x("div",mr,[c(Ie).length>1?(p(),N(D,{key:0,color:"neutral",variant:"subtle",size:"sm",icon:"i-lucide-workflow",title:c(Ie).map(I=>`${I.role}: ${I.model}`).join(" → ")},{default:Q(()=>[...g[13]||(g[13]=[A(" 2-stage ",-1)])]),_:1},8,["title"])):$("",!0),x("span",null,[A(w(t.diagnosis.model)+" · "+w(l(t.diagnosis.inputTokens,t.diagnosis.outputTokens)),1),c(Ge)>0?(p(),f(j,{key:0},[A(" ("+w(c(Ge))+" cached)",1)],64)):$("",!0),A(" · "+w(c(Dt)(t.diagnosis.updatedAt)),1)])])])])):$("",!0),t.diagnosis?$("",!0):(p(),f("div",br,[S(M,{name:"i-lucide-sparkles",class:"size-8 mb-2 opacity-30"}),g[14]||(g[14]=x("p",{class:"text-sm"},"Diagnosis will appear here",-1))]))])}}}),Fr=Object.assign(yr,{__name:"DiagnosisResult"});export{zr as _,ot as a,Er as b,An as c,Dr as d,Fr as e,qr as f,Lr as g,Br as h,Ir as i,Pr as s,Ot as u};
|
|
78
|
+
`)||"Could not parse the patch as a unified diff"};default:return{color:"neutral",icon:"i-lucide-badge-help",label:"Unverified",title:"The source file was not in context, so the patch could not be validated"}}}),le={"app-bug":"error","test-bug":"warning","flaky-test":"warning",infrastructure:"info",environment:"secondary",unknown:"neutral"},Ce={high:"success",medium:"warning",low:"neutral"},wt={blocker:"error",high:"warning",medium:"info",low:"neutral"},Ve=e;function vt(){const u=i.value?.investigationSteps??[];if(!u.length)return;const g=["Investigation findings (fill in the results, then re-diagnose):",...u.map(k=>`- ${k}: `)].join(`
|
|
79
|
+
`);Ve("prefill-context",g)}const pe=P(()=>{const u=i.value?.confidenceScore;return typeof u=="number"?u:null}),de=P(()=>{const u=pe.value;return u!==null?u<50:s.diagnosis?.confidence==="low"||s.diagnosis?.category==="unknown"}),$t={"app-bug":"i-lucide-bug","test-bug":"i-lucide-flask-conical","flaky-test":"i-lucide-dice-5",infrastructure:"i-lucide-server",environment:"i-lucide-settings-2",unknown:"i-lucide-circle-help"},_t=P(()=>{const u=s.diagnosis?.confidence;return u==="high"?"text-emerald-500":u==="medium"?"text-amber-500":"text-rose-500"});function Te(u){return lt[u]??u}function St(u){const g=[];return{text:u.replace(/\[([a-zA-Z][a-zA-Z0-9]*)\]/g,(D,R)=>gs(R)?(g.push(R),""):D).replace(/\s{2,}/g," ").trim(),citations:g}}const Qe=P(()=>{const u=i.value?.evidence;return Array.isArray(u)?u.map(St):[]}),ze=P(()=>{const u=i.value?.hypotheses;return Array.isArray(u)?u.slice(1):[]}),me=ne(!1),Ie=P(()=>{const u=i.value?.pipeline;return Array.isArray(u)?u:[]}),Ge=P(()=>Ie.value.reduce((u,g)=>u+(g.cacheReadInputTokens??0),0));return(u,g)=>{const k=Ft,D=Lt,R=De,M=ke,Z=_e,X=Mt,V=ot,At=Nt,Rt=jt;return p(),f("div",zn,[t.diagnosis&&(t.diagnosis.status==="failed"||a(t.diagnosis))?(p(),N(k,{key:0,color:"error",title:"Diagnosis failed",description:t.diagnosis.error||"Unknown error"},null,8,["description"])):$("",!0),c(y)?(p(),N(k,{key:1,color:"warning",icon:"i-lucide-clock",title:"Diagnosis may be stale",description:"New evidence may have appeared since this diagnosis was made. Consider re-running."})):$("",!0),t.diagnosis&&t.diagnosis.status==="completed"?(p(),f("div",In,[x("div",En,[c(pe)!==null?(p(),f("div",{key:0,class:"shrink-0",title:`Confidence ${c(pe)}/100`},[x("div",Ln,[(p(),f("svg",Bn,[g[6]||(g[6]=x("circle",{cx:"18",cy:"18",r:"15.9155",fill:"none",class:"text-gray-200 dark:text-gray-700",stroke:"currentColor","stroke-width":"3"},null,-1)),x("circle",{cx:"18",cy:"18",r:"15.9155",fill:"none",class:J(c(_t)),stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-dasharray":`${c(pe)} 100`},null,10,Dn)])),x("span",qn,w(c(pe)),1)])],8,Pn)):$("",!0),x("div",Fn,[x("div",Mn,[x("div",Nn,[t.diagnosis.category?(p(),N(D,{key:0,color:le[t.diagnosis.category]||"neutral",variant:"subtle",size:"sm",icon:$t[t.diagnosis.category]},{default:Q(()=>[C(w(t.diagnosis.category),1)]),_:1},8,["color","icon"])):$("",!0),t.diagnosis.confidence?(p(),N(D,{key:1,color:Ce[t.diagnosis.confidence]||"neutral",variant:"outline",size:"sm"},{default:Q(()=>[C(w(t.diagnosis.confidence)+" confidence ",1)]),_:1},8,["color"])):$("",!0),t.diagnosis.confidence?(p(),N(R,{key:2,topic:"cluster.confidence"})):$("",!0),c(i)?.severity?(p(),N(D,{key:3,color:wt[c(i).severity]||"neutral",variant:"soft",size:"sm"},{default:Q(()=>[C(w(c(i).severity)+" severity ",1)]),_:1},8,["color"])):$("",!0),c(i)?.affectedArea?(p(),f("span",jn,[S(M,{name:"i-lucide-crosshair",class:"size-3 shrink-0"}),C(" "+w(c(i).affectedArea),1)])):$("",!0)]),x("div",On,[S(R,{topic:"cluster.result"}),S(Z,{icon:c(n)?"i-lucide-check":"i-lucide-clipboard",size:"xs",color:"neutral",variant:"ghost",title:"Copy full diagnosis (Markdown + HTML)",onClick:re},null,8,["icon"])])]),t.diagnosis.summary?(p(),f("p",Hn,w(t.diagnosis.summary),1)):$("",!0)])]),t.diagnosis.rootCause?(p(),f("p",Zn,w(t.diagnosis.rootCause),1)):$("",!0),c(Qe).length?(p(),f("ul",Un,[(p(!0),f(j,null,Y(c(Qe),(I,U)=>(p(),f("li",{key:U,class:"text-sm text-gray-600 dark:text-gray-400 flex gap-1.5"},[g[7]||(g[7]=x("span",{class:"text-gray-400 shrink-0 leading-5"},"•",-1)),x("span",Vn,[x("span",null,w(I.text),1),(p(!0),f(j,null,Y(I.citations,se=>(p(),f("span",{key:se,class:"inline-flex items-center"},[x("button",{class:J(["inline-flex items-center gap-0.5 border border-default px-1.5 text-xs text-gray-500 hover:text-primary hover:border-primary transition-colors",c(o).canLocate(se)?"rounded-l bg-elevated":"rounded bg-elevated"]),title:`View ${Te(se)} in the AI context`,onClick:Ct=>Ve("view-section",se)},[S(M,{name:"i-lucide-link",class:"size-2.5"}),C(" "+w(Te(se)),1)],10,Qn),c(o).canLocate(se)?(p(),f("button",{key:0,class:"inline-flex items-center rounded-r border border-l-0 border-default bg-elevated px-1 text-xs text-gray-500 hover:text-primary hover:border-primary transition-colors",title:`Show ${Te(se)} on the page`,onClick:Ct=>c(o).open(se)},[S(M,{name:"i-lucide-map-pin",class:"size-2.5"})],8,Gn)):$("",!0)]))),128))])]))),128))])):$("",!0),c(i)?.suggestedFix?(p(),f("div",Wn,[g[9]||(g[9]=x("p",{class:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"},"Suggested fix",-1)),x("p",Xn,w(c(i).suggestedFix.description),1),c(i).suggestedFix.file&&!c(i).suggestedFix.patch?(p(),N(X,{key:0,"file-path":c(i).suggestedFix.file,class:"text-xs mt-1"},null,8,["file-path"])):$("",!0),c(i).suggestedFix.patch?(p(),f("div",Kn,[x("div",Jn,[x("div",Yn,[g[8]||(g[8]=x("span",{class:"text-xs text-gray-500 font-mono"},"patch",-1)),c(F)?(p(),N(D,{key:0,color:c(F).color,variant:"subtle",size:"sm",icon:c(F).icon,title:c(F).title},{default:Q(()=>[C(w(c(F).label),1)]),_:1},8,["color","icon","title"])):$("",!0)]),x("div",er,[S(Z,{size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-download",title:"Download .patch file",onClick:q}),S(Z,{size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-terminal",title:"Copy git apply command",onClick:te}),S(Z,{icon:c(n)?"i-lucide-check":"i-lucide-clipboard",size:"xs",color:"neutral",variant:"ghost",title:"Copy patch",onClick:g[0]||(g[0]=I=>c(r)(c(i).suggestedFix.patch))},null,8,["icon"])])]),S(V,{text:"```diff\n"+c(i).suggestedFix.patch+"\n```"},null,8,["text"]),c(E)&&(c(E).status==="stale-file"||c(E).status==="invalid")?(p(),f("p",tr,w(c(E).errors[0]||"This patch could not be verified against the source."),1)):$("",!0)])):c(i).suggestedFix.code?(p(),f("div",sr,[S(At,{code:c(i).suggestedFix.code},null,8,["code"])])):$("",!0)])):$("",!0),c(ze).length?(p(),f("div",nr,[x("div",rr,[x("button",{class:"flex items-center gap-1.5 text-xs font-medium text-gray-500 uppercase tracking-wide hover:text-gray-700 dark:hover:text-gray-300",onClick:g[1]||(g[1]=I=>me.value=!c(me))},[S(M,{name:c(me)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3.5"},null,8,["name"]),C(" Other hypotheses considered ("+w(c(ze).length)+") ",1)]),S(R,{topic:"cluster.hypotheses"})]),c(me)?(p(),f("div",ir,[(p(!0),f(j,null,Y(c(ze),(I,U)=>(p(),f("div",{key:U,class:"rounded-md border border-default bg-elevated/40 px-2.5 py-1.5"},[x("div",or,[I.category?(p(),N(D,{key:0,color:le[I.category]||"neutral",variant:"subtle",size:"sm"},{default:Q(()=>[C(w(I.category),1)]),_:2},1032,["color"])):$("",!0),typeof I.likelihood=="number"?(p(),f("div",ar,[x("div",lr,[x("div",{class:"h-full rounded-full bg-gray-400 dark:bg-gray-500",style:rt({width:`${I.likelihood}%`})},null,4)]),x("span",cr,w(I.likelihood)+"/100",1)])):$("",!0)]),I.rootCause?(p(),f("p",ur,w(I.rootCause),1)):$("",!0)]))),128))])):$("",!0)])):$("",!0),c(i)?.investigationSteps?.length?(p(),f("div",{key:4,class:J(["space-y-1.5",c(de)?"rounded-lg border border-amber-300/60 dark:border-amber-500/30 bg-amber-50/60 dark:bg-amber-500/10 p-3":""])},[x("p",{class:J(["text-xs font-medium uppercase tracking-wide flex items-center gap-1.5",c(de)?"text-amber-700 dark:text-amber-400":"text-gray-500"])},[c(de)?(p(),N(M,{key:0,name:"i-lucide-flask-conical",class:"size-3.5 shrink-0"})):$("",!0),C(" "+w(c(de)?"Low confidence — gather more evidence":"To confirm this diagnosis"),1)],2),x("ul",pr,[(p(!0),f(j,null,Y(c(i).investigationSteps,(I,U)=>(p(),f("li",{key:U,class:J(["text-sm flex gap-2 items-start cursor-pointer select-none",c(_).has(Number(U))?"text-gray-400 dark:text-gray-500 line-through":"text-gray-600 dark:text-gray-400"]),onClick:se=>c(_).has(Number(U))?c(_).delete(Number(U)):c(_).add(Number(U))},[S(M,{name:c(_).has(Number(U))?"i-lucide-check-square":"i-lucide-square",class:J(["size-4 shrink-0 mt-0.5",c(_).has(Number(U))?"text-primary":"text-gray-400"])},null,8,["name","class"]),C(" "+w(I),1)],10,dr))),128))]),c(de)?(p(),N(Z,{key:0,size:"xs",color:"warning",variant:"soft",icon:"i-lucide-clipboard-pen",class:"mt-1",title:"Pre-fill the additional-context box with these checks, then re-diagnose",onClick:vt},{default:Q(()=>[...g[10]||(g[10]=[C(" Add to context & refine ",-1)])]),_:1})):$("",!0)],2)):$("",!0),c(i)?.preventionTips?.length?(p(),f("ul",hr,[g[11]||(g[11]=x("li",{class:"text-xs font-medium text-gray-500 uppercase tracking-wide"},"Prevention tips",-1)),(p(!0),f(j,null,Y(c(i).preventionTips,(I,U)=>(p(),f("li",{key:U,class:"text-sm text-gray-600 dark:text-gray-400 flex gap-1.5"},[S(M,{name:"i-lucide-lightbulb",class:"size-3.5 shrink-0 mt-0.5 text-yellow-500"}),C(" "+w(I),1)]))),128))])):$("",!0),x("div",gr,[x("div",fr,[x("div",kr,[S(Z,{icon:(c(b)==="up","i-lucide-thumbs-up"),color:c(b)==="up"?"success":"neutral",variant:"ghost",size:"xs",loading:c(d),onClick:g[2]||(g[2]=I=>H("up"))},null,8,["icon","color","loading"]),S(Z,{icon:(c(b)==="down","i-lucide-thumbs-down"),color:c(b)==="down"?"error":"neutral",variant:"ghost",size:"xs",loading:c(d),onClick:g[3]||(g[3]=I=>H("down"))},null,8,["icon","color","loading"]),c(b)?(p(),f("button",{key:0,class:"text-xs text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 ml-1 transition-colors",onClick:g[4]||(g[4]=I=>m.value=!c(m))},[S(M,{name:c(m)?"i-lucide-chevron-up":"i-lucide-chevron-down",class:"size-3"},null,8,["name"]),C(" "+w(c(z)?"Edit note":"Note"),1)])):$("",!0)]),c(m)?(p(),f("div",xr,[S(Rt,{modelValue:c(z),"onUpdate:modelValue":g[5]||(g[5]=I=>Et(z)?z.value=I:null),size:"xs",placeholder:"Add a note about this feedback…",class:"max-w-64",ui:{base:"text-xs"},rows:2},null,8,["modelValue"]),S(Z,{size:"xs",color:"primary",variant:"solid",loading:c(h),onClick:v},{default:Q(()=>[...g[12]||(g[12]=[C(" Save ",-1)])]),_:1},8,["loading"])])):$("",!0)]),x("div",mr,[c(Ie).length>1?(p(),N(D,{key:0,color:"neutral",variant:"subtle",size:"sm",icon:"i-lucide-workflow",title:c(Ie).map(I=>`${I.role}: ${I.model}`).join(" → ")},{default:Q(()=>[...g[13]||(g[13]=[C(" 2-stage ",-1)])]),_:1},8,["title"])):$("",!0),x("span",null,[C(w(t.diagnosis.model)+" · "+w(l(t.diagnosis.inputTokens,t.diagnosis.outputTokens)),1),c(Ge)>0?(p(),f(j,{key:0},[C(" ("+w(c(Ge))+" cached)",1)],64)):$("",!0),C(" · "+w(c(Dt)(t.diagnosis.updatedAt)),1)])])])])):$("",!0),t.diagnosis?$("",!0):(p(),f("div",br,[S(M,{name:"i-lucide-sparkles",class:"size-8 mb-2 opacity-30"}),g[14]||(g[14]=x("p",{class:"text-sm"},"Diagnosis will appear here",-1))]))])}}}),Fr=Object.assign(yr,{__name:"DiagnosisResult"});export{zr as _,ot as a,Er as b,Cn as c,Dr as d,Fr as e,qr as f,Lr as g,Br as h,Ir as i,Pr as s,Ot as u};
|