auramaxx 0.0.12 → 0.0.13
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/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +244 -227
- package/.next/app-path-routes-manifest.json +11 -10
- package/.next/build-manifest.json +14 -14
- package/.next/prerender-manifest.json +49 -25
- package/.next/react-loadable-manifest.json +41 -41
- package/.next/routes-manifest.json +6 -0
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +12 -12
- package/.next/server/app/api/[...doc]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent-requests/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/apps/install/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/apps/manifests/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/apps/static/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/docs/plain/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/events/route.js +1 -19
- package/.next/server/app/api/events/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/import-from-openclaw/[channel]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/import-from-openclaw/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/import-from-openclaw/validate/[channel]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/update/route.js +63 -1
- package/.next/server/app/api/update/route.js.nft.json +1 -1
- package/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/workspace/[id]/apps/[wid]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/workspace/[id]/apps/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/workspace/[id]/export/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/workspace/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/workspace/config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/workspace/import/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/workspace/route_client-reference-manifest.js +1 -1
- package/.next/server/app/app-legacy-do-not-use/page.js +1 -1
- package/.next/server/app/app-legacy-do-not-use/page.js.nft.json +1 -1
- package/.next/server/app/app-legacy-do-not-use/page_client-reference-manifest.js +1 -1
- package/.next/server/app/app-legacy-do-not-use.html +1 -1
- package/.next/server/app/app-legacy-do-not-use.rsc +14 -14
- package/.next/server/app/approve/[actionId]/page.js +1 -1
- package/.next/server/app/approve/[actionId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/docs/[...doc]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/health/page_client-reference-manifest.js +1 -1
- package/.next/server/app/health.html +1 -1
- package/.next/server/app/health.rsc +13 -13
- package/.next/server/app/hello/page_client-reference-manifest.js +1 -1
- package/.next/server/app/hello.html +1 -1
- package/.next/server/app/hello.rsc +14 -14
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +18 -21
- package/.next/server/app/page.js +3 -3
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
- package/.next/server/app/privacy.html +1 -1
- package/.next/server/app/privacy.rsc +13 -13
- package/.next/server/app/share/[token]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/terms/page_client-reference-manifest.js +1 -1
- package/.next/server/app/terms.html +1 -1
- package/.next/server/app/terms.rsc +13 -13
- package/.next/server/app/yo/page.js +2 -0
- package/.next/server/app/yo/page.js.nft.json +1 -0
- package/.next/server/app/yo/page_client-reference-manifest.js +1 -0
- package/.next/server/app/yo.html +1 -0
- package/.next/server/app/yo.meta +7 -0
- package/.next/server/app/yo.rsc +23 -0
- package/.next/server/app-paths-manifest.json +11 -10
- package/.next/server/chunks/2145.js +1 -1
- package/.next/server/chunks/2460.js +1 -1
- package/.next/server/chunks/5246.js +1 -1
- package/.next/server/chunks/5678.js +1 -1
- package/.next/server/chunks/5784.js +1 -1
- package/.next/server/chunks/6086.js +2 -20
- package/.next/server/chunks/{5553.js → 6415.js} +2 -2
- package/.next/server/chunks/7935.js +2 -2
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/instrumentation.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/server/webpack-runtime.js +1 -1
- package/.next/static/WshFGr6RxGYP6AbWuT9OG/_buildManifest.js +1 -0
- package/.next/static/chunks/1168.aaac1edbb597fe5a.js +1 -0
- package/.next/static/chunks/1255-7999eac54f80a49f.js +1 -0
- package/.next/static/chunks/142-fa9752f53a551f63.js +1 -0
- package/.next/static/chunks/2505.d54ccadc42f4e3d1.js +1 -0
- package/.next/static/chunks/2619-04bc32f026a0d946.js +1 -0
- package/.next/static/chunks/2927.7e00cc878d9a3f52.js +1 -0
- package/.next/static/chunks/3573-1b41d7b8a000d015.js +1 -0
- package/.next/static/chunks/3609.ded5a5306e18af9c.js +1 -0
- package/.next/static/chunks/3667-1db7bd03948e60df.js +1 -0
- package/.next/static/chunks/3826.a73d4a88d8c09030.js +1 -0
- package/.next/static/chunks/{3a91511d-648a2ba3dad7df0c.js → 3a91511d-ba215c0b5dc21ba9.js} +1 -1
- package/.next/static/chunks/4256.48407d9abad5ea33.js +1 -0
- package/.next/static/chunks/4685-7f53bbfc4a9845eb.js +1 -0
- package/.next/static/chunks/4901-ba6a32818662e70a.js +1 -0
- package/.next/static/chunks/4919-7e7cdd5efc9f2110.js +1 -0
- package/.next/static/chunks/4bd1b696-100b9d70ed4e49c1.js +1 -0
- package/.next/static/chunks/5336-233ec7ab3807267c.js +1 -0
- package/.next/static/chunks/5442-b5bb869e832e8967.js +1 -0
- package/.next/static/chunks/6233-97a810aa272af547.js +1 -0
- package/.next/static/chunks/626.a5109d16f9eca1f6.js +1 -0
- package/.next/static/chunks/6872-faea0f088ab2d450.js +1 -0
- package/.next/static/chunks/7338-3ce17a93614f1d77.js +59 -0
- package/.next/static/chunks/7394-4bdb1feefad1a74a.js +1 -0
- package/.next/static/chunks/7616-1129bcb3eee8d315.js +1 -0
- package/.next/static/chunks/786-26deffb41572cbb3.js +1 -0
- package/.next/static/chunks/8273-8e92d34180669ca9.js +1 -0
- package/.next/static/chunks/8357.5dee1e0c4e5bb091.js +1 -0
- package/.next/static/chunks/9062-2bc2d089f9c9c6ba.js +1 -0
- package/.next/static/chunks/9380.f198afbf0c6b5369.js +1 -0
- package/.next/static/chunks/app/_not-found/page-5a8c6a29f762fa58.js +1 -0
- package/.next/static/chunks/app/api/[...doc]/page-f0852f35f0fd1d44.js +1 -0
- package/.next/static/chunks/app/api/agent-requests/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/apps/install/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/apps/manifests/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/apps/static/[...path]/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/docs/plain/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/events/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/import-from-openclaw/[channel]/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/import-from-openclaw/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/import-from-openclaw/validate/[channel]/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/page-cc59bebcc0d2c01d.js +1 -0
- package/.next/static/chunks/app/api/restart/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/update/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/version/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/workspace/[id]/apps/[wid]/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/workspace/[id]/apps/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/workspace/[id]/export/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/workspace/[id]/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/workspace/config/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/workspace/import/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/api/workspace/route-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/app-legacy-do-not-use/page-e5dc864e92d90ca7.js +1 -0
- package/.next/static/chunks/app/approve/[actionId]/page-2acca1f490424f21.js +1 -0
- package/.next/static/chunks/app/docs/[...doc]/page-8e2a2d036caab242.js +1 -0
- package/.next/static/chunks/app/docs/page-acf872a03ff79893.js +1 -0
- package/.next/static/chunks/app/error-66f983b7769dabfa.js +1 -0
- package/.next/static/chunks/app/health/page-c9185854ed9c86d0.js +1 -0
- package/.next/static/chunks/app/hello/page-74c9f4deaa4b03dd.js +1 -0
- package/.next/static/chunks/app/layout-af8d9969c7aeb758.js +1 -0
- package/.next/static/chunks/app/page-16dfcd1c7cc88bcc.js +1 -0
- package/.next/static/chunks/app/privacy/page-8e2d17079355c2cc.js +1 -0
- package/.next/static/chunks/app/share/[token]/page-5dd9b0418eee411f.js +1 -0
- package/.next/static/chunks/app/terms/page-8e2d17079355c2cc.js +1 -0
- package/.next/static/chunks/app/yo/layout-cf84f975aad4c719.js +1 -0
- package/.next/static/chunks/app/yo/page-719dc5f213fdfb30.js +1 -0
- package/.next/static/chunks/framework-a32a2a465584c0bc.js +1 -0
- package/.next/static/chunks/main-0f0f9142f74e7215.js +1 -0
- package/.next/static/chunks/main-app-24f0c92ba10af457.js +1 -0
- package/.next/static/chunks/pages/_app-4b3fb5e477a0267f.js +1 -0
- package/.next/static/chunks/pages/_error-c970d8b55ace1b48.js +1 -0
- package/.next/static/chunks/{webpack-768de8b7d6a7a27a.js → webpack-79ad58260e9b10b4.js} +1 -1
- package/.next/static/css/83cd401584ab787f.css +3 -0
- package/.next/trace +28 -28
- package/.next/types/app/yo/layout.ts +84 -0
- package/.next/types/app/yo/page.ts +84 -0
- package/.next/types/routes.d.ts +4 -2
- package/.next/types/validator.ts +18 -0
- package/bin/auramaxx.js +9 -24
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/AUTH.md +6 -3
- package/docs/CLI.md +2 -0
- package/docs/MCP.md +2 -0
- package/docs/credentials.md +2 -0
- package/package.json +1 -1
- package/prisma/migrations/20260227214000_update_agent_action_ttl_defaults/migration.sql +19 -0
- 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/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/llm.txt +2 -0
- package/public/llms.txt +39 -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/shared/agent-profile-schema.ts +81 -0
- package/shared/credential-field-schema.ts +12 -0
- package/skills/auramaxx/SKILL.md +71 -691
- package/src/app/UnlockPageClient.tsx +1939 -0
- package/src/app/api/page.tsx +8 -9
- package/src/app/api/update/route.ts +105 -36
- package/src/app/approve/[actionId]/page.tsx +4 -1
- package/src/app/docs/DocsPageContent.tsx +3 -3
- package/src/app/globals.css +94 -0
- package/src/app/layout.tsx +1 -0
- package/src/app/page.tsx +25 -1935
- package/src/app/yo/layout.tsx +29 -0
- package/src/app/yo/page.tsx +528 -0
- package/src/components/HumanActionBar.tsx +34 -8
- package/src/components/agent/AgentSidebar.tsx +3 -1
- package/src/components/agent/CredentialAgent.tsx +5 -1
- package/src/components/agent/CredentialDetail.tsx +32 -1
- package/src/components/agent/CredentialForm.tsx +94 -7
- package/src/components/agent/CredentialRow.tsx +8 -1
- package/src/components/agent/credentialFormName.ts +22 -1
- package/src/components/agent/types.ts +2 -2
- package/src/components/design-system/Modal.tsx +14 -1
- package/src/hooks/useUpdateChecker.ts +17 -1
- package/src/lib/pino.ts +77 -8
- package/src/server/cli/commands/actions.ts +1 -1
- package/src/server/cli/commands/agent.ts +110 -65
- package/src/server/cli/commands/approve.ts +1 -1
- package/src/server/cli/commands/auth.ts +81 -20
- package/src/server/cli/commands/token.ts +2 -2
- package/src/server/cli/lib/escalation.ts +109 -24
- package/src/server/cli/lib/process.ts +2 -1
- package/src/server/cli/socket.ts +1 -1
- package/src/server/index.ts +2 -0
- package/src/server/lib/agent-profile-records.ts +72 -0
- package/src/server/lib/credential-transport.ts +27 -11
- package/src/server/lib/defaults.ts +3 -3
- package/src/server/lib/escalation-responder.ts +1 -1
- package/src/server/lib/resolve-action.ts +2 -2
- package/src/server/mcp/server.ts +6 -1
- package/src/server/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/src/server/routes/actions.ts +2 -2
- package/src/server/routes/agent-profiles.ts +82 -0
- package/src/server/routes/auth.ts +39 -4
- package/src/server/routes/credentials.ts +18 -0
- package/src/server/tests/cli/agent-auth.test.ts +20 -39
- package/src/server/tests/cli/agent.test.ts +18 -0
- package/src/server/tests/cli/auth-action-flag.test.ts +3 -2
- package/src/server/tests/cli/bin-entrypoint.test.ts +35 -11
- package/src/server/tests/cli/escalation.test.ts +7 -3
- package/src/server/tests/cli/process.test.ts +3 -3
- package/src/server/tests/cli/socket.test.ts +2 -2
- package/src/server/tests/endpoints/actions.test.ts +2 -2
- package/src/server/tests/endpoints/agent-profiles.test.ts +117 -0
- package/src/server/tests/endpoints/auth.test.ts +34 -0
- package/src/server/tests/lib/credential-transport.test.ts +68 -2
- package/src/server/tests/lib/defaults.test.ts +2 -2
- package/src/server/tests/lib/escalation-responder.test.ts +2 -2
- package/src/server/tests/setup.ts +7 -0
- package/src/server/tsconfig.tsbuildinfo +1 -1
- package/src/server/types.ts +1 -1
- package/.next/static/chunks/1168.63dbb444a33b1867.js +0 -1
- package/.next/static/chunks/1255-e8718b02724690dd.js +0 -1
- package/.next/static/chunks/142-aeaf7ffa9c53516d.js +0 -1
- package/.next/static/chunks/2505.22aaa333fd65908f.js +0 -1
- package/.next/static/chunks/2619-3c9e02e22d10480a.js +0 -1
- package/.next/static/chunks/2927.e7e9e2a1b8d2dc61.js +0 -1
- package/.next/static/chunks/3573-27e17f4ff2dd86ed.js +0 -1
- package/.next/static/chunks/3609.6f8e0ecd6de9566c.js +0 -1
- package/.next/static/chunks/3667-d6770121629db38b.js +0 -1
- package/.next/static/chunks/3826.7dfe96467cd74e45.js +0 -1
- package/.next/static/chunks/4256.50cb375c979ffd5a.js +0 -1
- package/.next/static/chunks/4685-3f8d92f574366fec.js +0 -1
- package/.next/static/chunks/4901-54c1ac380b7b43bb.js +0 -1
- package/.next/static/chunks/4919-fe6f1553abfc9420.js +0 -1
- package/.next/static/chunks/4bd1b696-f785427dddbba9fb.js +0 -1
- package/.next/static/chunks/5336-bd251f91235f7c11.js +0 -1
- package/.next/static/chunks/5442-be197c885bf12079.js +0 -1
- package/.next/static/chunks/5553-c8b86fe3513fce04.js +0 -59
- package/.next/static/chunks/6233-44e6fe57a552a816.js +0 -1
- package/.next/static/chunks/626.2583673a0386a81b.js +0 -1
- package/.next/static/chunks/6872-6442f2f5cce36ce5.js +0 -1
- package/.next/static/chunks/7411-3ca797c21b722ccd.js +0 -1
- package/.next/static/chunks/7616-b8bd37ce1f735d6f.js +0 -1
- package/.next/static/chunks/786-9ed39f96091b2be4.js +0 -1
- package/.next/static/chunks/8273-922091226ba84a94.js +0 -1
- package/.next/static/chunks/8357.6159472717ff7d11.js +0 -1
- package/.next/static/chunks/9062-3eb1607c96486f88.js +0 -1
- package/.next/static/chunks/9380.93f361baab2eefdf.js +0 -1
- package/.next/static/chunks/app/_not-found/page-c3b87025baf0a9c2.js +0 -1
- package/.next/static/chunks/app/api/[...doc]/page-790c4b33ba1fde4a.js +0 -1
- package/.next/static/chunks/app/api/agent-requests/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/apps/install/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/apps/manifests/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/apps/static/[...path]/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/docs/plain/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/events/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/import-from-openclaw/[channel]/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/import-from-openclaw/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/import-from-openclaw/validate/[channel]/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/page-b53f9aa17a4c5201.js +0 -1
- package/.next/static/chunks/app/api/restart/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/update/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/version/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/workspace/[id]/apps/[wid]/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/workspace/[id]/apps/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/workspace/[id]/export/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/workspace/[id]/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/workspace/config/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/workspace/import/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/api/workspace/route-e83b12cbab2e8707.js +0 -1
- package/.next/static/chunks/app/app-legacy-do-not-use/page-0052191daef60036.js +0 -1
- package/.next/static/chunks/app/approve/[actionId]/page-45cd3b8fa062d5e5.js +0 -1
- package/.next/static/chunks/app/docs/[...doc]/page-632ac406200b66fe.js +0 -1
- package/.next/static/chunks/app/docs/page-b7556394709b43df.js +0 -1
- package/.next/static/chunks/app/error-3d6057da512253d8.js +0 -1
- package/.next/static/chunks/app/health/page-80c985cd72328b74.js +0 -1
- package/.next/static/chunks/app/hello/page-fd71babcd192729b.js +0 -1
- package/.next/static/chunks/app/layout-285c6ef3f16bae63.js +0 -1
- package/.next/static/chunks/app/page-85017185df14c37b.js +0 -1
- package/.next/static/chunks/app/privacy/page-faf36cd0dde6dfa3.js +0 -1
- package/.next/static/chunks/app/share/[token]/page-22d51d6c5a47bb75.js +0 -1
- package/.next/static/chunks/app/terms/page-faf36cd0dde6dfa3.js +0 -1
- package/.next/static/chunks/framework-e60c938074ff7136.js +0 -1
- package/.next/static/chunks/main-447abf206d7ebd2f.js +0 -1
- package/.next/static/chunks/main-app-f63b86bdbf5b7b88.js +0 -1
- package/.next/static/chunks/pages/_app-6c8c2371b16a04b8.js +0 -1
- package/.next/static/chunks/pages/_error-94812ad32cad7365.js +0 -1
- package/.next/static/css/eb25c6452113486f.css +0 -3
- package/.next/static/zCR6u3S4dIjlCtV80nNsp/_buildManifest.js +0 -1
- /package/.next/static/{zCR6u3S4dIjlCtV80nNsp → WshFGr6RxGYP6AbWuT9OG}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Request, Response, Router } from 'express';
|
|
2
|
+
import { requireWalletAuth } from '../middleware/auth';
|
|
3
|
+
import { requireAdmin } from '../lib/permissions';
|
|
4
|
+
import { getErrorMessage } from '../lib/error';
|
|
5
|
+
import { normalizeAgentProfileInput } from '../../../shared/agent-profile-schema';
|
|
6
|
+
import {
|
|
7
|
+
deleteAgentProfile,
|
|
8
|
+
getAgentProfile,
|
|
9
|
+
listAgentProfiles,
|
|
10
|
+
upsertAgentProfile,
|
|
11
|
+
} from '../lib/agent-profile-records';
|
|
12
|
+
|
|
13
|
+
const router = Router();
|
|
14
|
+
|
|
15
|
+
router.use(requireWalletAuth, requireAdmin);
|
|
16
|
+
|
|
17
|
+
function normalizeAgentIdParam(value: string): string {
|
|
18
|
+
const decoded = decodeURIComponent(String(value || ''));
|
|
19
|
+
const agentId = decoded.trim();
|
|
20
|
+
if (!agentId) {
|
|
21
|
+
throw new Error('agentId path param is required');
|
|
22
|
+
}
|
|
23
|
+
return agentId;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
router.get('/', (_req: Request, res: Response) => {
|
|
27
|
+
try {
|
|
28
|
+
const profiles = listAgentProfiles();
|
|
29
|
+
res.json({ success: true, profiles });
|
|
30
|
+
} catch (error) {
|
|
31
|
+
res.status(500).json({ success: false, error: getErrorMessage(error) });
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
router.get('/:agentId', (req: Request<{ agentId: string }>, res: Response) => {
|
|
36
|
+
try {
|
|
37
|
+
const agentId = normalizeAgentIdParam(req.params.agentId);
|
|
38
|
+
const profile = getAgentProfile(agentId);
|
|
39
|
+
if (!profile) {
|
|
40
|
+
res.status(404).json({ success: false, error: 'Agent profile not found' });
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
res.json({ success: true, profile });
|
|
44
|
+
} catch (error) {
|
|
45
|
+
res.status(400).json({ success: false, error: getErrorMessage(error) });
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
router.put('/:agentId', (req: Request<{ agentId: string }>, res: Response) => {
|
|
50
|
+
try {
|
|
51
|
+
const agentId = normalizeAgentIdParam(req.params.agentId);
|
|
52
|
+
const body = req.body && typeof req.body === 'object' && !Array.isArray(req.body)
|
|
53
|
+
? req.body as Record<string, unknown>
|
|
54
|
+
: {};
|
|
55
|
+
const bodyAgentIdRaw = body.agentId ?? body.agent_id;
|
|
56
|
+
if (typeof bodyAgentIdRaw === 'string' && bodyAgentIdRaw.trim() && bodyAgentIdRaw.trim() !== agentId) {
|
|
57
|
+
res.status(400).json({ success: false, error: 'body agentId must match path param' });
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const normalized = normalizeAgentProfileInput(body, { fallbackAgentId: agentId });
|
|
61
|
+
const profile = upsertAgentProfile(normalized);
|
|
62
|
+
res.json({ success: true, profile });
|
|
63
|
+
} catch (error) {
|
|
64
|
+
res.status(400).json({ success: false, error: getErrorMessage(error) });
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
router.delete('/:agentId', (req: Request<{ agentId: string }>, res: Response) => {
|
|
69
|
+
try {
|
|
70
|
+
const agentId = normalizeAgentIdParam(req.params.agentId);
|
|
71
|
+
const removed = deleteAgentProfile(agentId);
|
|
72
|
+
if (!removed) {
|
|
73
|
+
res.status(404).json({ success: false, error: 'Agent profile not found' });
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
res.json({ success: true, deleted: true, agentId });
|
|
77
|
+
} catch (error) {
|
|
78
|
+
res.status(400).json({ success: false, error: getErrorMessage(error) });
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
export default router;
|
|
@@ -73,6 +73,34 @@ function buildSessionApprovalContract(input: {
|
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
function materializeRetryCommand(originalCommand: string | undefined, reqId: string): string | undefined {
|
|
77
|
+
const base = String(originalCommand || '').trim();
|
|
78
|
+
if (!base) return undefined;
|
|
79
|
+
let command = base.replace(/<reqId>/g, reqId);
|
|
80
|
+
|
|
81
|
+
command = command
|
|
82
|
+
.replace(/--req-id\s+\S+/g, `--reqId ${reqId}`)
|
|
83
|
+
.replace(/--request-id\s+\S+/g, `--reqId ${reqId}`)
|
|
84
|
+
.replace(/--requestId\s+\S+/g, `--reqId ${reqId}`)
|
|
85
|
+
.replace(/--reqId\s+\S+/g, `--reqId ${reqId}`);
|
|
86
|
+
|
|
87
|
+
if (!/\s--(?:reqId|req-id|requestId|request-id)(?:\s|=|$)/.test(command)) {
|
|
88
|
+
command = `${command} --reqId ${reqId}`;
|
|
89
|
+
}
|
|
90
|
+
return command;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function buildRetryInstructions(base: unknown, retryCommand: string | undefined): string[] {
|
|
94
|
+
const existing = Array.isArray(base)
|
|
95
|
+
? base.filter((entry): entry is string => typeof entry === 'string' && entry.trim().length > 0)
|
|
96
|
+
: [];
|
|
97
|
+
if (!retryCommand) return existing;
|
|
98
|
+
return [
|
|
99
|
+
`Run this exact command now: ${retryCommand}`,
|
|
100
|
+
...existing,
|
|
101
|
+
];
|
|
102
|
+
}
|
|
103
|
+
|
|
76
104
|
function auditApprovalLifecycle(input: {
|
|
77
105
|
requestId: string;
|
|
78
106
|
state:
|
|
@@ -481,6 +509,7 @@ router.get('/:requestId', async (req: Request<{ requestId: string }>, res: Respo
|
|
|
481
509
|
binding?: Record<string, unknown>;
|
|
482
510
|
approveUrl?: string;
|
|
483
511
|
pubkey?: string;
|
|
512
|
+
originalCommand?: string;
|
|
484
513
|
} = {};
|
|
485
514
|
if (request.metadata) {
|
|
486
515
|
try {
|
|
@@ -522,6 +551,8 @@ router.get('/:requestId', async (req: Request<{ requestId: string }>, res: Respo
|
|
|
522
551
|
secret,
|
|
523
552
|
...(typeof metadata.approveUrl === 'string' ? { approveUrl: metadata.approveUrl } : {}),
|
|
524
553
|
});
|
|
554
|
+
const retryCommand = materializeRetryCommand(metadata.originalCommand, requestId);
|
|
555
|
+
const instructions = buildRetryInstructions(contract.flow.instructions, retryCommand);
|
|
525
556
|
|
|
526
557
|
// Return status based on request state
|
|
527
558
|
if (request.status === 'pending') {
|
|
@@ -545,7 +576,8 @@ router.get('/:requestId', async (req: Request<{ requestId: string }>, res: Respo
|
|
|
545
576
|
retryReady: false,
|
|
546
577
|
claimAction: contract.claimAction,
|
|
547
578
|
retryAction: contract.retryAction,
|
|
548
|
-
instructions
|
|
579
|
+
instructions,
|
|
580
|
+
...(retryCommand ? { retryCommand } : {}),
|
|
549
581
|
...((metadata.policyHash || metadata.effectivePolicyHash) ? { policyHash: metadata.policyHash || metadata.effectivePolicyHash } : {}),
|
|
550
582
|
...((metadata.compilerVersion || metadata.effectivePolicyHash) ? { compilerVersion: metadata.compilerVersion || 'profile.v1' } : {}),
|
|
551
583
|
message: 'Waiting for human approval',
|
|
@@ -574,7 +606,8 @@ router.get('/:requestId', async (req: Request<{ requestId: string }>, res: Respo
|
|
|
574
606
|
retryReady: false,
|
|
575
607
|
claimAction: contract.claimAction,
|
|
576
608
|
retryAction: contract.retryAction,
|
|
577
|
-
instructions
|
|
609
|
+
instructions,
|
|
610
|
+
...(retryCommand ? { retryCommand } : {}),
|
|
578
611
|
...((metadata.policyHash || metadata.effectivePolicyHash) ? { policyHash: metadata.policyHash || metadata.effectivePolicyHash } : {}),
|
|
579
612
|
...((metadata.compilerVersion || metadata.effectivePolicyHash) ? { compilerVersion: metadata.compilerVersion || 'profile.v1' } : {}),
|
|
580
613
|
message: 'Request was rejected',
|
|
@@ -626,7 +659,8 @@ router.get('/:requestId', async (req: Request<{ requestId: string }>, res: Respo
|
|
|
626
659
|
retryReady: false,
|
|
627
660
|
claimAction: contract.claimAction,
|
|
628
661
|
retryAction: contract.retryAction,
|
|
629
|
-
instructions
|
|
662
|
+
instructions,
|
|
663
|
+
...(retryCommand ? { retryCommand } : {}),
|
|
630
664
|
...(policyHash ? { policyHash } : {}),
|
|
631
665
|
...(compilerVersion ? { compilerVersion } : {}),
|
|
632
666
|
...(metadata.requestedPolicySource ? { requestedPolicySource: metadata.requestedPolicySource } : {}),
|
|
@@ -672,7 +706,8 @@ router.get('/:requestId', async (req: Request<{ requestId: string }>, res: Respo
|
|
|
672
706
|
retryReady: true,
|
|
673
707
|
claimAction: contract.claimAction,
|
|
674
708
|
retryAction: contract.retryAction,
|
|
675
|
-
instructions
|
|
709
|
+
instructions,
|
|
710
|
+
...(retryCommand ? { retryCommand } : {}),
|
|
676
711
|
...((metadata.policyHash || metadata.effectivePolicyHash) ? { policyHash: metadata.policyHash || metadata.effectivePolicyHash } : {}),
|
|
677
712
|
...((metadata.compilerVersion || metadata.effectivePolicyHash) ? { compilerVersion: metadata.compilerVersion || 'profile.v1' } : {}),
|
|
678
713
|
approvalScope: metadata.approvalScope,
|
|
@@ -61,6 +61,7 @@ const router = Router();
|
|
|
61
61
|
const VALID_CREDENTIAL_TYPES = new Set<CredentialType>([
|
|
62
62
|
'login',
|
|
63
63
|
'card',
|
|
64
|
+
'sso',
|
|
64
65
|
'note',
|
|
65
66
|
'plain_note',
|
|
66
67
|
'hot_wallet',
|
|
@@ -108,6 +109,15 @@ function normalizeName(name: string): string {
|
|
|
108
109
|
return name.trim().normalize('NFKC');
|
|
109
110
|
}
|
|
110
111
|
|
|
112
|
+
function readOriginalCommand(req: Request): string | undefined {
|
|
113
|
+
const value = req.header('x-aura-original-command');
|
|
114
|
+
if (typeof value !== 'string') return undefined;
|
|
115
|
+
const trimmed = value.trim();
|
|
116
|
+
if (!trimmed) return undefined;
|
|
117
|
+
// Keep header storage bounded while preserving full command intent.
|
|
118
|
+
return trimmed.slice(0, 4000);
|
|
119
|
+
}
|
|
120
|
+
|
|
111
121
|
function findSensitiveFieldValue(fields: CredentialField[], key: string): string {
|
|
112
122
|
const field = fields.find((entry) => entry.key === key);
|
|
113
123
|
return typeof field?.value === 'string' ? field.value : '';
|
|
@@ -572,6 +582,7 @@ function buildCredentialOneShotDenyContext(input: {
|
|
|
572
582
|
flowSummary: string;
|
|
573
583
|
finalStep: string;
|
|
574
584
|
retryBehavior: string;
|
|
585
|
+
originalCommand?: string;
|
|
575
586
|
metadata?: Record<string, unknown>;
|
|
576
587
|
eventMetadata?: Record<string, unknown>;
|
|
577
588
|
responseMetadata?: Record<string, unknown>;
|
|
@@ -611,6 +622,7 @@ function buildCredentialOneShotDenyContext(input: {
|
|
|
611
622
|
credentialId: input.credential.id,
|
|
612
623
|
credentialName: input.credential.name,
|
|
613
624
|
credentialAgentId: input.credential.agentId,
|
|
625
|
+
...(input.originalCommand ? { originalCommand: input.originalCommand } : {}),
|
|
614
626
|
...(input.metadata || {}),
|
|
615
627
|
},
|
|
616
628
|
eventMetadata: {
|
|
@@ -1611,6 +1623,7 @@ router.post('/purge', (req: Request, res: Response) => {
|
|
|
1611
1623
|
router.post('/:id/read', async (req: Request<{ id: string }>, res: Response) => {
|
|
1612
1624
|
try {
|
|
1613
1625
|
const auth = req.auth!;
|
|
1626
|
+
const originalCommand = readOriginalCommand(req);
|
|
1614
1627
|
const requestedLocation = parseCredentialLocation(req.query.location, 'active');
|
|
1615
1628
|
if (!requestedLocation) {
|
|
1616
1629
|
res.status(400).json({ success: false, error: 'Invalid location. Expected active, archive, or recently_deleted' });
|
|
@@ -1701,6 +1714,7 @@ router.post('/:id/read', async (req: Request<{ id: string }>, res: Response) =>
|
|
|
1701
1714
|
flowSummary: 'This approval grants a one-shot scoped read token (maxReads=1, short TTL).',
|
|
1702
1715
|
finalStep: 'Retry the original secret read/inject call after claim succeeds.',
|
|
1703
1716
|
retryBehavior: 'Retrying before claim completion will return another approval-required response.',
|
|
1717
|
+
originalCommand,
|
|
1704
1718
|
metadata: {
|
|
1705
1719
|
policyContext: {
|
|
1706
1720
|
readScopes: auth.token.credentialAccess?.read || [],
|
|
@@ -1849,6 +1863,7 @@ router.post('/:id/read', async (req: Request<{ id: string }>, res: Response) =>
|
|
|
1849
1863
|
flowSummary: 'This approval grants a one-shot scoped read token (maxReads=1, short TTL).',
|
|
1850
1864
|
finalStep: 'Retry the original secret read/inject call after claim succeeds.',
|
|
1851
1865
|
retryBehavior: 'Retrying before claim completion will return another approval-required response.',
|
|
1866
|
+
originalCommand,
|
|
1852
1867
|
metadata: {
|
|
1853
1868
|
requestedFields: requestedExcludedFields,
|
|
1854
1869
|
policyContext: {
|
|
@@ -2006,6 +2021,7 @@ router.post('/:id/read', async (req: Request<{ id: string }>, res: Response) =>
|
|
|
2006
2021
|
router.post('/:id/totp', async (req: Request<{ id: string }>, res: Response) => {
|
|
2007
2022
|
try {
|
|
2008
2023
|
const auth = req.auth!;
|
|
2024
|
+
const originalCommand = readOriginalCommand(req);
|
|
2009
2025
|
|
|
2010
2026
|
const credential = getCredential(req.params.id);
|
|
2011
2027
|
if (!credential) {
|
|
@@ -2079,6 +2095,7 @@ router.post('/:id/totp', async (req: Request<{ id: string }>, res: Response) =>
|
|
|
2079
2095
|
flowSummary: 'This approval grants a one-shot scoped TOTP token (maxReads=1, short TTL).',
|
|
2080
2096
|
finalStep: 'Retry the original TOTP request after claim succeeds.',
|
|
2081
2097
|
retryBehavior: 'Retrying before claim completion will return another approval-required response.',
|
|
2098
|
+
originalCommand,
|
|
2082
2099
|
metadata: {
|
|
2083
2100
|
policyContext: {
|
|
2084
2101
|
readScopes: auth.token.credentialAccess?.read || [],
|
|
@@ -2149,6 +2166,7 @@ router.post('/:id/totp', async (req: Request<{ id: string }>, res: Response) =>
|
|
|
2149
2166
|
flowSummary: 'This approval grants a one-shot scoped TOTP token (maxReads=1, short TTL).',
|
|
2150
2167
|
finalStep: 'Retry the original TOTP request after claim succeeds.',
|
|
2151
2168
|
retryBehavior: 'Retrying before claim completion will return another approval-required response.',
|
|
2169
|
+
originalCommand,
|
|
2152
2170
|
});
|
|
2153
2171
|
await respondPermissionDenied({
|
|
2154
2172
|
req,
|
|
@@ -205,7 +205,7 @@ describe('agent CLI auth behavior', () => {
|
|
|
205
205
|
});
|
|
206
206
|
|
|
207
207
|
it('list supports --agent filter by name or id', async () => {
|
|
208
|
-
mocks.bootstrapViaSocket.
|
|
208
|
+
mocks.bootstrapViaSocket.mockResolvedValue('socket-token');
|
|
209
209
|
|
|
210
210
|
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input: RequestInfo | URL, init?: RequestInit) => {
|
|
211
211
|
const url = new URL(typeof input === 'string' ? input : input instanceof URL ? input.toString() : input.url);
|
|
@@ -644,6 +644,7 @@ describe('agent CLI auth behavior', () => {
|
|
|
644
644
|
const claimExit = await runAuthCli(['claim', 'req-admin-cli', '--json']);
|
|
645
645
|
expect(claimExit).toBe(0);
|
|
646
646
|
|
|
647
|
+
process.env.AURA_TOKEN = 'session-admin-token';
|
|
647
648
|
const firstReadExit = await runAgentCli(['get', 'github', '--reqId', 'req-admin-cli']);
|
|
648
649
|
expect(firstReadExit).toBe(0);
|
|
649
650
|
|
|
@@ -661,6 +662,7 @@ describe('agent CLI auth behavior', () => {
|
|
|
661
662
|
const reqId = 'req-e2e-cli-claim';
|
|
662
663
|
const secret = 'req-e2e-cli-secret';
|
|
663
664
|
let oneShotReads = 0;
|
|
665
|
+
let originalCommandHeader = '';
|
|
664
666
|
|
|
665
667
|
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input: RequestInfo | URL, init?: RequestInit) => {
|
|
666
668
|
const url = new URL(typeof input === 'string' ? input : input instanceof URL ? input.toString() : input.url);
|
|
@@ -694,6 +696,7 @@ describe('agent CLI auth behavior', () => {
|
|
|
694
696
|
if (url.pathname === '/credentials/cred-github/read' && method === 'POST') {
|
|
695
697
|
const headers = init?.headers as Record<string, string>;
|
|
696
698
|
if (headers.Authorization === 'Bearer read-token') {
|
|
699
|
+
originalCommandHeader = headers['X-Aura-Original-Command'] || headers['x-aura-original-command'] || '';
|
|
697
700
|
return new Response(JSON.stringify({
|
|
698
701
|
contractVersion: 'v1',
|
|
699
702
|
error: 'Excluded credential fields require human approval',
|
|
@@ -733,6 +736,7 @@ describe('agent CLI auth behavior', () => {
|
|
|
733
736
|
status: 'approved',
|
|
734
737
|
encryptedToken: 'one-shot-token',
|
|
735
738
|
ttl: 60,
|
|
739
|
+
retryCommand: `npx auramaxx get github --json --reqId ${reqId}`,
|
|
736
740
|
}), { status: 200, headers: { 'Content-Type': 'application/json' } });
|
|
737
741
|
}
|
|
738
742
|
|
|
@@ -786,6 +790,8 @@ describe('agent CLI auth behavior', () => {
|
|
|
786
790
|
const claimPayload = readJsonPayload(claimed);
|
|
787
791
|
expect(claimPayload.claimStatus).toBe('approved');
|
|
788
792
|
expect(claimPayload.retryReady).toBe(true);
|
|
793
|
+
expect(claimPayload.retryCommand).toBe(`npx auramaxx get github --json --reqId ${reqId}`);
|
|
794
|
+
expect(originalCommandHeader).toBe('npx auramaxx get github --json');
|
|
789
795
|
|
|
790
796
|
const retried = await runWithCapture(() => runAgentCli(['get', 'github', '--reqId', reqId, '--json']));
|
|
791
797
|
expect(retried.exitCode).toBe(0);
|
|
@@ -1282,8 +1288,9 @@ describe('agent CLI auth behavior', () => {
|
|
|
1282
1288
|
expect(payload.retryReady).toBe(false);
|
|
1283
1289
|
});
|
|
1284
1290
|
|
|
1285
|
-
it('expired one-shot reqId fails deterministically and
|
|
1291
|
+
it('expired one-shot reqId fails deterministically and does not continue to read', async () => {
|
|
1286
1292
|
process.env.WALLET_DATA_DIR = fs.mkdtempSync(path.join(os.tmpdir(), 'auramaxx-agent-auth-'));
|
|
1293
|
+
process.env.AURA_TOKEN = 'env-token';
|
|
1287
1294
|
putClaimedToken({
|
|
1288
1295
|
reqId: 'req-expired-oneshot',
|
|
1289
1296
|
token: 'claimed-one-shot',
|
|
@@ -1292,11 +1299,6 @@ describe('agent CLI auth behavior', () => {
|
|
|
1292
1299
|
credentialId: 'cred-github',
|
|
1293
1300
|
credentialName: 'github',
|
|
1294
1301
|
});
|
|
1295
|
-
putActiveSessionToken({
|
|
1296
|
-
token: 'session-fallback-token',
|
|
1297
|
-
privateKeyPem: 'mock-private-key',
|
|
1298
|
-
ttlSeconds: 120,
|
|
1299
|
-
});
|
|
1300
1302
|
|
|
1301
1303
|
const realNow = Date.now();
|
|
1302
1304
|
const nowSpy = vi.spyOn(Date, 'now').mockReturnValue(realNow + 121_000);
|
|
@@ -1305,13 +1307,6 @@ describe('agent CLI auth behavior', () => {
|
|
|
1305
1307
|
const url = new URL(typeof input === 'string' ? input : input instanceof URL ? input.toString() : input.url);
|
|
1306
1308
|
const method = init?.method || 'GET';
|
|
1307
1309
|
|
|
1308
|
-
if (url.pathname === '/auth/validate' && method === 'POST') {
|
|
1309
|
-
return new Response(JSON.stringify({ valid: true }), {
|
|
1310
|
-
status: 200,
|
|
1311
|
-
headers: { 'Content-Type': 'application/json' },
|
|
1312
|
-
});
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
1310
|
if (url.pathname === '/credentials' && method === 'GET' && url.searchParams.get('q') === 'github') {
|
|
1316
1311
|
return new Response(JSON.stringify({
|
|
1317
1312
|
credentials: [{
|
|
@@ -1391,28 +1386,23 @@ describe('agent CLI auth behavior', () => {
|
|
|
1391
1386
|
expect(logSpy).toHaveBeenCalledWith('No credentials found.');
|
|
1392
1387
|
});
|
|
1393
1388
|
|
|
1394
|
-
it('
|
|
1389
|
+
it('ignores stored session token and uses /auth fallback when socket bootstrap fails', async () => {
|
|
1395
1390
|
process.env.WALLET_DATA_DIR = fs.mkdtempSync(path.join(os.tmpdir(), 'auramaxx-agent-auth-'));
|
|
1396
1391
|
putActiveSessionToken({
|
|
1397
1392
|
token: 'stored-session-token',
|
|
1398
1393
|
privateKeyPem: 'mock-private-key',
|
|
1399
1394
|
ttlSeconds: 120,
|
|
1400
1395
|
});
|
|
1396
|
+
mocks.bootstrapViaSocket.mockRejectedValueOnce(new Error('Cannot connect to AuraMaxx: connect ENOENT /tmp/aura-cli.sock'));
|
|
1397
|
+
mocks.bootstrapViaAuthRequest.mockResolvedValueOnce('fallback-token');
|
|
1401
1398
|
|
|
1402
1399
|
const fetchSpy = vi.spyOn(globalThis, 'fetch').mockImplementation(async (input: RequestInfo | URL, init?: RequestInit) => {
|
|
1403
1400
|
const url = new URL(typeof input === 'string' ? input : input instanceof URL ? input.toString() : input.url);
|
|
1404
1401
|
const method = init?.method || 'GET';
|
|
1405
1402
|
|
|
1406
|
-
if (url.pathname === '/auth/validate' && method === 'POST') {
|
|
1407
|
-
return new Response(JSON.stringify({ valid: true }), {
|
|
1408
|
-
status: 200,
|
|
1409
|
-
headers: { 'Content-Type': 'application/json' },
|
|
1410
|
-
});
|
|
1411
|
-
}
|
|
1412
|
-
|
|
1413
1403
|
if (url.pathname === '/credentials' && method === 'GET') {
|
|
1414
1404
|
const headers = init?.headers as Record<string, string>;
|
|
1415
|
-
expect(headers.Authorization).toBe('Bearer
|
|
1405
|
+
expect(headers.Authorization).toBe('Bearer fallback-token');
|
|
1416
1406
|
return new Response(JSON.stringify({ credentials: [] }), {
|
|
1417
1407
|
status: 200,
|
|
1418
1408
|
headers: { 'Content-Type': 'application/json' },
|
|
@@ -1426,18 +1416,15 @@ describe('agent CLI auth behavior', () => {
|
|
|
1426
1416
|
const exitCode = await runAgentCli(['list']);
|
|
1427
1417
|
|
|
1428
1418
|
expect(exitCode).toBe(0);
|
|
1429
|
-
expect(mocks.bootstrapViaSocket).
|
|
1430
|
-
expect(
|
|
1419
|
+
expect(mocks.bootstrapViaSocket).toHaveBeenCalledTimes(1);
|
|
1420
|
+
expect(mocks.bootstrapViaAuthRequest).toHaveBeenCalledTimes(1);
|
|
1421
|
+
expect(fetchSpy.mock.calls.some(([input]) => String(input).includes('/auth/validate'))).toBe(false);
|
|
1431
1422
|
expect(logSpy).toHaveBeenCalledWith('No credentials found.');
|
|
1432
1423
|
});
|
|
1433
1424
|
|
|
1434
|
-
it('uses delegated read key for
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
token: 'stored-session-token',
|
|
1438
|
-
privateKeyPem: 'stored-session-private-key',
|
|
1439
|
-
ttlSeconds: 120,
|
|
1440
|
-
});
|
|
1425
|
+
it('uses delegated read key for /auth fallback tokens when read token issuance succeeds', async () => {
|
|
1426
|
+
mocks.bootstrapViaSocket.mockRejectedValueOnce(new Error('Cannot connect to AuraMaxx: connect ENOENT /tmp/aura-cli.sock'));
|
|
1427
|
+
mocks.bootstrapViaAuthRequest.mockResolvedValueOnce('fallback-auth-token');
|
|
1441
1428
|
mocks.generateEphemeralKeypair.mockReturnValueOnce({
|
|
1442
1429
|
publicKeyPem: 'ephemeral-public-key',
|
|
1443
1430
|
privateKeyPem: 'ephemeral-private-key',
|
|
@@ -1453,13 +1440,6 @@ describe('agent CLI auth behavior', () => {
|
|
|
1453
1440
|
const url = new URL(typeof input === 'string' ? input : input instanceof URL ? input.toString() : input.url);
|
|
1454
1441
|
const method = init?.method || 'GET';
|
|
1455
1442
|
|
|
1456
|
-
if (url.pathname === '/auth/validate' && method === 'POST') {
|
|
1457
|
-
return new Response(JSON.stringify({ valid: true }), {
|
|
1458
|
-
status: 200,
|
|
1459
|
-
headers: { 'Content-Type': 'application/json' },
|
|
1460
|
-
});
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
1443
|
if (url.pathname === '/credentials' && method === 'GET' && url.searchParams.get('q') === 'github') {
|
|
1464
1444
|
return new Response(JSON.stringify({
|
|
1465
1445
|
credentials: [{
|
|
@@ -1506,6 +1486,7 @@ describe('agent CLI auth behavior', () => {
|
|
|
1506
1486
|
|
|
1507
1487
|
expect(exitCode).toBe(0);
|
|
1508
1488
|
expect(mocks.createReadToken).toHaveBeenCalledTimes(1);
|
|
1489
|
+
expect(mocks.createReadToken.mock.calls[0]?.[1]).toBe('fallback-auth-token');
|
|
1509
1490
|
expect(logSpy).toHaveBeenCalledWith('enc(gh-secret)');
|
|
1510
1491
|
});
|
|
1511
1492
|
});
|
|
@@ -56,6 +56,24 @@ describe('agent CLI', () => {
|
|
|
56
56
|
expect(result.positional).toEqual(['aws']);
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
+
it('parses get with --req-id alias', () => {
|
|
60
|
+
const result = parseArgs(['get', 'aws', '--req-id', 'req-123']);
|
|
61
|
+
expect(result.reqId).toBe('req-123');
|
|
62
|
+
expect(result.positional).toEqual(['aws']);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('parses get with --requestId alias', () => {
|
|
66
|
+
const result = parseArgs(['get', 'aws', '--requestId', 'req-123']);
|
|
67
|
+
expect(result.reqId).toBe('req-123');
|
|
68
|
+
expect(result.positional).toEqual(['aws']);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('parses get with --request-id alias', () => {
|
|
72
|
+
const result = parseArgs(['get', 'aws', '--request-id', 'req-123']);
|
|
73
|
+
expect(result.reqId).toBe('req-123');
|
|
74
|
+
expect(result.positional).toEqual(['aws']);
|
|
75
|
+
});
|
|
76
|
+
|
|
59
77
|
it('parses list', () => {
|
|
60
78
|
const result = parseArgs(['list']);
|
|
61
79
|
expect(result.subcommand).toBe('list');
|
|
@@ -94,9 +94,10 @@ describe('CLI auth --action flag parsing', () => {
|
|
|
94
94
|
expect(parsed.noWait).toBe(true);
|
|
95
95
|
});
|
|
96
96
|
|
|
97
|
-
it('
|
|
97
|
+
it('leaves profile/version unset when omitted (resolved later from defaults)', () => {
|
|
98
98
|
const parsed = parseRequestFlags(['--agent-id', 'test-cli']);
|
|
99
|
-
expect(parsed.profile).
|
|
99
|
+
expect(parsed.profile).toBeUndefined();
|
|
100
|
+
expect(parsed.profileVersion).toBeUndefined();
|
|
100
101
|
});
|
|
101
102
|
|
|
102
103
|
it('supports explicit --wait legacy mode', () => {
|
|
@@ -23,7 +23,6 @@ describe('bin entrypoint', () => {
|
|
|
23
23
|
AURA_UPDATE_CHECK_MOCK_LATEST: 'v9.9.9',
|
|
24
24
|
AURA_UPDATE_CHECK_FORCE: '1',
|
|
25
25
|
AURA_AUTO_ALIAS_INSTALL: '0',
|
|
26
|
-
AURA_AUTO_MCP_INSTALL: '0',
|
|
27
26
|
AURA_FORCE_NODE_TSX: '1',
|
|
28
27
|
AURA_TOKEN: 'test-token',
|
|
29
28
|
WALLET_SERVER_URL: 'http://127.0.0.1:9',
|
|
@@ -43,7 +42,6 @@ describe('bin entrypoint', () => {
|
|
|
43
42
|
env: {
|
|
44
43
|
...process.env,
|
|
45
44
|
AURA_AUTO_ALIAS_INSTALL: '0',
|
|
46
|
-
AURA_AUTO_MCP_INSTALL: '0',
|
|
47
45
|
AURA_FORCE_NODE_TSX: '1',
|
|
48
46
|
AURA_TOKEN: 'test-token',
|
|
49
47
|
WALLET_SERVER_URL: 'http://127.0.0.1:9',
|
|
@@ -63,7 +61,6 @@ describe('bin entrypoint', () => {
|
|
|
63
61
|
env: {
|
|
64
62
|
...process.env,
|
|
65
63
|
AURA_AUTO_ALIAS_INSTALL: '0',
|
|
66
|
-
AURA_AUTO_MCP_INSTALL: '0',
|
|
67
64
|
AURA_FORCE_NODE_TSX: '1',
|
|
68
65
|
AURA_TOKEN: 'test-token',
|
|
69
66
|
WALLET_SERVER_URL: 'http://127.0.0.1:9',
|
|
@@ -83,7 +80,6 @@ describe('bin entrypoint', () => {
|
|
|
83
80
|
env: {
|
|
84
81
|
...process.env,
|
|
85
82
|
AURA_AUTO_ALIAS_INSTALL: '0',
|
|
86
|
-
AURA_AUTO_MCP_INSTALL: '0',
|
|
87
83
|
AURA_FORCE_NODE_TSX: '1',
|
|
88
84
|
AURA_TOKEN: 'test-token',
|
|
89
85
|
WALLET_SERVER_URL: 'http://127.0.0.1:9',
|
|
@@ -103,7 +99,6 @@ describe('bin entrypoint', () => {
|
|
|
103
99
|
env: {
|
|
104
100
|
...process.env,
|
|
105
101
|
AURA_AUTO_ALIAS_INSTALL: '0',
|
|
106
|
-
AURA_AUTO_MCP_INSTALL: '0',
|
|
107
102
|
AURA_FORCE_NODE_TSX: '1',
|
|
108
103
|
AURA_TOKEN: 'test-token',
|
|
109
104
|
WALLET_SERVER_URL: 'http://127.0.0.1:9',
|
|
@@ -123,7 +118,6 @@ describe('bin entrypoint', () => {
|
|
|
123
118
|
env: {
|
|
124
119
|
...process.env,
|
|
125
120
|
AURA_AUTO_ALIAS_INSTALL: '0',
|
|
126
|
-
AURA_AUTO_MCP_INSTALL: '0',
|
|
127
121
|
AURA_FORCE_NODE_TSX: '1',
|
|
128
122
|
AURA_NO_UPDATE_CHECK: '1',
|
|
129
123
|
},
|
|
@@ -150,7 +144,6 @@ describe('bin entrypoint', () => {
|
|
|
150
144
|
SHELL: '/bin/zsh',
|
|
151
145
|
PATH: tempBin,
|
|
152
146
|
AURA_AUTO_ALIAS_INSTALL_FORCE: '1',
|
|
153
|
-
AURA_AUTO_MCP_INSTALL: '0',
|
|
154
147
|
AURA_FORCE_NODE_TSX: '1',
|
|
155
148
|
AURA_NO_UPDATE_CHECK: '1',
|
|
156
149
|
WALLET_SERVER_URL: 'http://127.0.0.1:9',
|
|
@@ -194,7 +187,6 @@ describe('bin entrypoint', () => {
|
|
|
194
187
|
SHELL: '/bin/zsh',
|
|
195
188
|
PATH: tempBin,
|
|
196
189
|
AURA_AUTO_ALIAS_INSTALL_FORCE: '1',
|
|
197
|
-
AURA_AUTO_MCP_INSTALL: '0',
|
|
198
190
|
AURA_FORCE_NODE_TSX: '1',
|
|
199
191
|
AURA_NO_UPDATE_CHECK: '1',
|
|
200
192
|
WALLET_SERVER_URL: 'http://127.0.0.1:9',
|
|
@@ -220,7 +212,6 @@ describe('bin entrypoint', () => {
|
|
|
220
212
|
env: {
|
|
221
213
|
...process.env,
|
|
222
214
|
AURA_AUTO_ALIAS_INSTALL: '0',
|
|
223
|
-
AURA_AUTO_MCP_INSTALL: '0',
|
|
224
215
|
AURA_NO_UPDATE_CHECK: '1',
|
|
225
216
|
NO_COLOR: '1',
|
|
226
217
|
},
|
|
@@ -263,7 +254,6 @@ describe('bin entrypoint', () => {
|
|
|
263
254
|
env: {
|
|
264
255
|
...process.env,
|
|
265
256
|
AURA_AUTO_ALIAS_INSTALL: '0',
|
|
266
|
-
AURA_AUTO_MCP_INSTALL: '0',
|
|
267
257
|
AURA_NO_UPDATE_CHECK: '1',
|
|
268
258
|
NO_COLOR: '1',
|
|
269
259
|
},
|
|
@@ -296,6 +286,38 @@ describe('bin entrypoint', () => {
|
|
|
296
286
|
...process.env,
|
|
297
287
|
WALLET_DATA_DIR: tempData,
|
|
298
288
|
AURA_AUTO_ALIAS_INSTALL: '0',
|
|
289
|
+
AURA_FORCE_NODE_TSX: '1',
|
|
290
|
+
AURA_NO_UPDATE_CHECK: '1',
|
|
291
|
+
},
|
|
292
|
+
encoding: 'utf8',
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
const combinedOutput = `${result.stdout}\n${result.stderr}`;
|
|
296
|
+
expect(result.status).toBe(0);
|
|
297
|
+
expect(combinedOutput).toContain('npx auramaxx start [options]');
|
|
298
|
+
expect(combinedOutput).not.toContain('Unknown command: --debug');
|
|
299
|
+
} finally {
|
|
300
|
+
fs.rmSync(tempData, { recursive: true, force: true });
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
it('ignores env toggles and auto-runs skill/mcp setup on explicit start', () => {
|
|
305
|
+
const tempHome = fs.mkdtempSync(path.join(os.tmpdir(), 'auramaxx-start-autoinstall-'));
|
|
306
|
+
const tempData = fs.mkdtempSync(path.join(os.tmpdir(), 'auramaxx-start-autoinstall-data-'));
|
|
307
|
+
try {
|
|
308
|
+
fs.writeFileSync(path.join(tempData, 'auramaxx.db'), '');
|
|
309
|
+
fs.writeFileSync(path.join(tempData, 'agent-primary.json'), '{}');
|
|
310
|
+
|
|
311
|
+
const result = spawnSync(process.execPath, [binPath, 'start', '--help'], {
|
|
312
|
+
cwd: projectRoot,
|
|
313
|
+
env: {
|
|
314
|
+
...process.env,
|
|
315
|
+
HOME: tempHome,
|
|
316
|
+
CODEX_HOME: path.join(tempHome, '.codex'),
|
|
317
|
+
CLAUDE_HOME: path.join(tempHome, '.claude'),
|
|
318
|
+
OPENCLAW_HOME: path.join(tempHome, '.openclaw'),
|
|
319
|
+
WALLET_DATA_DIR: tempData,
|
|
320
|
+
AURA_AUTO_ALIAS_INSTALL: '0',
|
|
299
321
|
AURA_AUTO_SKILL_INSTALL: '0',
|
|
300
322
|
AURA_AUTO_MCP_INSTALL: '0',
|
|
301
323
|
AURA_FORCE_NODE_TSX: '1',
|
|
@@ -306,9 +328,11 @@ describe('bin entrypoint', () => {
|
|
|
306
328
|
|
|
307
329
|
const combinedOutput = `${result.stdout}\n${result.stderr}`;
|
|
308
330
|
expect(result.status).toBe(0);
|
|
331
|
+
expect(combinedOutput).toContain('Skills… ✓');
|
|
332
|
+
expect(combinedOutput).toContain('MCP… ✓');
|
|
309
333
|
expect(combinedOutput).toContain('npx auramaxx start [options]');
|
|
310
|
-
expect(combinedOutput).not.toContain('Unknown command: --debug');
|
|
311
334
|
} finally {
|
|
335
|
+
fs.rmSync(tempHome, { recursive: true, force: true });
|
|
312
336
|
fs.rmSync(tempData, { recursive: true, force: true });
|
|
313
337
|
}
|
|
314
338
|
});
|
|
@@ -56,6 +56,8 @@ describe('cli escalation guidance', () => {
|
|
|
56
56
|
approveUrl: 'http://localhost:4747/approve/req-123',
|
|
57
57
|
approvalScope: 'one_shot_read',
|
|
58
58
|
error: 'Excluded field requires approval',
|
|
59
|
+
}, {
|
|
60
|
+
retryCommandTemplate: 'npx auramaxx get OURSECRET',
|
|
59
61
|
});
|
|
60
62
|
|
|
61
63
|
expect(handled).toBe(true);
|
|
@@ -69,12 +71,12 @@ describe('cli escalation guidance', () => {
|
|
|
69
71
|
};
|
|
70
72
|
expect(payload.reqId).toBe('req-123');
|
|
71
73
|
expect(payload.claimAction?.command).toBe('npx auramaxx auth claim req-123 --json');
|
|
72
|
-
expect(payload.retryAction?.command).toBe('
|
|
74
|
+
expect(payload.retryAction?.command).toBe('npx auramaxx get OURSECRET --reqId req-123');
|
|
73
75
|
expect(payload.claimStatus).toBe('pending');
|
|
74
76
|
expect(payload.retryReady).toBe(false);
|
|
75
77
|
expect(payload.instructions?.[0]).toContain('approve');
|
|
76
78
|
expect(payload.instructions?.[1]).toContain('Claim');
|
|
77
|
-
expect(payload.instructions?.[2]).toContain('
|
|
79
|
+
expect(payload.instructions?.[2]).toContain('exact command');
|
|
78
80
|
|
|
79
81
|
errorSpy.mockRestore();
|
|
80
82
|
});
|
|
@@ -119,6 +121,8 @@ describe('cli escalation guidance', () => {
|
|
|
119
121
|
reqId: 'req-456',
|
|
120
122
|
claimStatus: 'expired',
|
|
121
123
|
retryReady: false,
|
|
124
|
+
}, {
|
|
125
|
+
retryCommandTemplate: 'npx auramaxx get OURSECRET --json',
|
|
122
126
|
});
|
|
123
127
|
|
|
124
128
|
expect(handled).toBe(true);
|
|
@@ -128,7 +132,7 @@ describe('cli escalation guidance', () => {
|
|
|
128
132
|
instructions?: string[];
|
|
129
133
|
};
|
|
130
134
|
expect(payload.claimAction?.command).toBe('npx auramaxx auth claim req-456 --json');
|
|
131
|
-
expect(payload.retryAction?.command).toBe('
|
|
135
|
+
expect(payload.retryAction?.command).toBe('npx auramaxx get OURSECRET --json --reqId req-456');
|
|
132
136
|
expect(payload.instructions?.length).toBeGreaterThan(0);
|
|
133
137
|
|
|
134
138
|
errorSpy.mockRestore();
|
|
@@ -223,7 +223,7 @@ describe('process management (mocked)', () => {
|
|
|
223
223
|
startServer({ headless: false });
|
|
224
224
|
|
|
225
225
|
expect(mockedExecSync).toHaveBeenCalledWith(
|
|
226
|
-
'
|
|
226
|
+
'npm run build',
|
|
227
227
|
expect.objectContaining({
|
|
228
228
|
cwd: expect.any(String),
|
|
229
229
|
stdio: 'ignore',
|
|
@@ -244,7 +244,7 @@ describe('process management (mocked)', () => {
|
|
|
244
244
|
let buildRecovered = false;
|
|
245
245
|
const buildIdSuffix = `${path.sep}.next${path.sep}BUILD_ID`;
|
|
246
246
|
mockedExecSync.mockImplementation((command: unknown) => {
|
|
247
|
-
if (String(command) === '
|
|
247
|
+
if (String(command) === 'npm run build') {
|
|
248
248
|
buildRecovered = true;
|
|
249
249
|
}
|
|
250
250
|
return Buffer.from('');
|
|
@@ -258,7 +258,7 @@ describe('process management (mocked)', () => {
|
|
|
258
258
|
startServer({ headless: false });
|
|
259
259
|
|
|
260
260
|
expect(mockedExecSync).toHaveBeenCalledWith(
|
|
261
|
-
'
|
|
261
|
+
'npm run build',
|
|
262
262
|
expect.objectContaining({
|
|
263
263
|
cwd: expect.any(String),
|
|
264
264
|
stdio: 'ignore',
|