@testver/testver 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/README.md +3 -1
  2. package/bin/testver.js +8 -5
  3. package/dist/index.js +1483 -1086
  4. package/dist/vendor/grpc.cjs +24914 -0
  5. package/package.json +9 -4
  6. package/src/ui/static/assets/{AIPanel-D09Ni3a4.js → AIPanel-B_R-CbrF.js} +2 -2
  7. package/src/ui/static/assets/{AIRecordPanel-DZtUZnRe.js → AIRecordPanel-BRQWIU5h.js} +3 -3
  8. package/src/ui/static/assets/{AIStreamUI-BsxKziYG.js → AIStreamUI-C3D989_6.js} +3 -3
  9. package/src/ui/static/assets/{AITestGenPage-Cg21-P1W.js → AITestGenPage-D3t2gPAA.js} +5 -5
  10. package/src/ui/static/assets/{APITestingPage-Cdc8EZz2.js → APITestingPage-Cmwkiiys.js} +1 -1
  11. package/src/ui/static/assets/{AboutPage-yJLCr2_q.js → AboutPage-CjEqKB-q.js} +1 -1
  12. package/src/ui/static/assets/AdvancedPage-4kAcpE8Y.js +3 -0
  13. package/src/ui/static/assets/{AnalyticsPage-gTPFsiLZ.js → AnalyticsPage-64mYNK2v.js} +1 -1
  14. package/src/ui/static/assets/{AuditLogPage-DE45E_PV.js → AuditLogPage-BQjOzQje.js} +1 -1
  15. package/src/ui/static/assets/{ChangesSummary-C-7oi_sx.js → ChangesSummary-CY_Vb27i.js} +2 -2
  16. package/src/ui/static/assets/{CodeMapPage-DgU6ZYBO.js → CodeMapPage-B1ezmnlE.js} +3 -3
  17. package/src/ui/static/assets/{ConfirmDialog-DNU3qoAP.js → ConfirmDialog-t7mpeeSN.js} +1 -1
  18. package/src/ui/static/assets/{CoveragePage-BpTjgcdV.js → CoveragePage-YMmCbiBk.js} +2 -2
  19. package/src/ui/static/assets/{CronBuilder-DsnX-vRr.js → CronBuilder-Nk-K-_8I.js} +1 -1
  20. package/src/ui/static/assets/Dashboard-BDVxO2V4.js +1 -0
  21. package/src/ui/static/assets/{DefectsPage-BtMNbq6Z.js → DefectsPage-l8yGeCyR.js} +1 -1
  22. package/src/ui/static/assets/{DiffViewer-DPglzjPH.js → DiffViewer-BIU09a_i.js} +1 -1
  23. package/src/ui/static/assets/{EmptyState-BH_aDO0P.js → EmptyState-D1T3JWUr.js} +1 -1
  24. package/src/ui/static/assets/{ExportButton-Ce_MxnM1.js → ExportButton-Dt5RhL-h.js} +1 -1
  25. package/src/ui/static/assets/{FileViewer-iYL0lxyY.js → FileViewer-CrKgh_cB.js} +5 -5
  26. package/src/ui/static/assets/{GitPage-CQqV8JBC.js → GitPage-_4nCEzkJ.js} +5 -5
  27. package/src/ui/static/assets/{ImportExportPage-DXk7Koaq.js → ImportExportPage-BcR7IQi9.js} +1 -1
  28. package/src/ui/static/assets/{JiraPushDialog-CqftoLh8.js → JiraPushDialog-C2sP4_4h.js} +1 -1
  29. package/src/ui/static/assets/KpiTile-inmeEsy3.js +1 -0
  30. package/src/ui/static/assets/{LiveExecutionView-BD0wE8sz.js → LiveExecutionView-D5BRe9jq.js} +1 -1
  31. package/src/ui/static/assets/{MediaModal-DiSINwmh.js → MediaModal-C5n6sHYi.js} +1 -1
  32. package/src/ui/static/assets/{MobileRunPicker-BNs2lZFf.js → MobileRunPicker-0h-N2c6d.js} +1 -1
  33. package/src/ui/static/assets/{MobileRunTarget-D2Nqcj10.js → MobileRunTarget-Bo_xekig.js} +1 -1
  34. package/src/ui/static/assets/{ModuleExplorer-BmkoQrHb.js → ModuleExplorer-VGcmK167.js} +1 -1
  35. package/src/ui/static/assets/{OutputPage-Dcsr7cmr.js → OutputPage-B_1nPPxE.js} +1 -1
  36. package/src/ui/static/assets/PipelinesPanel-PmmPu8pj.js +1 -0
  37. package/src/ui/static/assets/{ProfilePage-ByshrcwC.js → ProfilePage-y7tJNNFd.js} +1 -1
  38. package/src/ui/static/assets/{ProjectExplorer-B9B___ij.js → ProjectExplorer-DbfGhRq0.js} +1 -1
  39. package/src/ui/static/assets/{RemoteFileStrip-DbPnaZ-v.js → RemoteFileStrip-WuRKtx_h.js} +1 -1
  40. package/src/ui/static/assets/ReportCard-G52Q6-2i.js +2 -0
  41. package/src/ui/static/assets/ReportFullView-Bt8UFP2J.js +1 -0
  42. package/src/ui/static/assets/ReportsPage-DMtDi73Q.js +48 -0
  43. package/src/ui/static/assets/ResultsPage-BI9jpK2N.js +115 -0
  44. package/src/ui/static/assets/RunState-ifC4zi6M.js +1 -0
  45. package/src/ui/static/assets/{RunTargets-C7Vqd4TU.js → RunTargets-C7vpCbck.js} +1 -1
  46. package/src/ui/static/assets/{ScriptMappingPage-BrANeHv0.js → ScriptMappingPage-7vHuvhQw.js} +1 -1
  47. package/src/ui/static/assets/{SearchableDevicePicker-CFJ_DUAA.js → SearchableDevicePicker-BYxYJNWl.js} +1 -1
  48. package/src/ui/static/assets/{SettingsPage-BwOiebKG.js → SettingsPage-DSISg7r7.js} +1 -1
  49. package/src/ui/static/assets/SharedReportView-BOqKGJmR.js +1 -0
  50. package/src/ui/static/assets/{SourcesPage-C_QVQwiA.js → SourcesPage-CgqtYGBi.js} +1 -1
  51. package/src/ui/static/assets/TestExplorerPage-gYLhCD4d.js +7 -0
  52. package/src/ui/static/assets/{TestManagementPage-Ch4PthuU.js → TestManagementPage-wqYTKP7W.js} +2 -2
  53. package/src/ui/static/assets/TestPlansPage-DOKX9p6z.js +5 -0
  54. package/src/ui/static/assets/{TestverCreditsRing-CUsMGEe3.js → TestverCreditsRing-DpMzl3h7.js} +1 -1
  55. package/src/ui/static/assets/{UncommittedDiffViewer-B5HSURk8.js → UncommittedDiffViewer-BxS0zi-p.js} +1 -1
  56. package/src/ui/static/assets/{UserManagementPage-BjY3ftxf.js → UserManagementPage-B5d0uDU_.js} +2 -2
  57. package/src/ui/static/assets/{WorkflowsPage-BUu-LjZ8.js → WorkflowsPage-Bk0DFnFS.js} +17 -17
  58. package/src/ui/static/assets/{hiddenLlmProviders-setxgY_B.js → hiddenLlmProviders-CdhhNa5G.js} +1 -1
  59. package/src/ui/static/assets/index-BYVxKLrT.js +47 -0
  60. package/src/ui/static/assets/index-C2KJt7SI.css +1 -0
  61. package/src/ui/static/assets/reportMeta-AKcU_qwq.js +1 -0
  62. package/src/ui/static/assets/{useFeatureFlags-DqhngqgG.js → useFeatureFlags-DNkIctil.js} +1 -1
  63. package/src/ui/static/assets/{useJiraConnector-TM1Rfj1s.js → useJiraConnector-D5ysBBvz.js} +1 -1
  64. package/src/ui/static/assets/{useOwnership-eW6Egd7X.js → useOwnership-U0AfKBRo.js} +1 -1
  65. package/src/ui/static/assets/{useSuites-CvtMGakZ.js → useSuites-DyfN9HVv.js} +1 -1
  66. package/src/ui/static/assets/{useTestExplorer-HqvURJAc.js → useTestExplorer-DT8frjCK.js} +1 -1
  67. package/src/ui/static/assets/{useTestLifecycle-CL7-zz0Q.js → useTestLifecycle-OcwQaB1s.js} +1 -1
  68. package/src/ui/static/assets/{useTestManagement-ZTA1_VUm.js → useTestManagement-Xm4Bcx3u.js} +2 -2
  69. package/src/ui/static/assets/useTestResults-D5EwGIX9.js +1 -0
  70. package/src/ui/static/assets/{vendor-icons-B0wLOBoh.js → vendor-icons-BKPiFyYV.js} +1 -1
  71. package/src/ui/static/index.html +3 -3
  72. package/dist/py-agent/__pycache__/testver_appium.cpython-313.pyc +0 -0
  73. package/src/ui/static/assets/AdvancedPage-DB-6sJ6s.js +0 -3
  74. package/src/ui/static/assets/Dashboard-DRWbVyTb.js +0 -1
  75. package/src/ui/static/assets/PipelinesPanel-CMMXCSda.js +0 -1
  76. package/src/ui/static/assets/ReportCard-BbNfk85h.js +0 -2
  77. package/src/ui/static/assets/ReportFullView-Cg1rggho.js +0 -1
  78. package/src/ui/static/assets/ReportsPage-CFv3OAhe.js +0 -48
  79. package/src/ui/static/assets/ResultsPage-B4LwZH-R.js +0 -115
  80. package/src/ui/static/assets/SharedReportView-BAbW1WOs.js +0 -1
  81. package/src/ui/static/assets/TestExplorerPage-BRRWtwde.js +0 -7
  82. package/src/ui/static/assets/TestPlansPage-Bno2vpGd.js +0 -5
  83. package/src/ui/static/assets/index-B0klHYbO.css +0 -1
  84. package/src/ui/static/assets/index-DtBWNlVD.js +0 -47
  85. package/src/ui/static/assets/useTestResults-Bm-JyMhB.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testver/testver",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "AI-powered interactive CLI for test automation",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -19,15 +19,17 @@
