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,28 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { getOutputDirPath } from '@/lib/data';
|
|
5
|
+
|
|
6
|
+
export async function GET() {
|
|
7
|
+
const outputDir = getOutputDirPath();
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
const files = fs.readdirSync(path.join(outputDir, 'diagrams'));
|
|
11
|
+
const flows: { name: string; filename: string }[] = [];
|
|
12
|
+
|
|
13
|
+
for (const file of files) {
|
|
14
|
+
if (/^flow-[\w-]+\.mmd$/.test(file)) {
|
|
15
|
+
const name = file
|
|
16
|
+
.replace(/^flow-/, '')
|
|
17
|
+
.replace(/\.mmd$/, '')
|
|
18
|
+
.replace(/-/g, ' ')
|
|
19
|
+
.replace(/\b\w/g, (c) => c.toUpperCase());
|
|
20
|
+
flows.push({ name, filename: file });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return NextResponse.json({ flows });
|
|
25
|
+
} catch {
|
|
26
|
+
return NextResponse.json({ flows: [] });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
import { readJsonFile } from '@/lib/data';
|
|
3
|
+
|
|
4
|
+
interface GithubSyncStatus {
|
|
5
|
+
repo: string;
|
|
6
|
+
last_synced_at: string;
|
|
7
|
+
pushed?: number;
|
|
8
|
+
updated?: number;
|
|
9
|
+
pulled?: number;
|
|
10
|
+
teammate_findings?: number;
|
|
11
|
+
duplicates_detected?: number;
|
|
12
|
+
errors?: string[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const dynamic = 'force-dynamic';
|
|
16
|
+
|
|
17
|
+
export async function GET() {
|
|
18
|
+
const status = readJsonFile<GithubSyncStatus>('external/github/sync-status.json');
|
|
19
|
+
if (!status) {
|
|
20
|
+
return NextResponse.json({}, { status: 204 });
|
|
21
|
+
}
|
|
22
|
+
return NextResponse.json(status);
|
|
23
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
import { readJsonFile, writeJsonFile } from '@/lib/data';
|
|
3
|
+
|
|
4
|
+
interface TrackingEntry {
|
|
5
|
+
id: string;
|
|
6
|
+
status?: string;
|
|
7
|
+
duplicate_of?: string | null;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface TrackingFile {
|
|
12
|
+
findings: TrackingEntry[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Map a board column to the canonical tracking status it persists as.
|
|
16
|
+
const COLUMN_TO_STATUS: Record<string, string> = {
|
|
17
|
+
potential: 'pending_validation',
|
|
18
|
+
verified: 'verified',
|
|
19
|
+
invalid: 'rejected',
|
|
20
|
+
duplicate: 'duplicate',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const STATUS_VALUES = new Set([
|
|
24
|
+
'pending_validation',
|
|
25
|
+
'unverified',
|
|
26
|
+
'verified',
|
|
27
|
+
'rejected',
|
|
28
|
+
'duplicate',
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
export async function POST(request: NextRequest, { params }: { params: { id: string } }) {
|
|
32
|
+
const id = params.id;
|
|
33
|
+
const body = (await request.json()) as {
|
|
34
|
+
column?: string;
|
|
35
|
+
status?: string;
|
|
36
|
+
duplicate_of?: string | null;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
let nextStatus: string | undefined;
|
|
40
|
+
if (body.status) {
|
|
41
|
+
if (!STATUS_VALUES.has(body.status)) {
|
|
42
|
+
return NextResponse.json({ error: `Invalid status: ${body.status}` }, { status: 400 });
|
|
43
|
+
}
|
|
44
|
+
nextStatus = body.status;
|
|
45
|
+
} else if (body.column) {
|
|
46
|
+
nextStatus = COLUMN_TO_STATUS[body.column];
|
|
47
|
+
if (!nextStatus) {
|
|
48
|
+
return NextResponse.json({ error: `Invalid column: ${body.column}` }, { status: 400 });
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
return NextResponse.json(
|
|
52
|
+
{ error: "Body must include either 'column' or 'status'" },
|
|
53
|
+
{ status: 400 },
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const tracking = readJsonFile<TrackingFile>('tracking.json') ?? { findings: [] };
|
|
58
|
+
const entry = tracking.findings.find((e) => e.id === id);
|
|
59
|
+
if (!entry) {
|
|
60
|
+
return NextResponse.json({ error: `Issue ${id} not found in tracking.json` }, { status: 404 });
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
entry.status = nextStatus;
|
|
64
|
+
if (body.duplicate_of !== undefined) {
|
|
65
|
+
entry.duplicate_of = body.duplicate_of;
|
|
66
|
+
}
|
|
67
|
+
// Clearing duplicate_of when leaving the duplicate column reduces stale refs.
|
|
68
|
+
if (nextStatus !== 'duplicate' && entry.duplicate_of) {
|
|
69
|
+
entry.duplicate_of = null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
writeJsonFile('tracking.json', tracking);
|
|
73
|
+
return NextResponse.json({ ok: true, id, status: nextStatus });
|
|
74
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
import { readJsonFile, writeJsonFile } from '@/lib/data';
|
|
3
|
+
|
|
4
|
+
interface FindingsFile {
|
|
5
|
+
findings: Array<{
|
|
6
|
+
id: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
severity?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
recommendation?: string;
|
|
11
|
+
resolution?: string;
|
|
12
|
+
update_from_client?: string;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface TrackingFile {
|
|
18
|
+
findings: Array<{
|
|
19
|
+
id: string;
|
|
20
|
+
title?: string;
|
|
21
|
+
severity?: string;
|
|
22
|
+
notes?: string;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const EDITABLE_FIELDS = new Set([
|
|
28
|
+
'title',
|
|
29
|
+
'severity',
|
|
30
|
+
'description',
|
|
31
|
+
'recommendation',
|
|
32
|
+
'resolution',
|
|
33
|
+
'update_from_client',
|
|
34
|
+
'notes',
|
|
35
|
+
]);
|
|
36
|
+
|
|
37
|
+
const SEVERITY_VALUES = new Set(['Critical', 'High', 'Medium', 'Low', 'Info']);
|
|
38
|
+
const RESOLUTION_VALUES = new Set([
|
|
39
|
+
'Fixed',
|
|
40
|
+
'Mitigated',
|
|
41
|
+
'Acknowledged',
|
|
42
|
+
'Not Fixed',
|
|
43
|
+
'Unresolved',
|
|
44
|
+
]);
|
|
45
|
+
|
|
46
|
+
export async function PATCH(request: NextRequest, { params }: { params: { id: string } }) {
|
|
47
|
+
const id = params.id;
|
|
48
|
+
const body = (await request.json()) as Record<string, unknown>;
|
|
49
|
+
|
|
50
|
+
const updates: Record<string, unknown> = {};
|
|
51
|
+
for (const [key, value] of Object.entries(body)) {
|
|
52
|
+
if (!EDITABLE_FIELDS.has(key)) continue;
|
|
53
|
+
if (key === 'severity' && typeof value === 'string' && !SEVERITY_VALUES.has(value)) {
|
|
54
|
+
return NextResponse.json({ error: `Invalid severity: ${value}` }, { status: 400 });
|
|
55
|
+
}
|
|
56
|
+
if (
|
|
57
|
+
key === 'resolution' &&
|
|
58
|
+
value != null &&
|
|
59
|
+
typeof value === 'string' &&
|
|
60
|
+
!RESOLUTION_VALUES.has(value)
|
|
61
|
+
) {
|
|
62
|
+
return NextResponse.json({ error: `Invalid resolution: ${value}` }, { status: 400 });
|
|
63
|
+
}
|
|
64
|
+
updates[key] = value;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (Object.keys(updates).length === 0) {
|
|
68
|
+
return NextResponse.json({ error: 'No editable fields supplied' }, { status: 400 });
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Apply to findings.json if a matching record exists; otherwise we record the
|
|
72
|
+
// edits on the tracking entry (title, severity, notes flow through; description
|
|
73
|
+
// and recommendation can't be displayed yet but we still persist them so a
|
|
74
|
+
// later /validate-issue or /write-finding can pick them up).
|
|
75
|
+
const findings = readJsonFile<FindingsFile>('findings.json') ?? { findings: [] };
|
|
76
|
+
const tracking = readJsonFile<TrackingFile>('tracking.json') ?? { findings: [] };
|
|
77
|
+
|
|
78
|
+
let findingTouched = false;
|
|
79
|
+
for (const finding of findings.findings) {
|
|
80
|
+
if (finding.id !== id) continue;
|
|
81
|
+
for (const [key, value] of Object.entries(updates)) {
|
|
82
|
+
if (key === 'notes') continue; // notes lives on tracking, not findings
|
|
83
|
+
finding[key] = value as never;
|
|
84
|
+
}
|
|
85
|
+
findingTouched = true;
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
let trackingTouched = false;
|
|
90
|
+
for (const entry of tracking.findings) {
|
|
91
|
+
if (entry.id !== id) continue;
|
|
92
|
+
// Title and severity are mirrored on tracking so the board shows current
|
|
93
|
+
// values without re-reading findings.json.
|
|
94
|
+
if ('title' in updates) entry.title = updates.title as string;
|
|
95
|
+
if ('severity' in updates) entry.severity = updates.severity as string;
|
|
96
|
+
if ('notes' in updates) entry.notes = updates.notes as string;
|
|
97
|
+
trackingTouched = true;
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (!findingTouched && !trackingTouched) {
|
|
102
|
+
return NextResponse.json({ error: `Issue ${id} not found` }, { status: 404 });
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (findingTouched) writeJsonFile('findings.json', findings);
|
|
106
|
+
if (trackingTouched) writeJsonFile('tracking.json', tracking);
|
|
107
|
+
|
|
108
|
+
return NextResponse.json({ ok: true, id, updates });
|
|
109
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { getOutputDirPath } from '@/lib/data';
|
|
5
|
+
|
|
6
|
+
export async function GET(request: NextRequest) {
|
|
7
|
+
const filename = request.nextUrl.searchParams.get('file');
|
|
8
|
+
|
|
9
|
+
if (!filename || !/^[\w.-]+\.mmd$/.test(filename)) {
|
|
10
|
+
return NextResponse.json({ error: 'Invalid filename' }, { status: 400 });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const outputDir = getOutputDirPath();
|
|
14
|
+
const filePath = path.join(outputDir, 'diagrams', filename);
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const syntax = fs.readFileSync(filePath, 'utf-8');
|
|
18
|
+
return NextResponse.json({ syntax });
|
|
19
|
+
} catch {
|
|
20
|
+
return NextResponse.json(
|
|
21
|
+
{ error: `File not found: ${filename}` },
|
|
22
|
+
{ status: 404 },
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
import { readJsonFile, writeJsonFile } from '@/lib/data';
|
|
3
|
+
|
|
4
|
+
interface ProgressData {
|
|
5
|
+
updated_at: string;
|
|
6
|
+
reviewed_contracts: Record<string, boolean>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const DEFAULT_PROGRESS: ProgressData = {
|
|
10
|
+
updated_at: new Date().toISOString(),
|
|
11
|
+
reviewed_contracts: {},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export async function GET() {
|
|
15
|
+
const data = readJsonFile<ProgressData>('progress.json');
|
|
16
|
+
return NextResponse.json(data ?? DEFAULT_PROGRESS);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function POST(request: NextRequest) {
|
|
20
|
+
const body = await request.json() as { reviewed_contracts: Record<string, boolean> };
|
|
21
|
+
|
|
22
|
+
if (!body.reviewed_contracts || typeof body.reviewed_contracts !== 'object') {
|
|
23
|
+
return NextResponse.json({ error: 'Invalid payload' }, { status: 400 });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const existing = readJsonFile<ProgressData>('progress.json') ?? { ...DEFAULT_PROGRESS };
|
|
27
|
+
|
|
28
|
+
// Merge: new values override existing
|
|
29
|
+
for (const [key, value] of Object.entries(body.reviewed_contracts)) {
|
|
30
|
+
existing.reviewed_contracts[key] = value;
|
|
31
|
+
}
|
|
32
|
+
existing.updated_at = new Date().toISOString();
|
|
33
|
+
|
|
34
|
+
writeJsonFile('progress.json', existing);
|
|
35
|
+
return NextResponse.json(existing);
|
|
36
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { initWatcher, onFileChange } from '@/lib/watcher';
|
|
2
|
+
import { getOutputDirPath } from '@/lib/data';
|
|
3
|
+
|
|
4
|
+
export const dynamic = 'force-dynamic';
|
|
5
|
+
|
|
6
|
+
export async function GET(): Promise<Response> {
|
|
7
|
+
const outputDir = getOutputDirPath();
|
|
8
|
+
initWatcher(outputDir);
|
|
9
|
+
|
|
10
|
+
const encoder = new TextEncoder();
|
|
11
|
+
let unsubscribe: (() => void) | undefined;
|
|
12
|
+
let keepalive: ReturnType<typeof setInterval> | undefined;
|
|
13
|
+
|
|
14
|
+
const stream = new ReadableStream({
|
|
15
|
+
start(controller) {
|
|
16
|
+
// Send initial connection confirmation
|
|
17
|
+
controller.enqueue(encoder.encode(': connected\n\n'));
|
|
18
|
+
|
|
19
|
+
// Subscribe to file changes from the watcher
|
|
20
|
+
unsubscribe = onFileChange((file) => {
|
|
21
|
+
try {
|
|
22
|
+
controller.enqueue(
|
|
23
|
+
encoder.encode(`data: ${JSON.stringify({ file })}\n\n`),
|
|
24
|
+
);
|
|
25
|
+
} catch {
|
|
26
|
+
// Stream closed; cleanup will happen in cancel()
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// Keepalive ping every 30 seconds to prevent connection timeout
|
|
31
|
+
keepalive = setInterval(() => {
|
|
32
|
+
try {
|
|
33
|
+
controller.enqueue(encoder.encode(': ping\n\n'));
|
|
34
|
+
} catch {
|
|
35
|
+
// Stream closed; cleanup will happen in cancel()
|
|
36
|
+
}
|
|
37
|
+
}, 30_000);
|
|
38
|
+
},
|
|
39
|
+
cancel() {
|
|
40
|
+
if (keepalive) clearInterval(keepalive);
|
|
41
|
+
if (unsubscribe) unsubscribe();
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return new Response(stream, {
|
|
46
|
+
headers: {
|
|
47
|
+
'Content-Type': 'text/event-stream',
|
|
48
|
+
'Cache-Control': 'no-cache, no-transform',
|
|
49
|
+
Connection: 'keep-alive',
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { FilterableTable, type FilterableColumn } from '@/components/FilterableTable';
|
|
4
|
+
|
|
5
|
+
// ─── Types ──────────────────────────────────────────────────────────
|
|
6
|
+
|
|
7
|
+
interface ConfidenceValue {
|
|
8
|
+
value: boolean | string;
|
|
9
|
+
confidence: string;
|
|
10
|
+
derived_from: string;
|
|
11
|
+
reasoning?: string;
|
|
12
|
+
warnings?: string[];
|
|
13
|
+
guard_type?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface ExternalCall {
|
|
17
|
+
contract: string;
|
|
18
|
+
function: string;
|
|
19
|
+
target: string;
|
|
20
|
+
method: string;
|
|
21
|
+
return_checked: ConfidenceValue;
|
|
22
|
+
inside_reentrancy_guard: ConfidenceValue;
|
|
23
|
+
call_type: string;
|
|
24
|
+
trust_level: ConfidenceValue;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface CallRow {
|
|
28
|
+
contract: string;
|
|
29
|
+
fn: string;
|
|
30
|
+
call: string;
|
|
31
|
+
return_checked: boolean;
|
|
32
|
+
call_type: string;
|
|
33
|
+
trust: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// ─── Helpers ────────────────────────────────────────────────────────
|
|
37
|
+
|
|
38
|
+
const TRUST_STYLES: Record<string, string> = {
|
|
39
|
+
external: 'bg-[var(--critical)]/15 text-[var(--critical)]',
|
|
40
|
+
untrusted: 'bg-[var(--critical)]/15 text-[var(--critical)]',
|
|
41
|
+
'semi-trusted': 'bg-[var(--medium)]/15 text-[var(--medium)]',
|
|
42
|
+
semi_trusted: 'bg-[var(--medium)]/15 text-[var(--medium)]',
|
|
43
|
+
trusted: 'bg-[var(--success)]/15 text-[var(--success)]',
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
function TrustBadge({ trust }: { trust: string }) {
|
|
47
|
+
const style = TRUST_STYLES[trust.toLowerCase()] ?? 'bg-[var(--neutral)]/15 text-[var(--neutral)]';
|
|
48
|
+
return (
|
|
49
|
+
<span className={`inline-flex items-center rounded-sm px-2 py-0.5 text-caption font-medium ${style}`}>
|
|
50
|
+
{trust}
|
|
51
|
+
</span>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function toBool(value: boolean | string): boolean {
|
|
56
|
+
return value === true || value === 'true' || value === 'yes';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function flattenCalls(calls: ExternalCall[]): CallRow[] {
|
|
60
|
+
return calls.map((c) => ({
|
|
61
|
+
contract: c.contract,
|
|
62
|
+
fn: c.function,
|
|
63
|
+
call: `${c.target}.${c.method}()`,
|
|
64
|
+
return_checked: toBool(c.return_checked.value),
|
|
65
|
+
call_type: c.call_type,
|
|
66
|
+
trust: String(c.trust_level.value),
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// ─── Columns ────────────────────────────────────────────────────────
|
|
71
|
+
|
|
72
|
+
const columns: FilterableColumn<CallRow>[] = [
|
|
73
|
+
{
|
|
74
|
+
id: 'contract',
|
|
75
|
+
header: 'Contract',
|
|
76
|
+
accessorKey: 'contract',
|
|
77
|
+
enableColumnFilter: true,
|
|
78
|
+
cell: (row) => <span className="font-medium text-text-primary">{row.contract}</span>,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'function',
|
|
82
|
+
header: 'Function',
|
|
83
|
+
accessorKey: 'fn',
|
|
84
|
+
cell: (row) => <span className="font-mono text-body text-text-secondary">{row.fn}</span>,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: 'call',
|
|
88
|
+
header: 'Call',
|
|
89
|
+
accessorKey: 'call',
|
|
90
|
+
cell: (row) => <span className="font-mono text-body text-text-secondary">{row.call}</span>,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'return_checked',
|
|
94
|
+
header: 'Return Checked',
|
|
95
|
+
accessorKey: 'return_checked',
|
|
96
|
+
cell: (row) => (
|
|
97
|
+
<span className={row.return_checked ? 'text-[var(--success)]' : 'text-[var(--critical)]'}>
|
|
98
|
+
{row.return_checked ? 'Yes' : 'No'}
|
|
99
|
+
</span>
|
|
100
|
+
),
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: 'call_type',
|
|
104
|
+
header: 'Call Type',
|
|
105
|
+
accessorKey: 'call_type',
|
|
106
|
+
enableColumnFilter: true,
|
|
107
|
+
cell: (row) => (
|
|
108
|
+
<span className="inline-flex items-center rounded-sm bg-surface-3 px-2 py-0.5 text-caption text-text-secondary">
|
|
109
|
+
{row.call_type}
|
|
110
|
+
</span>
|
|
111
|
+
),
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
id: 'trust',
|
|
115
|
+
header: 'Trust',
|
|
116
|
+
accessorKey: 'trust',
|
|
117
|
+
enableColumnFilter: true,
|
|
118
|
+
cell: (row) => <TrustBadge trust={row.trust} />,
|
|
119
|
+
},
|
|
120
|
+
];
|
|
121
|
+
|
|
122
|
+
// ─── Component ──────────────────────────────────────────────────────
|
|
123
|
+
|
|
124
|
+
export function CallsClient({ calls }: { calls: ExternalCall[] }) {
|
|
125
|
+
const rows = flattenCalls(calls);
|
|
126
|
+
|
|
127
|
+
const trustCounts: Record<string, number> = {};
|
|
128
|
+
for (const r of rows) {
|
|
129
|
+
trustCounts[r.trust] = (trustCounts[r.trust] ?? 0) + 1;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const uncheckedReturns = rows.filter((r) => !r.return_checked).length;
|
|
133
|
+
|
|
134
|
+
return (
|
|
135
|
+
<div>
|
|
136
|
+
<h2 className="mb-sp-5 text-title font-semibold text-text-primary">External Calls</h2>
|
|
137
|
+
|
|
138
|
+
<p className="mb-sp-3 text-body text-text-secondary">
|
|
139
|
+
{rows.length} external call{rows.length !== 1 ? 's' : ''} found
|
|
140
|
+
</p>
|
|
141
|
+
|
|
142
|
+
{/* Summary cards */}
|
|
143
|
+
<div className="mb-sp-5 grid grid-cols-2 gap-sp-3 sm:grid-cols-4">
|
|
144
|
+
{Object.entries(trustCounts).map(([level, count]) => (
|
|
145
|
+
<div
|
|
146
|
+
key={level}
|
|
147
|
+
className="rounded-md border border-border-default bg-surface-2 p-sp-4"
|
|
148
|
+
>
|
|
149
|
+
<div className="text-display text-text-primary">{count}</div>
|
|
150
|
+
<div className="mt-1">
|
|
151
|
+
<TrustBadge trust={level} />
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
))}
|
|
155
|
+
{uncheckedReturns > 0 && (
|
|
156
|
+
<div className="rounded-md border border-[var(--critical)]/30 bg-[var(--critical)]/5 p-sp-4">
|
|
157
|
+
<div className="text-display text-[var(--critical)]">{uncheckedReturns}</div>
|
|
158
|
+
<div className="mt-1 text-caption text-[var(--critical)]/70">Unchecked returns</div>
|
|
159
|
+
</div>
|
|
160
|
+
)}
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
<FilterableTable
|
|
164
|
+
columns={columns}
|
|
165
|
+
data={rows}
|
|
166
|
+
defaultOpen={true}
|
|
167
|
+
/>
|
|
168
|
+
</div>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { readJsonFile } from '@/lib/data';
|
|
2
|
+
import { NotYetGenerated } from '@/components/NotYetGenerated';
|
|
3
|
+
import { CallsClient } from './CallsClient';
|
|
4
|
+
|
|
5
|
+
interface ConfidenceValue {
|
|
6
|
+
value: boolean | string;
|
|
7
|
+
confidence: string;
|
|
8
|
+
derived_from: string;
|
|
9
|
+
reasoning?: string;
|
|
10
|
+
warnings?: string[];
|
|
11
|
+
guard_type?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface Evidence {
|
|
15
|
+
file: string;
|
|
16
|
+
line_start: number;
|
|
17
|
+
line_end: number;
|
|
18
|
+
snippet?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface ExternalCall {
|
|
22
|
+
contract: string;
|
|
23
|
+
function: string;
|
|
24
|
+
evidence: Evidence;
|
|
25
|
+
target: string;
|
|
26
|
+
method: string;
|
|
27
|
+
return_checked: ConfidenceValue;
|
|
28
|
+
inside_reentrancy_guard: ConfidenceValue;
|
|
29
|
+
call_type: string;
|
|
30
|
+
trust_level: ConfidenceValue;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface ExternalCalls {
|
|
34
|
+
calls: ExternalCall[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default function CallsPage() {
|
|
38
|
+
const data = readJsonFile<ExternalCalls>('external-calls.json');
|
|
39
|
+
|
|
40
|
+
if (!data) {
|
|
41
|
+
return (
|
|
42
|
+
<div>
|
|
43
|
+
<h2 className="mb-sp-5 text-title font-semibold text-text-primary">External Calls</h2>
|
|
44
|
+
<NotYetGenerated command="hex calls" />
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return <CallsClient calls={data.calls} />;
|
|
50
|
+
}
|