@castlekit/castle 0.3.2 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.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/IDGX3MGCjqUE6NQVlug5A/_buildManifest.js +11 -0
- package/.next/standalone/.next/static/IDGX3MGCjqUE6NQVlug5A/_clientMiddlewareManifest.json +6 -0
- package/.next/standalone/.next/static/IDGX3MGCjqUE6NQVlug5A/_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 +194 -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.ps1 +437 -0
- package/.next/standalone/install.sh +780 -0
- package/.next/standalone/next.config.ts +9 -0
- package/.next/standalone/package-lock.json +8115 -0
- package/.next/standalone/package.json +106 -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 +883 -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/IDGX3MGCjqUE6NQVlug5A/_buildManifest.js +11 -0
- package/.next/static/IDGX3MGCjqUE6NQVlug5A/_clientMiddlewareManifest.json +6 -0
- package/.next/static/IDGX3MGCjqUE6NQVlug5A/_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/bin/castle.js +17 -0
- package/install.ps1 +437 -0
- package/install.sh +4 -0
- package/next.config.ts +1 -0
- package/package.json +6 -1
- package/src/cli/onboarding.ts +197 -50
|
@@ -0,0 +1,883 @@
|
|
|
1
|
+
import * as p from "@clack/prompts";
|
|
2
|
+
import pc from "picocolors";
|
|
3
|
+
import { execSync } from "child_process";
|
|
4
|
+
import { randomUUID } from "crypto";
|
|
5
|
+
import WebSocket from "ws";
|
|
6
|
+
import { readFileSync, existsSync } from "fs";
|
|
7
|
+
import { resolve as resolvePath, dirname } from "path";
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
import {
|
|
10
|
+
isOpenClawInstalled,
|
|
11
|
+
readOpenClawToken,
|
|
12
|
+
readOpenClawPort,
|
|
13
|
+
ensureCastleDir,
|
|
14
|
+
writeConfig,
|
|
15
|
+
type CastleConfig,
|
|
16
|
+
} from "../lib/config.js";
|
|
17
|
+
// Device identity is handled by gateway-connection.ts for the persistent connection.
|
|
18
|
+
// The onboarding wizard uses simple token-only auth for agent discovery.
|
|
19
|
+
|
|
20
|
+
// Read version from package.json at the project root
|
|
21
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
22
|
+
const PROJECT_ROOT = resolvePath(__dirname, "..", "..");
|
|
23
|
+
let PKG_VERSION = "0.0.0";
|
|
24
|
+
try {
|
|
25
|
+
PKG_VERSION = JSON.parse(readFileSync(resolvePath(PROJECT_ROOT, "package.json"), "utf-8")).version;
|
|
26
|
+
} catch {
|
|
27
|
+
// Fallback if package.json is missing or invalid
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Castle blue helpers using standard ANSI colors (universal terminal support)
|
|
31
|
+
const BLUE = (s: string) => `\x1b[94m${s}\x1b[0m`; // bright blue
|
|
32
|
+
const BLUE_LIGHT = (s: string) => `\x1b[96m${s}\x1b[0m`; // bright cyan (lighter blue)
|
|
33
|
+
const BLUE_BOLD = (s: string) => `\x1b[1m\x1b[94m${s}\x1b[0m`; // bold bright blue
|
|
34
|
+
const BLUE_DIM = (s: string) => `\x1b[34m${s}\x1b[0m`; // standard blue (muted)
|
|
35
|
+
|
|
36
|
+
// Patch picocolors so @clack/prompts UI chrome (bars, dots, highlights) uses Castle blue
|
|
37
|
+
// @clack/prompts imports picocolors as an object reference, so overriding methods here
|
|
38
|
+
// changes the colors of all internal rendering (│ bars, ◆ dots, highlights, etc.)
|
|
39
|
+
const _pc = pc as unknown as Record<string, unknown>;
|
|
40
|
+
_pc.gray = BLUE_DIM;
|
|
41
|
+
_pc.green = BLUE;
|
|
42
|
+
_pc.greenBright = BLUE;
|
|
43
|
+
_pc.cyan = BLUE;
|
|
44
|
+
_pc.cyanBright = BLUE;
|
|
45
|
+
_pc.blue = BLUE;
|
|
46
|
+
_pc.blueBright = BLUE;
|
|
47
|
+
_pc.magenta = BLUE;
|
|
48
|
+
_pc.magentaBright = BLUE;
|
|
49
|
+
_pc.yellow = BLUE_DIM;
|
|
50
|
+
_pc.yellowBright = BLUE_DIM;
|
|
51
|
+
// red stays red for errors — no override
|
|
52
|
+
|
|
53
|
+
interface DiscoveredAgent {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
description: string | null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Connect to Gateway and discover agents via agents.list.
|
|
61
|
+
* Supports both port-based (local) and full URL (remote) connections.
|
|
62
|
+
* Returns the list of agents or an empty array on failure.
|
|
63
|
+
*/
|
|
64
|
+
async function discoverAgents(
|
|
65
|
+
portOrUrl: number | string,
|
|
66
|
+
token: string | null
|
|
67
|
+
): Promise<DiscoveredAgent[]> {
|
|
68
|
+
const wsUrl = typeof portOrUrl === "string" ? portOrUrl : `ws://127.0.0.1:${portOrUrl}`;
|
|
69
|
+
|
|
70
|
+
return new Promise((resolve) => {
|
|
71
|
+
const timeout = setTimeout(() => {
|
|
72
|
+
try { ws.close(); } catch { /* ignore */ }
|
|
73
|
+
resolve([]);
|
|
74
|
+
}, 8000);
|
|
75
|
+
|
|
76
|
+
let ws: WebSocket;
|
|
77
|
+
try {
|
|
78
|
+
ws = new WebSocket(wsUrl);
|
|
79
|
+
} catch {
|
|
80
|
+
clearTimeout(timeout);
|
|
81
|
+
resolve([]);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
ws.on("error", () => {
|
|
86
|
+
clearTimeout(timeout);
|
|
87
|
+
resolve([]);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
ws.on("open", () => {
|
|
91
|
+
// Send connect handshake
|
|
92
|
+
// NOTE: No device identity here — discoverAgents is just for listing agents
|
|
93
|
+
// during setup. Device auth happens in gateway-connection.ts for the real connection.
|
|
94
|
+
const connectId = randomUUID();
|
|
95
|
+
const connectFrame = {
|
|
96
|
+
type: "req",
|
|
97
|
+
id: connectId,
|
|
98
|
+
method: "connect",
|
|
99
|
+
params: {
|
|
100
|
+
minProtocol: 3,
|
|
101
|
+
maxProtocol: 3,
|
|
102
|
+
client: {
|
|
103
|
+
id: "gateway-client",
|
|
104
|
+
displayName: "Castle CLI",
|
|
105
|
+
version: PKG_VERSION,
|
|
106
|
+
platform: process.platform,
|
|
107
|
+
mode: "backend",
|
|
108
|
+
},
|
|
109
|
+
auth: token ? { token } : undefined,
|
|
110
|
+
role: "operator",
|
|
111
|
+
scopes: ["operator.admin"],
|
|
112
|
+
caps: [],
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
ws.send(JSON.stringify(connectFrame));
|
|
116
|
+
|
|
117
|
+
// Wait for connect response, then request agents
|
|
118
|
+
ws.on("message", (data) => {
|
|
119
|
+
try {
|
|
120
|
+
const msg = JSON.parse(data.toString());
|
|
121
|
+
|
|
122
|
+
// Connect response
|
|
123
|
+
if (msg.type === "res" && msg.id === connectId) {
|
|
124
|
+
if (!msg.ok) {
|
|
125
|
+
clearTimeout(timeout);
|
|
126
|
+
ws.close();
|
|
127
|
+
resolve([]);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
// Connected -- now request agents
|
|
131
|
+
const agentsId = randomUUID();
|
|
132
|
+
const agentsFrame = {
|
|
133
|
+
type: "req",
|
|
134
|
+
id: agentsId,
|
|
135
|
+
method: "agents.list",
|
|
136
|
+
params: {},
|
|
137
|
+
};
|
|
138
|
+
ws.send(JSON.stringify(agentsFrame));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Agents response (any successful res that isn't the connect response)
|
|
142
|
+
if (msg.type === "res" && msg.id !== connectId && msg.ok) {
|
|
143
|
+
clearTimeout(timeout);
|
|
144
|
+
ws.close();
|
|
145
|
+
const payload = msg.payload || {};
|
|
146
|
+
const agentsList = Array.isArray(payload.agents) ? payload.agents : [];
|
|
147
|
+
const agents = agentsList.map((a: { id: string; name?: string; identity?: { name?: string; theme?: string } }) => ({
|
|
148
|
+
id: a.id,
|
|
149
|
+
name: a.identity?.name || a.name || a.id,
|
|
150
|
+
description: a.identity?.theme || null,
|
|
151
|
+
}));
|
|
152
|
+
resolve(agents);
|
|
153
|
+
}
|
|
154
|
+
} catch {
|
|
155
|
+
// ignore parse errors
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Test a Gateway connection. Returns true if connection succeeds.
|
|
164
|
+
*/
|
|
165
|
+
async function testConnection(
|
|
166
|
+
portOrUrl: number | string,
|
|
167
|
+
token: string | null
|
|
168
|
+
): Promise<boolean> {
|
|
169
|
+
const wsUrl = typeof portOrUrl === "string" ? portOrUrl : `ws://127.0.0.1:${portOrUrl}`;
|
|
170
|
+
|
|
171
|
+
return new Promise((resolve) => {
|
|
172
|
+
const timeout = setTimeout(() => {
|
|
173
|
+
try { ws.close(); } catch { /* ignore */ }
|
|
174
|
+
resolve(false);
|
|
175
|
+
}, 5000);
|
|
176
|
+
|
|
177
|
+
let ws: WebSocket;
|
|
178
|
+
try {
|
|
179
|
+
ws = new WebSocket(wsUrl);
|
|
180
|
+
} catch {
|
|
181
|
+
clearTimeout(timeout);
|
|
182
|
+
resolve(false);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
ws.on("error", () => {
|
|
187
|
+
clearTimeout(timeout);
|
|
188
|
+
resolve(false);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
ws.on("open", () => {
|
|
192
|
+
clearTimeout(timeout);
|
|
193
|
+
ws.close();
|
|
194
|
+
resolve(true);
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Prompt for manual Gateway configuration (remote or local).
|
|
201
|
+
* Returns connection details or null if cancelled.
|
|
202
|
+
*/
|
|
203
|
+
async function promptManualGateway(): Promise<{
|
|
204
|
+
port: number;
|
|
205
|
+
token: string | null;
|
|
206
|
+
gatewayUrl?: string;
|
|
207
|
+
isRemote: boolean;
|
|
208
|
+
} | null> {
|
|
209
|
+
const locationType = await p.select({
|
|
210
|
+
message: "Where is your OpenClaw Gateway?",
|
|
211
|
+
options: [
|
|
212
|
+
{
|
|
213
|
+
value: "local",
|
|
214
|
+
label: "Local machine",
|
|
215
|
+
hint: "Running on this device (127.0.0.1)",
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
value: "remote",
|
|
219
|
+
label: "Remote / Tailscale",
|
|
220
|
+
hint: "Running on another machine",
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
if (p.isCancel(locationType)) return null;
|
|
226
|
+
|
|
227
|
+
let port = 18789;
|
|
228
|
+
let gatewayUrl: string | undefined;
|
|
229
|
+
const isRemote = locationType === "remote";
|
|
230
|
+
|
|
231
|
+
if (isRemote) {
|
|
232
|
+
const urlInput = await p.text({
|
|
233
|
+
message: "Gateway WebSocket URL",
|
|
234
|
+
placeholder: "ws://192.168.1.50:18789",
|
|
235
|
+
validate(value: string | undefined) {
|
|
236
|
+
if (!value?.trim()) return "URL is required";
|
|
237
|
+
if (!value.startsWith("ws://") && !value.startsWith("wss://")) {
|
|
238
|
+
return "URL must start with ws:// or wss://";
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
if (p.isCancel(urlInput)) return null;
|
|
244
|
+
gatewayUrl = urlInput as string;
|
|
245
|
+
|
|
246
|
+
// Extract port from URL for config compatibility
|
|
247
|
+
try {
|
|
248
|
+
const parsed = new URL(gatewayUrl);
|
|
249
|
+
port = parseInt(parsed.port, 10) || 18789;
|
|
250
|
+
} catch {
|
|
251
|
+
port = 18789;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Test the connection
|
|
255
|
+
const testSpinner = p.spinner();
|
|
256
|
+
testSpinner.start("Testing connection...");
|
|
257
|
+
const ok = await testConnection(gatewayUrl, null);
|
|
258
|
+
if (ok) {
|
|
259
|
+
testSpinner.stop(`\x1b[92m✔\x1b[0m Gateway reachable`);
|
|
260
|
+
} else {
|
|
261
|
+
testSpinner.stop(pc.dim("Could not reach Gateway — it may not be running yet"));
|
|
262
|
+
}
|
|
263
|
+
} else {
|
|
264
|
+
const gatewayPort = await p.text({
|
|
265
|
+
message: "OpenClaw Gateway port",
|
|
266
|
+
initialValue: "18789",
|
|
267
|
+
validate(value: string | undefined) {
|
|
268
|
+
const num = parseInt(value || "0", 10);
|
|
269
|
+
if (isNaN(num) || num < 1 || num > 65535) {
|
|
270
|
+
return "Please enter a valid port number (1-65535)";
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
if (p.isCancel(gatewayPort)) return null;
|
|
276
|
+
port = parseInt(gatewayPort as string, 10);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// Token entry
|
|
280
|
+
const tokenInput = await p.text({
|
|
281
|
+
message: "Gateway auth token",
|
|
282
|
+
placeholder: "Paste your token (or press Enter to skip)",
|
|
283
|
+
defaultValue: "",
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
if (p.isCancel(tokenInput)) return null;
|
|
287
|
+
|
|
288
|
+
const token = (tokenInput as string) || null;
|
|
289
|
+
|
|
290
|
+
return { port, token, gatewayUrl, isRemote };
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export async function runOnboarding(): Promise<void> {
|
|
294
|
+
|
|
295
|
+
// Node 22+ is required for native fetch, compile cache, and modern APIs
|
|
296
|
+
const nodeVersion = parseInt(process.versions.node.split(".")[0], 10);
|
|
297
|
+
if (nodeVersion < 22) {
|
|
298
|
+
p.intro(BLUE_BOLD("Castle Setup"));
|
|
299
|
+
p.log.error(
|
|
300
|
+
pc.red(`Node.js 22 or higher is required (you have v${process.versions.node}).`) +
|
|
301
|
+
"\n" +
|
|
302
|
+
pc.dim(" Install it from https://nodejs.org or via nvm:\n") +
|
|
303
|
+
BLUE(" nvm install 22 && nvm use 22")
|
|
304
|
+
);
|
|
305
|
+
p.outro(pc.dim("Then run castle setup again."));
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
p.intro(BLUE_BOLD("Castle Setup"));
|
|
310
|
+
|
|
311
|
+
p.note(
|
|
312
|
+
[
|
|
313
|
+
"Castle is your multi-agent workspace — a local-first",
|
|
314
|
+
"interface for managing and interacting with your",
|
|
315
|
+
"OpenClaw AI agents.",
|
|
316
|
+
"",
|
|
317
|
+
`${pc.dim("Learn more:")} ${BLUE_LIGHT("https://castlekit.com")}`,
|
|
318
|
+
].join("\n"),
|
|
319
|
+
"Welcome"
|
|
320
|
+
);
|
|
321
|
+
|
|
322
|
+
const ready = await p.confirm({
|
|
323
|
+
message: "Ready to set up Castle?",
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
if (p.isCancel(ready) || !ready) {
|
|
327
|
+
p.cancel("No worries — run castle setup when you're ready.");
|
|
328
|
+
process.exit(0);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// Step 1: Check for OpenClaw
|
|
332
|
+
const openclawSpinner = p.spinner();
|
|
333
|
+
openclawSpinner.start("Checking for OpenClaw...");
|
|
334
|
+
|
|
335
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
336
|
+
|
|
337
|
+
if (!isOpenClawInstalled()) {
|
|
338
|
+
openclawSpinner.stop(pc.dim("OpenClaw not found"));
|
|
339
|
+
|
|
340
|
+
p.note(
|
|
341
|
+
`Castle requires OpenClaw to run your AI agents.\n${BLUE_LIGHT("https://openclaw.ai")}`,
|
|
342
|
+
BLUE_BOLD("OpenClaw Required")
|
|
343
|
+
);
|
|
344
|
+
|
|
345
|
+
const installChoice = await p.confirm({
|
|
346
|
+
message: "Would you like us to install OpenClaw with default settings?",
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
if (p.isCancel(installChoice)) {
|
|
350
|
+
p.cancel("Setup cancelled.");
|
|
351
|
+
process.exit(0);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
if (installChoice) {
|
|
355
|
+
const installSpinner = p.spinner();
|
|
356
|
+
installSpinner.start("Installing OpenClaw...");
|
|
357
|
+
|
|
358
|
+
const installCmd = process.platform === "win32"
|
|
359
|
+
? 'powershell -NoProfile -ExecutionPolicy Bypass -Command "& { iwr -useb https://openclaw.ai/install.ps1 | iex } -NoOnboard"'
|
|
360
|
+
: 'curl -fsSL --proto "=https" --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --no-onboard --no-prompt';
|
|
361
|
+
|
|
362
|
+
try {
|
|
363
|
+
execSync(installCmd, { stdio: "pipe", timeout: 120000 });
|
|
364
|
+
installSpinner.stop(BLUE("✔ OpenClaw installed"));
|
|
365
|
+
} catch (error) {
|
|
366
|
+
installSpinner.stop(pc.red("OpenClaw installation failed"));
|
|
367
|
+
const manualCmd = process.platform === "win32"
|
|
368
|
+
? "iwr -useb https://openclaw.ai/install.ps1 | iex"
|
|
369
|
+
: "curl -fsSL https://openclaw.ai/install.sh | bash";
|
|
370
|
+
p.note(
|
|
371
|
+
`Install OpenClaw manually:\n${BLUE_LIGHT(manualCmd)}\n\nThen run: ${BLUE_LIGHT("castle setup")}`,
|
|
372
|
+
BLUE_BOLD("Manual Install")
|
|
373
|
+
);
|
|
374
|
+
p.outro("Come back when OpenClaw is installed!");
|
|
375
|
+
process.exit(1);
|
|
376
|
+
}
|
|
377
|
+
} else {
|
|
378
|
+
const manualCmd = process.platform === "win32"
|
|
379
|
+
? "iwr -useb https://openclaw.ai/install.ps1 | iex"
|
|
380
|
+
: "curl -fsSL https://openclaw.ai/install.sh | bash";
|
|
381
|
+
p.note(
|
|
382
|
+
`Install OpenClaw:\n${BLUE_LIGHT(manualCmd)}\n\nThen come back and run:\n${BLUE_LIGHT("castle setup")}`,
|
|
383
|
+
BLUE_BOLD("Install OpenClaw First")
|
|
384
|
+
);
|
|
385
|
+
p.outro("See you soon!");
|
|
386
|
+
process.exit(0);
|
|
387
|
+
}
|
|
388
|
+
} else {
|
|
389
|
+
// Auto-detect token and agents in one go
|
|
390
|
+
const detectedPort = readOpenClawPort() || 18789;
|
|
391
|
+
const token = readOpenClawToken();
|
|
392
|
+
const agents = await discoverAgents(detectedPort, token);
|
|
393
|
+
|
|
394
|
+
openclawSpinner.stop(`\x1b[92m✔\x1b[0m OpenClaw detected`);
|
|
395
|
+
|
|
396
|
+
if (agents.length > 0 && token) {
|
|
397
|
+
p.log.message(
|
|
398
|
+
[
|
|
399
|
+
`${pc.dim("—")} ${pc.dim(`Gateway running on port ${detectedPort}`)}`,
|
|
400
|
+
`${pc.dim("—")} ${pc.dim("Auth token found")}`,
|
|
401
|
+
`${pc.dim("—")} ${pc.dim(`${agents.length} agent${agents.length !== 1 ? "s" : ""} discovered: ${agents.map((a) => a.name).join(", ")}`)}`,
|
|
402
|
+
].join("\n")
|
|
403
|
+
);
|
|
404
|
+
} else if (token) {
|
|
405
|
+
p.log.message(
|
|
406
|
+
[
|
|
407
|
+
`${pc.dim("—")} ${pc.dim("Auth token found")}`,
|
|
408
|
+
`${pc.dim("—")} ${pc.dim("Could not reach Gateway — agents will be discovered when it's running")}`,
|
|
409
|
+
].join("\n")
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// Step 2: Connection mode — auto-detect or manual entry
|
|
415
|
+
let port = readOpenClawPort() || 18789;
|
|
416
|
+
let token = readOpenClawToken();
|
|
417
|
+
let gatewayUrl: string | undefined;
|
|
418
|
+
let isRemote = false;
|
|
419
|
+
|
|
420
|
+
// If we have auto-detected config, offer a choice
|
|
421
|
+
const hasLocalConfig = !!readOpenClawPort() || isOpenClawInstalled();
|
|
422
|
+
|
|
423
|
+
if (hasLocalConfig && token) {
|
|
424
|
+
// Both auto-detect and manual are available
|
|
425
|
+
const connectionMode = await p.select({
|
|
426
|
+
message: "How would you like to connect?",
|
|
427
|
+
options: [
|
|
428
|
+
{
|
|
429
|
+
value: "auto",
|
|
430
|
+
label: `Auto-detected local Gateway ${pc.dim(`(port ${port})`)}`,
|
|
431
|
+
hint: "Recommended for local setups",
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
value: "manual",
|
|
435
|
+
label: "Enter Gateway details manually",
|
|
436
|
+
hint: "For remote, Tailscale, or custom setups",
|
|
437
|
+
},
|
|
438
|
+
],
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
if (p.isCancel(connectionMode)) {
|
|
442
|
+
p.cancel("Setup cancelled.");
|
|
443
|
+
process.exit(0);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
if (connectionMode === "manual") {
|
|
447
|
+
const manualResult = await promptManualGateway();
|
|
448
|
+
if (!manualResult) {
|
|
449
|
+
p.cancel("Setup cancelled.");
|
|
450
|
+
process.exit(0);
|
|
451
|
+
}
|
|
452
|
+
port = manualResult.port;
|
|
453
|
+
token = manualResult.token;
|
|
454
|
+
gatewayUrl = manualResult.gatewayUrl;
|
|
455
|
+
isRemote = manualResult.isRemote;
|
|
456
|
+
}
|
|
457
|
+
} else if (!token) {
|
|
458
|
+
// No auto-detected token — fall through to manual entry
|
|
459
|
+
const manualResult = await promptManualGateway();
|
|
460
|
+
if (!manualResult) {
|
|
461
|
+
p.cancel("Setup cancelled.");
|
|
462
|
+
process.exit(0);
|
|
463
|
+
}
|
|
464
|
+
port = manualResult.port;
|
|
465
|
+
token = manualResult.token;
|
|
466
|
+
gatewayUrl = manualResult.gatewayUrl;
|
|
467
|
+
isRemote = manualResult.isRemote;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
// Step 3: Agent Discovery (use URL if remote, port if local)
|
|
471
|
+
const agentTarget = gatewayUrl || port;
|
|
472
|
+
const agents = await discoverAgents(agentTarget, token);
|
|
473
|
+
|
|
474
|
+
let primaryAgent: string;
|
|
475
|
+
|
|
476
|
+
if (agents.length > 0) {
|
|
477
|
+
|
|
478
|
+
const selectedAgent = await p.select({
|
|
479
|
+
message: "Choose your primary agent",
|
|
480
|
+
options: agents.map((a) => ({
|
|
481
|
+
value: a.id,
|
|
482
|
+
label: `${a.name} ${pc.dim(`<${a.id}>`)}`,
|
|
483
|
+
hint: a.description || undefined,
|
|
484
|
+
})),
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
if (p.isCancel(selectedAgent)) {
|
|
488
|
+
p.cancel("Setup cancelled.");
|
|
489
|
+
process.exit(0);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
primaryAgent = selectedAgent as string;
|
|
493
|
+
} else {
|
|
494
|
+
const setPrimary = await p.text({
|
|
495
|
+
message: "Enter the name of your primary agent",
|
|
496
|
+
initialValue: "assistant",
|
|
497
|
+
validate(value: string | undefined) {
|
|
498
|
+
if (!value?.trim()) return "Agent name is required";
|
|
499
|
+
},
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
if (p.isCancel(setPrimary)) {
|
|
503
|
+
p.cancel("Setup cancelled.");
|
|
504
|
+
process.exit(0);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
primaryAgent = setPrimary as string;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
// Step 5: Create Castle config
|
|
511
|
+
const serverSpinner = p.spinner();
|
|
512
|
+
serverSpinner.start("Saving configuration...");
|
|
513
|
+
|
|
514
|
+
ensureCastleDir();
|
|
515
|
+
|
|
516
|
+
const config: CastleConfig = {
|
|
517
|
+
openclaw: {
|
|
518
|
+
gateway_port: port,
|
|
519
|
+
gateway_token: token || undefined,
|
|
520
|
+
gateway_url: gatewayUrl,
|
|
521
|
+
is_remote: isRemote || undefined,
|
|
522
|
+
primary_agent: primaryAgent,
|
|
523
|
+
},
|
|
524
|
+
server: {
|
|
525
|
+
port: 3333,
|
|
526
|
+
},
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
writeConfig(config);
|
|
530
|
+
|
|
531
|
+
const { spawn, exec, execSync: execSyncChild } = await import("child_process");
|
|
532
|
+
const { join } = await import("path");
|
|
533
|
+
const { writeFileSync: writeFile, mkdirSync: mkDir, readFileSync: readF } = await import("fs");
|
|
534
|
+
const { homedir: home } = await import("os");
|
|
535
|
+
|
|
536
|
+
const castleDir = join(home(), ".castle");
|
|
537
|
+
const logsDir = join(castleDir, "logs");
|
|
538
|
+
mkDir(logsDir, { recursive: true });
|
|
539
|
+
|
|
540
|
+
// Check if the app was pre-built (npm publish ships .next/standalone/)
|
|
541
|
+
const standaloneServer = join(PROJECT_ROOT, ".next", "standalone", "server.js");
|
|
542
|
+
const hasPrebuilt = existsSync(standaloneServer);
|
|
543
|
+
|
|
544
|
+
if (hasPrebuilt) {
|
|
545
|
+
serverSpinner.message("Pre-built Castle detected — skipping build...");
|
|
546
|
+
} else {
|
|
547
|
+
// Dev / git-clone install — need to build from source
|
|
548
|
+
serverSpinner.message("Building Castle...");
|
|
549
|
+
|
|
550
|
+
const buildLogPath = join(logsDir, "build.log");
|
|
551
|
+
|
|
552
|
+
const buildOk = await new Promise<boolean>((resolve) => {
|
|
553
|
+
let output = "";
|
|
554
|
+
const child = exec("npm run build", {
|
|
555
|
+
cwd: PROJECT_ROOT,
|
|
556
|
+
timeout: 180000,
|
|
557
|
+
});
|
|
558
|
+
child.stdout?.on("data", (d: string) => { output += d; });
|
|
559
|
+
child.stderr?.on("data", (d: string) => { output += d; });
|
|
560
|
+
child.on("close", (code) => {
|
|
561
|
+
// Write full output to log file
|
|
562
|
+
try { writeFile(buildLogPath, output); } catch { /* ignore */ }
|
|
563
|
+
resolve(code === 0);
|
|
564
|
+
});
|
|
565
|
+
child.on("error", (err) => {
|
|
566
|
+
try { writeFile(buildLogPath, output + "\n" + String(err)); } catch { /* ignore */ }
|
|
567
|
+
resolve(false);
|
|
568
|
+
});
|
|
569
|
+
});
|
|
570
|
+
|
|
571
|
+
if (!buildOk) {
|
|
572
|
+
serverSpinner.stop(pc.red("Build failed"));
|
|
573
|
+
// Show the last 20 lines of build output so the user can see what went wrong
|
|
574
|
+
try {
|
|
575
|
+
const log = readF(buildLogPath, "utf-8");
|
|
576
|
+
const lines = log.split("\n");
|
|
577
|
+
const tail = lines.slice(-20).join("\n");
|
|
578
|
+
p.log.error(pc.dim("Last 20 lines of build output:\n") + tail);
|
|
579
|
+
} catch { /* log unavailable */ }
|
|
580
|
+
p.outro(
|
|
581
|
+
pc.dim(`Full build log: ${BLUE(`~/.castle/logs/build.log`)}\n`) +
|
|
582
|
+
pc.dim(`Try running ${BLUE("npm run build")} manually in the castle directory.`)
|
|
583
|
+
);
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
serverSpinner.message("Starting Castle...");
|
|
589
|
+
|
|
590
|
+
// Find node path and determine how to start the server
|
|
591
|
+
const nodePath = process.execPath;
|
|
592
|
+
const nextBin = join(PROJECT_ROOT, "node_modules", ".bin", "next");
|
|
593
|
+
|
|
594
|
+
// Use standalone server.js when pre-built (global installs), fall back to next start
|
|
595
|
+
const useStandalone = existsSync(join(PROJECT_ROOT, ".next", "standalone", "server.js"));
|
|
596
|
+
const serverScript = useStandalone
|
|
597
|
+
? join(PROJECT_ROOT, ".next", "standalone", "server.js")
|
|
598
|
+
: null;
|
|
599
|
+
|
|
600
|
+
// Build the program args for the service and direct spawn
|
|
601
|
+
const serverArgs = serverScript
|
|
602
|
+
? [serverScript]
|
|
603
|
+
: [nextBin, "start", "-p", String(config.server?.port || 3333)];
|
|
604
|
+
|
|
605
|
+
// Environment for standalone mode needs PORT, HOSTNAME, and NODE_PATH
|
|
606
|
+
// NODE_PATH is critical: the standalone bundle ships without node_modules
|
|
607
|
+
// (native modules like better-sqlite3 are platform-specific and can't be
|
|
608
|
+
// bundled cross-platform). NODE_PATH tells Node to resolve packages from
|
|
609
|
+
// the package root's node_modules/ where npm installed correct binaries.
|
|
610
|
+
const serverEnv: Record<string, string> = {
|
|
611
|
+
NODE_ENV: "production",
|
|
612
|
+
PATH: process.env.PATH || "",
|
|
613
|
+
};
|
|
614
|
+
if (serverScript) {
|
|
615
|
+
serverEnv.PORT = String(config.server?.port || 3333);
|
|
616
|
+
serverEnv.HOSTNAME = "127.0.0.1";
|
|
617
|
+
serverEnv.NODE_PATH = join(PROJECT_ROOT, "node_modules");
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
// Castle port from config or default
|
|
621
|
+
const castlePort = String(config.server?.port || 3333);
|
|
622
|
+
|
|
623
|
+
// Write PID file helper
|
|
624
|
+
const pidFile = join(castleDir, "server.pid");
|
|
625
|
+
const isWin = process.platform === "win32";
|
|
626
|
+
|
|
627
|
+
// Stop existing service FIRST — otherwise the service manager respawns
|
|
628
|
+
// the old server immediately after we kill it, stealing the port.
|
|
629
|
+
if (process.platform === "darwin") {
|
|
630
|
+
const plistPath = join(home(), "Library", "LaunchAgents", "com.castlekit.castle.plist");
|
|
631
|
+
try {
|
|
632
|
+
execSyncChild(`launchctl unload "${plistPath}" 2>/dev/null`, { stdio: "ignore", timeout: 10000 });
|
|
633
|
+
} catch { /* no existing service */ }
|
|
634
|
+
} else if (process.platform === "linux") {
|
|
635
|
+
try {
|
|
636
|
+
execSyncChild("systemctl --user stop castle.service 2>/dev/null", { stdio: "ignore", timeout: 10000 });
|
|
637
|
+
} catch { /* no existing service */ }
|
|
638
|
+
} else if (isWin) {
|
|
639
|
+
try {
|
|
640
|
+
execSyncChild('schtasks /End /TN "CastleServer" 2>nul', { stdio: "ignore", timeout: 10000 });
|
|
641
|
+
} catch { /* no existing task */ }
|
|
642
|
+
try {
|
|
643
|
+
execSyncChild('schtasks /Delete /TN "CastleServer" /F 2>nul', { stdio: "ignore", timeout: 10000 });
|
|
644
|
+
} catch { /* no existing task */ }
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
// Kill any existing Castle server (by PID file)
|
|
648
|
+
try {
|
|
649
|
+
const existingPid = parseInt(readF(pidFile, "utf-8").trim(), 10);
|
|
650
|
+
if (Number.isInteger(existingPid) && existingPid > 0) {
|
|
651
|
+
if (isWin) {
|
|
652
|
+
try { execSyncChild(`taskkill /PID ${existingPid} /F 2>nul`, { stdio: "ignore", timeout: 5000 }); } catch { /* ignore */ }
|
|
653
|
+
} else {
|
|
654
|
+
process.kill(existingPid);
|
|
655
|
+
}
|
|
656
|
+
for (let i = 0; i < 30; i++) {
|
|
657
|
+
try {
|
|
658
|
+
process.kill(existingPid, 0);
|
|
659
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
660
|
+
} catch {
|
|
661
|
+
break;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
} catch {
|
|
666
|
+
// No existing server or already dead
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
// Kill anything else on the target port
|
|
670
|
+
if (isWin) {
|
|
671
|
+
try {
|
|
672
|
+
const netstatOut = execSyncChild(
|
|
673
|
+
`netstat -ano | findstr ":${castlePort} " | findstr "LISTENING"`,
|
|
674
|
+
{ encoding: "utf-8", timeout: 5000 }
|
|
675
|
+
).toString();
|
|
676
|
+
const pids = new Set<string>();
|
|
677
|
+
for (const line of netstatOut.split("\n")) {
|
|
678
|
+
const parts = line.trim().split(/\s+/);
|
|
679
|
+
const pid = parts[parts.length - 1];
|
|
680
|
+
if (pid && /^\d+$/.test(pid) && pid !== "0") pids.add(pid);
|
|
681
|
+
}
|
|
682
|
+
for (const pid of pids) {
|
|
683
|
+
try { execSyncChild(`taskkill /PID ${pid} /F 2>nul`, { stdio: "ignore", timeout: 5000 }); } catch { /* ignore */ }
|
|
684
|
+
}
|
|
685
|
+
if (pids.size > 0) await new Promise((r) => setTimeout(r, 500));
|
|
686
|
+
} catch {
|
|
687
|
+
// Nothing on port or netstat not available
|
|
688
|
+
}
|
|
689
|
+
} else {
|
|
690
|
+
try {
|
|
691
|
+
execSyncChild(`lsof -ti:${castlePort} | xargs kill -9 2>/dev/null`, {
|
|
692
|
+
stdio: "ignore",
|
|
693
|
+
timeout: 5000,
|
|
694
|
+
});
|
|
695
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
696
|
+
} catch {
|
|
697
|
+
// Nothing on port or lsof not available
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
// Escape XML special characters for plist values
|
|
702
|
+
const xmlEscape = (s: string) =>
|
|
703
|
+
s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
704
|
+
|
|
705
|
+
// Install as a persistent service (auto-start on login)
|
|
706
|
+
if (process.platform === "darwin") {
|
|
707
|
+
const plistDir = join(home(), "Library", "LaunchAgents");
|
|
708
|
+
mkDir(plistDir, { recursive: true });
|
|
709
|
+
const plistPath = join(plistDir, "com.castlekit.castle.plist");
|
|
710
|
+
const plistArgs = [nodePath, ...serverArgs]
|
|
711
|
+
.map((a) => ` <string>${xmlEscape(a)}</string>`)
|
|
712
|
+
.join("\n");
|
|
713
|
+
const plistEnvEntries = Object.entries(serverEnv)
|
|
714
|
+
.map(([k, v]) => ` <key>${xmlEscape(k)}</key>\n <string>${xmlEscape(v)}</string>`)
|
|
715
|
+
.join("\n");
|
|
716
|
+
const plist = `<?xml version="1.0" encoding="UTF-8"?>
|
|
717
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
718
|
+
<plist version="1.0">
|
|
719
|
+
<dict>
|
|
720
|
+
<key>Label</key>
|
|
721
|
+
<string>com.castlekit.castle</string>
|
|
722
|
+
<key>ProgramArguments</key>
|
|
723
|
+
<array>
|
|
724
|
+
${plistArgs}
|
|
725
|
+
</array>
|
|
726
|
+
<key>WorkingDirectory</key>
|
|
727
|
+
<string>${xmlEscape(PROJECT_ROOT)}</string>
|
|
728
|
+
<key>RunAtLoad</key>
|
|
729
|
+
<true/>
|
|
730
|
+
<key>KeepAlive</key>
|
|
731
|
+
<dict>
|
|
732
|
+
<key>SuccessfulExit</key>
|
|
733
|
+
<false/>
|
|
734
|
+
</dict>
|
|
735
|
+
<key>StandardOutPath</key>
|
|
736
|
+
<string>${xmlEscape(logsDir)}/server.log</string>
|
|
737
|
+
<key>StandardErrorPath</key>
|
|
738
|
+
<string>${xmlEscape(logsDir)}/server.err</string>
|
|
739
|
+
<key>EnvironmentVariables</key>
|
|
740
|
+
<dict>
|
|
741
|
+
${plistEnvEntries}
|
|
742
|
+
</dict>
|
|
743
|
+
</dict>
|
|
744
|
+
</plist>`;
|
|
745
|
+
// Service was already unloaded above — just write new plist and load
|
|
746
|
+
writeFile(plistPath, plist);
|
|
747
|
+
try {
|
|
748
|
+
execSyncChild(`launchctl load "${plistPath}"`, { stdio: "ignore", timeout: 10000 });
|
|
749
|
+
} catch {
|
|
750
|
+
// Non-fatal — fall back to spawning directly
|
|
751
|
+
}
|
|
752
|
+
} else if (process.platform === "linux") {
|
|
753
|
+
const systemdDir = join(home(), ".config", "systemd", "user");
|
|
754
|
+
mkDir(systemdDir, { recursive: true });
|
|
755
|
+
const servicePath = join(systemdDir, "castle.service");
|
|
756
|
+
const systemdEnvLines = Object.entries(serverEnv)
|
|
757
|
+
.map(([k, v]) => `Environment=${k}=${v}`)
|
|
758
|
+
.join("\n");
|
|
759
|
+
const execStartCmd = [nodePath, ...serverArgs].join(" ");
|
|
760
|
+
const service = `[Unit]
|
|
761
|
+
Description=Castle - The multi-agent workspace
|
|
762
|
+
After=network.target
|
|
763
|
+
|
|
764
|
+
[Service]
|
|
765
|
+
ExecStart=${execStartCmd}
|
|
766
|
+
WorkingDirectory=${PROJECT_ROOT}
|
|
767
|
+
Restart=on-failure
|
|
768
|
+
RestartSec=5
|
|
769
|
+
${systemdEnvLines}
|
|
770
|
+
|
|
771
|
+
[Install]
|
|
772
|
+
WantedBy=default.target
|
|
773
|
+
`;
|
|
774
|
+
writeFile(servicePath, service);
|
|
775
|
+
try {
|
|
776
|
+
execSyncChild("systemctl --user daemon-reload && systemctl --user enable --now castle.service", { stdio: "ignore", timeout: 15000 });
|
|
777
|
+
} catch {
|
|
778
|
+
// Non-fatal
|
|
779
|
+
}
|
|
780
|
+
} else if (isWin) {
|
|
781
|
+
// Windows: use Task Scheduler to run Castle at logon
|
|
782
|
+
// Build a batch wrapper that sets environment variables and starts the server
|
|
783
|
+
const batPath = join(castleDir, "start-server.bat");
|
|
784
|
+
const envLines = Object.entries(serverEnv)
|
|
785
|
+
.map(([k, v]) => `set "${k}=${v}"`)
|
|
786
|
+
.join("\r\n");
|
|
787
|
+
const batContent = `@echo off\r\n${envLines}\r\ncd /d "${PROJECT_ROOT}"\r\n"${nodePath}" ${serverArgs.map((a) => `"${a}"`).join(" ")}\r\n`;
|
|
788
|
+
writeFile(batPath, batContent);
|
|
789
|
+
|
|
790
|
+
// Task was already deleted above — create fresh
|
|
791
|
+
try {
|
|
792
|
+
execSyncChild(
|
|
793
|
+
`schtasks /Create /TN "CastleServer" /TR "\\"${batPath}\\"" /SC ONLOGON /RL HIGHEST /F 2>nul`,
|
|
794
|
+
{ stdio: "ignore", timeout: 10000 }
|
|
795
|
+
);
|
|
796
|
+
} catch {
|
|
797
|
+
// Non-fatal — fall back to spawning directly
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
// Also start the task now
|
|
801
|
+
try {
|
|
802
|
+
execSyncChild('schtasks /Run /TN "CastleServer" 2>nul', { stdio: "ignore", timeout: 10000 });
|
|
803
|
+
} catch {
|
|
804
|
+
// Non-fatal
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
// If no service manager started it, spawn directly
|
|
809
|
+
try {
|
|
810
|
+
await fetch(`http://localhost:${castlePort}`);
|
|
811
|
+
} catch {
|
|
812
|
+
// Server not up yet — spawn it directly as fallback
|
|
813
|
+
const server = spawn(nodePath, serverArgs, {
|
|
814
|
+
cwd: PROJECT_ROOT,
|
|
815
|
+
stdio: ["ignore", "ignore", "ignore"],
|
|
816
|
+
detached: true,
|
|
817
|
+
env: { ...process.env, ...serverEnv },
|
|
818
|
+
});
|
|
819
|
+
if (server.pid != null) {
|
|
820
|
+
writeFile(pidFile, String(server.pid));
|
|
821
|
+
}
|
|
822
|
+
server.unref();
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
// Wait for server to be ready
|
|
826
|
+
const maxWait = 45000;
|
|
827
|
+
const startTime = Date.now();
|
|
828
|
+
let serverReady = false;
|
|
829
|
+
|
|
830
|
+
while (Date.now() - startTime < maxWait) {
|
|
831
|
+
try {
|
|
832
|
+
const res = await fetch(`http://localhost:${castlePort}`);
|
|
833
|
+
if (res.ok || res.status === 404) {
|
|
834
|
+
serverReady = true;
|
|
835
|
+
break;
|
|
836
|
+
}
|
|
837
|
+
} catch {
|
|
838
|
+
// Server not ready yet
|
|
839
|
+
}
|
|
840
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
if (!serverReady) {
|
|
844
|
+
serverSpinner.stop(pc.red("Server took too long to start"));
|
|
845
|
+
p.outro(pc.dim(`Check logs at ${BLUE("~/.castle/logs/")}`));
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
serverSpinner.stop(`\x1b[92m✔\x1b[0m Castle is running`);
|
|
850
|
+
|
|
851
|
+
// Find the display name for the selected primary agent
|
|
852
|
+
const primaryDisplay = agents.find((a) => a.id === primaryAgent)?.name || primaryAgent;
|
|
853
|
+
|
|
854
|
+
p.note(
|
|
855
|
+
[
|
|
856
|
+
"",
|
|
857
|
+
` ${BLUE_BOLD("🏰 Welcome to Castle!")}`,
|
|
858
|
+
"",
|
|
859
|
+
` ${pc.dim("Data directory")} ${BLUE_LIGHT("~/.castle/")}`,
|
|
860
|
+
` ${pc.dim("Config")} ${BLUE_LIGHT("~/.castle/castle.json")}`,
|
|
861
|
+
` ${pc.dim("Primary agent")} ${BLUE_BOLD(primaryDisplay)}`,
|
|
862
|
+
"",
|
|
863
|
+
` ${BLUE_BOLD("➜")} \x1b[1m\x1b[4m\x1b[94mhttp://localhost:${castlePort}\x1b[0m`,
|
|
864
|
+
"",
|
|
865
|
+
` ${pc.dim("Your agents are ready. Let's go!")} 🚀`,
|
|
866
|
+
"",
|
|
867
|
+
].join("\n"),
|
|
868
|
+
BLUE_BOLD("✨ Setup Complete")
|
|
869
|
+
);
|
|
870
|
+
|
|
871
|
+
const openBrowser = await p.confirm({
|
|
872
|
+
message: "Want to open Castle in your browser?",
|
|
873
|
+
});
|
|
874
|
+
|
|
875
|
+
if (p.isCancel(openBrowser) || !openBrowser) {
|
|
876
|
+
p.outro(pc.dim(`Run ${BLUE("castle")} anytime to launch Castle.`));
|
|
877
|
+
return;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
p.outro(pc.dim(`Opening ${BLUE(`http://localhost:${castlePort}`)}...`));
|
|
881
|
+
const open = (await import("open")).default;
|
|
882
|
+
await open(`http://localhost:${castlePort}`);
|
|
883
|
+
}
|