19
19
  "dist/wdio-bootstrap/",
20
20
  "dist/wdio-json-reporter/",
21
21
  "dist/py-agent/",
22
+ "!**/__pycache__",
22
23
  "dist/java-agent/",
23
24
  "dist/dotnet-agent/",
25
+ "dist/vendor/",
24
26
  "src/ui/static/",
25
27
  "deploy/",
26
28
  "README.md",
27
29
  "LICENSE"
28
30
  ],
29
31
  "engines": {
30
- "node": ">=22.0.0"
32
+ "node": ">=22.14.0"
31
33
  },
32
34
  "scripts": {
33
35
  "build": "tsup",
@@ -96,8 +98,6 @@
96
98
  "dependencies": {
97
99
  "@anthropic-ai/sdk": "^0.135.0",
98
100
  "@google/generative-ai": "^0.24.1",
99
- "@grpc/grpc-js": "^1.14.6",
100
- "@grpc/proto-loader": "^0.7.15",
101
101
  "@modelcontextprotocol/sdk": "^1.32.1",
102
102
  "@resvg/resvg-js": "^2.6.2",
103
103
  "@simple-git/argv-parser": "2.0.1",
@@ -142,6 +142,8 @@
142
142
  "zod": "^4.6.7"
143
143
  },
144
144
  "devDependencies": {
145
+ "@grpc/grpc-js": "^1.14.6",
146
+ "@grpc/proto-loader": "^0.7.15",
145
147
  "@types/amqplib": "^0.10.8",
146
148
  "@types/better-sqlite3": "^7.6.13",
147
149
  "@types/debug": "^4.1.13",
@@ -152,6 +154,9 @@
152
154
  "@types/pdf-parse": "^1.1.5",
153
155
  "@types/ws": "^8.18.2",
154
156
  "docx": "^9.12.0",
157
+ "esbuild": "^0.28.1",
158
+ "long": "^5.3.2",
159
+ "protobufjs": "^7.6.6",
155
160
  "rimraf": "^6.1.3",
156
161
  "tsup": "^8.5.1",
157
162
  "typescript": "^6.0.3",
@@ -1,4 +1,4 @@
1
- var sr=Object.defineProperty;var ar=(s,i,o)=>i in s?sr(s,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):s[i]=o;var Ws=(s,i,o)=>ar(s,typeof i!="symbol"?i+"":i,o);import{u as ss,r as n,j as e,n as na,L as kt,b as rr}from"./vendor-react-CTbHBddL.js";import{b as ia,N as nr,O as ir,h as or,P as lr,Q as dr,S as Js,T as Gs,U as cr,V as Ks,W as xr,X as ur,j as mr,Y as pr,Z as oa,_ as hr,$ as fr,a0 as gr,a1 as as,a2 as br,x as yr,a3 as vr,a4 as kr,a5 as jr,a6 as wr,a7 as Nr,a8 as Sr,a9 as Cr,aa as Vs,ab as $r,ac as Ar,ad as Ir,ae as Jt,af as Tr,ag as Rr,ah as zr,ai as Er,aj as Mr,ak as Dr,al as Pr,am as Lr,an as Or}from"./index-DtBWNlVD.js";import{u as qr}from"./RemoteFileStrip-DbPnaZ-v.js";import{G as Fr,K as rs,J as ns,aa as is,C as Br,O as la,y as ze,ak as Ye,bd as Hr,Z as da,be as Yt,r as Be,_ as os,a3 as jt,l as wt,ba as Ur,a0 as _r,X as Ie,al as ca,bf as Wr,bg as Jr,g as Re,a9 as Nt,bh as yt,aN as xa,b as Gr,bi as Kr,bj as Vr,bk as ua,B as ma,v as pa,b6 as Qr,b0 as Yr,aL as Xr,bl as Zr,T as en,bm as Gt,bn as Xt,h as Qs,ab as Kt,a5 as tn,bo as sn,bp as an,bq as rn,b8 as nn,b9 as on,br as ln,aG as dn,u as cn,ap as Ys,t as ha,a2 as Zt,aE as xn}from"./vendor-icons-B0wLOBoh.js";import{S as un,L as mn}from"./SearchableDevicePicker-CFJ_DUAA.js";import{C as fa}from"./ConfirmDialog-DNU3qoAP.js";import{s as ga}from"./visibleInterval-BKsLfJZ3.js";import{t as pn,f as hn}from"./formatTestName-BKd2Uqhs.js";import{u as fn}from"./useTestExplorer-HqvURJAc.js";import{u as gn}from"./useFeatureFlags-DqhngqgG.js";import{u as bn,e as yn,A as es,C as vn,S as kn,c as jn,s as wn}from"./AIStreamUI-BsxKziYG.js";import{a as ba,u as ls,c as ya}from"./vendor-query-BrzmPFT3.js";import{R as Nn}from"./ReportCard-BbNfk85h.js";import{L as Sn,a as Cn,A as Xs,P as $n,b as An,T as In,C as Tn}from"./ChangesSummary-C-7oi_sx.js";import{H as Rn,P as Zs}from"./hiddenLlmProviders-setxgY_B.js";import{T as zn}from"./TestverCreditsRing-CUsMGEe3.js";import{D as En}from"./DiffViewer-DPglzjPH.js";import{F as va}from"./index-DpQhqcHv.js";import{u as ka}from"./useChartTheme-BFz2QcND.js";import"./formatDate-T65-Y6Mi.js";import"./vendor-charts-DWFQlmCz.js";import"./useTabParam-ChbOedP1.js";import"./MediaModal-DiSINwmh.js";function Mn({texts:s,enabled:i}){const o=ss(),{toast:h}=ia(),d=nr(),m=ir(),{check:b,byPath:j}=qr(),[f,$]=n.useState(null);if(!i||!b||j.size===0)return null;const k=s.join(`
1
+ var sr=Object.defineProperty;var ar=(s,i,o)=>i in s?sr(s,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):s[i]=o;var Ws=(s,i,o)=>ar(s,typeof i!="symbol"?i+"":i,o);import{u as ss,r as n,j as e,n as na,L as kt,b as rr}from"./vendor-react-CTbHBddL.js";import{b as ia,N as nr,O as ir,h as or,P as lr,Q as dr,S as Js,T as Gs,U as cr,V as Ks,W as xr,X as ur,j as mr,Y as pr,Z as oa,_ as hr,$ as fr,a0 as gr,a1 as as,a2 as br,x as yr,a3 as vr,a4 as kr,a5 as jr,a6 as wr,a7 as Nr,a8 as Sr,a9 as Cr,aa as Vs,ab as $r,ac as Ar,ad as Ir,ae as Jt,af as Tr,ag as Rr,ah as zr,ai as Er,aj as Mr,ak as Dr,al as Pr,am as Lr,an as Or}from"./index-BYVxKLrT.js";import{u as qr}from"./RemoteFileStrip-WuRKtx_h.js";import{G as Fr,K as rs,J as ns,a6 as is,C as Br,O as la,y as ze,ag as Ye,bc as Hr,Z as da,bd as Yt,r as Be,_ as os,a0 as jt,l as wt,b9 as Ur,at as _r,X as Ie,ah as ca,be as Wr,bf as Jr,g as Re,a5 as Nt,bg as yt,aL as xa,b as Gr,bh as Kr,bi as Vr,bj as ua,B as ma,v as pa,b4 as Qr,a_ as Yr,aJ as Xr,bk as Zr,T as en,bl as Gt,bm as Xt,h as Qs,a7 as Kt,b8 as tn,bn as sn,bo as an,bp as rn,b6 as nn,b7 as on,bq as ln,aE as dn,u as cn,al as Ys,t as ha,ap as Zt,aC as xn}from"./vendor-icons-BKPiFyYV.js";import{S as un,L as mn}from"./SearchableDevicePicker-BYxYJNWl.js";import{C as fa}from"./ConfirmDialog-t7mpeeSN.js";import{s as ga}from"./visibleInterval-BKsLfJZ3.js";import{t as pn,f as hn}from"./formatTestName-BKd2Uqhs.js";import{u as fn}from"./useTestExplorer-DT8frjCK.js";import{u as gn}from"./useFeatureFlags-DNkIctil.js";import{u as bn,e as yn,A as es,C as vn,S as kn,c as jn,s as wn}from"./AIStreamUI-C3D989_6.js";import{a as ba,u as ls,c as ya}from"./vendor-query-BrzmPFT3.js";import{R as Nn}from"./ReportCard-G52Q6-2i.js";import{L as Sn,a as Cn,A as Xs,P as $n,b as An,T as In,C as Tn}from"./ChangesSummary-CY_Vb27i.js";import{H as Rn,P as Zs}from"./hiddenLlmProviders-CdhhNa5G.js";import{T as zn}from"./TestverCreditsRing-DpMzl3h7.js";import{D as En}from"./DiffViewer-BIU09a_i.js";import{F as va}from"./index-DpQhqcHv.js";import{u as ka}from"./useChartTheme-BFz2QcND.js";import"./formatDate-T65-Y6Mi.js";import"./KpiTile-inmeEsy3.js";import"./vendor-charts-DWFQlmCz.js";import"./useTabParam-ChbOedP1.js";import"./MediaModal-C5n6sHYi.js";function Mn({texts:s,enabled:i}){const o=ss(),{toast:h}=ia(),d=nr(),m=ir(),{check:b,byPath:j}=qr(),[f,$]=n.useState(null);if(!i||!b||j.size===0)return null;const k=s.join(`
2
2
  `);let y=null;for(const A of j.keys()){const I=A.split("/").pop()??A;if(k.includes(A)||I.length>3&&k.includes(I)){y=A;break}}if(!y)return null;const w=`${b.upstreamSha}:${y}`;if(f===w)return null;const g=j.get(y),l=or(b),S=b.dirtyFiles.includes(b.projectPrefix+y),c=b.verdict==="uncommitted_overlap"||b.verdict==="will_conflict";return e.jsx("div",{className:"flex-shrink-0 px-6 pt-2 pb-1 bg-white dark:bg-white/[0.02]",children:e.jsx("div",{className:"max-w-4xl mx-auto",children:e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-md border border-amber-500/30 bg-amber-500/5 dark:bg-amber-500/10",role:"status",children:[e.jsx(Fr,{size:14,className:"text-amber-600 dark:text-amber-400 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 text-xs text-gray-700 dark:text-gray-300",children:[e.jsx("span",{className:"font-mono font-semibold",children:y})," changed on ",l,g.author?e.jsxs(e.Fragment,{children:[" ",lr(g.timestamp)," (",g.author,": “",g.message,"”)"]}):null,".",S?" You also have uncommitted edits in it.":""," Your copy is behind — pull first so the assistant doesn't work on old code?"]}),c||S?e.jsx("button",{onClick:()=>o("/git"),className:"px-2.5 py-1 rounded-md text-[11px] font-medium bg-amber-500/20 hover:bg-amber-500/30 text-amber-700 dark:text-amber-300 border border-amber-500/40 transition-colors whitespace-nowrap",children:"Open Git"}):e.jsx("button",{disabled:m,onClick:()=>d.mutate(void 0,{onSuccess:A=>{var I;if(A.conflicts&&((I=A.conflictedPaths)!=null&&I.length)){o("/git");return}h("success",`Pulled from ${l}`)},onError:A=>h("error",`Pull failed: ${A.message}`)}),className:"px-2.5 py-1 rounded-md text-[11px] font-medium bg-amber-500/20 hover:bg-amber-500/30 text-amber-700 dark:text-amber-300 border border-amber-500/40 transition-colors whitespace-nowrap disabled:opacity-50",children:"Pull now"}),e.jsx("button",{onClick:()=>o("/git?incoming=1"),className:"px-2.5 py-1 rounded-md text-[11px] font-medium text-amber-700 dark:text-amber-300 hover:bg-amber-500/10 transition-colors whitespace-nowrap",children:"View the change"}),e.jsx("button",{onClick:()=>$(w),className:"px-2.5 py-1 rounded-md text-[11px] text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 transition-colors whitespace-nowrap",children:"Continue anyway"})]})})})}const oe=[{value:"web",label:"Web",description:"Tests, page objects, locators, fixes",Icon:rs,colorClass:"text-blue-500 dark:text-blue-400"},{value:"mobile",label:"Mobile",description:"iOS / Android via Appium — local or cloud devices",Icon:ns,colorClass:"text-indigo-500 dark:text-indigo-400"},{value:"api",label:"API",description:"Endpoints, schemas, collections, chains",Icon:is,colorClass:"text-purple-500 dark:text-purple-400"},{value:"reporting",label:"Reporting",description:"Analytics, charts, summaries, exports",Icon:Br,colorClass:"text-emerald-500 dark:text-emerald-400"},{value:"ask",label:"Ask",description:"What the app you are testing does, from what we know",Icon:la,colorClass:"text-cyan-500 dark:text-cyan-400"}];function Dn({value:s,onChange:i,disabled:o,availableModes:h}){const[d,m]=n.useState(!1),[b,j]=n.useState(!1),f=n.useRef(null),$=n.useRef(null),k=h?oe.filter(l=>h.includes(l.value)):oe,y=oe.find(l=>l.value===s)??k[0]??oe[0],w=y.Icon;n.useEffect(()=>{if(!d)return;const l=c=>{var A,I;(A=$.current)!=null&&A.contains(c.target)||(I=f.current)!=null&&I.contains(c.target)||m(!1)},S=c=>{var A;c.key==="Escape"&&(m(!1),(A=f.current)==null||A.focus())};return document.addEventListener("mousedown",l),document.addEventListener("keydown",S),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",S)}},[d]);const g=()=>{if(!o){if(f.current){const l=f.current.getBoundingClientRect(),S=56*k.length+16,c=window.innerHeight-l.bottom;j(c<S+8)}m(l=>!l)}};return e.jsxs("div",{className:"relative inline-block",children:[e.jsxs("button",{ref:f,type:"button",onClick:g,disabled:o,title:`Mode: ${y.label}`,"aria-haspopup":"listbox","aria-expanded":d,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs text-gray-500 hover:text-gray-300 hover:bg-white/5 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(w,{size:13,className:y.colorClass}),e.jsx("span",{children:y.label}),e.jsx(ze,{size:10,className:`flex-shrink-0 transition-transform ${d?"rotate-180":""}`})]}),d&&e.jsx("div",{ref:$,role:"listbox","aria-label":"Chat mode",className:`absolute z-50 ${b?"bottom-full mb-1":"top-full mt-1"} left-0
3
3
  w-60 rounded-xl border border-white/10 bg-surface-1 shadow-xl py-1 overflow-hidden`,children:k.map(l=>{const S=l.Icon,c=l.value===s;return e.jsxs("button",{type:"button",role:"option","aria-selected":c,onClick:()=>{i(l.value),m(!1)},className:`w-full flex items-start gap-2 px-3 py-2 text-left text-xs transition-colors
4
4
  ${c?"bg-brand-500/10 text-brand-300":"text-gray-400 hover:bg-brand-500/10 hover:text-gray-200"}`,children:[e.jsx(S,{size:13,className:`${l.colorClass} flex-shrink-0 mt-0.5`}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"font-medium",children:l.label}),c&&e.jsx(Ye,{size:12,className:"text-brand-400"})]}),e.jsx("div",{className:"text-[10px] opacity-70 leading-snug",children:l.description})]})]},l.value)})})]})}function Pn({mode:s,className:i=""}){const o=oe.find(d=>d.value===s)??oe[0],h=o.Icon;return e.jsx("span",{className:`inline-flex items-center justify-center ${i}`,title:`${o.label} mode`,"aria-label":`${o.label} mode`,children:e.jsx(h,{size:13,className:o.colorClass})})}const Vt=[{value:"manual",label:"Manual",description:"Ask before each action that changes something",Icon:Hr,colorClass:"text-gray-400"},{value:"auto",label:"Auto",description:"Approve actions automatically for this chat — deleting files, sending email and logins still ask",Icon:da,colorClass:"text-amber-500 dark:text-amber-400"}];function Ln({value:s,onChange:i,disabled:o}){const[h,d]=n.useState(!1),[m,b]=n.useState(!1),j=n.useRef(null),f=n.useRef(null),$=Vt.find(w=>w.value===s)??Vt[0],k=$.Icon;n.useEffect(()=>{if(!h)return;const w=g=>{var l,S;(l=f.current)!=null&&l.contains(g.target)||(S=j.current)!=null&&S.contains(g.target)||d(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[h]);const y=()=>{if(!o){if(j.current){const w=j.current.getBoundingClientRect();b(window.innerHeight-w.bottom<140)}d(w=>!w)}};return e.jsxs("div",{className:"relative inline-block",children:[e.jsxs("button",{ref:j,type:"button",onClick:y,disabled:o,title:s==="auto"?"Permissions: Auto — actions are approved without asking (deleting files, sending email and logins still ask)":"Permissions: Manual — asks before each action","aria-label":`Permissions: ${$.label}`,className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs transition-colors disabled:opacity-50 disabled:cursor-not-allowed
@@ -29,4 +29,4 @@ ${d.text.trimStart()}`,done:d.done};continue}o.push(d)}return o}function ci(s){f
29
29
  disabled:opacity-60 disabled:cursor-not-allowed
30
30
  ${$>0?"border-t border-gray-100 dark:border-white/5":""}
31
31
  ${y?f.iconBg:"bg-transparent hover:bg-gray-50 dark:hover:bg-white/[0.04]"}`,children:[e.jsx("span",{className:`flex-shrink-0 w-10 h-10 rounded-xl flex items-center justify-center
32
- ${y?"bg-white dark:bg-white/10":f.iconBg}`,children:e.jsx(k,{size:18,className:f.iconColor})}),e.jsx("span",{className:"w-24 flex-shrink-0 flex items-center gap-2",children:e.jsx("span",{className:"text-[16px] font-semibold text-gray-900 dark:text-gray-100",children:f.label})}),e.jsx("span",{className:"flex-1 min-w-0 text-[13.5px] leading-snug text-gray-500 dark:text-gray-400",children:f.description}),e.jsx("span",{className:"flex-shrink-0 hidden sm:flex flex-wrap justify-end items-center gap-1.5 max-w-[17rem]",children:f.capabilities.map(w=>e.jsx("span",{className:`text-[11.5px] px-2 py-0.5 rounded-full whitespace-nowrap ${f.chipClass}`,children:w},w))})]},f.id)})})]})})}function _i(){return e.jsx("div",{className:"flex-1 flex flex-col overflow-hidden h-full",children:e.jsx(ni,{})})}export{_i as AIPanel};
32
+ ${y?"bg-white dark:bg-white/10":f.iconBg}`,children:e.jsx(k,{size:18,className:f.iconColor})}),e.jsx("span",{className:"w-24 flex-shrink-0 flex items-center gap-2",children:e.jsx("span",{className:"text-[16px] font-semibold text-gray-900 dark:text-gray-100",children:f.label})}),e.jsx("span",{className:"flex-1 min-w-0 text-[13.5px] leading-snug text-gray-500 dark:text-gray-400",children:f.description}),e.jsx("span",{className:"flex-shrink-0 hidden sm:flex flex-wrap justify-end items-center gap-1.5 max-w-[17rem]",children:f.capabilities.map(w=>e.jsx("span",{className:`text-[11.5px] px-2 py-0.5 rounded-full whitespace-nowrap ${f.chipClass}`,children:w},w))})]},f.id)})})]})})}function Wi(){return e.jsx("div",{className:"flex-1 flex flex-col overflow-hidden h-full",children:e.jsx(ni,{})})}export{Wi as AIPanel};