@testver/testver 1.4.2 → 1.5.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/LICENSE +88 -69
- package/README.md +6 -2
- package/bin/testver.js +9 -1
- package/dist/index.js +52650 -35771
- package/package.json +179 -178
- package/src/ui/static/agents/antigravity.svg +76 -0
- package/src/ui/static/agents/codex.svg +3 -0
- package/src/ui/static/agents/gemini.svg +1 -0
- package/src/ui/static/agents/opencode.svg +4 -0
- package/src/ui/static/agents/vscode.svg +17 -0
- package/src/ui/static/assets/AIPanel-RWO8Cd9w.js +32 -0
- package/src/ui/static/assets/AIRecordPanel-DnreS585.js +40 -0
- package/src/ui/static/assets/AIStreamUI-C1gHJtlF.js +9 -0
- package/src/ui/static/assets/{AITestGenPage-D3t2gPAA.js → AITestGenPage-C8bWUelu.js} +5 -5
- package/src/ui/static/assets/APITestingPage-DwL67hqL.js +19 -0
- package/src/ui/static/assets/AboutPage-CynLB95E.js +1 -0
- package/src/ui/static/assets/AccessTokensTab-BdevOmpE.js +1 -0
- package/src/ui/static/assets/AdvancedPage-BeM7aB8b.js +3 -0
- package/src/ui/static/assets/{AnalyticsPage-64mYNK2v.js → AnalyticsPage-C5ddYfRk.js} +1 -1
- package/src/ui/static/assets/AuditLogPage-DYcUdJoj.js +1 -0
- package/src/ui/static/assets/ChangesSummary-BjNMwGIZ.js +3 -0
- package/src/ui/static/assets/{CodeMapPage-B1ezmnlE.js → CodeMapPage-BQOEtv-R.js} +3 -3
- package/src/ui/static/assets/{ConfirmDialog-t7mpeeSN.js → ConfirmDialog-D_N9188T.js} +1 -1
- package/src/ui/static/assets/{CoveragePage-YMmCbiBk.js → CoveragePage-8bDSphY1.js} +2 -2
- package/src/ui/static/assets/{CronBuilder-Nk-K-_8I.js → CronBuilder-C7_JADb7.js} +1 -1
- package/src/ui/static/assets/{Dashboard-BDVxO2V4.js → Dashboard-B22yRPyV.js} +1 -1
- package/src/ui/static/assets/{DefectsPage-l8yGeCyR.js → DefectsPage-Arv4Ac-b.js} +72 -72
- package/src/ui/static/assets/{EmptyState-D1T3JWUr.js → EmptyState-BShNSbLf.js} +1 -1
- package/src/ui/static/assets/{ExportButton-Dt5RhL-h.js → ExportButton-xrS_AnfS.js} +1 -1
- package/src/ui/static/assets/{FileViewer-CrKgh_cB.js → FileViewer-Bcr9T1jW.js} +18 -18
- package/src/ui/static/assets/{GitPage-_4nCEzkJ.js → GitPage-DXL2Sv40.js} +12 -12
- package/src/ui/static/assets/{ImportExportPage-BcR7IQi9.js → ImportExportPage-BcjzRd7T.js} +36 -36
- package/src/ui/static/assets/{JiraPushDialog-C2sP4_4h.js → JiraPushDialog-DNYU9Ce0.js} +1 -1
- package/src/ui/static/assets/{KpiTile-inmeEsy3.js → KpiTile-BKlWqjgN.js} +1 -1
- package/src/ui/static/assets/{LiveExecutionView-D5BRe9jq.js → LiveExecutionView-1LlyEDEe.js} +1 -1
- package/src/ui/static/assets/{ManagePage-B8iG6Q0B.js → ManagePage-SvRQ6L19.js} +1 -1
- package/src/ui/static/assets/{MediaModal-C5n6sHYi.js → MediaModal-Dyy_iHl9.js} +1 -1
- package/src/ui/static/assets/MobileRunPicker-Cf5rm469.js +1 -0
- package/src/ui/static/assets/MobileRunTarget-C4M4YJJh.js +6 -0
- package/src/ui/static/assets/{ModuleExplorer-VGcmK167.js → ModuleExplorer-BKVbxFZK.js} +1 -1
- package/src/ui/static/assets/{OutputPage-B_1nPPxE.js → OutputPage-Bi-28tJi.js} +1 -1
- package/src/ui/static/assets/PipelinesPanel-BtO3iSJ4.js +1 -0
- package/src/ui/static/assets/{ProfilePage-y7tJNNFd.js → ProfilePage-BgZ4VDC-.js} +1 -1
- package/src/ui/static/assets/{ProjectExplorer-DbfGhRq0.js → ProjectExplorer-BVGbmVP7.js} +1 -1
- package/src/ui/static/assets/{RemoteFileStrip-WuRKtx_h.js → RemoteFileStrip-dzPInzgb.js} +1 -1
- package/src/ui/static/assets/{ReportCard-G52Q6-2i.js → ReportCard-LOf1PXlb.js} +2 -2
- package/src/ui/static/assets/{ReportFullView-Bt8UFP2J.js → ReportFullView-Ce4OI8lf.js} +1 -1
- package/src/ui/static/assets/{ReportsPage-DMtDi73Q.js → ReportsPage-DFxCQ8cY.js} +48 -48
- package/src/ui/static/assets/{ResultsPage-BI9jpK2N.js → ResultsPage-DD-uj8gk.js} +115 -115
- package/src/ui/static/assets/{RunState-ifC4zi6M.js → RunState-DDwFB4tA.js} +1 -1
- package/src/ui/static/assets/{RunTargets-C7vpCbck.js → RunTargets-CkIpY3v3.js} +1 -1
- package/src/ui/static/assets/ScriptMappingPage-DQQoR6sR.js +1 -0
- package/src/ui/static/assets/{SearchableDevicePicker-BYxYJNWl.js → SearchableDevicePicker-CenIxD7b.js} +1 -1
- package/src/ui/static/assets/{SettingsPage-DSISg7r7.js → SettingsPage-DAV_0y0m.js} +83 -83
- package/src/ui/static/assets/{SharedReportView-BOqKGJmR.js → SharedReportView-CqSLFKT1.js} +1 -1
- package/src/ui/static/assets/{SourcesPage-CgqtYGBi.js → SourcesPage-BvqC9oKw.js} +14 -14
- package/src/ui/static/assets/TestExplorerPage-Bdnll77k.js +7 -0
- package/src/ui/static/assets/{TestManagementPage-wqYTKP7W.js → TestManagementPage-CCNE688A.js} +10 -10
- package/src/ui/static/assets/{TestPlansPage-DOKX9p6z.js → TestPlansPage-T6D25i6-.js} +5 -5
- package/src/ui/static/assets/{TestverCreditsDetail-cSW0SpNx.js → TestverCreditsDetail-BKpt4oLW.js} +1 -1
- package/src/ui/static/assets/{TestverCreditsRing-DpMzl3h7.js → TestverCreditsRing-CoDk5eAS.js} +1 -1
- package/src/ui/static/assets/TestverMcpPage-Dte0qSXp.js +34 -0
- package/src/ui/static/assets/{UncommittedDiffViewer-BxS0zi-p.js → UncommittedDiffViewer-BNroxCoo.js} +2 -2
- package/src/ui/static/assets/{UserManagementPage-B5d0uDU_.js → UserManagementPage-BU4MuDJZ.js} +10 -10
- package/src/ui/static/assets/{WorkflowsPage-Bk0DFnFS.js → WorkflowsPage-BP5k7AqE.js} +83 -83
- package/src/ui/static/assets/clipboard-BIEd7Ccc.js +1 -0
- package/src/ui/static/assets/{hiddenLlmProviders-CdhhNa5G.js → hiddenLlmProviders-BPORgy-e.js} +1 -1
- package/src/ui/static/assets/index-BlA8ntjb.js +47 -0
- package/src/ui/static/assets/index-Co4_SlGD.css +1 -0
- package/src/ui/static/assets/{index-DpQhqcHv.js → index-DLmlY2Ol.js} +1 -1
- package/src/ui/static/assets/{reportMeta-AKcU_qwq.js → reportMeta-B9ZRW6ts.js} +1 -1
- package/src/ui/static/assets/runSelected-BoPm1sz-.js +1 -0
- package/src/ui/static/assets/{useChartTheme-BFz2QcND.js → useChartTheme-CTIe6M63.js} +1 -1
- package/src/ui/static/assets/{useDebouncedValue-BsHptIvX.js → useDebouncedValue-C9odz7b2.js} +1 -1
- package/src/ui/static/assets/{useFeatureFlags-DNkIctil.js → useFeatureFlags-B4Otsv-N.js} +1 -1
- package/src/ui/static/assets/{useJiraConnector-D5ysBBvz.js → useJiraConnector--JZhbYrT.js} +1 -1
- package/src/ui/static/assets/{useOwnership-U0AfKBRo.js → useOwnership-BhPOiYzy.js} +1 -1
- package/src/ui/static/assets/useSuites-GN_K2mHc.js +1 -0
- package/src/ui/static/assets/{useTabParam-ChbOedP1.js → useTabParam-CyYAP90W.js} +1 -1
- package/src/ui/static/assets/{useTestExplorer-DT8frjCK.js → useTestExplorer-BGhkGHKy.js} +1 -1
- package/src/ui/static/assets/{useTestLifecycle-OcwQaB1s.js → useTestLifecycle-DX5ES6x8.js} +1 -1
- package/src/ui/static/assets/{useTestManagement-Xm4Bcx3u.js → useTestManagement-ommXjx0q.js} +2 -2
- package/src/ui/static/assets/useTestResults-DWjvm8gm.js +1 -0
- package/src/ui/static/assets/{vendor-charts-DWFQlmCz.js → vendor-charts-By5uZ93z.js} +1 -1
- package/src/ui/static/assets/{vendor-flow-YGpC9U9I.js → vendor-flow-B61ZV-pm.js} +1 -1
- package/src/ui/static/assets/{vendor-icons-BKPiFyYV.js → vendor-icons-Cm92aSc5.js} +1426 -1421
- package/src/ui/static/assets/vendor-query-DkZSMtfn.js +1 -0
- package/src/ui/static/assets/{vendor-quill-W-RoQfb6.js → vendor-quill-xJF2Jvjc.js} +1 -1
- package/src/ui/static/assets/{vendor-react-CTbHBddL.js → vendor-react-DOVfxdUy.js} +1 -1
- package/src/ui/static/index.html +479 -479
- package/src/ui/static/assets/AIPanel-B_R-CbrF.js +0 -32
- package/src/ui/static/assets/AIRecordPanel-BRQWIU5h.js +0 -40
- package/src/ui/static/assets/AIStreamUI-C3D989_6.js +0 -9
- package/src/ui/static/assets/APITestingPage-Cmwkiiys.js +0 -19
- package/src/ui/static/assets/AboutPage-CjEqKB-q.js +0 -1
- package/src/ui/static/assets/AdvancedPage-4kAcpE8Y.js +0 -3
- package/src/ui/static/assets/AuditLogPage-BQjOzQje.js +0 -1
- package/src/ui/static/assets/ChangesSummary-CY_Vb27i.js +0 -2
- package/src/ui/static/assets/DiffViewer-BIU09a_i.js +0 -2
- package/src/ui/static/assets/MobileRunPicker-0h-N2c6d.js +0 -1
- package/src/ui/static/assets/MobileRunTarget-Bo_xekig.js +0 -6
- package/src/ui/static/assets/PipelinesPanel-PmmPu8pj.js +0 -1
- package/src/ui/static/assets/ScriptMappingPage-7vHuvhQw.js +0 -1
- package/src/ui/static/assets/TestExplorerPage-gYLhCD4d.js +0 -7
- package/src/ui/static/assets/index-BYVxKLrT.js +0 -47
- package/src/ui/static/assets/index-C2KJt7SI.css +0 -1
- package/src/ui/static/assets/runSelected-WlgnZcSF.js +0 -1
- package/src/ui/static/assets/useSuites-DyfN9HVv.js +0 -1
- package/src/ui/static/assets/useTestResults-D5EwGIX9.js +0 -1
- package/src/ui/static/assets/vendor-query-BrzmPFT3.js +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{r as v,d as Y,j as e}from"./vendor-react-DOVfxdUy.js";import{u as X}from"./vendor-query-DkZSMtfn.js";import{gC as Z,a6 as z}from"./index-BlA8ntjb.js";import{ag as G,X as ee,a1 as te,$ as re}from"./vendor-icons-Cm92aSc5.js";function se({run:t,file:r,onClose:i}){const{data:n,isLoading:l,error:s}=X({queryKey:["explore-run-file",t,r],queryFn:()=>Z(t,r),staleTime:3e4});v.useEffect(()=>{const a=c=>{c.key==="Escape"&&i()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[i]);const d=/\.(md|markdown)$/i.test(r);return Y.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[80] flex items-center justify-center p-4","data-testid":"run-file-viewer",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:i}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":`Exploration ${t} — ${r}`,className:"relative w-full max-w-3xl max-h-[85vh] flex flex-col rounded-2xl border border-gray-200 dark:border-white/10 bg-white dark:bg-surface-1 shadow-2xl",children:[e.jsxs("div",{className:"flex items-start gap-3 px-5 pt-4 pb-3 border-b border-gray-200 dark:border-white/5",children:[e.jsx("span",{className:"mt-0.5 rounded-lg bg-emerald-500/10 p-2 text-emerald-600 dark:text-emerald-400",children:e.jsx(G,{size:16})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"text-base font-semibold text-gray-900 dark:text-gray-100 break-all",children:r}),e.jsxs("p",{className:"text-[13px] text-gray-500 dark:text-gray-400 break-all",children:["Exploration run ",t," · read-only, credentials masked"]})]}),e.jsx("button",{type:"button",onClick:i,className:"p-1 rounded-md text-gray-400 hover:text-gray-700 dark:hover:text-gray-200",title:"Close","aria-label":"Close",children:e.jsx(ee,{size:16})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 text-[13px]",children:[l&&e.jsxs("div",{className:"flex items-center gap-2 text-gray-500",children:[e.jsx(te,{size:14,className:"animate-spin"})," Reading the file…"]}),s&&e.jsxs("p",{className:"text-red-600 dark:text-red-400",children:["This file could not be opened: ",s.message]}),n&&(d?e.jsx("div",{className:"text-gray-800 dark:text-gray-200",children:e.jsx(ue,{text:n.content})}):e.jsx("pre",{className:"whitespace-pre-wrap break-words font-mono text-[12px] text-gray-800 dark:text-gray-200",children:n.content}))]})]})]}),document.body)}const R=/\[\[cite\|([^|\]]*)\|([^|\]]*)\|([^|\]]*)(?:\|([^\]]*))?\]\]/g,ae=/\[\[cite\\?\|[^\]]*\]\]/g;function ne(t){return t.replace(/\\(?=[|[\]])/g,"")}function $e(t){return t.replace(ae,ne)}function W(t){const r=t.trim().toLowerCase();return r==="observed"||r==="reported"||r==="asserted"||r==="automated"||r==="stated"?r:"stated"}function L(t,r,i){return`${W(t)}|${r.trim()||i.trim()||"source"}`}function ie(t){const r=new Map;for(const i of t.matchAll(R)){const n=i[1]||"",l=(i[2]||"").trim(),s=(i[3]||"").trim(),d=L(n,l,s);r.has(d)||r.set(d,{index:r.size+1,tier:W(n),ref:l||s||"source",detail:l?s:"",kind:(i[4]||"").trim()||void 0})}return[...r.values()]}function Ce(t){return t.replace(R,"").replace(/[ \t]+([.,;:!?])/g,"$1")}function $(t){return t.kind||q[t.tier]}function Le(t){const r=ie(t),i=new Map(r.map(s=>[L(s.tier,s.ref,""),s])),n=t.replace(R,(s,d,a,c)=>{const m=i.get(L(d,a.trim()||c.trim(),""));return m?` [${m.index}]`:""}).replace(/[ \t]+(\[\d+\])/g," $1");if(r.length===0)return n;const l=r.map(s=>`[${s.index}] ${$(s)} · ${s.ref}${s.detail?` — ${s.detail}`:""}`);return`${n}
|
|
2
|
+
|
|
3
|
+
Sources:
|
|
4
|
+
${l.join(`
|
|
5
|
+
`)}`}const T=v.createContext(null);function Ie({citations:t,children:r}){const i=`src-${v.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,n=new Map(t.map(l=>[L(l.tier,l.ref,""),l]));return e.jsx(T.Provider,{value:{map:n,listId:i},children:r})}const V={observed:"text-emerald-600 dark:text-emerald-400 border-emerald-500/30 bg-emerald-500/10",reported:"text-rose-600 dark:text-rose-400 border-rose-500/30 bg-rose-500/10",asserted:"text-blue-600 dark:text-blue-400 border-blue-500/30 bg-blue-500/10",automated:"text-violet-600 dark:text-violet-400 border-violet-500/30 bg-violet-500/10",stated:"text-amber-600 dark:text-amber-400 border-amber-500/30 bg-amber-500/10"},oe={observed:"Observed — the app was watched doing this",reported:"Reported — a tester logged this as a defect",asserted:"Asserted — a test case says so",automated:"Automated — a test in the repository checks this",stated:"Stated — written in a document"},q={observed:"Exploration",reported:"Defect",asserted:"Test case",automated:"Automated test",stated:"Document"},le="relative -top-[3px] mx-[3px] inline-flex items-center justify-center min-w-[14px] h-[14px] px-[3px] rounded-[4px] border text-[9px] leading-none font-semibold tabular-nums align-baseline";function de(t,r){const i=document.getElementById(t);if(!i)return;i.open=!0;const n=document.getElementById(`${t}-${r}`);n==null||n.scrollIntoView({block:"nearest",behavior:"smooth"}),n==null||n.focus({preventScroll:!0})}function ce({tier:t,refId:r,detail:i,kind:n}){const l=v.useContext(T),s=l==null?void 0:l.map.get(L(t,r,i)),d=W((s==null?void 0:s.tier)??t),a=(s==null?void 0:s.ref)??(r||i||"source"),c=s?String(s.index):a,m=(s==null?void 0:s.kind)||n||q[d],f=`${m} · ${a}
|
|
6
|
+
${oe[d]}${s!=null&&s.detail||i?`
|
|
7
|
+
${(s==null?void 0:s.detail)||i}`:""}`;return e.jsx("button",{type:"button",title:f,"aria-label":`Source ${c}: ${m} ${a}`,onClick:()=>{l&&s&&de(l.listId,s.index)},className:`${le} cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-cyan-400/60 ${V[d]}`,children:c})}function xe(t){var l;const r=t.ref.split(" · ")[0].trim();if(!r)return null;const i=(s,d)=>({kind:"page",href:`${s}?${new URLSearchParams(d).toString()}`});if(t.kind==="Defect register")return{kind:"page",href:"/defects"};if(t.kind==="Defect"||t.tier==="reported")return i("/defects",{defectId:r});if(t.kind==="Test run")return i("/results",{runId:r});if(t.tier==="asserted")return i("/test-cases",{tcId:r});if(t.kind==="Automation library")return{kind:"page",href:"/tests"};if(t.tier==="automated"&&t.kind==="Method"){const s=/^(.+?) · (.+):(\d+)$/.exec(t.ref.trim());if(!s)return null;const d=s[1].lastIndexOf("."),a=d>0?s[1].slice(0,d):"-",c=d>0?s[1].slice(d+1):s[1];return i("/code-map",{symbol:`${s[2]}::${a}::${c}::${s[3]}`,name:c})}if(t.tier==="automated"){const s=t.ref.indexOf(" :: ");return s<0?null:i("/tests",{file:t.ref.slice(0,s),test:t.ref.slice(s+4)})}if(t.tier==="stated"&&/^SRC-/i.test(r)){const s=t.kind==="Jira ticket"?"jira":t.kind==="Requirement"?"requirement":t.kind==="Note"?"nlp":"document";return i("/sources",{tab:s,sourceId:r})}if(t.tier==="stated"&&/^REQ-/i.test(r))return i("/coverage",{tab:"requirements",reqId:r});const n=(l=/\brun ([\w.-]+)/.exec(t.detail))==null?void 0:l[1];return t.tier==="observed"&&n&&/\.(md|markdown|txt|json)$/i.test(r)?{kind:"run-file",run:n,file:r}:null}function me(t,r){const i=t.split(" ").map(n=>n==="Jira"?n:n.toLowerCase()).join(" ");return`${r} ${r===1?i:`${i}s`}`}function Ee({citations:t}){const r=v.useContext(T),[i,n]=v.useState(null);if(t.length===0)return null;const l=a=>{a.kind==="run-file"?n({run:a.run,file:a.file}):window.open(a.href,"_blank","noopener")},s=new Map;for(const a of t){const c=$(a);s.set(c,(s.get(c)??0)+1)}const d=[...s.entries()].map(([a,c])=>me(a,c)).join(" · ");return e.jsxs("details",{id:r==null?void 0:r.listId,className:"group mt-3.5 rounded-xl border border-black/[0.07] dark:border-white/[0.08] bg-black/[0.015] dark:bg-white/[0.02] overflow-hidden",children:[e.jsxs("summary",{className:"flex items-center gap-2 cursor-pointer select-none px-3.5 py-2.5 list-none [&::-webkit-details-marker]:hidden hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[e.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-400 dark:text-gray-500 transition-transform duration-150 group-open:rotate-90 flex-shrink-0","aria-hidden":"true",children:e.jsx("path",{d:"m9 18 6-6-6-6"})}),e.jsx("span",{className:"text-[12px] font-semibold text-gray-700 dark:text-gray-300",children:"Sources"}),e.jsx("span",{className:"text-[11px] text-gray-500 dark:text-gray-500",children:d})]}),e.jsx("div",{className:"border-t border-black/[0.06] dark:border-white/[0.06]",children:t.map(a=>e.jsxs("div",{id:r?`${r.listId}-${a.index}`:void 0,tabIndex:-1,className:"flex items-start gap-2.5 px-3.5 py-2.5 border-b last:border-b-0 border-black/[0.04] dark:border-white/[0.04] focus:outline-none focus:bg-cyan-500/[0.06]",children:[e.jsx("span",{className:`mt-[1px] inline-flex items-center justify-center min-w-[16px] h-[16px] px-[3px] rounded-[4px] border text-[9.5px] leading-none font-semibold tabular-nums flex-shrink-0 ${V[a.tier]}`,children:a.index}),e.jsxs("span",{className:"flex-1 min-w-0",children:[e.jsxs("span",{className:"block text-[12px] leading-snug",children:[e.jsx("span",{className:"font-semibold text-gray-700 dark:text-gray-300",children:$(a)}),a.ref!==$(a)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-400 dark:text-gray-600",children:" · "}),e.jsx("span",{className:"font-mono text-[11.5px] text-gray-800 dark:text-gray-200 break-all",children:a.ref})]})]}),a.detail&&e.jsx("span",{className:"block mt-0.5 text-[11px] leading-relaxed text-gray-500 dark:text-gray-500 break-words",children:a.detail})]}),(()=>{const c=xe(a);return c?e.jsxs("button",{type:"button",onClick:()=>l(c),title:c.kind==="run-file"?"Read this file of the exploration run":`Open ${$(a).toLowerCase()} ${a.ref.split(" · ")[0]} in a new tab`,"aria-label":`Open ${$(a)} ${a.ref}`,"data-testid":"source-open",className:"flex-shrink-0 inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[11px] font-medium text-cyan-700 dark:text-cyan-400 hover:bg-cyan-500/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-cyan-400/60",children:["Open ",e.jsx(re,{size:11})]}):null})()]},`${a.tier}|${a.ref}`))}),i&&e.jsx(se,{run:i.run,file:i.file,onClose:()=>n(null)})]})}const ue=v.memo(function({text:r}){var O,D,P,B,F,U;const i=[];let n=r;const l=/EMAIL_PREVIEW_START\n([\s\S]*?)EMAIL_PREVIEW_END/g;let s;for(;(s=l.exec(r))!==null;){const x=s[1]||"",o=x.match(/^To:\s*(.+)/m),g=x.match(/^CC:\s*(.+)/m),b=x.match(/^From:\s*(.+)/m),k=x.match(/^Subject:\s*(.+)/m),y=x.match(/---BODY---\n([\s\S]*?)---END_BODY---/);i.push({to:((O=o==null?void 0:o[1])==null?void 0:O.trim())||"",cc:(D=g==null?void 0:g[1])==null?void 0:D.trim(),from:((P=b==null?void 0:b[1])==null?void 0:P.trim())||"",subject:((B=k==null?void 0:k[1])==null?void 0:B.trim())||"",body:((F=y==null?void 0:y[1])==null?void 0:F.trim())||""}),n=n.replace(s[0],`__EMAIL_PREVIEW_${i.length-1}__`)}const d=n.split(`
|
|
8
|
+
`),a=[];let c=!1,m="",f=[],N=[],u=0;const M=(x=!1)=>{if(f.length>0){const o=f.join(`
|
|
9
|
+
`);a.push(e.jsxs("div",{className:"my-2",children:[m&&e.jsxs("div",{className:"text-[10px] text-gray-500 bg-black/30 px-3 py-1 rounded-t-lg border border-b-0 border-white/5 font-mono flex items-center gap-2",children:[e.jsx("span",{children:m}),x&&e.jsx("span",{className:"text-[9px] text-gray-600 italic",children:"(streaming...)"})]}),e.jsx("pre",{className:`bg-black/30 border border-white/5 ${m?"rounded-b-lg":"rounded-lg"} p-3 text-xs text-gray-300 font-mono overflow-x-auto whitespace-pre-wrap max-h-[500px] overflow-y-auto`,children:o})]},u++)),f=[],m=""}},J=x=>{const o=[];return x.replace(/\[\[cite\\?\|[^\]]*\]\]/g,b=>(o.push(b.replace(/\\(?=[|[\]])/g,"")),`\0${o.length-1}\0`)).replace(/\\\|/g,"").replace(/^\|/,"").replace(/\|$/,"").split("|").map(b=>b.trim().replace(/\u0001/g,"|").replace(/\u0000(\d+)\u0000/g,(k,y)=>o[Number(y)]??""))},Q=x=>/^\|[\s:]*-{2,}[\s:]*(\|[\s:]*-{2,}[\s:]*)*\|?$/.test(x.trim()),I=()=>{if(N.length===0)return;const x=N.map(J);let o=null,g=[];N.length>=2&&Q(N[1])?(o=x[0],g=x.slice(2)):g=x,a.push(e.jsx(pe,{headers:o,rows:g},u++)),N=[]};for(const x of d){if(x.trimStart().startsWith("```")){I(),c?(c=!1,M()):(c=!0,m=x.trimStart().slice(3).trim());continue}if(c){f.push(x);continue}const o=x.trim();if(o.startsWith("|")){N.push(o);continue}if(I(),!o){a.push(e.jsx("div",{className:"h-2"},u++));continue}const g=o.match(/^__EMAIL_PREVIEW_(\d+)__$/);if(g){const w=parseInt(g[1],10),p=i[w];p&&a.push(e.jsxs("div",{className:"my-3 rounded-xl border border-blue-500/20 bg-blue-50/60 dark:bg-blue-500/5 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-blue-500/10 border-b border-blue-500/10",children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-blue-500 dark:text-blue-400 shrink-0",children:[e.jsx("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),e.jsx("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]}),e.jsx("span",{className:"text-sm font-semibold text-blue-700 dark:text-blue-300",children:"Email Preview"})]}),e.jsxs("div",{className:"px-4 py-3 space-y-1.5 border-b border-gray-200 dark:border-white/5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"text-gray-500 w-16 shrink-0",children:"To:"}),e.jsx("span",{className:"text-gray-800 dark:text-gray-200 font-medium",children:p.to})]}),p.cc&&e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"text-gray-500 w-16 shrink-0",children:"CC:"}),e.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:p.cc})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"text-gray-500 w-16 shrink-0",children:"From:"}),e.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:p.from})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"text-gray-500 w-16 shrink-0",children:"Subject:"}),e.jsx("span",{className:"text-gray-900 dark:text-gray-100 font-medium",children:p.subject})]})]}),e.jsx("div",{className:"px-4 py-3 max-h-[300px] overflow-y-auto",children:e.jsx("div",{className:"text-xs text-gray-700 dark:text-gray-300 whitespace-pre-wrap leading-relaxed",children:p.body})}),e.jsx("div",{className:"px-4 py-2 bg-gray-50 dark:bg-white/[0.02] border-t border-gray-200 dark:border-white/5",children:e.jsx("span",{className:"text-[10px] text-gray-500 italic",children:"Confirm to send this email"})})]},u++));continue}const b=o.match(/((?:https?:\/\/[^\s/]+)?\/api\/documents\/download\/([^\s)\]"']+\.(?:png|svg|jpg|jpeg)))/);if(b){const w=z(b[1]),p=decodeURIComponent(b[2]||"").replace(/^\d+-/,"");a.push(e.jsxs("div",{className:"my-3 w-full max-w-[640px] rounded-xl border border-gray-200 dark:border-white/10 overflow-hidden bg-white dark:bg-black/20",children:[e.jsx("img",{src:w,alt:p,className:"w-full h-auto max-h-[500px] object-contain block",loading:"lazy"}),e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-t border-gray-100 dark:border-white/5 bg-gray-50 dark:bg-white/[0.02]",children:[e.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400 truncate",children:p}),e.jsxs("button",{onClick:()=>{fetch(w).then(C=>C.blob()).then(C=>{const _=URL.createObjectURL(C),j=document.createElement("a");j.href=_,j.download=p,document.body.appendChild(j),j.click(),document.body.removeChild(j),URL.revokeObjectURL(_)}).catch(()=>window.open(w,"_blank"))},className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-white dark:bg-white/5 border border-gray-200 dark:border-white/10 hover:bg-gray-100 dark:hover:bg-white/10 transition-colors text-xs text-gray-700 dark:text-gray-300 cursor-pointer",children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"7 10 12 15 17 10"}),e.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),"Save"]})]})]},u++));continue}const k=o.match(/\[([^\]]*)\]\(((?:https?:\/\/[^)\s/]+)?\/api\/documents\/download\/([^)]+))\)/),y=k?null:o.match(/((?:https?:\/\/[^\s/]+)?\/api\/documents\/download\/(\S+))/),E=k?{url:k[2],file:k[3]}:y?{url:y[1],file:y[2]}:null;if(E){const w=z(E.url||""),p=decodeURIComponent(E.file||"document").replace(/^\d+-/,""),C=((U=p.split(".").pop())==null?void 0:U.toLowerCase())||"",j={docx:{color:"text-blue-500",label:"Word Document"},doc:{color:"text-blue-500",label:"Word Document"},pdf:{color:"text-rose-500",label:"PDF Document"},xlsx:{color:"text-emerald-500",label:"Excel Spreadsheet"},xls:{color:"text-emerald-500",label:"Excel Spreadsheet"},csv:{color:"text-gray-500",label:"CSV File"}}[C]||{color:"text-gray-500",label:"Document"};a.push(e.jsxs("a",{href:w,download:p,className:"flex items-center gap-3 p-3 my-2 rounded-xl border border-gray-200 dark:border-white/10 bg-transparent hover:bg-gray-50 dark:hover:bg-white/[0.03] transition-colors cursor-pointer no-underline group",children:[e.jsx("div",{className:"w-11 h-11 rounded-lg flex items-center justify-center shrink-0",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:j.color,children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-gray-800 dark:text-gray-200 truncate",children:p}),e.jsx("div",{className:"text-[11px] text-gray-500 dark:text-gray-400",children:j.label})]}),e.jsxs("div",{className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-gray-200 dark:border-white/10 group-hover:bg-gray-100 dark:group-hover:bg-white/5 transition-colors shrink-0 ${j.color}`,children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"7 10 12 15 17 10"}),e.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),e.jsx("span",{className:"text-xs font-medium",children:"Download"})]})]},u++));continue}if(/^[-*_]{3,}$/.test(o)){a.push(e.jsx("hr",{className:"border-white/5 my-3"},u++));continue}if(o.startsWith("#### ")){a.push(e.jsx("h5",{className:"text-[13px] font-semibold text-gray-200 mt-2.5 mb-1",children:h(o.slice(5))},u++));continue}if(o.startsWith("### ")){a.push(e.jsx("h4",{className:"text-sm font-semibold text-gray-200 mt-3 mb-1",children:h(o.slice(4))},u++));continue}if(o.startsWith("## ")){a.push(e.jsx("h3",{className:"text-base font-semibold text-gray-100 mt-4 mb-1",children:h(o.slice(3))},u++));continue}if(o.startsWith("# ")){a.push(e.jsx("h2",{className:"text-lg font-bold text-gray-100 mt-4 mb-1.5",children:h(o.slice(2))},u++));continue}const S=o.match(/^(\d+)\.\s+(.+)/);if(S){a.push(e.jsxs("div",{className:"flex gap-2 text-sm text-gray-300 leading-relaxed ml-2",children:[e.jsxs("span",{className:"text-gray-500 flex-shrink-0 w-4 text-right",children:[S[1],"."]}),e.jsx("span",{children:h(S[2])})]},u++));continue}if(o.startsWith("- ")||o.startsWith("* ")){a.push(e.jsxs("div",{className:"flex gap-2 text-sm text-gray-300 leading-relaxed ml-2",children:[e.jsx("span",{className:"text-gray-500 flex-shrink-0",children:"•"}),e.jsx("span",{children:h(o.slice(2))})]},u++));continue}if(o.startsWith("**")){a.push(e.jsx("p",{className:"text-sm text-gray-200 mt-2",children:h(o)},u++));continue}a.push(e.jsx("p",{className:"text-sm text-gray-300 leading-relaxed",children:h(o)},u++))}return c&&M(!0),I(),e.jsx("div",{className:"space-y-0.5",children:a})});function pe({headers:t,rows:r,alignNumbers:i=!1}){const n=t?t.findIndex(ke):-1,l=d=>d===n?" text-center w-px whitespace-nowrap":"",s=d=>i&&/^[-+]?[\d,]+(\.\d+)?\s*(%|ms|s)?$/.test(d.trim());return e.jsx("div",{className:"my-2.5 rounded-[10px] border border-gray-200 dark:border-[#2c2d36] overflow-hidden","data-testid":"ai-table",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse text-[13px] text-gray-700 dark:text-gray-300 tabular-nums",children:[t&&e.jsx("thead",{children:e.jsx("tr",{children:t.map((d,a)=>e.jsx("th",{className:`bg-[#f7f8fa] dark:bg-[#22232a] border-b border-gray-200 dark:border-[#2c2d36] px-3.5 py-[9px] text-left text-[11.5px] font-semibold uppercase tracking-[0.05em] text-gray-500 dark:text-gray-400 whitespace-nowrap${l(a)}`,children:h(d,!0)},a))})}),e.jsxs("tbody",{children:[r.map((d,a)=>e.jsx("tr",{className:"group/row",children:d.map((c,m)=>{var f;return e.jsx("td",{className:`px-3.5 py-2.5 align-middle border-b border-[#eef0f3] dark:border-[#25262d] group-last/row:border-b-0 group-hover/row:bg-[#f5f7fa] dark:group-hover/row:bg-[#23242b]${m===0?" font-medium text-gray-800 dark:text-gray-200":""}${(f=H(c))!=null&&f.rest?" min-w-[13rem]":he(c)}${l(m)}${s(c)?" text-right":""}`,children:ye(c)},m)})},a)),r.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:Math.max(1,(t==null?void 0:t.length)??1),className:"px-3.5 py-6 text-center text-gray-400 dark:text-gray-500",children:"No rows"})})]})]})})})}const A=/\[\[cite\|[^\]]*\]\]/g;function he(t){const r=t.replace(A,"").replace(/[`*]/g,"").trim().length;return r<=18?" whitespace-nowrap":r>40?" min-w-[16rem]":""}const ge=/^(passed|pass|failed|fail|error|skipped|blocked|flaky|open|in progress|resolved|closed|fixed|rejected)(\s*\((?:error|fixed)\))?(?:\s*[—–-]\s+([\s\S]+))?$/i,be={passed:"ok",pass:"ok",resolved:"ok",closed:"ok",fixed:"ok",failed:"bad",fail:"bad",error:"bad",blocked:"bad",open:"bad",skipped:"warn",flaky:"warn","in progress":"warn",rejected:"neutral"},fe={bad:"text-red-700 bg-red-50 dark:text-red-400 dark:bg-red-500/[0.12]",ok:"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-500/[0.12]",warn:"text-amber-700 bg-amber-50 dark:text-amber-400 dark:bg-amber-500/[0.12]",neutral:"text-gray-600 bg-gray-100 dark:text-gray-300 dark:bg-white/[0.08]"};function H(t){const r=ge.exec(t.replace(A,"").trim());return r?{label:`${r[1]}${r[2]??""}`.trim(),tone:be[r[1].toLowerCase()]??"neutral",rest:(r[3]??"").trim()}:null}function ke(t){return/^sources?$/i.test((t??"").replace(/\*/g,"").trim())}function K(t){const r=t.split(/\s→\s/);return r.length===1?h(t,!0):r.map((i,n)=>e.jsxs("span",{children:[n>0&&e.jsx("span",{className:"px-1 text-[#9ca3af] dark:text-gray-500",children:"→"}),h(i,!0)]},n))}function ye(t){const r=H(t);if(!r)return K(t);const i=(t.match(A)??[]).join(" ");return e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:`inline-flex items-center gap-[5px] rounded-full px-2 py-0.5 text-[11.5px] font-semibold whitespace-nowrap ${fe[r.tone]}`,children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current","aria-hidden":"true"}),r.label]}),i&&e.jsxs(e.Fragment,{children:[" ",h(i,!0)]}),r.rest&&e.jsx("span",{className:"mt-[3px] block text-[12px] text-gray-500 dark:text-gray-400",children:K(r.rest)})]})}function h(t,r=!1){const i=t.split(/(\*\*[^*]+\*\*|`[^`]+`|\[\[cite\|[^\]]*\]\]|\*[^\s*][^*\n]*[^\s*]\*|\*[^\s*]\*)/g);return i.length===1?t:e.jsx(e.Fragment,{children:i.map((n,l)=>{if(n.startsWith("[[cite|")){const s=/^\[\[cite\|([^|\]]*)\|([^|\]]*)\|([^|\]]*)(?:\|([^\]]*))?\]\]$/.exec(n);return s?e.jsx(ce,{tier:s[1]||"",refId:(s[2]||"").trim(),detail:(s[3]||"").trim(),kind:(s[4]||"").trim()||void 0},l):null}return n.startsWith("**")&&n.endsWith("**")?e.jsx("strong",{className:"font-semibold text-gray-200",children:h(n.slice(2,-2),r)},l):n.startsWith("`[[cite|")&&n.endsWith("]]`")?e.jsx("span",{children:h(n.slice(1,-1),r)},l):n.startsWith("`")&&n.endsWith("`")?e.jsx("code",{className:r?"bg-gray-100 text-gray-700 dark:bg-white/[0.08] dark:text-gray-200 px-[5px] py-px rounded text-[0.86em] font-mono whitespace-nowrap":"bg-white/5 text-amber-300 px-1 py-0.5 rounded text-xs font-mono",children:n.slice(1,-1)},l):n.length>2&&n.startsWith("*")&&n.endsWith("*")?e.jsx("em",{className:"italic",children:h(n.slice(1,-1),r)},l):e.jsx("span",{children:n},l)})})}export{ue as A,Ie as C,Ee as S,Le as c,ie as e,Ce as s,$e as u};
|