auramaxx 0.0.20 → 0.1.1
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/README.md +92 -53
- package/bin/auramaxx.js +114 -92
- package/package.json +18 -94
- package/src/server/cli/commands/create.ts +20 -24
- package/src/server/cli/commands/onboard.ts +18 -2
- package/src/server/cli/commands/play.ts +303 -34
- package/src/server/cli/lib/theme.ts +58 -0
- package/.next/BUILD_ID +0 -1
- package/.next/app-build-manifest.json +0 -303
- package/.next/app-path-routes-manifest.json +0 -38
- package/.next/build-manifest.json +0 -33
- package/.next/diagnostics/build-diagnostics.json +0 -6
- package/.next/diagnostics/framework.json +0 -1
- package/.next/export-marker.json +0 -6
- package/.next/images-manifest.json +0 -58
- package/.next/next-minimal-server.js.nft.json +0 -1
- package/.next/next-server.js.nft.json +0 -1
- package/.next/package.json +0 -1
- package/.next/prerender-manifest.json +0 -292
- package/.next/react-loadable-manifest.json +0 -80
- package/.next/required-server-files.json +0 -330
- package/.next/routes-manifest.json +0 -209
- package/.next/server/app/_not-found/page.js +0 -2
- package/.next/server/app/_not-found/page.js.nft.json +0 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +0 -1
- package/.next/server/app/_not-found.html +0 -1
- package/.next/server/app/_not-found.meta +0 -8
- package/.next/server/app/_not-found.rsc +0 -19
- package/.next/server/app/api/[...doc]/page.js +0 -2
- package/.next/server/app/api/[...doc]/page.js.nft.json +0 -1
- package/.next/server/app/api/[...doc]/page_client-reference-manifest.js +0 -1
- package/.next/server/app/api/agent-requests/route.js +0 -1
- package/.next/server/app/api/agent-requests/route.js.nft.json +0 -1
- package/.next/server/app/api/agent-requests/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/apps/install/route.js +0 -25
- package/.next/server/app/api/apps/install/route.js.nft.json +0 -1
- package/.next/server/app/api/apps/install/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/apps/manifests/route.js +0 -1
- package/.next/server/app/api/apps/manifests/route.js.nft.json +0 -1
- package/.next/server/app/api/apps/manifests/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/apps/static/[...path]/route.js +0 -1
- package/.next/server/app/api/apps/static/[...path]/route.js.nft.json +0 -1
- package/.next/server/app/api/apps/static/[...path]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/docs/plain/route.js +0 -4
- package/.next/server/app/api/docs/plain/route.js.nft.json +0 -1
- package/.next/server/app/api/docs/plain/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/events/route.js +0 -1
- package/.next/server/app/api/events/route.js.nft.json +0 -1
- package/.next/server/app/api/events/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/import-from-openclaw/[channel]/route.js +0 -1
- package/.next/server/app/api/import-from-openclaw/[channel]/route.js.nft.json +0 -1
- package/.next/server/app/api/import-from-openclaw/[channel]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/import-from-openclaw/route.js +0 -1
- package/.next/server/app/api/import-from-openclaw/route.js.nft.json +0 -1
- package/.next/server/app/api/import-from-openclaw/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/import-from-openclaw/validate/[channel]/route.js +0 -1
- package/.next/server/app/api/import-from-openclaw/validate/[channel]/route.js.nft.json +0 -1
- package/.next/server/app/api/import-from-openclaw/validate/[channel]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/page.js +0 -2
- package/.next/server/app/api/page.js.nft.json +0 -1
- package/.next/server/app/api/page_client-reference-manifest.js +0 -1
- package/.next/server/app/api/restart/route.js +0 -57
- package/.next/server/app/api/restart/route.js.nft.json +0 -1
- package/.next/server/app/api/restart/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/update/route.js +0 -94
- package/.next/server/app/api/update/route.js.nft.json +0 -1
- package/.next/server/app/api/update/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/version/route.js +0 -1
- package/.next/server/app/api/version/route.js.nft.json +0 -1
- package/.next/server/app/api/version/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/workspace/[id]/apps/[wid]/route.js +0 -1
- package/.next/server/app/api/workspace/[id]/apps/[wid]/route.js.nft.json +0 -1
- package/.next/server/app/api/workspace/[id]/apps/[wid]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/workspace/[id]/apps/route.js +0 -1
- package/.next/server/app/api/workspace/[id]/apps/route.js.nft.json +0 -1
- package/.next/server/app/api/workspace/[id]/apps/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/workspace/[id]/export/route.js +0 -1
- package/.next/server/app/api/workspace/[id]/export/route.js.nft.json +0 -1
- package/.next/server/app/api/workspace/[id]/export/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/workspace/[id]/route.js +0 -1
- package/.next/server/app/api/workspace/[id]/route.js.nft.json +0 -1
- package/.next/server/app/api/workspace/[id]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/workspace/config/route.js +0 -1
- package/.next/server/app/api/workspace/config/route.js.nft.json +0 -1
- package/.next/server/app/api/workspace/config/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/workspace/import/route.js +0 -1
- package/.next/server/app/api/workspace/import/route.js.nft.json +0 -1
- package/.next/server/app/api/workspace/import/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/workspace/route.js +0 -1
- package/.next/server/app/api/workspace/route.js.nft.json +0 -1
- package/.next/server/app/api/workspace/route_client-reference-manifest.js +0 -1
- package/.next/server/app/app-legacy-do-not-use/page.js +0 -17
- package/.next/server/app/app-legacy-do-not-use/page.js.nft.json +0 -1
- package/.next/server/app/app-legacy-do-not-use/page_client-reference-manifest.js +0 -1
- package/.next/server/app/app-legacy-do-not-use.html +0 -1
- package/.next/server/app/app-legacy-do-not-use.meta +0 -7
- package/.next/server/app/app-legacy-do-not-use.rsc +0 -23
- package/.next/server/app/apple-icon.png/route.js +0 -1
- package/.next/server/app/apple-icon.png/route.js.nft.json +0 -1
- package/.next/server/app/apple-icon.png.body +0 -0
- package/.next/server/app/apple-icon.png.meta +0 -1
- package/.next/server/app/approve/[actionId]/page.js +0 -2
- package/.next/server/app/approve/[actionId]/page.js.nft.json +0 -1
- package/.next/server/app/approve/[actionId]/page_client-reference-manifest.js +0 -1
- package/.next/server/app/docs/[...doc]/page.js +0 -2
- package/.next/server/app/docs/[...doc]/page.js.nft.json +0 -1
- package/.next/server/app/docs/[...doc]/page_client-reference-manifest.js +0 -1
- package/.next/server/app/docs/page.js +0 -2
- package/.next/server/app/docs/page.js.nft.json +0 -1
- package/.next/server/app/docs/page_client-reference-manifest.js +0 -1
- package/.next/server/app/favicon.ico/route.js +0 -1
- package/.next/server/app/favicon.ico/route.js.nft.json +0 -1
- package/.next/server/app/favicon.ico.body +0 -0
- package/.next/server/app/favicon.ico.meta +0 -1
- package/.next/server/app/health/page.js +0 -2
- package/.next/server/app/health/page.js.nft.json +0 -1
- package/.next/server/app/health/page_client-reference-manifest.js +0 -1
- package/.next/server/app/health.html +0 -1
- package/.next/server/app/health.meta +0 -7
- package/.next/server/app/health.rsc +0 -20
- package/.next/server/app/hello/page.js +0 -2
- package/.next/server/app/hello/page.js.nft.json +0 -1
- package/.next/server/app/hello/page_client-reference-manifest.js +0 -1
- package/.next/server/app/hello.html +0 -1
- package/.next/server/app/hello.meta +0 -7
- package/.next/server/app/hello.rsc +0 -23
- package/.next/server/app/icon.png/route.js +0 -1
- package/.next/server/app/icon.png/route.js.nft.json +0 -1
- package/.next/server/app/icon.png.body +0 -0
- package/.next/server/app/icon.png.meta +0 -1
- package/.next/server/app/index.html +0 -1
- package/.next/server/app/index.meta +0 -7
- package/.next/server/app/index.rsc +0 -20
- package/.next/server/app/page.js +0 -14
- package/.next/server/app/page.js.nft.json +0 -1
- package/.next/server/app/page_client-reference-manifest.js +0 -1
- package/.next/server/app/privacy/page.js +0 -2
- package/.next/server/app/privacy/page.js.nft.json +0 -1
- package/.next/server/app/privacy/page_client-reference-manifest.js +0 -1
- package/.next/server/app/privacy.html +0 -1
- package/.next/server/app/privacy.meta +0 -7
- package/.next/server/app/privacy.rsc +0 -24
- package/.next/server/app/share/[token]/page.js +0 -2
- package/.next/server/app/share/[token]/page.js.nft.json +0 -1
- package/.next/server/app/share/[token]/page_client-reference-manifest.js +0 -1
- package/.next/server/app/terms/page.js +0 -2
- package/.next/server/app/terms/page.js.nft.json +0 -1
- package/.next/server/app/terms/page_client-reference-manifest.js +0 -1
- package/.next/server/app/terms.html +0 -1
- package/.next/server/app/terms.meta +0 -7
- package/.next/server/app/terms.rsc +0 -24
- package/.next/server/app/yo/page.js +0 -2
- package/.next/server/app/yo/page.js.nft.json +0 -1
- package/.next/server/app/yo/page_client-reference-manifest.js +0 -1
- package/.next/server/app/yo.html +0 -1
- package/.next/server/app/yo.meta +0 -7
- package/.next/server/app/yo.rsc +0 -23
- package/.next/server/app-paths-manifest.json +0 -38
- package/.next/server/chunks/1194.js +0 -4
- package/.next/server/chunks/1196.js +0 -1
- package/.next/server/chunks/1331.js +0 -22
- package/.next/server/chunks/1503.js +0 -2
- package/.next/server/chunks/1644.js +0 -1
- package/.next/server/chunks/1692.js +0 -1
- package/.next/server/chunks/2123.js +0 -59
- package/.next/server/chunks/2145.js +0 -1
- package/.next/server/chunks/2234.js +0 -1
- package/.next/server/chunks/2269.js +0 -1
- package/.next/server/chunks/2395.js +0 -9
- package/.next/server/chunks/2945.js +0 -1
- package/.next/server/chunks/335.js +0 -1
- package/.next/server/chunks/372.js +0 -1
- package/.next/server/chunks/4224.js +0 -1
- package/.next/server/chunks/4337.js +0 -1
- package/.next/server/chunks/4600.js +0 -1
- package/.next/server/chunks/4697.js +0 -1
- package/.next/server/chunks/5347.js +0 -1
- package/.next/server/chunks/5482.js +0 -1
- package/.next/server/chunks/5611.js +0 -6
- package/.next/server/chunks/5678.js +0 -4
- package/.next/server/chunks/5784.js +0 -1
- package/.next/server/chunks/5991.js +0 -7
- package/.next/server/chunks/6086.js +0 -2
- package/.next/server/chunks/6470.js +0 -1
- package/.next/server/chunks/6572.js +0 -59
- package/.next/server/chunks/7585.js +0 -1
- package/.next/server/chunks/7935.js +0 -101
- package/.next/server/chunks/8011.js +0 -1
- package/.next/server/chunks/8468.js +0 -1
- package/.next/server/chunks/9323.js +0 -8
- package/.next/server/chunks/9971.js +0 -1
- package/.next/server/functions-config-manifest.json +0 -8
- package/.next/server/instrumentation.js +0 -1
- package/.next/server/instrumentation.js.nft.json +0 -1
- package/.next/server/interception-route-rewrite-manifest.js +0 -1
- package/.next/server/middleware-build-manifest.js +0 -1
- package/.next/server/middleware-manifest.json +0 -6
- package/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/.next/server/next-font-manifest.js +0 -1
- package/.next/server/next-font-manifest.json +0 -1
- package/.next/server/pages/404.html +0 -1
- package/.next/server/pages/500.html +0 -1
- package/.next/server/pages/_app.js +0 -1
- package/.next/server/pages/_app.js.nft.json +0 -1
- package/.next/server/pages/_document.js +0 -1
- package/.next/server/pages/_document.js.nft.json +0 -1
- package/.next/server/pages/_error.js +0 -19
- package/.next/server/pages/_error.js.nft.json +0 -1
- package/.next/server/pages-manifest.json +0 -6
- package/.next/server/server-reference-manifest.js +0 -1
- package/.next/server/server-reference-manifest.json +0 -1
- package/.next/server/webpack-runtime.js +0 -1
- package/.next/static/chunks/1168.bb1c93965872e980.js +0 -1
- package/.next/static/chunks/1255-7999eac54f80a49f.js +0 -1
- package/.next/static/chunks/142-fa9752f53a551f63.js +0 -1
- package/.next/static/chunks/2505.d54ccadc42f4e3d1.js +0 -1
- package/.next/static/chunks/2619-04bc32f026a0d946.js +0 -1
- package/.next/static/chunks/2891-bf010357841c9ce9.js +0 -1
- package/.next/static/chunks/2927.3976471e61df966e.js +0 -1
- package/.next/static/chunks/3573-667bc4c8f56afcff.js +0 -1
- package/.next/static/chunks/3609.ded5a5306e18af9c.js +0 -1
- package/.next/static/chunks/3826.a73d4a88d8c09030.js +0 -1
- package/.next/static/chunks/3a91511d-da2c74cad6c6fc33.js +0 -7
- package/.next/static/chunks/4114-a375178fd94c4d8a.js +0 -1
- package/.next/static/chunks/4256.aa831e4d8c3f65bc.js +0 -1
- package/.next/static/chunks/4901-ba6a32818662e70a.js +0 -1
- package/.next/static/chunks/4919-0e698cd95504e355.js +0 -1
- package/.next/static/chunks/4bd1b696-100b9d70ed4e49c1.js +0 -1
- package/.next/static/chunks/5336-b775f449d7433604.js +0 -1
- package/.next/static/chunks/5362-2e8fcdd0bc6273ca.js +0 -59
- package/.next/static/chunks/6233-97a810aa272af547.js +0 -1
- package/.next/static/chunks/626.a5109d16f9eca1f6.js +0 -1
- package/.next/static/chunks/67-cb9bbb430499e803.js +0 -1
- package/.next/static/chunks/7616-1129bcb3eee8d315.js +0 -1
- package/.next/static/chunks/786-26deffb41572cbb3.js +0 -1
- package/.next/static/chunks/8273-3b9d882c5dd6a9a8.js +0 -1
- package/.next/static/chunks/8291-8f6fb6554e692552.js +0 -1
- package/.next/static/chunks/8357.5dee1e0c4e5bb091.js +0 -1
- package/.next/static/chunks/8370-6537b6b27df58b23.js +0 -1
- package/.next/static/chunks/9062-2bc2d089f9c9c6ba.js +0 -1
- package/.next/static/chunks/9380.f198afbf0c6b5369.js +0 -1
- package/.next/static/chunks/app/_not-found/page-5a8c6a29f762fa58.js +0 -1
- package/.next/static/chunks/app/api/[...doc]/page-f0852f35f0fd1d44.js +0 -1
- package/.next/static/chunks/app/api/agent-requests/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/apps/install/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/apps/manifests/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/apps/static/[...path]/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/docs/plain/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/events/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/import-from-openclaw/[channel]/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/import-from-openclaw/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/import-from-openclaw/validate/[channel]/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/page-cc59bebcc0d2c01d.js +0 -1
- package/.next/static/chunks/app/api/restart/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/update/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/version/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/workspace/[id]/apps/[wid]/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/workspace/[id]/apps/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/workspace/[id]/export/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/workspace/[id]/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/workspace/config/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/workspace/import/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/api/workspace/route-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/app-legacy-do-not-use/page-efa348da049c5873.js +0 -1
- package/.next/static/chunks/app/approve/[actionId]/page-c862645e19371cea.js +0 -1
- package/.next/static/chunks/app/docs/[...doc]/page-8e2a2d036caab242.js +0 -1
- package/.next/static/chunks/app/docs/page-acf872a03ff79893.js +0 -1
- package/.next/static/chunks/app/error-04a18fd49a89ee17.js +0 -1
- package/.next/static/chunks/app/health/page-c9185854ed9c86d0.js +0 -1
- package/.next/static/chunks/app/hello/page-74c9f4deaa4b03dd.js +0 -1
- package/.next/static/chunks/app/layout-7093dda0d106f34d.js +0 -1
- package/.next/static/chunks/app/page-0ec7cf48550f71e6.js +0 -1
- package/.next/static/chunks/app/privacy/page-8e2d17079355c2cc.js +0 -1
- package/.next/static/chunks/app/share/[token]/page-5dd9b0418eee411f.js +0 -1
- package/.next/static/chunks/app/terms/page-8e2d17079355c2cc.js +0 -1
- package/.next/static/chunks/app/yo/layout-cf84f975aad4c719.js +0 -1
- package/.next/static/chunks/app/yo/page-48930746b135037e.js +0 -1
- package/.next/static/chunks/framework-a32a2a465584c0bc.js +0 -1
- package/.next/static/chunks/main-0f0f9142f74e7215.js +0 -1
- package/.next/static/chunks/main-app-24f0c92ba10af457.js +0 -1
- package/.next/static/chunks/pages/_app-4b3fb5e477a0267f.js +0 -1
- package/.next/static/chunks/pages/_error-c970d8b55ace1b48.js +0 -1
- package/.next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
- package/.next/static/chunks/webpack-15ec0114c9d658c2.js +0 -1
- package/.next/static/css/35991998d1b5eff0.css +0 -3
- package/.next/static/q3rrQEmg9jZ5Lt-BCTiTK/_buildManifest.js +0 -1
- package/.next/static/q3rrQEmg9jZ5Lt-BCTiTK/_ssgManifest.js +0 -1
- package/.next/trace +0 -28
- package/.next/types/app/api/[...doc]/page.ts +0 -84
- package/.next/types/app/api/agent-requests/route.ts +0 -347
- package/.next/types/app/api/apps/install/route.ts +0 -347
- package/.next/types/app/api/apps/manifests/route.ts +0 -347
- package/.next/types/app/api/apps/static/[...path]/route.ts +0 -347
- package/.next/types/app/api/docs/plain/route.ts +0 -347
- package/.next/types/app/api/events/route.ts +0 -347
- package/.next/types/app/api/import-from-openclaw/[channel]/route.ts +0 -347
- package/.next/types/app/api/import-from-openclaw/route.ts +0 -347
- package/.next/types/app/api/import-from-openclaw/validate/[channel]/route.ts +0 -347
- package/.next/types/app/api/restart/route.ts +0 -347
- package/.next/types/app/api/update/route.ts +0 -347
- package/.next/types/app/api/version/route.ts +0 -347
- package/.next/types/app/api/workspace/[id]/apps/[wid]/route.ts +0 -347
- package/.next/types/app/api/workspace/[id]/apps/route.ts +0 -347
- package/.next/types/app/api/workspace/[id]/export/route.ts +0 -347
- package/.next/types/app/api/workspace/[id]/route.ts +0 -347
- package/.next/types/app/api/workspace/config/route.ts +0 -347
- package/.next/types/app/api/workspace/import/route.ts +0 -347
- package/.next/types/app/api/workspace/route.ts +0 -347
- package/.next/types/app/app-legacy-do-not-use/page.ts +0 -84
- package/.next/types/app/approve/[actionId]/page.ts +0 -84
- package/.next/types/app/docs/[...doc]/page.ts +0 -84
- package/.next/types/app/docs/page.ts +0 -84
- package/.next/types/app/health/page.ts +0 -84
- package/.next/types/app/hello/page.ts +0 -84
- package/.next/types/app/page.ts +0 -84
- package/.next/types/app/privacy/page.ts +0 -84
- package/.next/types/app/share/[token]/page.ts +0 -84
- package/.next/types/app/terms/page.ts +0 -84
- package/.next/types/app/yo/layout.ts +0 -84
- package/.next/types/app/yo/page.ts +0 -84
- package/.next/types/cache-life.d.ts +0 -141
- package/.next/types/package.json +0 -1
- package/.next/types/routes.d.ts +0 -105
- package/.next/types/validator.ts +0 -358
- package/apps/desktop-electron/main.js +0 -428
- package/docs/README.md +0 -38
- package/docs/ai-agents-workflow/API.md +0 -127
- package/docs/ai-agents-workflow/AUTH.md +0 -460
- package/docs/ai-agents-workflow/BEST-PRACTICES.md +0 -82
- package/docs/ai-agents-workflow/CLI.md +0 -189
- package/docs/ai-agents-workflow/MCP.md +0 -223
- package/docs/ai-agents-workflow/POLICY.md +0 -194
- package/docs/ai-agents-workflow/SKILLS.md +0 -135
- package/docs/ai-agents-workflow/credentials.md +0 -122
- package/docs/api/authentication.md +0 -80
- package/docs/api/secrets/api-keys.md +0 -28
- package/docs/api/secrets/credentials.md +0 -88
- package/docs/api/secrets/sharing.md +0 -48
- package/docs/api/system.md +0 -42
- package/docs/api/wallets/apps-strategies.md +0 -66
- package/docs/api/wallets/core.md +0 -46
- package/docs/api/wallets/data-portfolio.md +0 -42
- package/docs/how-to-auramaxx/TROUBLESHOOTING.md +0 -477
- package/docs/how-to-auramaxx/WORKING_WITH_SECRETS.md +0 -96
- package/docs/how-to-auramaxx/share-secret.md +0 -74
- package/docs/legacy/ADAPTERS.md +0 -471
- package/docs/legacy/APPS.md +0 -199
- package/docs/legacy/DESKTOP_ELECTRON.md +0 -26
- package/docs/legacy/DEVELOPING-APPS.md +0 -453
- package/docs/legacy/PACKAGING_POLICY.md +0 -19
- package/docs/legacy/PERMISSION.md +0 -138
- package/docs/legacy/PROTOCOL.md +0 -142
- package/docs/legacy/README.md +0 -21
- package/docs/legacy/WORKSPACE.md +0 -673
- package/docs/legacy/agent-auth.md +0 -13
- package/docs/legacy/aura-file.md +0 -48
- package/docs/legacy/external/HOW_TO_AURAMAXX/README.md +0 -45
- package/docs/legacy/external/README.md +0 -7
- package/docs/legacy/external/getting-started.md +0 -10
- package/docs/legacy/external/overview.md +0 -19
- package/docs/legacy/external/persona-paths.md +0 -7
- package/docs/legacy/external/why-aura.md +0 -7
- package/docs/legacy/specs/README.md +0 -6
- package/docs/legacy/specs/aura-open-protocol.md +0 -61
- package/docs/legacy/specs/aura-provider-plugin.md +0 -24
- package/docs/legacy/specs/aura-registry-model.md +0 -31
- package/docs/legacy/specs/fixtures/invalid-bad-key.aura +0 -1
- package/docs/legacy/specs/fixtures/invalid-bad-unicode-escape.aura +0 -1
- package/docs/legacy/specs/fixtures/invalid-duplicate-key.aura +0 -2
- package/docs/legacy/specs/fixtures/valid-basic.aura +0 -4
- package/docs/legacy/specs/fixtures/valid-provider-ref.aura +0 -1
- package/docs/legacy/specs/fixtures/valid-quoted-escapes.aura +0 -2
- package/docs/legacy/specs/task-256-create-edit-ui.md +0 -65
- package/docs/legacy/templates/README.md +0 -3
- package/docs/legacy/templates/RELEASE_NOTES_TEMPLATE.md +0 -22
- package/docs/legacy/wallet/AI.md +0 -508
- package/docs/legacy/wallet/DEVELOPING-STRATEGIES.md +0 -713
- package/docs/legacy/wallet/README.md +0 -47
- package/docs/legacy/wallet/STRATEGY.md +0 -89
- package/docs/quickstart/AGENT_SETUP.md +0 -181
- package/docs/why-auramaxx/ARCHITECTURE.md +0 -248
- package/docs/why-auramaxx/FEATURES.md +0 -117
- package/docs/why-auramaxx/security.md +0 -362
- package/next.config.ts +0 -38
- package/postcss.config.mjs +0 -8
- package/prisma/migrations/20260214170000_baseline/migration.sql +0 -511
- package/prisma/migrations/20260216214537_add_passkey_model/migration.sql +0 -18
- package/prisma/migrations/20260217150500_add_credential_access_audit/migration.sql +0 -31
- package/prisma/migrations/20260222090000_update_admin_ttl_default/migration.sql +0 -10
- package/prisma/migrations/20260227214000_update_agent_action_ttl_defaults/migration.sql +0 -19
- package/prisma/migrations/20260301225214_social_tables/migration.sql +0 -81
- package/prisma/migrations/20260302120000_add_notification_hash/migration.sql +0 -8
- package/prisma/migrations/20260302160000_add_public_key_hex/migration.sql +0 -5
- package/prisma/migrations/20260302170000_add_inbound_author_public_key/migration.sql +0 -5
- package/prisma/migrations/migration_lock.toml +0 -3
- package/prisma/schema.prisma +0 -542
- package/public/0a167e5e-4f52-4715-ae23-bf63d259a6b1.png +0 -0
- package/public/141ec92c-6780-4b23-838f-9a7bf1e91bb8.png +0 -0
- package/public/3afc4935-92cb-42af-9624-0b1341c12a5e.png +0 -0
- package/public/43947df5-dbcf-4e49-ab8b-41b9162c0410.png +0 -0
- package/public/5aeae9ce-0d38-49ea-8fd1-167892a04a85.png +0 -0
- package/public/660e4ea3-a3a6-4be4-a8ca-2cb74c51dfb5.png +0 -0
- package/public/733f02d7-6b58-4ba6-a5c8-d062cd205e1d.png +0 -0
- package/public/README.png +0 -0
- package/public/a32d65cb-95b0-4977-be6b-cf69f515afbe.png +0 -0
- package/public/agent1.png +0 -0
- package/public/agent10.png +0 -0
- package/public/agent2.png +0 -0
- package/public/agent3.png +0 -0
- package/public/agent4.png +0 -0
- package/public/agent5.png +0 -0
- package/public/agent6.png +0 -0
- package/public/agent7.png +0 -0
- package/public/agent8.png +0 -0
- package/public/agent9.png +0 -0
- package/public/c4938305-b811-4ccc-91db-94d309734827.png +0 -0
- package/public/f2ca6825-a4f3-4107-815c-51ee740dfc09.png +0 -0
- package/public/install.ps1 +0 -10
- package/public/install.sh +0 -11
- package/public/llm.txt +0 -2
- package/public/llms.txt +0 -39
- package/public/logo.webp +0 -0
- package/public/opengraph.webp +0 -0
- package/public/ss-dark1.png +0 -0
- package/public/ss-dark1.webp +0 -0
- package/public/ss-dark2.png +0 -0
- package/public/ss-dark2.webp +0 -0
- package/public/ss-dark3.png +0 -0
- package/public/ss-dark3.webp +0 -0
- package/public/ss-light1.png +0 -0
- package/public/ss-light1.webp +0 -0
- package/public/ss-light2.png +0 -0
- package/public/ss-light2.webp +0 -0
- package/public/ss-light3.png +0 -0
- package/public/ss-light3.webp +0 -0
- package/scripts/add-app.js +0 -245
- package/shared/credential-field-schema.ts +0 -270
- package/skills/auramaxx/HEARTBEAT.md +0 -97
- package/skills/auramaxx/SKILL.md +0 -136
- package/skills/auramaxx/docs/AGENT_SETUP.md +0 -160
- package/skills/auramaxx/docs/API.md +0 -127
- package/skills/auramaxx/docs/AUTH.md +0 -318
- package/skills/auramaxx/docs/CLI.md +0 -130
- package/skills/auramaxx/docs/MCP.md +0 -192
- package/skills/auramaxx/docs/TROUBLESHOOTING.md +0 -357
- package/skills/auramaxx/docs/WORKSPACE.md +0 -673
- package/skills/auramaxx/docs/security.md +0 -227
- package/skills/task-lifecycle/SKILL.md +0 -366
- package/src/app/UnlockPageClient.tsx +0 -2344
- package/src/app/api/[...doc]/page.tsx +0 -36
- package/src/app/api/agent-requests/route.ts +0 -30
- package/src/app/api/apps/install/route.ts +0 -132
- package/src/app/api/apps/manifests/route.ts +0 -16
- package/src/app/api/apps/static/[...path]/route.ts +0 -57
- package/src/app/api/docs/plain/route.ts +0 -74
- package/src/app/api/events/route.ts +0 -92
- package/src/app/api/import-from-openclaw/[channel]/route.ts +0 -62
- package/src/app/api/import-from-openclaw/lib.ts +0 -672
- package/src/app/api/import-from-openclaw/route.ts +0 -88
- package/src/app/api/import-from-openclaw/validate/[channel]/route.ts +0 -88
- package/src/app/api/page.tsx +0 -299
- package/src/app/api/restart/route.ts +0 -111
- package/src/app/api/update/route.ts +0 -268
- package/src/app/api/version/route.ts +0 -79
- package/src/app/api/workspace/[id]/apps/[wid]/route.ts +0 -119
- package/src/app/api/workspace/[id]/apps/route.ts +0 -81
- package/src/app/api/workspace/[id]/export/route.ts +0 -67
- package/src/app/api/workspace/[id]/route.ts +0 -168
- package/src/app/api/workspace/auth.ts +0 -40
- package/src/app/api/workspace/config/route.ts +0 -121
- package/src/app/api/workspace/import/route.ts +0 -127
- package/src/app/api/workspace/route.ts +0 -116
- package/src/app/app-legacy-do-not-use/page.tsx +0 -2247
- package/src/app/apple-icon.png +0 -0
- package/src/app/approve/[actionId]/page.tsx +0 -428
- package/src/app/docs/DocsPageContent.tsx +0 -283
- package/src/app/docs/[...doc]/page.tsx +0 -41
- package/src/app/docs/page.tsx +0 -38
- package/src/app/error.tsx +0 -125
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +0 -940
- package/src/app/health/page.tsx +0 -5
- package/src/app/hello/page.tsx +0 -102
- package/src/app/icon.png +0 -0
- package/src/app/layout.tsx +0 -40
- package/src/app/page.tsx +0 -38
- package/src/app/privacy/page.tsx +0 -63
- package/src/app/providers.tsx +0 -87
- package/src/app/share/[token]/page.tsx +0 -295
- package/src/app/terms/page.tsx +0 -80
- package/src/app/yo/layout.tsx +0 -38
- package/src/app/yo/page.tsx +0 -614
- package/src/components/AgentPicker.tsx +0 -278
- package/src/components/ChainSelector.tsx +0 -44
- package/src/components/CreateAgentModal.tsx +0 -192
- package/src/components/HumanActionBar.tsx +0 -865
- package/src/components/NotificationDrawer.tsx +0 -455
- package/src/components/PasskeyEnrollmentPrompt.tsx +0 -974
- package/src/components/UpdateBanner.tsx +0 -171
- package/src/components/agent/AgentSidebar.tsx +0 -921
- package/src/components/agent/ApiKeysConsole.tsx +0 -1272
- package/src/components/agent/AuditConsole.tsx +0 -600
- package/src/components/agent/CredentialAgent.tsx +0 -1718
- package/src/components/agent/CredentialDetail.tsx +0 -710
- package/src/components/agent/CredentialEmpty.tsx +0 -55
- package/src/components/agent/CredentialField.tsx +0 -594
- package/src/components/agent/CredentialForm.tsx +0 -1867
- package/src/components/agent/CredentialList.tsx +0 -299
- package/src/components/agent/CredentialRow.tsx +0 -138
- package/src/components/agent/CredentialShareModal.tsx +0 -285
- package/src/components/agent/CredentialWalletWidget.tsx +0 -103
- package/src/components/agent/DocsConsole.tsx +0 -113
- package/src/components/agent/ImportCredentialsModal.tsx +0 -578
- package/src/components/agent/LargeTypeModal.tsx +0 -88
- package/src/components/agent/PasswordGenerator.tsx +0 -232
- package/src/components/agent/TOTPDisplay.tsx +0 -108
- package/src/components/agent/TotpSetupPanel.tsx +0 -198
- package/src/components/agent/credentialDisplayName.ts +0 -42
- package/src/components/agent/credentialFormName.ts +0 -150
- package/src/components/agent/credentialListSort.ts +0 -56
- package/src/components/agent/hooks/useAgentKeyboardShortcuts.ts +0 -69
- package/src/components/agent/types.ts +0 -56
- package/src/components/agents/AgentsView.tsx +0 -1035
- package/src/components/apps/AgentKeysApp.tsx +0 -490
- package/src/components/apps/App.tsx +0 -153
- package/src/components/apps/AppGrid.tsx +0 -15
- package/src/components/apps/DetailedAddressDrawer.tsx +0 -325
- package/src/components/apps/DraggableApp.tsx +0 -562
- package/src/components/apps/IFrameApp.tsx +0 -73
- package/src/components/apps/LogsApp.tsx +0 -360
- package/src/components/apps/SendApp.tsx +0 -394
- package/src/components/apps/SetupWizardApp.tsx +0 -1004
- package/src/components/apps/SystemDefaultsApp.tsx +0 -845
- package/src/components/apps/ThirdPartyApp.tsx +0 -428
- package/src/components/apps/TokenApp.tsx +0 -319
- package/src/components/apps/TransactionsApp.tsx +0 -438
- package/src/components/apps/WalletDetailApp.tsx +0 -1505
- package/src/components/apps/index.ts +0 -13
- package/src/components/design-system/Button.tsx +0 -88
- package/src/components/design-system/ChainIndicator.tsx +0 -65
- package/src/components/design-system/ChainSelector.tsx +0 -147
- package/src/components/design-system/ConfirmationModal.tsx +0 -107
- package/src/components/design-system/ConfirmationPopover.tsx +0 -81
- package/src/components/design-system/DownloadButton.tsx +0 -149
- package/src/components/design-system/Drawer.tsx +0 -133
- package/src/components/design-system/FilterDropdown.tsx +0 -183
- package/src/components/design-system/ItemPicker.tsx +0 -157
- package/src/components/design-system/Modal.tsx +0 -314
- package/src/components/design-system/Popover.tsx +0 -142
- package/src/components/design-system/TextAreaInput.tsx +0 -78
- package/src/components/design-system/TextInput.tsx +0 -85
- package/src/components/design-system/Toggle.tsx +0 -65
- package/src/components/design-system/TyvekCollapsibleSection.tsx +0 -55
- package/src/components/design-system/index.ts +0 -15
- package/src/components/docs/ClientSideMarkdown.tsx +0 -51
- package/src/components/docs/DocsSearchBar.tsx +0 -118
- package/src/components/docs/DocsThemeToggle.tsx +0 -38
- package/src/components/docs/PersistentDocGroup.tsx +0 -91
- package/src/components/docs/ShareUrlButton.tsx +0 -33
- package/src/components/docs/SidebarScrollMemory.tsx +0 -56
- package/src/components/health/CredentialHealthDashboard.tsx +0 -214
- package/src/components/hub/HubView.tsx +0 -58
- package/src/components/icons/ChainIcons.tsx +0 -72
- package/src/components/layout/AppStoreDrawer.tsx +0 -369
- package/src/components/layout/ContentArea.tsx +0 -21
- package/src/components/layout/CreateViewModal.tsx +0 -88
- package/src/components/layout/LeftRail.tsx +0 -407
- package/src/components/layout/SettingsDrawer.tsx +0 -1200
- package/src/components/layout/TabBar.tsx +0 -284
- package/src/components/layout/ViewShell.tsx +0 -125
- package/src/components/layout/WalletSidebar.tsx +0 -1043
- package/src/components/layout/index.ts +0 -7
- package/src/components/marketing/AuraMaxxSpecOverlay.tsx +0 -653
- package/src/components/marketing/DeviceMorphExperience.tsx +0 -216
- package/src/components/social/PrimaryHubRegistrationGate.tsx +0 -260
- package/src/components/social/SocialView.tsx +0 -904
- package/src/context/AuthContext.tsx +0 -365
- package/src/context/PriceContext.tsx +0 -113
- package/src/context/ThemeContext.tsx +0 -164
- package/src/context/WebSocketContext.tsx +0 -269
- package/src/context/WorkspaceContext.tsx +0 -668
- package/src/hooks/index.ts +0 -4
- package/src/hooks/useAgentActions.ts +0 -552
- package/src/hooks/useBalance.ts +0 -103
- package/src/hooks/useBalances.ts +0 -129
- package/src/hooks/useSocialNotifications.ts +0 -123
- package/src/hooks/useTheme.ts +0 -156
- package/src/hooks/useUpdateChecker.ts +0 -245
- package/src/instrumentation.ts +0 -12
- package/src/lib/agent-crypto.ts +0 -129
- package/src/lib/api-docs.ts +0 -158
- package/src/lib/api.ts +0 -474
- package/src/lib/app-loader.ts +0 -148
- package/src/lib/app-registry.ts +0 -178
- package/src/lib/app-sdk.ts +0 -157
- package/src/lib/audit-console-adapter.ts +0 -151
- package/src/lib/auth-client.ts +0 -75
- package/src/lib/config.ts +0 -74
- package/src/lib/credential-field-schema.ts +0 -11
- package/src/lib/crypto.ts +0 -112
- package/src/lib/db.ts +0 -21
- package/src/lib/docs.ts +0 -617
- package/src/lib/events.ts +0 -372
- package/src/lib/markdown.ts +0 -39
- package/src/lib/pino.ts +0 -82
- package/src/lib/social-client.ts +0 -319
- package/src/lib/theme-handlers.ts +0 -168
- package/src/lib/theme.ts +0 -351
- package/src/lib/tokenData.ts +0 -378
- package/src/lib/totp-import.ts +0 -57
- package/src/lib/view-registry.ts +0 -75
- package/src/lib/websocket-server.ts +0 -302
- package/src/lib/websocket-setup.ts +0 -79
- package/src/lib/wordlist.ts +0 -2050
- package/src/lib/workspace-handlers.ts +0 -285
- package/src/server/abi/SwapHelper.json +0 -438
- package/src/server/cli/approval.ts +0 -447
- package/src/server/cli/commands/actions.ts +0 -469
- package/src/server/cli/commands/agent.ts +0 -1760
- package/src/server/cli/commands/api.ts +0 -181
- package/src/server/cli/commands/apikey.ts +0 -278
- package/src/server/cli/commands/app.ts +0 -204
- package/src/server/cli/commands/approve.ts +0 -209
- package/src/server/cli/commands/auth.ts +0 -885
- package/src/server/cli/commands/cron.ts +0 -24
- package/src/server/cli/commands/diary.ts +0 -273
- package/src/server/cli/commands/doctor.ts +0 -1267
- package/src/server/cli/commands/env.ts +0 -476
- package/src/server/cli/commands/experimental.ts +0 -69
- package/src/server/cli/commands/init.ts +0 -973
- package/src/server/cli/commands/lock.ts +0 -109
- package/src/server/cli/commands/mcp.ts +0 -285
- package/src/server/cli/commands/nuke.ts +0 -156
- package/src/server/cli/commands/quickhack.ts +0 -86
- package/src/server/cli/commands/register-agent.ts +0 -181
- package/src/server/cli/commands/release-check.ts +0 -231
- package/src/server/cli/commands/restart.ts +0 -61
- package/src/server/cli/commands/restore.ts +0 -314
- package/src/server/cli/commands/service.ts +0 -406
- package/src/server/cli/commands/shell-hook.ts +0 -512
- package/src/server/cli/commands/skill.ts +0 -280
- package/src/server/cli/commands/social.ts +0 -648
- package/src/server/cli/commands/start.ts +0 -260
- package/src/server/cli/commands/status.ts +0 -59
- package/src/server/cli/commands/stop.ts +0 -36
- package/src/server/cli/commands/token.ts +0 -180
- package/src/server/cli/commands/unlock.ts +0 -50
- package/src/server/cli/commands/wallet.ts +0 -210
- package/src/server/cli/index.ts +0 -285
- package/src/server/cli/lib/approval-actions.ts +0 -21
- package/src/server/cli/lib/approval-context.ts +0 -347
- package/src/server/cli/lib/approval-poll.ts +0 -142
- package/src/server/cli/lib/aura-parser.ts +0 -64
- package/src/server/cli/lib/auth-bootstrap.ts +0 -72
- package/src/server/cli/lib/credential-create.ts +0 -74
- package/src/server/cli/lib/credential-resolve.ts +0 -300
- package/src/server/cli/lib/dotenv-migrate.ts +0 -116
- package/src/server/cli/lib/dotenv-parser.ts +0 -146
- package/src/server/cli/lib/escalation.ts +0 -238
- package/src/server/cli/lib/http.ts +0 -105
- package/src/server/cli/lib/init-steps.ts +0 -76
- package/src/server/cli/lib/local-agent-trust.ts +0 -46
- package/src/server/cli/lib/lock-unlock-helper.ts +0 -71
- package/src/server/cli/lib/process.ts +0 -536
- package/src/server/cli/socket.ts +0 -583
- package/src/server/cli/transport-client.ts +0 -47
- package/src/server/cron/index.ts +0 -133
- package/src/server/cron/job.ts +0 -31
- package/src/server/cron/jobs/balance-sync.ts +0 -436
- package/src/server/cron/jobs/incoming-scan.ts +0 -506
- package/src/server/cron/jobs/native-price.ts +0 -70
- package/src/server/cron/jobs/orphan-cleanup.ts +0 -40
- package/src/server/cron/jobs/social-inbound.ts +0 -596
- package/src/server/cron/jobs/social-outbound.ts +0 -70
- package/src/server/cron/jobs/strategy-runner.ts +0 -175
- package/src/server/cron/scheduler.ts +0 -125
- package/src/server/index.ts +0 -438
- package/src/server/lib/adapters/delivery.ts +0 -508
- package/src/server/lib/adapters/discord.ts +0 -141
- package/src/server/lib/adapters/factory.ts +0 -123
- package/src/server/lib/adapters/index.ts +0 -21
- package/src/server/lib/adapters/router.ts +0 -297
- package/src/server/lib/adapters/telegram.ts +0 -646
- package/src/server/lib/adapters/types.ts +0 -89
- package/src/server/lib/adapters/webhook.ts +0 -95
- package/src/server/lib/adapters/whatsapp-native.ts +0 -276
- package/src/server/lib/adapters/whatsapp.ts +0 -904
- package/src/server/lib/address.ts +0 -49
- package/src/server/lib/agent-auth/contracts.ts +0 -1194
- package/src/server/lib/agent-profiles.ts +0 -430
- package/src/server/lib/ai.ts +0 -286
- package/src/server/lib/api-registry/contracts.ts +0 -86
- package/src/server/lib/api-registry/validation.ts +0 -172
- package/src/server/lib/apikey-migration.ts +0 -258
- package/src/server/lib/app-installer.ts +0 -505
- package/src/server/lib/app-tokens.ts +0 -247
- package/src/server/lib/approval-flow.ts +0 -139
- package/src/server/lib/approval-link.ts +0 -27
- package/src/server/lib/auth.ts +0 -324
- package/src/server/lib/auto-execute.ts +0 -160
- package/src/server/lib/batch.ts +0 -242
- package/src/server/lib/cold.ts +0 -1013
- package/src/server/lib/config.ts +0 -410
- package/src/server/lib/credential-access-audit.ts +0 -85
- package/src/server/lib/credential-access-policy.ts +0 -112
- package/src/server/lib/credential-agent.ts +0 -77
- package/src/server/lib/credential-health.ts +0 -343
- package/src/server/lib/credential-import.ts +0 -614
- package/src/server/lib/credential-scope.ts +0 -102
- package/src/server/lib/credential-shares.ts +0 -190
- package/src/server/lib/credential-transport.ts +0 -556
- package/src/server/lib/credentials.ts +0 -422
- package/src/server/lib/crypto.ts +0 -8
- package/src/server/lib/db.ts +0 -58
- package/src/server/lib/defaults.ts +0 -397
- package/src/server/lib/dex/index.ts +0 -80
- package/src/server/lib/dex/relay.ts +0 -235
- package/src/server/lib/dex/types.ts +0 -59
- package/src/server/lib/dex/uniswap.ts +0 -370
- package/src/server/lib/diary.ts +0 -61
- package/src/server/lib/dont-ask-again-policy.ts +0 -41
- package/src/server/lib/e2e-agent/artifacts.ts +0 -36
- package/src/server/lib/e2e-agent/contracts.ts +0 -112
- package/src/server/lib/e2e-agent/validation.ts +0 -135
- package/src/server/lib/encrypt.ts +0 -114
- package/src/server/lib/error.ts +0 -20
- package/src/server/lib/escalation-contract.ts +0 -140
- package/src/server/lib/escalation-error-codes.ts +0 -26
- package/src/server/lib/escalation-responder.ts +0 -729
- package/src/server/lib/escalation-route-registry.ts +0 -138
- package/src/server/lib/events.ts +0 -220
- package/src/server/lib/feature-flags.ts +0 -96
- package/src/server/lib/hot.ts +0 -357
- package/src/server/lib/hub-auth.ts +0 -159
- package/src/server/lib/human-action-summary.ts +0 -80
- package/src/server/lib/key-fingerprint.ts +0 -28
- package/src/server/lib/logger.ts +0 -340
- package/src/server/lib/migrate-agent-profiles.ts +0 -96
- package/src/server/lib/network.ts +0 -137
- package/src/server/lib/notifications.ts +0 -241
- package/src/server/lib/oauth2-refresh.ts +0 -241
- package/src/server/lib/oursecret.ts +0 -87
- package/src/server/lib/passkey-credential.ts +0 -360
- package/src/server/lib/passkey.ts +0 -68
- package/src/server/lib/permissions.ts +0 -340
- package/src/server/lib/pino.ts +0 -24
- package/src/server/lib/policy-preview.ts +0 -138
- package/src/server/lib/price.ts +0 -338
- package/src/server/lib/prices.ts +0 -34
- package/src/server/lib/project-scope.ts +0 -326
- package/src/server/lib/redaction.ts +0 -108
- package/src/server/lib/resolve-action.ts +0 -398
- package/src/server/lib/resolve.ts +0 -36
- package/src/server/lib/secret-env.ts +0 -18
- package/src/server/lib/secret-gist-share.ts +0 -296
- package/src/server/lib/sessions.ts +0 -634
- package/src/server/lib/social/create.ts +0 -176
- package/src/server/lib/social/global-aura-id.ts +0 -115
- package/src/server/lib/social/hub-rpc-client.ts +0 -99
- package/src/server/lib/social/hub-session.ts +0 -6
- package/src/server/lib/social/public-key.ts +0 -32
- package/src/server/lib/social/register.ts +0 -162
- package/src/server/lib/social/sign.ts +0 -95
- package/src/server/lib/social/sync.ts +0 -301
- package/src/server/lib/socket-path.ts +0 -76
- package/src/server/lib/solana/connection.ts +0 -26
- package/src/server/lib/solana/jupiter.ts +0 -128
- package/src/server/lib/solana/transfer.ts +0 -108
- package/src/server/lib/solana/wallet.ts +0 -136
- package/src/server/lib/strategy/emits.ts +0 -21
- package/src/server/lib/strategy/engine.ts +0 -1313
- package/src/server/lib/strategy/executor.ts +0 -115
- package/src/server/lib/strategy/hook-context.ts +0 -159
- package/src/server/lib/strategy/hooks.ts +0 -1023
- package/src/server/lib/strategy/index.ts +0 -28
- package/src/server/lib/strategy/installer.ts +0 -305
- package/src/server/lib/strategy/loader.ts +0 -256
- package/src/server/lib/strategy/message.ts +0 -237
- package/src/server/lib/strategy/repository.ts +0 -218
- package/src/server/lib/strategy/session-logger.ts +0 -693
- package/src/server/lib/strategy/sources.ts +0 -288
- package/src/server/lib/strategy/state.ts +0 -189
- package/src/server/lib/strategy/templates.ts +0 -403
- package/src/server/lib/strategy/tick.ts +0 -404
- package/src/server/lib/strategy/types.ts +0 -230
- package/src/server/lib/swap.ts +0 -3
- package/src/server/lib/temp-policy.ts +0 -413
- package/src/server/lib/temp.ts +0 -86
- package/src/server/lib/token-metadata.ts +0 -86
- package/src/server/lib/token-safety.ts +0 -200
- package/src/server/lib/token-search.ts +0 -444
- package/src/server/lib/totp.ts +0 -194
- package/src/server/lib/transactions.ts +0 -123
- package/src/server/lib/transport.ts +0 -84
- package/src/server/lib/txhistory/decoder.ts +0 -262
- package/src/server/lib/txhistory/enricher.ts +0 -652
- package/src/server/lib/txhistory/index.ts +0 -391
- package/src/server/lib/txhistory/signatures.ts +0 -59
- package/src/server/lib/update-check.ts +0 -48
- package/src/server/lib/verified-summary.ts +0 -414
- package/src/server/lib/version-check-cache.ts +0 -23
- package/src/server/lib/view-registry.ts +0 -80
- package/src/server/mcp/profile-policy.ts +0 -30
- package/src/server/mcp/server.ts +0 -2887
- package/src/server/mcp/tools.ts +0 -863
- package/src/server/middleware/auth.ts +0 -117
- package/src/server/middleware/requestLogger.ts +0 -86
- package/src/server/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/src/server/routes/actions.ts +0 -607
- package/src/server/routes/adapters.ts +0 -1256
- package/src/server/routes/addressbook.ts +0 -129
- package/src/server/routes/agent-hub.ts +0 -276
- package/src/server/routes/agent-profiles.ts +0 -208
- package/src/server/routes/ai.ts +0 -34
- package/src/server/routes/apikeys.ts +0 -344
- package/src/server/routes/apps.ts +0 -623
- package/src/server/routes/auth.ts +0 -740
- package/src/server/routes/backup.ts +0 -404
- package/src/server/routes/batch.ts +0 -270
- package/src/server/routes/bookmarks.ts +0 -178
- package/src/server/routes/credential-agents.ts +0 -159
- package/src/server/routes/credential-shares.ts +0 -380
- package/src/server/routes/credentials.ts +0 -2545
- package/src/server/routes/dashboard.ts +0 -97
- package/src/server/routes/defaults.ts +0 -124
- package/src/server/routes/flags.ts +0 -11
- package/src/server/routes/fund.ts +0 -252
- package/src/server/routes/heartbeat.ts +0 -511
- package/src/server/routes/import.ts +0 -359
- package/src/server/routes/launch.ts +0 -703
- package/src/server/routes/lock.ts +0 -54
- package/src/server/routes/logs.ts +0 -78
- package/src/server/routes/nuke.ts +0 -136
- package/src/server/routes/passkey-credentials.ts +0 -99
- package/src/server/routes/passkey.ts +0 -372
- package/src/server/routes/portfolio.ts +0 -217
- package/src/server/routes/price.ts +0 -63
- package/src/server/routes/resolve.ts +0 -31
- package/src/server/routes/security.ts +0 -45
- package/src/server/routes/send-evm.ts +0 -286
- package/src/server/routes/send-solana.ts +0 -315
- package/src/server/routes/send.ts +0 -178
- package/src/server/routes/setup.ts +0 -210
- package/src/server/routes/social.ts +0 -869
- package/src/server/routes/strategy.ts +0 -901
- package/src/server/routes/swap-evm.ts +0 -386
- package/src/server/routes/swap-solana.ts +0 -203
- package/src/server/routes/swap.ts +0 -372
- package/src/server/routes/token.ts +0 -248
- package/src/server/routes/unlock.ts +0 -507
- package/src/server/routes/verified-credentials.ts +0 -312
- package/src/server/routes/views.ts +0 -41
- package/src/server/routes/wallet-assets.ts +0 -364
- package/src/server/routes/wallet-transactions.ts +0 -517
- package/src/server/routes/wallet.ts +0 -711
- package/src/server/test-data/agent-primary.json +0 -12
- package/src/server/test-data/agent-smbe0i.json +0 -14
- package/src/server/test-data/agent-wbl0v6.json +0 -14
- package/src/server/test-data/config.json +0 -33
- package/src/server/test-data/credentials/cred-1sj0yr5a.json +0 -23
- package/src/server/test-data/credentials/cred-469oz33y.json +0 -19
- package/src/server/test-data/credentials/cred-6h2h6oh7.json +0 -23
- package/src/server/test-data/credentials/cred-invrd1h9.json +0 -22
- package/src/server/test-data/credentials-archive/cred-nd7pngdm.json +0 -22
- package/src/server/test-data/debug-worker/agent-3vovb2.json +0 -14
- package/src/server/test-data/debug-worker/agent-ppchyx.json +0 -14
- package/src/server/test-data/debug-worker/agent-primary.json +0 -12
- package/src/server/test-data/debug-worker/agent-tm8bce.json +0 -14
- package/src/server/test-data/debug-worker/credentials/cred-bawnen1r.json +0 -23
- package/src/server/test-data/debug-worker/credentials/cred-wkqqa5sn.json +0 -23
- package/src/server/test-data/debug-worker/test.db +0 -0
- package/src/server/test-data/template.db +0 -0
- package/src/server/test-data/worker-1/test.db +0 -0
- package/src/server/test-data/worker-10/test.db +0 -0
- package/src/server/test-data/worker-11/test.db +0 -0
- package/src/server/test-data/worker-12/test.db +0 -0
- package/src/server/test-data/worker-13/test.db +0 -0
- package/src/server/test-data/worker-14/test.db +0 -0
- package/src/server/test-data/worker-15/test.db +0 -0
- package/src/server/test-data/worker-2/test.db +0 -0
- package/src/server/test-data/worker-3/test.db +0 -0
- package/src/server/test-data/worker-4/test.db +0 -0
- package/src/server/test-data/worker-5/test.db +0 -0
- package/src/server/test-data/worker-6/test.db +0 -0
- package/src/server/test-data/worker-7/test.db +0 -0
- package/src/server/test-data/worker-8/test.db +0 -0
- package/src/server/test-data/worker-9/test.db +0 -0
- package/src/server/tests/ai-integration/harness.ts +0 -235
- package/src/server/tests/ai-integration/live-harness.ts +0 -248
- package/src/server/tests/ai-integration/live.test.ts +0 -394
- package/src/server/tests/ai-integration/prompts.md +0 -396
- package/src/server/tests/ai-integration/scenarios.test.ts +0 -593
- package/src/server/tests/ai-integration/vitest.config.ts +0 -29
- package/src/server/tests/ai-integration/vitest.live.config.ts +0 -30
- package/src/server/tests/app-installer.test.ts +0 -406
- package/src/server/tests/auth/apikeys-validate.test.ts +0 -326
- package/src/server/tests/auth/apikeys.test.ts +0 -352
- package/src/server/tests/auth/approval-permissions-regression.test.ts +0 -641
- package/src/server/tests/auth/middleware.test.ts +0 -236
- package/src/server/tests/auth/permissions.test.ts +0 -387
- package/src/server/tests/cli/actions-auth.test.ts +0 -87
- package/src/server/tests/cli/agent-auth.test.ts +0 -1682
- package/src/server/tests/cli/agent-list-filters.test.ts +0 -150
- package/src/server/tests/cli/agent-share-gist.test.ts +0 -203
- package/src/server/tests/cli/agent.test.ts +0 -206
- package/src/server/tests/cli/auth-action-flag.test.ts +0 -135
- package/src/server/tests/cli/bin-entrypoint.test.ts +0 -438
- package/src/server/tests/cli/create-command.test.ts +0 -73
- package/src/server/tests/cli/credential-resolve.test.ts +0 -86
- package/src/server/tests/cli/doctor.test.ts +0 -154
- package/src/server/tests/cli/env-check-server-agent.test.ts +0 -114
- package/src/server/tests/cli/env.test.ts +0 -107
- package/src/server/tests/cli/escalation.test.ts +0 -140
- package/src/server/tests/cli/http.test.ts +0 -176
- package/src/server/tests/cli/init-flow.test.ts +0 -209
- package/src/server/tests/cli/init-runtime.test.ts +0 -144
- package/src/server/tests/cli/init-steps.test.ts +0 -184
- package/src/server/tests/cli/local-agent-trust.test.ts +0 -92
- package/src/server/tests/cli/process.test.ts +0 -453
- package/src/server/tests/cli/prompt-select.test.ts +0 -129
- package/src/server/tests/cli/quickhack.test.ts +0 -27
- package/src/server/tests/cli/restart-run.test.ts +0 -75
- package/src/server/tests/cli/service.test.ts +0 -138
- package/src/server/tests/cli/social.test.ts +0 -83
- package/src/server/tests/cli/socket.test.ts +0 -324
- package/src/server/tests/cli/start-run.test.ts +0 -185
- package/src/server/tests/cli/start.test.ts +0 -44
- package/src/server/tests/cli/taskctl-lock-smoke.test.ts +0 -136
- package/src/server/tests/cli/token.test.ts +0 -61
- package/src/server/tests/cli/wallet.test.ts +0 -23
- package/src/server/tests/credential-import.test.ts +0 -362
- package/src/server/tests/cron/incoming-scan.test.ts +0 -778
- package/src/server/tests/cron/native-price.test.ts +0 -121
- package/src/server/tests/cron/orphan-cleanup.test.ts +0 -94
- package/src/server/tests/cron/scheduler.test.ts +0 -161
- package/src/server/tests/cron/social-inbound-followers.unit.test.ts +0 -164
- package/src/server/tests/cron/social-inbound-staleness.test.ts +0 -193
- package/src/server/tests/cron/social-outbound.test.ts +0 -252
- package/src/server/tests/cron/strategy-runner.test.ts +0 -158
- package/src/server/tests/docs/job-docs-validation.test.ts +0 -16
- package/src/server/tests/dotenv-parser.test.ts +0 -121
- package/src/server/tests/e2e-agent/artifacts.test.ts +0 -35
- package/src/server/tests/e2e-agent/ci/nightly-set.json +0 -7
- package/src/server/tests/e2e-agent/ci/pr-smoke-set.json +0 -5
- package/src/server/tests/e2e-agent/ci-lanes.test.ts +0 -16
- package/src/server/tests/e2e-agent/runner.ts +0 -43
- package/src/server/tests/e2e-agent/scenarios/aura-onboarding-sanity.scenario.yaml +0 -16
- package/src/server/tests/e2e-agent/scenarios/credential-create-basic.scenario.yaml +0 -12
- package/src/server/tests/e2e-agent/scenarios/credential-read-basic.scenario.yaml +0 -16
- package/src/server/tests/e2e-agent/scenarios/save-on-submit-accept.scenario.yaml +0 -10
- package/src/server/tests/e2e-agent/scenarios/totp-retrieval-seeded.scenario.yaml +0 -12
- package/src/server/tests/e2e-agent/validation.test.ts +0 -129
- package/src/server/tests/e2e.test.ts +0 -295
- package/src/server/tests/endpoints/actions.test.ts +0 -1067
- package/src/server/tests/endpoints/address-transactions.test.ts +0 -223
- package/src/server/tests/endpoints/addressbook.test.ts +0 -225
- package/src/server/tests/endpoints/agent-profiles.test.ts +0 -117
- package/src/server/tests/endpoints/agent.test.ts +0 -713
- package/src/server/tests/endpoints/approve-action.test.ts +0 -107
- package/src/server/tests/endpoints/apps.test.ts +0 -561
- package/src/server/tests/endpoints/auth.test.ts +0 -565
- package/src/server/tests/endpoints/batch.test.ts +0 -352
- package/src/server/tests/endpoints/bookmarks.test.ts +0 -329
- package/src/server/tests/endpoints/credential-access-audit.test.ts +0 -194
- package/src/server/tests/endpoints/credential-ops.test.ts +0 -93
- package/src/server/tests/endpoints/credential-shares.test.ts +0 -249
- package/src/server/tests/endpoints/credentials.test.ts +0 -1786
- package/src/server/tests/endpoints/defaults.test.ts +0 -162
- package/src/server/tests/endpoints/escalation-migration-gate.test.ts +0 -488
- package/src/server/tests/endpoints/fund.test.ts +0 -299
- package/src/server/tests/endpoints/heartbeat.test.ts +0 -274
- package/src/server/tests/endpoints/import.test.ts +0 -192
- package/src/server/tests/endpoints/launch.test.ts +0 -734
- package/src/server/tests/endpoints/passkey-credentials.test.ts +0 -167
- package/src/server/tests/endpoints/passkey.test.ts +0 -219
- package/src/server/tests/endpoints/portfolio.test.ts +0 -497
- package/src/server/tests/endpoints/price.test.ts +0 -237
- package/src/server/tests/endpoints/rate-limit.test.ts +0 -465
- package/src/server/tests/endpoints/send.test.ts +0 -499
- package/src/server/tests/endpoints/setup.test.ts +0 -194
- package/src/server/tests/endpoints/solana-fund.test.ts +0 -218
- package/src/server/tests/endpoints/solana-send.test.ts +0 -215
- package/src/server/tests/endpoints/solana-swap.test.ts +0 -280
- package/src/server/tests/endpoints/solana-wallet.test.ts +0 -223
- package/src/server/tests/endpoints/strategy-routes.test.ts +0 -602
- package/src/server/tests/endpoints/swap.test.ts +0 -589
- package/src/server/tests/endpoints/token-balance.test.ts +0 -227
- package/src/server/tests/endpoints/token-clearing.test.ts +0 -230
- package/src/server/tests/endpoints/token-safety.test.ts +0 -280
- package/src/server/tests/endpoints/token-search.test.ts +0 -186
- package/src/server/tests/endpoints/transactions.test.ts +0 -348
- package/src/server/tests/endpoints/unlock.test.ts +0 -385
- package/src/server/tests/endpoints/wallet-data.test.ts +0 -547
- package/src/server/tests/endpoints/wallet.test.ts +0 -755
- package/src/server/tests/globalSetup.ts +0 -62
- package/src/server/tests/helpers/amounts.ts +0 -14
- package/src/server/tests/integration/adapter-resolve.test.ts +0 -160
- package/src/server/tests/integration/agent-flow.test.ts +0 -477
- package/src/server/tests/lib/adapters-chat.test.ts +0 -259
- package/src/server/tests/lib/adapters-test.test.ts +0 -1196
- package/src/server/tests/lib/adapters.test.ts +0 -962
- package/src/server/tests/lib/address.test.ts +0 -96
- package/src/server/tests/lib/agent-auth/contracts.test.ts +0 -771
- package/src/server/tests/lib/agent-profiles.test.ts +0 -98
- package/src/server/tests/lib/ai.test.ts +0 -452
- package/src/server/tests/lib/api-registry/validation.test.ts +0 -174
- package/src/server/tests/lib/app-tokens-tier.test.ts +0 -106
- package/src/server/tests/lib/approval-link.test.ts +0 -20
- package/src/server/tests/lib/aura-parser.test.ts +0 -96
- package/src/server/tests/lib/auth-action.test.ts +0 -251
- package/src/server/tests/lib/auth.test.ts +0 -237
- package/src/server/tests/lib/auto-execute.test.ts +0 -269
- package/src/server/tests/lib/auto-unlock.test.ts +0 -47
- package/src/server/tests/lib/batch.test.ts +0 -363
- package/src/server/tests/lib/credential-access.test.ts +0 -244
- package/src/server/tests/lib/credential-agent.test.ts +0 -174
- package/src/server/tests/lib/credential-field-schema.test.ts +0 -448
- package/src/server/tests/lib/credential-health.test.ts +0 -110
- package/src/server/tests/lib/credential-paths.test.ts +0 -430
- package/src/server/tests/lib/credential-scope.test.ts +0 -163
- package/src/server/tests/lib/credential-transport.test.ts +0 -319
- package/src/server/tests/lib/credentials.test.ts +0 -249
- package/src/server/tests/lib/defaults.test.ts +0 -76
- package/src/server/tests/lib/diary.test.ts +0 -43
- package/src/server/tests/lib/dont-ask-again-policy.test.ts +0 -22
- package/src/server/tests/lib/encrypt.test.ts +0 -43
- package/src/server/tests/lib/escalation-responder.test.ts +0 -228
- package/src/server/tests/lib/events-decoder.test.ts +0 -286
- package/src/server/tests/lib/events-enricher.test.ts +0 -294
- package/src/server/tests/lib/events-fetcher.test.ts +0 -577
- package/src/server/tests/lib/human-action-summary.test.ts +0 -62
- package/src/server/tests/lib/network.test.ts +0 -280
- package/src/server/tests/lib/oauth2-refresh.test.ts +0 -140
- package/src/server/tests/lib/passkey-credential.test.ts +0 -153
- package/src/server/tests/lib/price.test.ts +0 -286
- package/src/server/tests/lib/prices.test.ts +0 -50
- package/src/server/tests/lib/profile-parity.test.ts +0 -50
- package/src/server/tests/lib/project-scope.test.ts +0 -242
- package/src/server/tests/lib/relay.test.ts +0 -464
- package/src/server/tests/lib/resolve-action.test.ts +0 -294
- package/src/server/tests/lib/secret-gist-share.test.ts +0 -58
- package/src/server/tests/lib/sessions-currency.test.ts +0 -215
- package/src/server/tests/lib/sessions.test.ts +0 -327
- package/src/server/tests/lib/social/create.test.ts +0 -207
- package/src/server/tests/lib/social/sign.test.ts +0 -163
- package/src/server/tests/lib/social/sync.test.ts +0 -198
- package/src/server/tests/lib/solana-wallet.test.ts +0 -143
- package/src/server/tests/lib/strategy/executor.test.ts +0 -363
- package/src/server/tests/lib/strategy/hooks.test.ts +0 -897
- package/src/server/tests/lib/strategy/loader.test.ts +0 -343
- package/src/server/tests/lib/strategy/message.test.ts +0 -416
- package/src/server/tests/lib/strategy/repository.test.ts +0 -84
- package/src/server/tests/lib/strategy/session-logger.test.ts +0 -467
- package/src/server/tests/lib/strategy/sources.test.ts +0 -503
- package/src/server/tests/lib/strategy/state.test.ts +0 -349
- package/src/server/tests/lib/strategy/tick.test.ts +0 -283
- package/src/server/tests/lib/temp-policy.test.ts +0 -184
- package/src/server/tests/lib/token-safety.test.ts +0 -277
- package/src/server/tests/lib/token-search.test.ts +0 -687
- package/src/server/tests/lib/totp.test.ts +0 -193
- package/src/server/tests/lib/uniswap.test.ts +0 -307
- package/src/server/tests/lib/update-check.test.ts +0 -27
- package/src/server/tests/lib/verified-summary.test.ts +0 -454
- package/src/server/tests/lib/websocket-auth.test.ts +0 -247
- package/src/server/tests/mcp/contract.test.ts +0 -318
- package/src/server/tests/mcp/profile-policy.test.ts +0 -178
- package/src/server/tests/mcp/server.test.ts +0 -3159
- package/src/server/tests/mcp/tools.test.ts +0 -518
- package/src/server/tests/resolve.test.ts +0 -81
- package/src/server/tests/runtime-agent-smoke.test.ts +0 -130
- package/src/server/tests/sandbox/cli-cd-suite.test.ts +0 -526
- package/src/server/tests/sandbox/cli.test.ts +0 -402
- package/src/server/tests/send-token.test.ts +0 -191
- package/src/server/tests/setup-integration/adapter-test.test.ts +0 -122
- package/src/server/tests/setup-integration/apikey-validation.test.ts +0 -118
- package/src/server/tests/setup-integration/autonomous-agent.test.ts +0 -243
- package/src/server/tests/setup-integration/edge-cases.test.ts +0 -115
- package/src/server/tests/setup-integration/fresh-setup.test.ts +0 -60
- package/src/server/tests/setup-integration/harness.ts +0 -296
- package/src/server/tests/setup-integration/onboarding-e2e.test.ts +0 -292
- package/src/server/tests/setup-integration/terminal-flow.test.ts +0 -201
- package/src/server/tests/setup-integration/vitest.config.ts +0 -29
- package/src/server/tests/setup-integration/wizard-flow.test.ts +0 -139
- package/src/server/tests/setup.ts +0 -351
- package/src/server/tests/swap-quote.test.ts +0 -279
- package/src/server/tests/test-data/agent-e1ica7.json +0 -14
- package/src/server/tests/test-data/agent-iaswp5.json +0 -14
- package/src/server/tests/test-data/agent-primary.json +0 -12
- package/src/server/tests/test-data/agent-qvn7eo.json +0 -14
- package/src/server/tests/test-data/agent-vqhtrt.json +0 -14
- package/src/server/tests/test-data/config.json +0 -33
- package/src/server/tests/test-data/test.db +0 -0
- package/src/server/tests/workerSetup.ts +0 -39
- package/src/server/tsconfig.json +0 -21
- package/src/server/tsconfig.tsbuildinfo +0 -1
- package/src/server/types.ts +0 -161
- package/start.sh +0 -170
- package/tailwind.config.ts +0 -99
- package/tsconfig.json +0 -52
|
@@ -1,2247 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import React, { useEffect, useState, Suspense } from 'react';
|
|
4
|
-
|
|
5
|
-
import { Shield, Flame, Plus, Send, Rocket, Copy, Loader2, Check, X, AlertTriangle, Trash2, Home as HomeIcon, KeyRound, Code, Database, RotateCcw, Lock, Settings, Bot } from 'lucide-react';
|
|
6
|
-
import { TextInput, Drawer, Modal, ConfirmationModal, Button, Popover, TyvekCollapsibleSection } from '@/components/design-system';
|
|
7
|
-
import { WalletSidebar, TabBar, WorkspaceTab, AppStoreDrawer, LeftRail, CreateViewModal } from '@/components/layout';
|
|
8
|
-
import { DEFAULT_VIEWS, SOCIAL_VIEW, getDefaultActiveViewId, type ViewDefinition } from '@/lib/view-registry';
|
|
9
|
-
import { DraggableApp, type AppColor } from '@/components/apps';
|
|
10
|
-
import { useAgentActions } from '@/hooks/useAgentActions';
|
|
11
|
-
import { HumanActionBar } from '@/components/HumanActionBar';
|
|
12
|
-
import { PasskeyEnrollmentPrompt } from '@/components/PasskeyEnrollmentPrompt';
|
|
13
|
-
import { useWorkspace, type AppState as WorkspaceAppState } from '@/context/WorkspaceContext';
|
|
14
|
-
import { useAuth, type ApiKey, type ChainConfig } from '@/context/AuthContext';
|
|
15
|
-
import { useWebSocket } from '@/context/WebSocketContext';
|
|
16
|
-
import { getAppDefinition } from '@/lib/app-registry';
|
|
17
|
-
import SystemDefaults, { AiEngineSection } from '@/components/apps/SystemDefaultsApp';
|
|
18
|
-
import { WALLET_EVENTS, WalletCreatedData } from '@/lib/events';
|
|
19
|
-
import { api, Api } from '@/lib/api';
|
|
20
|
-
|
|
21
|
-
// Known chains with Alchemy support - used for auto-fill when adding chains
|
|
22
|
-
const KNOWN_CHAINS: Record<string, { chainId: number; alchemyPath: string; explorer: string }> = {
|
|
23
|
-
base: { chainId: 8453, alchemyPath: 'base-mainnet', explorer: 'https://basescan.org' },
|
|
24
|
-
ethereum: { chainId: 1, alchemyPath: 'eth-mainnet', explorer: 'https://etherscan.io' },
|
|
25
|
-
arbitrum: { chainId: 42161, alchemyPath: 'arb-mainnet', explorer: 'https://arbiscan.io' },
|
|
26
|
-
optimism: { chainId: 10, alchemyPath: 'opt-mainnet', explorer: 'https://optimistic.etherscan.io' },
|
|
27
|
-
polygon: { chainId: 137, alchemyPath: 'polygon-mainnet', explorer: 'https://polygonscan.com' },
|
|
28
|
-
zksync: { chainId: 324, alchemyPath: 'zksync-mainnet', explorer: 'https://explorer.zksync.io' },
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
interface WalletData {
|
|
32
|
-
address: string;
|
|
33
|
-
tier: 'cold' | 'hot' | 'temp';
|
|
34
|
-
chain: string;
|
|
35
|
-
balance?: string;
|
|
36
|
-
label?: string;
|
|
37
|
-
spentToday?: number;
|
|
38
|
-
name?: string;
|
|
39
|
-
color?: string;
|
|
40
|
-
emoji?: string;
|
|
41
|
-
description?: string;
|
|
42
|
-
hidden?: boolean;
|
|
43
|
-
tokenHash?: string;
|
|
44
|
-
createdAt?: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
interface DashboardState {
|
|
48
|
-
configured: boolean;
|
|
49
|
-
isUnlocked: boolean;
|
|
50
|
-
wallets: WalletData[];
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
interface AppPosition {
|
|
54
|
-
x: number;
|
|
55
|
-
y: number;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export default function Home() {
|
|
59
|
-
const {
|
|
60
|
-
token,
|
|
61
|
-
apiKeys: authApiKeys,
|
|
62
|
-
apiKeysLoading: authApiKeysLoading,
|
|
63
|
-
refreshApiKeys,
|
|
64
|
-
getApiKey,
|
|
65
|
-
chainOverrides,
|
|
66
|
-
saveChainOverride,
|
|
67
|
-
removeChainOverride,
|
|
68
|
-
getConfiguredChains,
|
|
69
|
-
} = useAuth();
|
|
70
|
-
const { subscribe } = useWebSocket();
|
|
71
|
-
const [state, setState] = useState<DashboardState | null>(null);
|
|
72
|
-
const [loading, setLoading] = useState(true);
|
|
73
|
-
const [error, setError] = useState('');
|
|
74
|
-
const lastToastRef = React.useRef<{ message: string; at: number } | null>(null);
|
|
75
|
-
|
|
76
|
-
// Experimental wallet multi-view shell state
|
|
77
|
-
const [experimentalWallet, setExperimentalWallet] = useState(false);
|
|
78
|
-
const [socialEnabled, setSocialEnabled] = useState(false);
|
|
79
|
-
const [activeViewId, setActiveViewId] = useState(getDefaultActiveViewId());
|
|
80
|
-
const [createViewOpen, setCreateViewOpen] = useState(false);
|
|
81
|
-
|
|
82
|
-
const reportNonInlineError = React.useCallback((message: string) => {
|
|
83
|
-
const normalized = message.trim() || 'Something went wrong';
|
|
84
|
-
const now = Date.now();
|
|
85
|
-
const last = lastToastRef.current;
|
|
86
|
-
if (last && last.message === normalized && now - last.at < 3000) return;
|
|
87
|
-
lastToastRef.current = { message: normalized, at: now };
|
|
88
|
-
setError(normalized);
|
|
89
|
-
}, []);
|
|
90
|
-
|
|
91
|
-
// Agent requests - only need count for sidebar badge (app is self-contained)
|
|
92
|
-
// Only auto-fetch when we have a token (wallet is unlocked)
|
|
93
|
-
const { requests, notifications, dismissNotification, resolveAction, actionLoading } = useAgentActions({ autoFetch: !!token });
|
|
94
|
-
const [copied, setCopied] = useState<string | null>(null);
|
|
95
|
-
const [activeDrawer, setActiveDrawer] = useState<'settings' | 'receive' | null>(null);
|
|
96
|
-
const [showAppStore, setShowAppStore] = useState(false);
|
|
97
|
-
const [nuking, setNuking] = useState(false);
|
|
98
|
-
const [confirmNuke, setConfirmNuke] = useState(false);
|
|
99
|
-
|
|
100
|
-
const [sendFrom, setSendFrom] = useState('');
|
|
101
|
-
|
|
102
|
-
const [seedPhrase, setSeedPhrase] = useState<string | null>(null);
|
|
103
|
-
const [seedConfirmed, setSeedConfirmed] = useState(false);
|
|
104
|
-
const [exportPassword, setExportPassword] = useState('');
|
|
105
|
-
const [exporting, setExporting] = useState(false);
|
|
106
|
-
const [exportedSeed, setExportedSeed] = useState<string | null>(null);
|
|
107
|
-
|
|
108
|
-
// Import seed state
|
|
109
|
-
const [showImportSeedModal, setShowImportSeedModal] = useState(false);
|
|
110
|
-
const [importSeedPhrase, setImportSeedPhrase] = useState('');
|
|
111
|
-
const [importPassword, setImportPassword] = useState('');
|
|
112
|
-
const [importConfirmPassword, setImportConfirmPassword] = useState('');
|
|
113
|
-
const [importing, setImporting] = useState(false);
|
|
114
|
-
|
|
115
|
-
// Chain state
|
|
116
|
-
const [chains, setChains] = useState<Record<string, { rpc: string; chainId: number; explorer: string; nativeCurrency: string }>>({});
|
|
117
|
-
const [editingChainRpc, setEditingChainRpc] = useState<string | null>(null);
|
|
118
|
-
const [customRpc, setCustomRpc] = useState('');
|
|
119
|
-
const [savingConfig] = useState(false);
|
|
120
|
-
const [showAddChainModal, setShowAddChainModal] = useState(false);
|
|
121
|
-
const [addChainAnchorEl, setAddChainAnchorEl] = useState<HTMLElement | null>(null);
|
|
122
|
-
const [newChain, setNewChain] = useState({ name: '', chainId: '', rpc: '', explorer: '', nativeCurrency: 'ETH' });
|
|
123
|
-
|
|
124
|
-
// API Keys state
|
|
125
|
-
const [showAddApiKeyPopover, setShowAddApiKeyPopover] = useState(false);
|
|
126
|
-
const [addApiKeyAnchorEl, setAddApiKeyAnchorEl] = useState<HTMLElement | null>(null);
|
|
127
|
-
const [newApiKey, setNewApiKey] = useState({ service: '', name: '', key: '' });
|
|
128
|
-
const [savingApiKey, setSavingApiKey] = useState(false);
|
|
129
|
-
const [deletingApiKey, setDeletingApiKey] = useState<string | null>(null);
|
|
130
|
-
const [showRevokeAllApiKeysPopover, setShowRevokeAllApiKeysPopover] = useState(false);
|
|
131
|
-
const [revokeAllApiKeysAnchorEl, setRevokeAllApiKeysAnchorEl] = useState<HTMLElement | null>(null);
|
|
132
|
-
const [revokingAllApiKeys, setRevokingAllApiKeys] = useState(false);
|
|
133
|
-
|
|
134
|
-
// Backup state
|
|
135
|
-
interface BackupInfo {
|
|
136
|
-
filename: string;
|
|
137
|
-
timestamp: string;
|
|
138
|
-
size: number;
|
|
139
|
-
date: string;
|
|
140
|
-
}
|
|
141
|
-
const [backups, setBackups] = useState<BackupInfo[]>([]);
|
|
142
|
-
const [backupsLoading, setBackupsLoading] = useState(false);
|
|
143
|
-
const [creatingBackup, setCreatingBackup] = useState(false);
|
|
144
|
-
const [restoringBackup, setRestoringBackup] = useState<string | null>(null);
|
|
145
|
-
|
|
146
|
-
// Workspace context for programmatic workspace control
|
|
147
|
-
const {
|
|
148
|
-
workspaces,
|
|
149
|
-
activeWorkspaceId,
|
|
150
|
-
apps: workspaceApps,
|
|
151
|
-
loading: workspaceLoading,
|
|
152
|
-
createWorkspace,
|
|
153
|
-
deleteWorkspace,
|
|
154
|
-
updateWorkspace,
|
|
155
|
-
switchWorkspace,
|
|
156
|
-
addApp,
|
|
157
|
-
removeApp,
|
|
158
|
-
updateApp,
|
|
159
|
-
bringToFront,
|
|
160
|
-
tidyApps,
|
|
161
|
-
} = useWorkspace();
|
|
162
|
-
|
|
163
|
-
// Convert workspaces to tabs format
|
|
164
|
-
const tabs: WorkspaceTab[] = workspaces.map(ws => ({
|
|
165
|
-
id: ws.id,
|
|
166
|
-
label: ws.name,
|
|
167
|
-
icon: ws.icon === 'Home' ? HomeIcon : undefined,
|
|
168
|
-
emoji: ws.emoji,
|
|
169
|
-
color: ws.color,
|
|
170
|
-
closeable: ws.isCloseable,
|
|
171
|
-
isDefault: ws.isDefault,
|
|
172
|
-
}));
|
|
173
|
-
|
|
174
|
-
// Handle workspace tab update (name, emoji, color)
|
|
175
|
-
const handleTabUpdate = (tabId: string, data: { name?: string; emoji?: string; color?: string }) => {
|
|
176
|
-
updateWorkspace(tabId, {
|
|
177
|
-
name: data.name,
|
|
178
|
-
emoji: data.emoji,
|
|
179
|
-
color: data.color,
|
|
180
|
-
});
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
const fetchState = async (retries = 10): Promise<void> => {
|
|
184
|
-
for (let attempt = 0; attempt < retries; attempt++) {
|
|
185
|
-
try {
|
|
186
|
-
const controller = new AbortController();
|
|
187
|
-
const timeout = setTimeout(() => controller.abort(), 5000);
|
|
188
|
-
|
|
189
|
-
const setupData = await api.get<{ hasWallet: boolean; unlocked: boolean; address: string | null }>(
|
|
190
|
-
Api.Wallet, '/setup', undefined, { signal: controller.signal },
|
|
191
|
-
);
|
|
192
|
-
clearTimeout(timeout);
|
|
193
|
-
|
|
194
|
-
// Map new server response format
|
|
195
|
-
const configured = setupData.hasWallet;
|
|
196
|
-
const isUnlocked = setupData.unlocked;
|
|
197
|
-
|
|
198
|
-
if (!configured) {
|
|
199
|
-
setState({ configured: false, isUnlocked: false, wallets: [] });
|
|
200
|
-
setLoading(false);
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
if (!isUnlocked) {
|
|
205
|
-
setState({ configured: true, isUnlocked: false, wallets: [] });
|
|
206
|
-
setLoading(false);
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const walletsData = await api.get<{ wallets: WalletData[] }>(Api.Wallet, '/wallets', { includeHidden: true });
|
|
211
|
-
|
|
212
|
-
setState({
|
|
213
|
-
configured: true,
|
|
214
|
-
isUnlocked: true,
|
|
215
|
-
wallets: walletsData.wallets || [],
|
|
216
|
-
});
|
|
217
|
-
if (walletsData.wallets?.length > 0 && !sendFrom) {
|
|
218
|
-
const hotWallet = walletsData.wallets.find((w: WalletData) => w.tier === 'hot');
|
|
219
|
-
if (hotWallet) setSendFrom(hotWallet.address);
|
|
220
|
-
}
|
|
221
|
-
setLoading(false);
|
|
222
|
-
return;
|
|
223
|
-
} catch {
|
|
224
|
-
// Server not ready yet — retry after a delay
|
|
225
|
-
if (attempt < retries - 1) {
|
|
226
|
-
await new Promise(r => setTimeout(r, 2000));
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
// All retries exhausted
|
|
231
|
-
reportNonInlineError('Failed to connect to wallet server');
|
|
232
|
-
setLoading(false);
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
useEffect(() => { fetchState(); }, []);
|
|
236
|
-
|
|
237
|
-
// Fetch feature flags for experimental wallet + social
|
|
238
|
-
useEffect(() => {
|
|
239
|
-
fetch('/flags')
|
|
240
|
-
.then((r) => r.ok ? r.json() : {})
|
|
241
|
-
.then((flags: Record<string, boolean>) => {
|
|
242
|
-
if (flags.EXPERIMENTAL_WALLET) setExperimentalWallet(true);
|
|
243
|
-
if (flags.SOCIAL) setSocialEnabled(true);
|
|
244
|
-
})
|
|
245
|
-
.catch(() => {});
|
|
246
|
-
}, []);
|
|
247
|
-
|
|
248
|
-
// Sync chains state from AuthContext (overrides + Alchemy + public fallbacks)
|
|
249
|
-
useEffect(() => {
|
|
250
|
-
const configuredChains = getConfiguredChains();
|
|
251
|
-
const chainsWithNative: Record<string, { rpc: string; chainId: number; explorer: string; nativeCurrency: string }> = {};
|
|
252
|
-
for (const [chain, config] of Object.entries(configuredChains)) {
|
|
253
|
-
chainsWithNative[chain] = {
|
|
254
|
-
...config,
|
|
255
|
-
nativeCurrency: 'ETH', // All supported chains use ETH
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
setChains(chainsWithNative);
|
|
259
|
-
}, [getConfiguredChains, chainOverrides, authApiKeys]);
|
|
260
|
-
|
|
261
|
-
// Subscribe to WebSocket wallet events for real-time updates
|
|
262
|
-
useEffect(() => {
|
|
263
|
-
// Handle wallet:created - add new wallet to state
|
|
264
|
-
const unsubscribeWalletCreated = subscribe(WALLET_EVENTS.WALLET_CREATED, (event) => {
|
|
265
|
-
const data = event.data as WalletCreatedData;
|
|
266
|
-
setState((prev) => {
|
|
267
|
-
if (!prev) return prev;
|
|
268
|
-
// Check if wallet already exists
|
|
269
|
-
if (prev.wallets.some((w) => w.address === data.address)) {
|
|
270
|
-
return prev;
|
|
271
|
-
}
|
|
272
|
-
// Add new wallet with createdAt timestamp
|
|
273
|
-
const newWallet: WalletData = {
|
|
274
|
-
address: data.address,
|
|
275
|
-
tier: data.tier,
|
|
276
|
-
chain: data.chain,
|
|
277
|
-
name: data.name,
|
|
278
|
-
tokenHash: data.tokenHash,
|
|
279
|
-
balance: '0 ETH',
|
|
280
|
-
createdAt: new Date().toISOString(),
|
|
281
|
-
};
|
|
282
|
-
return {
|
|
283
|
-
...prev,
|
|
284
|
-
wallets: [...prev.wallets, newWallet],
|
|
285
|
-
};
|
|
286
|
-
});
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
return () => {
|
|
290
|
-
unsubscribeWalletCreated();
|
|
291
|
-
};
|
|
292
|
-
}, [subscribe]);
|
|
293
|
-
|
|
294
|
-
// Seed default apps on first setup (empty workspace + configured + unlocked)
|
|
295
|
-
// Key is tied to cold wallet address so a new agent (e.g. sandbox) gets fresh defaults
|
|
296
|
-
useEffect(() => {
|
|
297
|
-
if (
|
|
298
|
-
!state?.configured ||
|
|
299
|
-
!state?.isUnlocked ||
|
|
300
|
-
workspaceLoading ||
|
|
301
|
-
workspaceApps.length > 0
|
|
302
|
-
) return;
|
|
303
|
-
|
|
304
|
-
const coldWallet = state.wallets.find(w => w.tier === 'cold');
|
|
305
|
-
const seedKey = `defaultAppsSeeded:${coldWallet?.address || 'unknown'}`;
|
|
306
|
-
|
|
307
|
-
if (localStorage.getItem(seedKey)) return;
|
|
308
|
-
|
|
309
|
-
// 1. Getting Started
|
|
310
|
-
const dismissKey = `setupWizardDismissed:${coldWallet?.address || 'unknown'}`;
|
|
311
|
-
if (!localStorage.getItem(dismissKey)) {
|
|
312
|
-
addApp('setup', undefined, { x: 20, y: 20 });
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
// 2. Agent Chat
|
|
316
|
-
addApp(
|
|
317
|
-
'installed:agent-chat',
|
|
318
|
-
{ appPath: 'agent-chat', appName: 'Agent Chat' },
|
|
319
|
-
{ x: 460, y: 20 }
|
|
320
|
-
);
|
|
321
|
-
|
|
322
|
-
// 3. Wallet detail for cold wallet
|
|
323
|
-
if (coldWallet) {
|
|
324
|
-
addApp(
|
|
325
|
-
'walletDetail',
|
|
326
|
-
{
|
|
327
|
-
walletAddress: coldWallet.address,
|
|
328
|
-
walletName: coldWallet.name,
|
|
329
|
-
walletEmoji: coldWallet.emoji,
|
|
330
|
-
walletColor: coldWallet.color,
|
|
331
|
-
},
|
|
332
|
-
{ x: 820, y: 20 },
|
|
333
|
-
`walletDetail-${coldWallet.address}`
|
|
334
|
-
);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
localStorage.setItem(seedKey, 'true');
|
|
338
|
-
}, [state?.configured, state?.isUnlocked, state?.wallets, workspaceLoading, workspaceApps.length, addApp]);
|
|
339
|
-
|
|
340
|
-
const handleExportSeed = async (e: React.FormEvent) => {
|
|
341
|
-
e.preventDefault();
|
|
342
|
-
setError('');
|
|
343
|
-
setExporting(true);
|
|
344
|
-
try {
|
|
345
|
-
const data = await api.post<{ success: boolean; error?: string; mnemonic?: string }>(Api.Wallet, '/wallet/export-seed', { password: exportPassword });
|
|
346
|
-
if (!data.success) throw new Error(data.error);
|
|
347
|
-
setExportedSeed(data.mnemonic ?? null);
|
|
348
|
-
setExportPassword('');
|
|
349
|
-
} catch (err) {
|
|
350
|
-
setError(err instanceof Error ? err.message : 'Export failed');
|
|
351
|
-
} finally {
|
|
352
|
-
setExporting(false);
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
const copyAddress = (address: string) => {
|
|
357
|
-
navigator.clipboard.writeText(address);
|
|
358
|
-
setCopied(address);
|
|
359
|
-
setTimeout(() => setCopied(null), 2000);
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
const handleNuke = async () => {
|
|
363
|
-
if (!confirmNuke) {
|
|
364
|
-
setConfirmNuke(true);
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
setNuking(true);
|
|
368
|
-
try {
|
|
369
|
-
const data = await api.post<{ success: boolean; error?: string }>(Api.Wallet, '/nuke');
|
|
370
|
-
if (!data.success) throw new Error(data.error);
|
|
371
|
-
setState(null);
|
|
372
|
-
setActiveDrawer(null);
|
|
373
|
-
setConfirmNuke(false);
|
|
374
|
-
window.location.reload();
|
|
375
|
-
} catch (err) {
|
|
376
|
-
setError(err instanceof Error ? err.message : 'Nuke failed');
|
|
377
|
-
} finally {
|
|
378
|
-
setNuking(false);
|
|
379
|
-
}
|
|
380
|
-
};
|
|
381
|
-
|
|
382
|
-
const handleImportSeed = async (e: React.FormEvent) => {
|
|
383
|
-
e.preventDefault();
|
|
384
|
-
if (importPassword !== importConfirmPassword) {
|
|
385
|
-
setError('Passwords do not match');
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
if (importPassword.length < 8) {
|
|
389
|
-
setError('Password must be at least 8 characters');
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
if (!importSeedPhrase.trim()) {
|
|
393
|
-
setError('Please enter a seed phrase');
|
|
394
|
-
return;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
setImporting(true);
|
|
398
|
-
try {
|
|
399
|
-
const data = await api.post<{ success?: boolean; error?: string }>(Api.Wallet, '/nuke/import', {
|
|
400
|
-
mnemonic: importSeedPhrase.trim(),
|
|
401
|
-
password: importPassword
|
|
402
|
-
});
|
|
403
|
-
if (!data.success && data.error) throw new Error(data.error);
|
|
404
|
-
|
|
405
|
-
setShowImportSeedModal(false);
|
|
406
|
-
setImportSeedPhrase('');
|
|
407
|
-
setImportPassword('');
|
|
408
|
-
setImportConfirmPassword('');
|
|
409
|
-
window.location.reload();
|
|
410
|
-
} catch (err) {
|
|
411
|
-
setError(err instanceof Error ? err.message : 'Import failed');
|
|
412
|
-
} finally {
|
|
413
|
-
setImporting(false);
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
|
|
417
|
-
const handleWalletClick = (wallet: WalletData) => {
|
|
418
|
-
const appId = `walletDetail-${wallet.address}`;
|
|
419
|
-
|
|
420
|
-
// Check if app for this wallet is already open
|
|
421
|
-
const existingApp = workspaceApps.find(w => w.id === appId);
|
|
422
|
-
if (existingApp) {
|
|
423
|
-
// Bring to front
|
|
424
|
-
bringToFront(appId);
|
|
425
|
-
return;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
// Count existing wallet detail apps for offset
|
|
429
|
-
const walletAppCount = workspaceApps.filter(w => w.appType === 'walletDetail').length;
|
|
430
|
-
const offset = walletAppCount * 30;
|
|
431
|
-
|
|
432
|
-
// Add app through workspace system with wallet info for title/color
|
|
433
|
-
addApp(
|
|
434
|
-
'walletDetail',
|
|
435
|
-
{
|
|
436
|
-
walletAddress: wallet.address,
|
|
437
|
-
walletName: wallet.name,
|
|
438
|
-
walletEmoji: wallet.emoji,
|
|
439
|
-
walletColor: wallet.color,
|
|
440
|
-
},
|
|
441
|
-
{ x: 360 + offset, y: 20 + offset },
|
|
442
|
-
appId
|
|
443
|
-
);
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
448
|
-
const handleWalletUpdate = async (
|
|
449
|
-
address: string,
|
|
450
|
-
updates: { name?: string; color?: string; emoji?: string; description?: string; hidden?: boolean }
|
|
451
|
-
) => {
|
|
452
|
-
try {
|
|
453
|
-
const data = await api.post<{ success: boolean; error?: string }>(Api.Wallet, '/wallet/rename', { address, ...updates });
|
|
454
|
-
if (!data.success) throw new Error(data.error);
|
|
455
|
-
|
|
456
|
-
// Update local state - wallet detail apps read from state.wallets
|
|
457
|
-
if (state?.wallets) {
|
|
458
|
-
const updatedWallets = state.wallets.map((w) =>
|
|
459
|
-
w.address === address ? { ...w, ...updates } : w
|
|
460
|
-
);
|
|
461
|
-
setState((prev) => (prev ? { ...prev, wallets: updatedWallets } : null));
|
|
462
|
-
}
|
|
463
|
-
} catch (err) {
|
|
464
|
-
setError(err instanceof Error ? err.message : 'Failed to update wallet');
|
|
465
|
-
}
|
|
466
|
-
};
|
|
467
|
-
|
|
468
|
-
const handleRemoveChain = async (chain: string) => {
|
|
469
|
-
try {
|
|
470
|
-
await removeChainOverride(chain);
|
|
471
|
-
} catch {
|
|
472
|
-
setError('Failed to remove chain');
|
|
473
|
-
}
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
// Add new API key
|
|
477
|
-
const handleAddApiKey = async () => {
|
|
478
|
-
if (!newApiKey.service || !newApiKey.name || !newApiKey.key) {
|
|
479
|
-
setError('Service, name, and key are required');
|
|
480
|
-
return;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
setSavingApiKey(true);
|
|
484
|
-
try {
|
|
485
|
-
const data = await api.post<{ success: boolean; error?: string }>(Api.Wallet, '/apikeys', {
|
|
486
|
-
service: newApiKey.service.toLowerCase(),
|
|
487
|
-
name: newApiKey.name,
|
|
488
|
-
key: newApiKey.key
|
|
489
|
-
});
|
|
490
|
-
|
|
491
|
-
if (data.success) {
|
|
492
|
-
// Refresh API keys list from AuthContext
|
|
493
|
-
await refreshApiKeys();
|
|
494
|
-
setNewApiKey({ service: '', name: '', key: '' });
|
|
495
|
-
setShowAddApiKeyPopover(false);
|
|
496
|
-
} else {
|
|
497
|
-
reportNonInlineError(data.error || 'Failed to save API key');
|
|
498
|
-
}
|
|
499
|
-
} catch (err) {
|
|
500
|
-
setError(err instanceof Error ? err.message : 'Failed to save API key');
|
|
501
|
-
} finally {
|
|
502
|
-
setSavingApiKey(false);
|
|
503
|
-
}
|
|
504
|
-
};
|
|
505
|
-
|
|
506
|
-
// Delete API key
|
|
507
|
-
const handleDeleteApiKey = async (id: string) => {
|
|
508
|
-
setDeletingApiKey(id);
|
|
509
|
-
try {
|
|
510
|
-
const data = await api.delete<{ success: boolean; error?: string }>(Api.Wallet, `/apikeys/${id}`);
|
|
511
|
-
|
|
512
|
-
if (data.success) {
|
|
513
|
-
await refreshApiKeys();
|
|
514
|
-
} else {
|
|
515
|
-
reportNonInlineError(data.error || 'Failed to delete API key');
|
|
516
|
-
}
|
|
517
|
-
} catch (err) {
|
|
518
|
-
setError(err instanceof Error ? err.message : 'Failed to delete API key');
|
|
519
|
-
} finally {
|
|
520
|
-
setDeletingApiKey(null);
|
|
521
|
-
}
|
|
522
|
-
};
|
|
523
|
-
|
|
524
|
-
const onOpenRevokeAllApiKeys = (anchorEl: HTMLElement) => {
|
|
525
|
-
setRevokeAllApiKeysAnchorEl(anchorEl);
|
|
526
|
-
setShowRevokeAllApiKeysPopover(true);
|
|
527
|
-
};
|
|
528
|
-
|
|
529
|
-
const onCloseRevokeAllApiKeys = () => {
|
|
530
|
-
setShowRevokeAllApiKeysPopover(false);
|
|
531
|
-
setRevokeAllApiKeysAnchorEl(null);
|
|
532
|
-
};
|
|
533
|
-
|
|
534
|
-
const handleRevokeAllApiKeys = async () => {
|
|
535
|
-
setRevokingAllApiKeys(true);
|
|
536
|
-
try {
|
|
537
|
-
const data = await api.delete<{ success: boolean; revokedCount?: number; message?: string; error?: string }>(Api.Wallet, '/apikeys/revoke-all');
|
|
538
|
-
if (!data.success) {
|
|
539
|
-
reportNonInlineError(data.error || 'Failed to revoke all API keys');
|
|
540
|
-
return;
|
|
541
|
-
}
|
|
542
|
-
await refreshApiKeys();
|
|
543
|
-
onCloseRevokeAllApiKeys();
|
|
544
|
-
} catch (err) {
|
|
545
|
-
setError(err instanceof Error ? err.message : 'Failed to revoke all API keys');
|
|
546
|
-
} finally {
|
|
547
|
-
setRevokingAllApiKeys(false);
|
|
548
|
-
}
|
|
549
|
-
};
|
|
550
|
-
|
|
551
|
-
// Add Alchemy API key directly (for quick setup)
|
|
552
|
-
const handleAddAlchemyKey = async (key: string): Promise<boolean> => {
|
|
553
|
-
try {
|
|
554
|
-
const data = await api.post<{ success: boolean; error?: string }>(Api.Wallet, '/apikeys', {
|
|
555
|
-
service: 'alchemy',
|
|
556
|
-
name: 'default',
|
|
557
|
-
key
|
|
558
|
-
});
|
|
559
|
-
|
|
560
|
-
if (data.success) {
|
|
561
|
-
await refreshApiKeys();
|
|
562
|
-
return true;
|
|
563
|
-
} else {
|
|
564
|
-
reportNonInlineError(data.error || 'Failed to save Alchemy key');
|
|
565
|
-
return false;
|
|
566
|
-
}
|
|
567
|
-
} catch (err) {
|
|
568
|
-
setError(err instanceof Error ? err.message : 'Failed to save Alchemy key');
|
|
569
|
-
return false;
|
|
570
|
-
}
|
|
571
|
-
};
|
|
572
|
-
|
|
573
|
-
const handleAddChain = async () => {
|
|
574
|
-
const chainName = newChain.name.toLowerCase().trim();
|
|
575
|
-
if (!chainName || !newChain.chainId) {
|
|
576
|
-
setError('Chain name and chain ID are required');
|
|
577
|
-
return;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
const chainId = parseInt(newChain.chainId, 10);
|
|
581
|
-
const knownChain = KNOWN_CHAINS[chainName];
|
|
582
|
-
const explorer = newChain.explorer || knownChain?.explorer || '';
|
|
583
|
-
|
|
584
|
-
// If RPC is blank and we have Alchemy key + known chain, construct Alchemy URL
|
|
585
|
-
let rpc = newChain.rpc.trim();
|
|
586
|
-
if (!rpc) {
|
|
587
|
-
const alchemyKey = getApiKey('alchemy');
|
|
588
|
-
if (alchemyKey && knownChain?.alchemyPath) {
|
|
589
|
-
rpc = `https://${knownChain.alchemyPath}.g.alchemy.com/v2/${alchemyKey}`;
|
|
590
|
-
} else {
|
|
591
|
-
setError('RPC URL is required (or add Alchemy key for known chains)');
|
|
592
|
-
return;
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
try {
|
|
597
|
-
await saveChainOverride(chainName, { rpc, chainId, explorer });
|
|
598
|
-
setNewChain({ name: '', chainId: '', rpc: '', explorer: '', nativeCurrency: 'ETH' });
|
|
599
|
-
setShowAddChainModal(false);
|
|
600
|
-
} catch {
|
|
601
|
-
setError('Failed to add chain');
|
|
602
|
-
}
|
|
603
|
-
};
|
|
604
|
-
|
|
605
|
-
const handleSaveCustomRpc = async (chain: string, rpc: string) => {
|
|
606
|
-
if (!rpc) {
|
|
607
|
-
setError('RPC URL is required');
|
|
608
|
-
return;
|
|
609
|
-
}
|
|
610
|
-
try {
|
|
611
|
-
// Get current chain config to preserve chainId and explorer
|
|
612
|
-
const currentConfig = chains[chain];
|
|
613
|
-
await saveChainOverride(chain, {
|
|
614
|
-
rpc,
|
|
615
|
-
chainId: currentConfig?.chainId || 0,
|
|
616
|
-
explorer: currentConfig?.explorer || '',
|
|
617
|
-
});
|
|
618
|
-
setEditingChainRpc(null);
|
|
619
|
-
setCustomRpc('');
|
|
620
|
-
} catch {
|
|
621
|
-
setError('Failed to save RPC override');
|
|
622
|
-
}
|
|
623
|
-
};
|
|
624
|
-
|
|
625
|
-
const fetchBackups = async () => {
|
|
626
|
-
// Skip if no auth token
|
|
627
|
-
if (!token) {
|
|
628
|
-
setBackups([]);
|
|
629
|
-
return;
|
|
630
|
-
}
|
|
631
|
-
setBackupsLoading(true);
|
|
632
|
-
try {
|
|
633
|
-
const data = await api.get<{ success: boolean; backups: Array<{ filename: string; timestamp: string; size: number; date: string }> }>(Api.Wallet, '/backup');
|
|
634
|
-
if (data.success) {
|
|
635
|
-
setBackups(data.backups);
|
|
636
|
-
}
|
|
637
|
-
} catch (err) {
|
|
638
|
-
console.error('Failed to fetch backups:', err);
|
|
639
|
-
setBackups([]);
|
|
640
|
-
} finally {
|
|
641
|
-
setBackupsLoading(false);
|
|
642
|
-
}
|
|
643
|
-
};
|
|
644
|
-
|
|
645
|
-
const handleCreateBackup = async () => {
|
|
646
|
-
setCreatingBackup(true);
|
|
647
|
-
try {
|
|
648
|
-
const data = await api.post<{ success: boolean; error?: string }>(Api.Wallet, '/backup');
|
|
649
|
-
if (data.success) {
|
|
650
|
-
await fetchBackups();
|
|
651
|
-
} else {
|
|
652
|
-
reportNonInlineError(data.error || 'Failed to create backup');
|
|
653
|
-
}
|
|
654
|
-
} catch (err) {
|
|
655
|
-
setError(err instanceof Error ? err.message : 'Failed to create backup');
|
|
656
|
-
} finally {
|
|
657
|
-
setCreatingBackup(false);
|
|
658
|
-
}
|
|
659
|
-
};
|
|
660
|
-
|
|
661
|
-
const handleRestoreBackup = async (filename: string) => {
|
|
662
|
-
setRestoringBackup(filename);
|
|
663
|
-
try {
|
|
664
|
-
const data = await api.put<{ success: boolean; error?: string }>(Api.Wallet, '/backup', { filename });
|
|
665
|
-
if (data.success) {
|
|
666
|
-
window.location.reload();
|
|
667
|
-
} else {
|
|
668
|
-
reportNonInlineError(data.error || 'Failed to restore backup');
|
|
669
|
-
}
|
|
670
|
-
} catch (err) {
|
|
671
|
-
setError(err instanceof Error ? err.message : 'Failed to restore backup');
|
|
672
|
-
} finally {
|
|
673
|
-
setRestoringBackup(null);
|
|
674
|
-
}
|
|
675
|
-
};
|
|
676
|
-
|
|
677
|
-
const [exportingDb, setExportingDb] = useState(false);
|
|
678
|
-
|
|
679
|
-
const handleExportDb = async () => {
|
|
680
|
-
setExportingDb(true);
|
|
681
|
-
try {
|
|
682
|
-
const baseUrl = api.getBaseUrl(Api.Wallet);
|
|
683
|
-
const authToken = token || '';
|
|
684
|
-
const res = await fetch(`${baseUrl}/backup/export`, {
|
|
685
|
-
headers: { Authorization: `Bearer ${authToken}` },
|
|
686
|
-
});
|
|
687
|
-
if (!res.ok) {
|
|
688
|
-
const err = await res.json().catch(() => ({ error: 'Export failed' }));
|
|
689
|
-
reportNonInlineError(err.error || 'Export failed');
|
|
690
|
-
return;
|
|
691
|
-
}
|
|
692
|
-
const blob = await res.blob();
|
|
693
|
-
const disposition = res.headers.get('Content-Disposition') || '';
|
|
694
|
-
const filenameMatch = disposition.match(/filename="?([^"]+)"?/);
|
|
695
|
-
const filename = filenameMatch ? filenameMatch[1] : 'auramaxx-export.db';
|
|
696
|
-
const url = URL.createObjectURL(blob);
|
|
697
|
-
const a = document.createElement('a');
|
|
698
|
-
a.href = url;
|
|
699
|
-
a.download = filename;
|
|
700
|
-
document.body.appendChild(a);
|
|
701
|
-
a.click();
|
|
702
|
-
document.body.removeChild(a);
|
|
703
|
-
URL.revokeObjectURL(url);
|
|
704
|
-
} catch (err) {
|
|
705
|
-
reportNonInlineError(err instanceof Error ? err.message : 'Export failed');
|
|
706
|
-
} finally {
|
|
707
|
-
setExportingDb(false);
|
|
708
|
-
}
|
|
709
|
-
};
|
|
710
|
-
|
|
711
|
-
const handleNewTab = () => {
|
|
712
|
-
createWorkspace('NEW');
|
|
713
|
-
};
|
|
714
|
-
|
|
715
|
-
const handleCloseTab = (tabId: string) => {
|
|
716
|
-
deleteWorkspace(tabId);
|
|
717
|
-
};
|
|
718
|
-
|
|
719
|
-
const handleTabChange = (tabId: string) => {
|
|
720
|
-
switchWorkspace(tabId);
|
|
721
|
-
};
|
|
722
|
-
|
|
723
|
-
const handleAppPositionChange = (id: string, pos: AppPosition) => {
|
|
724
|
-
// Update context (will sync to DB)
|
|
725
|
-
updateApp(id, { x: pos.x, y: pos.y });
|
|
726
|
-
};
|
|
727
|
-
|
|
728
|
-
const handleAppLockChange = (id: string, locked: boolean) => {
|
|
729
|
-
updateApp(id, { isLocked: locked });
|
|
730
|
-
};
|
|
731
|
-
|
|
732
|
-
const handleAppSizeChange = (id: string, size: { width: number; height: number }) => {
|
|
733
|
-
updateApp(id, { width: size.width, height: size.height });
|
|
734
|
-
};
|
|
735
|
-
|
|
736
|
-
const handleBringToFront = (id: string) => {
|
|
737
|
-
bringToFront(id);
|
|
738
|
-
};
|
|
739
|
-
|
|
740
|
-
const handleDismissApp = (id: string) => {
|
|
741
|
-
removeApp(id);
|
|
742
|
-
};
|
|
743
|
-
|
|
744
|
-
const handleOpenLogs = () => {
|
|
745
|
-
// Check if logs app already exists
|
|
746
|
-
const logsApp = workspaceApps.find(w => w.appType === 'logs');
|
|
747
|
-
if (logsApp) {
|
|
748
|
-
bringToFront(logsApp.id);
|
|
749
|
-
} else {
|
|
750
|
-
addApp('logs', undefined, { x: 700, y: 20 });
|
|
751
|
-
}
|
|
752
|
-
};
|
|
753
|
-
|
|
754
|
-
const handleOpenApp = (type: string, position?: { x: number; y: number }) => {
|
|
755
|
-
const existing = workspaceApps.find(w => w.appType === type);
|
|
756
|
-
if (existing) {
|
|
757
|
-
bringToFront(existing.id);
|
|
758
|
-
} else {
|
|
759
|
-
addApp(type, undefined, position);
|
|
760
|
-
}
|
|
761
|
-
};
|
|
762
|
-
|
|
763
|
-
const handleAddAppFromStore = (appType: string, config?: Record<string, unknown>) => {
|
|
764
|
-
addApp(appType, config, { x: 360, y: 20 });
|
|
765
|
-
setShowAppStore(false);
|
|
766
|
-
};
|
|
767
|
-
|
|
768
|
-
// Loading state
|
|
769
|
-
if (loading) {
|
|
770
|
-
return (
|
|
771
|
-
<div className="min-h-screen flex items-center justify-center bg-[var(--color-background,#f5f5f5)] relative">
|
|
772
|
-
<div className="fixed inset-0 pointer-events-none z-0 overflow-hidden">
|
|
773
|
-
<div className="absolute inset-0 bg-[linear-gradient(to_right,var(--color-border-muted,#e5e5e5)_1px,transparent_1px),linear-gradient(to_bottom,var(--color-border-muted,#e5e5e5)_1px,transparent_1px)] bg-[size:4rem_4rem] opacity-30" />
|
|
774
|
-
</div>
|
|
775
|
-
<div className="font-mono text-sm text-[var(--color-text-muted,#6b7280)] animate-pulse relative z-10">INITIALIZING SYSTEM...</div>
|
|
776
|
-
</div>
|
|
777
|
-
);
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
// Seed backup screen
|
|
781
|
-
if (seedPhrase && !seedConfirmed) {
|
|
782
|
-
return (
|
|
783
|
-
<div className="min-h-screen flex items-center justify-center p-4 bg-[var(--color-background,#f5f5f5)] relative">
|
|
784
|
-
<div className="fixed inset-0 pointer-events-none z-0 overflow-hidden">
|
|
785
|
-
<div className="absolute inset-0 bg-[linear-gradient(to_right,var(--color-border-muted,#e5e5e5)_1px,transparent_1px),linear-gradient(to_bottom,var(--color-border-muted,#e5e5e5)_1px,transparent_1px)] bg-[size:4rem_4rem] opacity-30" />
|
|
786
|
-
</div>
|
|
787
|
-
<div className="w-full max-w-md bg-[var(--color-surface,#ffffff)] border border-[var(--color-border,#d4d4d8)] relative z-10">
|
|
788
|
-
<div className="absolute top-2 left-2 w-4 h-4 border-l-2 border-t-2 border-[var(--color-border-focus,#0a0a0a)]" />
|
|
789
|
-
<div className="absolute top-2 right-2 w-4 h-4 border-r-2 border-t-2 border-[var(--color-border-focus,#0a0a0a)]" />
|
|
790
|
-
<div className="absolute bottom-2 left-2 w-4 h-4 border-l-2 border-b-2 border-[var(--color-border-focus,#0a0a0a)]" />
|
|
791
|
-
<div className="absolute bottom-2 right-2 w-4 h-4 border-r-2 border-b-2 border-[var(--color-border-focus,#0a0a0a)]" />
|
|
792
|
-
<div className="absolute inset-0 opacity-[0.02] pointer-events-none bg-[radial-gradient(var(--color-text,#000)_1px,transparent_1px)] bg-[size:4px_4px]" />
|
|
793
|
-
|
|
794
|
-
<div className="p-8 relative z-10">
|
|
795
|
-
<div className="flex items-center gap-3 mb-6">
|
|
796
|
-
<div className="w-10 h-10 bg-[var(--color-warning,#ff4d00)] flex items-center justify-center">
|
|
797
|
-
<AlertTriangle size={16} className="text-white" />
|
|
798
|
-
</div>
|
|
799
|
-
<div>
|
|
800
|
-
<div className="font-mono text-[10px] text-[var(--color-warning,#ff4d00)] tracking-widest">CRITICAL</div>
|
|
801
|
-
<div className="font-black text-xl text-[var(--color-text,#0a0a0a)] tracking-tight">BACKUP SEED PHRASE</div>
|
|
802
|
-
</div>
|
|
803
|
-
</div>
|
|
804
|
-
|
|
805
|
-
<div className="mb-4 p-3 bg-[var(--color-warning,#ff4d00)]/10 border border-[var(--color-warning,#ff4d00)]/30">
|
|
806
|
-
<div className="font-mono text-[10px] text-[var(--color-warning,#ff4d00)] leading-relaxed">
|
|
807
|
-
Write this down and store it safely. This is the ONLY way to recover your wallets. It will NOT be shown again.
|
|
808
|
-
</div>
|
|
809
|
-
</div>
|
|
810
|
-
|
|
811
|
-
<div className="mb-6 p-4 bg-[var(--color-text,#0a0a0a)] border-2 border-[var(--color-border-focus,#0a0a0a)] relative">
|
|
812
|
-
<button
|
|
813
|
-
onClick={() => {
|
|
814
|
-
navigator.clipboard.writeText(seedPhrase);
|
|
815
|
-
setCopied('seed');
|
|
816
|
-
setTimeout(() => setCopied(null), 2000);
|
|
817
|
-
}}
|
|
818
|
-
className="absolute top-2 right-2 p-1.5 bg-[var(--color-text,#0a0a0a)]/80 hover:bg-[var(--color-text,#0a0a0a)]/70 transition-colors"
|
|
819
|
-
>
|
|
820
|
-
<Copy size={12} className={copied === 'seed' ? 'text-[var(--color-accent,#ccff00)]' : 'text-[var(--color-text-muted,#6b7280)]'} />
|
|
821
|
-
</button>
|
|
822
|
-
<div className="font-mono text-sm text-[var(--color-accent,#ccff00)] leading-relaxed break-words select-all">
|
|
823
|
-
{seedPhrase}
|
|
824
|
-
</div>
|
|
825
|
-
</div>
|
|
826
|
-
|
|
827
|
-
<div className="space-y-3">
|
|
828
|
-
<label className="flex items-start gap-3 cursor-pointer group">
|
|
829
|
-
<input
|
|
830
|
-
type="checkbox"
|
|
831
|
-
checked={seedConfirmed}
|
|
832
|
-
onChange={(e) => setSeedConfirmed(e.target.checked)}
|
|
833
|
-
className="mt-1 w-4 h-4 accent-[var(--color-accent,#ccff00)]"
|
|
834
|
-
/>
|
|
835
|
-
<span className="font-mono text-[10px] text-[var(--color-text-muted,#6b7280)] leading-relaxed group-hover:text-[var(--color-text,#0a0a0a)]">
|
|
836
|
-
I have saved my seed phrase in a secure location.
|
|
837
|
-
</span>
|
|
838
|
-
</label>
|
|
839
|
-
|
|
840
|
-
<button
|
|
841
|
-
onClick={() => {
|
|
842
|
-
setSeedPhrase(null);
|
|
843
|
-
fetchState();
|
|
844
|
-
}}
|
|
845
|
-
disabled={!seedConfirmed}
|
|
846
|
-
className="w-full h-14 bg-[var(--color-text,#0a0a0a)] text-white relative overflow-hidden disabled:opacity-30 disabled:cursor-not-allowed group"
|
|
847
|
-
>
|
|
848
|
-
<span className="relative z-10 font-mono font-bold text-xs uppercase tracking-[0.15em] group-hover:text-[var(--color-accent,#ccff00)] transition-colors">
|
|
849
|
-
CONTINUE
|
|
850
|
-
</span>
|
|
851
|
-
</button>
|
|
852
|
-
</div>
|
|
853
|
-
</div>
|
|
854
|
-
</div>
|
|
855
|
-
</div>
|
|
856
|
-
);
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
// Derived state for other components
|
|
860
|
-
const coldWallets = state?.wallets.filter(w => w.tier === 'cold') || [];
|
|
861
|
-
const isLocked = state?.configured && !state?.isUnlocked;
|
|
862
|
-
const isConfigured = state?.configured ?? false;
|
|
863
|
-
|
|
864
|
-
// MAIN LAYOUT - Sidebar + Tab Content
|
|
865
|
-
return (
|
|
866
|
-
<div className="h-screen flex bg-[var(--color-background,#f5f5f5)] overflow-hidden">
|
|
867
|
-
{/* Experimental Wallet Left Rail */}
|
|
868
|
-
{experimentalWallet && (
|
|
869
|
-
<LeftRail
|
|
870
|
-
views={socialEnabled ? [...DEFAULT_VIEWS, SOCIAL_VIEW] : DEFAULT_VIEWS}
|
|
871
|
-
activeViewId={activeViewId}
|
|
872
|
-
onSelectView={setActiveViewId}
|
|
873
|
-
onCreateView={() => setCreateViewOpen(true)}
|
|
874
|
-
/>
|
|
875
|
-
)}
|
|
876
|
-
{experimentalWallet && (
|
|
877
|
-
<CreateViewModal
|
|
878
|
-
open={createViewOpen}
|
|
879
|
-
onClose={() => setCreateViewOpen(false)}
|
|
880
|
-
onSelect={(view: ViewDefinition) => setActiveViewId(view.id)}
|
|
881
|
-
/>
|
|
882
|
-
)}
|
|
883
|
-
{/* Background Pattern with AURA/MAXXING */}
|
|
884
|
-
<div className="fixed inset-0 pointer-events-none z-0 overflow-hidden">
|
|
885
|
-
<div className="absolute inset-0 bg-[linear-gradient(to_right,var(--color-border-muted,#e5e5e5)_1px,transparent_1px),linear-gradient(to_bottom,var(--color-border-muted,#e5e5e5)_1px,transparent_1px)] bg-[size:4rem_4rem] opacity-30" />
|
|
886
|
-
<div className="absolute inset-0 tyvek-texture opacity-40 mix-blend-multiply" />
|
|
887
|
-
<div className="absolute top-[5%] left-[30%] opacity-[0.03] select-none">
|
|
888
|
-
<div className="text-[15vw] font-black leading-none text-[var(--color-text,#0a0a0a)] font-mono tracking-tighter">AURA</div>
|
|
889
|
-
</div>
|
|
890
|
-
<div className="absolute bottom-[5%] right-[5%] opacity-[0.03] select-none">
|
|
891
|
-
<div className="text-[12vw] font-black leading-none text-[var(--color-text,#0a0a0a)] font-mono tracking-tighter text-right">MAXXING</div>
|
|
892
|
-
</div>
|
|
893
|
-
{/* Lab Markings */}
|
|
894
|
-
<div className="absolute top-10 left-[290px] w-24 h-24 border-l-4 border-t-4 border-[var(--color-text,#0a0a0a)] opacity-10">
|
|
895
|
-
<div className="absolute top-2 left-2 w-3 h-3 bg-[var(--color-text,#0a0a0a)]" />
|
|
896
|
-
</div>
|
|
897
|
-
<div className="absolute bottom-10 right-10 w-24 h-24 border-r-4 border-b-4 border-[var(--color-text,#0a0a0a)] opacity-10 flex items-end justify-end">
|
|
898
|
-
<div className="absolute bottom-2 right-2 w-3 h-3 bg-[var(--color-text,#0a0a0a)]" />
|
|
899
|
-
</div>
|
|
900
|
-
</div>
|
|
901
|
-
|
|
902
|
-
{/* Wallet Sidebar - Self-contained component */}
|
|
903
|
-
<WalletSidebar
|
|
904
|
-
onSend={() => handleOpenApp('send', { x: 360, y: 20 })}
|
|
905
|
-
onReceive={() => setActiveDrawer('receive')}
|
|
906
|
-
onLogs={handleOpenLogs}
|
|
907
|
-
onAgentKeys={() => handleOpenApp('agentKeys', { x: 360, y: 20 })}
|
|
908
|
-
onAppStore={() => setShowAppStore(true)}
|
|
909
|
-
onWalletClick={handleWalletClick}
|
|
910
|
-
onImportSeed={() => setShowImportSeedModal(true)}
|
|
911
|
-
onSettings={() => { setActiveDrawer(activeDrawer === 'settings' ? null : 'settings'); setConfirmNuke(false); }}
|
|
912
|
-
pendingActionCount={notifications.filter((n) => n.status === 'pending' && n.type !== 'notify').length}
|
|
913
|
-
onStateChange={(newState) => {
|
|
914
|
-
setState(prev => prev ? {
|
|
915
|
-
...prev,
|
|
916
|
-
configured: newState.configured,
|
|
917
|
-
isUnlocked: newState.unlocked,
|
|
918
|
-
wallets: newState.wallets,
|
|
919
|
-
} : {
|
|
920
|
-
configured: newState.configured,
|
|
921
|
-
isUnlocked: newState.unlocked,
|
|
922
|
-
wallets: newState.wallets,
|
|
923
|
-
});
|
|
924
|
-
}}
|
|
925
|
-
/>
|
|
926
|
-
|
|
927
|
-
{/* Main Content Area */}
|
|
928
|
-
<div className="flex-1 flex flex-col relative z-10">
|
|
929
|
-
{/* Error Toast */}
|
|
930
|
-
{error && (
|
|
931
|
-
<div
|
|
932
|
-
data-testid="app-error-toast"
|
|
933
|
-
className="absolute top-2 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 px-3 py-2 border shadow-lg"
|
|
934
|
-
style={{
|
|
935
|
-
background: 'color-mix(in srgb, var(--color-warning,#ff4d00) 8%, var(--color-surface,#ffffff))',
|
|
936
|
-
borderColor: 'color-mix(in srgb, var(--color-warning,#ff4d00) 40%, transparent)',
|
|
937
|
-
}}
|
|
938
|
-
>
|
|
939
|
-
<span className="font-mono text-[10px] text-[var(--color-warning,#ff4d00)]">{error}</span>
|
|
940
|
-
<button onClick={() => setError('')} className="text-[var(--color-warning,#ff4d00)] hover:opacity-70">
|
|
941
|
-
<X size={10} />
|
|
942
|
-
</button>
|
|
943
|
-
</div>
|
|
944
|
-
)}
|
|
945
|
-
|
|
946
|
-
{isLocked || !isConfigured ? (
|
|
947
|
-
/* Locked/unconfigured state - no workspace, no tabs, no apps */
|
|
948
|
-
<div className="flex-1 flex items-center justify-center">
|
|
949
|
-
<div className="text-center">
|
|
950
|
-
<Lock size={32} className="mx-auto mb-3 text-[var(--color-text-faint,#9ca3af)]" />
|
|
951
|
-
<div className="font-mono text-sm text-[var(--color-text-muted,#6b7280)]">
|
|
952
|
-
{!isConfigured ? 'WALLET NOT CONFIGURED' : 'AGENT LOCKED'}
|
|
953
|
-
</div>
|
|
954
|
-
<div className="font-mono text-[10px] text-[var(--color-text-faint,#9ca3af)] mt-1">
|
|
955
|
-
{!isConfigured ? 'Set up your wallet using the sidebar' : 'Unlock workspace access in the sidebar. Unlock each agent row separately.'}
|
|
956
|
-
</div>
|
|
957
|
-
</div>
|
|
958
|
-
</div>
|
|
959
|
-
) : (
|
|
960
|
-
<>
|
|
961
|
-
{/* Tab Bar - only shown when unlocked */}
|
|
962
|
-
<TabBar
|
|
963
|
-
tabs={tabs}
|
|
964
|
-
activeTab={activeWorkspaceId}
|
|
965
|
-
onTabChange={handleTabChange}
|
|
966
|
-
onTabClose={handleCloseTab}
|
|
967
|
-
onNewTab={handleNewTab}
|
|
968
|
-
onTabUpdate={handleTabUpdate}
|
|
969
|
-
onTidy={tidyApps}
|
|
970
|
-
onAppStore={() => setShowAppStore(true)}
|
|
971
|
-
notifications={notifications}
|
|
972
|
-
onDismissNotification={dismissNotification}
|
|
973
|
-
/>
|
|
974
|
-
|
|
975
|
-
{/* Content Area - Freeform Canvas */}
|
|
976
|
-
<div className="flex-1 relative overflow-y-auto overflow-x-hidden">
|
|
977
|
-
{workspaceLoading ? (
|
|
978
|
-
<div className="absolute inset-0 flex items-center justify-center">
|
|
979
|
-
<div className="text-center">
|
|
980
|
-
<Loader2 size={24} className="mx-auto mb-2 text-[var(--color-text-faint,#9ca3af)] animate-spin" />
|
|
981
|
-
<div className="font-mono text-[10px] text-[var(--color-text-muted,#6b7280)]">LOADING WORKSPACE...</div>
|
|
982
|
-
</div>
|
|
983
|
-
</div>
|
|
984
|
-
) : (
|
|
985
|
-
<div className="relative w-full h-full min-h-[800px]">
|
|
986
|
-
{/* Render apps from context */}
|
|
987
|
-
{workspaceApps.filter(w => w.isVisible).map((app) => (
|
|
988
|
-
<WorkspaceApp
|
|
989
|
-
key={app.id}
|
|
990
|
-
app={app}
|
|
991
|
-
onPositionChange={handleAppPositionChange}
|
|
992
|
-
onSizeChange={handleAppSizeChange}
|
|
993
|
-
onLockChange={handleAppLockChange}
|
|
994
|
-
onBringToFront={handleBringToFront}
|
|
995
|
-
onDismiss={handleDismissApp}
|
|
996
|
-
/>
|
|
997
|
-
))}
|
|
998
|
-
|
|
999
|
-
{/* Empty state */}
|
|
1000
|
-
{workspaceApps.length === 0 && (
|
|
1001
|
-
<div className="absolute inset-0 flex items-center justify-center pointer-events-none">
|
|
1002
|
-
<div className="text-center">
|
|
1003
|
-
<div className="font-mono text-sm text-[var(--color-text-muted,#6b7280)]">EMPTY WORKSPACE</div>
|
|
1004
|
-
<div className="font-mono text-[10px] text-[var(--color-text-faint,#9ca3af)] mt-1">Apps can be added via WebSocket or sidebar</div>
|
|
1005
|
-
</div>
|
|
1006
|
-
</div>
|
|
1007
|
-
)}
|
|
1008
|
-
</div>
|
|
1009
|
-
)}
|
|
1010
|
-
</div>
|
|
1011
|
-
|
|
1012
|
-
<HumanActionBar
|
|
1013
|
-
requests={requests}
|
|
1014
|
-
resolveAction={resolveAction}
|
|
1015
|
-
actionLoading={actionLoading}
|
|
1016
|
-
/>
|
|
1017
|
-
</>
|
|
1018
|
-
)}
|
|
1019
|
-
</div>
|
|
1020
|
-
|
|
1021
|
-
{/* Settings Drawer */}
|
|
1022
|
-
<Drawer
|
|
1023
|
-
isOpen={activeDrawer === 'settings'}
|
|
1024
|
-
onClose={() => setActiveDrawer(null)}
|
|
1025
|
-
title="SETTINGS"
|
|
1026
|
-
subtitle="System configuration"
|
|
1027
|
-
footerLabel=""
|
|
1028
|
-
>
|
|
1029
|
-
<SettingsContent
|
|
1030
|
-
chains={chains}
|
|
1031
|
-
editingChainRpc={editingChainRpc}
|
|
1032
|
-
setEditingChainRpc={setEditingChainRpc}
|
|
1033
|
-
customRpc={customRpc}
|
|
1034
|
-
setCustomRpc={setCustomRpc}
|
|
1035
|
-
savingConfig={savingConfig}
|
|
1036
|
-
handleSaveCustomRpc={handleSaveCustomRpc}
|
|
1037
|
-
handleRemoveChain={handleRemoveChain}
|
|
1038
|
-
exportedSeed={exportedSeed}
|
|
1039
|
-
setExportedSeed={setExportedSeed}
|
|
1040
|
-
exportPassword={exportPassword}
|
|
1041
|
-
setExportPassword={setExportPassword}
|
|
1042
|
-
exporting={exporting}
|
|
1043
|
-
handleExportSeed={handleExportSeed}
|
|
1044
|
-
copied={copied}
|
|
1045
|
-
setCopied={setCopied}
|
|
1046
|
-
confirmNuke={confirmNuke}
|
|
1047
|
-
nuking={nuking}
|
|
1048
|
-
handleNuke={handleNuke}
|
|
1049
|
-
backups={backups}
|
|
1050
|
-
backupsLoading={backupsLoading}
|
|
1051
|
-
creatingBackup={creatingBackup}
|
|
1052
|
-
restoringBackup={restoringBackup}
|
|
1053
|
-
onFetchBackups={fetchBackups}
|
|
1054
|
-
onCreateBackup={handleCreateBackup}
|
|
1055
|
-
onRestoreBackup={handleRestoreBackup}
|
|
1056
|
-
exportingDb={exportingDb}
|
|
1057
|
-
onExportDb={handleExportDb}
|
|
1058
|
-
showAddChainPopover={showAddChainModal}
|
|
1059
|
-
addChainAnchorEl={addChainAnchorEl}
|
|
1060
|
-
onOpenAddChain={(el) => { setAddChainAnchorEl(el); setShowAddChainModal(true); }}
|
|
1061
|
-
onCloseAddChain={() => { setShowAddChainModal(false); setAddChainAnchorEl(null); }}
|
|
1062
|
-
newChain={newChain}
|
|
1063
|
-
setNewChain={setNewChain}
|
|
1064
|
-
handleAddChain={handleAddChain}
|
|
1065
|
-
// Chain overrides props
|
|
1066
|
-
chainOverrides={chainOverrides}
|
|
1067
|
-
hasAlchemyKey={!!getApiKey('alchemy')}
|
|
1068
|
-
// Auth state
|
|
1069
|
-
isUnlocked={state?.isUnlocked ?? false}
|
|
1070
|
-
// API Keys props (from AuthContext)
|
|
1071
|
-
apiKeys={authApiKeys}
|
|
1072
|
-
apiKeysLoading={authApiKeysLoading}
|
|
1073
|
-
showAddApiKeyPopover={showAddApiKeyPopover}
|
|
1074
|
-
addApiKeyAnchorEl={addApiKeyAnchorEl}
|
|
1075
|
-
onOpenAddApiKey={(el) => { setAddApiKeyAnchorEl(el); setShowAddApiKeyPopover(true); }}
|
|
1076
|
-
onCloseAddApiKey={() => { setShowAddApiKeyPopover(false); setAddApiKeyAnchorEl(null); }}
|
|
1077
|
-
newApiKey={newApiKey}
|
|
1078
|
-
setNewApiKey={setNewApiKey}
|
|
1079
|
-
savingApiKey={savingApiKey}
|
|
1080
|
-
handleAddApiKey={handleAddApiKey}
|
|
1081
|
-
deletingApiKey={deletingApiKey}
|
|
1082
|
-
handleDeleteApiKey={handleDeleteApiKey}
|
|
1083
|
-
showRevokeAllApiKeysPopover={showRevokeAllApiKeysPopover}
|
|
1084
|
-
revokeAllApiKeysAnchorEl={revokeAllApiKeysAnchorEl}
|
|
1085
|
-
revokingAllApiKeys={revokingAllApiKeys}
|
|
1086
|
-
onOpenRevokeAllApiKeys={onOpenRevokeAllApiKeys}
|
|
1087
|
-
onCloseRevokeAllApiKeys={onCloseRevokeAllApiKeys}
|
|
1088
|
-
handleRevokeAllApiKeys={handleRevokeAllApiKeys}
|
|
1089
|
-
onAddAlchemyKey={handleAddAlchemyKey}
|
|
1090
|
-
/>
|
|
1091
|
-
</Drawer>
|
|
1092
|
-
|
|
1093
|
-
{/* Receive Drawer */}
|
|
1094
|
-
<Drawer
|
|
1095
|
-
isOpen={activeDrawer === 'receive'}
|
|
1096
|
-
onClose={() => setActiveDrawer(null)}
|
|
1097
|
-
title="RECEIVE"
|
|
1098
|
-
subtitle="Fund your wallets"
|
|
1099
|
-
>
|
|
1100
|
-
<ReceiveContent
|
|
1101
|
-
coldWallets={coldWallets}
|
|
1102
|
-
copyAddress={copyAddress}
|
|
1103
|
-
copied={copied}
|
|
1104
|
-
/>
|
|
1105
|
-
</Drawer>
|
|
1106
|
-
|
|
1107
|
-
{/* App Store Drawer - only accessible when unlocked */}
|
|
1108
|
-
<AppStoreDrawer
|
|
1109
|
-
isOpen={showAppStore && !isLocked && isConfigured}
|
|
1110
|
-
onClose={() => setShowAppStore(false)}
|
|
1111
|
-
onAddApp={handleAddAppFromStore}
|
|
1112
|
-
/>
|
|
1113
|
-
|
|
1114
|
-
{/* Import Seed Modal */}
|
|
1115
|
-
<Modal
|
|
1116
|
-
isOpen={showImportSeedModal}
|
|
1117
|
-
onClose={() => {
|
|
1118
|
-
setShowImportSeedModal(false);
|
|
1119
|
-
setImportSeedPhrase('');
|
|
1120
|
-
setImportPassword('');
|
|
1121
|
-
setImportConfirmPassword('');
|
|
1122
|
-
}}
|
|
1123
|
-
title="Import Seed Phrase"
|
|
1124
|
-
subtitle="Recovery"
|
|
1125
|
-
icon={<KeyRound size={20} className="text-[#0047ff]" />}
|
|
1126
|
-
size="md"
|
|
1127
|
-
>
|
|
1128
|
-
<form onSubmit={handleImportSeed} className="space-y-4">
|
|
1129
|
-
<div>
|
|
1130
|
-
<label className="font-mono text-[9px] text-[var(--color-text-muted,#6b7280)] tracking-widest block mb-1">
|
|
1131
|
-
SEED_PHRASE
|
|
1132
|
-
</label>
|
|
1133
|
-
<textarea
|
|
1134
|
-
value={importSeedPhrase}
|
|
1135
|
-
onChange={(e) => setImportSeedPhrase(e.target.value)}
|
|
1136
|
-
placeholder="Enter your 12 or 24 word seed phrase..."
|
|
1137
|
-
rows={3}
|
|
1138
|
-
className="w-full px-3 py-2 border border-[var(--color-border,#d4d4d8)] font-mono text-xs focus:outline-none focus:border-[var(--color-border-focus,#0a0a0a)] bg-[var(--color-surface,#ffffff)] text-[var(--color-text,#0a0a0a)] resize-none"
|
|
1139
|
-
/>
|
|
1140
|
-
</div>
|
|
1141
|
-
<div>
|
|
1142
|
-
<label className="font-mono text-[9px] text-[var(--color-text-muted,#6b7280)] tracking-widest block mb-1">
|
|
1143
|
-
NEW_PASSWORD
|
|
1144
|
-
</label>
|
|
1145
|
-
<input
|
|
1146
|
-
type="password"
|
|
1147
|
-
value={importPassword}
|
|
1148
|
-
onChange={(e) => setImportPassword(e.target.value)}
|
|
1149
|
-
placeholder="Min 8 characters"
|
|
1150
|
-
className="w-full px-3 py-2 border border-[var(--color-border,#d4d4d8)] font-mono text-xs focus:outline-none focus:border-[var(--color-border-focus,#0a0a0a)] bg-[var(--color-surface,#ffffff)] text-[var(--color-text,#0a0a0a)]"
|
|
1151
|
-
/>
|
|
1152
|
-
</div>
|
|
1153
|
-
<div>
|
|
1154
|
-
<label className="font-mono text-[9px] text-[var(--color-text-muted,#6b7280)] tracking-widest block mb-1">
|
|
1155
|
-
CONFIRM_PASSWORD
|
|
1156
|
-
</label>
|
|
1157
|
-
<input
|
|
1158
|
-
type="password"
|
|
1159
|
-
value={importConfirmPassword}
|
|
1160
|
-
onChange={(e) => setImportConfirmPassword(e.target.value)}
|
|
1161
|
-
placeholder="Confirm password"
|
|
1162
|
-
className="w-full px-3 py-2 border border-[var(--color-border,#d4d4d8)] font-mono text-xs focus:outline-none focus:border-[var(--color-border-focus,#0a0a0a)] bg-[var(--color-surface,#ffffff)] text-[var(--color-text,#0a0a0a)]"
|
|
1163
|
-
/>
|
|
1164
|
-
</div>
|
|
1165
|
-
<div className="p-3 bg-[var(--color-info,#0047ff)]/5 border border-[var(--color-info,#0047ff)]/30">
|
|
1166
|
-
<div className="font-mono text-[9px] text-[var(--color-text-muted,#6b7280)] leading-relaxed">
|
|
1167
|
-
This will restore your wallet from the seed phrase. All hot wallets will be re-derived from this seed.
|
|
1168
|
-
</div>
|
|
1169
|
-
</div>
|
|
1170
|
-
<div className="flex gap-2">
|
|
1171
|
-
<button
|
|
1172
|
-
type="button"
|
|
1173
|
-
onClick={() => {
|
|
1174
|
-
setShowImportSeedModal(false);
|
|
1175
|
-
setImportSeedPhrase('');
|
|
1176
|
-
setImportPassword('');
|
|
1177
|
-
setImportConfirmPassword('');
|
|
1178
|
-
}}
|
|
1179
|
-
className="flex-1 h-10 border border-[var(--color-border,#d4d4d8)] font-mono text-[10px] tracking-widest text-[var(--color-text-muted,#6b7280)] hover:border-[var(--color-border-focus,#0a0a0a)] hover:text-[var(--color-text,#0a0a0a)] transition-colors"
|
|
1180
|
-
>
|
|
1181
|
-
CANCEL
|
|
1182
|
-
</button>
|
|
1183
|
-
<button
|
|
1184
|
-
type="submit"
|
|
1185
|
-
disabled={importing || !importSeedPhrase || !importPassword || !importConfirmPassword}
|
|
1186
|
-
className="flex-1 h-10 bg-[var(--color-text,#0a0a0a)] text-white font-mono text-[10px] tracking-widest flex items-center justify-center gap-2 disabled:opacity-50 hover:text-[var(--color-accent,#ccff00)] transition-colors"
|
|
1187
|
-
>
|
|
1188
|
-
{importing ? <Loader2 size={12} className="animate-spin" /> : <KeyRound size={12} />}
|
|
1189
|
-
{importing ? 'IMPORTING...' : 'IMPORT'}
|
|
1190
|
-
</button>
|
|
1191
|
-
</div>
|
|
1192
|
-
</form>
|
|
1193
|
-
</Modal>
|
|
1194
|
-
|
|
1195
|
-
{/* Passkey Enrollment Prompt - shown after unlock if passkeys not yet registered */}
|
|
1196
|
-
<PasskeyEnrollmentPrompt isUnlocked={state?.isUnlocked ?? false} />
|
|
1197
|
-
</div>
|
|
1198
|
-
);
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
|
-
// WorkspaceApp - Renders a app from the workspace context
|
|
1202
|
-
// All apps are self-contained and only receive config
|
|
1203
|
-
interface WorkspaceAppProps {
|
|
1204
|
-
app: WorkspaceAppState;
|
|
1205
|
-
onPositionChange: (id: string, pos: { x: number; y: number }) => void;
|
|
1206
|
-
onSizeChange: (id: string, size: { width: number; height: number }) => void;
|
|
1207
|
-
onLockChange: (id: string, locked: boolean) => void;
|
|
1208
|
-
onBringToFront: (id: string) => void;
|
|
1209
|
-
onDismiss: (id: string) => void;
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
function WorkspaceApp({
|
|
1213
|
-
app,
|
|
1214
|
-
onPositionChange,
|
|
1215
|
-
onSizeChange,
|
|
1216
|
-
onLockChange,
|
|
1217
|
-
onBringToFront,
|
|
1218
|
-
onDismiss,
|
|
1219
|
-
}: WorkspaceAppProps) {
|
|
1220
|
-
const [refreshKey, setRefreshKey] = useState(0);
|
|
1221
|
-
const isThirdParty = app.appType.startsWith('installed:');
|
|
1222
|
-
const definition = getAppDefinition(app.appType);
|
|
1223
|
-
|
|
1224
|
-
if (!definition) {
|
|
1225
|
-
return (
|
|
1226
|
-
<DraggableApp
|
|
1227
|
-
id={app.id}
|
|
1228
|
-
title={`UNKNOWN: ${app.appType}`}
|
|
1229
|
-
icon={Code}
|
|
1230
|
-
color="gray"
|
|
1231
|
-
initialPosition={{ x: app.x, y: app.y }}
|
|
1232
|
-
initialSize={{ width: app.width, height: app.height }}
|
|
1233
|
-
locked={app.isLocked}
|
|
1234
|
-
onLockChange={onLockChange}
|
|
1235
|
-
dismissable
|
|
1236
|
-
onDismiss={() => onDismiss(app.id)}
|
|
1237
|
-
onPositionChange={onPositionChange}
|
|
1238
|
-
onSizeChange={onSizeChange}
|
|
1239
|
-
onBringToFront={onBringToFront}
|
|
1240
|
-
zIndex={app.zIndex}
|
|
1241
|
-
>
|
|
1242
|
-
<div className="py-4 text-center">
|
|
1243
|
-
<Code size={20} className="mx-auto mb-2 text-[var(--color-text-faint,#9ca3af)]" />
|
|
1244
|
-
<div className="font-mono text-[9px] text-[var(--color-text-muted,#6b7280)]">UNKNOWN APP TYPE</div>
|
|
1245
|
-
<div className="font-mono text-[8px] text-[var(--color-text-faint,#9ca3af)] mt-1">{app.appType}</div>
|
|
1246
|
-
</div>
|
|
1247
|
-
</DraggableApp>
|
|
1248
|
-
);
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
const AppComponent = definition.component;
|
|
1252
|
-
|
|
1253
|
-
// All apps are self-contained - just pass config
|
|
1254
|
-
const renderContent = () => {
|
|
1255
|
-
const config = isThirdParty
|
|
1256
|
-
? {
|
|
1257
|
-
appPath: app.appType.slice(10), // installed:agent-chat -> agent-chat
|
|
1258
|
-
...app.config, // Explicit config (if present) wins
|
|
1259
|
-
_refreshKey: refreshKey,
|
|
1260
|
-
}
|
|
1261
|
-
: app.config;
|
|
1262
|
-
return (
|
|
1263
|
-
<Suspense fallback={<AppLoading />}>
|
|
1264
|
-
<AppComponent config={config} />
|
|
1265
|
-
</Suspense>
|
|
1266
|
-
);
|
|
1267
|
-
};
|
|
1268
|
-
|
|
1269
|
-
// Get title for wallet detail apps (use config passed when app was opened)
|
|
1270
|
-
const getTitle = () => {
|
|
1271
|
-
if (app.appType === 'walletDetail') {
|
|
1272
|
-
const emoji = app.config?.walletEmoji as string | undefined;
|
|
1273
|
-
const name = app.config?.walletName as string | undefined;
|
|
1274
|
-
if (emoji || name) {
|
|
1275
|
-
return emoji ? `${emoji} ${name || 'WALLET'}` : (name || 'WALLET');
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
return definition.title;
|
|
1279
|
-
};
|
|
1280
|
-
|
|
1281
|
-
// Get color for wallet detail apps (use config passed when app was opened)
|
|
1282
|
-
const getColor = (): AppColor => {
|
|
1283
|
-
if (app.appType === 'walletDetail') {
|
|
1284
|
-
const color = app.config?.walletColor as string | undefined;
|
|
1285
|
-
if (color) {
|
|
1286
|
-
const colorMap: Record<string, AppColor> = {
|
|
1287
|
-
'#ff4d00': 'orange',
|
|
1288
|
-
'#0047ff': 'blue',
|
|
1289
|
-
'#00c853': 'teal',
|
|
1290
|
-
'#ffab00': 'orange',
|
|
1291
|
-
'#9c27b0': 'purple',
|
|
1292
|
-
'#00bcd4': 'teal',
|
|
1293
|
-
'#e91e63': 'rose',
|
|
1294
|
-
'#607d8b': 'gray',
|
|
1295
|
-
};
|
|
1296
|
-
return colorMap[color] || 'orange';
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
return definition.color;
|
|
1300
|
-
};
|
|
1301
|
-
|
|
1302
|
-
// Get subtitle for iframe apps (show URL hostname)
|
|
1303
|
-
const getSubtitle = () => {
|
|
1304
|
-
if (app.appType === 'iframe' && app.config?.url) {
|
|
1305
|
-
try {
|
|
1306
|
-
const url = new URL(app.config.url as string);
|
|
1307
|
-
return url.hostname;
|
|
1308
|
-
} catch {
|
|
1309
|
-
return undefined;
|
|
1310
|
-
}
|
|
1311
|
-
}
|
|
1312
|
-
return undefined;
|
|
1313
|
-
};
|
|
1314
|
-
|
|
1315
|
-
const getSubtitleLink = () => {
|
|
1316
|
-
if (app.appType === 'iframe' && app.config?.url) {
|
|
1317
|
-
return app.config.url as string;
|
|
1318
|
-
}
|
|
1319
|
-
return undefined;
|
|
1320
|
-
};
|
|
1321
|
-
|
|
1322
|
-
return (
|
|
1323
|
-
<DraggableApp
|
|
1324
|
-
id={app.id}
|
|
1325
|
-
title={getTitle()}
|
|
1326
|
-
subtitle={getSubtitle()}
|
|
1327
|
-
subtitleLink={getSubtitleLink()}
|
|
1328
|
-
icon={definition.icon}
|
|
1329
|
-
color={getColor()}
|
|
1330
|
-
initialPosition={{ x: app.x, y: app.y }}
|
|
1331
|
-
initialSize={{ width: app.width, height: app.height }}
|
|
1332
|
-
locked={app.isLocked}
|
|
1333
|
-
onLockChange={onLockChange}
|
|
1334
|
-
onRefresh={isThirdParty ? () => setRefreshKey(k => k + 1) : undefined}
|
|
1335
|
-
dismissable
|
|
1336
|
-
onDismiss={() => onDismiss(app.id)}
|
|
1337
|
-
onPositionChange={onPositionChange}
|
|
1338
|
-
onSizeChange={onSizeChange}
|
|
1339
|
-
onBringToFront={onBringToFront}
|
|
1340
|
-
zIndex={app.zIndex}
|
|
1341
|
-
>
|
|
1342
|
-
{renderContent()}
|
|
1343
|
-
</DraggableApp>
|
|
1344
|
-
);
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
function AppLoading() {
|
|
1348
|
-
return (
|
|
1349
|
-
<div className="py-6 text-center">
|
|
1350
|
-
<Loader2 size={20} className="mx-auto mb-2 text-[var(--color-text-faint,#9ca3af)] animate-spin" />
|
|
1351
|
-
<div className="font-mono text-[9px] text-[var(--color-text-muted,#6b7280)]">LOADING...</div>
|
|
1352
|
-
</div>
|
|
1353
|
-
);
|
|
1354
|
-
}
|
|
1355
|
-
|
|
1356
|
-
interface BackupInfo {
|
|
1357
|
-
filename: string;
|
|
1358
|
-
timestamp: string;
|
|
1359
|
-
size: number;
|
|
1360
|
-
date: string;
|
|
1361
|
-
}
|
|
1362
|
-
|
|
1363
|
-
function SettingsContent({
|
|
1364
|
-
chains,
|
|
1365
|
-
editingChainRpc,
|
|
1366
|
-
setEditingChainRpc,
|
|
1367
|
-
customRpc,
|
|
1368
|
-
setCustomRpc,
|
|
1369
|
-
savingConfig,
|
|
1370
|
-
handleSaveCustomRpc,
|
|
1371
|
-
handleRemoveChain,
|
|
1372
|
-
exportedSeed,
|
|
1373
|
-
setExportedSeed,
|
|
1374
|
-
exportPassword,
|
|
1375
|
-
setExportPassword,
|
|
1376
|
-
exporting,
|
|
1377
|
-
handleExportSeed,
|
|
1378
|
-
copied,
|
|
1379
|
-
setCopied,
|
|
1380
|
-
confirmNuke,
|
|
1381
|
-
nuking,
|
|
1382
|
-
handleNuke,
|
|
1383
|
-
backups,
|
|
1384
|
-
backupsLoading,
|
|
1385
|
-
creatingBackup,
|
|
1386
|
-
restoringBackup,
|
|
1387
|
-
onFetchBackups,
|
|
1388
|
-
onCreateBackup,
|
|
1389
|
-
onRestoreBackup,
|
|
1390
|
-
exportingDb,
|
|
1391
|
-
onExportDb,
|
|
1392
|
-
showAddChainPopover,
|
|
1393
|
-
addChainAnchorEl,
|
|
1394
|
-
onOpenAddChain,
|
|
1395
|
-
onCloseAddChain,
|
|
1396
|
-
newChain,
|
|
1397
|
-
setNewChain,
|
|
1398
|
-
handleAddChain,
|
|
1399
|
-
// Chain overrides props
|
|
1400
|
-
chainOverrides,
|
|
1401
|
-
hasAlchemyKey,
|
|
1402
|
-
// Auth state
|
|
1403
|
-
isUnlocked,
|
|
1404
|
-
// API Keys props
|
|
1405
|
-
apiKeys,
|
|
1406
|
-
apiKeysLoading,
|
|
1407
|
-
showAddApiKeyPopover,
|
|
1408
|
-
addApiKeyAnchorEl,
|
|
1409
|
-
onOpenAddApiKey,
|
|
1410
|
-
onCloseAddApiKey,
|
|
1411
|
-
newApiKey,
|
|
1412
|
-
setNewApiKey,
|
|
1413
|
-
savingApiKey,
|
|
1414
|
-
handleAddApiKey,
|
|
1415
|
-
deletingApiKey,
|
|
1416
|
-
handleDeleteApiKey,
|
|
1417
|
-
showRevokeAllApiKeysPopover,
|
|
1418
|
-
revokeAllApiKeysAnchorEl,
|
|
1419
|
-
revokingAllApiKeys,
|
|
1420
|
-
onOpenRevokeAllApiKeys,
|
|
1421
|
-
onCloseRevokeAllApiKeys,
|
|
1422
|
-
handleRevokeAllApiKeys,
|
|
1423
|
-
onAddAlchemyKey,
|
|
1424
|
-
}: {
|
|
1425
|
-
chains: Record<string, { rpc: string; chainId: number; explorer: string; nativeCurrency: string }>;
|
|
1426
|
-
editingChainRpc: string | null;
|
|
1427
|
-
setEditingChainRpc: (c: string | null) => void;
|
|
1428
|
-
customRpc: string;
|
|
1429
|
-
setCustomRpc: (r: string) => void;
|
|
1430
|
-
savingConfig: boolean;
|
|
1431
|
-
handleSaveCustomRpc: (chain: string, rpc: string) => void;
|
|
1432
|
-
handleRemoveChain: (chain: string) => void;
|
|
1433
|
-
exportedSeed: string | null;
|
|
1434
|
-
setExportedSeed: (s: string | null) => void;
|
|
1435
|
-
exportPassword: string;
|
|
1436
|
-
setExportPassword: (p: string) => void;
|
|
1437
|
-
exporting: boolean;
|
|
1438
|
-
handleExportSeed: (e: React.FormEvent) => void;
|
|
1439
|
-
copied: string | null;
|
|
1440
|
-
setCopied: (c: string | null) => void;
|
|
1441
|
-
confirmNuke: boolean;
|
|
1442
|
-
nuking: boolean;
|
|
1443
|
-
handleNuke: () => void;
|
|
1444
|
-
backups: BackupInfo[];
|
|
1445
|
-
backupsLoading: boolean;
|
|
1446
|
-
creatingBackup: boolean;
|
|
1447
|
-
restoringBackup: string | null;
|
|
1448
|
-
onFetchBackups: () => void;
|
|
1449
|
-
onCreateBackup: () => void;
|
|
1450
|
-
onRestoreBackup: (filename: string) => void;
|
|
1451
|
-
exportingDb: boolean;
|
|
1452
|
-
onExportDb: () => void;
|
|
1453
|
-
showAddChainPopover: boolean;
|
|
1454
|
-
addChainAnchorEl: HTMLElement | null;
|
|
1455
|
-
onOpenAddChain: (el: HTMLElement) => void;
|
|
1456
|
-
onCloseAddChain: () => void;
|
|
1457
|
-
newChain: { name: string; chainId: string; rpc: string; explorer: string; nativeCurrency: string };
|
|
1458
|
-
setNewChain: (c: { name: string; chainId: string; rpc: string; explorer: string; nativeCurrency: string }) => void;
|
|
1459
|
-
// Chain overrides types
|
|
1460
|
-
chainOverrides: Record<string, ChainConfig>;
|
|
1461
|
-
hasAlchemyKey: boolean;
|
|
1462
|
-
// Auth state
|
|
1463
|
-
isUnlocked: boolean;
|
|
1464
|
-
// API Keys types
|
|
1465
|
-
apiKeys: ApiKey[];
|
|
1466
|
-
apiKeysLoading: boolean;
|
|
1467
|
-
showAddApiKeyPopover: boolean;
|
|
1468
|
-
addApiKeyAnchorEl: HTMLElement | null;
|
|
1469
|
-
onOpenAddApiKey: (el: HTMLElement) => void;
|
|
1470
|
-
onCloseAddApiKey: () => void;
|
|
1471
|
-
newApiKey: { service: string; name: string; key: string };
|
|
1472
|
-
setNewApiKey: (k: { service: string; name: string; key: string }) => void;
|
|
1473
|
-
savingApiKey: boolean;
|
|
1474
|
-
handleAddApiKey: () => void;
|
|
1475
|
-
deletingApiKey: string | null;
|
|
1476
|
-
handleDeleteApiKey: (id: string) => void;
|
|
1477
|
-
showRevokeAllApiKeysPopover: boolean;
|
|
1478
|
-
revokeAllApiKeysAnchorEl: HTMLElement | null;
|
|
1479
|
-
revokingAllApiKeys: boolean;
|
|
1480
|
-
onOpenRevokeAllApiKeys: (el: HTMLElement) => void;
|
|
1481
|
-
onCloseRevokeAllApiKeys: () => void;
|
|
1482
|
-
handleRevokeAllApiKeys: () => void;
|
|
1483
|
-
handleAddChain: () => void;
|
|
1484
|
-
onAddAlchemyKey: (key: string) => Promise<boolean>;
|
|
1485
|
-
}) {
|
|
1486
|
-
const [restoreConfirmOpen, setRestoreConfirmOpen] = React.useState<string | null>(null);
|
|
1487
|
-
const [restoreAnchorEl, setRestoreAnchorEl] = React.useState<HTMLElement | null>(null);
|
|
1488
|
-
const [alchemyKeyInput, setAlchemyKeyInput] = React.useState('');
|
|
1489
|
-
const [addingAlchemyKey, setAddingAlchemyKey] = React.useState(false);
|
|
1490
|
-
|
|
1491
|
-
// Fetch backups when component mounts (only if unlocked)
|
|
1492
|
-
React.useEffect(() => {
|
|
1493
|
-
if (isUnlocked) {
|
|
1494
|
-
onFetchBackups();
|
|
1495
|
-
}
|
|
1496
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1497
|
-
}, [isUnlocked]);
|
|
1498
|
-
|
|
1499
|
-
// Handle adding Alchemy API key
|
|
1500
|
-
const handleAlchemyKeySubmit = async () => {
|
|
1501
|
-
if (!alchemyKeyInput.trim()) return;
|
|
1502
|
-
setAddingAlchemyKey(true);
|
|
1503
|
-
const success = await onAddAlchemyKey(alchemyKeyInput.trim());
|
|
1504
|
-
if (success) {
|
|
1505
|
-
setAlchemyKeyInput('');
|
|
1506
|
-
}
|
|
1507
|
-
setAddingAlchemyKey(false);
|
|
1508
|
-
};
|
|
1509
|
-
|
|
1510
|
-
const formatBackupDate = (timestamp: string) => {
|
|
1511
|
-
// timestamp format: YYYYMMDD_HHMMSS
|
|
1512
|
-
const year = timestamp.slice(0, 4);
|
|
1513
|
-
const month = timestamp.slice(4, 6);
|
|
1514
|
-
const day = timestamp.slice(6, 8);
|
|
1515
|
-
const hour = timestamp.slice(9, 11);
|
|
1516
|
-
const minute = timestamp.slice(11, 13);
|
|
1517
|
-
return `${year}-${month}-${day} ${hour}:${minute}`;
|
|
1518
|
-
};
|
|
1519
|
-
|
|
1520
|
-
const formatSize = (bytes: number) => {
|
|
1521
|
-
if (bytes < 1024) return `${bytes} B`;
|
|
1522
|
-
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
1523
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
1524
|
-
};
|
|
1525
|
-
// Alchemy-supported chains
|
|
1526
|
-
const alchemyChains = ['base', 'ethereum', 'arbitrum', 'optimism'];
|
|
1527
|
-
|
|
1528
|
-
// Get the RPC source for a chain (override, alchemy, or public)
|
|
1529
|
-
const getRpcSource = (chainName: string): 'override' | 'alchemy' | 'public' => {
|
|
1530
|
-
if (chainOverrides[chainName]) return 'override';
|
|
1531
|
-
if (hasAlchemyKey && alchemyChains.includes(chainName)) return 'alchemy';
|
|
1532
|
-
return 'public';
|
|
1533
|
-
};
|
|
1534
|
-
|
|
1535
|
-
const [agentSectionOpen, setAgentSectionOpen] = React.useState(false);
|
|
1536
|
-
const [agentTier, setAgentTier] = React.useState<string>('admin');
|
|
1537
|
-
const [agentTierLoading, setAgentTierLoading] = React.useState(true);
|
|
1538
|
-
const [agentTierSaving, setAgentTierSaving] = React.useState(false);
|
|
1539
|
-
|
|
1540
|
-
// Fetch agent tier on mount
|
|
1541
|
-
React.useEffect(() => {
|
|
1542
|
-
(async () => {
|
|
1543
|
-
try {
|
|
1544
|
-
const grouped = await api.get<Record<string, Array<{ key: string; value: unknown }>>>(Api.Wallet, '/defaults');
|
|
1545
|
-
const permsGroup = grouped.permissions || [];
|
|
1546
|
-
const tierRow = permsGroup.find((r: { key: string }) => r.key === 'permissions.agent_tier');
|
|
1547
|
-
if (tierRow) setAgentTier(tierRow.value as string);
|
|
1548
|
-
} catch { /* use default */ }
|
|
1549
|
-
finally { setAgentTierLoading(false); }
|
|
1550
|
-
})();
|
|
1551
|
-
}, []);
|
|
1552
|
-
|
|
1553
|
-
const handleTierChange = async (tier: string) => {
|
|
1554
|
-
setAgentTier(tier);
|
|
1555
|
-
setAgentTierSaving(true);
|
|
1556
|
-
try {
|
|
1557
|
-
await api.patch(Api.Wallet, `/defaults/${encodeURIComponent('permissions.agent_tier')}`, { value: tier });
|
|
1558
|
-
} catch { /* revert on error */ setAgentTier(tier === 'admin' ? 'restricted' : 'admin'); }
|
|
1559
|
-
finally { setAgentTierSaving(false); }
|
|
1560
|
-
};
|
|
1561
|
-
|
|
1562
|
-
const [systemDefaultsOpen, setSystemDefaultsOpen] = React.useState(false);
|
|
1563
|
-
const [rpcOpen, setRpcOpen] = React.useState(false);
|
|
1564
|
-
const [apiKeysOpen, setApiKeysOpen] = React.useState(false);
|
|
1565
|
-
const [exportSeedOpen, setExportSeedOpen] = React.useState(false);
|
|
1566
|
-
const [backupOpen, setBackupOpen] = React.useState(false);
|
|
1567
|
-
const [dangerOpen, setDangerOpen] = React.useState(false);
|
|
1568
|
-
|
|
1569
|
-
return (
|
|
1570
|
-
<div className="space-y-4">
|
|
1571
|
-
{/* DEFAULT_AGENT — permission tier + AI model */}
|
|
1572
|
-
<TyvekCollapsibleSection
|
|
1573
|
-
title="DEFAULT_AGENT"
|
|
1574
|
-
icon={<Bot size={12} />}
|
|
1575
|
-
isOpen={agentSectionOpen}
|
|
1576
|
-
onToggle={() => setAgentSectionOpen(!agentSectionOpen)}
|
|
1577
|
-
contentClassName="p-4 pt-0 space-y-4"
|
|
1578
|
-
>
|
|
1579
|
-
{/* Permission Tier Toggle */}
|
|
1580
|
-
<div className="p-3 space-y-2 border border-[var(--color-border)] bg-[var(--color-surface)]">
|
|
1581
|
-
<div className="font-mono text-[10px] text-[var(--color-text)]">Permission Tier</div>
|
|
1582
|
-
<div className="font-mono text-[8px] text-[var(--color-text-muted)]">
|
|
1583
|
-
Controls what the agent-chat app can do directly
|
|
1584
|
-
</div>
|
|
1585
|
-
{agentTierLoading ? (
|
|
1586
|
-
<div className="flex items-center gap-2 py-2">
|
|
1587
|
-
<Loader2 size={12} className="animate-spin text-[var(--color-text-muted)]" />
|
|
1588
|
-
</div>
|
|
1589
|
-
) : (
|
|
1590
|
-
<div className="flex gap-2">
|
|
1591
|
-
<Button
|
|
1592
|
-
type="button"
|
|
1593
|
-
onClick={() => handleTierChange('admin')}
|
|
1594
|
-
disabled={agentTierSaving}
|
|
1595
|
-
variant={agentTier === 'admin' ? 'secondary' : 'ghost'}
|
|
1596
|
-
size="md"
|
|
1597
|
-
className={`flex-1 !h-auto !p-2 !justify-start border ${
|
|
1598
|
-
agentTier === 'admin'
|
|
1599
|
-
? 'border-[var(--color-accent)] text-[var(--color-text)] bg-[var(--color-background-alt)]'
|
|
1600
|
-
: 'border-[var(--color-border)] text-[var(--color-text-muted)]'
|
|
1601
|
-
}`}
|
|
1602
|
-
>
|
|
1603
|
-
<div className="text-left">
|
|
1604
|
-
<div className="font-bold text-[9px] tracking-normal">Full Admin</div>
|
|
1605
|
-
<div className="text-[8px] tracking-normal text-[var(--color-text-muted)]">Agent can do everything directly</div>
|
|
1606
|
-
</div>
|
|
1607
|
-
</Button>
|
|
1608
|
-
<Button
|
|
1609
|
-
type="button"
|
|
1610
|
-
onClick={() => handleTierChange('restricted')}
|
|
1611
|
-
disabled={agentTierSaving}
|
|
1612
|
-
variant={agentTier === 'restricted' ? 'secondary' : 'ghost'}
|
|
1613
|
-
size="md"
|
|
1614
|
-
className={`flex-1 !h-auto !p-2 !justify-start border ${
|
|
1615
|
-
agentTier === 'restricted'
|
|
1616
|
-
? 'border-[var(--color-accent)] text-[var(--color-text)] bg-[var(--color-background-alt)]'
|
|
1617
|
-
: 'border-[var(--color-border)] text-[var(--color-text-muted)]'
|
|
1618
|
-
}`}
|
|
1619
|
-
>
|
|
1620
|
-
<div className="text-left">
|
|
1621
|
-
<div className="font-bold text-[9px] tracking-normal">Restricted</div>
|
|
1622
|
-
<div className="text-[8px] tracking-normal text-[var(--color-text-muted)]">Approval required for actions</div>
|
|
1623
|
-
</div>
|
|
1624
|
-
</Button>
|
|
1625
|
-
</div>
|
|
1626
|
-
)}
|
|
1627
|
-
</div>
|
|
1628
|
-
|
|
1629
|
-
{/* AI Model Selection (moved from SystemDefaults) */}
|
|
1630
|
-
<AiEngineSection />
|
|
1631
|
-
</TyvekCollapsibleSection>
|
|
1632
|
-
|
|
1633
|
-
{/* System Defaults (limits, permissions, AI engine) — collapsible */}
|
|
1634
|
-
<TyvekCollapsibleSection
|
|
1635
|
-
title="SYSTEM_DEFAULTS"
|
|
1636
|
-
icon={<Settings size={12} />}
|
|
1637
|
-
isOpen={systemDefaultsOpen}
|
|
1638
|
-
onToggle={() => setSystemDefaultsOpen(!systemDefaultsOpen)}
|
|
1639
|
-
>
|
|
1640
|
-
<SystemDefaults />
|
|
1641
|
-
</TyvekCollapsibleSection>
|
|
1642
|
-
|
|
1643
|
-
{/* RPC Configuration */}
|
|
1644
|
-
<TyvekCollapsibleSection
|
|
1645
|
-
title="RPC_CONFIGURATION"
|
|
1646
|
-
icon={<Code size={12} />}
|
|
1647
|
-
isOpen={rpcOpen}
|
|
1648
|
-
onToggle={() => setRpcOpen(!rpcOpen)}
|
|
1649
|
-
contentClassName="p-4 pt-0"
|
|
1650
|
-
>
|
|
1651
|
-
<div className="p-3 bg-[var(--color-background-alt)] border border-[var(--color-border)] space-y-4">
|
|
1652
|
-
{/* Quick Setup - Alchemy API Key */}
|
|
1653
|
-
<div className="p-3 border border-dashed border-[var(--color-border)] bg-[var(--color-surface)]">
|
|
1654
|
-
<div className="font-mono text-[9px] text-[var(--color-text-muted)] uppercase tracking-widest mb-2">ALCHEMY API KEY</div>
|
|
1655
|
-
{hasAlchemyKey ? (
|
|
1656
|
-
<div className="space-y-2">
|
|
1657
|
-
<div className="flex items-center gap-2">
|
|
1658
|
-
<Check size={12} className="text-[var(--color-success)]" />
|
|
1659
|
-
<span className="font-mono text-[10px] text-[var(--color-success)]">Configured</span>
|
|
1660
|
-
<span className="font-mono text-[8px] text-[var(--color-text-muted)]">
|
|
1661
|
-
(auto-configures: {alchemyChains.join(', ')})
|
|
1662
|
-
</span>
|
|
1663
|
-
</div>
|
|
1664
|
-
<div className="font-mono text-[8px] text-[var(--color-text-faint)] leading-relaxed">
|
|
1665
|
-
Remove in API Keys section below. Custom overrides take priority.
|
|
1666
|
-
</div>
|
|
1667
|
-
</div>
|
|
1668
|
-
) : (
|
|
1669
|
-
<div className="space-y-2">
|
|
1670
|
-
<div className="font-mono text-[8px] text-[var(--color-text-muted)] leading-relaxed mb-2">
|
|
1671
|
-
Get a free key at alchemy.com to auto-configure: {alchemyChains.join(', ')}
|
|
1672
|
-
</div>
|
|
1673
|
-
<div className="flex gap-2">
|
|
1674
|
-
<div className="flex-1">
|
|
1675
|
-
<TextInput
|
|
1676
|
-
label=""
|
|
1677
|
-
type="password"
|
|
1678
|
-
value={alchemyKeyInput}
|
|
1679
|
-
onChange={(e) => setAlchemyKeyInput(e.target.value)}
|
|
1680
|
-
placeholder="Paste your Alchemy API key..."
|
|
1681
|
-
compact
|
|
1682
|
-
/>
|
|
1683
|
-
</div>
|
|
1684
|
-
<Button
|
|
1685
|
-
size="sm"
|
|
1686
|
-
onClick={handleAlchemyKeySubmit}
|
|
1687
|
-
disabled={addingAlchemyKey || !alchemyKeyInput.trim()}
|
|
1688
|
-
loading={addingAlchemyKey}
|
|
1689
|
-
icon={!addingAlchemyKey ? <Plus size={10} /> : undefined}
|
|
1690
|
-
>
|
|
1691
|
-
ADD
|
|
1692
|
-
</Button>
|
|
1693
|
-
</div>
|
|
1694
|
-
<div className="font-mono text-[8px] text-[var(--color-text-faint)] leading-relaxed">
|
|
1695
|
-
Currently using public RPCs (may have rate limits).
|
|
1696
|
-
</div>
|
|
1697
|
-
</div>
|
|
1698
|
-
)}
|
|
1699
|
-
</div>
|
|
1700
|
-
|
|
1701
|
-
{/* Chain Overrides */}
|
|
1702
|
-
<div>
|
|
1703
|
-
<div className="flex items-center justify-between mb-2">
|
|
1704
|
-
<div className="font-mono text-[9px] text-[var(--color-text-muted)] uppercase tracking-widest">CHAIN OVERRIDES</div>
|
|
1705
|
-
<div className="relative">
|
|
1706
|
-
<Button
|
|
1707
|
-
variant="ghost"
|
|
1708
|
-
size="sm"
|
|
1709
|
-
onClick={(e) => onOpenAddChain(e.currentTarget)}
|
|
1710
|
-
icon={<Plus size={10} />}
|
|
1711
|
-
>
|
|
1712
|
-
ADD
|
|
1713
|
-
</Button>
|
|
1714
|
-
<Popover
|
|
1715
|
-
isOpen={showAddChainPopover}
|
|
1716
|
-
onClose={onCloseAddChain}
|
|
1717
|
-
title="ADD_CHAIN"
|
|
1718
|
-
anchorEl={addChainAnchorEl}
|
|
1719
|
-
anchor="right"
|
|
1720
|
-
className="w-64"
|
|
1721
|
-
>
|
|
1722
|
-
<div className="space-y-3">
|
|
1723
|
-
<div className="font-mono text-[8px] text-[var(--color-text-muted)] leading-relaxed">
|
|
1724
|
-
Known chains: arbitrum, optimism, polygon, zksync
|
|
1725
|
-
</div>
|
|
1726
|
-
<TextInput
|
|
1727
|
-
label="NAME"
|
|
1728
|
-
type="text"
|
|
1729
|
-
value={newChain.name}
|
|
1730
|
-
onChange={(e) => setNewChain({ ...newChain, name: e.target.value })}
|
|
1731
|
-
placeholder="arbitrum, polygon, zksync..."
|
|
1732
|
-
compact
|
|
1733
|
-
/>
|
|
1734
|
-
<TextInput
|
|
1735
|
-
label="CHAIN_ID"
|
|
1736
|
-
type="number"
|
|
1737
|
-
value={newChain.chainId}
|
|
1738
|
-
onChange={(e) => setNewChain({ ...newChain, chainId: e.target.value })}
|
|
1739
|
-
placeholder="42161, 10, 137..."
|
|
1740
|
-
compact
|
|
1741
|
-
/>
|
|
1742
|
-
<TextInput
|
|
1743
|
-
label="RPC (optional)"
|
|
1744
|
-
type="text"
|
|
1745
|
-
value={newChain.rpc}
|
|
1746
|
-
onChange={(e) => setNewChain({ ...newChain, rpc: e.target.value })}
|
|
1747
|
-
placeholder="blank = use Alchemy"
|
|
1748
|
-
compact
|
|
1749
|
-
/>
|
|
1750
|
-
<Button
|
|
1751
|
-
size="md"
|
|
1752
|
-
onClick={() => { handleAddChain(); onCloseAddChain(); }}
|
|
1753
|
-
disabled={savingConfig || !newChain.name || !newChain.chainId}
|
|
1754
|
-
loading={savingConfig}
|
|
1755
|
-
icon={!savingConfig ? <Plus size={10} /> : undefined}
|
|
1756
|
-
className="w-full"
|
|
1757
|
-
>
|
|
1758
|
-
ADD CHAIN
|
|
1759
|
-
</Button>
|
|
1760
|
-
</div>
|
|
1761
|
-
</Popover>
|
|
1762
|
-
</div>
|
|
1763
|
-
</div>
|
|
1764
|
-
<div className="space-y-2">
|
|
1765
|
-
{Object.entries(chains).map(([chainName, chainConfig]) => {
|
|
1766
|
-
const source = getRpcSource(chainName);
|
|
1767
|
-
// Can remove any chain except defaults (base, ethereum)
|
|
1768
|
-
const canRemove = !['base', 'ethereum'].includes(chainName);
|
|
1769
|
-
return (
|
|
1770
|
-
<div key={chainName} className="flex items-center gap-2 p-2 bg-[var(--color-surface)] border border-[var(--color-border)]">
|
|
1771
|
-
<div className="w-20 font-mono text-[10px] font-bold text-[var(--color-text)] uppercase flex items-center gap-1">
|
|
1772
|
-
{chainName}
|
|
1773
|
-
<span className={`font-mono text-[7px] px-1 py-0.5 rounded ${
|
|
1774
|
-
source === 'override' ? 'bg-[var(--color-accent)]/20 text-[var(--color-accent)]' :
|
|
1775
|
-
source === 'alchemy' ? 'bg-[var(--color-success)]/20 text-[var(--color-success)]' :
|
|
1776
|
-
'bg-[var(--color-text-muted)]/20 text-[var(--color-text-muted)]'
|
|
1777
|
-
}`}>
|
|
1778
|
-
{source === 'override' ? 'CUSTOM' : source === 'alchemy' ? 'ALCHEMY' : 'PUBLIC'}
|
|
1779
|
-
</span>
|
|
1780
|
-
</div>
|
|
1781
|
-
{editingChainRpc === chainName ? (
|
|
1782
|
-
<div className="flex-1">
|
|
1783
|
-
<TextInput
|
|
1784
|
-
label=""
|
|
1785
|
-
type="text"
|
|
1786
|
-
value={customRpc}
|
|
1787
|
-
onChange={(e) => setCustomRpc(e.target.value)}
|
|
1788
|
-
placeholder="https://..."
|
|
1789
|
-
compact
|
|
1790
|
-
autoFocus
|
|
1791
|
-
rightElement={
|
|
1792
|
-
<div className="flex gap-1">
|
|
1793
|
-
<Button variant="ghost" size="sm" onClick={() => handleSaveCustomRpc(chainName, customRpc)} icon={<Check size={12} className="text-[var(--color-success)]" />}>
|
|
1794
|
-
{''}
|
|
1795
|
-
</Button>
|
|
1796
|
-
<Button variant="ghost" size="sm" onClick={() => { setEditingChainRpc(null); setCustomRpc(''); }} icon={<X size={12} />}>
|
|
1797
|
-
{''}
|
|
1798
|
-
</Button>
|
|
1799
|
-
</div>
|
|
1800
|
-
}
|
|
1801
|
-
/>
|
|
1802
|
-
</div>
|
|
1803
|
-
) : (
|
|
1804
|
-
<>
|
|
1805
|
-
<div className="flex-1" />
|
|
1806
|
-
<Button variant="secondary" size="sm" onClick={() => { setEditingChainRpc(chainName); setCustomRpc(chainConfig.rpc); }}>
|
|
1807
|
-
EDIT RPC
|
|
1808
|
-
</Button>
|
|
1809
|
-
{canRemove && (
|
|
1810
|
-
<Button variant="ghost" size="sm" onClick={() => handleRemoveChain(chainName)} icon={<Trash2 size={10} />} className="hover:text-[var(--color-warning)]">
|
|
1811
|
-
{''}
|
|
1812
|
-
</Button>
|
|
1813
|
-
)}
|
|
1814
|
-
</>
|
|
1815
|
-
)}
|
|
1816
|
-
</div>
|
|
1817
|
-
);
|
|
1818
|
-
})}
|
|
1819
|
-
</div>
|
|
1820
|
-
</div>
|
|
1821
|
-
</div>
|
|
1822
|
-
</TyvekCollapsibleSection>
|
|
1823
|
-
|
|
1824
|
-
{/* API Keys */}
|
|
1825
|
-
<TyvekCollapsibleSection
|
|
1826
|
-
title="API_KEYS"
|
|
1827
|
-
icon={<KeyRound size={12} />}
|
|
1828
|
-
isOpen={apiKeysOpen}
|
|
1829
|
-
onToggle={() => setApiKeysOpen(!apiKeysOpen)}
|
|
1830
|
-
contentClassName="p-4 pt-0"
|
|
1831
|
-
>
|
|
1832
|
-
<div className="p-3 bg-[var(--color-background-alt)] border border-[var(--color-border)] space-y-3">
|
|
1833
|
-
<div className="flex items-center justify-between gap-2">
|
|
1834
|
-
<div className="font-mono text-[9px] text-[var(--color-text-muted)]">
|
|
1835
|
-
Store API keys for premium services (Alchemy, Infura, etc.)
|
|
1836
|
-
</div>
|
|
1837
|
-
<div className="flex items-center gap-1">
|
|
1838
|
-
{apiKeys.length > 0 && (
|
|
1839
|
-
<div className="relative">
|
|
1840
|
-
<Button
|
|
1841
|
-
variant="danger"
|
|
1842
|
-
size="sm"
|
|
1843
|
-
onClick={(e) => onOpenRevokeAllApiKeys(e.currentTarget)}
|
|
1844
|
-
disabled={revokingAllApiKeys}
|
|
1845
|
-
icon={revokingAllApiKeys ? <Loader2 size={10} className="animate-spin" /> : <AlertTriangle size={10} />}
|
|
1846
|
-
>
|
|
1847
|
-
REVOKE ALL
|
|
1848
|
-
</Button>
|
|
1849
|
-
<ConfirmationModal
|
|
1850
|
-
isOpen={showRevokeAllApiKeysPopover}
|
|
1851
|
-
onClose={onCloseRevokeAllApiKeys}
|
|
1852
|
-
onConfirm={handleRevokeAllApiKeys}
|
|
1853
|
-
title="Revoke All API Keys"
|
|
1854
|
-
message="Revoking all API keys can lock the agent by disabling services that depend on them. This action revokes every active API key immediately."
|
|
1855
|
-
confirmText="REVOKE ALL"
|
|
1856
|
-
variant="danger"
|
|
1857
|
-
loading={revokingAllApiKeys}
|
|
1858
|
-
/>
|
|
1859
|
-
</div>
|
|
1860
|
-
)}
|
|
1861
|
-
<div className="relative">
|
|
1862
|
-
<Button
|
|
1863
|
-
variant="ghost"
|
|
1864
|
-
size="sm"
|
|
1865
|
-
onClick={(e) => onOpenAddApiKey(e.currentTarget)}
|
|
1866
|
-
icon={<Plus size={10} />}
|
|
1867
|
-
>
|
|
1868
|
-
ADD
|
|
1869
|
-
</Button>
|
|
1870
|
-
<Popover
|
|
1871
|
-
isOpen={showAddApiKeyPopover}
|
|
1872
|
-
onClose={onCloseAddApiKey}
|
|
1873
|
-
title="ADD_API_KEY"
|
|
1874
|
-
anchorEl={addApiKeyAnchorEl}
|
|
1875
|
-
anchor="right"
|
|
1876
|
-
className="w-72"
|
|
1877
|
-
>
|
|
1878
|
-
<div className="space-y-3">
|
|
1879
|
-
<TextInput
|
|
1880
|
-
label="SERVICE"
|
|
1881
|
-
type="text"
|
|
1882
|
-
value={newApiKey.service}
|
|
1883
|
-
onChange={(e) => setNewApiKey({ ...newApiKey, service: e.target.value })}
|
|
1884
|
-
placeholder="alchemy, infura, etherscan..."
|
|
1885
|
-
compact
|
|
1886
|
-
/>
|
|
1887
|
-
<TextInput
|
|
1888
|
-
label="NAME"
|
|
1889
|
-
type="text"
|
|
1890
|
-
value={newApiKey.name}
|
|
1891
|
-
onChange={(e) => setNewApiKey({ ...newApiKey, name: e.target.value })}
|
|
1892
|
-
placeholder="My API Key"
|
|
1893
|
-
compact
|
|
1894
|
-
/>
|
|
1895
|
-
<TextInput
|
|
1896
|
-
label="API_KEY"
|
|
1897
|
-
type="password"
|
|
1898
|
-
value={newApiKey.key}
|
|
1899
|
-
onChange={(e) => setNewApiKey({ ...newApiKey, key: e.target.value })}
|
|
1900
|
-
placeholder="Enter your API key..."
|
|
1901
|
-
compact
|
|
1902
|
-
/>
|
|
1903
|
-
<Button
|
|
1904
|
-
size="md"
|
|
1905
|
-
onClick={handleAddApiKey}
|
|
1906
|
-
disabled={savingApiKey || !newApiKey.service || !newApiKey.name || !newApiKey.key}
|
|
1907
|
-
loading={savingApiKey}
|
|
1908
|
-
icon={!savingApiKey ? <Plus size={10} /> : undefined}
|
|
1909
|
-
className="w-full"
|
|
1910
|
-
>
|
|
1911
|
-
ADD KEY
|
|
1912
|
-
</Button>
|
|
1913
|
-
</div>
|
|
1914
|
-
</Popover>
|
|
1915
|
-
</div>
|
|
1916
|
-
</div>
|
|
1917
|
-
</div>
|
|
1918
|
-
|
|
1919
|
-
{apiKeysLoading ? (
|
|
1920
|
-
<div className="py-4 flex items-center justify-center">
|
|
1921
|
-
<Loader2 size={16} className="animate-spin text-[var(--color-text-muted)]" />
|
|
1922
|
-
</div>
|
|
1923
|
-
) : apiKeys.length === 0 ? (
|
|
1924
|
-
<div className="py-4 text-center border border-dashed border-[var(--color-border)]">
|
|
1925
|
-
<div className="font-mono text-[9px] text-[var(--color-text-muted)]">No API keys stored</div>
|
|
1926
|
-
<div className="font-mono text-[8px] text-[var(--color-text-faint)] mt-1">Add keys for Alchemy, Infura, etc.</div>
|
|
1927
|
-
</div>
|
|
1928
|
-
) : (
|
|
1929
|
-
<div className="space-y-2">
|
|
1930
|
-
{apiKeys.map((apiKey) => (
|
|
1931
|
-
<div key={apiKey.id} className="flex items-center gap-2 p-2 bg-[var(--color-surface)] border border-[var(--color-border)]">
|
|
1932
|
-
<div className="flex-1 min-w-0">
|
|
1933
|
-
<div className="flex items-center gap-2">
|
|
1934
|
-
<span className="font-mono text-[10px] font-bold text-[var(--color-text)] uppercase">{apiKey.service}</span>
|
|
1935
|
-
<span className="font-mono text-[9px] text-[var(--color-text-muted)]">{apiKey.name}</span>
|
|
1936
|
-
</div>
|
|
1937
|
-
<div className="font-mono text-[8px] text-[var(--color-text-faint)] truncate">
|
|
1938
|
-
{apiKey.keyMasked || apiKey.key}
|
|
1939
|
-
</div>
|
|
1940
|
-
</div>
|
|
1941
|
-
<Button
|
|
1942
|
-
variant="ghost"
|
|
1943
|
-
size="sm"
|
|
1944
|
-
onClick={() => handleDeleteApiKey(apiKey.id)}
|
|
1945
|
-
disabled={deletingApiKey === apiKey.id}
|
|
1946
|
-
icon={deletingApiKey === apiKey.id ? <Loader2 size={10} className="animate-spin" /> : <Trash2 size={10} />}
|
|
1947
|
-
className="hover:text-[var(--color-warning)]"
|
|
1948
|
-
>
|
|
1949
|
-
{''}
|
|
1950
|
-
</Button>
|
|
1951
|
-
</div>
|
|
1952
|
-
))}
|
|
1953
|
-
</div>
|
|
1954
|
-
)}
|
|
1955
|
-
|
|
1956
|
-
<div className="pt-2 border-t border-dashed border-[var(--color-border)]">
|
|
1957
|
-
<div className="font-mono text-[8px] text-[var(--color-text-faint)] leading-relaxed">
|
|
1958
|
-
Alchemy keys will automatically configure RPCs for supported chains.
|
|
1959
|
-
</div>
|
|
1960
|
-
</div>
|
|
1961
|
-
</div>
|
|
1962
|
-
</TyvekCollapsibleSection>
|
|
1963
|
-
|
|
1964
|
-
{/* Export Seed */}
|
|
1965
|
-
<TyvekCollapsibleSection
|
|
1966
|
-
title="EXPORT_SEED"
|
|
1967
|
-
icon={<Shield size={12} />}
|
|
1968
|
-
isOpen={exportSeedOpen}
|
|
1969
|
-
onToggle={() => setExportSeedOpen(!exportSeedOpen)}
|
|
1970
|
-
contentClassName="p-4 pt-0"
|
|
1971
|
-
>
|
|
1972
|
-
{exportedSeed ? (
|
|
1973
|
-
<div className="space-y-3">
|
|
1974
|
-
<div className="p-3 bg-[var(--color-text)] border border-[var(--color-border-focus)] relative">
|
|
1975
|
-
<Button
|
|
1976
|
-
variant="ghost"
|
|
1977
|
-
size="sm"
|
|
1978
|
-
onClick={() => { navigator.clipboard.writeText(exportedSeed); setCopied('exported'); setTimeout(() => setCopied(null), 2000); }}
|
|
1979
|
-
className="absolute top-2 right-2 bg-[var(--color-text-muted)]/20 hover:bg-[var(--color-text-muted)]/40"
|
|
1980
|
-
icon={<Copy size={10} className={copied === 'exported' ? 'text-[var(--color-accent)]' : 'text-[var(--color-surface)]'} />}
|
|
1981
|
-
>
|
|
1982
|
-
{''}
|
|
1983
|
-
</Button>
|
|
1984
|
-
<div className="font-mono text-xs text-[var(--color-accent)] leading-relaxed break-words select-all pr-8">{exportedSeed}</div>
|
|
1985
|
-
</div>
|
|
1986
|
-
<Button variant="ghost" size="sm" onClick={() => setExportedSeed(null)}>
|
|
1987
|
-
HIDE
|
|
1988
|
-
</Button>
|
|
1989
|
-
</div>
|
|
1990
|
-
) : (
|
|
1991
|
-
<form onSubmit={handleExportSeed}>
|
|
1992
|
-
<TextInput
|
|
1993
|
-
label="PASSWORD"
|
|
1994
|
-
type="password"
|
|
1995
|
-
value={exportPassword}
|
|
1996
|
-
onChange={(e) => setExportPassword(e.target.value)}
|
|
1997
|
-
placeholder="Enter password to export..."
|
|
1998
|
-
compact
|
|
1999
|
-
rightElement={
|
|
2000
|
-
<Button type="submit" size="sm" disabled={exporting || !exportPassword} loading={exporting}>
|
|
2001
|
-
EXPORT
|
|
2002
|
-
</Button>
|
|
2003
|
-
}
|
|
2004
|
-
/>
|
|
2005
|
-
</form>
|
|
2006
|
-
)}
|
|
2007
|
-
</TyvekCollapsibleSection>
|
|
2008
|
-
|
|
2009
|
-
{/* Database Backup */}
|
|
2010
|
-
<TyvekCollapsibleSection
|
|
2011
|
-
title="DATABASE_BACKUP"
|
|
2012
|
-
icon={<Database size={12} />}
|
|
2013
|
-
isOpen={backupOpen}
|
|
2014
|
-
onToggle={() => setBackupOpen(!backupOpen)}
|
|
2015
|
-
contentClassName="p-4 pt-0"
|
|
2016
|
-
>
|
|
2017
|
-
<div className="space-y-3">
|
|
2018
|
-
<Button
|
|
2019
|
-
variant="secondary"
|
|
2020
|
-
size="lg"
|
|
2021
|
-
onClick={onCreateBackup}
|
|
2022
|
-
disabled={creatingBackup}
|
|
2023
|
-
loading={creatingBackup}
|
|
2024
|
-
icon={!creatingBackup ? <Plus size={12} /> : undefined}
|
|
2025
|
-
className="w-full"
|
|
2026
|
-
>
|
|
2027
|
-
{creatingBackup ? 'CREATING...' : 'CREATE BACKUP'}
|
|
2028
|
-
</Button>
|
|
2029
|
-
<Button
|
|
2030
|
-
variant="secondary"
|
|
2031
|
-
size="lg"
|
|
2032
|
-
onClick={onExportDb}
|
|
2033
|
-
disabled={exportingDb}
|
|
2034
|
-
loading={exportingDb}
|
|
2035
|
-
icon={!exportingDb ? <Database size={12} /> : undefined}
|
|
2036
|
-
className="w-full"
|
|
2037
|
-
>
|
|
2038
|
-
{exportingDb ? 'EXPORTING...' : 'EXPORT DATABASE'}
|
|
2039
|
-
</Button>
|
|
2040
|
-
|
|
2041
|
-
{backupsLoading ? (
|
|
2042
|
-
<div className="py-4 flex items-center justify-center">
|
|
2043
|
-
<Loader2 size={16} className="animate-spin text-[var(--color-text-muted)]" />
|
|
2044
|
-
</div>
|
|
2045
|
-
) : backups.length === 0 ? (
|
|
2046
|
-
<div className="py-4 text-center">
|
|
2047
|
-
<div className="font-mono text-[9px] text-[var(--color-text-muted)]">No backups found</div>
|
|
2048
|
-
</div>
|
|
2049
|
-
) : (
|
|
2050
|
-
<div className="space-y-1 max-h-48 overflow-y-auto">
|
|
2051
|
-
{backups.map((backup) => (
|
|
2052
|
-
<div key={backup.filename} className="relative">
|
|
2053
|
-
<Button
|
|
2054
|
-
type="button"
|
|
2055
|
-
variant="secondary"
|
|
2056
|
-
size="md"
|
|
2057
|
-
onClick={(e) => {
|
|
2058
|
-
setRestoreAnchorEl(e.currentTarget);
|
|
2059
|
-
setRestoreConfirmOpen(backup.filename);
|
|
2060
|
-
}}
|
|
2061
|
-
className="w-full !h-auto !px-2 !py-2 !justify-between group"
|
|
2062
|
-
>
|
|
2063
|
-
<div className="flex items-center gap-2">
|
|
2064
|
-
<RotateCcw size={10} className="text-[var(--color-text-muted)] group-hover:text-[var(--color-text)]" />
|
|
2065
|
-
<span className="font-mono text-[10px] text-[var(--color-text)]">
|
|
2066
|
-
{formatBackupDate(backup.timestamp)}
|
|
2067
|
-
</span>
|
|
2068
|
-
</div>
|
|
2069
|
-
<span className="font-mono text-[9px] text-[var(--color-text-muted)]">
|
|
2070
|
-
{formatSize(backup.size)}
|
|
2071
|
-
</span>
|
|
2072
|
-
</Button>
|
|
2073
|
-
<ConfirmationModal
|
|
2074
|
-
isOpen={restoreConfirmOpen === backup.filename}
|
|
2075
|
-
onClose={() => {
|
|
2076
|
-
setRestoreConfirmOpen(null);
|
|
2077
|
-
setRestoreAnchorEl(null);
|
|
2078
|
-
}}
|
|
2079
|
-
onConfirm={() => {
|
|
2080
|
-
onRestoreBackup(backup.filename);
|
|
2081
|
-
setRestoreConfirmOpen(null);
|
|
2082
|
-
setRestoreAnchorEl(null);
|
|
2083
|
-
}}
|
|
2084
|
-
title="Restore Backup"
|
|
2085
|
-
message="Restore to this backup? You will lose all data since this backup was created."
|
|
2086
|
-
confirmText="RESTORE"
|
|
2087
|
-
variant="warning"
|
|
2088
|
-
loading={restoringBackup === backup.filename}
|
|
2089
|
-
/>
|
|
2090
|
-
</div>
|
|
2091
|
-
))}
|
|
2092
|
-
</div>
|
|
2093
|
-
)}
|
|
2094
|
-
|
|
2095
|
-
<div className="pt-2 border-t border-dashed border-[var(--color-border)]">
|
|
2096
|
-
<div className="font-mono text-[8px] text-[var(--color-text-faint)] leading-relaxed">
|
|
2097
|
-
Backups are tied to the current database schema. Restoring after migrations may cause issues.
|
|
2098
|
-
</div>
|
|
2099
|
-
</div>
|
|
2100
|
-
</div>
|
|
2101
|
-
</TyvekCollapsibleSection>
|
|
2102
|
-
|
|
2103
|
-
{/* Danger Zone */}
|
|
2104
|
-
<TyvekCollapsibleSection
|
|
2105
|
-
title="DANGER_ZONE"
|
|
2106
|
-
icon={<AlertTriangle size={12} />}
|
|
2107
|
-
isOpen={dangerOpen}
|
|
2108
|
-
onToggle={() => setDangerOpen(!dangerOpen)}
|
|
2109
|
-
tone="warning"
|
|
2110
|
-
contentClassName="p-4 pt-0"
|
|
2111
|
-
>
|
|
2112
|
-
<div className="p-3 border-2 border-[var(--color-warning)] bg-[color-mix(in_srgb,var(--color-warning)_5%,transparent)]">
|
|
2113
|
-
<div className="font-mono text-[10px] text-[var(--color-text-muted)] mb-3">Delete ALL data. Irreversible.</div>
|
|
2114
|
-
<Button
|
|
2115
|
-
variant={confirmNuke ? 'primary' : 'danger'}
|
|
2116
|
-
size="lg"
|
|
2117
|
-
onClick={handleNuke}
|
|
2118
|
-
disabled={nuking}
|
|
2119
|
-
loading={nuking}
|
|
2120
|
-
icon={!nuking ? <Trash2 size={12} /> : undefined}
|
|
2121
|
-
className={`w-full ${confirmNuke ? '!bg-[var(--color-warning)] !border-[var(--color-warning)] hover:!bg-[var(--color-warning)]' : ''}`}
|
|
2122
|
-
>
|
|
2123
|
-
{nuking ? 'NUKING...' : confirmNuke ? 'CONFIRM' : 'NUKE'}
|
|
2124
|
-
</Button>
|
|
2125
|
-
</div>
|
|
2126
|
-
</TyvekCollapsibleSection>
|
|
2127
|
-
</div>
|
|
2128
|
-
);
|
|
2129
|
-
}
|
|
2130
|
-
|
|
2131
|
-
function ReceiveContent({
|
|
2132
|
-
coldWallets,
|
|
2133
|
-
copyAddress,
|
|
2134
|
-
copied,
|
|
2135
|
-
}: {
|
|
2136
|
-
coldWallets: WalletData[];
|
|
2137
|
-
copyAddress: (addr: string) => void;
|
|
2138
|
-
copied: string | null;
|
|
2139
|
-
}) {
|
|
2140
|
-
if (coldWallets.length === 0) {
|
|
2141
|
-
return (
|
|
2142
|
-
<div className="text-center py-8">
|
|
2143
|
-
<div className="font-mono text-[10px] text-[var(--color-text-muted,#6b7280)]">No wallet found. Set up your wallet first.</div>
|
|
2144
|
-
</div>
|
|
2145
|
-
);
|
|
2146
|
-
}
|
|
2147
|
-
|
|
2148
|
-
return (
|
|
2149
|
-
<div className="space-y-5">
|
|
2150
|
-
{coldWallets.map((wallet) => (
|
|
2151
|
-
<div key={wallet.address} className="space-y-3">
|
|
2152
|
-
{/* Agent label */}
|
|
2153
|
-
<div className="flex items-center justify-center gap-2">
|
|
2154
|
-
<Shield size={12} style={{ color: 'var(--color-info, #0047ff)' }} />
|
|
2155
|
-
<span className="font-mono text-[9px] font-bold tracking-widest" style={{ color: 'var(--color-info, #0047ff)' }}>
|
|
2156
|
-
{wallet.name?.toUpperCase() || 'AGENT'}
|
|
2157
|
-
{wallet.chain ? ` (${wallet.chain.toUpperCase()})` : ''}
|
|
2158
|
-
</span>
|
|
2159
|
-
</div>
|
|
2160
|
-
|
|
2161
|
-
{/* QR Code - white bg required for scanning */}
|
|
2162
|
-
<div className="flex justify-center">
|
|
2163
|
-
<div
|
|
2164
|
-
className="p-3 relative"
|
|
2165
|
-
style={{
|
|
2166
|
-
backgroundColor: 'var(--color-surface, #ffffff)',
|
|
2167
|
-
border: '1px solid var(--color-border, #d4d4d8)',
|
|
2168
|
-
}}
|
|
2169
|
-
>
|
|
2170
|
-
<div className="absolute top-1 left-1 w-2 h-2 border-l border-t" style={{ borderColor: 'var(--color-border-focus, #0a0a0a)' }} />
|
|
2171
|
-
<div className="absolute top-1 right-1 w-2 h-2 border-r border-t" style={{ borderColor: 'var(--color-border-focus, #0a0a0a)' }} />
|
|
2172
|
-
<div className="absolute bottom-1 left-1 w-2 h-2 border-l border-b" style={{ borderColor: 'var(--color-border-focus, #0a0a0a)' }} />
|
|
2173
|
-
<div className="absolute bottom-1 right-1 w-2 h-2 border-r border-b" style={{ borderColor: 'var(--color-border-focus, #0a0a0a)' }} />
|
|
2174
|
-
<img
|
|
2175
|
-
src={`https://api.qrserver.com/v1/create-qr-code/?size=160x160&data=${wallet.address}&bgcolor=ffffff&color=0a0a0a&margin=0`}
|
|
2176
|
-
alt="Wallet QR Code"
|
|
2177
|
-
className="w-40 h-40"
|
|
2178
|
-
/>
|
|
2179
|
-
</div>
|
|
2180
|
-
</div>
|
|
2181
|
-
|
|
2182
|
-
{/* Address */}
|
|
2183
|
-
<div
|
|
2184
|
-
className="p-3 relative group cursor-pointer"
|
|
2185
|
-
onClick={() => copyAddress(wallet.address)}
|
|
2186
|
-
style={{
|
|
2187
|
-
backgroundColor: 'var(--color-background-alt, #f4f4f5)',
|
|
2188
|
-
border: '1px solid var(--color-border, #d4d4d8)',
|
|
2189
|
-
}}
|
|
2190
|
-
>
|
|
2191
|
-
<code
|
|
2192
|
-
className="font-mono text-[11px] break-all select-all block text-center leading-relaxed pr-6"
|
|
2193
|
-
style={{ color: 'var(--color-text, #0a0a0a)' }}
|
|
2194
|
-
>
|
|
2195
|
-
{wallet.address}
|
|
2196
|
-
</code>
|
|
2197
|
-
<button
|
|
2198
|
-
className="absolute right-2 top-1/2 -translate-y-1/2 p-1 opacity-60 group-hover:opacity-100 transition-opacity"
|
|
2199
|
-
onClick={(e) => {
|
|
2200
|
-
e.stopPropagation();
|
|
2201
|
-
copyAddress(wallet.address);
|
|
2202
|
-
}}
|
|
2203
|
-
>
|
|
2204
|
-
<Copy size={14} style={{ color: copied === wallet.address ? 'var(--color-success, #00c853)' : 'var(--color-info, #0047ff)' }} />
|
|
2205
|
-
</button>
|
|
2206
|
-
</div>
|
|
2207
|
-
{copied === wallet.address && (
|
|
2208
|
-
<div className="text-center">
|
|
2209
|
-
<span className="font-mono text-[9px]" style={{ color: 'var(--color-success, #00c853)' }}>COPIED TO CLIPBOARD</span>
|
|
2210
|
-
</div>
|
|
2211
|
-
)}
|
|
2212
|
-
|
|
2213
|
-
{/* Divider between agents */}
|
|
2214
|
-
{coldWallets.length > 1 && wallet !== coldWallets[coldWallets.length - 1] && (
|
|
2215
|
-
<div className="border-t" style={{ borderColor: 'var(--color-border, #d4d4d8)' }} />
|
|
2216
|
-
)}
|
|
2217
|
-
</div>
|
|
2218
|
-
))}
|
|
2219
|
-
|
|
2220
|
-
{/* Instructions */}
|
|
2221
|
-
<div className="space-y-2 pt-2">
|
|
2222
|
-
<div className="font-mono text-[8px] text-[var(--color-text-muted,#6b7280)] tracking-widest">INSTRUCTIONS</div>
|
|
2223
|
-
<div className="space-y-1.5">
|
|
2224
|
-
<div className="flex items-start gap-2">
|
|
2225
|
-
<div className="w-4 h-4 bg-[var(--color-background-alt,#e8e8e6)] flex items-center justify-center shrink-0 mt-0.5">
|
|
2226
|
-
<span className="font-mono text-[8px] text-[var(--color-text-muted,#6b7280)]">1</span>
|
|
2227
|
-
</div>
|
|
2228
|
-
<span className="font-mono text-[9px] text-[var(--color-text-muted,#6b7280)]">Scan QR or copy address above</span>
|
|
2229
|
-
</div>
|
|
2230
|
-
<div className="flex items-start gap-2">
|
|
2231
|
-
<div className="w-4 h-4 bg-[var(--color-background-alt,#e8e8e6)] flex items-center justify-center shrink-0 mt-0.5">
|
|
2232
|
-
<span className="font-mono text-[8px] text-[var(--color-text-muted,#6b7280)]">2</span>
|
|
2233
|
-
</div>
|
|
2234
|
-
<span className="font-mono text-[9px] text-[var(--color-text-muted,#6b7280)]">Send ETH from exchange or another wallet</span>
|
|
2235
|
-
</div>
|
|
2236
|
-
<div className="flex items-start gap-2">
|
|
2237
|
-
<div className="w-4 h-4 bg-[var(--color-background-alt,#e8e8e6)] flex items-center justify-center shrink-0 mt-0.5">
|
|
2238
|
-
<span className="font-mono text-[8px] text-[var(--color-text-muted,#6b7280)]">3</span>
|
|
2239
|
-
</div>
|
|
2240
|
-
<span className="font-mono text-[9px] text-[var(--color-text-muted,#6b7280)]">Funds will appear after network confirmation</span>
|
|
2241
|
-
</div>
|
|
2242
|
-
</div>
|
|
2243
|
-
</div>
|
|
2244
|
-
|
|
2245
|
-
</div>
|
|
2246
|
-
);
|
|
2247
|
-
}
|