@castlekit/castle 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -0
- package/.next/standalone/.next/app-path-routes-manifest.json +29 -0
- package/.next/standalone/.next/build-manifest.json +20 -0
- package/.next/standalone/.next/package.json +1 -0
- package/.next/standalone/.next/prerender-manifest.json +186 -0
- package/.next/standalone/.next/required-server-files.json +322 -0
- package/.next/standalone/.next/routes-manifest.json +213 -0
- package/.next/standalone/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +17 -0
- package/.next/standalone/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
- package/.next/standalone/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/_global-error/page.js +10 -0
- package/.next/standalone/.next/server/app/_global-error/page.js.map +5 -0
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/_global-error.html +2 -0
- package/.next/standalone/.next/server/app/_global-error.meta +15 -0
- package/.next/standalone/.next/server/app/_global-error.rsc +12 -0
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +12 -0
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +5 -0
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +4 -0
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
- package/.next/standalone/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +17 -0
- package/.next/standalone/.next/server/app/_not-found/page/next-font-manifest.json +11 -0
- package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/_not-found/page.js +15 -0
- package/.next/standalone/.next/server/app/_not-found/page.js.map +5 -0
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/_not-found.html +1 -0
- package/.next/standalone/.next/server/app/_not-found.meta +16 -0
- package/.next/standalone/.next/server/app/_not-found.rsc +17 -0
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +17 -0
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +6 -0
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +8 -0
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +4 -0
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -0
- package/.next/standalone/.next/server/app/api/avatars/[id]/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/avatars/[id]/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/avatars/[id]/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/avatars/[id]/route.js +9 -0
- package/.next/standalone/.next/server/app/api/avatars/[id]/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/avatars/[id]/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/avatars/[id]/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/[id]/avatar/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/[id]/avatar/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/[id]/avatar/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/[id]/avatar/route.js +9 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/[id]/avatar/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/[id]/avatar/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/[id]/avatar/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/route.js +9 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/status/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/status/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/status/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/status/route.js +13 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/status/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/status/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/openclaw/agents/status/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/attachments/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/attachments/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/attachments/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/attachments/route.js +13 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/attachments/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/attachments/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/attachments/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/channels/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/channels/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/channels/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/channels/route.js +13 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/channels/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/channels/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/channels/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/route.js +14 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/search/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/search/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/search/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/search/route.js +13 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/search/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/search/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/search/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/storage/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/storage/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/storage/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/storage/route.js +13 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/storage/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/storage/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/openclaw/chat/storage/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/openclaw/config/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/openclaw/config/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/openclaw/config/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/openclaw/config/route.js +9 -0
- package/.next/standalone/.next/server/app/api/openclaw/config/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/openclaw/config/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/openclaw/config/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/openclaw/events/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/openclaw/events/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/openclaw/events/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/openclaw/events/route.js +8 -0
- package/.next/standalone/.next/server/app/api/openclaw/events/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/openclaw/events/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/openclaw/events/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/openclaw/logs/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/openclaw/logs/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/openclaw/logs/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/openclaw/logs/route.js +8 -0
- package/.next/standalone/.next/server/app/api/openclaw/logs/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/openclaw/logs/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/openclaw/logs/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/openclaw/ping/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/openclaw/ping/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/openclaw/ping/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/openclaw/ping/route.js +9 -0
- package/.next/standalone/.next/server/app/api/openclaw/ping/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/openclaw/ping/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/openclaw/ping/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/openclaw/restart/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/openclaw/restart/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/openclaw/restart/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/openclaw/restart/route.js +7 -0
- package/.next/standalone/.next/server/app/api/openclaw/restart/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/openclaw/restart/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/openclaw/restart/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/openclaw/session/context/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/openclaw/session/context/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/openclaw/session/context/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/openclaw/session/context/route.js +14 -0
- package/.next/standalone/.next/server/app/api/openclaw/session/context/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/openclaw/session/context/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/openclaw/session/context/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/openclaw/session/status/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/openclaw/session/status/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/openclaw/session/status/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/openclaw/session/status/route.js +8 -0
- package/.next/standalone/.next/server/app/api/openclaw/session/status/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/openclaw/session/status/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/openclaw/session/status/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/openclaw/sessions/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/openclaw/sessions/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/openclaw/sessions/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/openclaw/sessions/route.js +8 -0
- package/.next/standalone/.next/server/app/api/openclaw/sessions/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/openclaw/sessions/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/openclaw/sessions/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/settings/avatar/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/settings/avatar/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/settings/avatar/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/settings/avatar/route.js +13 -0
- package/.next/standalone/.next/server/app/api/settings/avatar/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/settings/avatar/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/settings/avatar/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/settings/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/settings/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/settings/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/settings/route.js +13 -0
- package/.next/standalone/.next/server/app/api/settings/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/settings/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/settings/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/chat/[channelId]/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/chat/[channelId]/page/build-manifest.json +17 -0
- package/.next/standalone/.next/server/app/chat/[channelId]/page/next-font-manifest.json +11 -0
- package/.next/standalone/.next/server/app/chat/[channelId]/page/react-loadable-manifest.json +1 -0
- package/.next/standalone/.next/server/app/chat/[channelId]/page/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/chat/[channelId]/page.js +18 -0
- package/.next/standalone/.next/server/app/chat/[channelId]/page.js.map +5 -0
- package/.next/standalone/.next/server/app/chat/[channelId]/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/chat/[channelId]/page_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/chat/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/chat/page/build-manifest.json +17 -0
- package/.next/standalone/.next/server/app/chat/page/next-font-manifest.json +11 -0
- package/.next/standalone/.next/server/app/chat/page/react-loadable-manifest.json +1 -0
- package/.next/standalone/.next/server/app/chat/page/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/chat/page.js +18 -0
- package/.next/standalone/.next/server/app/chat/page.js.map +5 -0
- package/.next/standalone/.next/server/app/chat/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/chat/page_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/chat.html +1 -0
- package/.next/standalone/.next/server/app/chat.meta +15 -0
- package/.next/standalone/.next/server/app/chat.rsc +26 -0
- package/.next/standalone/.next/server/app/chat.segments/_full.segment.rsc +26 -0
- package/.next/standalone/.next/server/app/chat.segments/_head.segment.rsc +6 -0
- package/.next/standalone/.next/server/app/chat.segments/_index.segment.rsc +8 -0
- package/.next/standalone/.next/server/app/chat.segments/_tree.segment.rsc +4 -0
- package/.next/standalone/.next/server/app/chat.segments/chat/__PAGE__.segment.rsc +9 -0
- package/.next/standalone/.next/server/app/chat.segments/chat.segment.rsc +7 -0
- package/.next/standalone/.next/server/app/icon.png/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/icon.png/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/icon.png/route.js +8 -0
- package/.next/standalone/.next/server/app/icon.png/route.js.map +5 -0
- package/.next/standalone/.next/server/app/icon.png/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/icon.png.body +0 -0
- package/.next/standalone/.next/server/app/icon.png.meta +1 -0
- package/.next/standalone/.next/server/app/index.html +1 -0
- package/.next/standalone/.next/server/app/index.meta +14 -0
- package/.next/standalone/.next/server/app/index.rsc +23 -0
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +9 -0
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +23 -0
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +6 -0
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +8 -0
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +4 -0
- package/.next/standalone/.next/server/app/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/page/build-manifest.json +17 -0
- package/.next/standalone/.next/server/app/page/next-font-manifest.json +11 -0
- package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +1 -0
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/page.js +17 -0
- package/.next/standalone/.next/server/app/page.js.map +5 -0
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/settings/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/settings/page/build-manifest.json +17 -0
- package/.next/standalone/.next/server/app/settings/page/next-font-manifest.json +11 -0
- package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -0
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/settings/page.js +17 -0
- package/.next/standalone/.next/server/app/settings/page.js.map +5 -0
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/settings.html +1 -0
- package/.next/standalone/.next/server/app/settings.meta +15 -0
- package/.next/standalone/.next/server/app/settings.rsc +23 -0
- package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +23 -0
- package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +6 -0
- package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +8 -0
- package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +4 -0
- package/.next/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +9 -0
- package/.next/standalone/.next/server/app/settings.segments/settings.segment.rsc +4 -0
- package/.next/standalone/.next/server/app/ui-kit/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/ui-kit/page/build-manifest.json +17 -0
- package/.next/standalone/.next/server/app/ui-kit/page/next-font-manifest.json +11 -0
- package/.next/standalone/.next/server/app/ui-kit/page/react-loadable-manifest.json +1 -0
- package/.next/standalone/.next/server/app/ui-kit/page/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/ui-kit/page.js +17 -0
- package/.next/standalone/.next/server/app/ui-kit/page.js.map +5 -0
- package/.next/standalone/.next/server/app/ui-kit/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/ui-kit/page_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/ui-kit.html +1 -0
- package/.next/standalone/.next/server/app/ui-kit.meta +15 -0
- package/.next/standalone/.next/server/app/ui-kit.rsc +23 -0
- package/.next/standalone/.next/server/app/ui-kit.segments/_full.segment.rsc +23 -0
- package/.next/standalone/.next/server/app/ui-kit.segments/_head.segment.rsc +6 -0
- package/.next/standalone/.next/server/app/ui-kit.segments/_index.segment.rsc +8 -0
- package/.next/standalone/.next/server/app/ui-kit.segments/_tree.segment.rsc +4 -0
- package/.next/standalone/.next/server/app/ui-kit.segments/ui-kit/__PAGE__.segment.rsc +9 -0
- package/.next/standalone/.next/server/app/ui-kit.segments/ui-kit.segment.rsc +4 -0
- package/.next/standalone/.next/server/app-paths-manifest.json +29 -0
- package/.next/standalone/.next/server/chunks/[externals]_next_dist_a6d89067._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2824c41d._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__28c35c7d._.js +11 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2aa60cfc._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2e91224f._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__361bce14._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__36b434e7._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__47efedcd._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__4b157e5a._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__56815e49._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5ef29d48._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5f6aa90c._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__7114163c._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8f5ebbc3._.js +7 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__93758a40._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a80a1099._.js +31 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__af3cebf7._.js +138 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b3182da1._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b39f673e._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__bbd3b47c._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c223b7d3._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c7ce1c43._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e50da949._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__f41df55c._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__faf9ad2e._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__fe76fb40._.js +3 -0
- package/.next/standalone/.next/server/chunks/[turbopack]_runtime.js +795 -0
- package/.next/standalone/.next/server/chunks/_b137597c._.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_avatars_[id]_route_actions_21e11acd.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_openclaw_agents_[id]_avatar_route_actions_1cb9863b.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_openclaw_agents_route_actions_82d135b1.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_openclaw_agents_status_route_actions_0b88c8a6.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_openclaw_chat_attachments_route_actions_07ce0270.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_openclaw_chat_channels_route_actions_945f54a8.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_openclaw_chat_route_actions_cd398c8d.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_openclaw_chat_search_route_actions_d1599780.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_openclaw_chat_storage_route_actions_fd3e7369.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_openclaw_config_route_actions_3c2a30de.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_openclaw_events_route_actions_24b1acfe.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_openclaw_logs_route_actions_151f8335.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_openclaw_ping_route_actions_3079a70c.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_openclaw_restart_route_actions_25b671bb.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_openclaw_session_context_route_actions_14ebc427.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_openclaw_session_status_route_actions_060ba4f4.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_openclaw_sessions_route_actions_0c00f4a9.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_settings_avatar_route_actions_e222d284.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_settings_route_actions_a476013b.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_icon_png_route_actions_fa3562e2.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_drizzle-orm_a549359e._.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_drizzle-orm_f8415f57._.js +4 -0
- package/.next/standalone/.next/server/chunks/node_modules_drizzle-orm_index_d5f6a514.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_next_1402a1da._.js +17 -0
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_97dac613.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03219135._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0f7b131d._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1690ee0d._.js +10 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__31de57f6._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__4e637dc9._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__55ece10e._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__69f5a83d._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__a457c799._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__a5ce2f72._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__aecdcbb6._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__b4ed2322._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__ca05f4a0._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__e2f86be8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__e375a3a7._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__ea12eca9._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__ed06de41._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__f907a2ce._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[turbopack]_runtime.js +795 -0
- package/.next/standalone/.next/server/chunks/ssr/_0bb5ce6a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_30d6fdaa._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_3b2b917b._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/_3bf0a72b._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/_539da066._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/_6caa74c9._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_7a67de23._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_7b52fbee._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_84fe35ec._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_ac1c4494._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_ca23d3b0._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/_d04daf62._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_e6db8164._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/_ef4d503b._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_75761787.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_554ec2bf.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_chat_[channelId]_page_actions_6220414d.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_chat_page_actions_c92d15a6.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_page_actions_39d4fc33.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_settings_page_actions_840229cd.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_ui-kit_page_actions_8486bfbd.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_45598cbe._.js +6 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_d3586d0c._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_95f27697._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_08570d7f._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_65e60196._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_681edc0a._.js +6 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_client_components_9774470f._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_45780354.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_ece394eb.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_15817684.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_02f39477.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_f9713a08._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_app_0c8a77b8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_app_chat_layout_tsx_31cd0231._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_app_chat_layout_tsx_be09920b._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_app_chat_page_tsx_2a0793ad._.js +3 -0
- package/.next/standalone/.next/server/edge/chunks/[root-of-the-server]__25fe7590._.js +15 -0
- package/.next/standalone/.next/server/edge/chunks/node_modules_next_dist_esm_build_templates_edge-wrapper_78fa9d6a.js +3 -0
- package/.next/standalone/.next/server/edge/chunks/turbopack-node_modules_next_dist_esm_build_templates_edge-wrapper_99e3e1b8.js +6 -0
- package/.next/standalone/.next/server/functions-config-manifest.json +6 -0
- package/.next/standalone/.next/server/middleware-build-manifest.js +21 -0
- package/.next/standalone/.next/server/middleware-manifest.json +33 -0
- package/.next/standalone/.next/server/next-font-manifest.js +1 -0
- package/.next/standalone/.next/server/next-font-manifest.json +31 -0
- package/.next/standalone/.next/server/pages/404.html +1 -0
- package/.next/standalone/.next/server/pages/500.html +2 -0
- package/.next/standalone/.next/server/pages-manifest.json +4 -0
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -0
- package/.next/standalone/.next/server/server-reference-manifest.json +5 -0
- package/.next/standalone/.next/static/R01Vc6rRTS_XwAg0Y8ERm/_buildManifest.js +11 -0
- package/.next/standalone/.next/static/R01Vc6rRTS_XwAg0Y8ERm/_clientMiddlewareManifest.json +6 -0
- package/.next/standalone/.next/static/R01Vc6rRTS_XwAg0Y8ERm/_ssgManifest.js +1 -0
- package/.next/standalone/.next/static/chunks/1c362778d42e76b0.js +1 -0
- package/.next/standalone/.next/static/chunks/2b48886a383c2e37.js +1 -0
- package/.next/standalone/.next/static/chunks/3c2b51fd3ab2ac34.css +3 -0
- package/.next/standalone/.next/static/chunks/3fef23e63934711e.js +1 -0
- package/.next/standalone/.next/static/chunks/5781c606560d6f13.js +1 -0
- package/.next/standalone/.next/static/chunks/5a1105a61e9390f8.js +1 -0
- package/.next/standalone/.next/static/chunks/6468938847443ae8.js +1 -0
- package/.next/standalone/.next/static/chunks/76c064224d953678.js +4 -0
- package/.next/standalone/.next/static/chunks/77868ed664ba62d2.js +1 -0
- package/.next/standalone/.next/static/chunks/7de9141b1af425c3.js +1 -0
- package/.next/standalone/.next/static/chunks/868f09ea8b0a7649.js +1 -0
- package/.next/standalone/.next/static/chunks/97d384ea34b6283a.js +1 -0
- package/.next/standalone/.next/static/chunks/a6dad97d9634a72d.js +1 -0
- package/.next/standalone/.next/static/chunks/a6dad97d9634a72d.js.map +1 -0
- package/.next/standalone/.next/static/chunks/afd967a636289a73.js +1 -0
- package/.next/standalone/.next/static/chunks/bffbc071b1075ac3.js +1 -0
- package/.next/standalone/.next/static/chunks/d11263c7e8894d27.js +1 -0
- package/.next/standalone/.next/static/chunks/f1f489dad7e35d90.js +2 -0
- package/.next/standalone/.next/static/chunks/turbopack-1da073e19f58dee0.js +4 -0
- package/.next/standalone/.next/static/media/4fa387ec64143e14-s.c1fdd6c2.woff2 +0 -0
- package/.next/standalone/.next/static/media/7178b3e590c64307-s.b97b3418.woff2 +0 -0
- package/.next/standalone/.next/static/media/797e433ab948586e-s.p.dbea232f.woff2 +0 -0
- package/.next/standalone/.next/static/media/8a480f0b521d4e75-s.8e0177b5.woff2 +0 -0
- package/.next/standalone/.next/static/media/bbc41e54d2fcbd21-s.799d8ef8.woff2 +0 -0
- package/.next/standalone/.next/static/media/caa3a2e1cccd8315-s.p.853070df.woff2 +0 -0
- package/.next/standalone/.next/static/media/icon.4cc5e0bd.png +0 -0
- package/.next/standalone/CHANGELOG.md +182 -0
- package/.next/standalone/CONTRIBUTING.md +46 -0
- package/.next/standalone/LICENSE +21 -0
- package/.next/standalone/README.md +54 -0
- package/.next/standalone/SECURITY.md +80 -0
- package/.next/standalone/bin/castle.js +193 -0
- package/.next/standalone/castle_secrets.py +29 -0
- package/.next/standalone/drizzle.config.ts +7 -0
- package/.next/standalone/index.js +1 -0
- package/.next/standalone/install.sh +776 -0
- package/.next/standalone/next.config.ts +9 -0
- package/.next/standalone/package-lock.json +8115 -0
- package/.next/standalone/package.json +105 -0
- package/.next/standalone/postcss.config.mjs +7 -0
- package/.next/standalone/server.js +44 -0
- package/.next/standalone/src/app/api/avatars/[id]/route.ts +172 -0
- package/.next/standalone/src/app/api/openclaw/agents/[id]/avatar/route.ts +216 -0
- package/.next/standalone/src/app/api/openclaw/agents/route.ts +149 -0
- package/.next/standalone/src/app/api/openclaw/agents/status/route.ts +55 -0
- package/.next/standalone/src/app/api/openclaw/chat/attachments/route.ts +230 -0
- package/.next/standalone/src/app/api/openclaw/chat/channels/route.ts +217 -0
- package/.next/standalone/src/app/api/openclaw/chat/route.ts +283 -0
- package/.next/standalone/src/app/api/openclaw/chat/search/route.ts +150 -0
- package/.next/standalone/src/app/api/openclaw/chat/storage/route.ts +75 -0
- package/.next/standalone/src/app/api/openclaw/config/route.ts +137 -0
- package/.next/standalone/src/app/api/openclaw/events/route.ts +140 -0
- package/.next/standalone/src/app/api/openclaw/logs/route.ts +74 -0
- package/.next/standalone/src/app/api/openclaw/ping/route.ts +73 -0
- package/.next/standalone/src/app/api/openclaw/restart/route.ts +73 -0
- package/.next/standalone/src/app/api/openclaw/session/context/route.ts +163 -0
- package/.next/standalone/src/app/api/openclaw/session/status/route.ts +210 -0
- package/.next/standalone/src/app/api/openclaw/sessions/route.ts +64 -0
- package/.next/standalone/src/app/api/settings/avatar/route.ts +190 -0
- package/.next/standalone/src/app/api/settings/route.ts +88 -0
- package/.next/standalone/src/app/chat/[channelId]/error-boundary.tsx +64 -0
- package/.next/standalone/src/app/chat/[channelId]/page.tsx +385 -0
- package/.next/standalone/src/app/chat/layout.tsx +96 -0
- package/.next/standalone/src/app/chat/page.tsx +52 -0
- package/.next/standalone/src/app/globals.css +383 -0
- package/.next/standalone/src/app/icon.png +0 -0
- package/.next/standalone/src/app/layout.tsx +48 -0
- package/.next/standalone/src/app/page.tsx +390 -0
- package/.next/standalone/src/app/settings/page.tsx +300 -0
- package/.next/standalone/src/app/ui-kit/page.tsx +684 -0
- package/.next/standalone/src/cli/onboarding.ts +810 -0
- package/.next/standalone/src/components/chat/agent-mention-popup.tsx +89 -0
- package/.next/standalone/src/components/chat/archived-channels.tsx +190 -0
- package/.next/standalone/src/components/chat/channel-list.tsx +140 -0
- package/.next/standalone/src/components/chat/chat-input.tsx +328 -0
- package/.next/standalone/src/components/chat/create-channel-dialog.tsx +171 -0
- package/.next/standalone/src/components/chat/markdown-content.tsx +205 -0
- package/.next/standalone/src/components/chat/message-bubble.tsx +168 -0
- package/.next/standalone/src/components/chat/message-list.tsx +666 -0
- package/.next/standalone/src/components/chat/message-queue.tsx +68 -0
- package/.next/standalone/src/components/chat/session-divider.tsx +61 -0
- package/.next/standalone/src/components/chat/session-stats-panel.tsx +444 -0
- package/.next/standalone/src/components/chat/storage-indicator.tsx +76 -0
- package/.next/standalone/src/components/dashboard/agent-status.tsx +107 -0
- package/.next/standalone/src/components/dashboard/glass-card.tsx +28 -0
- package/.next/standalone/src/components/dashboard/goal-widget.tsx +174 -0
- package/.next/standalone/src/components/dashboard/greeting-widget.tsx +78 -0
- package/.next/standalone/src/components/dashboard/index.ts +7 -0
- package/.next/standalone/src/components/dashboard/stat-widget.tsx +61 -0
- package/.next/standalone/src/components/dashboard/stock-widget.tsx +164 -0
- package/.next/standalone/src/components/dashboard/weather-widget.tsx +68 -0
- package/.next/standalone/src/components/icons/castle-icon.tsx +21 -0
- package/.next/standalone/src/components/kanban/index.ts +3 -0
- package/.next/standalone/src/components/kanban/kanban-board.tsx +391 -0
- package/.next/standalone/src/components/kanban/kanban-card.tsx +137 -0
- package/.next/standalone/src/components/kanban/kanban-column.tsx +98 -0
- package/.next/standalone/src/components/layout/index.ts +4 -0
- package/.next/standalone/src/components/layout/page-header.tsx +20 -0
- package/.next/standalone/src/components/layout/sidebar.tsx +209 -0
- package/.next/standalone/src/components/layout/theme-toggle.tsx +59 -0
- package/.next/standalone/src/components/layout/user-menu.tsx +97 -0
- package/.next/standalone/src/components/providers/presence-provider.tsx +8 -0
- package/.next/standalone/src/components/providers/search-provider.tsx +110 -0
- package/.next/standalone/src/components/search/search-dialog.tsx +269 -0
- package/.next/standalone/src/components/ui/alert.tsx +72 -0
- package/.next/standalone/src/components/ui/avatar.tsx +89 -0
- package/.next/standalone/src/components/ui/badge.tsx +39 -0
- package/.next/standalone/src/components/ui/button.tsx +43 -0
- package/.next/standalone/src/components/ui/card.tsx +107 -0
- package/.next/standalone/src/components/ui/checkbox.tsx +56 -0
- package/.next/standalone/src/components/ui/clock.tsx +171 -0
- package/.next/standalone/src/components/ui/dialog.tsx +111 -0
- package/.next/standalone/src/components/ui/index.ts +34 -0
- package/.next/standalone/src/components/ui/input.tsx +112 -0
- package/.next/standalone/src/components/ui/option-card.tsx +151 -0
- package/.next/standalone/src/components/ui/progress.tsx +103 -0
- package/.next/standalone/src/components/ui/radio.tsx +109 -0
- package/.next/standalone/src/components/ui/select.tsx +46 -0
- package/.next/standalone/src/components/ui/slider.tsx +62 -0
- package/.next/standalone/src/components/ui/tabs.tsx +132 -0
- package/.next/standalone/src/components/ui/toggle-group.tsx +85 -0
- package/.next/standalone/src/components/ui/toggle.tsx +78 -0
- package/.next/standalone/src/components/ui/tooltip.tsx +162 -0
- package/.next/standalone/src/components/ui/twemoji-text.tsx +37 -0
- package/.next/standalone/src/components/ui/uptime.tsx +106 -0
- package/.next/standalone/src/lib/api-security.ts +188 -0
- package/.next/standalone/src/lib/config.ts +227 -0
- package/.next/standalone/src/lib/date-utils.ts +79 -0
- package/.next/standalone/src/lib/db/index.ts +652 -0
- package/.next/standalone/src/lib/db/queries.ts +1144 -0
- package/.next/standalone/src/lib/db/schema.ts +164 -0
- package/.next/standalone/src/lib/device-identity.ts +303 -0
- package/.next/standalone/src/lib/gateway-connection.ts +649 -0
- package/.next/standalone/src/lib/hooks/use-agent-status.ts +251 -0
- package/.next/standalone/src/lib/hooks/use-chat.ts +753 -0
- package/.next/standalone/src/lib/hooks/use-compaction-events.ts +132 -0
- package/.next/standalone/src/lib/hooks/use-context-boundary.ts +82 -0
- package/.next/standalone/src/lib/hooks/use-openclaw.ts +185 -0
- package/.next/standalone/src/lib/hooks/use-search.ts +114 -0
- package/.next/standalone/src/lib/hooks/use-session-stats.ts +60 -0
- package/.next/standalone/src/lib/hooks/use-user-settings.ts +46 -0
- package/.next/standalone/src/lib/sse-singleton.ts +184 -0
- package/.next/standalone/src/lib/types/chat.ts +202 -0
- package/.next/standalone/src/lib/types/search.ts +60 -0
- package/.next/standalone/src/lib/utils.ts +6 -0
- package/.next/standalone/src/middleware.ts +52 -0
- package/.next/standalone/tsconfig.json +34 -0
- package/.next/standalone/vitest.config.ts +14 -0
- package/.next/standalone/vitest.stress.config.ts +14 -0
- package/.next/standalone/zizmor.yml +17 -0
- package/.next/static/R01Vc6rRTS_XwAg0Y8ERm/_buildManifest.js +11 -0
- package/.next/static/R01Vc6rRTS_XwAg0Y8ERm/_clientMiddlewareManifest.json +6 -0
- package/.next/static/R01Vc6rRTS_XwAg0Y8ERm/_ssgManifest.js +1 -0
- package/.next/static/chunks/1c362778d42e76b0.js +1 -0
- package/.next/static/chunks/2b48886a383c2e37.js +1 -0
- package/.next/static/chunks/3c2b51fd3ab2ac34.css +3 -0
- package/.next/static/chunks/3fef23e63934711e.js +1 -0
- package/.next/static/chunks/5781c606560d6f13.js +1 -0
- package/.next/static/chunks/5a1105a61e9390f8.js +1 -0
- package/.next/static/chunks/6468938847443ae8.js +1 -0
- package/.next/static/chunks/76c064224d953678.js +4 -0
- package/.next/static/chunks/77868ed664ba62d2.js +1 -0
- package/.next/static/chunks/7de9141b1af425c3.js +1 -0
- package/.next/static/chunks/868f09ea8b0a7649.js +1 -0
- package/.next/static/chunks/97d384ea34b6283a.js +1 -0
- package/.next/static/chunks/a6dad97d9634a72d.js +1 -0
- package/.next/static/chunks/a6dad97d9634a72d.js.map +1 -0
- package/.next/static/chunks/afd967a636289a73.js +1 -0
- package/.next/static/chunks/bffbc071b1075ac3.js +1 -0
- package/.next/static/chunks/d11263c7e8894d27.js +1 -0
- package/.next/static/chunks/f1f489dad7e35d90.js +2 -0
- package/.next/static/chunks/turbopack-1da073e19f58dee0.js +4 -0
- package/.next/static/media/4fa387ec64143e14-s.c1fdd6c2.woff2 +0 -0
- package/.next/static/media/7178b3e590c64307-s.b97b3418.woff2 +0 -0
- package/.next/static/media/797e433ab948586e-s.p.dbea232f.woff2 +0 -0
- package/.next/static/media/8a480f0b521d4e75-s.8e0177b5.woff2 +0 -0
- package/.next/static/media/bbc41e54d2fcbd21-s.799d8ef8.woff2 +0 -0
- package/.next/static/media/caa3a2e1cccd8315-s.p.853070df.woff2 +0 -0
- package/.next/static/media/icon.4cc5e0bd.png +0 -0
- package/LICENSE +1 -1
- package/bin/castle.js +17 -0
- package/next.config.ts +1 -0
- package/package.json +6 -1
- package/src/cli/onboarding.ts +102 -28
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useRef, useEffect, memo } from "react";
|
|
4
|
+
import twemoji from "@twemoji/api";
|
|
5
|
+
|
|
6
|
+
interface TwemojiTextProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wraps children and replaces native Unicode emojis with Twemoji SVG images.
|
|
13
|
+
* Uses twemoji.parse() on the rendered DOM node after mount/update.
|
|
14
|
+
*/
|
|
15
|
+
export const TwemojiText = memo(function TwemojiText({
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
}: TwemojiTextProps) {
|
|
19
|
+
const ref = useRef<HTMLSpanElement>(null);
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (ref.current) {
|
|
23
|
+
twemoji.parse(ref.current, {
|
|
24
|
+
folder: "svg",
|
|
25
|
+
ext: ".svg",
|
|
26
|
+
// Use jsDelivr CDN for the SVG assets
|
|
27
|
+
base: "https://cdn.jsdelivr.net/gh/jdecked/twemoji@latest/assets/",
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<span ref={ref} className={className}>
|
|
34
|
+
{children}
|
|
35
|
+
</span>
|
|
36
|
+
);
|
|
37
|
+
});
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
|
|
5
|
+
export type UptimeStatus = "loading" | "operational" | "degraded" | "partial" | "major" | "maintenance";
|
|
6
|
+
|
|
7
|
+
export interface UptimeProps {
|
|
8
|
+
title: string;
|
|
9
|
+
status: UptimeStatus;
|
|
10
|
+
uptimePercent?: number;
|
|
11
|
+
message?: string;
|
|
12
|
+
data?: number[];
|
|
13
|
+
labels?: string[];
|
|
14
|
+
barCount?: number;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const statusConfig: Record<UptimeStatus, { label: string; color: string; dot: string }> = {
|
|
19
|
+
loading: { label: "Checking...", color: "bg-foreground/5 text-foreground-secondary", dot: "bg-foreground/30" },
|
|
20
|
+
operational: { label: "Operational", color: "bg-success/10 text-success", dot: "bg-success" },
|
|
21
|
+
degraded: { label: "Degraded", color: "bg-warning/10 text-warning", dot: "bg-warning" },
|
|
22
|
+
partial: { label: "Partial Outage", color: "bg-warning/10 text-warning", dot: "bg-warning" },
|
|
23
|
+
major: { label: "Major Outage", color: "bg-error/10 text-error", dot: "bg-error" },
|
|
24
|
+
maintenance: { label: "Maintenance", color: "bg-info/10 text-info", dot: "bg-info" },
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
function getBarColor(value: number): string {
|
|
28
|
+
if (value < 0) return "bg-foreground/10";
|
|
29
|
+
if (value >= 99) return "bg-success";
|
|
30
|
+
if (value >= 95) return "bg-success/70";
|
|
31
|
+
if (value >= 90) return "bg-warning";
|
|
32
|
+
if (value >= 50) return "bg-warning/70";
|
|
33
|
+
return "bg-error";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function Uptime({
|
|
37
|
+
title,
|
|
38
|
+
status,
|
|
39
|
+
message,
|
|
40
|
+
data = [],
|
|
41
|
+
labels = [],
|
|
42
|
+
barCount = 45,
|
|
43
|
+
className,
|
|
44
|
+
}: UptimeProps) {
|
|
45
|
+
const config = statusConfig[status];
|
|
46
|
+
|
|
47
|
+
const bars = data === undefined
|
|
48
|
+
? null
|
|
49
|
+
: data.length > 0
|
|
50
|
+
? data.slice(-barCount)
|
|
51
|
+
: Array(barCount).fill(-1);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div className={cn("w-full", className)}>
|
|
55
|
+
<div className="flex items-center justify-between mb-6">
|
|
56
|
+
<h3 className="text-lg font-semibold text-foreground">{title}</h3>
|
|
57
|
+
{status === "loading" ? (
|
|
58
|
+
<span className="inline-flex items-center gap-2 px-3 py-1 text-sm text-foreground-secondary">
|
|
59
|
+
<svg className="animate-spin h-4 w-4" viewBox="0 0 24 24" fill="none">
|
|
60
|
+
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4" />
|
|
61
|
+
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" />
|
|
62
|
+
</svg>
|
|
63
|
+
</span>
|
|
64
|
+
) : (
|
|
65
|
+
<span className={cn(
|
|
66
|
+
"inline-flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium transition-opacity duration-300",
|
|
67
|
+
config.color
|
|
68
|
+
)}>
|
|
69
|
+
<span className={cn("h-2 w-2 rounded-full", config.dot)} />
|
|
70
|
+
{config.label}
|
|
71
|
+
</span>
|
|
72
|
+
)}
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div className="flex items-center justify-between mb-3">
|
|
76
|
+
<span className="text-sm text-foreground-secondary">Uptime</span>
|
|
77
|
+
<span className="text-sm text-foreground-secondary" suppressHydrationWarning>
|
|
78
|
+
{message}
|
|
79
|
+
</span>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<div className="flex justify-between mb-2 h-8">
|
|
83
|
+
{bars?.map((value, i) => (
|
|
84
|
+
<div
|
|
85
|
+
key={i}
|
|
86
|
+
className={cn(
|
|
87
|
+
"h-8 w-1 rounded-full",
|
|
88
|
+
getBarColor(value)
|
|
89
|
+
)}
|
|
90
|
+
title={value < 0 ? "No data" : `${value}%`}
|
|
91
|
+
/>
|
|
92
|
+
))}
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
{labels.length > 0 && (
|
|
96
|
+
<div className="flex justify-between text-xs text-foreground-muted">
|
|
97
|
+
{labels.map((label, i) => (
|
|
98
|
+
<span key={i}>{label}</span>
|
|
99
|
+
))}
|
|
100
|
+
</div>
|
|
101
|
+
)}
|
|
102
|
+
</div>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { Uptime };
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from "next/server";
|
|
2
|
+
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// Localhost guard — reject requests from non-local IPs
|
|
5
|
+
// ============================================================================
|
|
6
|
+
|
|
7
|
+
const LOCALHOST_IPS = new Set([
|
|
8
|
+
"127.0.0.1",
|
|
9
|
+
"::1",
|
|
10
|
+
"::ffff:127.0.0.1",
|
|
11
|
+
"localhost",
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Reject requests that don't originate from localhost.
|
|
16
|
+
* Uses x-forwarded-for (if behind a proxy) or falls back to the host header.
|
|
17
|
+
* Returns a 403 response if the request is from a non-local IP, or null if OK.
|
|
18
|
+
*/
|
|
19
|
+
export function checkLocalhost(request: NextRequest): NextResponse | null {
|
|
20
|
+
// If running in development, skip the check
|
|
21
|
+
if (process.env.NODE_ENV === "development") return null;
|
|
22
|
+
|
|
23
|
+
const forwarded = request.headers.get("x-forwarded-for");
|
|
24
|
+
const host = request.headers.get("host") || "";
|
|
25
|
+
|
|
26
|
+
// Check x-forwarded-for first (proxy scenario)
|
|
27
|
+
if (forwarded) {
|
|
28
|
+
const clientIp = forwarded.split(",")[0].trim();
|
|
29
|
+
if (!LOCALHOST_IPS.has(clientIp)) {
|
|
30
|
+
return NextResponse.json(
|
|
31
|
+
{ error: "Forbidden — Castle is only accessible from localhost" },
|
|
32
|
+
{ status: 403 }
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Check host header — reject if it's not a localhost variant
|
|
38
|
+
const hostname = host.split(":")[0];
|
|
39
|
+
if (hostname && !LOCALHOST_IPS.has(hostname)) {
|
|
40
|
+
return NextResponse.json(
|
|
41
|
+
{ error: "Forbidden — Castle is only accessible from localhost" },
|
|
42
|
+
{ status: 403 }
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ============================================================================
|
|
50
|
+
// Rate limiting — in-memory sliding window
|
|
51
|
+
// ============================================================================
|
|
52
|
+
|
|
53
|
+
interface RateLimitEntry {
|
|
54
|
+
timestamps: number[];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const rateLimitStore = new Map<string, RateLimitEntry>();
|
|
58
|
+
|
|
59
|
+
// Clean up stale entries every 5 minutes
|
|
60
|
+
let cleanupTimer: ReturnType<typeof setInterval> | null = null;
|
|
61
|
+
function ensureCleanup() {
|
|
62
|
+
if (cleanupTimer) return;
|
|
63
|
+
cleanupTimer = setInterval(() => {
|
|
64
|
+
const now = Date.now();
|
|
65
|
+
for (const [key, entry] of rateLimitStore.entries()) {
|
|
66
|
+
entry.timestamps = entry.timestamps.filter((t) => now - t < 60_000);
|
|
67
|
+
if (entry.timestamps.length === 0) rateLimitStore.delete(key);
|
|
68
|
+
}
|
|
69
|
+
}, 5 * 60_000);
|
|
70
|
+
// Don't prevent process exit
|
|
71
|
+
if (typeof cleanupTimer === "object" && "unref" in cleanupTimer) {
|
|
72
|
+
cleanupTimer.unref();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Simple in-memory rate limiter using a sliding window.
|
|
78
|
+
*
|
|
79
|
+
* @param key — Unique key for the rate limit bucket (e.g. "chat:send" or IP-based)
|
|
80
|
+
* @param limit — Max requests allowed within the window
|
|
81
|
+
* @param windowMs — Window duration in milliseconds (default: 60 seconds)
|
|
82
|
+
* @returns 429 response if rate limit exceeded, or null if OK
|
|
83
|
+
*/
|
|
84
|
+
export function checkRateLimit(
|
|
85
|
+
key: string,
|
|
86
|
+
limit: number,
|
|
87
|
+
windowMs = 60_000
|
|
88
|
+
): NextResponse | null {
|
|
89
|
+
ensureCleanup();
|
|
90
|
+
|
|
91
|
+
const now = Date.now();
|
|
92
|
+
let entry = rateLimitStore.get(key);
|
|
93
|
+
|
|
94
|
+
if (!entry) {
|
|
95
|
+
entry = { timestamps: [] };
|
|
96
|
+
rateLimitStore.set(key, entry);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Drop timestamps outside the window
|
|
100
|
+
entry.timestamps = entry.timestamps.filter((t) => now - t < windowMs);
|
|
101
|
+
|
|
102
|
+
if (entry.timestamps.length >= limit) {
|
|
103
|
+
return NextResponse.json(
|
|
104
|
+
{ error: "Too many requests — please slow down" },
|
|
105
|
+
{ status: 429 }
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
entry.timestamps.push(now);
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Helper to build a rate-limit key from the request IP + route.
|
|
115
|
+
*/
|
|
116
|
+
export function rateLimitKey(request: NextRequest, route: string): string {
|
|
117
|
+
const ip =
|
|
118
|
+
request.headers.get("x-forwarded-for")?.split(",")[0].trim() ||
|
|
119
|
+
request.headers.get("x-real-ip") ||
|
|
120
|
+
"local";
|
|
121
|
+
return `${ip}:${route}`;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// ============================================================================
|
|
125
|
+
// CSRF protection
|
|
126
|
+
// ============================================================================
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Verify that a mutating API request originated from the Castle UI itself,
|
|
130
|
+
* not from a cross-origin attacker (CSRF protection).
|
|
131
|
+
*
|
|
132
|
+
* Checks the Origin or Referer header against allowed localhost origins.
|
|
133
|
+
* Returns a 403 response if the request fails the check, or null if it passes.
|
|
134
|
+
*/
|
|
135
|
+
export function checkCsrf(request: NextRequest): NextResponse | null {
|
|
136
|
+
const origin = request.headers.get("origin");
|
|
137
|
+
const referer = request.headers.get("referer");
|
|
138
|
+
|
|
139
|
+
// Build allowed origins from the request's own host
|
|
140
|
+
const host = request.headers.get("host") || "localhost:3333";
|
|
141
|
+
const allowed = new Set([
|
|
142
|
+
`http://${host}`,
|
|
143
|
+
`https://${host}`,
|
|
144
|
+
// Common localhost variants
|
|
145
|
+
"http://localhost:3333",
|
|
146
|
+
"http://127.0.0.1:3333",
|
|
147
|
+
"http://[::1]:3333",
|
|
148
|
+
]);
|
|
149
|
+
|
|
150
|
+
// If Origin header is present, it must match
|
|
151
|
+
if (origin) {
|
|
152
|
+
if (allowed.has(origin)) return null;
|
|
153
|
+
return NextResponse.json(
|
|
154
|
+
{ error: "Forbidden — cross-origin request rejected" },
|
|
155
|
+
{ status: 403 }
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Fall back to Referer (browsers always send at least one for form submissions)
|
|
160
|
+
if (referer) {
|
|
161
|
+
try {
|
|
162
|
+
const refOrigin = new URL(referer).origin;
|
|
163
|
+
if (allowed.has(refOrigin)) return null;
|
|
164
|
+
} catch {
|
|
165
|
+
// Malformed referer
|
|
166
|
+
}
|
|
167
|
+
return NextResponse.json(
|
|
168
|
+
{ error: "Forbidden — cross-origin request rejected" },
|
|
169
|
+
{ status: 403 }
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// No Origin or Referer — likely a direct curl/CLI call, allow it.
|
|
174
|
+
// Browsers ALWAYS send Origin on cross-origin requests,
|
|
175
|
+
// so a missing Origin means it's not a browser-based CSRF attack.
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Sanitize a string by redacting token patterns and key material.
|
|
181
|
+
* Use this before returning any text content (logs, errors) via API.
|
|
182
|
+
*/
|
|
183
|
+
export function sanitizeForApi(str: string): string {
|
|
184
|
+
return str
|
|
185
|
+
.replace(/rew_[a-f0-9]+/gi, "rew_***")
|
|
186
|
+
.replace(/-----BEGIN [A-Z ]+-----[\s\S]*?-----END [A-Z ]+-----/g, "[REDACTED KEY]")
|
|
187
|
+
.replace(/\b[a-f0-9]{32,}\b/gi, (m) => m.slice(0, 8) + "***");
|
|
188
|
+
}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync, mkdirSync, existsSync, chmodSync } from "fs";
|
|
2
|
+
import { join } from "path";
|
|
3
|
+
import { homedir } from "os";
|
|
4
|
+
import { platform } from "os";
|
|
5
|
+
import JSON5 from "json5";
|
|
6
|
+
|
|
7
|
+
export interface CastleConfig {
|
|
8
|
+
openclaw: {
|
|
9
|
+
gateway_port: number;
|
|
10
|
+
gateway_token?: string;
|
|
11
|
+
gateway_url?: string; // Full WebSocket URL for remote Gateways (e.g. ws://192.168.1.50:18789)
|
|
12
|
+
is_remote?: boolean; // True when connecting to a non-local Gateway
|
|
13
|
+
primary_agent?: string;
|
|
14
|
+
};
|
|
15
|
+
server: {
|
|
16
|
+
port: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const DEFAULT_CONFIG: CastleConfig = {
|
|
21
|
+
openclaw: {
|
|
22
|
+
gateway_port: 18789,
|
|
23
|
+
},
|
|
24
|
+
server: {
|
|
25
|
+
port: 3333,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export function getCastleDir(): string {
|
|
30
|
+
return join(homedir(), ".castle");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function getConfigPath(): string {
|
|
34
|
+
return join(getCastleDir(), "castle.json");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function ensureCastleDir(): void {
|
|
38
|
+
const dir = getCastleDir();
|
|
39
|
+
if (!existsSync(dir)) {
|
|
40
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
41
|
+
}
|
|
42
|
+
// Tighten existing directories that may have been created with default perms
|
|
43
|
+
if (platform() !== "win32") {
|
|
44
|
+
try { chmodSync(dir, 0o700); } catch { /* ignore */ }
|
|
45
|
+
}
|
|
46
|
+
const dataDir = join(dir, "data");
|
|
47
|
+
if (!existsSync(dataDir)) {
|
|
48
|
+
mkdirSync(dataDir, { recursive: true, mode: 0o700 });
|
|
49
|
+
}
|
|
50
|
+
const logsDir = join(dir, "logs");
|
|
51
|
+
if (!existsSync(logsDir)) {
|
|
52
|
+
mkdirSync(logsDir, { recursive: true, mode: 0o700 });
|
|
53
|
+
}
|
|
54
|
+
// Tighten log file permissions — LaunchAgent creates them with default umask
|
|
55
|
+
if (platform() !== "win32") {
|
|
56
|
+
for (const logFile of ["server.log", "server.err"]) {
|
|
57
|
+
const logPath = join(logsDir, logFile);
|
|
58
|
+
if (existsSync(logPath)) {
|
|
59
|
+
try { chmodSync(logPath, 0o600); } catch { /* ignore */ }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function configExists(): boolean {
|
|
66
|
+
return existsSync(getConfigPath());
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function readConfig(): CastleConfig {
|
|
70
|
+
const configPath = getConfigPath();
|
|
71
|
+
if (!existsSync(configPath)) {
|
|
72
|
+
return { ...DEFAULT_CONFIG };
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
const raw = readFileSync(configPath, "utf-8");
|
|
76
|
+
const parsed = JSON5.parse(raw);
|
|
77
|
+
return {
|
|
78
|
+
...DEFAULT_CONFIG,
|
|
79
|
+
...parsed,
|
|
80
|
+
openclaw: { ...DEFAULT_CONFIG.openclaw, ...parsed.openclaw },
|
|
81
|
+
server: { ...DEFAULT_CONFIG.server, ...parsed.server },
|
|
82
|
+
};
|
|
83
|
+
} catch {
|
|
84
|
+
return { ...DEFAULT_CONFIG };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function writeConfig(config: CastleConfig): void {
|
|
89
|
+
ensureCastleDir();
|
|
90
|
+
const configPath = getConfigPath();
|
|
91
|
+
const content = JSON5.stringify(config, null, 2);
|
|
92
|
+
writeFileSync(configPath, content, "utf-8");
|
|
93
|
+
// Restrict permissions — castle.json may contain gateway_token
|
|
94
|
+
if (platform() !== "win32") {
|
|
95
|
+
try {
|
|
96
|
+
chmodSync(configPath, 0o600);
|
|
97
|
+
} catch {
|
|
98
|
+
// May fail on some filesystems
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Load a .env file and set values into process.env (does not override existing)
|
|
105
|
+
*/
|
|
106
|
+
function loadEnvFile(envPath: string): void {
|
|
107
|
+
if (!existsSync(envPath)) return;
|
|
108
|
+
try {
|
|
109
|
+
const raw = readFileSync(envPath, "utf-8");
|
|
110
|
+
for (const line of raw.split("\n")) {
|
|
111
|
+
const trimmed = line.trim();
|
|
112
|
+
if (!trimmed || trimmed.startsWith("#")) continue;
|
|
113
|
+
const eqIdx = trimmed.indexOf("=");
|
|
114
|
+
if (eqIdx === -1) continue;
|
|
115
|
+
const key = trimmed.slice(0, eqIdx).trim();
|
|
116
|
+
let value = trimmed.slice(eqIdx + 1).trim();
|
|
117
|
+
// Strip surrounding quotes
|
|
118
|
+
if ((value.startsWith('"') && value.endsWith('"')) ||
|
|
119
|
+
(value.startsWith("'") && value.endsWith("'"))) {
|
|
120
|
+
value = value.slice(1, -1);
|
|
121
|
+
}
|
|
122
|
+
if (!process.env[key]) {
|
|
123
|
+
process.env[key] = value;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
} catch {
|
|
127
|
+
// Ignore errors loading .env
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Resolve ${ENV_VAR} references in a string value.
|
|
133
|
+
* Users often have "token": "${OPENCLAW_GATEWAY_TOKEN}" in their config.
|
|
134
|
+
*/
|
|
135
|
+
function resolveEnvVar(value: string): string | null {
|
|
136
|
+
if (value.startsWith("${") && value.endsWith("}")) {
|
|
137
|
+
const envVar = value.slice(2, -1);
|
|
138
|
+
return process.env[envVar] || null;
|
|
139
|
+
}
|
|
140
|
+
return value;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Get the OpenClaw directory path
|
|
145
|
+
*/
|
|
146
|
+
export function getOpenClawDir(): string {
|
|
147
|
+
return join(homedir(), ".openclaw");
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Try to read the OpenClaw gateway token from ~/.openclaw/openclaw.json
|
|
152
|
+
* Handles ${ENV_VAR} references and loads ~/.openclaw/.env
|
|
153
|
+
*/
|
|
154
|
+
export function readOpenClawToken(): string | null {
|
|
155
|
+
// Load ~/.openclaw/.env first so env var references can resolve
|
|
156
|
+
loadEnvFile(join(getOpenClawDir(), ".env"));
|
|
157
|
+
|
|
158
|
+
const paths = [
|
|
159
|
+
join(homedir(), ".openclaw", "openclaw.json"),
|
|
160
|
+
join(homedir(), ".openclaw", "openclaw.json5"),
|
|
161
|
+
];
|
|
162
|
+
|
|
163
|
+
for (const p of paths) {
|
|
164
|
+
if (!existsSync(p)) continue;
|
|
165
|
+
try {
|
|
166
|
+
const raw = readFileSync(p, "utf-8");
|
|
167
|
+
const parsed = JSON5.parse(raw);
|
|
168
|
+
const token = parsed?.gateway?.auth?.token;
|
|
169
|
+
if (token && typeof token === "string") {
|
|
170
|
+
return resolveEnvVar(token);
|
|
171
|
+
}
|
|
172
|
+
} catch {
|
|
173
|
+
// Continue to next path
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Fallback: check env vars directly
|
|
178
|
+
return process.env.OPENCLAW_GATEWAY_TOKEN || null;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Try to read the OpenClaw gateway port from ~/.openclaw/openclaw.json
|
|
183
|
+
*/
|
|
184
|
+
export function readOpenClawPort(): number | null {
|
|
185
|
+
const paths = [
|
|
186
|
+
join(homedir(), ".openclaw", "openclaw.json"),
|
|
187
|
+
join(homedir(), ".openclaw", "openclaw.json5"),
|
|
188
|
+
];
|
|
189
|
+
|
|
190
|
+
for (const p of paths) {
|
|
191
|
+
if (!existsSync(p)) continue;
|
|
192
|
+
try {
|
|
193
|
+
const raw = readFileSync(p, "utf-8");
|
|
194
|
+
const parsed = JSON5.parse(raw);
|
|
195
|
+
const port = parsed?.gateway?.port;
|
|
196
|
+
if (typeof port === "number" && port > 0 && port <= 65535) {
|
|
197
|
+
return port;
|
|
198
|
+
}
|
|
199
|
+
} catch {
|
|
200
|
+
// Continue
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Get the Gateway WebSocket URL.
|
|
208
|
+
* Priority: env var > config gateway_url > config port on localhost.
|
|
209
|
+
*/
|
|
210
|
+
export function getGatewayUrl(): string {
|
|
211
|
+
if (process.env.OPENCLAW_GATEWAY_URL) {
|
|
212
|
+
return process.env.OPENCLAW_GATEWAY_URL;
|
|
213
|
+
}
|
|
214
|
+
const config = readConfig();
|
|
215
|
+
// Explicit URL takes priority (remote Gateways, Tailscale, etc.)
|
|
216
|
+
if (config.openclaw.gateway_url) {
|
|
217
|
+
return config.openclaw.gateway_url;
|
|
218
|
+
}
|
|
219
|
+
return `ws://127.0.0.1:${config.openclaw.gateway_port}`;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Check if OpenClaw is installed by looking for the config directory
|
|
224
|
+
*/
|
|
225
|
+
export function isOpenClawInstalled(): boolean {
|
|
226
|
+
return existsSync(join(homedir(), ".openclaw"));
|
|
227
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Shared date formatting — consistent across the app
|
|
3
|
+
// ============================================================================
|
|
4
|
+
//
|
|
5
|
+
// Formats:
|
|
6
|
+
// formatDate(ts) → "9 February 2026"
|
|
7
|
+
// formatDateTime(ts) → "9 February 2026 at 2:24 am"
|
|
8
|
+
// formatTime(ts) → "2:24 am"
|
|
9
|
+
// formatTimeAgo(ts) → "3 hours ago", "2 days ago", etc.
|
|
10
|
+
// formatDateShort(ts) → "9 Feb" (for compact UI like search results)
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* "9 February 2026"
|
|
14
|
+
*/
|
|
15
|
+
export function formatDate(timestamp: number): string {
|
|
16
|
+
return new Date(timestamp).toLocaleDateString("en-GB", {
|
|
17
|
+
day: "numeric",
|
|
18
|
+
month: "long",
|
|
19
|
+
year: "numeric",
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* "9 February 2026 at 2:24 am"
|
|
25
|
+
*/
|
|
26
|
+
export function formatDateTime(timestamp: number): string {
|
|
27
|
+
const date = new Date(timestamp);
|
|
28
|
+
const datePart = date.toLocaleDateString("en-GB", {
|
|
29
|
+
day: "numeric",
|
|
30
|
+
month: "long",
|
|
31
|
+
year: "numeric",
|
|
32
|
+
});
|
|
33
|
+
const timePart = date.toLocaleTimeString("en-GB", {
|
|
34
|
+
hour: "numeric",
|
|
35
|
+
minute: "2-digit",
|
|
36
|
+
hour12: true,
|
|
37
|
+
});
|
|
38
|
+
return `${datePart} at ${timePart}`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* "2:24 am"
|
|
43
|
+
*/
|
|
44
|
+
export function formatTime(timestamp: number): string {
|
|
45
|
+
return new Date(timestamp).toLocaleTimeString("en-GB", {
|
|
46
|
+
hour: "numeric",
|
|
47
|
+
minute: "2-digit",
|
|
48
|
+
hour12: true,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* "3 hours ago", "2 days ago", "just now", etc.
|
|
54
|
+
*/
|
|
55
|
+
export function formatTimeAgo(timestamp: number): string {
|
|
56
|
+
const now = Date.now();
|
|
57
|
+
const diff = now - timestamp;
|
|
58
|
+
|
|
59
|
+
const seconds = Math.floor(diff / 1000);
|
|
60
|
+
if (seconds < 60) return "just now";
|
|
61
|
+
|
|
62
|
+
const minutes = Math.floor(seconds / 60);
|
|
63
|
+
if (minutes < 60) return `${minutes}m ago`;
|
|
64
|
+
|
|
65
|
+
const hours = Math.floor(minutes / 60);
|
|
66
|
+
if (hours < 24) return `${hours}h ago`;
|
|
67
|
+
|
|
68
|
+
const days = Math.floor(hours / 24);
|
|
69
|
+
if (days < 7) return `${days}d ago`;
|
|
70
|
+
|
|
71
|
+
const weeks = Math.floor(days / 7);
|
|
72
|
+
if (weeks < 5) return `${weeks}w ago`;
|
|
73
|
+
|
|
74
|
+
const months = Math.floor(days / 30);
|
|
75
|
+
if (months < 12) return `${months}mo ago`;
|
|
76
|
+
|
|
77
|
+
const years = Math.floor(days / 365);
|
|
78
|
+
return `${years}y ago`;
|
|
79
|
+
}
|