hex-audit 0.4.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/CLAUDE.md +105 -0
- package/DEMO.md +141 -0
- package/README.md +378 -0
- package/dashboard/.next/BUILD_ID +1 -0
- package/dashboard/.next/app-build-manifest.json +99 -0
- package/dashboard/.next/app-path-routes-manifest.json +1 -0
- package/dashboard/.next/build-manifest.json +32 -0
- package/dashboard/.next/cache/.tsbuildinfo +1 -0
- package/dashboard/.next/cache/webpack/client-production/0.pack +0 -0
- package/dashboard/.next/cache/webpack/client-production/index.pack +0 -0
- package/dashboard/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/dashboard/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/dashboard/.next/cache/webpack/server-production/0.pack +0 -0
- package/dashboard/.next/cache/webpack/server-production/1.pack +0 -0
- package/dashboard/.next/cache/webpack/server-production/2.pack +0 -0
- package/dashboard/.next/cache/webpack/server-production/index.pack +0 -0
- package/dashboard/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/dashboard/.next/export-marker.json +1 -0
- package/dashboard/.next/images-manifest.json +1 -0
- package/dashboard/.next/next-minimal-server.js.nft.json +1 -0
- package/dashboard/.next/next-server.js.nft.json +1 -0
- package/dashboard/.next/package.json +1 -0
- package/dashboard/.next/prerender-manifest.js +1 -0
- package/dashboard/.next/prerender-manifest.json +1 -0
- package/dashboard/.next/react-loadable-manifest.json +300 -0
- package/dashboard/.next/required-server-files.json +1 -0
- package/dashboard/.next/routes-manifest.json +1 -0
- package/dashboard/.next/server/app/_not-found/page.js +1 -0
- package/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/dashboard/.next/server/app/_not-found.html +1 -0
- package/dashboard/.next/server/app/_not-found.meta +6 -0
- package/dashboard/.next/server/app/_not-found.rsc +12 -0
- package/dashboard/.next/server/app/access/page.js +1 -0
- package/dashboard/.next/server/app/access/page.js.nft.json +1 -0
- package/dashboard/.next/server/app/access/page_client-reference-manifest.js +1 -0
- package/dashboard/.next/server/app/access.html +1 -0
- package/dashboard/.next/server/app/access.meta +5 -0
- package/dashboard/.next/server/app/access.rsc +8 -0
- package/dashboard/.next/server/app/api/code/route.js +1 -0
- package/dashboard/.next/server/app/api/code/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/flows/route.js +1 -0
- package/dashboard/.next/server/app/api/flows/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/flows.body +1 -0
- package/dashboard/.next/server/app/api/flows.meta +1 -0
- package/dashboard/.next/server/app/api/github-status/route.js +1 -0
- package/dashboard/.next/server/app/api/github-status/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/issues/[id]/move/route.js +1 -0
- package/dashboard/.next/server/app/api/issues/[id]/move/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/issues/[id]/route.js +1 -0
- package/dashboard/.next/server/app/api/issues/[id]/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/mermaid/route.js +1 -0
- package/dashboard/.next/server/app/api/mermaid/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/progress/route.js +1 -0
- package/dashboard/.next/server/app/api/progress/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/api/watch/route.js +3 -0
- package/dashboard/.next/server/app/api/watch/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/calls/page.js +1 -0
- package/dashboard/.next/server/app/calls/page.js.nft.json +1 -0
- package/dashboard/.next/server/app/calls/page_client-reference-manifest.js +1 -0
- package/dashboard/.next/server/app/calls.html +1 -0
- package/dashboard/.next/server/app/calls.meta +5 -0
- package/dashboard/.next/server/app/calls.rsc +8 -0
- package/dashboard/.next/server/app/conformance/page.js +1 -0
- package/dashboard/.next/server/app/conformance/page.js.nft.json +1 -0
- package/dashboard/.next/server/app/conformance/page_client-reference-manifest.js +1 -0
- package/dashboard/.next/server/app/conformance.html +1 -0
- package/dashboard/.next/server/app/conformance.meta +5 -0
- package/dashboard/.next/server/app/conformance.rsc +8 -0
- package/dashboard/.next/server/app/diagram/page.js +1 -0
- package/dashboard/.next/server/app/diagram/page.js.nft.json +1 -0
- package/dashboard/.next/server/app/diagram/page_client-reference-manifest.js +1 -0
- package/dashboard/.next/server/app/diagram.html +1 -0
- package/dashboard/.next/server/app/diagram.meta +5 -0
- package/dashboard/.next/server/app/diagram.rsc +10 -0
- package/dashboard/.next/server/app/flows/page.js +1 -0
- package/dashboard/.next/server/app/flows/page.js.nft.json +1 -0
- package/dashboard/.next/server/app/flows/page_client-reference-manifest.js +1 -0
- package/dashboard/.next/server/app/flows.html +1 -0
- package/dashboard/.next/server/app/flows.meta +5 -0
- package/dashboard/.next/server/app/flows.rsc +10 -0
- package/dashboard/.next/server/app/functions/page.js +1 -0
- package/dashboard/.next/server/app/functions/page.js.nft.json +1 -0
- package/dashboard/.next/server/app/functions/page_client-reference-manifest.js +1 -0
- package/dashboard/.next/server/app/functions.html +1 -0
- package/dashboard/.next/server/app/functions.meta +5 -0
- package/dashboard/.next/server/app/functions.rsc +8 -0
- package/dashboard/.next/server/app/icon.svg/route.js +12 -0
- package/dashboard/.next/server/app/icon.svg/route.js.nft.json +1 -0
- package/dashboard/.next/server/app/icon.svg.body +18 -0
- package/dashboard/.next/server/app/icon.svg.meta +1 -0
- package/dashboard/.next/server/app/index.html +1 -0
- package/dashboard/.next/server/app/index.meta +5 -0
- package/dashboard/.next/server/app/index.rsc +9 -0
- package/dashboard/.next/server/app/issues/page.js +1 -0
- package/dashboard/.next/server/app/issues/page.js.nft.json +1 -0
- package/dashboard/.next/server/app/issues/page_client-reference-manifest.js +1 -0
- package/dashboard/.next/server/app/issues.html +1 -0
- package/dashboard/.next/server/app/issues.meta +5 -0
- package/dashboard/.next/server/app/issues.rsc +8 -0
- package/dashboard/.next/server/app/page.js +20 -0
- package/dashboard/.next/server/app/page.js.nft.json +1 -0
- package/dashboard/.next/server/app/page_client-reference-manifest.js +1 -0
- package/dashboard/.next/server/app/progress/page.js +1 -0
- package/dashboard/.next/server/app/progress/page.js.nft.json +1 -0
- package/dashboard/.next/server/app/progress/page_client-reference-manifest.js +1 -0
- package/dashboard/.next/server/app/progress.html +1 -0
- package/dashboard/.next/server/app/progress.meta +5 -0
- package/dashboard/.next/server/app/progress.rsc +8 -0
- package/dashboard/.next/server/app/stats/page.js +1 -0
- package/dashboard/.next/server/app/stats/page.js.nft.json +1 -0
- package/dashboard/.next/server/app/stats/page_client-reference-manifest.js +1 -0
- package/dashboard/.next/server/app/stats.html +1 -0
- package/dashboard/.next/server/app/stats.meta +5 -0
- package/dashboard/.next/server/app/stats.rsc +8 -0
- package/dashboard/.next/server/app-paths-manifest.json +22 -0
- package/dashboard/.next/server/chunks/431.js +1 -0
- package/dashboard/.next/server/chunks/557.js +1 -0
- package/dashboard/.next/server/chunks/645.js +6 -0
- package/dashboard/.next/server/chunks/649.js +2 -0
- package/dashboard/.next/server/chunks/665.js +13 -0
- package/dashboard/.next/server/chunks/786.js +12 -0
- package/dashboard/.next/server/chunks/818.js +6 -0
- package/dashboard/.next/server/chunks/916.js +2 -0
- package/dashboard/.next/server/chunks/font-manifest.json +1 -0
- package/dashboard/.next/server/font-manifest.json +1 -0
- package/dashboard/.next/server/functions-config-manifest.json +1 -0
- package/dashboard/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/dashboard/.next/server/middleware-build-manifest.js +1 -0
- package/dashboard/.next/server/middleware-manifest.json +6 -0
- package/dashboard/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/dashboard/.next/server/next-font-manifest.js +1 -0
- package/dashboard/.next/server/next-font-manifest.json +1 -0
- package/dashboard/.next/server/pages/404.html +1 -0
- package/dashboard/.next/server/pages/500.html +1 -0
- package/dashboard/.next/server/pages/_app.js +1 -0
- package/dashboard/.next/server/pages/_app.js.nft.json +1 -0
- package/dashboard/.next/server/pages/_document.js +1 -0
- package/dashboard/.next/server/pages/_document.js.nft.json +1 -0
- package/dashboard/.next/server/pages/_error.js +1 -0
- package/dashboard/.next/server/pages/_error.js.nft.json +1 -0
- package/dashboard/.next/server/pages-manifest.json +1 -0
- package/dashboard/.next/server/server-reference-manifest.js +1 -0
- package/dashboard/.next/server/server-reference-manifest.json +1 -0
- package/dashboard/.next/server/webpack-runtime.js +1 -0
- package/dashboard/.next/static/0IZAlhEwk5-v4myUvWKBd/_buildManifest.js +1 -0
- package/dashboard/.next/static/0IZAlhEwk5-v4myUvWKBd/_ssgManifest.js +1 -0
- package/dashboard/.next/static/chunks/1.8868c4d131111be7.js +36 -0
- package/dashboard/.next/static/chunks/1015.3ab89142e5f44120.js +226 -0
- package/dashboard/.next/static/chunks/1151.b6ef5c786e587ed7.js +1 -0
- package/dashboard/.next/static/chunks/1199.a072929dbec89965.js +148 -0
- package/dashboard/.next/static/chunks/1375.d4d2f7fc9c9c2ff1.js +43 -0
- package/dashboard/.next/static/chunks/1799.83206776abbbf1fc.js +9 -0
- package/dashboard/.next/static/chunks/20154aaa.ccc347c04ab5ad4a.js +1 -0
- package/dashboard/.next/static/chunks/2077.7011a570c87aa7b1.js +1 -0
- package/dashboard/.next/static/chunks/2166.cc0fabeb2e89b840.js +215 -0
- package/dashboard/.next/static/chunks/2291.85a70cb0c228157b.js +29 -0
- package/dashboard/.next/static/chunks/2325.2c55cb9a6282ae3f.js +24 -0
- package/dashboard/.next/static/chunks/2383.62c035a052272594.js +1 -0
- package/dashboard/.next/static/chunks/2694.92bbe252063e4786.js +1 -0
- package/dashboard/.next/static/chunks/275.0d761aa0e5b030b8.js +34 -0
- package/dashboard/.next/static/chunks/2781.8536b644a480aede.js +93 -0
- package/dashboard/.next/static/chunks/2805.a8d71d2f92bb6ba9.js +1 -0
- package/dashboard/.next/static/chunks/2879.51436986f93981d9.js +1 -0
- package/dashboard/.next/static/chunks/3017.e55781da9dd32d37.js +1 -0
- package/dashboard/.next/static/chunks/3205-728c260fbb4f89c6.js +2 -0
- package/dashboard/.next/static/chunks/3236.dff44fa7961d9d5e.js +1 -0
- package/dashboard/.next/static/chunks/3480.9451396ad7ee7613.js +1 -0
- package/dashboard/.next/static/chunks/3626.ba1cf848a9f2e93d.js +64 -0
- package/dashboard/.next/static/chunks/3865.a432a7910a2f5281.js +90 -0
- package/dashboard/.next/static/chunks/3887.c22cbfa3f095826c.js +1 -0
- package/dashboard/.next/static/chunks/3924-4a05057b5450abe1.js +1 -0
- package/dashboard/.next/static/chunks/3948.fe3c7d758568d98b.js +287 -0
- package/dashboard/.next/static/chunks/4728.07d87640a3e7dd0d.js +24 -0
- package/dashboard/.next/static/chunks/4787.4e5f6a0e0e40a583.js +23 -0
- package/dashboard/.next/static/chunks/5060.baca226af35ed016.js +1 -0
- package/dashboard/.next/static/chunks/5284.f949ac90c95ff143.js +1 -0
- package/dashboard/.next/static/chunks/5715.1524bcc9591e180b.js +115 -0
- package/dashboard/.next/static/chunks/6014.700ae4969b64d728.js +104 -0
- package/dashboard/.next/static/chunks/6024.4d23707c65514679.js +79 -0
- package/dashboard/.next/static/chunks/6052.033a6f1013c666eb.js +141 -0
- package/dashboard/.next/static/chunks/6177.e5c84cfc4c0dea51.js +1 -0
- package/dashboard/.next/static/chunks/618f8807-547c5614e1318888.js +1 -0
- package/dashboard/.next/static/chunks/6434.9481771c33195d29.js +1 -0
- package/dashboard/.next/static/chunks/6468.f4a3e8fa6accc6da.js +77 -0
- package/dashboard/.next/static/chunks/6540.86f367d7390738d4.js +1 -0
- package/dashboard/.next/static/chunks/6549.4d0d472df96429a5.js +1 -0
- package/dashboard/.next/static/chunks/690f35d0.3e40ca0930e4bbdb.js +119 -0
- package/dashboard/.next/static/chunks/7020.831e16e26d91abc1.js +166 -0
- package/dashboard/.next/static/chunks/7397-f6f4dddc7a20bfc1.js +1 -0
- package/dashboard/.next/static/chunks/7498-ea83cb9e30ec5491.js +1 -0
- package/dashboard/.next/static/chunks/7802.89aec9ee11680850.js +80 -0
- package/dashboard/.next/static/chunks/7973.8b526f589aca5d84.js +79 -0
- package/dashboard/.next/static/chunks/7a04ac15.1c6cea694301806c.js +62 -0
- package/dashboard/.next/static/chunks/8216.1bead812eb126c35.js +5 -0
- package/dashboard/.next/static/chunks/8233babc.780b8e272eda298f.js +92 -0
- package/dashboard/.next/static/chunks/8452-e616b5f43bceb95f.js +13 -0
- package/dashboard/.next/static/chunks/8645.a5ca76f11edc9633.js +1 -0
- package/dashboard/.next/static/chunks/8928-60c623ee89d2e6ad.js +1 -0
- package/dashboard/.next/static/chunks/9173.2486ffca31131ec5.js +1 -0
- package/dashboard/.next/static/chunks/9178.469341860bf8caec.js +1 -0
- package/dashboard/.next/static/chunks/9466.e904660d38c03eea.js +1 -0
- package/dashboard/.next/static/chunks/9660.84a85811380c5f33.js +1 -0
- package/dashboard/.next/static/chunks/9717.6cf5c8c89403b651.js +1 -0
- package/dashboard/.next/static/chunks/9720.67d4d0d15a96d691.js +1 -0
- package/dashboard/.next/static/chunks/9811.65e1d080c2d256af.js +1 -0
- package/dashboard/.next/static/chunks/app/_not-found/page-548ab392d0e890d1.js +1 -0
- package/dashboard/.next/static/chunks/app/access/page-3668562e7464eb5d.js +1 -0
- package/dashboard/.next/static/chunks/app/calls/page-d07f5b8664cc8303.js +1 -0
- package/dashboard/.next/static/chunks/app/conformance/page-2fede1d7b5f9265d.js +1 -0
- package/dashboard/.next/static/chunks/app/diagram/page-b228444265546495.js +1 -0
- package/dashboard/.next/static/chunks/app/flows/page-fa67783d8cd79cab.js +1 -0
- package/dashboard/.next/static/chunks/app/functions/page-686f0296639133a3.js +1 -0
- package/dashboard/.next/static/chunks/app/issues/page-dc110d4cc0a5c398.js +1 -0
- package/dashboard/.next/static/chunks/app/layout-e7b50543ba216d12.js +1 -0
- package/dashboard/.next/static/chunks/app/page-a0f25953d4457935.js +1 -0
- package/dashboard/.next/static/chunks/app/progress/page-f07ac39d1d27b480.js +1 -0
- package/dashboard/.next/static/chunks/app/stats/page-db81f600a086f252.js +1 -0
- package/dashboard/.next/static/chunks/b7167ec1.7afbab6f609e3326.js +153 -0
- package/dashboard/.next/static/chunks/c7ea4e13.5effeeba6618bdb7.js +1 -0
- package/dashboard/.next/static/chunks/framework-cf6f5bdca6ba0184.js +33 -0
- package/dashboard/.next/static/chunks/main-70c6d841ad572657.js +1 -0
- package/dashboard/.next/static/chunks/main-app-9d2f6b8a47133e9b.js +1 -0
- package/dashboard/.next/static/chunks/pages/_app-6ad2b50514c24ab4.js +1 -0
- package/dashboard/.next/static/chunks/pages/_error-d5eb11c5c4626811.js +1 -0
- package/dashboard/.next/static/chunks/polyfills-78c92fac7aa8fdd8.js +1 -0
- package/dashboard/.next/static/chunks/webpack-08869f2b18792e51.js +1 -0
- package/dashboard/.next/static/css/e6cb67f77f13ae8e.css +3 -0
- package/dashboard/.next/static/media/0aa834ed78bf6d07-s.woff2 +0 -0
- package/dashboard/.next/static/media/438aa629764e75f3-s.woff2 +0 -0
- package/dashboard/.next/static/media/4c9affa5bc8f420e-s.p.woff2 +0 -0
- package/dashboard/.next/static/media/51251f8b9793cdb3-s.woff2 +0 -0
- package/dashboard/.next/static/media/67957d42bae0796d-s.woff2 +0 -0
- package/dashboard/.next/static/media/875ae681bfde4580-s.woff2 +0 -0
- package/dashboard/.next/static/media/886030b0b59bc5a7-s.woff2 +0 -0
- package/dashboard/.next/static/media/939c4f875ee75fbb-s.woff2 +0 -0
- package/dashboard/.next/static/media/bb3ef058b751a6ad-s.p.woff2 +0 -0
- package/dashboard/.next/static/media/cc978ac5ee68c2b6-s.woff2 +0 -0
- package/dashboard/.next/static/media/e857b654a2caa584-s.woff2 +0 -0
- package/dashboard/.next/static/media/f911b923c6adde36-s.woff2 +0 -0
- package/dashboard/.next/trace +80 -0
- package/dashboard/.next/types/app/access/page.ts +79 -0
- package/dashboard/.next/types/app/api/code/route.ts +343 -0
- package/dashboard/.next/types/app/api/flows/route.ts +343 -0
- package/dashboard/.next/types/app/api/github-status/route.ts +343 -0
- package/dashboard/.next/types/app/api/issues/[id]/move/route.ts +343 -0
- package/dashboard/.next/types/app/api/issues/[id]/route.ts +343 -0
- package/dashboard/.next/types/app/api/mermaid/route.ts +343 -0
- package/dashboard/.next/types/app/api/progress/route.ts +343 -0
- package/dashboard/.next/types/app/api/watch/route.ts +343 -0
- package/dashboard/.next/types/app/calls/page.ts +79 -0
- package/dashboard/.next/types/app/conformance/page.ts +79 -0
- package/dashboard/.next/types/app/diagram/page.ts +79 -0
- package/dashboard/.next/types/app/flows/page.ts +79 -0
- package/dashboard/.next/types/app/functions/page.ts +79 -0
- package/dashboard/.next/types/app/issues/page.ts +79 -0
- package/dashboard/.next/types/app/page.ts +79 -0
- package/dashboard/.next/types/app/progress/page.ts +79 -0
- package/dashboard/.next/types/app/stats/page.ts +79 -0
- package/dashboard/.next/types/package.json +1 -0
- package/dashboard/app/access/AccessClient.tsx +402 -0
- package/dashboard/app/access/ReadOnlyFunctions.tsx +114 -0
- package/dashboard/app/access/page.tsx +118 -0
- package/dashboard/app/api/code/route.ts +35 -0
- package/dashboard/app/api/flows/route.ts +28 -0
- package/dashboard/app/api/github-status/route.ts +23 -0
- package/dashboard/app/api/issues/[id]/move/route.ts +74 -0
- package/dashboard/app/api/issues/[id]/route.ts +109 -0
- package/dashboard/app/api/mermaid/route.ts +25 -0
- package/dashboard/app/api/progress/route.ts +36 -0
- package/dashboard/app/api/watch/route.ts +52 -0
- package/dashboard/app/calls/CallsClient.tsx +170 -0
- package/dashboard/app/calls/page.tsx +50 -0
- package/dashboard/app/conformance/ConformanceTable.tsx +214 -0
- package/dashboard/app/conformance/page.tsx +179 -0
- package/dashboard/app/diagram/page.tsx +65 -0
- package/dashboard/app/flows/page.tsx +102 -0
- package/dashboard/app/functions/FunctionsClient.tsx +167 -0
- package/dashboard/app/functions/page.tsx +171 -0
- package/dashboard/app/globals.css +157 -0
- package/dashboard/app/icon.svg +18 -0
- package/dashboard/app/issues/IssuesBoardClient.tsx +636 -0
- package/dashboard/app/issues/page.tsx +239 -0
- package/dashboard/app/layout.tsx +40 -0
- package/dashboard/app/page.tsx +259 -0
- package/dashboard/app/progress/ProgressClient.tsx +333 -0
- package/dashboard/app/progress/page.tsx +118 -0
- package/dashboard/app/stats/StatsClient.tsx +452 -0
- package/dashboard/app/stats/page.tsx +43 -0
- package/dashboard/components/AutoRefresh.tsx +37 -0
- package/dashboard/components/CodeReference.tsx +129 -0
- package/dashboard/components/CommandPalette.tsx +135 -0
- package/dashboard/components/ConfidenceBadge.tsx +53 -0
- package/dashboard/components/DashboardLayout.tsx +450 -0
- package/dashboard/components/FilterableTable.tsx +293 -0
- package/dashboard/components/LiveStatus.tsx +99 -0
- package/dashboard/components/MarkdownRenderer.tsx +40 -0
- package/dashboard/components/MermaidViewer.tsx +267 -0
- package/dashboard/components/NotYetGenerated.tsx +32 -0
- package/dashboard/components/SeverityBadge.tsx +28 -0
- package/dashboard/components/SignalBars.tsx +27 -0
- package/dashboard/components/SortableTable.tsx +122 -0
- package/dashboard/lib/conformance-tokens.ts +49 -0
- package/dashboard/lib/data.ts +102 -0
- package/dashboard/lib/watcher.ts +45 -0
- package/dashboard/next-env.d.ts +5 -0
- package/dashboard/next.config.mjs +9 -0
- package/dashboard/postcss.config.cjs +6 -0
- package/dashboard/tailwind.config.ts +79 -0
- package/dashboard/tsconfig.json +21 -0
- package/dist/analysis/access-control.d.ts +24 -0
- package/dist/analysis/access-control.d.ts.map +1 -0
- package/dist/analysis/access-control.js +378 -0
- package/dist/analysis/access-control.js.map +1 -0
- package/dist/analysis/attack-surface.d.ts +51 -0
- package/dist/analysis/attack-surface.d.ts.map +1 -0
- package/dist/analysis/attack-surface.js +206 -0
- package/dist/analysis/attack-surface.js.map +1 -0
- package/dist/analysis/constraint-extraction.d.ts +25 -0
- package/dist/analysis/constraint-extraction.d.ts.map +1 -0
- package/dist/analysis/constraint-extraction.js +398 -0
- package/dist/analysis/constraint-extraction.js.map +1 -0
- package/dist/analysis/context-assembler.d.ts +16 -0
- package/dist/analysis/context-assembler.d.ts.map +1 -0
- package/dist/analysis/context-assembler.js +88 -0
- package/dist/analysis/context-assembler.js.map +1 -0
- package/dist/analysis/dependency-graph.d.ts +31 -0
- package/dist/analysis/dependency-graph.d.ts.map +1 -0
- package/dist/analysis/dependency-graph.js +223 -0
- package/dist/analysis/dependency-graph.js.map +1 -0
- package/dist/analysis/erc-detection.d.ts +16 -0
- package/dist/analysis/erc-detection.d.ts.map +1 -0
- package/dist/analysis/erc-detection.js +81 -0
- package/dist/analysis/erc-detection.js.map +1 -0
- package/dist/analysis/external-calls.d.ts +8 -0
- package/dist/analysis/external-calls.d.ts.map +1 -0
- package/dist/analysis/external-calls.js +124 -0
- package/dist/analysis/external-calls.js.map +1 -0
- package/dist/analysis/nsloc.d.ts +46 -0
- package/dist/analysis/nsloc.d.ts.map +1 -0
- package/dist/analysis/nsloc.js +106 -0
- package/dist/analysis/nsloc.js.map +1 -0
- package/dist/analysis/pattern-detection.d.ts +20 -0
- package/dist/analysis/pattern-detection.d.ts.map +1 -0
- package/dist/analysis/pattern-detection.js +236 -0
- package/dist/analysis/pattern-detection.js.map +1 -0
- package/dist/analysis/state-variables.d.ts +33 -0
- package/dist/analysis/state-variables.d.ts.map +1 -0
- package/dist/analysis/state-variables.js +179 -0
- package/dist/analysis/state-variables.js.map +1 -0
- package/dist/commands/access.d.ts +3 -0
- package/dist/commands/access.d.ts.map +1 -0
- package/dist/commands/access.js +99 -0
- package/dist/commands/access.js.map +1 -0
- package/dist/commands/ai-status.d.ts +3 -0
- package/dist/commands/ai-status.d.ts.map +1 -0
- package/dist/commands/ai-status.js +172 -0
- package/dist/commands/ai-status.js.map +1 -0
- package/dist/commands/analyze.d.ts +3 -0
- package/dist/commands/analyze.d.ts.map +1 -0
- package/dist/commands/analyze.js +101 -0
- package/dist/commands/analyze.js.map +1 -0
- package/dist/commands/calls.d.ts +3 -0
- package/dist/commands/calls.d.ts.map +1 -0
- package/dist/commands/calls.js +92 -0
- package/dist/commands/calls.js.map +1 -0
- package/dist/commands/claude.d.ts +3 -0
- package/dist/commands/claude.d.ts.map +1 -0
- package/dist/commands/claude.js +42 -0
- package/dist/commands/claude.js.map +1 -0
- package/dist/commands/constraints.d.ts +3 -0
- package/dist/commands/constraints.d.ts.map +1 -0
- package/dist/commands/constraints.js +32 -0
- package/dist/commands/constraints.js.map +1 -0
- package/dist/commands/context.d.ts +3 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +57 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/dashboard.d.ts +3 -0
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/commands/dashboard.js +95 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/deps.d.ts +3 -0
- package/dist/commands/deps.d.ts.map +1 -0
- package/dist/commands/deps.js +67 -0
- package/dist/commands/deps.js.map +1 -0
- package/dist/commands/doctor.d.ts +17 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +154 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +330 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/patterns.d.ts +3 -0
- package/dist/commands/patterns.d.ts.map +1 -0
- package/dist/commands/patterns.js +40 -0
- package/dist/commands/patterns.js.map +1 -0
- package/dist/commands/state.d.ts +3 -0
- package/dist/commands/state.d.ts.map +1 -0
- package/dist/commands/state.js +92 -0
- package/dist/commands/state.js.map +1 -0
- package/dist/commands/stats.d.ts +3 -0
- package/dist/commands/stats.d.ts.map +1 -0
- package/dist/commands/stats.js +347 -0
- package/dist/commands/stats.js.map +1 -0
- package/dist/commands/surface.d.ts +3 -0
- package/dist/commands/surface.d.ts.map +1 -0
- package/dist/commands/surface.js +45 -0
- package/dist/commands/surface.js.map +1 -0
- package/dist/commands/update-skills.d.ts +3 -0
- package/dist/commands/update-skills.d.ts.map +1 -0
- package/dist/commands/update-skills.js +40 -0
- package/dist/commands/update-skills.js.map +1 -0
- package/dist/commands/update.d.ts +3 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +157 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/core/config.d.ts +24 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +70 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/errors.d.ts +17 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +113 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/external-tools.d.ts +39 -0
- package/dist/core/external-tools.d.ts.map +1 -0
- package/dist/core/external-tools.js +151 -0
- package/dist/core/external-tools.js.map +1 -0
- package/dist/core/logger.d.ts +16 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +22 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/output.d.ts +13 -0
- package/dist/core/output.d.ts.map +1 -0
- package/dist/core/output.js +45 -0
- package/dist/core/output.js.map +1 -0
- package/dist/core/paths.d.ts +21 -0
- package/dist/core/paths.d.ts.map +1 -0
- package/dist/core/paths.js +32 -0
- package/dist/core/paths.js.map +1 -0
- package/dist/core/progress.d.ts +34 -0
- package/dist/core/progress.d.ts.map +1 -0
- package/dist/core/progress.js +119 -0
- package/dist/core/progress.js.map +1 -0
- package/dist/core/schema.d.ts +3197 -0
- package/dist/core/schema.d.ts.map +1 -0
- package/dist/core/schema.js +420 -0
- package/dist/core/schema.js.map +1 -0
- package/dist/core/skills.d.ts +28 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +82 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/parsers/lcov.d.ts +27 -0
- package/dist/parsers/lcov.d.ts.map +1 -0
- package/dist/parsers/lcov.js +68 -0
- package/dist/parsers/lcov.js.map +1 -0
- package/dist/parsers/slither.d.ts +63 -0
- package/dist/parsers/slither.d.ts.map +1 -0
- package/dist/parsers/slither.js +160 -0
- package/dist/parsers/slither.js.map +1 -0
- package/dist/parsers/solc.d.ts +19 -0
- package/dist/parsers/solc.d.ts.map +1 -0
- package/dist/parsers/solc.js +43 -0
- package/dist/parsers/solc.js.map +1 -0
- package/dist/parsers/solidity-parser.d.ts +77 -0
- package/dist/parsers/solidity-parser.d.ts.map +1 -0
- package/dist/parsers/solidity-parser.js +357 -0
- package/dist/parsers/solidity-parser.js.map +1 -0
- package/dist/skills/generate-overleaf.md +326 -0
- package/dist/skills/generate-poc.md +186 -0
- package/dist/skills/ingest-aa-report.md +172 -0
- package/dist/skills/init-audit.md +271 -0
- package/dist/skills/sync-issues.md +266 -0
- package/dist/skills/validate-issue.md +149 -0
- package/dist/skills/write-finding.md +142 -0
- package/dist/types/index.d.ts +30 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useState, useMemo } from 'react';
|
|
4
|
+
import { FilterableTable, type FilterableColumn } from '@/components/FilterableTable';
|
|
5
|
+
|
|
6
|
+
// ─── Types ──────────────────────────────────────────────────────────
|
|
7
|
+
|
|
8
|
+
interface PerContractStats {
|
|
9
|
+
file: string;
|
|
10
|
+
contract: string;
|
|
11
|
+
type: string;
|
|
12
|
+
nsloc: number;
|
|
13
|
+
functions: number;
|
|
14
|
+
external_functions: number;
|
|
15
|
+
public_functions: number;
|
|
16
|
+
internal_functions: number;
|
|
17
|
+
private_functions: number;
|
|
18
|
+
modifiers: number;
|
|
19
|
+
events: number;
|
|
20
|
+
errors: number;
|
|
21
|
+
assembly_lines: number;
|
|
22
|
+
inherits: string[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface DependencyEntry {
|
|
26
|
+
package: string;
|
|
27
|
+
version: string | null;
|
|
28
|
+
imports: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface CoveragePerContract {
|
|
32
|
+
contract: string;
|
|
33
|
+
file: string;
|
|
34
|
+
line_pct: number;
|
|
35
|
+
branch_pct: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface TestCoverage {
|
|
39
|
+
status: string;
|
|
40
|
+
failure_reason: string | null;
|
|
41
|
+
overall_line_pct: number | null;
|
|
42
|
+
overall_branch_pct: number | null;
|
|
43
|
+
per_contract: CoveragePerContract[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface Totals {
|
|
47
|
+
files: number;
|
|
48
|
+
contracts: number;
|
|
49
|
+
interfaces: number;
|
|
50
|
+
libraries: number;
|
|
51
|
+
abstract_contracts: number;
|
|
52
|
+
total_lines: number;
|
|
53
|
+
nsloc: number;
|
|
54
|
+
comment_lines: number;
|
|
55
|
+
blank_lines: number;
|
|
56
|
+
assembly_lines: number;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface StatsClientProps {
|
|
60
|
+
totals: Totals;
|
|
61
|
+
per_contract: PerContractStats[];
|
|
62
|
+
erc_eip_usage: string[];
|
|
63
|
+
dependencies: DependencyEntry[];
|
|
64
|
+
test_coverage: TestCoverage | null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ─── Helpers ────────────────────────────────────────────────────────
|
|
68
|
+
|
|
69
|
+
function pctBarColor(pct: number): string {
|
|
70
|
+
if (pct >= 80) return 'bg-[var(--success)]';
|
|
71
|
+
if (pct >= 50) return 'bg-[var(--medium)]';
|
|
72
|
+
return 'bg-[var(--critical)]';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const TYPE_STYLES: Record<string, string> = {
|
|
76
|
+
contract: 'bg-[var(--low)]/15 text-[var(--low)]',
|
|
77
|
+
interface: 'bg-[var(--info)]/15 text-[var(--info)]',
|
|
78
|
+
library: 'bg-[var(--info)]/15 text-[var(--info)]',
|
|
79
|
+
abstract: 'bg-[var(--high)]/15 text-[var(--high)]',
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const TABS = ['Summary', 'Per-Contract', 'Coverage', 'Dependencies'] as const;
|
|
83
|
+
type Tab = (typeof TABS)[number];
|
|
84
|
+
|
|
85
|
+
// ─── Component ──────────────────────────────────────────────────────
|
|
86
|
+
|
|
87
|
+
export function StatsClient({
|
|
88
|
+
totals,
|
|
89
|
+
per_contract,
|
|
90
|
+
erc_eip_usage,
|
|
91
|
+
dependencies,
|
|
92
|
+
test_coverage,
|
|
93
|
+
}: StatsClientProps) {
|
|
94
|
+
const [activeTab, setActiveTab] = useState<Tab>('Summary');
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<>
|
|
98
|
+
{/* Segmented control */}
|
|
99
|
+
<div className="mb-sp-5 inline-flex overflow-x-auto rounded-md bg-surface-3 p-1">
|
|
100
|
+
{TABS.map((tab) => (
|
|
101
|
+
<button
|
|
102
|
+
key={tab}
|
|
103
|
+
type="button"
|
|
104
|
+
onClick={() => setActiveTab(tab)}
|
|
105
|
+
className={`whitespace-nowrap rounded-sm px-sp-3 py-1.5 text-body font-medium ${
|
|
106
|
+
activeTab === tab
|
|
107
|
+
? 'bg-surface-2 text-text-primary shadow-sm'
|
|
108
|
+
: 'text-text-secondary hover:text-text-primary'
|
|
109
|
+
}`}
|
|
110
|
+
>
|
|
111
|
+
{tab}
|
|
112
|
+
</button>
|
|
113
|
+
))}
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
{/* Tab content */}
|
|
117
|
+
{activeTab === 'Summary' && (
|
|
118
|
+
<SummaryTab totals={totals} per_contract={per_contract} erc_eip_usage={erc_eip_usage} />
|
|
119
|
+
)}
|
|
120
|
+
{activeTab === 'Per-Contract' && (
|
|
121
|
+
<PerContractTab per_contract={per_contract} />
|
|
122
|
+
)}
|
|
123
|
+
{activeTab === 'Coverage' && (
|
|
124
|
+
<CoverageTab test_coverage={test_coverage} />
|
|
125
|
+
)}
|
|
126
|
+
{activeTab === 'Dependencies' && (
|
|
127
|
+
<DependenciesTab dependencies={dependencies} />
|
|
128
|
+
)}
|
|
129
|
+
</>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// ─── Tab: Summary ───────────────────────────────────────────────────
|
|
134
|
+
|
|
135
|
+
function SummaryTab({
|
|
136
|
+
totals,
|
|
137
|
+
per_contract,
|
|
138
|
+
erc_eip_usage,
|
|
139
|
+
}: {
|
|
140
|
+
totals: Totals;
|
|
141
|
+
per_contract: PerContractStats[];
|
|
142
|
+
erc_eip_usage: string[];
|
|
143
|
+
}) {
|
|
144
|
+
return (
|
|
145
|
+
<div>
|
|
146
|
+
{/* 6 KPI cards */}
|
|
147
|
+
<div className="mb-sp-6 grid grid-cols-2 gap-sp-3 sm:grid-cols-3 lg:grid-cols-6">
|
|
148
|
+
<SummaryCard label="Contracts" value={totals.contracts} />
|
|
149
|
+
<SummaryCard label="nSLOC" value={totals.nsloc.toLocaleString()} />
|
|
150
|
+
<SummaryCard label="Functions" value={per_contract.reduce((s, c) => s + c.functions, 0)} />
|
|
151
|
+
<SummaryCard label="Modifiers" value={per_contract.reduce((s, c) => s + c.modifiers, 0)} />
|
|
152
|
+
<SummaryCard label="Events" value={per_contract.reduce((s, c) => s + c.events, 0)} />
|
|
153
|
+
<SummaryCard label="Assembly" value={totals.assembly_lines} />
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
{/* ERC/EIP badges */}
|
|
157
|
+
{erc_eip_usage.length > 0 && (
|
|
158
|
+
<div className="mb-sp-6">
|
|
159
|
+
<h3 className="mb-sp-2 text-heading font-medium text-text-primary">ERC / EIP Usage</h3>
|
|
160
|
+
<div className="flex flex-wrap gap-2">
|
|
161
|
+
{erc_eip_usage.map((erc) => (
|
|
162
|
+
<span
|
|
163
|
+
key={erc}
|
|
164
|
+
className="inline-flex items-center rounded-sm bg-[var(--info)]/15 px-2.5 py-1 text-caption font-medium text-[var(--info)]"
|
|
165
|
+
>
|
|
166
|
+
{erc}
|
|
167
|
+
</span>
|
|
168
|
+
))}
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
)}
|
|
172
|
+
|
|
173
|
+
{/* Less important counts */}
|
|
174
|
+
<div className="flex flex-wrap gap-sp-4 text-caption text-text-tertiary">
|
|
175
|
+
<span>Total Lines: {totals.total_lines.toLocaleString()}</span>
|
|
176
|
+
<span>Comments: {totals.comment_lines.toLocaleString()}</span>
|
|
177
|
+
<span>Blank: {totals.blank_lines.toLocaleString()}</span>
|
|
178
|
+
<span>Files: {totals.files}</span>
|
|
179
|
+
<span>Interfaces: {totals.interfaces}</span>
|
|
180
|
+
<span>Libraries: {totals.libraries}</span>
|
|
181
|
+
<span>Abstract: {totals.abstract_contracts}</span>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// ─── Tab: Per-Contract ──────────────────────────────────────────────
|
|
188
|
+
|
|
189
|
+
function PerContractTab({ per_contract }: { per_contract: PerContractStats[] }) {
|
|
190
|
+
const columns = useMemo<FilterableColumn<PerContractStats>[]>(() => [
|
|
191
|
+
{
|
|
192
|
+
id: 'file',
|
|
193
|
+
header: 'File',
|
|
194
|
+
accessorKey: 'file',
|
|
195
|
+
cell: (row) => (
|
|
196
|
+
<span className="max-w-[200px] truncate font-mono text-caption text-text-tertiary">{row.file}</span>
|
|
197
|
+
),
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
id: 'contract',
|
|
201
|
+
header: 'Contract',
|
|
202
|
+
accessorKey: 'contract',
|
|
203
|
+
enableColumnFilter: true,
|
|
204
|
+
cell: (row) => <span className="font-medium text-text-primary">{row.contract}</span>,
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
id: 'type',
|
|
208
|
+
header: 'Type',
|
|
209
|
+
accessorKey: 'type',
|
|
210
|
+
enableColumnFilter: true,
|
|
211
|
+
cell: (row) => (
|
|
212
|
+
<span className={`inline-flex items-center rounded-sm px-2 py-0.5 text-caption font-medium ${TYPE_STYLES[row.type] ?? 'bg-surface-3 text-text-secondary'}`}>
|
|
213
|
+
{row.type}
|
|
214
|
+
</span>
|
|
215
|
+
),
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
id: 'nsloc',
|
|
219
|
+
header: 'nSLOC',
|
|
220
|
+
accessorKey: 'nsloc',
|
|
221
|
+
cell: (row) => <span className="text-right font-mono tabular-nums text-text-secondary">{row.nsloc}</span>,
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
id: 'functions',
|
|
225
|
+
header: 'Functions',
|
|
226
|
+
accessorKey: 'functions',
|
|
227
|
+
cell: (row) => <span className="text-right font-mono tabular-nums text-text-secondary">{row.functions}</span>,
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
id: 'modifiers',
|
|
231
|
+
header: 'Modifiers',
|
|
232
|
+
accessorKey: 'modifiers',
|
|
233
|
+
cell: (row) => <span className="text-right font-mono tabular-nums text-text-secondary">{row.modifiers}</span>,
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
id: 'events',
|
|
237
|
+
header: 'Events',
|
|
238
|
+
accessorKey: 'events',
|
|
239
|
+
cell: (row) => <span className="text-right font-mono tabular-nums text-text-secondary">{row.events}</span>,
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
id: 'errors',
|
|
243
|
+
header: 'Errors',
|
|
244
|
+
accessorKey: 'errors',
|
|
245
|
+
cell: (row) => <span className="text-right font-mono tabular-nums text-text-secondary">{row.errors}</span>,
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
id: 'assembly_lines',
|
|
249
|
+
header: 'Assembly',
|
|
250
|
+
accessorKey: 'assembly_lines',
|
|
251
|
+
cell: (row) => (
|
|
252
|
+
row.assembly_lines > 0
|
|
253
|
+
? <span className="text-right font-mono tabular-nums text-[var(--medium)]">{row.assembly_lines}</span>
|
|
254
|
+
: <span className="text-right font-mono tabular-nums text-text-tertiary">0</span>
|
|
255
|
+
),
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
id: 'inherits',
|
|
259
|
+
header: 'Inherits',
|
|
260
|
+
accessorKey: 'inherits',
|
|
261
|
+
cell: (row) => (
|
|
262
|
+
<span className="max-w-[200px] truncate text-caption text-text-tertiary">
|
|
263
|
+
{row.inherits.length > 0 ? row.inherits.join(', ') : '--'}
|
|
264
|
+
</span>
|
|
265
|
+
),
|
|
266
|
+
},
|
|
267
|
+
], []);
|
|
268
|
+
|
|
269
|
+
const totals = useMemo(() => ({
|
|
270
|
+
nsloc: per_contract.reduce((s, c) => s + c.nsloc, 0),
|
|
271
|
+
functions: per_contract.reduce((s, c) => s + c.functions, 0),
|
|
272
|
+
modifiers: per_contract.reduce((s, c) => s + c.modifiers, 0),
|
|
273
|
+
events: per_contract.reduce((s, c) => s + c.events, 0),
|
|
274
|
+
errors: per_contract.reduce((s, c) => s + c.errors, 0),
|
|
275
|
+
assembly: per_contract.reduce((s, c) => s + c.assembly_lines, 0),
|
|
276
|
+
}), [per_contract]);
|
|
277
|
+
|
|
278
|
+
return (
|
|
279
|
+
<div>
|
|
280
|
+
<FilterableTable columns={columns} data={per_contract} defaultOpen={true} />
|
|
281
|
+
|
|
282
|
+
{/* Totals summary */}
|
|
283
|
+
<div className="mt-sp-3 flex flex-wrap gap-sp-4 rounded-md border border-border-default bg-surface-2 px-sp-4 py-sp-3 text-body font-medium text-text-primary">
|
|
284
|
+
<span>Total ({per_contract.length} contracts)</span>
|
|
285
|
+
<span className="font-mono tabular-nums">nSLOC: {totals.nsloc}</span>
|
|
286
|
+
<span className="font-mono tabular-nums">Functions: {totals.functions}</span>
|
|
287
|
+
<span className="font-mono tabular-nums">Modifiers: {totals.modifiers}</span>
|
|
288
|
+
<span className="font-mono tabular-nums">Events: {totals.events}</span>
|
|
289
|
+
<span className="font-mono tabular-nums">Errors: {totals.errors}</span>
|
|
290
|
+
<span className="font-mono tabular-nums">Assembly: {totals.assembly}</span>
|
|
291
|
+
</div>
|
|
292
|
+
</div>
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// ─── Tab: Coverage ──────────────────────────────────────────────────
|
|
297
|
+
|
|
298
|
+
function CoverageTab({ test_coverage }: { test_coverage: TestCoverage | null }) {
|
|
299
|
+
if (!test_coverage || test_coverage.status !== 'available') {
|
|
300
|
+
return (
|
|
301
|
+
<div className="flex flex-col items-center justify-center rounded-md border border-dashed border-border-emphasis bg-surface-1 py-sp-8">
|
|
302
|
+
<p className="mb-2 text-heading font-medium text-text-primary">No Coverage Data</p>
|
|
303
|
+
<p className="text-body text-text-tertiary">
|
|
304
|
+
Run tests with coverage enabled to see results here.
|
|
305
|
+
</p>
|
|
306
|
+
</div>
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return (
|
|
311
|
+
<div>
|
|
312
|
+
<div className="mb-sp-3 grid grid-cols-2 gap-sp-3 sm:grid-cols-4">
|
|
313
|
+
{test_coverage.overall_line_pct != null && (
|
|
314
|
+
<div className="rounded-md border border-border-default bg-surface-2 p-sp-4">
|
|
315
|
+
<div className="mb-1 text-caption text-text-secondary">Line Coverage</div>
|
|
316
|
+
<div className="text-display text-text-primary">
|
|
317
|
+
{test_coverage.overall_line_pct.toFixed(1)}%
|
|
318
|
+
</div>
|
|
319
|
+
<div className="mt-2 h-1.5 w-full overflow-hidden rounded-full bg-surface-3">
|
|
320
|
+
<div
|
|
321
|
+
className={`h-full rounded-full ${pctBarColor(test_coverage.overall_line_pct)}`}
|
|
322
|
+
style={{ width: `${Math.min(test_coverage.overall_line_pct, 100)}%` }}
|
|
323
|
+
/>
|
|
324
|
+
</div>
|
|
325
|
+
</div>
|
|
326
|
+
)}
|
|
327
|
+
{test_coverage.overall_branch_pct != null && (
|
|
328
|
+
<div className="rounded-md border border-border-default bg-surface-2 p-sp-4">
|
|
329
|
+
<div className="mb-1 text-caption text-text-secondary">Branch Coverage</div>
|
|
330
|
+
<div className="text-display text-text-primary">
|
|
331
|
+
{test_coverage.overall_branch_pct.toFixed(1)}%
|
|
332
|
+
</div>
|
|
333
|
+
<div className="mt-2 h-1.5 w-full overflow-hidden rounded-full bg-surface-3">
|
|
334
|
+
<div
|
|
335
|
+
className={`h-full rounded-full ${pctBarColor(test_coverage.overall_branch_pct)}`}
|
|
336
|
+
style={{ width: `${Math.min(test_coverage.overall_branch_pct, 100)}%` }}
|
|
337
|
+
/>
|
|
338
|
+
</div>
|
|
339
|
+
</div>
|
|
340
|
+
)}
|
|
341
|
+
</div>
|
|
342
|
+
|
|
343
|
+
{test_coverage.per_contract.length > 0 && (
|
|
344
|
+
<div className="overflow-x-auto rounded-md border border-border-default">
|
|
345
|
+
<table className="w-full text-left text-body">
|
|
346
|
+
<thead className="border-b border-border-default bg-surface-2 text-caption font-medium uppercase tracking-wider text-text-tertiary">
|
|
347
|
+
<tr>
|
|
348
|
+
<th className="px-sp-4 py-sp-2">Contract</th>
|
|
349
|
+
<th className="px-sp-4 py-sp-2">File</th>
|
|
350
|
+
<th className="px-sp-4 py-sp-2">Line %</th>
|
|
351
|
+
<th className="w-48 px-sp-4 py-sp-2">Line Coverage</th>
|
|
352
|
+
<th className="px-sp-4 py-sp-2">Branch %</th>
|
|
353
|
+
<th className="w-48 px-sp-4 py-sp-2">Branch Coverage</th>
|
|
354
|
+
</tr>
|
|
355
|
+
</thead>
|
|
356
|
+
<tbody className="divide-y divide-border-subtle">
|
|
357
|
+
{test_coverage.per_contract.map((cov) => (
|
|
358
|
+
<tr
|
|
359
|
+
key={`${cov.file}:${cov.contract}`}
|
|
360
|
+
className="h-9 bg-surface-1 hover:bg-surface-3"
|
|
361
|
+
>
|
|
362
|
+
<td className="px-sp-4 py-sp-2 font-medium text-text-primary">{cov.contract}</td>
|
|
363
|
+
<td className="max-w-[200px] truncate px-sp-4 py-sp-2 font-mono text-caption text-text-tertiary">
|
|
364
|
+
{cov.file}
|
|
365
|
+
</td>
|
|
366
|
+
<td className="px-sp-4 py-sp-2 font-mono tabular-nums text-text-secondary">
|
|
367
|
+
{cov.line_pct.toFixed(1)}%
|
|
368
|
+
</td>
|
|
369
|
+
<td className="px-sp-4 py-sp-2">
|
|
370
|
+
<div className="h-1.5 w-full overflow-hidden rounded-full bg-surface-3">
|
|
371
|
+
<div
|
|
372
|
+
className={`h-full rounded-full ${pctBarColor(cov.line_pct)}`}
|
|
373
|
+
style={{ width: `${Math.min(cov.line_pct, 100)}%` }}
|
|
374
|
+
/>
|
|
375
|
+
</div>
|
|
376
|
+
</td>
|
|
377
|
+
<td className="px-sp-4 py-sp-2 font-mono tabular-nums text-text-secondary">
|
|
378
|
+
{cov.branch_pct.toFixed(1)}%
|
|
379
|
+
</td>
|
|
380
|
+
<td className="px-sp-4 py-sp-2">
|
|
381
|
+
<div className="h-1.5 w-full overflow-hidden rounded-full bg-surface-3">
|
|
382
|
+
<div
|
|
383
|
+
className={`h-full rounded-full ${pctBarColor(cov.branch_pct)}`}
|
|
384
|
+
style={{ width: `${Math.min(cov.branch_pct, 100)}%` }}
|
|
385
|
+
/>
|
|
386
|
+
</div>
|
|
387
|
+
</td>
|
|
388
|
+
</tr>
|
|
389
|
+
))}
|
|
390
|
+
</tbody>
|
|
391
|
+
</table>
|
|
392
|
+
</div>
|
|
393
|
+
)}
|
|
394
|
+
</div>
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// ─── Tab: Dependencies ──────────────────────────────────────────────
|
|
399
|
+
|
|
400
|
+
function DependenciesTab({ dependencies }: { dependencies: DependencyEntry[] }) {
|
|
401
|
+
if (dependencies.length === 0) {
|
|
402
|
+
return (
|
|
403
|
+
<div className="flex flex-col items-center justify-center rounded-md border border-dashed border-border-emphasis bg-surface-1 py-sp-8">
|
|
404
|
+
<p className="mb-2 text-heading font-medium text-text-primary">No Dependencies</p>
|
|
405
|
+
<p className="text-body text-text-tertiary">
|
|
406
|
+
No external dependencies were detected.
|
|
407
|
+
</p>
|
|
408
|
+
</div>
|
|
409
|
+
);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
return (
|
|
413
|
+
<div className="overflow-x-auto rounded-md border border-border-default">
|
|
414
|
+
<table className="w-full text-left text-body">
|
|
415
|
+
<thead className="border-b border-border-default bg-surface-2 text-caption font-medium uppercase tracking-wider text-text-tertiary">
|
|
416
|
+
<tr>
|
|
417
|
+
<th className="px-sp-4 py-sp-2">Package</th>
|
|
418
|
+
<th className="px-sp-4 py-sp-2">Version</th>
|
|
419
|
+
<th className="px-sp-4 py-sp-2 text-right">Imports</th>
|
|
420
|
+
</tr>
|
|
421
|
+
</thead>
|
|
422
|
+
<tbody className="divide-y divide-border-subtle">
|
|
423
|
+
{dependencies.map((dep) => (
|
|
424
|
+
<tr
|
|
425
|
+
key={dep.package}
|
|
426
|
+
className="h-9 bg-surface-1 hover:bg-surface-3"
|
|
427
|
+
>
|
|
428
|
+
<td className="px-sp-4 py-sp-2 font-medium text-text-primary">{dep.package}</td>
|
|
429
|
+
<td className="px-sp-4 py-sp-2 font-mono text-body text-text-tertiary">
|
|
430
|
+
{dep.version ?? '--'}
|
|
431
|
+
</td>
|
|
432
|
+
<td className="px-sp-4 py-sp-2 text-right font-mono tabular-nums text-text-secondary">
|
|
433
|
+
{dep.imports}
|
|
434
|
+
</td>
|
|
435
|
+
</tr>
|
|
436
|
+
))}
|
|
437
|
+
</tbody>
|
|
438
|
+
</table>
|
|
439
|
+
</div>
|
|
440
|
+
);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// ─── Shared sub-components ──────────────────────────────────────────
|
|
444
|
+
|
|
445
|
+
function SummaryCard({ label, value }: { label: string; value: string | number }) {
|
|
446
|
+
return (
|
|
447
|
+
<div className="rounded-md border border-border-default bg-surface-2 p-sp-4">
|
|
448
|
+
<div className="text-display text-text-primary">{value}</div>
|
|
449
|
+
<div className="mt-1 text-caption text-text-secondary">{label}</div>
|
|
450
|
+
</div>
|
|
451
|
+
);
|
|
452
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { readJsonFile } from '@/lib/data';
|
|
2
|
+
import { NotYetGenerated } from '@/components/NotYetGenerated';
|
|
3
|
+
import { StatsClient, type StatsClientProps } from './StatsClient';
|
|
4
|
+
|
|
5
|
+
// ─── Types ──────────────────────────────────────────────────────────
|
|
6
|
+
|
|
7
|
+
interface Stats {
|
|
8
|
+
generated_at: string;
|
|
9
|
+
totals: StatsClientProps['totals'];
|
|
10
|
+
solidity_version: string;
|
|
11
|
+
erc_eip_usage: string[];
|
|
12
|
+
dependencies: StatsClientProps['dependencies'];
|
|
13
|
+
test_coverage: StatsClientProps['test_coverage'];
|
|
14
|
+
per_contract: StatsClientProps['per_contract'];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// ─── Component ──────────────────────────────────────────────────────
|
|
18
|
+
|
|
19
|
+
export default function StatsPage() {
|
|
20
|
+
const stats = readJsonFile<Stats>('stats.json');
|
|
21
|
+
|
|
22
|
+
if (!stats) {
|
|
23
|
+
return (
|
|
24
|
+
<div>
|
|
25
|
+
<h2 className="mb-sp-5 text-title font-semibold text-text-primary">Stats</h2>
|
|
26
|
+
<NotYetGenerated command="hex stats" />
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div>
|
|
33
|
+
<h2 className="mb-sp-5 text-title font-semibold text-text-primary">Stats</h2>
|
|
34
|
+
<StatsClient
|
|
35
|
+
totals={stats.totals}
|
|
36
|
+
per_contract={stats.per_contract}
|
|
37
|
+
erc_eip_usage={stats.erc_eip_usage}
|
|
38
|
+
dependencies={stats.dependencies}
|
|
39
|
+
test_coverage={stats.test_coverage}
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { useRouter } from 'next/navigation';
|
|
5
|
+
|
|
6
|
+
export function AutoRefresh() {
|
|
7
|
+
const router = useRouter();
|
|
8
|
+
const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
9
|
+
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const eventSource = new EventSource('/api/watch');
|
|
12
|
+
|
|
13
|
+
eventSource.onmessage = () => {
|
|
14
|
+
// Debounce: clear any pending refresh and schedule a new one
|
|
15
|
+
if (timerRef.current) {
|
|
16
|
+
clearTimeout(timerRef.current);
|
|
17
|
+
}
|
|
18
|
+
timerRef.current = setTimeout(() => {
|
|
19
|
+
router.refresh();
|
|
20
|
+
}, 500);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
eventSource.onerror = () => {
|
|
24
|
+
// The browser will automatically attempt to reconnect for SSE.
|
|
25
|
+
// No action needed here beyond letting the default reconnect behavior work.
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return () => {
|
|
29
|
+
eventSource.close();
|
|
30
|
+
if (timerRef.current) {
|
|
31
|
+
clearTimeout(timerRef.current);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}, [router]);
|
|
35
|
+
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
|
+
|
|
5
|
+
interface CodeReferenceProps {
|
|
6
|
+
file: string;
|
|
7
|
+
lineStart: number;
|
|
8
|
+
lineEnd?: number;
|
|
9
|
+
snippet?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function CodeReference({ file, lineStart, lineEnd, snippet }: CodeReferenceProps) {
|
|
13
|
+
const [modalOpen, setModalOpen] = useState(false);
|
|
14
|
+
const [code, setCode] = useState<string | null>(snippet ?? null);
|
|
15
|
+
const [loading, setLoading] = useState(false);
|
|
16
|
+
const [error, setError] = useState<string | null>(null);
|
|
17
|
+
|
|
18
|
+
const label = `${file}:${lineStart}${lineEnd && lineEnd !== lineStart ? `-${lineEnd}` : ''}`;
|
|
19
|
+
|
|
20
|
+
const handleClick = async () => {
|
|
21
|
+
setModalOpen(true);
|
|
22
|
+
if (code) return;
|
|
23
|
+
|
|
24
|
+
setLoading(true);
|
|
25
|
+
try {
|
|
26
|
+
const params = new URLSearchParams({
|
|
27
|
+
file,
|
|
28
|
+
start: String(Math.max(1, lineStart - 3)),
|
|
29
|
+
end: String((lineEnd ?? lineStart) + 3),
|
|
30
|
+
});
|
|
31
|
+
const res = await fetch(`/api/code?${params}`);
|
|
32
|
+
if (!res.ok) throw new Error('Failed to load source');
|
|
33
|
+
const data = await res.json();
|
|
34
|
+
setCode(data.code);
|
|
35
|
+
} catch (err) {
|
|
36
|
+
setError(err instanceof Error ? err.message : 'Failed to load');
|
|
37
|
+
} finally {
|
|
38
|
+
setLoading(false);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<>
|
|
44
|
+
<button
|
|
45
|
+
type="button"
|
|
46
|
+
onClick={handleClick}
|
|
47
|
+
className="font-mono text-caption text-accent hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent rounded-sm"
|
|
48
|
+
>
|
|
49
|
+
{label}
|
|
50
|
+
</button>
|
|
51
|
+
|
|
52
|
+
{modalOpen && (
|
|
53
|
+
<ModalOverlay onClose={() => setModalOpen(false)}>
|
|
54
|
+
<div
|
|
55
|
+
role="dialog"
|
|
56
|
+
aria-modal="true"
|
|
57
|
+
aria-label={`Source code: ${label}`}
|
|
58
|
+
className="relative max-h-[80vh] w-full max-w-3xl overflow-auto border border-border-emphasis bg-surface-1 shadow-2xl"
|
|
59
|
+
style={{ borderRadius: 'var(--radius-md)', boxShadow: 'var(--shadow-accent)' }}
|
|
60
|
+
onClick={(e) => e.stopPropagation()}
|
|
61
|
+
>
|
|
62
|
+
{/* Header */}
|
|
63
|
+
<div className="sticky top-0 flex items-center justify-between border-b border-border-default bg-surface-2 px-sp-4 py-sp-3">
|
|
64
|
+
<span className="font-mono text-body text-text-primary">{label}</span>
|
|
65
|
+
<button
|
|
66
|
+
type="button"
|
|
67
|
+
onClick={() => setModalOpen(false)}
|
|
68
|
+
aria-label="Close"
|
|
69
|
+
className="rounded p-1 text-text-tertiary hover:bg-surface-3 hover:text-text-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent"
|
|
70
|
+
>
|
|
71
|
+
<svg className="h-5 w-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
|
|
72
|
+
<path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12" />
|
|
73
|
+
</svg>
|
|
74
|
+
</button>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
{/* Content */}
|
|
78
|
+
<div className="p-sp-4">
|
|
79
|
+
{loading && <p className="text-body text-text-secondary">Loading...</p>}
|
|
80
|
+
{error && <p className="text-body text-severity-critical">{error}</p>}
|
|
81
|
+
{code && (
|
|
82
|
+
<pre className="overflow-x-auto rounded-md bg-surface-0 p-sp-4 text-caption leading-relaxed text-text-secondary">
|
|
83
|
+
{code.split('\n').map((line, i) => {
|
|
84
|
+
const lineNum = Math.max(1, lineStart - 3) + i;
|
|
85
|
+
const isHighlighted = lineNum >= lineStart && lineNum <= (lineEnd ?? lineStart);
|
|
86
|
+
return (
|
|
87
|
+
<div
|
|
88
|
+
key={i}
|
|
89
|
+
className={isHighlighted ? 'bg-accent/10' : ''}
|
|
90
|
+
>
|
|
91
|
+
<span className="mr-4 inline-block w-10 select-none text-right text-text-tertiary">
|
|
92
|
+
{lineNum}
|
|
93
|
+
</span>
|
|
94
|
+
{line}
|
|
95
|
+
</div>
|
|
96
|
+
);
|
|
97
|
+
})}
|
|
98
|
+
</pre>
|
|
99
|
+
)}
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</ModalOverlay>
|
|
103
|
+
)}
|
|
104
|
+
</>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function ModalOverlay({ onClose, children }: { onClose: () => void; children: React.ReactNode }) {
|
|
109
|
+
const overlayRef = useRef<HTMLDivElement>(null);
|
|
110
|
+
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
overlayRef.current?.focus();
|
|
113
|
+
}, []);
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<div
|
|
117
|
+
ref={overlayRef}
|
|
118
|
+
tabIndex={-1}
|
|
119
|
+
className="fixed inset-0 z-50 flex items-center justify-center outline-none"
|
|
120
|
+
style={{ background: 'var(--overlay-bg)' }}
|
|
121
|
+
onClick={onClose}
|
|
122
|
+
onKeyDown={(e) => {
|
|
123
|
+
if (e.key === 'Escape') onClose();
|
|
124
|
+
}}
|
|
125
|
+
>
|
|
126
|
+
{children}
|
|
127
|
+
</div>
|
|
128
|
+
);
|
|
129
|
+
}
|