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,327 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for session management and spending limits
|
|
3
|
-
*
|
|
4
|
-
* Tests:
|
|
5
|
-
* - Session creation and tracking
|
|
6
|
-
* - Spending limit enforcement
|
|
7
|
-
* - Per-type spending tracking (fund, send, swap)
|
|
8
|
-
* - Token revocation
|
|
9
|
-
*/
|
|
10
|
-
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
11
|
-
import {
|
|
12
|
-
getSession,
|
|
13
|
-
checkLimitByType,
|
|
14
|
-
recordSpendByType,
|
|
15
|
-
getRemainingByType,
|
|
16
|
-
revokeToken,
|
|
17
|
-
isRevoked,
|
|
18
|
-
clearSessions,
|
|
19
|
-
listSessions,
|
|
20
|
-
} from '../../lib/sessions';
|
|
21
|
-
import { createTokenSync as createToken, getTokenHash } from '../../lib/auth';
|
|
22
|
-
import { cleanDatabase } from '../setup';
|
|
23
|
-
|
|
24
|
-
describe('Session Management', () => {
|
|
25
|
-
beforeEach(async () => {
|
|
26
|
-
await cleanDatabase();
|
|
27
|
-
clearSessions();
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
afterEach(() => {
|
|
31
|
-
clearSessions();
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
describe('getSession()', () => {
|
|
35
|
-
it('should create a session for a new token', () => {
|
|
36
|
-
const token = createToken({
|
|
37
|
-
agentId: 'test-agent',
|
|
38
|
-
permissions: ['fund'],
|
|
39
|
-
limits: { fund: 1.0 },
|
|
40
|
-
exp: Date.now() + 3600000,
|
|
41
|
-
});
|
|
42
|
-
const tokenHash = getTokenHash(token);
|
|
43
|
-
|
|
44
|
-
const payload = {
|
|
45
|
-
agentId: 'test-agent',
|
|
46
|
-
permissions: ['fund'],
|
|
47
|
-
limits: { fund: 1.0 },
|
|
48
|
-
exp: Date.now() + 3600000,
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const session = getSession(tokenHash, payload);
|
|
52
|
-
|
|
53
|
-
expect(session).toBeDefined();
|
|
54
|
-
expect(session.token).toEqual(payload);
|
|
55
|
-
expect(session.spent).toBe(0);
|
|
56
|
-
expect(session.spentByType).toEqual({ fund: 0, send: 0, swap: 0 });
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('should return same session for same token hash', () => {
|
|
60
|
-
const payload = {
|
|
61
|
-
agentId: 'test-agent',
|
|
62
|
-
permissions: ['fund'],
|
|
63
|
-
limits: { fund: 1.0 },
|
|
64
|
-
exp: Date.now() + 3600000,
|
|
65
|
-
};
|
|
66
|
-
const token = createToken(payload);
|
|
67
|
-
const tokenHash = getTokenHash(token);
|
|
68
|
-
|
|
69
|
-
const session1 = getSession(tokenHash, payload);
|
|
70
|
-
const session2 = getSession(tokenHash, payload);
|
|
71
|
-
|
|
72
|
-
expect(session1).toBe(session2);
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
describe('Spending Limits', () => {
|
|
77
|
-
it('should allow spending within limit', () => {
|
|
78
|
-
const payload = {
|
|
79
|
-
agentId: 'test-agent',
|
|
80
|
-
permissions: ['fund'],
|
|
81
|
-
limits: { fund: 1.0 },
|
|
82
|
-
exp: Date.now() + 3600000,
|
|
83
|
-
};
|
|
84
|
-
const token = createToken(payload);
|
|
85
|
-
const tokenHash = getTokenHash(token);
|
|
86
|
-
|
|
87
|
-
// Initialize session
|
|
88
|
-
getSession(tokenHash, payload);
|
|
89
|
-
|
|
90
|
-
// Check limit for 0.5 ETH - should pass
|
|
91
|
-
const canSpend = checkLimitByType(tokenHash, payload, 'fund', 0.5);
|
|
92
|
-
expect(canSpend).toBe(true);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it('should reject spending over limit', () => {
|
|
96
|
-
const payload = {
|
|
97
|
-
agentId: 'test-agent',
|
|
98
|
-
permissions: ['fund'],
|
|
99
|
-
limits: { fund: 1.0 },
|
|
100
|
-
exp: Date.now() + 3600000,
|
|
101
|
-
};
|
|
102
|
-
const token = createToken(payload);
|
|
103
|
-
const tokenHash = getTokenHash(token);
|
|
104
|
-
|
|
105
|
-
getSession(tokenHash, payload);
|
|
106
|
-
|
|
107
|
-
// Check limit for 1.5 ETH - should fail
|
|
108
|
-
const canSpend = checkLimitByType(tokenHash, payload, 'fund', 1.5);
|
|
109
|
-
expect(canSpend).toBe(false);
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
it('should track cumulative spending', async () => {
|
|
113
|
-
const payload = {
|
|
114
|
-
agentId: 'test-agent',
|
|
115
|
-
permissions: ['fund'],
|
|
116
|
-
limits: { fund: 1.0 },
|
|
117
|
-
exp: Date.now() + 3600000,
|
|
118
|
-
};
|
|
119
|
-
const token = createToken(payload);
|
|
120
|
-
const tokenHash = getTokenHash(token);
|
|
121
|
-
|
|
122
|
-
getSession(tokenHash, payload);
|
|
123
|
-
|
|
124
|
-
// First spend
|
|
125
|
-
await recordSpendByType(tokenHash, 'fund', 0.5);
|
|
126
|
-
|
|
127
|
-
// Check remaining
|
|
128
|
-
const remaining = getRemainingByType(tokenHash, payload, 'fund');
|
|
129
|
-
expect(remaining).toBeCloseTo(0.5);
|
|
130
|
-
|
|
131
|
-
// Second spend should fail if over limit
|
|
132
|
-
const canSpend = checkLimitByType(tokenHash, payload, 'fund', 0.6);
|
|
133
|
-
expect(canSpend).toBe(false);
|
|
134
|
-
|
|
135
|
-
// But 0.4 should still work
|
|
136
|
-
const canSpendLess = checkLimitByType(tokenHash, payload, 'fund', 0.4);
|
|
137
|
-
expect(canSpendLess).toBe(true);
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
it('should track spending per type independently', async () => {
|
|
141
|
-
const payload = {
|
|
142
|
-
agentId: 'test-agent',
|
|
143
|
-
permissions: ['fund', 'send:hot'],
|
|
144
|
-
limits: { fund: 1.0, send: 2.0 },
|
|
145
|
-
exp: Date.now() + 3600000,
|
|
146
|
-
};
|
|
147
|
-
const token = createToken(payload);
|
|
148
|
-
const tokenHash = getTokenHash(token);
|
|
149
|
-
|
|
150
|
-
getSession(tokenHash, payload);
|
|
151
|
-
|
|
152
|
-
// Spend from fund
|
|
153
|
-
await recordSpendByType(tokenHash, 'fund', 0.8);
|
|
154
|
-
|
|
155
|
-
// Fund should have 0.2 remaining
|
|
156
|
-
expect(getRemainingByType(tokenHash, payload, 'fund')).toBeCloseTo(0.2);
|
|
157
|
-
|
|
158
|
-
// Send should still have full 2.0
|
|
159
|
-
expect(getRemainingByType(tokenHash, payload, 'send')).toBeCloseTo(2.0);
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
it('should include fund spent from spentByType in listSessions', async () => {
|
|
163
|
-
const payload = {
|
|
164
|
-
agentId: 'test-agent',
|
|
165
|
-
permissions: ['fund'],
|
|
166
|
-
limits: { fund: 1.0 },
|
|
167
|
-
exp: Date.now() + 3600000,
|
|
168
|
-
};
|
|
169
|
-
const token = createToken(payload);
|
|
170
|
-
const tokenHash = getTokenHash(token);
|
|
171
|
-
|
|
172
|
-
const session = getSession(tokenHash, payload);
|
|
173
|
-
session.spentByType = { fund: 0.4, send: 0, swap: 0 };
|
|
174
|
-
session.spent = 0;
|
|
175
|
-
|
|
176
|
-
const sessions = listSessions();
|
|
177
|
-
const [row] = sessions.filter(s => s.tokenHash === tokenHash);
|
|
178
|
-
|
|
179
|
-
expect(row.spent).toBe(0.4);
|
|
180
|
-
expect(row.remaining).toBe(0.6);
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
it('should aggregate fund spend across currencies in listSessions when spent is currency-keyed', async () => {
|
|
184
|
-
const payload = {
|
|
185
|
-
agentId: 'test-agent',
|
|
186
|
-
permissions: ['fund'],
|
|
187
|
-
limits: { fund: 2.5 },
|
|
188
|
-
exp: Date.now() + 3600000,
|
|
189
|
-
};
|
|
190
|
-
const token = createToken(payload);
|
|
191
|
-
const tokenHash = getTokenHash(token);
|
|
192
|
-
|
|
193
|
-
const session = getSession(tokenHash, payload);
|
|
194
|
-
session.spentByType = {
|
|
195
|
-
fund: { '0xaaa': 1.0, '0xbbb': 0.5 },
|
|
196
|
-
send: 0,
|
|
197
|
-
swap: 0,
|
|
198
|
-
};
|
|
199
|
-
session.spent = 0;
|
|
200
|
-
|
|
201
|
-
const sessions = listSessions();
|
|
202
|
-
const [row] = sessions.filter(s => s.tokenHash === tokenHash);
|
|
203
|
-
|
|
204
|
-
expect(row.spent).toBe(1.5);
|
|
205
|
-
expect(row.remaining).toBe(1.0);
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
it('should allow unlimited spending when no limit set at all', () => {
|
|
209
|
-
const payload = {
|
|
210
|
-
agentId: 'test-agent',
|
|
211
|
-
permissions: ['send:hot'],
|
|
212
|
-
// No limits set, no fund limit
|
|
213
|
-
exp: Date.now() + 3600000,
|
|
214
|
-
};
|
|
215
|
-
const token = createToken(payload);
|
|
216
|
-
const tokenHash = getTokenHash(token);
|
|
217
|
-
|
|
218
|
-
getSession(tokenHash, payload);
|
|
219
|
-
|
|
220
|
-
// Should allow any amount (no fund limit = no send limit)
|
|
221
|
-
const canSpend = checkLimitByType(tokenHash, payload, 'send', 1000000);
|
|
222
|
-
expect(canSpend).toBe(true);
|
|
223
|
-
|
|
224
|
-
// Remaining should be Infinity
|
|
225
|
-
expect(getRemainingByType(tokenHash, payload, 'send')).toBe(Infinity);
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
it('should default send limit to fund limit when send not explicitly set', () => {
|
|
229
|
-
const payload = {
|
|
230
|
-
agentId: 'test-agent',
|
|
231
|
-
permissions: ['send:hot', 'fund'],
|
|
232
|
-
limit: 1.0, // Fund limit of 1.0 ETH, no explicit send limit
|
|
233
|
-
exp: Date.now() + 3600000,
|
|
234
|
-
};
|
|
235
|
-
const token = createToken(payload);
|
|
236
|
-
const tokenHash = getTokenHash(token);
|
|
237
|
-
|
|
238
|
-
getSession(tokenHash, payload);
|
|
239
|
-
|
|
240
|
-
// Send limit should default to fund limit (1.0)
|
|
241
|
-
expect(checkLimitByType(tokenHash, payload, 'send', 0.5)).toBe(true);
|
|
242
|
-
expect(checkLimitByType(tokenHash, payload, 'send', 1.5)).toBe(false);
|
|
243
|
-
expect(getRemainingByType(tokenHash, payload, 'send')).toBeCloseTo(1.0);
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
it('should use explicit send limit over fund limit when both set', () => {
|
|
247
|
-
const payload = {
|
|
248
|
-
agentId: 'test-agent',
|
|
249
|
-
permissions: ['send:hot', 'fund'],
|
|
250
|
-
limits: { fund: 2.0, send: 0.5 }, // Explicit send limit lower than fund
|
|
251
|
-
exp: Date.now() + 3600000,
|
|
252
|
-
};
|
|
253
|
-
const token = createToken(payload);
|
|
254
|
-
const tokenHash = getTokenHash(token);
|
|
255
|
-
|
|
256
|
-
getSession(tokenHash, payload);
|
|
257
|
-
|
|
258
|
-
// Send limit should be 0.5, not 2.0
|
|
259
|
-
expect(checkLimitByType(tokenHash, payload, 'send', 0.3)).toBe(true);
|
|
260
|
-
expect(checkLimitByType(tokenHash, payload, 'send', 0.6)).toBe(false);
|
|
261
|
-
expect(getRemainingByType(tokenHash, payload, 'send')).toBeCloseTo(0.5);
|
|
262
|
-
|
|
263
|
-
// Fund limit should still be 2.0
|
|
264
|
-
expect(getRemainingByType(tokenHash, payload, 'fund')).toBeCloseTo(2.0);
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
describe('Token Revocation', () => {
|
|
269
|
-
it('should mark token as revoked', () => {
|
|
270
|
-
const token = createToken({
|
|
271
|
-
agentId: 'test-agent',
|
|
272
|
-
permissions: ['wallet:list'],
|
|
273
|
-
exp: Date.now() + 3600000,
|
|
274
|
-
});
|
|
275
|
-
const tokenHash = getTokenHash(token);
|
|
276
|
-
|
|
277
|
-
expect(isRevoked(tokenHash)).toBe(false);
|
|
278
|
-
|
|
279
|
-
revokeToken(tokenHash);
|
|
280
|
-
|
|
281
|
-
expect(isRevoked(tokenHash)).toBe(true);
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
it('should persist revocation across session lookups', () => {
|
|
285
|
-
const payload = {
|
|
286
|
-
agentId: 'test-agent',
|
|
287
|
-
permissions: ['wallet:list'],
|
|
288
|
-
exp: Date.now() + 3600000,
|
|
289
|
-
};
|
|
290
|
-
const token = createToken(payload);
|
|
291
|
-
const tokenHash = getTokenHash(token);
|
|
292
|
-
|
|
293
|
-
// Create session
|
|
294
|
-
getSession(tokenHash, payload);
|
|
295
|
-
|
|
296
|
-
// Revoke
|
|
297
|
-
revokeToken(tokenHash);
|
|
298
|
-
|
|
299
|
-
// Should still be revoked
|
|
300
|
-
expect(isRevoked(tokenHash)).toBe(true);
|
|
301
|
-
});
|
|
302
|
-
});
|
|
303
|
-
|
|
304
|
-
describe('clearSessions()', () => {
|
|
305
|
-
it('should clear all sessions and spending', async () => {
|
|
306
|
-
const payload = {
|
|
307
|
-
agentId: 'test-agent',
|
|
308
|
-
permissions: ['fund'],
|
|
309
|
-
limits: { fund: 1.0 },
|
|
310
|
-
exp: Date.now() + 3600000,
|
|
311
|
-
};
|
|
312
|
-
const token = createToken(payload);
|
|
313
|
-
const tokenHash = getTokenHash(token);
|
|
314
|
-
|
|
315
|
-
getSession(tokenHash, payload);
|
|
316
|
-
await recordSpendByType(tokenHash, 'fund', 0.5);
|
|
317
|
-
|
|
318
|
-
// Clear sessions
|
|
319
|
-
clearSessions();
|
|
320
|
-
|
|
321
|
-
// New session should have fresh spending
|
|
322
|
-
const newSession = getSession(tokenHash, payload);
|
|
323
|
-
expect(newSession.spent).toBe(0);
|
|
324
|
-
expect(getRemainingByType(tokenHash, payload, 'fund')).toBe(1.0);
|
|
325
|
-
});
|
|
326
|
-
});
|
|
327
|
-
});
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach } from 'vitest';
|
|
2
|
-
import { testPrisma } from '../../setup';
|
|
3
|
-
import {
|
|
4
|
-
createPost,
|
|
5
|
-
createReaction,
|
|
6
|
-
createFollow,
|
|
7
|
-
createUnfollow,
|
|
8
|
-
createProfileUpdate,
|
|
9
|
-
} from '../../../lib/social/create';
|
|
10
|
-
import { ed25519 } from '@noble/curves/ed25519.js';
|
|
11
|
-
import { blake3 } from '@noble/hashes/blake3.js';
|
|
12
|
-
|
|
13
|
-
const TEST_MNEMONIC =
|
|
14
|
-
'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about';
|
|
15
|
-
const TEST_AGENT_ID = 'test-social-agent';
|
|
16
|
-
const TEST_AURA_ID = 42;
|
|
17
|
-
|
|
18
|
-
async function cleanSocialTables() {
|
|
19
|
-
await testPrisma.socialMessage.deleteMany();
|
|
20
|
-
await testPrisma.agentProfile.deleteMany();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async function seedAgentProfile(auraId: number | null = TEST_AURA_ID) {
|
|
24
|
-
return testPrisma.agentProfile.create({
|
|
25
|
-
data: {
|
|
26
|
-
agentId: TEST_AGENT_ID,
|
|
27
|
-
auraId,
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
describe('social/create', () => {
|
|
33
|
-
beforeEach(async () => {
|
|
34
|
-
await cleanSocialTables();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
describe('createPost()', () => {
|
|
38
|
-
it('should create a post_add message with pending syncStatus', async () => {
|
|
39
|
-
await seedAgentProfile();
|
|
40
|
-
|
|
41
|
-
const msg = await createPost(TEST_AGENT_ID, TEST_MNEMONIC, 'gm auramaxxnow');
|
|
42
|
-
|
|
43
|
-
expect(msg.agentId).toBe(TEST_AGENT_ID);
|
|
44
|
-
expect(msg.type).toBe('post_add');
|
|
45
|
-
expect(msg.syncStatus).toBe('pending');
|
|
46
|
-
expect(msg.hash).toMatch(/^[0-9a-f]{64}$/);
|
|
47
|
-
expect(msg.signature).toMatch(/^[0-9a-f]{128}$/);
|
|
48
|
-
expect(msg.signer).toMatch(/^[0-9a-f]{64}$/);
|
|
49
|
-
|
|
50
|
-
const body = JSON.parse(msg.body);
|
|
51
|
-
expect(body.text).toBe('gm auramaxxnow');
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it('should include optional fields in body', async () => {
|
|
55
|
-
await seedAgentProfile();
|
|
56
|
-
|
|
57
|
-
const msg = await createPost(TEST_AGENT_ID, TEST_MNEMONIC, 'hello', {
|
|
58
|
-
embeds: ['https://example.com'],
|
|
59
|
-
parentPostHash: 'abc123',
|
|
60
|
-
mentions: [7, 11],
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
const body = JSON.parse(msg.body);
|
|
64
|
-
expect(body.text).toBe('hello');
|
|
65
|
-
expect(body.embeds).toEqual(['https://example.com']);
|
|
66
|
-
expect(body.parentPostHash).toBe('abc123');
|
|
67
|
-
expect(body.mentions).toEqual([7, 11]);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('should omit empty optional fields', async () => {
|
|
71
|
-
await seedAgentProfile();
|
|
72
|
-
|
|
73
|
-
const msg = await createPost(TEST_AGENT_ID, TEST_MNEMONIC, 'simple post');
|
|
74
|
-
|
|
75
|
-
const body = JSON.parse(msg.body);
|
|
76
|
-
expect(body).toEqual({ text: 'simple post' });
|
|
77
|
-
expect(body.embeds).toBeUndefined();
|
|
78
|
-
expect(body.parentPostHash).toBeUndefined();
|
|
79
|
-
expect(body.mentions).toBeUndefined();
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
it('should produce a verifiable signature', async () => {
|
|
83
|
-
await seedAgentProfile();
|
|
84
|
-
|
|
85
|
-
const msg = await createPost(TEST_AGENT_ID, TEST_MNEMONIC, 'verify me');
|
|
86
|
-
|
|
87
|
-
const hashBytes = Buffer.from(msg.hash, 'hex');
|
|
88
|
-
const sigBytes = Buffer.from(msg.signature, 'hex');
|
|
89
|
-
const pubBytes = Buffer.from(msg.signer, 'hex');
|
|
90
|
-
expect(ed25519.verify(sigBytes, hashBytes, pubBytes)).toBe(true);
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
describe('createReaction()', () => {
|
|
95
|
-
it('should create a reaction_add message', async () => {
|
|
96
|
-
await seedAgentProfile();
|
|
97
|
-
|
|
98
|
-
const msg = await createReaction(TEST_AGENT_ID, TEST_MNEMONIC, 'abc123', 'like');
|
|
99
|
-
|
|
100
|
-
expect(msg.type).toBe('reaction_add');
|
|
101
|
-
const body = JSON.parse(msg.body);
|
|
102
|
-
expect(body.postHash).toBe('abc123');
|
|
103
|
-
expect(body.reactionType).toBe('like');
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
describe('createFollow()', () => {
|
|
108
|
-
it('should create a link_add message', async () => {
|
|
109
|
-
await seedAgentProfile();
|
|
110
|
-
|
|
111
|
-
const targetPubKey = 'ab'.repeat(32);
|
|
112
|
-
const msg = await createFollow(TEST_AGENT_ID, TEST_MNEMONIC, targetPubKey);
|
|
113
|
-
|
|
114
|
-
expect(msg.type).toBe('link_add');
|
|
115
|
-
const body = JSON.parse(msg.body);
|
|
116
|
-
expect(body.followeePublicKey).toBe(targetPubKey);
|
|
117
|
-
expect(body.linkType).toBe('follow');
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
describe('createUnfollow()', () => {
|
|
122
|
-
it('should create a link_remove message', async () => {
|
|
123
|
-
await seedAgentProfile();
|
|
124
|
-
|
|
125
|
-
const targetPubKey = 'ab'.repeat(32);
|
|
126
|
-
const msg = await createUnfollow(TEST_AGENT_ID, TEST_MNEMONIC, targetPubKey);
|
|
127
|
-
|
|
128
|
-
expect(msg.type).toBe('link_remove');
|
|
129
|
-
const body = JSON.parse(msg.body);
|
|
130
|
-
expect(body.followeePublicKey).toBe(targetPubKey);
|
|
131
|
-
expect(body.linkType).toBe('follow');
|
|
132
|
-
});
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
describe('createProfileUpdate()', () => {
|
|
136
|
-
it('should create a user_data_add message', async () => {
|
|
137
|
-
await seedAgentProfile();
|
|
138
|
-
|
|
139
|
-
const msg = await createProfileUpdate(
|
|
140
|
-
TEST_AGENT_ID,
|
|
141
|
-
TEST_MNEMONIC,
|
|
142
|
-
'display',
|
|
143
|
-
'Agent Smith',
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
expect(msg.type).toBe('user_data_add');
|
|
147
|
-
const body = JSON.parse(msg.body);
|
|
148
|
-
expect(body.type).toBe('display');
|
|
149
|
-
expect(body.value).toBe('Agent Smith');
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
describe('error handling', () => {
|
|
154
|
-
it('should throw if agent has no auraId', async () => {
|
|
155
|
-
await seedAgentProfile(null);
|
|
156
|
-
|
|
157
|
-
await expect(
|
|
158
|
-
createPost(TEST_AGENT_ID, TEST_MNEMONIC, 'should fail'),
|
|
159
|
-
).rejects.toThrow('no auraId');
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
it('should throw if agent profile does not exist', async () => {
|
|
163
|
-
await expect(
|
|
164
|
-
createPost('nonexistent-agent', TEST_MNEMONIC, 'should fail'),
|
|
165
|
-
).rejects.toThrow('no auraId');
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
describe('persistence', () => {
|
|
170
|
-
it('should persist the message in SocialMessage table', async () => {
|
|
171
|
-
await seedAgentProfile();
|
|
172
|
-
|
|
173
|
-
const msg = await createPost(TEST_AGENT_ID, TEST_MNEMONIC, 'persisted');
|
|
174
|
-
|
|
175
|
-
const found = await testPrisma.socialMessage.findUnique({
|
|
176
|
-
where: { hash: msg.hash },
|
|
177
|
-
});
|
|
178
|
-
expect(found).not.toBeNull();
|
|
179
|
-
expect(found!.agentId).toBe(TEST_AGENT_ID);
|
|
180
|
-
expect(found!.syncStatus).toBe('pending');
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
it('should reject duplicate hashes', async () => {
|
|
184
|
-
await seedAgentProfile();
|
|
185
|
-
|
|
186
|
-
// Two messages with same content at same timestamp would produce same hash.
|
|
187
|
-
// In practice timestamps differ, but we test the unique constraint.
|
|
188
|
-
const msg = await createPost(TEST_AGENT_ID, TEST_MNEMONIC, 'first');
|
|
189
|
-
|
|
190
|
-
// Force a duplicate by inserting directly
|
|
191
|
-
await expect(
|
|
192
|
-
testPrisma.socialMessage.create({
|
|
193
|
-
data: {
|
|
194
|
-
agentId: msg.agentId,
|
|
195
|
-
hash: msg.hash, // duplicate
|
|
196
|
-
type: msg.type,
|
|
197
|
-
body: msg.body,
|
|
198
|
-
timestamp: msg.timestamp,
|
|
199
|
-
network: msg.network,
|
|
200
|
-
signature: msg.signature,
|
|
201
|
-
signer: msg.signer,
|
|
202
|
-
},
|
|
203
|
-
}),
|
|
204
|
-
).rejects.toThrow();
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
});
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { signMessage, type MessageData, type SignedEnvelope } from '../../../lib/social/sign';
|
|
3
|
-
import { blake3 } from '@noble/hashes/blake3.js';
|
|
4
|
-
import { ed25519 } from '@noble/curves/ed25519.js';
|
|
5
|
-
|
|
6
|
-
const TEST_MNEMONIC =
|
|
7
|
-
'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about';
|
|
8
|
-
|
|
9
|
-
const POST_DATA: MessageData = {
|
|
10
|
-
type: 'post_add',
|
|
11
|
-
timestamp: 1700000000000,
|
|
12
|
-
network: 'mainnet',
|
|
13
|
-
body: { text: 'gm auramaxxnow' },
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
describe('signMessage()', () => {
|
|
17
|
-
it('should return a valid SignedEnvelope', () => {
|
|
18
|
-
const env = signMessage(POST_DATA, TEST_MNEMONIC);
|
|
19
|
-
|
|
20
|
-
expect(env.data).toEqual(POST_DATA);
|
|
21
|
-
expect(env.hashScheme).toBe('blake3');
|
|
22
|
-
expect(env.signatureScheme).toBe('ed25519');
|
|
23
|
-
expect(env.hash).toMatch(/^[0-9a-f]{64}$/);
|
|
24
|
-
expect(env.signature).toMatch(/^[0-9a-f]{128}$/);
|
|
25
|
-
expect(env.signer).toMatch(/^[0-9a-f]{64}$/);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('should be deterministic (same input -> same output)', () => {
|
|
29
|
-
const env1 = signMessage(POST_DATA, TEST_MNEMONIC);
|
|
30
|
-
const env2 = signMessage(POST_DATA, TEST_MNEMONIC);
|
|
31
|
-
|
|
32
|
-
expect(env1.hash).toBe(env2.hash);
|
|
33
|
-
expect(env1.signature).toBe(env2.signature);
|
|
34
|
-
expect(env1.signer).toBe(env2.signer);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('should produce a verifiable ED25519 signature', () => {
|
|
38
|
-
const env = signMessage(POST_DATA, TEST_MNEMONIC);
|
|
39
|
-
|
|
40
|
-
const hashBytes = Buffer.from(env.hash, 'hex');
|
|
41
|
-
const sigBytes = Buffer.from(env.signature, 'hex');
|
|
42
|
-
const pubBytes = Buffer.from(env.signer, 'hex');
|
|
43
|
-
|
|
44
|
-
expect(ed25519.verify(sigBytes, hashBytes, pubBytes)).toBe(true);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('should produce a BLAKE3 hash matching re-hashed canonical form', () => {
|
|
48
|
-
const env = signMessage(POST_DATA, TEST_MNEMONIC);
|
|
49
|
-
|
|
50
|
-
// Reconstruct canonical form in the hub's fixed field order.
|
|
51
|
-
const canonical = {
|
|
52
|
-
body: { text: 'gm auramaxxnow' },
|
|
53
|
-
network: 'mainnet',
|
|
54
|
-
timestamp: 1700000000000,
|
|
55
|
-
type: 'post_add',
|
|
56
|
-
wireType: 'CAST_ADD',
|
|
57
|
-
version: 1,
|
|
58
|
-
};
|
|
59
|
-
const jsonBytes = new TextEncoder().encode(JSON.stringify(canonical));
|
|
60
|
-
const expected = Buffer.from(blake3(jsonBytes)).toString('hex');
|
|
61
|
-
|
|
62
|
-
expect(env.hash).toBe(expected);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it('should canonicalize deterministically with fixed field set', () => {
|
|
66
|
-
const env = signMessage(POST_DATA, TEST_MNEMONIC);
|
|
67
|
-
|
|
68
|
-
const canonical = {
|
|
69
|
-
body: { text: 'gm auramaxxnow' },
|
|
70
|
-
network: 'mainnet',
|
|
71
|
-
timestamp: 1700000000000,
|
|
72
|
-
type: 'post_add',
|
|
73
|
-
wireType: 'CAST_ADD',
|
|
74
|
-
version: 1,
|
|
75
|
-
};
|
|
76
|
-
const jsonBytes = new TextEncoder().encode(JSON.stringify(canonical));
|
|
77
|
-
const expected = Buffer.from(blake3(jsonBytes)).toString('hex');
|
|
78
|
-
|
|
79
|
-
expect(env.hash).toBe(expected);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
it('should change hash when body changes', () => {
|
|
83
|
-
const env1 = signMessage(POST_DATA, TEST_MNEMONIC);
|
|
84
|
-
const env2 = signMessage(
|
|
85
|
-
{ ...POST_DATA, body: { text: 'different message' } },
|
|
86
|
-
TEST_MNEMONIC,
|
|
87
|
-
);
|
|
88
|
-
|
|
89
|
-
expect(env1.hash).not.toBe(env2.hash);
|
|
90
|
-
expect(env1.signature).not.toBe(env2.signature);
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('should change signer when mnemonic changes', () => {
|
|
94
|
-
const other =
|
|
95
|
-
'zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo wrong';
|
|
96
|
-
const env1 = signMessage(POST_DATA, TEST_MNEMONIC);
|
|
97
|
-
const env2 = signMessage(POST_DATA, other);
|
|
98
|
-
|
|
99
|
-
expect(env1.signer).not.toBe(env2.signer);
|
|
100
|
-
expect(env1.hash).toBe(env2.hash); // same data -> same hash
|
|
101
|
-
expect(env1.signature).not.toBe(env2.signature); // different key -> different sig
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
it('should map all 7 wire types', () => {
|
|
105
|
-
const types = [
|
|
106
|
-
['post_add', 'CAST_ADD'],
|
|
107
|
-
['post_remove', 'CAST_REMOVE'],
|
|
108
|
-
['reaction_add', 'REACTION_ADD'],
|
|
109
|
-
['reaction_remove', 'REACTION_REMOVE'],
|
|
110
|
-
['link_add', 'LINK_ADD'],
|
|
111
|
-
['link_remove', 'LINK_REMOVE'],
|
|
112
|
-
['user_data_add', 'USER_DATA_ADD'],
|
|
113
|
-
] as const;
|
|
114
|
-
|
|
115
|
-
for (const [type, wireType] of types) {
|
|
116
|
-
const data: MessageData = { ...POST_DATA, type };
|
|
117
|
-
const env = signMessage(data, TEST_MNEMONIC);
|
|
118
|
-
|
|
119
|
-
// Verify wireType is embedded in canonical form by re-hashing
|
|
120
|
-
expect(env.hash).toMatch(/^[0-9a-f]{64}$/);
|
|
121
|
-
expect(ed25519.verify(
|
|
122
|
-
Buffer.from(env.signature, 'hex'),
|
|
123
|
-
Buffer.from(env.hash, 'hex'),
|
|
124
|
-
Buffer.from(env.signer, 'hex'),
|
|
125
|
-
)).toBe(true);
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it('should throw for unknown message type', () => {
|
|
130
|
-
const bad: MessageData = { ...POST_DATA, type: 'invalid_type' };
|
|
131
|
-
expect(() => signMessage(bad, TEST_MNEMONIC)).toThrow('Unknown message type: invalid_type');
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
it('should sort nested body keys canonically', () => {
|
|
135
|
-
const data1: MessageData = {
|
|
136
|
-
...POST_DATA,
|
|
137
|
-
body: { text: 'hello', embeds: ['https://example.com'], mentions: [7, 11] },
|
|
138
|
-
};
|
|
139
|
-
const data2: MessageData = {
|
|
140
|
-
...POST_DATA,
|
|
141
|
-
body: { mentions: [7, 11], text: 'hello', embeds: ['https://example.com'] },
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
const env1 = signMessage(data1, TEST_MNEMONIC);
|
|
145
|
-
const env2 = signMessage(data2, TEST_MNEMONIC);
|
|
146
|
-
|
|
147
|
-
expect(env1.hash).toBe(env2.hash);
|
|
148
|
-
expect(env1.signature).toBe(env2.signature);
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
// Deterministic test vector: pin hash + signer for the test mnemonic
|
|
152
|
-
it('should match pinned test vectors', () => {
|
|
153
|
-
const env = signMessage(POST_DATA, TEST_MNEMONIC);
|
|
154
|
-
|
|
155
|
-
// Signer is the public key derived from m/44'/501'/0'/0' of the test mnemonic
|
|
156
|
-
// This value is stable across runs.
|
|
157
|
-
expect(env.signer).toHaveLength(64);
|
|
158
|
-
|
|
159
|
-
// Verify the full roundtrip is deterministic
|
|
160
|
-
const env2 = signMessage(POST_DATA, TEST_MNEMONIC);
|
|
161
|
-
expect(env).toEqual(env2);
|
|
162
|
-
});
|
|
163
|
-
});
|