@jlongo78/agent-spaces 0.3.12 → 0.5.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/.claude/settings.local.json +8 -0
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +5 -0
- package/.next/standalone/.next/build-manifest.json +4 -4
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +30 -25
- package/.next/standalone/.next/routes-manifest.json +40 -0
- package/.next/standalone/.next/server/app/(desktop)/admin/analytics/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/(desktop)/admin/analytics/page.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/admin/analytics/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(desktop)/admin/analytics/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/admin/users/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/(desktop)/admin/users/page.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/admin/users/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(desktop)/admin/users/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/analytics/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/(desktop)/analytics/page.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/analytics/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(desktop)/analytics/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/network/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/(desktop)/network/page.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/network/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(desktop)/network/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/(desktop)/page.js +3 -3
- package/.next/standalone/.next/server/app/(desktop)/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(desktop)/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/projects/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/(desktop)/projects/page.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(desktop)/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/sessions/[id]/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/(desktop)/sessions/[id]/page.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/sessions/[id]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(desktop)/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/sessions/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/(desktop)/sessions/page.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/sessions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(desktop)/sessions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/settings/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/(desktop)/settings/page.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(desktop)/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/terminal/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/(desktop)/terminal/page.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/terminal/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(desktop)/terminal/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/terminal/pane/[id]/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/(desktop)/terminal/pane/[id]/page.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/terminal/pane/[id]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(desktop)/terminal/pane/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/terminal/remote/[nodeId]/[workspaceId]/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/(desktop)/terminal/remote/[nodeId]/[workspaceId]/page.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/terminal/remote/[nodeId]/[workspaceId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(desktop)/terminal/remote/[nodeId]/[workspaceId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/workspaces/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/(desktop)/workspaces/page.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/workspaces/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(desktop)/workspaces/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/_global-error/page.js +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +2 -2
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/_not-found/page.js +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/admin/analytics.html +1 -1
- package/.next/standalone/.next/server/app/admin/analytics.rsc +6 -6
- package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin/analytics/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin/analytics.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/admin/analytics.segments/_full.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/admin/analytics.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/admin/analytics.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/admin/analytics.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/admin/users.html +1 -1
- package/.next/standalone/.next/server/app/admin/users.rsc +6 -6
- package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin/users/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin/users.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/admin/users.segments/_full.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/admin/users.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/admin/users.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/admin/users.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/analytics.html +1 -1
- package/.next/standalone/.next/server/app/analytics.rsc +6 -6
- package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap/analytics/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap/analytics.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/analytics.segments/_full.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/analytics.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/analytics.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/analytics.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/admin/analytics/route.js +1 -1
- package/.next/standalone/.next/server/app/api/admin/analytics/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/admin/users/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/admin/users/route.js +1 -1
- package/.next/standalone/.next/server/app/api/admin/users/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/analytics/overview/route.js +1 -1
- package/.next/standalone/.next/server/app/api/analytics/overview/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login/route.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/login/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/me/route.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/me/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/totp/setup/route.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/totp/setup/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/totp/status/route.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/totp/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/totp/verify/route.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/totp/verify/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/bulk/route.js +1 -1
- package/.next/standalone/.next/server/app/api/bulk/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/chat/route.js +1 -1
- package/.next/standalone/.next/server/app/api/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/config/route.js +1 -1
- package/.next/standalone/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/events/route.js +1 -1
- package/.next/standalone/.next/server/app/api/events/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/folders/route.js +1 -1
- package/.next/standalone/.next/server/app/api/folders/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/discovered/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/discovered/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/handshake/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/handshake/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/health/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/health/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/identity/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/identity/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/keys/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/keys/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/keys/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/keys/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/nodes/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/nodes/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/nodes/check/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/nodes/check/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/nodes/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/nodes/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/projects/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/projects/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/proxy/[nodeId]/[...path]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/proxy/[nodeId]/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/search/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/sessions/[id]/messages/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/sessions/[id]/messages/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/sessions/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/sessions/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/sessions/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/terminal/token/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/terminal/token/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/workspaces/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/workspaces/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/workspaces/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/workspaces/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/panes/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/panes/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/panes/route.js +1 -1
- package/.next/standalone/.next/server/app/api/panes/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/projects/route.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/search/route.js +1 -1
- package/.next/standalone/.next/server/app/api/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[id]/chat/route.js +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[id]/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[id]/messages/route.js +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[id]/messages/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sessions/route.js +1 -1
- package/.next/standalone/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sync/route.js +1 -1
- package/.next/standalone/.next/server/app/api/sync/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tags/route.js +1 -1
- package/.next/standalone/.next/server/app/api/tags/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tier/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/tier/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/tier/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/tier/route.js +7 -0
- package/.next/standalone/.next/server/app/api/tier/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/tier/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/tier/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route.js +7 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route.js +7 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route.js +7 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route.js +7 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/sessions/route.js +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/route.js +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/login/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/login/page.js +1 -1
- package/.next/standalone/.next/server/app/login/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/login.html +1 -1
- package/.next/standalone/.next/server/app/login.rsc +5 -5
- package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/m/page.js +1 -1
- package/.next/standalone/.next/server/app/m/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/m/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/m/projects/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/m/projects/page.js +1 -1
- package/.next/standalone/.next/server/app/m/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/m/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/m/projects.html +1 -1
- package/.next/standalone/.next/server/app/m/projects.rsc +6 -6
- package/.next/standalone/.next/server/app/m/projects.segments/_full.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/m/projects.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/projects.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/m/projects.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/projects.segments/m/projects/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/projects.segments/m/projects.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/projects.segments/m.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/sessions/[id]/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/m/sessions/[id]/page.js +1 -1
- package/.next/standalone/.next/server/app/m/sessions/[id]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/m/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/m/sessions/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/m/sessions/page.js +1 -1
- package/.next/standalone/.next/server/app/m/sessions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/m/sessions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/m/sessions.html +1 -1
- package/.next/standalone/.next/server/app/m/sessions.rsc +6 -6
- package/.next/standalone/.next/server/app/m/sessions.segments/_full.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/m/sessions.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/sessions.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/m/sessions.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/sessions.segments/m/sessions/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/sessions.segments/m/sessions.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/sessions.segments/m.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/settings/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/m/settings/page.js +1 -1
- package/.next/standalone/.next/server/app/m/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/m/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/m/settings.html +1 -1
- package/.next/standalone/.next/server/app/m/settings.rsc +6 -6
- package/.next/standalone/.next/server/app/m/settings.segments/_full.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/m/settings.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/settings.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/m/settings.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/settings.segments/m/settings/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/settings.segments/m/settings.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/settings.segments/m.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/terminal/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/m/terminal/page.js +1 -1
- package/.next/standalone/.next/server/app/m/terminal/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/m/terminal/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/m/terminal.html +1 -1
- package/.next/standalone/.next/server/app/m/terminal.rsc +6 -6
- package/.next/standalone/.next/server/app/m/terminal.segments/_full.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/m/terminal.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/terminal.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/m/terminal.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/terminal.segments/m/terminal/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/terminal.segments/m/terminal.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/terminal.segments/m.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m.html +1 -1
- package/.next/standalone/.next/server/app/m.rsc +6 -6
- package/.next/standalone/.next/server/app/m.segments/_full.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/m.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/m.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m.segments/m/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m.segments/m.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/network.html +1 -1
- package/.next/standalone/.next/server/app/network.rsc +6 -6
- package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap/network/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap/network.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/network.segments/_full.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/network.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/network.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/network.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/projects.html +1 -1
- package/.next/standalone/.next/server/app/projects.rsc +6 -6
- package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap/projects/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap/projects.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/projects.segments/_full.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/projects.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/projects.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/projects.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/sessions.html +1 -1
- package/.next/standalone/.next/server/app/sessions.rsc +6 -6
- package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap/sessions/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap/sessions.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/sessions.segments/_full.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/sessions.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/sessions.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/sessions.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/settings.html +1 -1
- package/.next/standalone/.next/server/app/settings.rsc +6 -6
- package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap/settings/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap/settings.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/terminal.html +1 -1
- package/.next/standalone/.next/server/app/terminal.rsc +6 -6
- package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap/terminal/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap/terminal.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/terminal.segments/_full.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/terminal.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/terminal.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/terminal.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/workspaces.html +1 -1
- package/.next/standalone/.next/server/app/workspaces.rsc +6 -6
- package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap/workspaces/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap/workspaces.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/workspaces.segments/_full.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/workspaces.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspaces.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/workspaces.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app-paths-manifest.json +5 -0
- package/.next/standalone/.next/server/chunks/[externals]_chokidar_a0cd9157._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__086be15a._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0955695e._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fac388d._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__18a58c5f._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__190b05d8._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1a211143._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__20353b76._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2861e096._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2a7a798c._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2b6758fc._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2e9d1d5a._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__31f028ec._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__34c34116._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__3aa57139._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__3ce30e4e._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__41ae8be6._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__41e589ee._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__43112c34._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__464db440._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__466c7e18._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__47a63195._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__4ad64489._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5bbc73ff._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__60689e2b._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__67c4abf3._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__6b94cc47._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__6c6cfe82._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__776b2fd5._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__7901e2ab._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__83b9bcf3._.js +11 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__89124c96._.js +48 -37
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8c2eee30._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8ffcf827._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__95b7f18e._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__9e343d64._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a2ee9884._.js +13 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a651ede9._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a6ce192e._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b4b692df._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b4edb4d6._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b71497ab._.js +48 -37
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__bc97ddc7._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__bef2ed87._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c525457e._.js +19 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c546cf71._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ccc27199._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ce5edd98._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d877df12._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__dd2e81be._.js +11 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__de96c005._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__df6bc9e9._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e2b78951._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e742ef33._.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_tier_route_actions_6186023b.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_workspaces_[id]_context_route_actions_e9cb4bed.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_workspaces_[id]_messages_route_actions_0cf1d576.js +3 -0
- package/.next/standalone/.next/server/chunks/ce889_server_app_api_workspaces_[id]_context_[key]_route_actions_8e11e764.js +3 -0
- package/.next/standalone/.next/server/chunks/ce889_server_app_api_workspaces_[id]_messages_[msgId]_route_actions_008a0317.js +3 -0
- package/.next/standalone/.next/server/chunks/src_lib_events_sse_ts_1ad73980._.js +6 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__ea64930e._.js → [root-of-the-server]__2b4e2acc._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__36a11bc9._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__63c35e0f._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__650a172d._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__66aca5d4._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__ba1024f6._.js → [root-of-the-server]__67234962._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__72acd514._.js → [root-of-the-server]__c73bef9a._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__e921fdfc._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/{_548abc09._.js → _0946fdc3._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1f12caba._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_2230ad2d._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_3b54193d._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_43e7e611._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_5ac43c5d._.js +1 -3
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__3611990a._.js → _cd0986af._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_cd50a174._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_7e741697._.js → _de57b857._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_ef42f47a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_f67f58f1._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_dd004864._.js → _fbc5e000._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_861e98fe._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_(desktop)_terminal_page_tsx_de5e8d85._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_m_terminal_page_tsx_553a0130._.js +2 -2
- package/.next/standalone/.next/server/edge/chunks/{[root-of-the-server]__6154bdc0._.js → [root-of-the-server]__32a0045c._.js} +3 -5
- package/.next/standalone/.next/server/edge/chunks/_d73df637._.js +3 -0
- package/.next/standalone/.next/server/edge/chunks/turbopack-node_modules_next_dist_esm_build_templates_edge-wrapper_a4434a38.js +6 -0
- package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
- package/.next/standalone/.next/server/middleware-manifest.json +8 -8
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +2 -2
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/{f58f62604604c529.js → 10c6424526b53431.js} +2 -2
- package/.next/standalone/.next/static/chunks/{0b733ac17fcb2bef.js → 27649ec994a696fb.js} +1 -1
- package/.next/standalone/.next/static/chunks/302ce212c690bec4.js +5 -0
- package/.next/standalone/.next/static/chunks/{4bd6943fa4082aa9.js → 3165c61fb2e4045d.js} +1 -1
- package/.next/standalone/.next/static/chunks/4e792c3078e37704.js +5 -0
- package/.next/standalone/.next/static/chunks/51dacec57c9714c0.js +1 -0
- package/.next/standalone/.next/static/chunks/53782d1e41fd7f82.js +1 -0
- package/.next/standalone/.next/static/chunks/58d78765e5140dcb.js +1 -0
- package/.next/standalone/.next/static/chunks/65afda485a466977.js +1 -0
- package/.next/standalone/.next/static/chunks/cb442c50eecb758d.js +5 -0
- package/.next/standalone/.next/static/chunks/d0c839c82cf232b8.js +1 -0
- package/.next/standalone/.next/static/chunks/e6134a48180c8a36.js +1 -0
- package/.next/standalone/.next/static/chunks/{7de9141b1af425c3.js → e7772d64463868eb.js} +1 -1
- package/.next/standalone/.next/static/chunks/{e94f6965199a47e7.js → eb780226f5bd3892.js} +1 -1
- package/.next/standalone/.next/static/chunks/ff5fac1bd7b518dd.css +3 -0
- package/.next/standalone/.next/static/chunks/{turbopack-947de56768b27172.js → turbopack-ea18b8255590c757.js} +1 -1
- package/.next/standalone/node_modules/@img/sharp-win32-x64/lib/sharp-win32-x64.node +0 -0
- package/.next/standalone/node_modules/@img/{sharp-linux-x64 → sharp-win32-x64}/package.json +39 -46
- package/.next/standalone/node_modules/chokidar/LICENSE +21 -0
- package/.next/standalone/node_modules/chokidar/README.md +305 -0
- package/.next/standalone/node_modules/chokidar/handler.js +632 -0
- package/.next/standalone/node_modules/chokidar/index.js +822 -0
- package/.next/standalone/node_modules/chokidar/package.json +63 -0
- package/.next/standalone/node_modules/readdirp/LICENSE +21 -0
- package/.next/standalone/node_modules/readdirp/README.md +120 -0
- package/.next/standalone/node_modules/readdirp/index.js +272 -0
- package/.next/standalone/node_modules/readdirp/package.json +66 -0
- package/.next/standalone/package.json +89 -91
- package/.next/standalone/server.js +1 -1
- package/.next/standalone/tsconfig.json +34 -34
- package/LICENSE +661 -661
- package/README.md +131 -131
- package/bin/fix-standalone-externals.js +79 -79
- package/bin/lib/auto-setup.js +101 -0
- package/bin/mdns-service.js +171 -171
- package/bin/postinstall.js +35 -35
- package/bin/setup-admin.js +189 -189
- package/bin/spaces-dev.js +208 -108
- package/bin/spaces-install.js +425 -0
- package/bin/spaces-setup.js +242 -0
- package/bin/spaces.js +466 -155
- package/bin/terminal-server.js +1117 -990
- package/package.json +89 -91
- package/.next/standalone/.next/server/chunks/[externals]_node:path_d28a9bfe._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__01c98454._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__18b8f7d9._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__193cb667._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__25b4d5ca._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__280398d8._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2a4c2db6._.js +0 -13
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__3fd6439e._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__40c21d75._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__4375a280._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__4950da9c._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__4a77d855._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__4d551a41._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5420fbcd._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__586418c6._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5c2f4a8e._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5eaa589f._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5f4dc1dd._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5ff6b7d9._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__65509457._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__65620687._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__76e7a7b9._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__7fae7bd7._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__821ffcfb._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__83676993._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__86e02dd1._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8a7fae80._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8af8821a._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__93e1af64._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__94f437bd._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__9e9f597a._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__aae49c2b._.js +0 -15
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ab25b881._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__aef285c3._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b52523c7._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b607a85c._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b950ac1e._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c6355fd6._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d1771755._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d55d3167._.js +0 -12
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d9533783._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d9540965._.js +0 -21
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ddbb7b16._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e4989332._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e7a6a584._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ed0f1148._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__f1436778._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__fe65bfb1._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__17ba2e09._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__6bd17d85._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__7e604f3d._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__a923e475._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__d23f4926._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__e3bf6054._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__f08a4c64._.js +0 -3
- package/.next/standalone/.next/server/edge/chunks/node_modules_next_dist_esm_build_templates_edge-wrapper_78fa9d6a.js +0 -3
- package/.next/standalone/.next/server/edge/chunks/turbopack-node_modules_next_dist_esm_build_templates_edge-wrapper_03b33eff.js +0 -6
- package/.next/standalone/.next/static/chunks/06e3af139a18e326.js +0 -5
- package/.next/standalone/.next/static/chunks/13c233fe06728b88.js +0 -1
- package/.next/standalone/.next/static/chunks/1f4937830aceaae2.js +0 -1
- package/.next/standalone/.next/static/chunks/6b8fb2027281ae5d.js +0 -3
- package/.next/standalone/.next/static/chunks/76698b8c3d5cae75.js +0 -1
- package/.next/standalone/.next/static/chunks/7fbc5bdede00e3c9.js +0 -1
- package/.next/standalone/.next/static/chunks/acbcf40fb5a2ca5e.js +0 -1
- package/.next/standalone/.next/static/chunks/b873b989ec82be01.css +0 -3
- package/.next/standalone/.next/static/chunks/db03df936139672b.js +0 -1
- package/.next/standalone/.next/static/chunks/e7ac38524a30e234.js +0 -5
- package/.next/standalone/.next/static/chunks/f8cf8e5a643bd23f.js +0 -5
- package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/README.md +0 -46
- package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +0 -221
- package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/index.js +0 -1
- package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3 +0 -0
- package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/package.json +0 -42
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +0 -46
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +0 -221
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +0 -1
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +0 -42
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +0 -30
- package/.next/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
- package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
- package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +0 -46
- /package/.next/standalone/.next/static/{_8ZLzufn5gU1vrGxPWqKS → MjMvcPAGPqPwAzs1S2njU}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{_8ZLzufn5gU1vrGxPWqKS → MjMvcPAGPqPwAzs1S2njU}/_clientMiddlewareManifest.json +0 -0
- /package/.next/standalone/.next/static/{_8ZLzufn5gU1vrGxPWqKS → MjMvcPAGPqPwAzs1S2njU}/_ssgManifest.js +0 -0
- /package/.next/standalone/node_modules/@img/{sharp-libvips-linux-x64 → sharp-win32-x64}/versions.json +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31278,e=>{"use strict";let t=(0,e.i(75254).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>t],31278)},66027,54616,e=>{"use strict";let t;var s=e.i(75555),i=e.i(40143),r=e.i(86491),a=e.i(15823),n=e.i(93803),o=e.i(19273),c=e.i(80166),u=class extends a.Subscribable{constructor(e,t){super(),this.options=t,this.#e=e,this.#t=null,this.#s=(0,n.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#e;#i=void 0;#r=void 0;#a=void 0;#n;#o;#s;#t;#c;#u;#l;#h;#d;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#i.addObserver(this),l(this.#i,this.options)?this.#y():this.updateResult(),this.#f())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return h(this.#i,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return h(this.#i,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#b(),this.#i.removeObserver(this)}setOptions(e){let t=this.options,s=this.#i;if(this.options=this.#e.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,o.resolveEnabled)(this.options.enabled,this.#i))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#g(),this.#i.setOptions(this.options),t._defaulted&&!(0,o.shallowEqualObjects)(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#i,observer:this});let i=this.hasListeners();i&&d(this.#i,s,this.options,t)&&this.#y(),this.updateResult(),i&&(this.#i!==s||(0,o.resolveEnabled)(this.options.enabled,this.#i)!==(0,o.resolveEnabled)(t.enabled,this.#i)||(0,o.resolveStaleTime)(this.options.staleTime,this.#i)!==(0,o.resolveStaleTime)(t.staleTime,this.#i))&&this.#v();let r=this.#j();i&&(this.#i!==s||(0,o.resolveEnabled)(this.options.enabled,this.#i)!==(0,o.resolveEnabled)(t.enabled,this.#i)||r!==this.#p)&&this.#S(r)}getOptimisticResult(e){var t,s;let i=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(i,e);return t=this,s=r,(0,o.shallowEqualObjects)(t.getCurrentResult(),s)||(this.#a=r,this.#o=this.options,this.#n=this.#i.state),r}getCurrentResult(){return this.#a}trackResult(e,t){return new Proxy(e,{get:(e,s)=>(this.trackProp(s),t?.(s),"promise"===s&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#s.status||this.#s.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,s))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#i}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),s=this.#e.getQueryCache().build(this.#e,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#y({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#y(e){this.#g();let t=this.#i.fetch(this.options,e);return e?.throwOnError||(t=t.catch(o.noop)),t}#v(){this.#x();let e=(0,o.resolveStaleTime)(this.options.staleTime,this.#i);if(o.isServer||this.#a.isStale||!(0,o.isValidTimeout)(e))return;let t=(0,o.timeUntilStale)(this.#a.dataUpdatedAt,e);this.#h=c.timeoutManager.setTimeout(()=>{this.#a.isStale||this.updateResult()},t+1)}#j(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#i):this.options.refetchInterval)??!1}#S(e){this.#b(),this.#p=e,!o.isServer&&!1!==(0,o.resolveEnabled)(this.options.enabled,this.#i)&&(0,o.isValidTimeout)(this.#p)&&0!==this.#p&&(this.#d=c.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||s.focusManager.isFocused())&&this.#y()},this.#p))}#f(){this.#v(),this.#S(this.#j())}#x(){this.#h&&(c.timeoutManager.clearTimeout(this.#h),this.#h=void 0)}#b(){this.#d&&(c.timeoutManager.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let s,i=this.#i,a=this.options,c=this.#a,u=this.#n,h=this.#o,m=e!==i?e.state:this.#r,{state:y}=e,f={...y},x=!1;if(t._optimisticResults){let s=this.hasListeners(),n=!s&&l(e,t),o=s&&d(e,i,t,a);(n||o)&&(f={...f,...(0,r.fetchState)(y.data,e.options)}),"isRestoring"===t._optimisticResults&&(f.fetchStatus="idle")}let{error:b,errorUpdatedAt:g,status:v}=f;s=f.data;let j=!1;if(void 0!==t.placeholderData&&void 0===s&&"pending"===v){let e;c?.isPlaceholderData&&t.placeholderData===h?.placeholderData?(e=c.data,j=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,void 0!==e&&(v="success",s=(0,o.replaceData)(c?.data,e,t),x=!0)}if(t.select&&void 0!==s&&!j)if(c&&s===u?.data&&t.select===this.#c)s=this.#u;else try{this.#c=t.select,s=t.select(s),s=(0,o.replaceData)(c?.data,s,t),this.#u=s,this.#t=null}catch(e){this.#t=e}this.#t&&(b=this.#t,s=this.#u,g=Date.now(),v="error");let S="fetching"===f.fetchStatus,w="pending"===v,R="error"===v,Q=w&&S,T=void 0!==s,N={status:v,fetchStatus:f.fetchStatus,isPending:w,isSuccess:"success"===v,isError:R,isInitialLoading:Q,isLoading:Q,data:s,dataUpdatedAt:f.dataUpdatedAt,error:b,errorUpdatedAt:g,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>m.dataUpdateCount||f.errorUpdateCount>m.errorUpdateCount,isFetching:S,isRefetching:S&&!w,isLoadingError:R&&!T,isPaused:"paused"===f.fetchStatus,isPlaceholderData:x,isRefetchError:R&&T,isStale:p(e,t),refetch:this.refetch,promise:this.#s,isEnabled:!1!==(0,o.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==N.data,s="error"===N.status&&!t,r=e=>{s?e.reject(N.error):t&&e.resolve(N.data)},a=()=>{r(this.#s=N.promise=(0,n.pendingThenable)())},o=this.#s;switch(o.status){case"pending":e.queryHash===i.queryHash&&r(o);break;case"fulfilled":(s||N.data!==o.value)&&a();break;case"rejected":s&&N.error===o.reason||a()}}return N}updateResult(){let e=this.#a,t=this.createResult(this.#i,this.options);if(this.#n=this.#i.state,this.#o=this.options,void 0!==this.#n.data&&(this.#l=this.#i),(0,o.shallowEqualObjects)(t,e))return;this.#a=t;let s=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.#m.size)return!0;let i=new Set(s??this.#m);return this.options.throwOnError&&i.add("error"),Object.keys(this.#a).some(t=>this.#a[t]!==e[t]&&i.has(t))};this.#w({listeners:s()})}#g(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#i)return;let t=this.#i;this.#i=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#f()}#w(e){i.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#a)}),this.#e.getQueryCache().notify({query:this.#i,type:"observerResultsUpdated"})})}};function l(e,t){return!1!==(0,o.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&h(e,t,t.refetchOnMount)}function h(e,t,s){if(!1!==(0,o.resolveEnabled)(t.enabled,e)&&"static"!==(0,o.resolveStaleTime)(t.staleTime,e)){let i="function"==typeof s?s(e):s;return"always"===i||!1!==i&&p(e,t)}return!1}function d(e,t,s,i){return(e!==t||!1===(0,o.resolveEnabled)(i.enabled,e))&&(!s.suspense||"error"!==e.state.status)&&p(e,s)}function p(e,t){return!1!==(0,o.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,o.resolveStaleTime)(t.staleTime,e))}e.i(47167);var m=e.i(71645),y=e.i(12598);e.i(18050);var f=m.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),x=m.createContext(!1);x.Provider;var b=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function g(e,t){return function(e,t,s){let r,a=m.useContext(x),n=m.useContext(f),c=(0,y.useQueryClient)(s),u=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(u);let l=c.getQueryCache().get(u.queryHash);if(u._optimisticResults=a?"isRestoring":"optimistic",u.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=u.staleTime;u.staleTime="function"==typeof t?(...s)=>e(t(...s)):e(t),"number"==typeof u.gcTime&&(u.gcTime=Math.max(u.gcTime,1e3))}r=l?.state.error&&"function"==typeof u.throwOnError?(0,o.shouldThrowError)(u.throwOnError,[l.state.error,l]):u.throwOnError,(u.suspense||u.experimental_prefetchInRender||r)&&!n.isReset()&&(u.retryOnMount=!1),m.useEffect(()=>{n.clearReset()},[n]);let h=!c.getQueryCache().get(u.queryHash),[d]=m.useState(()=>new t(c,u)),p=d.getOptimisticResult(u),g=!a&&!1!==e.subscribed;if(m.useSyncExternalStore(m.useCallback(e=>{let t=g?d.subscribe(i.notifyManager.batchCalls(e)):o.noop;return d.updateResult(),t},[d,g]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),m.useEffect(()=>{d.setOptions(u)},[u,d]),u?.suspense&&p.isPending)throw b(u,d,n);if((({result:e,errorResetBoundary:t,throwOnError:s,query:i,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(r&&void 0===e.data||(0,o.shouldThrowError)(s,[e.error,i])))({result:p,errorResetBoundary:n,throwOnError:u.throwOnError,query:l,suspense:u.suspense}))throw p.error;if(c.getDefaultOptions().queries?._experimental_afterQuery?.(u,p),u.experimental_prefetchInRender&&!o.isServer&&p.isLoading&&p.isFetching&&!a){let e=h?b(u,d,n):l?.promise;e?.catch(o.noop).finally(()=>{d.updateResult()})}return u.notifyOnChangeProps?p:d.trackResult(p)}(e,u,t)}e.s(["useQuery",()=>g],66027);var v=e.i(14272),j=a,S=class extends j.Subscribable{#e;#a=void 0;#R;#Q;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#T()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,o.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#R,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,o.hashKey)(t.mutationKey)!==(0,o.hashKey)(this.options.mutationKey)?this.reset():this.#R?.state.status==="pending"&&this.#R.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#R?.removeObserver(this)}onMutationUpdate(e){this.#T(),this.#w(e)}getCurrentResult(){return this.#a}reset(){this.#R?.removeObserver(this),this.#R=void 0,this.#T(),this.#w()}mutate(e,t){return this.#Q=t,this.#R?.removeObserver(this),this.#R=this.#e.getMutationCache().build(this.#e,this.options),this.#R.addObserver(this),this.#R.execute(e)}#T(){let e=this.#R?.state??(0,v.getDefaultState)();this.#a={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#w(e){i.notifyManager.batch(()=>{if(this.#Q&&this.hasListeners()){let t=this.#a.variables,s=this.#a.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#Q.onSuccess?.(e.data,t,s,i)}catch(e){Promise.reject(e)}try{this.#Q.onSettled?.(e.data,null,t,s,i)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#Q.onError?.(e.error,t,s,i)}catch(e){Promise.reject(e)}try{this.#Q.onSettled?.(void 0,e.error,t,s,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#a)})})}};function w(e,t){let s=(0,y.useQueryClient)(t),[r]=m.useState(()=>new S(s,e));m.useEffect(()=>{r.setOptions(e)},[r,e]);let a=m.useSyncExternalStore(m.useCallback(e=>r.subscribe(i.notifyManager.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),n=m.useCallback((e,t)=>{r.mutate(e,t).catch(o.noop)},[r]);if(a.error&&(0,o.shouldThrowError)(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:n,mutateAsync:a.mutate}}e.s(["useMutation",()=>w],54616)},3999,e=>{"use strict";var t=e.i(66027),s=e.i(54616),i=e.i(12598),r=e.i(9165);function a(e={}){return(0,t.useQuery)({queryKey:["sessions",e],queryFn:async()=>{let t=new URLSearchParams;return e.projectId&&t.set("projectId",e.projectId),void 0!==e.starred&&t.set("starred",String(e.starred)),e.search&&t.set("search",e.search),e.agentType&&t.set("agentType",e.agentType),e.sortBy&&t.set("sortBy",e.sortBy),e.sortDir&&t.set("sortDir",e.sortDir),void 0!==e.offset&&t.set("offset",String(e.offset)),void 0!==e.limit&&t.set("limit",String(e.limit)),"all"===e.nodeFilter&&t.set("nodes","all"),(await fetch((0,r.api)(`/api/sessions?${t}`))).json()}})}function n(e){return(0,t.useQuery)({queryKey:["session",e],queryFn:async()=>{let t=await fetch((0,r.api)(`/api/sessions/${e}`));if(!t.ok)throw Error("Session not found");return t.json()},enabled:!!e})}function o(e,s=0,i=50,a){return(0,t.useQuery)({queryKey:["messages",e,s,i,a],queryFn:async()=>{let t=a?(0,r.api)(`/api/network/proxy/${a}/sessions/${e}/messages?offset=${s}&limit=${i}`):(0,r.api)(`/api/sessions/${e}/messages?offset=${s}&limit=${i}`);return(await fetch(t)).json()},enabled:!!e})}function c(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async e=>(await fetch((0,r.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"star"})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function u(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async({sessionId:e,notes:t})=>(await fetch((0,r.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"notes",notes:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["session"]})}})}function l(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async({sessionId:e,tagName:t})=>(await fetch((0,r.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"tag",tagName:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]}),e.invalidateQueries({queryKey:["tags"]})}})}function h(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async({sessionId:e,tagName:t})=>(await fetch((0,r.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"removeTag",tagName:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]}),e.invalidateQueries({queryKey:["tags"]})}})}function d(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async({sessionId:e,name:t})=>(await fetch((0,r.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"rename",name:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function p(){return(0,t.useQuery)({queryKey:["tags"],queryFn:async()=>(await fetch((0,r.api)("/api/tags"))).json()})}function m(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async e=>(await fetch((0,r.api)("/api/tags"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete",tagId:e})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["tags"]}),e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function y(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async({tagId:e,color:t})=>(await fetch((0,r.api)("/api/tags"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"updateColor",tagId:e,color:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["tags"]}),e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function f(){return(0,t.useQuery)({queryKey:["workspaces"],queryFn:async()=>(await fetch((0,r.api)("/api/workspaces"))).json()})}function x(){return(0,t.useQuery)({queryKey:["workspaces","remote"],queryFn:async()=>(await fetch((0,r.api)("/api/workspaces?nodes=all"))).json()})}function b(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async({workspaceId:e,sessionId:t,nodeId:s,title:i,cwd:a,agentType:n})=>{let o=await fetch((0,r.api)(`/api/workspaces/${e}/sessions`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t,nodeId:s,title:i,cwd:a,agentType:n})});if(!o.ok)throw Error("Failed to add session to workspace");return o.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["workspace-sessions"]}),e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function g(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async({workspaceId:e,sessionId:t})=>{let s=await fetch((0,r.api)(`/api/workspaces/${e}/sessions`),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t})});if(!s.ok)throw Error("Failed to remove session from workspace");return s.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["workspace-sessions"]}),e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function v(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async e=>(await fetch((0,r.api)("/api/bulk"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["tags"]})}})}function j(){return(0,t.useQuery)({queryKey:["projects"],queryFn:async()=>(await fetch((0,r.api)("/api/projects"))).json()})}function S(){return(0,t.useQuery)({queryKey:["analytics"],queryFn:async()=>(await fetch((0,r.api)("/api/analytics/overview"))).json()})}function w(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async()=>(await fetch((0,r.api)("/api/sync"),{method:"POST"})).json(),onSuccess:()=>{e.invalidateQueries()}})}e.s(["useAddSessionToWorkspace",()=>b,"useAddTag",()=>l,"useAnalytics",()=>S,"useBulkAction",()=>v,"useDeleteTag",()=>m,"useMessages",()=>o,"useProjects",()=>j,"useRemoteWorkspaces",()=>x,"useRemoveSessionFromWorkspace",()=>g,"useRemoveTag",()=>h,"useRenameSession",()=>d,"useSession",()=>n,"useSessions",()=>a,"useSync",()=>w,"useTags",()=>p,"useToggleStar",()=>c,"useUpdateNotes",()=>u,"useUpdateTagColor",()=>y,"useWorkspaces",()=>f])},37727,e=>{"use strict";let t=(0,e.i(75254).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",()=>t],37727)},7233,e=>{"use strict";let t=(0,e.i(75254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],7233)},16715,e=>{"use strict";let t=(0,e.i(75254).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",()=>t],16715)},98919,e=>{"use strict";let t=(0,e.i(75254).default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);e.s(["Shield",()=>t],98919)},95468,11588,e=>{"use strict";var t=e.i(75254);let s=(0,t.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["CheckCircle2",()=>s],95468);let i=(0,t.default)("folder-code",[["path",{d:"M10 10.5 8 13l2 2.5",key:"m4t9c1"}],["path",{d:"m14 10.5 2 2.5-2 2.5",key:"14w2eb"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2z",key:"1u1bxd"}]]);e.s(["FolderCode",()=>i],11588)},38090,e=>{"use strict";var t=e.i(18050),s=e.i(71645),i=e.i(3999),r=e.i(39616),a=e.i(16715),n=e.i(75505),o=e.i(31278),c=e.i(98919),u=e.i(95468),l=e.i(17923),h=e.i(7233),d=e.i(37727),p=e.i(11588),m=e.i(9165),y=e.i(9593),f=e.i(83774);let x="u">typeof document&&document.cookie.includes("spaces-session=");function b(){let e=(0,i.useSync)(),[b,g]=(0,s.useState)(""),[v,j]=(0,s.useState)(!1),[S,w]=(0,s.useState)(!0),[R,Q]=(0,s.useState)(!1),[T,N]=(0,s.useState)(""),[k,C]=(0,s.useState)(""),[O,E]=(0,s.useState)(""),[M,q]=(0,s.useState)(""),[z,F]=(0,s.useState)(!1),I=(0,s.useRef)(null),[K,P]=(0,s.useState)(null),[D,U]=(0,s.useState)([]),[A,L]=(0,s.useState)(""),[$,_]=(0,s.useState)(!1),[W,J]=(0,s.useState)(!0);(0,s.useEffect)(()=>{f.HAS_AUTH?x?fetch((0,m.api)("/api/auth/me")).then(e=>e.json()).then(e=>{P(e),w(!1)}).catch(()=>w(!1)):fetch((0,m.api)("/api/auth/totp/status")).then(e=>e.json()).then(e=>{j(e.enabled),w(!1)}).catch(()=>w(!1)):w(!1)},[]),(0,s.useEffect)(()=>{fetch((0,m.api)("/api/config")).then(e=>e.json()).then(e=>{_(e.telemetryOptOut),U(e.devDirectories||[]),J(!1)}).catch(()=>J(!1))},[]);let H=async e=>{U(e),await fetch((0,m.api)("/api/config"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({devDirectories:e})})},B=()=>{let e=A.trim();!e||D.includes(e)||(e.startsWith("/")||/^[A-Za-z]:[\\/]/.test(e))&&(H([...D,e]),L(""))},V=async()=>{let t=await e.mutateAsync();g(`Synced ${t.projects} projects, ${t.sessions} sessions, enriched ${t.enriched}`),(0,y.track)("sync_completed",{projects:t.projects,sessions:t.sessions,enriched:t.enriched})},X=async()=>{let e=!$;_(e),(0,y.setOptOut)(e),(0,y.track)("telemetry_toggled",{enabled:!e}),await fetch((0,m.api)("/api/config"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({telemetryOptOut:e})})},Y=async()=>{Q(!0),q(""),E("");let e=await fetch((0,m.api)("/api/auth/totp/setup"),{method:"POST"}),t=await e.json();N(t.qrDataUrl),C(t.secret),setTimeout(()=>I.current?.focus(),100)},Z=async e=>{if(6!==e.length)return;F(!0),q("");let t=await fetch((0,m.api)("/api/auth/totp/verify"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,action:"enable"})}),s=await t.json();F(!1),s.success?(j(!0),Q(!1),N(""),C(""),E("")):(q(s.error||"Invalid code"),E(""),I.current?.focus())},G=async()=>{confirm("Disable 2FA? You will need to set it up again to use terminals.")&&(await fetch((0,m.api)("/api/auth/totp/setup"),{method:"POST"}),j(!1),Q(!1))};return(0,t.jsxs)("div",{className:"p-6 max-w-3xl",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold",children:"Settings"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm mt-1",children:"Configure Spaces"})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[f.HAS_AUTH&&(0,t.jsxs)("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg p-5",children:[(0,t.jsxs)("h3",{className:"font-semibold flex items-center gap-2 mb-3",children:[(0,t.jsx)(c.Shield,{className:"w-4 h-4"}),"Terminal Security"]}),S?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-zinc-400",children:[(0,t.jsx)(o.Loader2,{className:"w-4 h-4 animate-spin"}),"Loading..."]}):x?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.CheckCircle2,{className:"w-5 h-5 text-green-500"}),(0,t.jsx)("span",{className:"text-sm font-medium text-green-500",children:"2FA Enabled"})]}),(0,t.jsx)("p",{className:"text-xs text-zinc-500",children:"Two-factor authentication is required at login. TOTP is managed through the login flow. Contact an admin to reset your 2FA if needed."})]}):v&&!R?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.CheckCircle2,{className:"w-5 h-5 text-green-500"}),(0,t.jsx)("span",{className:"text-sm font-medium text-green-500",children:"2FA Enabled"})]}),(0,t.jsx)("p",{className:"text-xs text-zinc-500",children:"Two-factor authentication is required each time you open a terminal session. Tokens are valid for 8 hours."}),(0,t.jsx)("button",{onClick:G,className:"text-xs text-zinc-500 hover:text-red-400 transition-colors",children:"Disable 2FA"})]}):R?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("p",{className:"text-sm text-zinc-400",children:"Scan this QR code with your authenticator app (Google Authenticator, Authy, etc.)"}),T?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,t.jsx)("div",{className:"bg-white p-3 rounded-lg",children:(0,t.jsx)("img",{src:T,alt:"TOTP QR Code",width:200,height:200})}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("p",{className:"text-[10px] text-zinc-600 mb-1",children:"Manual entry key:"}),(0,t.jsx)("code",{className:"text-xs bg-zinc-800 px-2 py-1 rounded font-mono select-all",children:k})]})]}):(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)(o.Loader2,{className:"w-6 h-6 animate-spin text-zinc-400"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs text-zinc-400 block mb-1.5",children:"Enter the 6-digit code from your authenticator"}),(0,t.jsx)("input",{ref:I,type:"text",inputMode:"numeric",autoComplete:"one-time-code",placeholder:"000000",value:O,onChange:e=>{let t;E(t=e.target.value.replace(/\D/g,"").slice(0,6)),q(""),6===t.length&&Z(t)},disabled:z,className:"w-40 px-3 py-2 text-lg font-mono tracking-[0.3em] text-center bg-zinc-800 border border-zinc-700 rounded-md focus:outline-none focus:border-indigo-500 text-white disabled:opacity-50"}),z&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-2 text-xs text-zinc-400",children:[(0,t.jsx)(o.Loader2,{className:"w-3 h-3 animate-spin"}),"Verifying..."]}),M&&(0,t.jsx)("p",{className:"text-xs text-red-400 mt-2",children:M})]}),(0,t.jsx)("button",{onClick:()=>{Q(!1),N(""),C("")},className:"text-xs text-zinc-500 hover:text-white transition-colors",children:"Cancel"})]}):(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-sm text-zinc-400",children:"Two-factor authentication adds an extra layer of security to terminal access. You'll need an authenticator app to generate codes."}),(0,t.jsxs)("button",{onClick:Y,className:"flex items-center gap-2 px-4 py-2 text-sm bg-indigo-500 text-white rounded-md hover:bg-indigo-600",children:[(0,t.jsx)(c.Shield,{className:"w-4 h-4"}),"Set up 2FA"]})]})]}),(0,t.jsxs)("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg p-5",children:[(0,t.jsxs)("h3",{className:"font-semibold flex items-center gap-2 mb-3",children:[(0,t.jsx)(n.FolderOpen,{className:"w-4 h-4"}),"Data Source"]}),(0,t.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-muted-foreground text-xs",children:"Agent Data Directories"}),(0,t.jsxs)("div",{className:"font-mono text-xs mt-1 p-2 bg-zinc-50 dark:bg-zinc-800 rounded space-y-1",children:[(0,t.jsx)("p",{children:"~/.claude/"}),(0,t.jsx)("p",{children:"~/.codex/"}),(0,t.jsx)("p",{children:"~/.gemini/"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-muted-foreground text-xs",children:"Spaces Database"}),(0,t.jsx)("p",{className:"font-mono text-xs mt-1 p-2 bg-zinc-50 dark:bg-zinc-800 rounded",children:"~/.spaces/spaces.db"})]})]})]}),(0,t.jsxs)("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg p-5",children:[(0,t.jsxs)("h3",{className:"font-semibold flex items-center gap-2 mb-3",children:[(0,t.jsx)(p.FolderCode,{className:"w-4 h-4"}),"Development Directories"]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-3",children:"Restrict terminal pane creation to these project roots. Paths must be absolute."}),D.length>0&&(0,t.jsx)("div",{className:"space-y-1.5 mb-3",children:D.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-zinc-50 dark:bg-zinc-800 rounded-md group",children:[(0,t.jsx)(n.FolderOpen,{className:"w-3.5 h-3.5 text-amber-500/70 flex-shrink-0"}),(0,t.jsx)("span",{className:"font-mono text-xs flex-1 truncate",children:e}),(0,t.jsx)("button",{onClick:()=>{H(D.filter(t=>t!==e))},className:"text-zinc-400 hover:text-red-400 opacity-0 group-hover:opacity-100 transition-opacity",title:"Remove",children:(0,t.jsx)(d.X,{className:"w-3.5 h-3.5"})})]},e))}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"text",placeholder:"u">typeof navigator&&navigator.platform?.startsWith("Win")?"C:\\Users\\you\\projects":"/home/user/projects",value:A,onChange:e=>L(e.target.value),onKeyDown:e=>"Enter"===e.key&&B(),className:"flex-1 px-3 py-1.5 text-sm bg-zinc-50 dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-md focus:outline-none focus:border-indigo-500 font-mono"}),(0,t.jsxs)("button",{onClick:B,disabled:!A.trim()||!(A.trim().startsWith("/")||/^[A-Za-z]:[\\/]/.test(A.trim())),className:"flex items-center gap-1.5 px-3 py-1.5 text-sm bg-indigo-500 text-white rounded-md hover:bg-indigo-600 disabled:opacity-50",children:[(0,t.jsx)(h.Plus,{className:"w-3.5 h-3.5"}),"Add"]})]})]}),(0,t.jsxs)("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg p-5",children:[(0,t.jsxs)("h3",{className:"font-semibold flex items-center gap-2 mb-3",children:[(0,t.jsx)(a.RefreshCw,{className:"w-4 h-4"}),"Data Sync"]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-3",children:"Force a full re-scan of all agent sessions. This rebuilds the index from scratch."}),(0,t.jsxs)("button",{onClick:V,disabled:e.isPending,className:"flex items-center gap-2 px-4 py-2 text-sm bg-indigo-500 text-white rounded-md hover:bg-indigo-600 disabled:opacity-50",children:[e.isPending?(0,t.jsx)(o.Loader2,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(a.RefreshCw,{className:"w-4 h-4"}),"Re-sync Now"]}),b&&(0,t.jsx)("p",{className:"text-xs text-green-600 mt-2",children:b})]}),(0,t.jsxs)("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg p-5",children:[(0,t.jsxs)("h3",{className:"font-semibold flex items-center gap-2 mb-3",children:[(0,t.jsx)(l.BarChart3,{className:"w-4 h-4"}),"Telemetry"]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-3",children:"Anonymous usage data helps us understand how Spaces is used and improve the product. No file paths, session content, or personal information is ever collected."}),W?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-zinc-400",children:[(0,t.jsx)(o.Loader2,{className:"w-4 h-4 animate-spin"}),"Loading..."]}):(0,t.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:!$,onChange:X,className:"w-4 h-4 rounded border-zinc-300 dark:border-zinc-700 text-indigo-500 focus:ring-indigo-500"}),(0,t.jsx)("span",{className:"text-sm",children:"Send anonymous usage data"})]})]}),(0,t.jsxs)("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg p-5",children:[(0,t.jsxs)("h3",{className:"font-semibold flex items-center gap-2 mb-3",children:[(0,t.jsx)(r.Settings,{className:"w-4 h-4"}),"About"]}),(0,t.jsxs)("div",{className:"text-sm space-y-1",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Version:"})," 0.1.0"]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Data access:"})," Read-only (never modifies agent data directories)"]}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs mt-2",children:"Spaces is an open-source agent workspace manager. All session data stays local on your machine."})]})]})]})]})}e.s(["default",()=>b])}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31278,e=>{"use strict";let t=(0,e.i(75254).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>t],31278)},66027,54616,e=>{"use strict";let t;var s=e.i(75555),i=e.i(40143),r=e.i(86491),a=e.i(15823),n=e.i(93803),o=e.i(19273),c=e.i(80166),u=class extends a.Subscribable{constructor(e,t){super(),this.options=t,this.#e=e,this.#t=null,this.#s=(0,n.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#e;#i=void 0;#r=void 0;#a=void 0;#n;#o;#s;#t;#c;#u;#l;#h;#d;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#i.addObserver(this),l(this.#i,this.options)?this.#y():this.updateResult(),this.#f())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return h(this.#i,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return h(this.#i,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#b(),this.#i.removeObserver(this)}setOptions(e){let t=this.options,s=this.#i;if(this.options=this.#e.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,o.resolveEnabled)(this.options.enabled,this.#i))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#g(),this.#i.setOptions(this.options),t._defaulted&&!(0,o.shallowEqualObjects)(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#i,observer:this});let i=this.hasListeners();i&&d(this.#i,s,this.options,t)&&this.#y(),this.updateResult(),i&&(this.#i!==s||(0,o.resolveEnabled)(this.options.enabled,this.#i)!==(0,o.resolveEnabled)(t.enabled,this.#i)||(0,o.resolveStaleTime)(this.options.staleTime,this.#i)!==(0,o.resolveStaleTime)(t.staleTime,this.#i))&&this.#v();let r=this.#j();i&&(this.#i!==s||(0,o.resolveEnabled)(this.options.enabled,this.#i)!==(0,o.resolveEnabled)(t.enabled,this.#i)||r!==this.#p)&&this.#S(r)}getOptimisticResult(e){var t,s;let i=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(i,e);return t=this,s=r,(0,o.shallowEqualObjects)(t.getCurrentResult(),s)||(this.#a=r,this.#o=this.options,this.#n=this.#i.state),r}getCurrentResult(){return this.#a}trackResult(e,t){return new Proxy(e,{get:(e,s)=>(this.trackProp(s),t?.(s),"promise"===s&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#s.status||this.#s.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,s))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#i}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),s=this.#e.getQueryCache().build(this.#e,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#y({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#y(e){this.#g();let t=this.#i.fetch(this.options,e);return e?.throwOnError||(t=t.catch(o.noop)),t}#v(){this.#x();let e=(0,o.resolveStaleTime)(this.options.staleTime,this.#i);if(o.isServer||this.#a.isStale||!(0,o.isValidTimeout)(e))return;let t=(0,o.timeUntilStale)(this.#a.dataUpdatedAt,e);this.#h=c.timeoutManager.setTimeout(()=>{this.#a.isStale||this.updateResult()},t+1)}#j(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#i):this.options.refetchInterval)??!1}#S(e){this.#b(),this.#p=e,!o.isServer&&!1!==(0,o.resolveEnabled)(this.options.enabled,this.#i)&&(0,o.isValidTimeout)(this.#p)&&0!==this.#p&&(this.#d=c.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||s.focusManager.isFocused())&&this.#y()},this.#p))}#f(){this.#v(),this.#S(this.#j())}#x(){this.#h&&(c.timeoutManager.clearTimeout(this.#h),this.#h=void 0)}#b(){this.#d&&(c.timeoutManager.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let s,i=this.#i,a=this.options,c=this.#a,u=this.#n,h=this.#o,m=e!==i?e.state:this.#r,{state:y}=e,f={...y},x=!1;if(t._optimisticResults){let s=this.hasListeners(),n=!s&&l(e,t),o=s&&d(e,i,t,a);(n||o)&&(f={...f,...(0,r.fetchState)(y.data,e.options)}),"isRestoring"===t._optimisticResults&&(f.fetchStatus="idle")}let{error:b,errorUpdatedAt:g,status:v}=f;s=f.data;let j=!1;if(void 0!==t.placeholderData&&void 0===s&&"pending"===v){let e;c?.isPlaceholderData&&t.placeholderData===h?.placeholderData?(e=c.data,j=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,void 0!==e&&(v="success",s=(0,o.replaceData)(c?.data,e,t),x=!0)}if(t.select&&void 0!==s&&!j)if(c&&s===u?.data&&t.select===this.#c)s=this.#u;else try{this.#c=t.select,s=t.select(s),s=(0,o.replaceData)(c?.data,s,t),this.#u=s,this.#t=null}catch(e){this.#t=e}this.#t&&(b=this.#t,s=this.#u,g=Date.now(),v="error");let S="fetching"===f.fetchStatus,w="pending"===v,R="error"===v,Q=w&&S,N=void 0!==s,T={status:v,fetchStatus:f.fetchStatus,isPending:w,isSuccess:"success"===v,isError:R,isInitialLoading:Q,isLoading:Q,data:s,dataUpdatedAt:f.dataUpdatedAt,error:b,errorUpdatedAt:g,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>m.dataUpdateCount||f.errorUpdateCount>m.errorUpdateCount,isFetching:S,isRefetching:S&&!w,isLoadingError:R&&!N,isPaused:"paused"===f.fetchStatus,isPlaceholderData:x,isRefetchError:R&&N,isStale:p(e,t),refetch:this.refetch,promise:this.#s,isEnabled:!1!==(0,o.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==T.data,s="error"===T.status&&!t,r=e=>{s?e.reject(T.error):t&&e.resolve(T.data)},a=()=>{r(this.#s=T.promise=(0,n.pendingThenable)())},o=this.#s;switch(o.status){case"pending":e.queryHash===i.queryHash&&r(o);break;case"fulfilled":(s||T.data!==o.value)&&a();break;case"rejected":s&&T.error===o.reason||a()}}return T}updateResult(){let e=this.#a,t=this.createResult(this.#i,this.options);if(this.#n=this.#i.state,this.#o=this.options,void 0!==this.#n.data&&(this.#l=this.#i),(0,o.shallowEqualObjects)(t,e))return;this.#a=t;let s=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.#m.size)return!0;let i=new Set(s??this.#m);return this.options.throwOnError&&i.add("error"),Object.keys(this.#a).some(t=>this.#a[t]!==e[t]&&i.has(t))};this.#w({listeners:s()})}#g(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#i)return;let t=this.#i;this.#i=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#f()}#w(e){i.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#a)}),this.#e.getQueryCache().notify({query:this.#i,type:"observerResultsUpdated"})})}};function l(e,t){return!1!==(0,o.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&h(e,t,t.refetchOnMount)}function h(e,t,s){if(!1!==(0,o.resolveEnabled)(t.enabled,e)&&"static"!==(0,o.resolveStaleTime)(t.staleTime,e)){let i="function"==typeof s?s(e):s;return"always"===i||!1!==i&&p(e,t)}return!1}function d(e,t,s,i){return(e!==t||!1===(0,o.resolveEnabled)(i.enabled,e))&&(!s.suspense||"error"!==e.state.status)&&p(e,s)}function p(e,t){return!1!==(0,o.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,o.resolveStaleTime)(t.staleTime,e))}e.i(47167);var m=e.i(71645),y=e.i(12598);e.i(18050);var f=m.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),x=m.createContext(!1);x.Provider;var b=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function g(e,t){return function(e,t,s){let r,a=m.useContext(x),n=m.useContext(f),c=(0,y.useQueryClient)(s),u=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(u);let l=c.getQueryCache().get(u.queryHash);if(u._optimisticResults=a?"isRestoring":"optimistic",u.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=u.staleTime;u.staleTime="function"==typeof t?(...s)=>e(t(...s)):e(t),"number"==typeof u.gcTime&&(u.gcTime=Math.max(u.gcTime,1e3))}r=l?.state.error&&"function"==typeof u.throwOnError?(0,o.shouldThrowError)(u.throwOnError,[l.state.error,l]):u.throwOnError,(u.suspense||u.experimental_prefetchInRender||r)&&!n.isReset()&&(u.retryOnMount=!1),m.useEffect(()=>{n.clearReset()},[n]);let h=!c.getQueryCache().get(u.queryHash),[d]=m.useState(()=>new t(c,u)),p=d.getOptimisticResult(u),g=!a&&!1!==e.subscribed;if(m.useSyncExternalStore(m.useCallback(e=>{let t=g?d.subscribe(i.notifyManager.batchCalls(e)):o.noop;return d.updateResult(),t},[d,g]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),m.useEffect(()=>{d.setOptions(u)},[u,d]),u?.suspense&&p.isPending)throw b(u,d,n);if((({result:e,errorResetBoundary:t,throwOnError:s,query:i,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(r&&void 0===e.data||(0,o.shouldThrowError)(s,[e.error,i])))({result:p,errorResetBoundary:n,throwOnError:u.throwOnError,query:l,suspense:u.suspense}))throw p.error;if(c.getDefaultOptions().queries?._experimental_afterQuery?.(u,p),u.experimental_prefetchInRender&&!o.isServer&&p.isLoading&&p.isFetching&&!a){let e=h?b(u,d,n):l?.promise;e?.catch(o.noop).finally(()=>{d.updateResult()})}return u.notifyOnChangeProps?p:d.trackResult(p)}(e,u,t)}e.s(["useQuery",()=>g],66027);var v=e.i(14272),j=a,S=class extends j.Subscribable{#e;#a=void 0;#R;#Q;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#N()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,o.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#R,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,o.hashKey)(t.mutationKey)!==(0,o.hashKey)(this.options.mutationKey)?this.reset():this.#R?.state.status==="pending"&&this.#R.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#R?.removeObserver(this)}onMutationUpdate(e){this.#N(),this.#w(e)}getCurrentResult(){return this.#a}reset(){this.#R?.removeObserver(this),this.#R=void 0,this.#N(),this.#w()}mutate(e,t){return this.#Q=t,this.#R?.removeObserver(this),this.#R=this.#e.getMutationCache().build(this.#e,this.options),this.#R.addObserver(this),this.#R.execute(e)}#N(){let e=this.#R?.state??(0,v.getDefaultState)();this.#a={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#w(e){i.notifyManager.batch(()=>{if(this.#Q&&this.hasListeners()){let t=this.#a.variables,s=this.#a.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#Q.onSuccess?.(e.data,t,s,i)}catch(e){Promise.reject(e)}try{this.#Q.onSettled?.(e.data,null,t,s,i)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#Q.onError?.(e.error,t,s,i)}catch(e){Promise.reject(e)}try{this.#Q.onSettled?.(void 0,e.error,t,s,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#a)})})}};function w(e,t){let s=(0,y.useQueryClient)(t),[r]=m.useState(()=>new S(s,e));m.useEffect(()=>{r.setOptions(e)},[r,e]);let a=m.useSyncExternalStore(m.useCallback(e=>r.subscribe(i.notifyManager.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),n=m.useCallback((e,t)=>{r.mutate(e,t).catch(o.noop)},[r]);if(a.error&&(0,o.shouldThrowError)(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:n,mutateAsync:a.mutate}}e.s(["useMutation",()=>w],54616)},3999,e=>{"use strict";var t=e.i(66027),s=e.i(54616),i=e.i(12598),r=e.i(9165);function a(e={}){return(0,t.useQuery)({queryKey:["sessions",e],queryFn:async()=>{let t=new URLSearchParams;return e.projectId&&t.set("projectId",e.projectId),void 0!==e.starred&&t.set("starred",String(e.starred)),e.search&&t.set("search",e.search),e.agentType&&t.set("agentType",e.agentType),e.sortBy&&t.set("sortBy",e.sortBy),e.sortDir&&t.set("sortDir",e.sortDir),void 0!==e.offset&&t.set("offset",String(e.offset)),void 0!==e.limit&&t.set("limit",String(e.limit)),"all"===e.nodeFilter&&t.set("nodes","all"),(await fetch((0,r.api)(`/api/sessions?${t}`))).json()}})}function n(e){return(0,t.useQuery)({queryKey:["session",e],queryFn:async()=>{let t=await fetch((0,r.api)(`/api/sessions/${e}`));if(!t.ok)throw Error("Session not found");return t.json()},enabled:!!e})}function o(e,s=0,i=50,a){return(0,t.useQuery)({queryKey:["messages",e,s,i,a],queryFn:async()=>{let t=a?(0,r.api)(`/api/network/proxy/${a}/sessions/${e}/messages?offset=${s}&limit=${i}`):(0,r.api)(`/api/sessions/${e}/messages?offset=${s}&limit=${i}`);return(await fetch(t)).json()},enabled:!!e})}function c(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async e=>(await fetch((0,r.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"star"})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function u(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async({sessionId:e,notes:t})=>(await fetch((0,r.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"notes",notes:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["session"]})}})}function l(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async({sessionId:e,tagName:t})=>(await fetch((0,r.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"tag",tagName:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]}),e.invalidateQueries({queryKey:["tags"]})}})}function h(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async({sessionId:e,tagName:t})=>(await fetch((0,r.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"removeTag",tagName:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]}),e.invalidateQueries({queryKey:["tags"]})}})}function d(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async({sessionId:e,name:t})=>(await fetch((0,r.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"rename",name:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function p(){return(0,t.useQuery)({queryKey:["tags"],queryFn:async()=>(await fetch((0,r.api)("/api/tags"))).json()})}function m(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async e=>(await fetch((0,r.api)("/api/tags"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete",tagId:e})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["tags"]}),e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function y(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async({tagId:e,color:t})=>(await fetch((0,r.api)("/api/tags"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"updateColor",tagId:e,color:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["tags"]}),e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function f(){return(0,t.useQuery)({queryKey:["workspaces"],queryFn:async()=>(await fetch((0,r.api)("/api/workspaces"))).json()})}function x(){return(0,t.useQuery)({queryKey:["workspaces","remote"],queryFn:async()=>(await fetch((0,r.api)("/api/workspaces?nodes=all"))).json()})}function b(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async({workspaceId:e,sessionId:t,nodeId:s,title:i,cwd:a,agentType:n})=>{let o=await fetch((0,r.api)(`/api/workspaces/${e}/sessions`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t,nodeId:s,title:i,cwd:a,agentType:n})});if(!o.ok)throw Error("Failed to add session to workspace");return o.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["workspace-sessions"]}),e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function g(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async({workspaceId:e,sessionId:t})=>{let s=await fetch((0,r.api)(`/api/workspaces/${e}/sessions`),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t})});if(!s.ok)throw Error("Failed to remove session from workspace");return s.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["workspace-sessions"]}),e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function v(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async e=>(await fetch((0,r.api)("/api/bulk"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["tags"]})}})}function j(){return(0,t.useQuery)({queryKey:["projects"],queryFn:async()=>(await fetch((0,r.api)("/api/projects"))).json()})}function S(){return(0,t.useQuery)({queryKey:["analytics"],queryFn:async()=>(await fetch((0,r.api)("/api/analytics/overview"))).json()})}function w(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async()=>(await fetch((0,r.api)("/api/sync"),{method:"POST"})).json(),onSuccess:()=>{e.invalidateQueries()}})}e.s(["useAddSessionToWorkspace",()=>b,"useAddTag",()=>l,"useAnalytics",()=>S,"useBulkAction",()=>v,"useDeleteTag",()=>m,"useMessages",()=>o,"useProjects",()=>j,"useRemoteWorkspaces",()=>x,"useRemoveSessionFromWorkspace",()=>g,"useRemoveTag",()=>h,"useRenameSession",()=>d,"useSession",()=>n,"useSessions",()=>a,"useSync",()=>w,"useTags",()=>p,"useToggleStar",()=>c,"useUpdateNotes",()=>u,"useUpdateTagColor",()=>y,"useWorkspaces",()=>f])},37727,e=>{"use strict";let t=(0,e.i(75254).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",()=>t],37727)},7233,e=>{"use strict";let t=(0,e.i(75254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],7233)},16715,e=>{"use strict";let t=(0,e.i(75254).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",()=>t],16715)},98919,e=>{"use strict";let t=(0,e.i(75254).default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);e.s(["Shield",()=>t],98919)},95468,11588,e=>{"use strict";var t=e.i(75254);let s=(0,t.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["CheckCircle2",()=>s],95468);let i=(0,t.default)("folder-code",[["path",{d:"M10 10.5 8 13l2 2.5",key:"m4t9c1"}],["path",{d:"m14 10.5 2 2.5-2 2.5",key:"14w2eb"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2z",key:"1u1bxd"}]]);e.s(["FolderCode",()=>i],11588)},38090,e=>{"use strict";var t=e.i(18050),s=e.i(71645),i=e.i(3999),r=e.i(39616),a=e.i(16715),n=e.i(75505),o=e.i(31278),c=e.i(98919),u=e.i(95468),l=e.i(17923),h=e.i(7233),d=e.i(37727),p=e.i(11588),m=e.i(9165),y=e.i(9593),f=e.i(29320);function x(){let{hasAuth:e,tier:x,version:b}=(0,f.useTier)(),g="u">typeof document&&document.cookie.includes("spaces-session="),v=(0,i.useSync)(),[j,S]=(0,s.useState)(""),[w,R]=(0,s.useState)(!1),[Q,N]=(0,s.useState)(!0),[T,k]=(0,s.useState)(!1),[C,O]=(0,s.useState)(""),[E,M]=(0,s.useState)(""),[q,z]=(0,s.useState)(""),[F,I]=(0,s.useState)(""),[K,P]=(0,s.useState)(!1),D=(0,s.useRef)(null),[U,A]=(0,s.useState)(null),[L,$]=(0,s.useState)([]),[_,W]=(0,s.useState)(""),[J,B]=(0,s.useState)(!1),[H,V]=(0,s.useState)(!0);(0,s.useEffect)(()=>{e?g?fetch((0,m.api)("/api/auth/me")).then(e=>e.json()).then(e=>{A(e),N(!1)}).catch(()=>N(!1)):fetch((0,m.api)("/api/auth/totp/status")).then(e=>e.json()).then(e=>{R(e.enabled),N(!1)}).catch(()=>N(!1)):N(!1)},[e,g]),(0,s.useEffect)(()=>{fetch((0,m.api)("/api/config")).then(e=>e.json()).then(e=>{B(e.telemetryOptOut),$(e.devDirectories||[]),V(!1)}).catch(()=>V(!1))},[]);let X=async e=>{$(e),await fetch((0,m.api)("/api/config"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({devDirectories:e})})},Y=()=>{let e=_.trim();!e||L.includes(e)||(e.startsWith("/")||/^[A-Za-z]:[\\/]/.test(e))&&(X([...L,e]),W(""))},Z=async()=>{let e=await v.mutateAsync();S(`Synced ${e.projects} projects, ${e.sessions} sessions, enriched ${e.enriched}`),(0,y.track)("sync_completed",{projects:e.projects,sessions:e.sessions,enriched:e.enriched})},G=async()=>{let e=!J;B(e),(0,y.setOptOut)(e),(0,y.track)("telemetry_toggled",{enabled:!e}),await fetch((0,m.api)("/api/config"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({telemetryOptOut:e})})},ee=async()=>{k(!0),I(""),z("");let e=await fetch((0,m.api)("/api/auth/totp/setup"),{method:"POST"}),t=await e.json();O(t.qrDataUrl),M(t.secret),setTimeout(()=>D.current?.focus(),100)},et=async e=>{if(6!==e.length)return;P(!0),I("");let t=await fetch((0,m.api)("/api/auth/totp/verify"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,action:"enable"})}),s=await t.json();P(!1),s.success?(R(!0),k(!1),O(""),M(""),z("")):(I(s.error||"Invalid code"),z(""),D.current?.focus())},es=async()=>{confirm("Disable 2FA? You will need to set it up again to use terminals.")&&(await fetch((0,m.api)("/api/auth/totp/setup"),{method:"POST"}),R(!1),k(!1))};return(0,t.jsxs)("div",{className:"p-6 max-w-3xl",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold",children:"Settings"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm mt-1",children:"Configure Spaces"})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[e&&(0,t.jsxs)("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg p-5",children:[(0,t.jsxs)("h3",{className:"font-semibold flex items-center gap-2 mb-3",children:[(0,t.jsx)(c.Shield,{className:"w-4 h-4"}),"Terminal Security"]}),Q?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-zinc-400",children:[(0,t.jsx)(o.Loader2,{className:"w-4 h-4 animate-spin"}),"Loading..."]}):g?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.CheckCircle2,{className:"w-5 h-5 text-green-500"}),(0,t.jsx)("span",{className:"text-sm font-medium text-green-500",children:"2FA Enabled"})]}),(0,t.jsx)("p",{className:"text-xs text-zinc-500",children:"Two-factor authentication is required at login. TOTP is managed through the login flow. Contact an admin to reset your 2FA if needed."})]}):w&&!T?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.CheckCircle2,{className:"w-5 h-5 text-green-500"}),(0,t.jsx)("span",{className:"text-sm font-medium text-green-500",children:"2FA Enabled"})]}),(0,t.jsx)("p",{className:"text-xs text-zinc-500",children:"Two-factor authentication is required each time you open a terminal session. Tokens are valid for 8 hours."}),(0,t.jsx)("button",{onClick:es,className:"text-xs text-zinc-500 hover:text-red-400 transition-colors",children:"Disable 2FA"})]}):T?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("p",{className:"text-sm text-zinc-400",children:"Scan this QR code with your authenticator app (Google Authenticator, Authy, etc.)"}),C?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,t.jsx)("div",{className:"bg-white p-3 rounded-lg",children:(0,t.jsx)("img",{src:C,alt:"TOTP QR Code",width:200,height:200})}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("p",{className:"text-[10px] text-zinc-600 mb-1",children:"Manual entry key:"}),(0,t.jsx)("code",{className:"text-xs bg-zinc-800 px-2 py-1 rounded font-mono select-all",children:E})]})]}):(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)(o.Loader2,{className:"w-6 h-6 animate-spin text-zinc-400"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs text-zinc-400 block mb-1.5",children:"Enter the 6-digit code from your authenticator"}),(0,t.jsx)("input",{ref:D,type:"text",inputMode:"numeric",autoComplete:"one-time-code",placeholder:"000000",value:q,onChange:e=>{let t;z(t=e.target.value.replace(/\D/g,"").slice(0,6)),I(""),6===t.length&&et(t)},disabled:K,className:"w-40 px-3 py-2 text-lg font-mono tracking-[0.3em] text-center bg-zinc-800 border border-zinc-700 rounded-md focus:outline-none focus:border-indigo-500 text-white disabled:opacity-50"}),K&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-2 text-xs text-zinc-400",children:[(0,t.jsx)(o.Loader2,{className:"w-3 h-3 animate-spin"}),"Verifying..."]}),F&&(0,t.jsx)("p",{className:"text-xs text-red-400 mt-2",children:F})]}),(0,t.jsx)("button",{onClick:()=>{k(!1),O(""),M("")},className:"text-xs text-zinc-500 hover:text-white transition-colors",children:"Cancel"})]}):(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-sm text-zinc-400",children:"Two-factor authentication adds an extra layer of security to terminal access. You'll need an authenticator app to generate codes."}),(0,t.jsxs)("button",{onClick:ee,className:"flex items-center gap-2 px-4 py-2 text-sm bg-indigo-500 text-white rounded-md hover:bg-indigo-600",children:[(0,t.jsx)(c.Shield,{className:"w-4 h-4"}),"Set up 2FA"]})]})]}),(0,t.jsxs)("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg p-5",children:[(0,t.jsxs)("h3",{className:"font-semibold flex items-center gap-2 mb-3",children:[(0,t.jsx)(n.FolderOpen,{className:"w-4 h-4"}),"Data Source"]}),(0,t.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-muted-foreground text-xs",children:"Agent Data Directories"}),(0,t.jsxs)("div",{className:"font-mono text-xs mt-1 p-2 bg-zinc-50 dark:bg-zinc-800 rounded space-y-1",children:[(0,t.jsx)("p",{children:"~/.claude/"}),(0,t.jsx)("p",{children:"~/.codex/"}),(0,t.jsx)("p",{children:"~/.gemini/"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-muted-foreground text-xs",children:"Spaces Database"}),(0,t.jsx)("p",{className:"font-mono text-xs mt-1 p-2 bg-zinc-50 dark:bg-zinc-800 rounded",children:"~/.spaces/spaces.db"})]})]})]}),(0,t.jsxs)("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg p-5",children:[(0,t.jsxs)("h3",{className:"font-semibold flex items-center gap-2 mb-3",children:[(0,t.jsx)(p.FolderCode,{className:"w-4 h-4"}),"Development Directories"]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-3",children:"Restrict terminal pane creation to these project roots. Paths must be absolute."}),L.length>0&&(0,t.jsx)("div",{className:"space-y-1.5 mb-3",children:L.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-zinc-50 dark:bg-zinc-800 rounded-md group",children:[(0,t.jsx)(n.FolderOpen,{className:"w-3.5 h-3.5 text-amber-500/70 flex-shrink-0"}),(0,t.jsx)("span",{className:"font-mono text-xs flex-1 truncate",children:e}),(0,t.jsx)("button",{onClick:()=>{X(L.filter(t=>t!==e))},className:"text-zinc-400 hover:text-red-400 opacity-0 group-hover:opacity-100 transition-opacity",title:"Remove",children:(0,t.jsx)(d.X,{className:"w-3.5 h-3.5"})})]},e))}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"text",placeholder:"u">typeof navigator&&navigator.platform?.startsWith("Win")?"C:\\Users\\you\\projects":"/home/user/projects",value:_,onChange:e=>W(e.target.value),onKeyDown:e=>"Enter"===e.key&&Y(),className:"flex-1 px-3 py-1.5 text-sm bg-zinc-50 dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-md focus:outline-none focus:border-indigo-500 font-mono"}),(0,t.jsxs)("button",{onClick:Y,disabled:!_.trim()||!(_.trim().startsWith("/")||/^[A-Za-z]:[\\/]/.test(_.trim())),className:"flex items-center gap-1.5 px-3 py-1.5 text-sm bg-indigo-500 text-white rounded-md hover:bg-indigo-600 disabled:opacity-50",children:[(0,t.jsx)(h.Plus,{className:"w-3.5 h-3.5"}),"Add"]})]})]}),(0,t.jsxs)("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg p-5",children:[(0,t.jsxs)("h3",{className:"font-semibold flex items-center gap-2 mb-3",children:[(0,t.jsx)(a.RefreshCw,{className:"w-4 h-4"}),"Data Sync"]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-3",children:"Force a full re-scan of all agent sessions. This rebuilds the index from scratch."}),(0,t.jsxs)("button",{onClick:Z,disabled:v.isPending,className:"flex items-center gap-2 px-4 py-2 text-sm bg-indigo-500 text-white rounded-md hover:bg-indigo-600 disabled:opacity-50",children:[v.isPending?(0,t.jsx)(o.Loader2,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(a.RefreshCw,{className:"w-4 h-4"}),"Re-sync Now"]}),j&&(0,t.jsx)("p",{className:"text-xs text-green-600 mt-2",children:j})]}),(0,t.jsxs)("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg p-5",children:[(0,t.jsxs)("h3",{className:"font-semibold flex items-center gap-2 mb-3",children:[(0,t.jsx)(l.BarChart3,{className:"w-4 h-4"}),"Telemetry"]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-3",children:"Anonymous usage data helps us understand how Spaces is used and improve the product. No file paths, session content, or personal information is ever collected."}),H?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-zinc-400",children:[(0,t.jsx)(o.Loader2,{className:"w-4 h-4 animate-spin"}),"Loading..."]}):(0,t.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:!J,onChange:G,className:"w-4 h-4 rounded border-zinc-300 dark:border-zinc-700 text-indigo-500 focus:ring-indigo-500"}),(0,t.jsx)("span",{className:"text-sm",children:"Send anonymous usage data"})]})]}),(0,t.jsxs)("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg p-5",children:[(0,t.jsxs)("h3",{className:"font-semibold flex items-center gap-2 mb-3",children:[(0,t.jsx)(r.Settings,{className:"w-4 h-4"}),"About"]}),(0,t.jsxs)("div",{className:"text-sm space-y-1",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Version:"})," ",b||"..."]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Tier:"})," ",(0,t.jsx)("span",{className:"capitalize",children:x})]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Data access:"})," Read-only (never modifies agent data directories)"]}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs mt-2",children:"Spaces is an open-source agent workspace manager. All session data stays local on your machine."})]})]})]})]})}e.s(["default",()=>x])}]);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,71689,e=>{"use strict";let t=(0,e.i(75254).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",()=>t],71689)},68054,e=>{"use strict";let t=(0,e.i(75254).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],68054)},43531,e=>{"use strict";let t=(0,e.i(75254).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",()=>t],43531)},31278,e=>{"use strict";let t=(0,e.i(75254).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>t],31278)},37727,e=>{"use strict";let t=(0,e.i(75254).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",()=>t],37727)},88699,e=>{"use strict";let t=(0,e.i(75254).default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["Pencil",()=>t],88699)},73359,e=>{"use strict";let t={shell:{id:"shell",name:"Shell",command:"",resumeFlag:"",supportsResume:!1,color:"#71717a",description:"Plain terminal shell"},claude:{id:"claude",name:"Claude Code",command:"claude",resumeFlag:"--resume",supportsResume:!0,color:"#d97706",description:"Anthropic Claude Code CLI"},codex:{id:"codex",name:"Codex CLI",command:"codex",resumeFlag:"resume",supportsResume:!0,color:"#10b981",description:"OpenAI Codex CLI"},gemini:{id:"gemini",name:"Gemini CLI",command:"gemini",resumeFlag:"--resume",supportsResume:!0,color:"#3b82f6",description:"Google Gemini CLI"},aider:{id:"aider",name:"Aider",command:"aider",resumeFlag:"",supportsResume:!1,color:"#8b5cf6",description:"AI pair programming in your terminal"},custom:{id:"custom",name:"Custom",command:"",resumeFlag:"",supportsResume:!1,color:"#ec4899",description:"Custom command"}},s=Object.values(t);e.s(["AGENT_LIST",0,s,"AGENT_TYPES",0,t])},34623,e=>{"use strict";var t=e.i(18050),s=e.i(71645),r=e.i(31278),a=e.i(39616),n=e.i(18566),i=e.i(9165),c=e.i(29320);let l="spaces-terminal-token";function o({children:e}){let o=(0,n.useRouter)(),{isDesktop:d,basePath:u}=(0,c.useTier)(),[m,x]=(0,s.useState)("loading"),[h,p]=(0,s.useState)(""),[f,g]=(0,s.useState)(""),[b,y]=(0,s.useState)(""),[w,k]=(0,s.useState)(!1),j=(0,s.useRef)(null),N=`${u}/spaces_icon.png`;(0,s.useEffect)(()=>{if(d){p("desktop-local"),x("authorized");return}function e(){let e=sessionStorage.getItem(l);if(e){p(e),x("authorized");return}fetch((0,i.api)("/api/auth/totp/status")).then(e=>e.json()).then(e=>{e.enabled?(x("prompt"),setTimeout(()=>j.current?.focus(),100)):x("not-setup")}).catch(()=>x("not-setup"))}fetch((0,i.api)("/api/auth/me")).then(t=>{if(t.ok){p("session-auth"),x("authorized");return}return e()}).catch(()=>e())},[d]);let v=(0,s.useCallback)(async e=>{if(6!==e.length)return;k(!0),y("");let t=await fetch((0,i.api)("/api/auth/totp/verify"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,action:"verify"})}),s=await t.json();k(!1),s.success&&s.terminalToken?(sessionStorage.setItem(l,s.terminalToken),p(s.terminalToken),x("authorized")):(y(s.error||"Invalid code"),g(""),j.current?.focus())},[]);return"loading"===m?(0,t.jsx)("div",{className:"flex items-center justify-center h-screen bg-zinc-950",children:(0,t.jsx)(r.Loader2,{className:"w-6 h-6 animate-spin text-indigo-500"})}):"authorized"===m?(0,t.jsx)(t.Fragment,{children:e(h)}):"not-setup"===m?(0,t.jsx)("div",{className:"flex items-center justify-center h-screen bg-zinc-950",children:(0,t.jsxs)("div",{className:"text-center space-y-4 max-w-sm",children:[(0,t.jsx)("img",{src:N,alt:"Spaces",className:"w-12 h-12 mx-auto opacity-40"}),(0,t.jsx)("h2",{className:"text-lg font-semibold text-white",children:"2FA Required"}),(0,t.jsx)("p",{className:"text-sm text-zinc-400",children:"Two-factor authentication must be set up before you can use terminals."}),(0,t.jsxs)("button",{onClick:()=>o.push("/settings"),className:"inline-flex items-center gap-2 px-4 py-2 text-sm bg-indigo-600 text-white rounded-md hover:bg-indigo-500",children:[(0,t.jsx)(a.Settings,{className:"w-4 h-4"}),"Go to Settings"]})]})}):(0,t.jsx)("div",{className:"flex items-center justify-center h-screen bg-zinc-950",children:(0,t.jsxs)("div",{className:"text-center space-y-4 max-w-sm",children:[(0,t.jsx)("img",{src:N,alt:"Spaces",className:"w-12 h-12 mx-auto"}),(0,t.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Terminal Verification"}),(0,t.jsx)("p",{className:"text-sm text-zinc-400",children:"Enter the 6-digit code from your authenticator app."}),(0,t.jsxs)("div",{children:[(0,t.jsx)("input",{ref:j,type:"text",inputMode:"numeric",autoComplete:"one-time-code",placeholder:"000000",value:f,onChange:e=>{let t;g(t=e.target.value.replace(/\D/g,"").slice(0,6)),y(""),6===t.length&&v(t)},disabled:w,className:"w-48 px-3 py-3 text-2xl font-mono tracking-[0.4em] text-center bg-zinc-800 border border-zinc-700 rounded-lg focus:outline-none focus:border-indigo-500 text-white disabled:opacity-50",autoFocus:!0}),w&&(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 mt-3 text-xs text-zinc-400",children:[(0,t.jsx)(r.Loader2,{className:"w-3 h-3 animate-spin"}),"Verifying..."]}),b&&(0,t.jsx)("p",{className:"text-sm text-red-400 mt-3",children:b})]}),(0,t.jsx)("p",{className:"text-[11px] text-zinc-600",children:"Token is valid for 8 hours after verification."})]})})}e.s(["TotpGate",()=>o])},24134,e=>{"use strict";var t=e.i(47167),s=e.i(18050),r=e.i(71645),a=e.i(74080),n=e.i(37727),i=e.i(88699),c=e.i(43531),l=e.i(75254);let o=(0,l.default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),d=(0,l.default)("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]),u=(0,l.default)("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]),m=(0,l.default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);var x=e.i(48256),h=e.i(61911),p=e.i(75157),f=e.i(73359);let g=t.default.env.NEXT_PUBLIC_WS_PATH;function b({pane:t,onClose:l,onUpdate:b,isMaximized:y,onToggleMaximize:w,onPopout:k,isPopout:j,terminalToken:N,workspaceCollaboration:v}){let C=(0,r.useRef)(null),z=(0,r.useRef)(null),S=(0,r.useRef)(null),T=(0,r.useRef)(null),[R,A]=(0,r.useState)(!1),[P,E]=(0,r.useState)(!1),[I,M]=(0,r.useState)(t.title),[F,L]=(0,r.useState)(!1),[$,G]=(0,r.useState)({x:0,y:0}),O=(0,r.useRef)(null),q=(0,r.useRef)(null),[B,_]=(0,r.useState)(!1),J=(0,r.useRef)(t);J.current=t;let W=(0,r.useRef)(b);W.current=b;let H=(0,r.useRef)(N);H.current=N;let U=(0,r.useRef)(!1),Y=(0,r.useRef)(!1),D=(0,r.useRef)(null),V=(0,r.useRef)(0),K=(0,r.useCallback)(async()=>{if(!C.current)return;J.current,Y.current=!1,V.current=0;let{Terminal:t}=await e.A(16049),{FitAddon:s}=await e.A(59439),{WebLinksAddon:r}=await e.A(16091);z.current&&z.current.dispose();let a=new t({cursorBlink:!0,fontSize:13,fontFamily:"'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, monospace",theme:{background:"#0a0a0a",foreground:"#e4e4e7",cursor:"#6366f1",selectionBackground:"#6366f133",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#fafafa"},allowProposedApi:!0}),n=new s,i=new r;a.loadAddon(n),a.loadAddon(i),await new Promise(e=>requestAnimationFrame(()=>{if(C.current){a.open(C.current);try{n.fit()}catch{}}e()})),z.current=a,T.current=n;let c=()=>{try{n.fit()}catch{}};requestAnimationFrame(()=>requestAnimationFrame(c)),setTimeout(c,300);let l=()=>{let e,t,s,r,n;if(Y.current)return;V.current>0&&(a.write("\x1b[2J\x1b[H"),a.clear());let i=new WebSocket((t=new URLSearchParams({paneId:(e=J.current).id,cwd:e.cwd,agentType:e.agentType||"shell",cols:String(a.cols),rows:String(a.rows)}),e.claudeSessionId&&t.set("agentSession",e.claudeSessionId),e.customCommand&&t.set("customCommand",e.customCommand),e.nodeId&&t.set("nodeId",e.nodeId),(s=H.current)&&t.set("terminalToken",s),r=g||"/ws",n="https:"===location.protocol?"wss:":"ws:",`${n}//${location.host}${r}?${t}`));S.current=i,i.onopen=()=>{A(!0),_(!1),U.current=!1,V.current=0,setTimeout(()=>{if(T.current)try{T.current.fit()}catch{}},150)},i.onmessage=e=>{try{let t=JSON.parse(e.data);if("data"===t.type)a.write(t.data);else if("exit"===t.type){_(!0),U.current=!0;let e=t.reason?` — ${t.reason}`:"";a.write(`\r
|
|
2
|
+
\x1b[90m[Process exited with code ${t.exitCode}${e}]\x1b[0m\r
|
|
3
|
+
`)}else"error"===t.type?a.write(`\r
|
|
4
|
+
\x1b[31m${t.data}\x1b[0m\r
|
|
5
|
+
`):"session-detected"===t.type&&W.current(J.current.id,{claudeSessionId:t.sessionId})}catch{}},i.onclose=()=>{if(A(!1),!U.current&&!Y.current){let e=V.current;if(e<20){let t=Math.min(1e3*Math.pow(1.5,e),3e4);V.current=e+1,D.current=setTimeout(l,t)}}},i.onerror=()=>{A(!1)}};a.onData(e=>{S.current?.readyState===WebSocket.OPEN&&S.current.send(JSON.stringify({type:"data",data:e}))}),a.onResize(({cols:e,rows:t})=>{S.current?.readyState===WebSocket.OPEN&&S.current.send(JSON.stringify({type:"resize",cols:e,rows:t}))}),l()},[]);(0,r.useEffect)(()=>(K(),()=>{Y.current=!0,D.current&&clearTimeout(D.current),S.current?.close(),z.current?.dispose()}),[K]),(0,r.useEffect)(()=>{let e,t=new ResizeObserver(()=>{cancelAnimationFrame(e),e=requestAnimationFrame(()=>{if(T.current)try{T.current.fit()}catch{}})});return C.current&&t.observe(C.current),()=>{cancelAnimationFrame(e),t.disconnect()}},[]),(0,r.useEffect)(()=>{setTimeout(()=>{if(T.current)try{T.current.fit()}catch{}},50)},[y]);let X=()=>{b(t.id,{title:I}),E(!1)};return(0,r.useEffect)(()=>{if(!F)return;let e=e=>{let t=e.target;O.current&&!O.current.contains(t)&&q.current&&!q.current.contains(t)&&L(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[F]),(0,s.jsxs)("div",{className:(0,p.cn)("flex flex-col border rounded-lg overflow-hidden",y?"fixed inset-2 z-50":"","border-zinc-700"),style:{borderColor:`${t.color}60`},children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 text-xs select-none flex-shrink-0",style:{backgroundColor:`${t.color}60`},children:[(0,s.jsxs)("div",{ref:O,className:"flex-shrink-0",children:[(0,s.jsx)("button",{onClick:e=>{let t=e.currentTarget.getBoundingClientRect();G({x:t.left,y:t.bottom+6}),L(!F)},className:"w-3 h-3 rounded-full hover:ring-2 hover:ring-zinc-500 ring-offset-1 ring-offset-zinc-900 transition-shadow cursor-pointer",style:{backgroundColor:t.color},title:"Change color"}),F&&(0,a.createPortal)((0,s.jsx)("div",{ref:q,className:"fixed z-[9999] bg-zinc-800 border border-zinc-600 rounded-xl p-3 shadow-2xl",style:{left:$.x,top:$.y},children:(0,s.jsx)("div",{className:"grid grid-cols-4 gap-2.5",style:{width:132},children:["#ef4444","#f97316","#f59e0b","#eab308","#84cc16","#22c55e","#14b8a6","#06b6d4","#3b82f6","#6366f1","#8b5cf6","#a855f7","#d946ef","#ec4899","#f43f5e","#78716c"].map(e=>(0,s.jsx)("button",{onClick:()=>{b(t.id,{color:e}),L(!1)},className:`w-7 h-7 rounded-full border-2 transition-all hover:scale-110 ${t.color===e?"border-white scale-110 shadow-lg":"border-transparent hover:border-zinc-500"}`,style:{backgroundColor:e}},e))})}),document.body)]}),P?(0,s.jsxs)("div",{className:"flex items-center gap-1 flex-1",children:[(0,s.jsx)("input",{autoFocus:!0,value:I,onChange:e=>M(e.target.value),onKeyDown:e=>{"Enter"===e.key&&X(),"Escape"===e.key&&(M(t.title),E(!1))},className:"flex-1 bg-transparent border border-zinc-600 rounded px-1.5 py-0.5 text-xs focus:outline-none focus:border-indigo-400"}),(0,s.jsx)("button",{onClick:X,className:"text-green-400 hover:text-green-300",children:(0,s.jsx)(c.Check,{className:"w-3 h-3"})})]}):(0,s.jsxs)("div",{className:"flex items-center gap-1 flex-1 min-w-0 group/title",children:[(0,s.jsx)("span",{onDoubleClick:()=>E(!0),className:"truncate text-zinc-300 font-medium cursor-default",children:t.title}),(0,s.jsx)("button",{onClick:()=>E(!0),className:"text-zinc-600 hover:text-zinc-300 opacity-0 group-hover/title:opacity-100 transition-opacity flex-shrink-0",title:"Rename",children:(0,s.jsx)(i.Pencil,{className:"w-2.5 h-2.5"})})]}),(0,s.jsx)("span",{className:"text-[10px] text-zinc-500 truncate max-w-[120px]",title:t.cwd,children:t.cwd.split(/[/\\]/).pop()}),t.agentType&&"shell"!==t.agentType&&(0,s.jsx)("span",{className:"text-[9px] px-1.5 py-0.5 rounded font-medium",style:{backgroundColor:`${f.AGENT_TYPES[t.agentType]?.color||"#6366f1"}20`,color:f.AGENT_TYPES[t.agentType]?.color||"#6366f1"},children:f.AGENT_TYPES[t.agentType]?.name||t.agentType}),t.nodeId&&(0,s.jsxs)("span",{className:"text-[9px] px-1.5 py-0.5 rounded font-medium bg-blue-500/10 text-blue-400 flex items-center gap-0.5",children:[(0,s.jsx)(x.Globe,{className:"w-2.5 h-2.5"}),"remote"]}),v&&"shell"!==t.agentType&&(0,s.jsx)("button",{onClick:()=>{let e=!t.isCollaborating;b(t.id,{isCollaborating:e}),S.current?.readyState===WebSocket.OPEN&&S.current.send(JSON.stringify({type:"collab-toggle",isCollaborating:e}))},className:`transition-colors ${t.isCollaborating?"text-indigo-400 hover:text-indigo-300":"text-zinc-600 hover:text-zinc-400"}`,title:t.isCollaborating?"Collaborating — click to opt out":"Not collaborating — click to opt in",children:(0,s.jsx)(h.Users,{className:"w-3 h-3"})}),!R&&!B&&(0,s.jsx)("span",{className:"text-[10px] text-yellow-500",children:"connecting..."}),B&&(0,s.jsx)("button",{onClick:()=>{Y.current=!0,D.current&&clearTimeout(D.current),S.current?.close(),z.current?.dispose(),_(!1),U.current=!1,setTimeout(K,100)},className:"text-zinc-400 hover:text-white",title:"Restart",children:(0,s.jsx)(o,{className:"w-3 h-3"})}),!j&&k&&(0,s.jsx)("button",{onClick:()=>{k&&(Y.current=!0,D.current&&clearTimeout(D.current),S.current?.close(),z.current?.dispose(),k(t.id))},className:"text-zinc-400 hover:text-white",title:"Pop out to new window",children:(0,s.jsx)(m,{className:"w-3 h-3"})}),(0,s.jsx)("button",{onClick:()=>w(t.id),className:"text-zinc-400 hover:text-white",title:y?"Restore":"Maximize",children:y?(0,s.jsx)(u,{className:"w-3 h-3"}):(0,s.jsx)(d,{className:"w-3 h-3"})}),(0,s.jsx)("button",{onClick:()=>{confirm("Close this terminal?")&&l(t.id)},className:"text-zinc-400 hover:text-red-400",title:"Close",children:(0,s.jsx)(n.X,{className:"w-3 h-3"})})]}),(0,s.jsx)("div",{ref:C,className:"flex-1 bg-[#0a0a0a]",style:{minHeight:y?"calc(100vh - 100px)":"300px"}})]})}e.s(["TerminalPane",()=>b],24134)},63209,e=>{"use strict";let t=(0,e.i(75254).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",()=>t],63209)},10160,e=>{"use strict";var t=e.i(18050),s=e.i(71645),r=e.i(18566),a=e.i(31278),n=e.i(71689),i=e.i(48256),c=e.i(68054),l=e.i(63209),o=e.i(24134),d=e.i(34623),u=e.i(9165);function m({params:e}){return(0,t.jsx)(d.TotpGate,{children:s=>(0,t.jsx)(x,{params:e,terminalToken:s})})}function x({params:e,terminalToken:d}){let m=(0,r.useRouter)(),[x,h]=(0,s.useState)(null),[p,f]=(0,s.useState)(null),[g,b]=(0,s.useState)([]),[y,w]=(0,s.useState)(""),[k,j]=(0,s.useState)("#6366f1"),[N,v]=(0,s.useState)(""),[C,z]=(0,s.useState)(!0),[S,T]=(0,s.useState)(null),[R,A]=(0,s.useState)(null);(0,s.useEffect)(()=>{e.then(e=>{h(e.nodeId),f(e.workspaceId)})},[e]),(0,s.useEffect)(()=>{x&&p&&Promise.all([fetch((0,u.api)(`/api/network/proxy/${x}/workspaces/${p}`)).then(e=>{if(!e.ok)throw Error(`Failed to fetch workspace (${e.status})`);return e.json()}),fetch((0,u.api)(`/api/network/proxy/${x}/workspaces`)).then(e=>{if(!e.ok)throw Error(`Failed to fetch workspaces (${e.status})`);return e.json()})]).then(([e,t])=>{b((e.panes||[]).map(e=>({...e,nodeId:x,isPopout:!!e.isPopout})));let s=t.workspaces?.find(e=>String(e.id)===p);s&&(w(s.name),j(s.color),v(s.nodeName||"")),z(!1)}).catch(e=>{T(e.message),z(!1)})},[x,p]);let P=(0,s.useCallback)(()=>{},[]),E=(0,s.useCallback)(()=>{},[]),I=(0,s.useCallback)(e=>{A(t=>t===e?null:e)},[]);if(C)return(0,t.jsx)("div",{className:"flex items-center justify-center h-screen bg-zinc-950",children:(0,t.jsx)(a.Loader2,{className:"w-6 h-6 animate-spin text-indigo-500"})});if(S)return(0,t.jsxs)("div",{className:"h-screen flex flex-col items-center justify-center bg-zinc-950 text-zinc-100",children:[(0,t.jsx)(l.AlertCircle,{className:"w-8 h-8 text-red-500 mb-3"}),(0,t.jsx)("p",{className:"text-sm text-zinc-400 mb-4",children:S}),(0,t.jsxs)("button",{onClick:()=>m.push("/terminal"),className:"flex items-center gap-2 px-4 py-2 text-sm border border-zinc-700 text-zinc-400 rounded-lg hover:text-white hover:border-zinc-500 transition-colors",children:[(0,t.jsx)(n.ArrowLeft,{className:"w-4 h-4"}),"Back to Spaces"]})]});let M=g.filter(e=>!e.isPopout);return(0,t.jsxs)("div",{className:"h-screen flex flex-col bg-zinc-950 text-zinc-100",children:[(0,t.jsx)("div",{className:"flex items-center justify-between px-4 py-2 border-b border-zinc-800 flex-shrink-0",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("button",{onClick:()=>m.push("/terminal"),className:"p-1.5 -ml-1 text-zinc-500 hover:text-white hover:bg-zinc-800 rounded-md transition-colors",title:"Back to Spaces",children:(0,t.jsx)(n.ArrowLeft,{className:"w-4 h-4"})}),(0,t.jsx)("div",{className:"w-px h-4 bg-zinc-800"}),(0,t.jsx)(i.Globe,{className:"w-3.5 h-3.5 text-zinc-500"}),(0,t.jsx)("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:k}}),(0,t.jsx)("span",{className:"text-sm font-semibold",children:y||"Remote Workspace"}),N&&(0,t.jsxs)("span",{className:"text-xs text-zinc-500",children:["on ",N]}),(0,t.jsxs)("span",{className:"text-[11px] text-zinc-500",children:[M.length," pane",1!==M.length?"s":""]})]})}),0===M.length?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center space-y-2",children:[(0,t.jsx)(c.Terminal,{className:"w-10 h-10 text-zinc-700 mx-auto"}),(0,t.jsx)("p",{className:"text-zinc-500 text-sm",children:"This remote workspace has no panes."})]})}):(0,t.jsx)("div",{className:"flex-1 p-2 gap-2 overflow-auto",style:{display:"grid",gridTemplateColumns:1===M.length?"1fr":M.length<=2||M.length<=4?"repeat(2, 1fr)":"repeat(3, 1fr)",gridAutoRows:M.length<=2?"1fr":"minmax(300px, 1fr)"},children:M.map(e=>R&&R!==e.id?null:(0,t.jsx)(o.TerminalPane,{pane:e,onClose:P,onUpdate:E,isMaximized:R===e.id,onToggleMaximize:I,terminalToken:d},e.id))})]})}e.s(["default",()=>m])},16049,e=>{e.v(t=>Promise.all(["static/chunks/e40d2bd3b4ce8192.js"].map(t=>e.l(t))).then(()=>t(44908)))},59439,e=>{e.v(t=>Promise.all(["static/chunks/af8bfb72187b7cbf.js"].map(t=>e.l(t))).then(()=>t(93309)))},16091,e=>{e.v(t=>Promise.all(["static/chunks/9768207ca0a51abd.js"].map(t=>e.l(t))).then(()=>t(52216)))}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,3116,e=>{"use strict";let t=(0,e.i(75254).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",()=>t],3116)},43531,e=>{"use strict";let t=(0,e.i(75254).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",()=>t],43531)},37727,e=>{"use strict";let t=(0,e.i(75254).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",()=>t],37727)},88699,e=>{"use strict";let t=(0,e.i(75254).default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["Pencil",()=>t],88699)},31278,e=>{"use strict";let t=(0,e.i(75254).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>t],31278)},66027,54616,e=>{"use strict";let t;var s=e.i(75555),r=e.i(40143),a=e.i(86491),i=e.i(15823),n=e.i(93803),o=e.i(19273),l=e.i(80166),c=class extends i.Subscribable{constructor(e,t){super(),this.options=t,this.#e=e,this.#t=null,this.#s=(0,n.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#e;#r=void 0;#a=void 0;#i=void 0;#n;#o;#s;#t;#l;#c;#u;#d;#h;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#r.addObserver(this),u(this.#r,this.options)?this.#f():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return d(this.#r,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return d(this.#r,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#y(),this.#g(),this.#r.removeObserver(this)}setOptions(e){let t=this.options,s=this.#r;if(this.options=this.#e.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,o.resolveEnabled)(this.options.enabled,this.#r))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#b(),this.#r.setOptions(this.options),t._defaulted&&!(0,o.shallowEqualObjects)(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#r,observer:this});let r=this.hasListeners();r&&h(this.#r,s,this.options,t)&&this.#f(),this.updateResult(),r&&(this.#r!==s||(0,o.resolveEnabled)(this.options.enabled,this.#r)!==(0,o.resolveEnabled)(t.enabled,this.#r)||(0,o.resolveStaleTime)(this.options.staleTime,this.#r)!==(0,o.resolveStaleTime)(t.staleTime,this.#r))&&this.#v();let a=this.#j();r&&(this.#r!==s||(0,o.resolveEnabled)(this.options.enabled,this.#r)!==(0,o.resolveEnabled)(t.enabled,this.#r)||a!==this.#p)&&this.#k(a)}getOptimisticResult(e){var t,s;let r=this.#e.getQueryCache().build(this.#e,e),a=this.createResult(r,e);return t=this,s=a,(0,o.shallowEqualObjects)(t.getCurrentResult(),s)||(this.#i=a,this.#o=this.options,this.#n=this.#r.state),a}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(e,s)=>(this.trackProp(s),t?.(s),"promise"===s&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#s.status||this.#s.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,s))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#r}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),s=this.#e.getQueryCache().build(this.#e,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#f(e){this.#b();let t=this.#r.fetch(this.options,e);return e?.throwOnError||(t=t.catch(o.noop)),t}#v(){this.#y();let e=(0,o.resolveStaleTime)(this.options.staleTime,this.#r);if(o.isServer||this.#i.isStale||!(0,o.isValidTimeout)(e))return;let t=(0,o.timeUntilStale)(this.#i.dataUpdatedAt,e);this.#d=l.timeoutManager.setTimeout(()=>{this.#i.isStale||this.updateResult()},t+1)}#j(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#r):this.options.refetchInterval)??!1}#k(e){this.#g(),this.#p=e,!o.isServer&&!1!==(0,o.resolveEnabled)(this.options.enabled,this.#r)&&(0,o.isValidTimeout)(this.#p)&&0!==this.#p&&(this.#h=l.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||s.focusManager.isFocused())&&this.#f()},this.#p))}#x(){this.#v(),this.#k(this.#j())}#y(){this.#d&&(l.timeoutManager.clearTimeout(this.#d),this.#d=void 0)}#g(){this.#h&&(l.timeoutManager.clearInterval(this.#h),this.#h=void 0)}createResult(e,t){let s,r=this.#r,i=this.options,l=this.#i,c=this.#n,d=this.#o,m=e!==r?e.state:this.#a,{state:f}=e,x={...f},y=!1;if(t._optimisticResults){let s=this.hasListeners(),n=!s&&u(e,t),o=s&&h(e,r,t,i);(n||o)&&(x={...x,...(0,a.fetchState)(f.data,e.options)}),"isRestoring"===t._optimisticResults&&(x.fetchStatus="idle")}let{error:g,errorUpdatedAt:b,status:v}=x;s=x.data;let j=!1;if(void 0!==t.placeholderData&&void 0===s&&"pending"===v){let e;l?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(e=l.data,j=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,void 0!==e&&(v="success",s=(0,o.replaceData)(l?.data,e,t),y=!0)}if(t.select&&void 0!==s&&!j)if(l&&s===c?.data&&t.select===this.#l)s=this.#c;else try{this.#l=t.select,s=t.select(s),s=(0,o.replaceData)(l?.data,s,t),this.#c=s,this.#t=null}catch(e){this.#t=e}this.#t&&(g=this.#t,s=this.#c,b=Date.now(),v="error");let k="fetching"===x.fetchStatus,w="pending"===v,N="error"===v,C=w&&k,S=void 0!==s,R={status:v,fetchStatus:x.fetchStatus,isPending:w,isSuccess:"success"===v,isError:N,isInitialLoading:C,isLoading:C,data:s,dataUpdatedAt:x.dataUpdatedAt,error:g,errorUpdatedAt:b,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:x.dataUpdateCount>0||x.errorUpdateCount>0,isFetchedAfterMount:x.dataUpdateCount>m.dataUpdateCount||x.errorUpdateCount>m.errorUpdateCount,isFetching:k,isRefetching:k&&!w,isLoadingError:N&&!S,isPaused:"paused"===x.fetchStatus,isPlaceholderData:y,isRefetchError:N&&S,isStale:p(e,t),refetch:this.refetch,promise:this.#s,isEnabled:!1!==(0,o.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==R.data,s="error"===R.status&&!t,a=e=>{s?e.reject(R.error):t&&e.resolve(R.data)},i=()=>{a(this.#s=R.promise=(0,n.pendingThenable)())},o=this.#s;switch(o.status){case"pending":e.queryHash===r.queryHash&&a(o);break;case"fulfilled":(s||R.data!==o.value)&&i();break;case"rejected":s&&R.error===o.reason||i()}}return R}updateResult(){let e=this.#i,t=this.createResult(this.#r,this.options);if(this.#n=this.#r.state,this.#o=this.options,void 0!==this.#n.data&&(this.#u=this.#r),(0,o.shallowEqualObjects)(t,e))return;this.#i=t;let s=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.#m.size)return!0;let r=new Set(s??this.#m);return this.options.throwOnError&&r.add("error"),Object.keys(this.#i).some(t=>this.#i[t]!==e[t]&&r.has(t))};this.#w({listeners:s()})}#b(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#r)return;let t=this.#r;this.#r=e,this.#a=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#w(e){r.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#i)}),this.#e.getQueryCache().notify({query:this.#r,type:"observerResultsUpdated"})})}};function u(e,t){return!1!==(0,o.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&d(e,t,t.refetchOnMount)}function d(e,t,s){if(!1!==(0,o.resolveEnabled)(t.enabled,e)&&"static"!==(0,o.resolveStaleTime)(t.staleTime,e)){let r="function"==typeof s?s(e):s;return"always"===r||!1!==r&&p(e,t)}return!1}function h(e,t,s,r){return(e!==t||!1===(0,o.resolveEnabled)(r.enabled,e))&&(!s.suspense||"error"!==e.state.status)&&p(e,s)}function p(e,t){return!1!==(0,o.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,o.resolveStaleTime)(t.staleTime,e))}e.i(47167);var m=e.i(71645),f=e.i(12598);e.i(18050);var x=m.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),y=m.createContext(!1);y.Provider;var g=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function b(e,t){return function(e,t,s){let a,i=m.useContext(y),n=m.useContext(x),l=(0,f.useQueryClient)(s),c=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(c);let u=l.getQueryCache().get(c.queryHash);if(c._optimisticResults=i?"isRestoring":"optimistic",c.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=c.staleTime;c.staleTime="function"==typeof t?(...s)=>e(t(...s)):e(t),"number"==typeof c.gcTime&&(c.gcTime=Math.max(c.gcTime,1e3))}a=u?.state.error&&"function"==typeof c.throwOnError?(0,o.shouldThrowError)(c.throwOnError,[u.state.error,u]):c.throwOnError,(c.suspense||c.experimental_prefetchInRender||a)&&!n.isReset()&&(c.retryOnMount=!1),m.useEffect(()=>{n.clearReset()},[n]);let d=!l.getQueryCache().get(c.queryHash),[h]=m.useState(()=>new t(l,c)),p=h.getOptimisticResult(c),b=!i&&!1!==e.subscribed;if(m.useSyncExternalStore(m.useCallback(e=>{let t=b?h.subscribe(r.notifyManager.batchCalls(e)):o.noop;return h.updateResult(),t},[h,b]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),m.useEffect(()=>{h.setOptions(c)},[c,h]),c?.suspense&&p.isPending)throw g(c,h,n);if((({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&void 0===e.data||(0,o.shouldThrowError)(s,[e.error,r])))({result:p,errorResetBoundary:n,throwOnError:c.throwOnError,query:u,suspense:c.suspense}))throw p.error;if(l.getDefaultOptions().queries?._experimental_afterQuery?.(c,p),c.experimental_prefetchInRender&&!o.isServer&&p.isLoading&&p.isFetching&&!i){let e=d?g(c,h,n):u?.promise;e?.catch(o.noop).finally(()=>{h.updateResult()})}return c.notifyOnChangeProps?p:h.trackResult(p)}(e,c,t)}e.s(["useQuery",()=>b],66027);var v=e.i(14272),j=i,k=class extends j.Subscribable{#e;#i=void 0;#N;#C;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#S()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,o.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#N,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,o.hashKey)(t.mutationKey)!==(0,o.hashKey)(this.options.mutationKey)?this.reset():this.#N?.state.status==="pending"&&this.#N.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#N?.removeObserver(this)}onMutationUpdate(e){this.#S(),this.#w(e)}getCurrentResult(){return this.#i}reset(){this.#N?.removeObserver(this),this.#N=void 0,this.#S(),this.#w()}mutate(e,t){return this.#C=t,this.#N?.removeObserver(this),this.#N=this.#e.getMutationCache().build(this.#e,this.options),this.#N.addObserver(this),this.#N.execute(e)}#S(){let e=this.#N?.state??(0,v.getDefaultState)();this.#i={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#w(e){r.notifyManager.batch(()=>{if(this.#C&&this.hasListeners()){let t=this.#i.variables,s=this.#i.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#C.onSuccess?.(e.data,t,s,r)}catch(e){Promise.reject(e)}try{this.#C.onSettled?.(e.data,null,t,s,r)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#C.onError?.(e.error,t,s,r)}catch(e){Promise.reject(e)}try{this.#C.onSettled?.(void 0,e.error,t,s,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#i)})})}};function w(e,t){let s=(0,f.useQueryClient)(t),[a]=m.useState(()=>new k(s,e));m.useEffect(()=>{a.setOptions(e)},[a,e]);let i=m.useSyncExternalStore(m.useCallback(e=>a.subscribe(r.notifyManager.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),n=m.useCallback((e,t)=>{a.mutate(e,t).catch(o.noop)},[a]);if(i.error&&(0,o.shouldThrowError)(a.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:n,mutateAsync:i.mutate}}e.s(["useMutation",()=>w],54616)},3999,e=>{"use strict";var t=e.i(66027),s=e.i(54616),r=e.i(12598),a=e.i(9165);function i(e={}){return(0,t.useQuery)({queryKey:["sessions",e],queryFn:async()=>{let t=new URLSearchParams;return e.projectId&&t.set("projectId",e.projectId),void 0!==e.starred&&t.set("starred",String(e.starred)),e.search&&t.set("search",e.search),e.agentType&&t.set("agentType",e.agentType),e.sortBy&&t.set("sortBy",e.sortBy),e.sortDir&&t.set("sortDir",e.sortDir),void 0!==e.offset&&t.set("offset",String(e.offset)),void 0!==e.limit&&t.set("limit",String(e.limit)),"all"===e.nodeFilter&&t.set("nodes","all"),(await fetch((0,a.api)(`/api/sessions?${t}`))).json()}})}function n(e){return(0,t.useQuery)({queryKey:["session",e],queryFn:async()=>{let t=await fetch((0,a.api)(`/api/sessions/${e}`));if(!t.ok)throw Error("Session not found");return t.json()},enabled:!!e})}function o(e,s=0,r=50,i){return(0,t.useQuery)({queryKey:["messages",e,s,r,i],queryFn:async()=>{let t=i?(0,a.api)(`/api/network/proxy/${i}/sessions/${e}/messages?offset=${s}&limit=${r}`):(0,a.api)(`/api/sessions/${e}/messages?offset=${s}&limit=${r}`);return(await fetch(t)).json()},enabled:!!e})}function l(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async e=>(await fetch((0,a.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"star"})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function c(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async({sessionId:e,notes:t})=>(await fetch((0,a.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"notes",notes:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["session"]})}})}function u(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async({sessionId:e,tagName:t})=>(await fetch((0,a.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"tag",tagName:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]}),e.invalidateQueries({queryKey:["tags"]})}})}function d(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async({sessionId:e,tagName:t})=>(await fetch((0,a.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"removeTag",tagName:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]}),e.invalidateQueries({queryKey:["tags"]})}})}function h(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async({sessionId:e,name:t})=>(await fetch((0,a.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"rename",name:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function p(){return(0,t.useQuery)({queryKey:["tags"],queryFn:async()=>(await fetch((0,a.api)("/api/tags"))).json()})}function m(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async e=>(await fetch((0,a.api)("/api/tags"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete",tagId:e})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["tags"]}),e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function f(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async({tagId:e,color:t})=>(await fetch((0,a.api)("/api/tags"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"updateColor",tagId:e,color:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["tags"]}),e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function x(){return(0,t.useQuery)({queryKey:["workspaces"],queryFn:async()=>(await fetch((0,a.api)("/api/workspaces"))).json()})}function y(){return(0,t.useQuery)({queryKey:["workspaces","remote"],queryFn:async()=>(await fetch((0,a.api)("/api/workspaces?nodes=all"))).json()})}function g(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async({workspaceId:e,sessionId:t,nodeId:s,title:r,cwd:i,agentType:n})=>{let o=await fetch((0,a.api)(`/api/workspaces/${e}/sessions`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t,nodeId:s,title:r,cwd:i,agentType:n})});if(!o.ok)throw Error("Failed to add session to workspace");return o.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["workspace-sessions"]}),e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function b(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async({workspaceId:e,sessionId:t})=>{let s=await fetch((0,a.api)(`/api/workspaces/${e}/sessions`),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t})});if(!s.ok)throw Error("Failed to remove session from workspace");return s.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["workspace-sessions"]}),e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function v(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async e=>(await fetch((0,a.api)("/api/bulk"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["tags"]})}})}function j(){return(0,t.useQuery)({queryKey:["projects"],queryFn:async()=>(await fetch((0,a.api)("/api/projects"))).json()})}function k(){return(0,t.useQuery)({queryKey:["analytics"],queryFn:async()=>(await fetch((0,a.api)("/api/analytics/overview"))).json()})}function w(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async()=>(await fetch((0,a.api)("/api/sync"),{method:"POST"})).json(),onSuccess:()=>{e.invalidateQueries()}})}e.s(["useAddSessionToWorkspace",()=>g,"useAddTag",()=>u,"useAnalytics",()=>k,"useBulkAction",()=>v,"useDeleteTag",()=>m,"useMessages",()=>o,"useProjects",()=>j,"useRemoteWorkspaces",()=>y,"useRemoveSessionFromWorkspace",()=>b,"useRemoveTag",()=>d,"useRenameSession",()=>h,"useSession",()=>n,"useSessions",()=>i,"useSync",()=>w,"useTags",()=>p,"useToggleStar",()=>l,"useUpdateNotes",()=>c,"useUpdateTagColor",()=>f,"useWorkspaces",()=>x])},71689,e=>{"use strict";let t=(0,e.i(75254).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",()=>t],71689)},7233,e=>{"use strict";let t=(0,e.i(75254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],7233)},27612,e=>{"use strict";let t=(0,e.i(75254).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",()=>t],27612)},70273,e=>{"use strict";let t=(0,e.i(75254).default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);e.s(["Star",()=>t],70273)},55716,e=>{"use strict";let t=(0,e.i(75254).default)("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]);e.s(["GitBranch",()=>t],55716)},88081,e=>{"use strict";let t=(0,e.i(75254).default)("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);e.s(["Hash",()=>t],88081)},86536,e=>{"use strict";let t=(0,e.i(75254).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",()=>t],86536)},14764,e=>{"use strict";let t=(0,e.i(75254).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["Send",()=>t],14764)},78894,e=>{"use strict";let t=(0,e.i(75254).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["AlertTriangle",()=>t],78894)},51975,e=>{"use strict";let t=(0,e.i(75254).default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);e.s(["Tag",()=>t],51975)},64659,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],64659)},63059,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],63059)},68054,e=>{"use strict";let t=(0,e.i(75254).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],68054)},74886,e=>{"use strict";let t=(0,e.i(75254).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",()=>t],74886)},55900,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);e.s(["ChevronUp",()=>t],55900)},98003,e=>{"use strict";var t=e.i(18050),s=e.i(75157);let r=["#ef4444","#f97316","#f59e0b","#eab308","#84cc16","#22c55e","#14b8a6","#06b6d4","#3b82f6","#6366f1","#8b5cf6","#a855f7","#d946ef","#ec4899","#f43f5e","#78716c"];function a({value:e,onChange:a,className:i}){return(0,t.jsx)("div",{className:(0,s.cn)("grid grid-cols-8 gap-1.5",i),children:r.map(r=>(0,t.jsx)("button",{onClick:()=>a(r),className:(0,s.cn)("w-6 h-6 rounded-full border-2 transition-transform hover:scale-110",e===r?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:r},title:r},r))})}e.s(["ColorPicker",()=>a])},91809,e=>{"use strict";var t=e.i(18050),s=e.i(71645),r=e.i(12598),a=e.i(18566),i=e.i(3999),n=e.i(46686),o=e.i(14764),l=e.i(31278),c=e.i(52044),u=e.i(68054),d=e.i(55900),h=e.i(64659),p=e.i(75157),m=e.i(9165),f=e.i(18789),x=e.i(42531);function y({sessionId:e,projectPath:r,onMessageSent:a}){let[i,n]=(0,s.useState)(""),[y,g]=(0,s.useState)(!1),[b,v]=(0,s.useState)([]),[j,k]=(0,s.useState)(""),[w,N]=(0,s.useState)(!0),[C,S]=(0,s.useState)(null),R=(0,s.useRef)(null),Q=(0,s.useRef)(null),T=(0,s.useRef)(null);(0,s.useEffect)(()=>{R.current&&(R.current.style.height="auto",R.current.style.height=`${Math.min(R.current.scrollHeight,200)}px`)},[i]),(0,s.useEffect)(()=>{Q.current&&(Q.current.scrollTop=Q.current.scrollHeight)},[j,b]);let z=(0,s.useCallback)(async()=>{if(!i.trim()||y)return;g(!0),v([]),k(""),S(null),N(!0);let t=new AbortController;T.current=t;try{let s=await fetch((0,m.api)(`/api/sessions/${e}/chat`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:i.trim(),cwd:r}),signal:t.signal});if(!s.ok){let e=await s.json();S(e.error||"Failed to send message"),g(!1);return}let o=s.body?.getReader();if(!o){S("No response stream"),g(!1);return}let l=new TextDecoder,c="",u="";for(n("");;){let{done:e,value:t}=await o.read();if(e)break;let s=(c+=l.decode(t,{stream:!0})).split("\n\n");for(let e of(c=s.pop()||"",s)){if(!e.startsWith("data: "))continue;let t=e.slice(6);try{let e=JSON.parse(t);if(v(t=>[...t,e]),"done"===e.type)a?.();else if("error"===e.type)S(t=>(t||"")+(e.text||""));else if("stderr"===e.type){let t=e.text||"";(t.includes("Error")||t.includes("error"))&&S(e=>(e||"")+t)}else if("assistant"===e.type){let t=e.message?.content||e.content;if(Array.isArray(t))for(let e of t)"text"===e.type&&e.text&&(u+=e.text,k(u))}else if("content_block_delta"===e.type)(e.content?.type==="text_delta"||e.text)&&(u+=e.content?.text||e.text||"",k(u));else if("text"===e.type)u+=e.text||"",k(u);else if("result"===e.type){if(!u){let t=e.result;"string"==typeof t&&(u=t,k(u))}a?.()}}catch{}}}}catch(e){"AbortError"!==e.name&&S(e.message||"Connection failed")}finally{g(!1),T.current=null}},[i,y,e,r,a]);return(0,t.jsxs)("div",{className:"border-t border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 flex-shrink-0",children:[(j||C||y)&&(0,t.jsxs)("div",{className:"border-b border-zinc-200 dark:border-zinc-800",children:[(0,t.jsxs)("button",{onClick:()=>N(!w),className:"w-full flex items-center gap-2 px-4 py-1.5 text-[11px] text-muted-foreground hover:text-foreground bg-zinc-50 dark:bg-zinc-900/50",children:[y?(0,t.jsx)(l.Loader2,{className:"w-3 h-3 animate-spin text-indigo-500"}):(0,t.jsx)(u.Terminal,{className:"w-3 h-3"}),(0,t.jsx)("span",{className:"font-medium",children:y?"Claude is responding...":"Response"}),w?(0,t.jsx)(h.ChevronDown,{className:"w-3 h-3 ml-auto"}):(0,t.jsx)(d.ChevronUp,{className:"w-3 h-3 ml-auto"})]}),w&&(0,t.jsxs)("div",{ref:Q,className:"max-h-64 overflow-y-auto px-4 py-3 text-sm",children:[C&&(0,t.jsx)("div",{className:"text-red-500 text-xs mb-2 bg-red-50 dark:bg-red-950/20 rounded px-3 py-2",children:C}),j&&(0,t.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none prose-pre:bg-zinc-100 dark:prose-pre:bg-zinc-800 prose-pre:text-xs",children:(0,t.jsx)(f.default,{remarkPlugins:[x.default],children:j})}),y&&!j&&!C&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground text-xs",children:[(0,t.jsx)(l.Loader2,{className:"w-3 h-3 animate-spin"}),"Waiting for Claude..."]})]})]}),(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsx)("div",{className:"flex items-end gap-2 max-w-4xl mx-auto",children:(0,t.jsxs)("div",{className:"flex-1 relative",children:[(0,t.jsx)("textarea",{ref:R,value:i,onChange:e=>n(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),z())},placeholder:y?"Claude is thinking...":"Send a message to Claude...",disabled:y,rows:1,className:(0,p.cn)("w-full resize-none rounded-lg border px-4 py-2.5 pr-12 text-sm bg-transparent","focus:outline-none focus:ring-2 focus:ring-indigo-400 focus:border-transparent","placeholder:text-muted-foreground/50","border-zinc-200 dark:border-zinc-700",y&&"opacity-50")}),(0,t.jsx)("div",{className:"absolute right-2 bottom-2",children:y?(0,t.jsx)("button",{onClick:()=>{T.current?.abort(),g(!1)},className:"p-1.5 rounded-md bg-red-500 text-white hover:bg-red-600 transition-colors",title:"Stop generation",children:(0,t.jsx)(c.Square,{className:"w-3.5 h-3.5"})}):(0,t.jsx)("button",{onClick:z,disabled:!i.trim(),className:(0,p.cn)("p-1.5 rounded-md transition-colors",i.trim()?"bg-indigo-500 text-white hover:bg-indigo-600":"bg-zinc-100 dark:bg-zinc-800 text-muted-foreground"),title:"Send (Enter)",children:(0,t.jsx)(o.Send,{className:"w-3.5 h-3.5"})})})]})}),(0,t.jsxs)("p",{className:"text-[10px] text-muted-foreground mt-1.5 text-center",children:["Enter to send, Shift+Enter for newline. Resumes this session via ",(0,t.jsx)("code",{className:"bg-zinc-100 dark:bg-zinc-800 px-1 rounded",children:"claude --resume"})]})]})]})}var g=e.i(51975),b=e.i(37727),v=e.i(7233),j=e.i(75254);let k=(0,j.default)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);var w=e.i(27612),N=e.i(98003);function C({sessionId:e,currentTags:r,tagObjects:a,compact:n}){let[o,l]=(0,s.useState)(!1),[c,u]=(0,s.useState)(""),[d,h]=(0,s.useState)(null),m=(0,s.useRef)(null),{data:f}=(0,i.useTags)(),x=(0,i.useAddTag)(),y=(0,i.useRemoveTag)(),j=(0,i.useDeleteTag)(),C=(0,i.useUpdateTagColor)();(0,s.useEffect)(()=>{let e=e=>{m.current&&!m.current.contains(e.target)&&(l(!1),h(null))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let S=(f||[]).filter(e=>!r.includes(e.name));return(0,t.jsxs)("div",{ref:m,className:"relative inline-block",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-wrap",children:[(a||[]).map(s=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium border",style:{backgroundColor:`${s.color}15`,borderColor:`${s.color}40`,color:s.color},children:[s.name,(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),y.mutate({sessionId:e,tagName:s.name})},className:"hover:opacity-70",children:(0,t.jsx)(b.X,{className:"w-2.5 h-2.5"})})]},s.id)),r.filter(e=>!a?.find(t=>t.name===e)).map(s=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium bg-indigo-50 dark:bg-indigo-950/50 text-indigo-600 dark:text-indigo-300 border border-indigo-200 dark:border-indigo-800",children:[s,(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),y.mutate({sessionId:e,tagName:s})},className:"hover:opacity-70",children:(0,t.jsx)(b.X,{className:"w-2.5 h-2.5"})})]},s)),(0,t.jsxs)("button",{onClick:()=>l(!o),className:(0,p.cn)("inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full text-[10px] text-muted-foreground hover:text-foreground hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",n&&"p-1"),children:[(0,t.jsx)(v.Plus,{className:"w-3 h-3"}),!n&&"tag"]})]}),o&&(0,t.jsxs)("div",{className:"absolute top-full left-0 mt-1 w-56 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg shadow-lg z-50 py-1",children:[(0,t.jsx)("div",{className:"px-2 py-1.5 border-b border-zinc-100 dark:border-zinc-800",children:(0,t.jsxs)("form",{onSubmit:t=>{t.preventDefault(),c.trim()&&(x.mutate({sessionId:e,tagName:c.trim()}),u(""))},className:"flex items-center gap-1",children:[(0,t.jsx)(g.Tag,{className:"w-3 h-3 text-muted-foreground flex-shrink-0"}),(0,t.jsx)("input",{type:"text",placeholder:"New tag name...",value:c,onChange:e=>u(e.target.value),className:"flex-1 text-xs bg-transparent focus:outline-none",autoFocus:!0}),c&&(0,t.jsx)("button",{type:"submit",className:"text-xs text-indigo-500 hover:text-indigo-600 font-medium",children:"Add"})]})}),S.length>0&&(0,t.jsx)("div",{className:"max-h-40 overflow-y-auto",children:S.map(s=>(0,t.jsxs)("div",{className:"group",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-zinc-50 dark:hover:bg-zinc-800/50",children:[(0,t.jsxs)("button",{onClick:()=>{x.mutate({sessionId:e,tagName:s.name})},className:"flex items-center gap-2 flex-1 text-left",children:[(0,t.jsx)("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:s.color}}),(0,t.jsx)("span",{className:"text-xs truncate",children:s.name})]}),(0,t.jsxs)("div",{className:"hidden group-hover:flex items-center gap-0.5",children:[(0,t.jsx)("button",{onClick:()=>h(d===s.id?null:s.id),className:"p-0.5 text-muted-foreground hover:text-foreground",title:"Change color",children:(0,t.jsx)(k,{className:"w-3 h-3"})}),(0,t.jsx)("button",{onClick:()=>{confirm(`Delete tag "${s.name}"?`)&&j.mutate(s.id)},className:"p-0.5 text-muted-foreground hover:text-red-500",title:"Delete tag",children:(0,t.jsx)(w.Trash2,{className:"w-3 h-3"})})]})]}),d===s.id&&(0,t.jsx)("div",{className:"px-3 py-2 bg-zinc-50 dark:bg-zinc-800/50",children:(0,t.jsx)(N.ColorPicker,{value:s.color,onChange:e=>{C.mutate({tagId:s.id,color:e}),h(null)}})})]},s.id))}),0===S.length&&!c&&(0,t.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:0===(f||[]).length?"No tags yet. Type to create one.":"All tags applied."})]})]})}var S=e.i(52008),R=e.i(43531);function Q({sessionId:e,currentWorkspaces:r=[],compact:a}){let[n,o]=(0,s.useState)(!1),l=(0,s.useRef)(null),{data:c}=(0,i.useWorkspaces)(),u=(0,i.useAddSessionToWorkspace)(),d=(0,i.useRemoveSessionFromWorkspace)();(0,s.useEffect)(()=>{let e=e=>{l.current&&!l.current.contains(e.target)&&o(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let h=r.map(e=>e.id);return(0,t.jsxs)("div",{ref:l,className:"relative inline-block",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-wrap",children:[r.map(s=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-[10px] font-medium border",style:{backgroundColor:`${s.color}15`,borderColor:`${s.color}40`,color:s.color},children:[(0,t.jsx)(S.Layers,{className:"w-2.5 h-2.5"}),s.name,(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),d.mutate({workspaceId:s.id,sessionId:e})},className:"hover:opacity-70",children:(0,t.jsx)(b.X,{className:"w-2.5 h-2.5"})})]},s.id)),(0,t.jsxs)("button",{onClick:()=>o(!n),className:(0,p.cn)("inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] text-muted-foreground hover:text-foreground hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",a&&"p-1"),children:[(0,t.jsx)(S.Layers,{className:"w-3 h-3"}),!a&&"space"]})]}),n&&(0,t.jsx)("div",{className:"absolute top-full left-0 mt-1 w-56 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg shadow-lg z-50 py-1",children:0===(c||[]).length?(0,t.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No spaces yet. Create one on the Spaces page."}):(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto",children:(c||[]).map(s=>{let r=h.includes(s.id);return(0,t.jsxs)("button",{onClick:()=>{r?d.mutate({workspaceId:s.id,sessionId:e}):u.mutate({workspaceId:s.id,sessionId:e})},className:"w-full flex items-center gap-2 px-3 py-1.5 hover:bg-zinc-50 dark:hover:bg-zinc-800/50 text-left",children:[(0,t.jsx)("span",{className:"w-3 h-3 rounded flex-shrink-0 flex items-center justify-center",style:{backgroundColor:`${s.color}20`},children:r&&(0,t.jsx)(R.Check,{className:"w-2.5 h-2.5",style:{color:s.color}})}),(0,t.jsx)("span",{className:"text-xs truncate flex-1",children:s.name}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:s.sessionCount||0})]},s.id)})})})]})}var T=e.i(71689),z=e.i(70273),O=e.i(55716),M=e.i(86311),E=e.i(3116),q=e.i(75505);let I=(0,j.default)("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),K=(0,j.default)("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),P=(0,j.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]);var F=e.i(88081),D=e.i(88699),L=e.i(48256),U=e.i(22016),A=e.i(9593);function $({params:e}){let{id:o}=(0,s.use)(e),c=(0,a.useSearchParams)().get("node")||void 0,u=!!c,[d,h]=(0,s.useState)([]),[f,x]=(0,s.useState)(0),[g,v]=(0,s.useState)(!0),[j,k]=(0,s.useState)(!1),[w,N]=(0,s.useState)(""),[S,$]=(0,s.useState)(!1),[B,H]=(0,s.useState)(""),J=(0,s.useRef)(null),[V,X]=(0,s.useState)(null),[G,Y]=(0,s.useState)(!1);(0,s.useEffect)(()=>{u&&(Y(!0),fetch((0,m.api)(`/api/network/proxy/${c}/sessions/${o}`)).then(e=>e.json()).then(e=>{X(e),Y(!1)}).catch(()=>Y(!1)))},[o,c,u]);let{data:Z,isLoading:ee}=(0,i.useSession)(u?null:o),et=u?V:Z,es=u?G:ee,{data:er,isLoading:ea}=(0,i.useMessages)(o,50*f,50,c),ei=(0,i.useToggleStar)(),en=(0,i.useUpdateNotes)(),eo=(0,i.useRenameSession)(),el=(0,r.useQueryClient)(),ec=(0,s.useCallback)(()=>{setTimeout(()=>{x(0),h([]),el.invalidateQueries({queryKey:["messages",o]}),el.invalidateQueries({queryKey:["session",o]})},1500)},[o,el]);(0,s.useEffect)(()=>{er?.messages&&er.messages.length>0&&(0===f?h(er.messages):h(e=>[...e,...er.messages]))},[er,f]),(0,s.useEffect)(()=>{(0,A.track)("session_viewed")},[o]),(0,s.useEffect)(()=>{et?.notes&&N(et.notes)},[et?.notes]);let eu=(0,s.useCallback)(()=>{J.current?.scrollTo({top:J.current.scrollHeight,behavior:"smooth"})},[]),ed=(0,s.useCallback)(()=>{J.current?.scrollTo({top:0,behavior:"smooth"})},[]),eh=(0,s.useCallback)(()=>{!ea&&er?.hasMore&&x(e=>e+1)},[ea,er?.hasMore]);if((0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&(k(!1),$(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),es)return(0,t.jsx)("div",{className:"flex items-center justify-center h-screen",children:(0,t.jsx)(l.Loader2,{className:"w-6 h-6 animate-spin text-indigo-500"})});if(!et)return(0,t.jsxs)("div",{className:"p-8 space-y-2",children:[(0,t.jsx)("p",{className:"text-red-500",children:"Session not found"}),(0,t.jsx)(U.default,{href:"/sessions",className:"text-indigo-500 text-sm",children:"Back to sessions"})]});let ep=et.customName||et.summary||(0,p.truncate)(et.firstPrompt,120),em=er?.total||et.messageCount,ef=er?.hasMore??!0,ex=d.reduce((e,t)=>(e[t.type]=(e[t.type]||0)+1,e),{}),ey={};for(let e of d)if("assistant"===e.type){let t=e.message?.content;if(Array.isArray(t))for(let e of t)"tool_use"===e.type&&e.name&&(ey[e.name]=(ey[e.name]||0)+1)}return(0,t.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-w-0",children:[(0,t.jsxs)("div",{className:"border-b border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 px-4 py-2.5 flex-shrink-0 z-10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(U.default,{href:"/sessions",className:"text-muted-foreground hover:text-foreground transition-colors",children:(0,t.jsx)(T.ArrowLeft,{className:"w-4 h-4"})}),!u&&(0,t.jsx)("button",{onClick:()=>{ei.mutate(et.id),(0,A.track)("session_starred")},className:"flex-shrink-0",children:(0,t.jsx)(z.Star,{className:(0,p.cn)("w-4 h-4 transition-colors",et.starred?"text-amber-500 fill-amber-500":"text-zinc-300 hover:text-amber-400")})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[S?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{autoFocus:!0,value:B,onChange:e=>H(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(eo.mutate({sessionId:et.id,name:B}),$(!1)),"Escape"===e.key&&$(!1)},className:"text-sm font-semibold bg-transparent border border-indigo-400 rounded px-2 py-0.5 focus:outline-none w-full max-w-md",placeholder:"Custom session name..."}),(0,t.jsx)("button",{onClick:()=>{eo.mutate({sessionId:et.id,name:B}),$(!1)},className:"text-green-500 hover:text-green-600",children:(0,t.jsx)(R.Check,{className:"w-4 h-4"})}),(0,t.jsx)("button",{onClick:()=>$(!1),className:"text-muted-foreground hover:text-foreground",children:(0,t.jsx)(b.X,{className:"w-4 h-4"})})]}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5 group",children:[(0,t.jsx)("h1",{className:"text-sm font-semibold truncate",children:ep}),(0,t.jsx)("button",{onClick:()=>{H(et.customName||""),$(!0)},className:"opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-foreground transition-opacity",title:"Rename session",children:(0,t.jsx)(D.Pencil,{className:"w-3 h-3"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mt-0.5 text-[11px] text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 font-medium text-indigo-500",children:[(0,t.jsx)(q.FolderOpen,{className:"w-3 h-3"}),et.projectName]}),et.gitBranch&&"HEAD"!==et.gitBranch&&(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(O.GitBranch,{className:"w-3 h-3"}),et.gitBranch]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(M.MessageSquare,{className:"w-3 h-3"}),em]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(E.Clock,{className:"w-3 h-3"}),(0,p.formatDateTime)(et.created)]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("button",{onClick:()=>k(!j),className:(0,p.cn)("p-1.5 rounded-md transition-colors text-muted-foreground",j?"bg-zinc-100 dark:bg-zinc-800":"hover:bg-zinc-100 dark:hover:bg-zinc-800"),title:"Notes",children:(0,t.jsx)(P,{className:"w-4 h-4"})}),(0,t.jsx)("button",{onClick:()=>v(!g),className:(0,p.cn)("p-1.5 rounded-md transition-colors text-muted-foreground",g?"bg-zinc-100 dark:bg-zinc-800":"hover:bg-zinc-100 dark:hover:bg-zinc-800"),title:"Toggle sidebar",children:(0,t.jsx)(F.Hash,{className:"w-4 h-4"})})]})]}),!u&&(0,t.jsxs)("div",{className:"flex items-center gap-3 mt-2",children:[(0,t.jsx)(C,{sessionId:et.id,currentTags:et.tags||[],tagObjects:et.tagObjects}),(0,t.jsx)("span",{className:"text-zinc-300 dark:text-zinc-700",children:"|"}),(0,t.jsx)(Q,{sessionId:et.id,currentWorkspaces:et.workspaces})]})]}),u&&(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 bg-blue-50 dark:bg-blue-950/30 border-b border-blue-200 dark:border-blue-800 text-sm text-blue-700 dark:text-blue-300",children:[(0,t.jsx)(L.Globe,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Remote session — viewing from a connected node"})]}),j&&!u&&(0,t.jsxs)("div",{className:"border-b border-zinc-200 dark:border-zinc-800 bg-amber-50/50 dark:bg-amber-950/10 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("span",{className:"text-xs font-medium text-amber-700 dark:text-amber-300 flex items-center gap-1",children:[(0,t.jsx)(P,{className:"w-3 h-3"})," Notes"]}),(0,t.jsx)("button",{onClick:()=>k(!1),className:"text-muted-foreground hover:text-foreground",children:(0,t.jsx)(b.X,{className:"w-3 h-3"})})]}),(0,t.jsx)("textarea",{value:w,onChange:e=>N(e.target.value),onBlur:()=>en.mutate({sessionId:et.id,notes:w}),placeholder:"Add notes about this session...",className:"w-full h-20 text-sm bg-transparent border border-amber-200 dark:border-amber-900/50 rounded-md px-3 py-2 resize-none focus:outline-none focus:ring-1 focus:ring-amber-400"})]}),(0,t.jsx)("div",{ref:J,className:"flex-1 overflow-y-auto",children:(0,t.jsx)("div",{className:"max-w-4xl mx-auto py-6 px-6 space-y-6",children:ea&&0===d.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-20 gap-3",children:[(0,t.jsx)(l.Loader2,{className:"w-6 h-6 animate-spin text-indigo-500"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Loading conversation..."})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"text-center",children:(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground bg-zinc-100 dark:bg-zinc-800 px-3 py-1 rounded-full",children:["Showing ",d.length," of ",em," messages"]})}),d.map((e,s)=>(0,t.jsx)(n.MessageRenderer,{message:e,isLast:s===d.length-1},e.uuid||`msg-${s}`)),ef&&(0,t.jsx)("div",{className:"text-center py-4",children:(0,t.jsxs)("button",{onClick:eh,disabled:ea,className:"px-5 py-2.5 text-sm bg-indigo-500 text-white rounded-lg hover:bg-indigo-600 disabled:opacity-50 transition-colors inline-flex items-center gap-2",children:[ea&&(0,t.jsx)(l.Loader2,{className:"w-4 h-4 animate-spin"}),"Load more (",em-d.length," remaining)"]})}),!ef&&d.length>0&&(0,t.jsx)("div",{className:"text-center py-4",children:(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"End of conversation"})})]})})}),!u&&(0,t.jsx)(y,{sessionId:o,projectPath:et.projectPath,onMessageSent:ec}),(0,t.jsxs)("div",{className:"absolute bottom-4 right-4 flex flex-col gap-1 z-20",style:{marginRight:g?"260px":"0"},children:[(0,t.jsx)("button",{onClick:ed,className:"p-2 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg shadow-sm hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors",title:"Scroll to top",children:(0,t.jsx)(K,{className:"w-4 h-4"})}),(0,t.jsx)("button",{onClick:eu,className:"p-2 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg shadow-sm hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors",title:"Scroll to bottom",children:(0,t.jsx)(I,{className:"w-4 h-4"})})]})]}),g&&(0,t.jsx)("div",{className:"w-[260px] border-l border-zinc-200 dark:border-zinc-800 bg-zinc-50 dark:bg-zinc-950 flex-shrink-0 overflow-y-auto",children:(0,t.jsxs)("div",{className:"p-4 space-y-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:"Session"}),(0,t.jsxs)("div",{className:"space-y-1.5 text-xs",children:[(0,t.jsx)(_,{label:"ID",value:et.sessionId.slice(0,8),mono:!0}),(0,t.jsx)(_,{label:"Created",value:(0,p.formatDateTime)(et.created)}),(0,t.jsx)(_,{label:"Modified",value:(0,p.formatDateTime)(et.modified)}),(0,t.jsx)(_,{label:"Messages",value:String(em)}),et.projectPath&&(0,t.jsx)(_,{label:"Path",value:et.projectPath})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:"Breakdown"}),(0,t.jsxs)("div",{className:"space-y-1",children:[ex.user&&(0,t.jsx)(W,{label:"Your messages",count:ex.user,total:d.length,color:"bg-blue-500"}),ex.assistant&&(0,t.jsx)(W,{label:"Claude responses",count:ex.assistant,total:d.length,color:"bg-indigo-500"}),ex.system&&(0,t.jsx)(W,{label:"System",count:ex.system,total:d.length,color:"bg-zinc-400"})]})]}),Object.keys(ey).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:["Tools Used (",Object.values(ey).reduce((e,t)=>e+t,0),")"]}),(0,t.jsx)("div",{className:"space-y-1",children:Object.entries(ey).sort((e,t)=>t[1]-e[1]).map(([e,s])=>(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,t.jsx)("span",{className:"font-mono text-muted-foreground truncate",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground bg-zinc-200 dark:bg-zinc-800 px-1.5 py-0.5 rounded text-[10px] font-medium",children:s})]},e))})]}),et.workspaces&&et.workspaces.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:"Workspaces"}),(0,t.jsx)("div",{className:"space-y-1",children:et.workspaces.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)("span",{className:"w-2.5 h-2.5 rounded",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{children:e.name})]},e.id))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:"Source File"}),(0,t.jsx)("p",{className:"text-[10px] font-mono text-muted-foreground break-all leading-relaxed",children:et.fullPath})]})]})})]})}function _({label:e,value:s,mono:r}){return(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground flex-shrink-0",children:e}),(0,t.jsx)("span",{className:(0,p.cn)("text-right truncate",r&&"font-mono"),title:s,children:s})]})}function W({label:e,count:s,total:r,color:a}){let i=r>0?s/r*100:0;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs mb-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"font-medium",children:s})]}),(0,t.jsx)("div",{className:"h-1 bg-zinc-200 dark:bg-zinc-800 rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:(0,p.cn)("h-full rounded-full",a),style:{width:`${i}%`}})})]})}e.s(["default",()=>$],91809)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,3116,e=>{"use strict";let t=(0,e.i(75254).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",()=>t],3116)},43531,e=>{"use strict";let t=(0,e.i(75254).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",()=>t],43531)},37727,e=>{"use strict";let t=(0,e.i(75254).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",()=>t],37727)},88699,e=>{"use strict";let t=(0,e.i(75254).default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["Pencil",()=>t],88699)},31278,e=>{"use strict";let t=(0,e.i(75254).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>t],31278)},66027,54616,e=>{"use strict";let t;var s=e.i(75555),r=e.i(40143),a=e.i(86491),i=e.i(15823),n=e.i(93803),o=e.i(19273),l=e.i(80166),c=class extends i.Subscribable{constructor(e,t){super(),this.options=t,this.#e=e,this.#t=null,this.#s=(0,n.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#e;#r=void 0;#a=void 0;#i=void 0;#n;#o;#s;#t;#l;#c;#u;#d;#h;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#r.addObserver(this),u(this.#r,this.options)?this.#f():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return d(this.#r,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return d(this.#r,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#y(),this.#g(),this.#r.removeObserver(this)}setOptions(e){let t=this.options,s=this.#r;if(this.options=this.#e.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,o.resolveEnabled)(this.options.enabled,this.#r))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#b(),this.#r.setOptions(this.options),t._defaulted&&!(0,o.shallowEqualObjects)(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#r,observer:this});let r=this.hasListeners();r&&h(this.#r,s,this.options,t)&&this.#f(),this.updateResult(),r&&(this.#r!==s||(0,o.resolveEnabled)(this.options.enabled,this.#r)!==(0,o.resolveEnabled)(t.enabled,this.#r)||(0,o.resolveStaleTime)(this.options.staleTime,this.#r)!==(0,o.resolveStaleTime)(t.staleTime,this.#r))&&this.#v();let a=this.#j();r&&(this.#r!==s||(0,o.resolveEnabled)(this.options.enabled,this.#r)!==(0,o.resolveEnabled)(t.enabled,this.#r)||a!==this.#p)&&this.#k(a)}getOptimisticResult(e){var t,s;let r=this.#e.getQueryCache().build(this.#e,e),a=this.createResult(r,e);return t=this,s=a,(0,o.shallowEqualObjects)(t.getCurrentResult(),s)||(this.#i=a,this.#o=this.options,this.#n=this.#r.state),a}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(e,s)=>(this.trackProp(s),t?.(s),"promise"===s&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#s.status||this.#s.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,s))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#r}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),s=this.#e.getQueryCache().build(this.#e,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#f(e){this.#b();let t=this.#r.fetch(this.options,e);return e?.throwOnError||(t=t.catch(o.noop)),t}#v(){this.#y();let e=(0,o.resolveStaleTime)(this.options.staleTime,this.#r);if(o.isServer||this.#i.isStale||!(0,o.isValidTimeout)(e))return;let t=(0,o.timeUntilStale)(this.#i.dataUpdatedAt,e);this.#d=l.timeoutManager.setTimeout(()=>{this.#i.isStale||this.updateResult()},t+1)}#j(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#r):this.options.refetchInterval)??!1}#k(e){this.#g(),this.#p=e,!o.isServer&&!1!==(0,o.resolveEnabled)(this.options.enabled,this.#r)&&(0,o.isValidTimeout)(this.#p)&&0!==this.#p&&(this.#h=l.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||s.focusManager.isFocused())&&this.#f()},this.#p))}#x(){this.#v(),this.#k(this.#j())}#y(){this.#d&&(l.timeoutManager.clearTimeout(this.#d),this.#d=void 0)}#g(){this.#h&&(l.timeoutManager.clearInterval(this.#h),this.#h=void 0)}createResult(e,t){let s,r=this.#r,i=this.options,l=this.#i,c=this.#n,d=this.#o,m=e!==r?e.state:this.#a,{state:f}=e,x={...f},y=!1;if(t._optimisticResults){let s=this.hasListeners(),n=!s&&u(e,t),o=s&&h(e,r,t,i);(n||o)&&(x={...x,...(0,a.fetchState)(f.data,e.options)}),"isRestoring"===t._optimisticResults&&(x.fetchStatus="idle")}let{error:g,errorUpdatedAt:b,status:v}=x;s=x.data;let j=!1;if(void 0!==t.placeholderData&&void 0===s&&"pending"===v){let e;l?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(e=l.data,j=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,void 0!==e&&(v="success",s=(0,o.replaceData)(l?.data,e,t),y=!0)}if(t.select&&void 0!==s&&!j)if(l&&s===c?.data&&t.select===this.#l)s=this.#c;else try{this.#l=t.select,s=t.select(s),s=(0,o.replaceData)(l?.data,s,t),this.#c=s,this.#t=null}catch(e){this.#t=e}this.#t&&(g=this.#t,s=this.#c,b=Date.now(),v="error");let k="fetching"===x.fetchStatus,w="pending"===v,N="error"===v,C=w&&k,S=void 0!==s,R={status:v,fetchStatus:x.fetchStatus,isPending:w,isSuccess:"success"===v,isError:N,isInitialLoading:C,isLoading:C,data:s,dataUpdatedAt:x.dataUpdatedAt,error:g,errorUpdatedAt:b,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:x.dataUpdateCount>0||x.errorUpdateCount>0,isFetchedAfterMount:x.dataUpdateCount>m.dataUpdateCount||x.errorUpdateCount>m.errorUpdateCount,isFetching:k,isRefetching:k&&!w,isLoadingError:N&&!S,isPaused:"paused"===x.fetchStatus,isPlaceholderData:y,isRefetchError:N&&S,isStale:p(e,t),refetch:this.refetch,promise:this.#s,isEnabled:!1!==(0,o.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==R.data,s="error"===R.status&&!t,a=e=>{s?e.reject(R.error):t&&e.resolve(R.data)},i=()=>{a(this.#s=R.promise=(0,n.pendingThenable)())},o=this.#s;switch(o.status){case"pending":e.queryHash===r.queryHash&&a(o);break;case"fulfilled":(s||R.data!==o.value)&&i();break;case"rejected":s&&R.error===o.reason||i()}}return R}updateResult(){let e=this.#i,t=this.createResult(this.#r,this.options);if(this.#n=this.#r.state,this.#o=this.options,void 0!==this.#n.data&&(this.#u=this.#r),(0,o.shallowEqualObjects)(t,e))return;this.#i=t;let s=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.#m.size)return!0;let r=new Set(s??this.#m);return this.options.throwOnError&&r.add("error"),Object.keys(this.#i).some(t=>this.#i[t]!==e[t]&&r.has(t))};this.#w({listeners:s()})}#b(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#r)return;let t=this.#r;this.#r=e,this.#a=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#w(e){r.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#i)}),this.#e.getQueryCache().notify({query:this.#r,type:"observerResultsUpdated"})})}};function u(e,t){return!1!==(0,o.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&d(e,t,t.refetchOnMount)}function d(e,t,s){if(!1!==(0,o.resolveEnabled)(t.enabled,e)&&"static"!==(0,o.resolveStaleTime)(t.staleTime,e)){let r="function"==typeof s?s(e):s;return"always"===r||!1!==r&&p(e,t)}return!1}function h(e,t,s,r){return(e!==t||!1===(0,o.resolveEnabled)(r.enabled,e))&&(!s.suspense||"error"!==e.state.status)&&p(e,s)}function p(e,t){return!1!==(0,o.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,o.resolveStaleTime)(t.staleTime,e))}e.i(47167);var m=e.i(71645),f=e.i(12598);e.i(18050);var x=m.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),y=m.createContext(!1);y.Provider;var g=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function b(e,t){return function(e,t,s){let a,i=m.useContext(y),n=m.useContext(x),l=(0,f.useQueryClient)(s),c=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(c);let u=l.getQueryCache().get(c.queryHash);if(c._optimisticResults=i?"isRestoring":"optimistic",c.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=c.staleTime;c.staleTime="function"==typeof t?(...s)=>e(t(...s)):e(t),"number"==typeof c.gcTime&&(c.gcTime=Math.max(c.gcTime,1e3))}a=u?.state.error&&"function"==typeof c.throwOnError?(0,o.shouldThrowError)(c.throwOnError,[u.state.error,u]):c.throwOnError,(c.suspense||c.experimental_prefetchInRender||a)&&!n.isReset()&&(c.retryOnMount=!1),m.useEffect(()=>{n.clearReset()},[n]);let d=!l.getQueryCache().get(c.queryHash),[h]=m.useState(()=>new t(l,c)),p=h.getOptimisticResult(c),b=!i&&!1!==e.subscribed;if(m.useSyncExternalStore(m.useCallback(e=>{let t=b?h.subscribe(r.notifyManager.batchCalls(e)):o.noop;return h.updateResult(),t},[h,b]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),m.useEffect(()=>{h.setOptions(c)},[c,h]),c?.suspense&&p.isPending)throw g(c,h,n);if((({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&void 0===e.data||(0,o.shouldThrowError)(s,[e.error,r])))({result:p,errorResetBoundary:n,throwOnError:c.throwOnError,query:u,suspense:c.suspense}))throw p.error;if(l.getDefaultOptions().queries?._experimental_afterQuery?.(c,p),c.experimental_prefetchInRender&&!o.isServer&&p.isLoading&&p.isFetching&&!i){let e=d?g(c,h,n):u?.promise;e?.catch(o.noop).finally(()=>{h.updateResult()})}return c.notifyOnChangeProps?p:h.trackResult(p)}(e,c,t)}e.s(["useQuery",()=>b],66027);var v=e.i(14272),j=i,k=class extends j.Subscribable{#e;#i=void 0;#N;#C;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#S()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,o.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#N,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,o.hashKey)(t.mutationKey)!==(0,o.hashKey)(this.options.mutationKey)?this.reset():this.#N?.state.status==="pending"&&this.#N.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#N?.removeObserver(this)}onMutationUpdate(e){this.#S(),this.#w(e)}getCurrentResult(){return this.#i}reset(){this.#N?.removeObserver(this),this.#N=void 0,this.#S(),this.#w()}mutate(e,t){return this.#C=t,this.#N?.removeObserver(this),this.#N=this.#e.getMutationCache().build(this.#e,this.options),this.#N.addObserver(this),this.#N.execute(e)}#S(){let e=this.#N?.state??(0,v.getDefaultState)();this.#i={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#w(e){r.notifyManager.batch(()=>{if(this.#C&&this.hasListeners()){let t=this.#i.variables,s=this.#i.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#C.onSuccess?.(e.data,t,s,r)}catch(e){Promise.reject(e)}try{this.#C.onSettled?.(e.data,null,t,s,r)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#C.onError?.(e.error,t,s,r)}catch(e){Promise.reject(e)}try{this.#C.onSettled?.(void 0,e.error,t,s,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#i)})})}};function w(e,t){let s=(0,f.useQueryClient)(t),[a]=m.useState(()=>new k(s,e));m.useEffect(()=>{a.setOptions(e)},[a,e]);let i=m.useSyncExternalStore(m.useCallback(e=>a.subscribe(r.notifyManager.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),n=m.useCallback((e,t)=>{a.mutate(e,t).catch(o.noop)},[a]);if(i.error&&(0,o.shouldThrowError)(a.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:n,mutateAsync:i.mutate}}e.s(["useMutation",()=>w],54616)},3999,e=>{"use strict";var t=e.i(66027),s=e.i(54616),r=e.i(12598),a=e.i(9165);function i(e={}){return(0,t.useQuery)({queryKey:["sessions",e],queryFn:async()=>{let t=new URLSearchParams;return e.projectId&&t.set("projectId",e.projectId),void 0!==e.starred&&t.set("starred",String(e.starred)),e.search&&t.set("search",e.search),e.agentType&&t.set("agentType",e.agentType),e.sortBy&&t.set("sortBy",e.sortBy),e.sortDir&&t.set("sortDir",e.sortDir),void 0!==e.offset&&t.set("offset",String(e.offset)),void 0!==e.limit&&t.set("limit",String(e.limit)),"all"===e.nodeFilter&&t.set("nodes","all"),(await fetch((0,a.api)(`/api/sessions?${t}`))).json()}})}function n(e){return(0,t.useQuery)({queryKey:["session",e],queryFn:async()=>{let t=await fetch((0,a.api)(`/api/sessions/${e}`));if(!t.ok)throw Error("Session not found");return t.json()},enabled:!!e})}function o(e,s=0,r=50,i){return(0,t.useQuery)({queryKey:["messages",e,s,r,i],queryFn:async()=>{let t=i?(0,a.api)(`/api/network/proxy/${i}/sessions/${e}/messages?offset=${s}&limit=${r}`):(0,a.api)(`/api/sessions/${e}/messages?offset=${s}&limit=${r}`);return(await fetch(t)).json()},enabled:!!e})}function l(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async e=>(await fetch((0,a.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"star"})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function c(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async({sessionId:e,notes:t})=>(await fetch((0,a.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"notes",notes:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["session"]})}})}function u(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async({sessionId:e,tagName:t})=>(await fetch((0,a.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"tag",tagName:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]}),e.invalidateQueries({queryKey:["tags"]})}})}function d(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async({sessionId:e,tagName:t})=>(await fetch((0,a.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"removeTag",tagName:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]}),e.invalidateQueries({queryKey:["tags"]})}})}function h(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async({sessionId:e,name:t})=>(await fetch((0,a.api)(`/api/sessions/${e}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"rename",name:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function p(){return(0,t.useQuery)({queryKey:["tags"],queryFn:async()=>(await fetch((0,a.api)("/api/tags"))).json()})}function m(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async e=>(await fetch((0,a.api)("/api/tags"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete",tagId:e})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["tags"]}),e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function f(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async({tagId:e,color:t})=>(await fetch((0,a.api)("/api/tags"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"updateColor",tagId:e,color:t})})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["tags"]}),e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function x(){return(0,t.useQuery)({queryKey:["workspaces"],queryFn:async()=>(await fetch((0,a.api)("/api/workspaces"))).json()})}function y(){return(0,t.useQuery)({queryKey:["workspaces","remote"],queryFn:async()=>(await fetch((0,a.api)("/api/workspaces?nodes=all"))).json()})}function g(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async({workspaceId:e,sessionId:t,nodeId:s,title:r,cwd:i,agentType:n})=>{let o=await fetch((0,a.api)(`/api/workspaces/${e}/sessions`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t,nodeId:s,title:r,cwd:i,agentType:n})});if(!o.ok)throw Error("Failed to add session to workspace");return o.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["workspace-sessions"]}),e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function b(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async({workspaceId:e,sessionId:t})=>{let s=await fetch((0,a.api)(`/api/workspaces/${e}/sessions`),{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t})});if(!s.ok)throw Error("Failed to remove session from workspace");return s.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["workspace-sessions"]}),e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["session"]})}})}function v(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async e=>(await fetch((0,a.api)("/api/bulk"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json(),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["tags"]})}})}function j(){return(0,t.useQuery)({queryKey:["projects"],queryFn:async()=>(await fetch((0,a.api)("/api/projects"))).json()})}function k(){return(0,t.useQuery)({queryKey:["analytics"],queryFn:async()=>(await fetch((0,a.api)("/api/analytics/overview"))).json()})}function w(){let e=(0,r.useQueryClient)();return(0,s.useMutation)({mutationFn:async()=>(await fetch((0,a.api)("/api/sync"),{method:"POST"})).json(),onSuccess:()=>{e.invalidateQueries()}})}e.s(["useAddSessionToWorkspace",()=>g,"useAddTag",()=>u,"useAnalytics",()=>k,"useBulkAction",()=>v,"useDeleteTag",()=>m,"useMessages",()=>o,"useProjects",()=>j,"useRemoteWorkspaces",()=>y,"useRemoveSessionFromWorkspace",()=>b,"useRemoveTag",()=>d,"useRenameSession",()=>h,"useSession",()=>n,"useSessions",()=>i,"useSync",()=>w,"useTags",()=>p,"useToggleStar",()=>l,"useUpdateNotes",()=>c,"useUpdateTagColor",()=>f,"useWorkspaces",()=>x])},71689,e=>{"use strict";let t=(0,e.i(75254).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",()=>t],71689)},7233,e=>{"use strict";let t=(0,e.i(75254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],7233)},27612,e=>{"use strict";let t=(0,e.i(75254).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",()=>t],27612)},70273,e=>{"use strict";let t=(0,e.i(75254).default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);e.s(["Star",()=>t],70273)},55716,e=>{"use strict";let t=(0,e.i(75254).default)("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]);e.s(["GitBranch",()=>t],55716)},88081,e=>{"use strict";let t=(0,e.i(75254).default)("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);e.s(["Hash",()=>t],88081)},86536,e=>{"use strict";let t=(0,e.i(75254).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",()=>t],86536)},78894,e=>{"use strict";let t=(0,e.i(75254).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["AlertTriangle",()=>t],78894)},51975,e=>{"use strict";let t=(0,e.i(75254).default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);e.s(["Tag",()=>t],51975)},68054,e=>{"use strict";let t=(0,e.i(75254).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],68054)},74886,e=>{"use strict";let t=(0,e.i(75254).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",()=>t],74886)},64659,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],64659)},14764,e=>{"use strict";let t=(0,e.i(75254).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["Send",()=>t],14764)},63059,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],63059)},55900,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);e.s(["ChevronUp",()=>t],55900)},98003,e=>{"use strict";var t=e.i(18050),s=e.i(75157);let r=["#ef4444","#f97316","#f59e0b","#eab308","#84cc16","#22c55e","#14b8a6","#06b6d4","#3b82f6","#6366f1","#8b5cf6","#a855f7","#d946ef","#ec4899","#f43f5e","#78716c"];function a({value:e,onChange:a,className:i}){return(0,t.jsx)("div",{className:(0,s.cn)("grid grid-cols-8 gap-1.5",i),children:r.map(r=>(0,t.jsx)("button",{onClick:()=>a(r),className:(0,s.cn)("w-6 h-6 rounded-full border-2 transition-transform hover:scale-110",e===r?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:r},title:r},r))})}e.s(["ColorPicker",()=>a])},91809,e=>{"use strict";var t=e.i(18050),s=e.i(71645),r=e.i(12598),a=e.i(18566),i=e.i(3999),n=e.i(46686),o=e.i(14764),l=e.i(31278),c=e.i(52044),u=e.i(68054),d=e.i(55900),h=e.i(64659),p=e.i(75157),m=e.i(9165),f=e.i(18789),x=e.i(42531);function y({sessionId:e,projectPath:r,onMessageSent:a}){let[i,n]=(0,s.useState)(""),[y,g]=(0,s.useState)(!1),[b,v]=(0,s.useState)([]),[j,k]=(0,s.useState)(""),[w,N]=(0,s.useState)(!0),[C,S]=(0,s.useState)(null),R=(0,s.useRef)(null),Q=(0,s.useRef)(null),T=(0,s.useRef)(null);(0,s.useEffect)(()=>{R.current&&(R.current.style.height="auto",R.current.style.height=`${Math.min(R.current.scrollHeight,200)}px`)},[i]),(0,s.useEffect)(()=>{Q.current&&(Q.current.scrollTop=Q.current.scrollHeight)},[j,b]);let z=(0,s.useCallback)(async()=>{if(!i.trim()||y)return;g(!0),v([]),k(""),S(null),N(!0);let t=new AbortController;T.current=t;try{let s=await fetch((0,m.api)(`/api/sessions/${e}/chat`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:i.trim(),cwd:r}),signal:t.signal});if(!s.ok){let e=await s.json();S(e.error||"Failed to send message"),g(!1);return}let o=s.body?.getReader();if(!o){S("No response stream"),g(!1);return}let l=new TextDecoder,c="",u="";for(n("");;){let{done:e,value:t}=await o.read();if(e)break;let s=(c+=l.decode(t,{stream:!0})).split("\n\n");for(let e of(c=s.pop()||"",s)){if(!e.startsWith("data: "))continue;let t=e.slice(6);try{let e=JSON.parse(t);if(v(t=>[...t,e]),"done"===e.type)a?.();else if("error"===e.type)S(t=>(t||"")+(e.text||""));else if("stderr"===e.type){let t=e.text||"";(t.includes("Error")||t.includes("error"))&&S(e=>(e||"")+t)}else if("assistant"===e.type){let t=e.message?.content||e.content;if(Array.isArray(t))for(let e of t)"text"===e.type&&e.text&&(u+=e.text,k(u))}else if("content_block_delta"===e.type)(e.content?.type==="text_delta"||e.text)&&(u+=e.content?.text||e.text||"",k(u));else if("text"===e.type)u+=e.text||"",k(u);else if("result"===e.type){if(!u){let t=e.result;"string"==typeof t&&(u=t,k(u))}a?.()}}catch{}}}}catch(e){"AbortError"!==e.name&&S(e.message||"Connection failed")}finally{g(!1),T.current=null}},[i,y,e,r,a]);return(0,t.jsxs)("div",{className:"border-t border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 flex-shrink-0",children:[(j||C||y)&&(0,t.jsxs)("div",{className:"border-b border-zinc-200 dark:border-zinc-800",children:[(0,t.jsxs)("button",{onClick:()=>N(!w),className:"w-full flex items-center gap-2 px-4 py-1.5 text-[11px] text-muted-foreground hover:text-foreground bg-zinc-50 dark:bg-zinc-900/50",children:[y?(0,t.jsx)(l.Loader2,{className:"w-3 h-3 animate-spin text-indigo-500"}):(0,t.jsx)(u.Terminal,{className:"w-3 h-3"}),(0,t.jsx)("span",{className:"font-medium",children:y?"Claude is responding...":"Response"}),w?(0,t.jsx)(h.ChevronDown,{className:"w-3 h-3 ml-auto"}):(0,t.jsx)(d.ChevronUp,{className:"w-3 h-3 ml-auto"})]}),w&&(0,t.jsxs)("div",{ref:Q,className:"max-h-64 overflow-y-auto px-4 py-3 text-sm",children:[C&&(0,t.jsx)("div",{className:"text-red-500 text-xs mb-2 bg-red-50 dark:bg-red-950/20 rounded px-3 py-2",children:C}),j&&(0,t.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none prose-pre:bg-zinc-100 dark:prose-pre:bg-zinc-800 prose-pre:text-xs",children:(0,t.jsx)(f.default,{remarkPlugins:[x.default],children:j})}),y&&!j&&!C&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground text-xs",children:[(0,t.jsx)(l.Loader2,{className:"w-3 h-3 animate-spin"}),"Waiting for Claude..."]})]})]}),(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsx)("div",{className:"flex items-end gap-2 max-w-4xl mx-auto",children:(0,t.jsxs)("div",{className:"flex-1 relative",children:[(0,t.jsx)("textarea",{ref:R,value:i,onChange:e=>n(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),z())},placeholder:y?"Claude is thinking...":"Send a message to Claude...",disabled:y,rows:1,className:(0,p.cn)("w-full resize-none rounded-lg border px-4 py-2.5 pr-12 text-sm bg-transparent","focus:outline-none focus:ring-2 focus:ring-indigo-400 focus:border-transparent","placeholder:text-muted-foreground/50","border-zinc-200 dark:border-zinc-700",y&&"opacity-50")}),(0,t.jsx)("div",{className:"absolute right-2 bottom-2",children:y?(0,t.jsx)("button",{onClick:()=>{T.current?.abort(),g(!1)},className:"p-1.5 rounded-md bg-red-500 text-white hover:bg-red-600 transition-colors",title:"Stop generation",children:(0,t.jsx)(c.Square,{className:"w-3.5 h-3.5"})}):(0,t.jsx)("button",{onClick:z,disabled:!i.trim(),className:(0,p.cn)("p-1.5 rounded-md transition-colors",i.trim()?"bg-indigo-500 text-white hover:bg-indigo-600":"bg-zinc-100 dark:bg-zinc-800 text-muted-foreground"),title:"Send (Enter)",children:(0,t.jsx)(o.Send,{className:"w-3.5 h-3.5"})})})]})}),(0,t.jsxs)("p",{className:"text-[10px] text-muted-foreground mt-1.5 text-center",children:["Enter to send, Shift+Enter for newline. Resumes this session via ",(0,t.jsx)("code",{className:"bg-zinc-100 dark:bg-zinc-800 px-1 rounded",children:"claude --resume"})]})]})]})}var g=e.i(51975),b=e.i(37727),v=e.i(7233),j=e.i(75254);let k=(0,j.default)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);var w=e.i(27612),N=e.i(98003);function C({sessionId:e,currentTags:r,tagObjects:a,compact:n}){let[o,l]=(0,s.useState)(!1),[c,u]=(0,s.useState)(""),[d,h]=(0,s.useState)(null),m=(0,s.useRef)(null),{data:f}=(0,i.useTags)(),x=(0,i.useAddTag)(),y=(0,i.useRemoveTag)(),j=(0,i.useDeleteTag)(),C=(0,i.useUpdateTagColor)();(0,s.useEffect)(()=>{let e=e=>{m.current&&!m.current.contains(e.target)&&(l(!1),h(null))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let S=(f||[]).filter(e=>!r.includes(e.name));return(0,t.jsxs)("div",{ref:m,className:"relative inline-block",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-wrap",children:[(a||[]).map(s=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium border",style:{backgroundColor:`${s.color}15`,borderColor:`${s.color}40`,color:s.color},children:[s.name,(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),y.mutate({sessionId:e,tagName:s.name})},className:"hover:opacity-70",children:(0,t.jsx)(b.X,{className:"w-2.5 h-2.5"})})]},s.id)),r.filter(e=>!a?.find(t=>t.name===e)).map(s=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium bg-indigo-50 dark:bg-indigo-950/50 text-indigo-600 dark:text-indigo-300 border border-indigo-200 dark:border-indigo-800",children:[s,(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),y.mutate({sessionId:e,tagName:s})},className:"hover:opacity-70",children:(0,t.jsx)(b.X,{className:"w-2.5 h-2.5"})})]},s)),(0,t.jsxs)("button",{onClick:()=>l(!o),className:(0,p.cn)("inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full text-[10px] text-muted-foreground hover:text-foreground hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",n&&"p-1"),children:[(0,t.jsx)(v.Plus,{className:"w-3 h-3"}),!n&&"tag"]})]}),o&&(0,t.jsxs)("div",{className:"absolute top-full left-0 mt-1 w-56 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg shadow-lg z-50 py-1",children:[(0,t.jsx)("div",{className:"px-2 py-1.5 border-b border-zinc-100 dark:border-zinc-800",children:(0,t.jsxs)("form",{onSubmit:t=>{t.preventDefault(),c.trim()&&(x.mutate({sessionId:e,tagName:c.trim()}),u(""))},className:"flex items-center gap-1",children:[(0,t.jsx)(g.Tag,{className:"w-3 h-3 text-muted-foreground flex-shrink-0"}),(0,t.jsx)("input",{type:"text",placeholder:"New tag name...",value:c,onChange:e=>u(e.target.value),className:"flex-1 text-xs bg-transparent focus:outline-none",autoFocus:!0}),c&&(0,t.jsx)("button",{type:"submit",className:"text-xs text-indigo-500 hover:text-indigo-600 font-medium",children:"Add"})]})}),S.length>0&&(0,t.jsx)("div",{className:"max-h-40 overflow-y-auto",children:S.map(s=>(0,t.jsxs)("div",{className:"group",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-zinc-50 dark:hover:bg-zinc-800/50",children:[(0,t.jsxs)("button",{onClick:()=>{x.mutate({sessionId:e,tagName:s.name})},className:"flex items-center gap-2 flex-1 text-left",children:[(0,t.jsx)("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:s.color}}),(0,t.jsx)("span",{className:"text-xs truncate",children:s.name})]}),(0,t.jsxs)("div",{className:"hidden group-hover:flex items-center gap-0.5",children:[(0,t.jsx)("button",{onClick:()=>h(d===s.id?null:s.id),className:"p-0.5 text-muted-foreground hover:text-foreground",title:"Change color",children:(0,t.jsx)(k,{className:"w-3 h-3"})}),(0,t.jsx)("button",{onClick:()=>{confirm(`Delete tag "${s.name}"?`)&&j.mutate(s.id)},className:"p-0.5 text-muted-foreground hover:text-red-500",title:"Delete tag",children:(0,t.jsx)(w.Trash2,{className:"w-3 h-3"})})]})]}),d===s.id&&(0,t.jsx)("div",{className:"px-3 py-2 bg-zinc-50 dark:bg-zinc-800/50",children:(0,t.jsx)(N.ColorPicker,{value:s.color,onChange:e=>{C.mutate({tagId:s.id,color:e}),h(null)}})})]},s.id))}),0===S.length&&!c&&(0,t.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:0===(f||[]).length?"No tags yet. Type to create one.":"All tags applied."})]})]})}var S=e.i(52008),R=e.i(43531);function Q({sessionId:e,currentWorkspaces:r=[],compact:a}){let[n,o]=(0,s.useState)(!1),l=(0,s.useRef)(null),{data:c}=(0,i.useWorkspaces)(),u=(0,i.useAddSessionToWorkspace)(),d=(0,i.useRemoveSessionFromWorkspace)();(0,s.useEffect)(()=>{let e=e=>{l.current&&!l.current.contains(e.target)&&o(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let h=r.map(e=>e.id);return(0,t.jsxs)("div",{ref:l,className:"relative inline-block",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-wrap",children:[r.map(s=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-[10px] font-medium border",style:{backgroundColor:`${s.color}15`,borderColor:`${s.color}40`,color:s.color},children:[(0,t.jsx)(S.Layers,{className:"w-2.5 h-2.5"}),s.name,(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),d.mutate({workspaceId:s.id,sessionId:e})},className:"hover:opacity-70",children:(0,t.jsx)(b.X,{className:"w-2.5 h-2.5"})})]},s.id)),(0,t.jsxs)("button",{onClick:()=>o(!n),className:(0,p.cn)("inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] text-muted-foreground hover:text-foreground hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",a&&"p-1"),children:[(0,t.jsx)(S.Layers,{className:"w-3 h-3"}),!a&&"space"]})]}),n&&(0,t.jsx)("div",{className:"absolute top-full left-0 mt-1 w-56 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg shadow-lg z-50 py-1",children:0===(c||[]).length?(0,t.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No spaces yet. Create one on the Spaces page."}):(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto",children:(c||[]).map(s=>{let r=h.includes(s.id);return(0,t.jsxs)("button",{onClick:()=>{r?d.mutate({workspaceId:s.id,sessionId:e}):u.mutate({workspaceId:s.id,sessionId:e})},className:"w-full flex items-center gap-2 px-3 py-1.5 hover:bg-zinc-50 dark:hover:bg-zinc-800/50 text-left",children:[(0,t.jsx)("span",{className:"w-3 h-3 rounded flex-shrink-0 flex items-center justify-center",style:{backgroundColor:`${s.color}20`},children:r&&(0,t.jsx)(R.Check,{className:"w-2.5 h-2.5",style:{color:s.color}})}),(0,t.jsx)("span",{className:"text-xs truncate flex-1",children:s.name}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:s.sessionCount||0})]},s.id)})})})]})}var T=e.i(71689),z=e.i(70273),O=e.i(55716),M=e.i(86311),E=e.i(3116),q=e.i(75505);let I=(0,j.default)("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),K=(0,j.default)("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),P=(0,j.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]);var F=e.i(88081),D=e.i(88699),L=e.i(48256),U=e.i(22016),A=e.i(9593);function $({params:e}){let{id:o}=(0,s.use)(e),c=(0,a.useSearchParams)().get("node")||void 0,u=!!c,[d,h]=(0,s.useState)([]),[f,x]=(0,s.useState)(0),[g,v]=(0,s.useState)(!0),[j,k]=(0,s.useState)(!1),[w,N]=(0,s.useState)(""),[S,$]=(0,s.useState)(!1),[B,H]=(0,s.useState)(""),J=(0,s.useRef)(null),[V,X]=(0,s.useState)(null),[G,Y]=(0,s.useState)(!1);(0,s.useEffect)(()=>{u&&(Y(!0),fetch((0,m.api)(`/api/network/proxy/${c}/sessions/${o}`)).then(e=>e.json()).then(e=>{X(e),Y(!1)}).catch(()=>Y(!1)))},[o,c,u]);let{data:Z,isLoading:ee}=(0,i.useSession)(u?null:o),et=u?V:Z,es=u?G:ee,{data:er,isLoading:ea}=(0,i.useMessages)(o,50*f,50,c),ei=(0,i.useToggleStar)(),en=(0,i.useUpdateNotes)(),eo=(0,i.useRenameSession)(),el=(0,r.useQueryClient)(),ec=(0,s.useCallback)(()=>{setTimeout(()=>{x(0),h([]),el.invalidateQueries({queryKey:["messages",o]}),el.invalidateQueries({queryKey:["session",o]})},1500)},[o,el]);(0,s.useEffect)(()=>{er?.messages&&er.messages.length>0&&(0===f?h(er.messages):h(e=>[...e,...er.messages]))},[er,f]),(0,s.useEffect)(()=>{(0,A.track)("session_viewed")},[o]),(0,s.useEffect)(()=>{et?.notes&&N(et.notes)},[et?.notes]);let eu=(0,s.useCallback)(()=>{J.current?.scrollTo({top:J.current.scrollHeight,behavior:"smooth"})},[]),ed=(0,s.useCallback)(()=>{J.current?.scrollTo({top:0,behavior:"smooth"})},[]),eh=(0,s.useCallback)(()=>{!ea&&er?.hasMore&&x(e=>e+1)},[ea,er?.hasMore]);if((0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&(k(!1),$(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),es)return(0,t.jsx)("div",{className:"flex items-center justify-center h-screen",children:(0,t.jsx)(l.Loader2,{className:"w-6 h-6 animate-spin text-indigo-500"})});if(!et)return(0,t.jsxs)("div",{className:"p-8 space-y-2",children:[(0,t.jsx)("p",{className:"text-red-500",children:"Session not found"}),(0,t.jsx)(U.default,{href:"/sessions",className:"text-indigo-500 text-sm",children:"Back to sessions"})]});let ep=et.customName||et.summary||(0,p.truncate)(et.firstPrompt,120),em=er?.total||et.messageCount,ef=er?.hasMore??!0,ex=d.reduce((e,t)=>(e[t.type]=(e[t.type]||0)+1,e),{}),ey={};for(let e of d)if("assistant"===e.type){let t=e.message?.content;if(Array.isArray(t))for(let e of t)"tool_use"===e.type&&e.name&&(ey[e.name]=(ey[e.name]||0)+1)}return(0,t.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-w-0",children:[(0,t.jsxs)("div",{className:"border-b border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 px-4 py-2.5 flex-shrink-0 z-10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(U.default,{href:"/sessions",className:"text-muted-foreground hover:text-foreground transition-colors",children:(0,t.jsx)(T.ArrowLeft,{className:"w-4 h-4"})}),!u&&(0,t.jsx)("button",{onClick:()=>{ei.mutate(et.id),(0,A.track)("session_starred")},className:"flex-shrink-0",children:(0,t.jsx)(z.Star,{className:(0,p.cn)("w-4 h-4 transition-colors",et.starred?"text-amber-500 fill-amber-500":"text-zinc-300 hover:text-amber-400")})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[S?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{autoFocus:!0,value:B,onChange:e=>H(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(eo.mutate({sessionId:et.id,name:B}),$(!1)),"Escape"===e.key&&$(!1)},className:"text-sm font-semibold bg-transparent border border-indigo-400 rounded px-2 py-0.5 focus:outline-none w-full max-w-md",placeholder:"Custom session name..."}),(0,t.jsx)("button",{onClick:()=>{eo.mutate({sessionId:et.id,name:B}),$(!1)},className:"text-green-500 hover:text-green-600",children:(0,t.jsx)(R.Check,{className:"w-4 h-4"})}),(0,t.jsx)("button",{onClick:()=>$(!1),className:"text-muted-foreground hover:text-foreground",children:(0,t.jsx)(b.X,{className:"w-4 h-4"})})]}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5 group",children:[(0,t.jsx)("h1",{className:"text-sm font-semibold truncate",children:ep}),(0,t.jsx)("button",{onClick:()=>{H(et.customName||""),$(!0)},className:"opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-foreground transition-opacity",title:"Rename session",children:(0,t.jsx)(D.Pencil,{className:"w-3 h-3"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mt-0.5 text-[11px] text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 font-medium text-indigo-500",children:[(0,t.jsx)(q.FolderOpen,{className:"w-3 h-3"}),et.projectName]}),et.gitBranch&&"HEAD"!==et.gitBranch&&(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(O.GitBranch,{className:"w-3 h-3"}),et.gitBranch]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(M.MessageSquare,{className:"w-3 h-3"}),em]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(E.Clock,{className:"w-3 h-3"}),(0,p.formatDateTime)(et.created)]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("button",{onClick:()=>k(!j),className:(0,p.cn)("p-1.5 rounded-md transition-colors text-muted-foreground",j?"bg-zinc-100 dark:bg-zinc-800":"hover:bg-zinc-100 dark:hover:bg-zinc-800"),title:"Notes",children:(0,t.jsx)(P,{className:"w-4 h-4"})}),(0,t.jsx)("button",{onClick:()=>v(!g),className:(0,p.cn)("p-1.5 rounded-md transition-colors text-muted-foreground",g?"bg-zinc-100 dark:bg-zinc-800":"hover:bg-zinc-100 dark:hover:bg-zinc-800"),title:"Toggle sidebar",children:(0,t.jsx)(F.Hash,{className:"w-4 h-4"})})]})]}),!u&&(0,t.jsxs)("div",{className:"flex items-center gap-3 mt-2",children:[(0,t.jsx)(C,{sessionId:et.id,currentTags:et.tags||[],tagObjects:et.tagObjects}),(0,t.jsx)("span",{className:"text-zinc-300 dark:text-zinc-700",children:"|"}),(0,t.jsx)(Q,{sessionId:et.id,currentWorkspaces:et.workspaces})]})]}),u&&(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 bg-blue-50 dark:bg-blue-950/30 border-b border-blue-200 dark:border-blue-800 text-sm text-blue-700 dark:text-blue-300",children:[(0,t.jsx)(L.Globe,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Remote session — viewing from a connected node"})]}),j&&!u&&(0,t.jsxs)("div",{className:"border-b border-zinc-200 dark:border-zinc-800 bg-amber-50/50 dark:bg-amber-950/10 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("span",{className:"text-xs font-medium text-amber-700 dark:text-amber-300 flex items-center gap-1",children:[(0,t.jsx)(P,{className:"w-3 h-3"})," Notes"]}),(0,t.jsx)("button",{onClick:()=>k(!1),className:"text-muted-foreground hover:text-foreground",children:(0,t.jsx)(b.X,{className:"w-3 h-3"})})]}),(0,t.jsx)("textarea",{value:w,onChange:e=>N(e.target.value),onBlur:()=>en.mutate({sessionId:et.id,notes:w}),placeholder:"Add notes about this session...",className:"w-full h-20 text-sm bg-transparent border border-amber-200 dark:border-amber-900/50 rounded-md px-3 py-2 resize-none focus:outline-none focus:ring-1 focus:ring-amber-400"})]}),(0,t.jsx)("div",{ref:J,className:"flex-1 overflow-y-auto",children:(0,t.jsx)("div",{className:"max-w-4xl mx-auto py-6 px-6 space-y-6",children:ea&&0===d.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-20 gap-3",children:[(0,t.jsx)(l.Loader2,{className:"w-6 h-6 animate-spin text-indigo-500"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Loading conversation..."})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"text-center",children:(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground bg-zinc-100 dark:bg-zinc-800 px-3 py-1 rounded-full",children:["Showing ",d.length," of ",em," messages"]})}),d.map((e,s)=>(0,t.jsx)(n.MessageRenderer,{message:e,isLast:s===d.length-1},e.uuid||`msg-${s}`)),ef&&(0,t.jsx)("div",{className:"text-center py-4",children:(0,t.jsxs)("button",{onClick:eh,disabled:ea,className:"px-5 py-2.5 text-sm bg-indigo-500 text-white rounded-lg hover:bg-indigo-600 disabled:opacity-50 transition-colors inline-flex items-center gap-2",children:[ea&&(0,t.jsx)(l.Loader2,{className:"w-4 h-4 animate-spin"}),"Load more (",em-d.length," remaining)"]})}),!ef&&d.length>0&&(0,t.jsx)("div",{className:"text-center py-4",children:(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"End of conversation"})})]})})}),!u&&(0,t.jsx)(y,{sessionId:o,projectPath:et.projectPath,onMessageSent:ec}),(0,t.jsxs)("div",{className:"absolute bottom-4 right-4 flex flex-col gap-1 z-20",style:{marginRight:g?"260px":"0"},children:[(0,t.jsx)("button",{onClick:ed,className:"p-2 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg shadow-sm hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors",title:"Scroll to top",children:(0,t.jsx)(K,{className:"w-4 h-4"})}),(0,t.jsx)("button",{onClick:eu,className:"p-2 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg shadow-sm hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors",title:"Scroll to bottom",children:(0,t.jsx)(I,{className:"w-4 h-4"})})]})]}),g&&(0,t.jsx)("div",{className:"w-[260px] border-l border-zinc-200 dark:border-zinc-800 bg-zinc-50 dark:bg-zinc-950 flex-shrink-0 overflow-y-auto",children:(0,t.jsxs)("div",{className:"p-4 space-y-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:"Session"}),(0,t.jsxs)("div",{className:"space-y-1.5 text-xs",children:[(0,t.jsx)(_,{label:"ID",value:et.sessionId.slice(0,8),mono:!0}),(0,t.jsx)(_,{label:"Created",value:(0,p.formatDateTime)(et.created)}),(0,t.jsx)(_,{label:"Modified",value:(0,p.formatDateTime)(et.modified)}),(0,t.jsx)(_,{label:"Messages",value:String(em)}),et.projectPath&&(0,t.jsx)(_,{label:"Path",value:et.projectPath})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:"Breakdown"}),(0,t.jsxs)("div",{className:"space-y-1",children:[ex.user&&(0,t.jsx)(W,{label:"Your messages",count:ex.user,total:d.length,color:"bg-blue-500"}),ex.assistant&&(0,t.jsx)(W,{label:"Claude responses",count:ex.assistant,total:d.length,color:"bg-indigo-500"}),ex.system&&(0,t.jsx)(W,{label:"System",count:ex.system,total:d.length,color:"bg-zinc-400"})]})]}),Object.keys(ey).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:["Tools Used (",Object.values(ey).reduce((e,t)=>e+t,0),")"]}),(0,t.jsx)("div",{className:"space-y-1",children:Object.entries(ey).sort((e,t)=>t[1]-e[1]).map(([e,s])=>(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,t.jsx)("span",{className:"font-mono text-muted-foreground truncate",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground bg-zinc-200 dark:bg-zinc-800 px-1.5 py-0.5 rounded text-[10px] font-medium",children:s})]},e))})]}),et.workspaces&&et.workspaces.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:"Workspaces"}),(0,t.jsx)("div",{className:"space-y-1",children:et.workspaces.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)("span",{className:"w-2.5 h-2.5 rounded",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{children:e.name})]},e.id))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:"Source File"}),(0,t.jsx)("p",{className:"text-[10px] font-mono text-muted-foreground break-all leading-relaxed",children:et.fullPath})]})]})})]})}function _({label:e,value:s,mono:r}){return(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground flex-shrink-0",children:e}),(0,t.jsx)("span",{className:(0,p.cn)("text-right truncate",r&&"font-mono"),title:s,children:s})]})}function W({label:e,count:s,total:r,color:a}){let i=r>0?s/r*100:0;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs mb-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"font-medium",children:s})]}),(0,t.jsx)("div",{className:"h-1 bg-zinc-200 dark:bg-zinc-800 rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:(0,p.cn)("h-full rounded-full",a),style:{width:`${i}%`}})})]})}e.s(["default",()=>$],91809)}]);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31278,e=>{"use strict";let t=(0,e.i(75254).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>t],31278)},7233,e=>{"use strict";let t=(0,e.i(75254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],7233)},27612,e=>{"use strict";let t=(0,e.i(75254).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",()=>t],27612)},64659,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],64659)},14764,e=>{"use strict";let t=(0,e.i(75254).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["Send",()=>t],14764)},73359,e=>{"use strict";let t={shell:{id:"shell",name:"Shell",command:"",resumeFlag:"",supportsResume:!1,color:"#71717a",description:"Plain terminal shell"},claude:{id:"claude",name:"Claude Code",command:"claude",resumeFlag:"--resume",supportsResume:!0,color:"#d97706",description:"Anthropic Claude Code CLI"},codex:{id:"codex",name:"Codex CLI",command:"codex",resumeFlag:"resume",supportsResume:!0,color:"#10b981",description:"OpenAI Codex CLI"},gemini:{id:"gemini",name:"Gemini CLI",command:"gemini",resumeFlag:"--resume",supportsResume:!0,color:"#3b82f6",description:"Google Gemini CLI"},aider:{id:"aider",name:"Aider",command:"aider",resumeFlag:"",supportsResume:!1,color:"#8b5cf6",description:"AI pair programming in your terminal"},custom:{id:"custom",name:"Custom",command:"",resumeFlag:"",supportsResume:!1,color:"#ec4899",description:"Custom command"}},s=Object.values(t);e.s(["AGENT_LIST",0,s,"AGENT_TYPES",0,t])},34623,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(31278),n=e.i(39616),r=e.i(18566),i=e.i(9165),l=e.i(29320);let c="spaces-terminal-token";function o({children:e}){let o=(0,r.useRouter)(),{isDesktop:u,basePath:d}=(0,l.useTier)(),[m,x]=(0,s.useState)("loading"),[h,p]=(0,s.useState)(""),[f,b]=(0,s.useState)(""),[g,w]=(0,s.useState)(""),[j,y]=(0,s.useState)(!1),k=(0,s.useRef)(null),N=`${d}/spaces_icon.png`;(0,s.useEffect)(()=>{if(u){p("desktop-local"),x("authorized");return}function e(){let e=sessionStorage.getItem(c);if(e){p(e),x("authorized");return}fetch((0,i.api)("/api/auth/totp/status")).then(e=>e.json()).then(e=>{e.enabled?(x("prompt"),setTimeout(()=>k.current?.focus(),100)):x("not-setup")}).catch(()=>x("not-setup"))}fetch((0,i.api)("/api/auth/me")).then(t=>{if(t.ok){p("session-auth"),x("authorized");return}return e()}).catch(()=>e())},[u]);let v=(0,s.useCallback)(async e=>{if(6!==e.length)return;y(!0),w("");let t=await fetch((0,i.api)("/api/auth/totp/verify"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,action:"verify"})}),s=await t.json();y(!1),s.success&&s.terminalToken?(sessionStorage.setItem(c,s.terminalToken),p(s.terminalToken),x("authorized")):(w(s.error||"Invalid code"),b(""),k.current?.focus())},[]);return"loading"===m?(0,t.jsx)("div",{className:"flex items-center justify-center h-screen bg-zinc-950",children:(0,t.jsx)(a.Loader2,{className:"w-6 h-6 animate-spin text-indigo-500"})}):"authorized"===m?(0,t.jsx)(t.Fragment,{children:e(h)}):"not-setup"===m?(0,t.jsx)("div",{className:"flex items-center justify-center h-screen bg-zinc-950",children:(0,t.jsxs)("div",{className:"text-center space-y-4 max-w-sm",children:[(0,t.jsx)("img",{src:N,alt:"Spaces",className:"w-12 h-12 mx-auto opacity-40"}),(0,t.jsx)("h2",{className:"text-lg font-semibold text-white",children:"2FA Required"}),(0,t.jsx)("p",{className:"text-sm text-zinc-400",children:"Two-factor authentication must be set up before you can use terminals."}),(0,t.jsxs)("button",{onClick:()=>o.push("/settings"),className:"inline-flex items-center gap-2 px-4 py-2 text-sm bg-indigo-600 text-white rounded-md hover:bg-indigo-500",children:[(0,t.jsx)(n.Settings,{className:"w-4 h-4"}),"Go to Settings"]})]})}):(0,t.jsx)("div",{className:"flex items-center justify-center h-screen bg-zinc-950",children:(0,t.jsxs)("div",{className:"text-center space-y-4 max-w-sm",children:[(0,t.jsx)("img",{src:N,alt:"Spaces",className:"w-12 h-12 mx-auto"}),(0,t.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Terminal Verification"}),(0,t.jsx)("p",{className:"text-sm text-zinc-400",children:"Enter the 6-digit code from your authenticator app."}),(0,t.jsxs)("div",{children:[(0,t.jsx)("input",{ref:k,type:"text",inputMode:"numeric",autoComplete:"one-time-code",placeholder:"000000",value:f,onChange:e=>{let t;b(t=e.target.value.replace(/\D/g,"").slice(0,6)),w(""),6===t.length&&v(t)},disabled:j,className:"w-48 px-3 py-3 text-2xl font-mono tracking-[0.4em] text-center bg-zinc-800 border border-zinc-700 rounded-lg focus:outline-none focus:border-indigo-500 text-white disabled:opacity-50",autoFocus:!0}),j&&(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 mt-3 text-xs text-zinc-400",children:[(0,t.jsx)(a.Loader2,{className:"w-3 h-3 animate-spin"}),"Verifying..."]}),g&&(0,t.jsx)("p",{className:"text-sm text-red-400 mt-3",children:g})]}),(0,t.jsx)("p",{className:"text-[11px] text-zinc-600",children:"Token is valid for 8 hours after verification."})]})})}e.s(["TotpGate",()=>o])},94351,e=>{"use strict";let t=(0,e.i(75254).default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);e.s(["Home",()=>t],94351)},14661,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(75254);let n=(0,a.default)("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]),r=(0,a.default)("mic-off",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]]);var i=e.i(75157);function l({onTranscript:e}){let{isListening:a,isSupported:l,transcript:c,interimTranscript:o,startListening:u,stopListening:d}=function(){let[e,t]=(0,s.useState)(!1),[a,n]=(0,s.useState)(!1),[r,i]=(0,s.useState)(""),[l,c]=(0,s.useState)(""),o=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=window.SpeechRecognition||window.webkitSpeechRecognition;if(n(!!e),!e)return;let s=new e;s.continuous=!1,s.interimResults=!0,s.lang="en-US",s.onresult=e=>{let t="",s="";for(let a=e.resultIndex;a<e.results.length;a++){let n=e.results[a];n.isFinal?s+=n[0].transcript:t+=n[0].transcript}s?(i(s),c("")):c(t)},s.onerror=()=>{t(!1)},s.onend=()=>{t(!1)},o.current=s},[]);let u=(0,s.useCallback)(()=>{if(o.current&&!e){i(""),c("");try{o.current.start(),t(!0)}catch{}}},[e]);return{isListening:e,isSupported:a,transcript:r,interimTranscript:l,startListening:u,stopListening:(0,s.useCallback)(()=>{if(o.current){try{o.current.stop()}catch{}t(!1)}},[]),resetTranscript:(0,s.useCallback)(()=>{i(""),c("")},[])}}();return((0,s.useEffect)(()=>{c&&e(c)},[c,e]),l)?(0,t.jsxs)("div",{className:"relative flex-shrink-0",children:[(0,t.jsx)("button",{onClick:a?d:u,className:(0,i.cn)("p-2.5 rounded-xl transition-colors",a?"bg-red-500 text-white animate-pulse":"bg-zinc-800 text-zinc-400 hover:text-white"),children:a?(0,t.jsx)(r,{className:"w-4 h-4"}):(0,t.jsx)(n,{className:"w-4 h-4"})}),a&&o&&(0,t.jsx)("div",{className:"absolute bottom-full left-0 mb-2 px-3 py-1.5 bg-zinc-800 border border-zinc-700 rounded-lg text-xs text-zinc-300 whitespace-nowrap max-w-[200px] truncate shadow-xl",children:o})]}):null}e.s(["VoiceInput",()=>l],14661)},19027,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(7233),n=e.i(31278),r=e.i(64659),i=e.i(27612),l=e.i(94351),c=e.i(52008),o=e.i(47167),u=e.i(14661);let d=[{label:"Ctrl",data:null,modifier:"ctrl"},{label:"Esc",data:"\x1b"},{label:"Tab",data:" "},{label:"|",data:"|"},{label:"~",data:"~"},{label:"↑",data:"\x1b[A"},{label:"↓",data:"\x1b[B"},{label:"←",data:"\x1b[D"},{label:"→",data:"\x1b[C"}];function m({onSend:e}){let s=t=>{"ctrl"===t.modifier?e("\0"):t.data&&e(t.data)};return(0,t.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1.5 bg-zinc-900 border-t border-zinc-800 overflow-x-auto",children:[d.map(e=>(0,t.jsx)("button",{onTouchStart:t=>{t.preventDefault(),s(e)},onClick:()=>s(e),className:"flex-shrink-0 px-3 py-1.5 text-xs font-mono bg-zinc-800 border border-zinc-700 rounded text-zinc-300 active:bg-zinc-700 select-none",children:e.label},e.label)),(0,t.jsx)(u.VoiceInput,{onTranscript:e})]})}var x=e.i(14764),h=e.i(75157);function p({onSend:e}){let[a,n]=(0,s.useState)(""),r=(0,s.useRef)(null);(0,s.useEffect)(()=>{r.current&&(r.current.style.height="auto",r.current.style.height=`${Math.min(r.current.scrollHeight,96)}px`)},[a]);let i=(0,s.useCallback)(()=>{a.trim()&&(e(a+"\r"),n(""),r.current?.focus())},[a,e]),l=(0,s.useCallback)(e=>{n(t=>t?`${t} ${e}`:e),r.current?.focus()},[]);return(0,t.jsx)("div",{className:"flex-shrink-0 border-t border-zinc-800 bg-zinc-950 pb-[env(safe-area-inset-bottom)]",children:(0,t.jsxs)("div",{className:"flex items-end gap-2 px-3 py-2",children:[(0,t.jsx)(u.VoiceInput,{onTranscript:l}),(0,t.jsx)("textarea",{ref:r,value:a,onChange:e=>n(e.target.value),placeholder:"Type a command...",rows:1,className:(0,h.cn)("flex-1 resize-none rounded-xl border px-3 py-2 text-sm bg-zinc-900","focus:outline-none focus:ring-1 focus:ring-indigo-500","placeholder:text-zinc-600 border-zinc-700","max-h-[96px]")}),(0,t.jsx)("button",{onClick:i,disabled:!a.trim(),className:(0,h.cn)("p-2.5 rounded-xl flex-shrink-0",a.trim()?"bg-indigo-500 text-white":"bg-zinc-800 text-zinc-600"),children:(0,t.jsx)(x.Send,{className:"w-4 h-4"})})]})})}let f=o.default.env.NEXT_PUBLIC_WS_PATH;function b({pane:a,terminalToken:n,isVisible:r,onIdleChange:i,onUserInput:l}){let c=(0,s.useRef)(null),o=(0,s.useRef)(null),u=(0,s.useRef)(null),d=(0,s.useRef)(null),[x,h]=(0,s.useState)(!1),[b,g]=(0,s.useState)(!1),w=(0,s.useRef)(a);w.current=a;let j=(0,s.useRef)(n);j.current=n;let y=(0,s.useRef)(l);y.current=l;let{idleState:k,markConnected:N,markDataReceived:v,markUserInput:C,markDisconnected:z}=function({paneId:e,onIdleChange:t}){let[a,n]=(0,s.useState)("initializing"),r=(0,s.useRef)(null),i=(0,s.useRef)(null),l=(0,s.useRef)(!1),c=(0,s.useRef)("initializing"),o=(0,s.useRef)(t);o.current=t;let u=(0,s.useRef)(e);u.current=e;let d=(0,s.useCallback)(e=>{c.current!==e&&(c.current=e,n(e),o.current?.(u.current,e))},[]),m=(0,s.useCallback)(()=>{r.current&&(clearTimeout(r.current),r.current=null),i.current&&(clearTimeout(i.current),i.current=null)},[]),x=(0,s.useCallback)(()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{d("idle")},1500)},[d]),h=(0,s.useCallback)(()=>{m(),l.current=!0,d("initializing"),i.current=setTimeout(()=>{l.current=!1,"initializing"===c.current&&x()},3e3)},[m,d,x]),p=(0,s.useCallback)(()=>{l.current||(d("busy"),x())},[d,x]);return{idleState:a,markConnected:h,markDataReceived:p,markUserInput:(0,s.useCallback)(()=>{!l.current&&(d("busy"),r.current&&(clearTimeout(r.current),r.current=null))},[d]),markDisconnected:(0,s.useCallback)(()=>{m(),l.current=!1,d("initializing")},[m,d])}}({paneId:a.id,onIdleChange:i}),S=(0,s.useRef)(!1),T=(0,s.useRef)(!1),R=(0,s.useRef)(null),A=(0,s.useRef)(0),E=(0,s.useCallback)(async()=>{if(!c.current)return;w.current,T.current=!1,A.current=0;let{Terminal:t}=await e.A(16049),{FitAddon:s}=await e.A(59439),{WebLinksAddon:a}=await e.A(16091);o.current&&o.current.dispose();let n=new t({cursorBlink:!0,fontSize:16,fontFamily:"'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, monospace",theme:{background:"#0a0a0a",foreground:"#e4e4e7",cursor:"#6366f1",selectionBackground:"#6366f133",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#fafafa"},allowProposedApi:!0}),r=new s,i=new a;n.loadAddon(r),n.loadAddon(i),n.open(c.current);try{r.fit()}catch{}o.current=n,d.current=r;let l=()=>{try{r.fit()}catch{}};requestAnimationFrame(()=>requestAnimationFrame(l)),setTimeout(l,300);let m=()=>{let e,t,s,a,r;if(T.current)return;A.current>0&&(n.write("\x1b[2J\x1b[H"),n.clear());let i=new WebSocket((t=new URLSearchParams({paneId:(e=w.current).id,cwd:e.cwd,agentType:e.agentType||"shell",cols:String(n.cols),rows:String(n.rows)}),e.claudeSessionId&&t.set("agentSession",e.claudeSessionId),e.customCommand&&t.set("customCommand",e.customCommand),(s=j.current)&&t.set("terminalToken",s),a=f||"/ws",r="https:"===location.protocol?"wss:":"ws:",`${r}//${location.host}${a}?${t}`));u.current=i,i.onopen=()=>{h(!0),g(!1),S.current=!1,A.current=0,N()},i.onmessage=e=>{try{let t=JSON.parse(e.data);"data"===t.type?(n.write(t.data),S.current||v()):"exit"===t.type?(g(!0),S.current=!0,z(),n.write(`\r
|
|
2
|
+
\x1b[90m[Process exited with code ${t.exitCode}]\x1b[0m\r
|
|
3
|
+
`)):"error"===t.type&&n.write(`\r
|
|
4
|
+
\x1b[31m${t.data}\x1b[0m\r
|
|
5
|
+
`)}catch{}},i.onclose=()=>{if(h(!1),z(),!S.current&&!T.current){let e=A.current;if(e<20){let t=Math.min(1e3*Math.pow(1.5,e),3e4);A.current=e+1,R.current=setTimeout(m,t)}}},i.onerror=()=>{h(!1),z()}};n.onData(e=>{u.current?.readyState===WebSocket.OPEN&&(u.current.send(JSON.stringify({type:"data",data:e})),C(),y.current?.(w.current.id))}),n.onResize(({cols:e,rows:t})=>{u.current?.readyState===WebSocket.OPEN&&u.current.send(JSON.stringify({type:"resize",cols:e,rows:t}))}),m()},[N,v,C,z]);(0,s.useEffect)(()=>(E(),()=>{T.current=!0,R.current&&clearTimeout(R.current),u.current?.close(),o.current?.dispose()}),[E]),(0,s.useEffect)(()=>{let e,t=new ResizeObserver(()=>{cancelAnimationFrame(e),e=requestAnimationFrame(()=>{if(d.current)try{d.current.fit()}catch{}})});return c.current&&t.observe(c.current),()=>{cancelAnimationFrame(e),t.disconnect()}},[]),(0,s.useEffect)(()=>{if(r&&d.current){let e=setTimeout(()=>{try{d.current?.fit()}catch{}},50);return()=>clearTimeout(e)}},[r]);let I=(0,s.useCallback)(e=>{u.current?.readyState===WebSocket.OPEN&&(u.current.send(JSON.stringify({type:"data",data:e})),C(),y.current?.(w.current.id))},[C]);return(0,t.jsxs)("div",{className:r?"flex flex-col flex-1 min-h-0":"invisible absolute inset-0 pointer-events-none flex flex-col flex-1 min-h-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-zinc-900 border-b border-zinc-800 text-xs flex-shrink-0",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:a.color}}),(0,t.jsx)("span",{className:"font-medium truncate flex-1",children:a.title}),!x&&!b&&(0,t.jsx)("span",{className:"text-yellow-500",children:"connecting..."}),b&&(0,t.jsx)("button",{onClick:()=>{T.current=!0,R.current&&clearTimeout(R.current),u.current?.close(),o.current?.dispose(),g(!1),S.current=!1,setTimeout(E,100)},className:"text-indigo-400 text-xs",children:"Restart"})]}),(0,t.jsx)("div",{ref:c,className:"flex-1 bg-[#0a0a0a]",style:{minHeight:"200px"}}),(0,t.jsx)(m,{onSend:I}),(0,t.jsx)(p,{onSend:I})]})}var g=e.i(34623),w=e.i(73359),j=e.i(9165),y=e.i(29320);function k(){return(0,t.jsx)(g.TotpGate,{children:e=>(0,t.jsx)(N,{terminalToken:e})})}function N({terminalToken:e}){let{basePath:o}=(0,y.useTier)(),[u,d]=(0,s.useState)([]),[m,x]=(0,s.useState)(!0),[p,f]=(0,s.useState)(!0),[g,k]=(0,s.useState)([]),[N,v]=(0,s.useState)(null),[C,z]=(0,s.useState)(!1),[S,T]=(0,s.useState)(null),[R,A]=(0,s.useState)(!1),[E,I]=(0,s.useState)(!1),[M,P]=(0,s.useState)({}),[O,F]=(0,s.useState)(!0),L=(0,s.useRef)(null),$=(0,s.useRef)(!1),G=(0,s.useCallback)(async()=>{let e=await fetch((0,j.api)("/api/workspaces")),t=await e.json();k(t);let s=t.find(e=>e.isActive);return v(s||null),f(!1),s||null},[]),J=(0,s.useCallback)(async()=>{let e=await fetch((0,j.api)("/api/panes")),t=await e.json();d(t),t.length>0&&!S&&T(t[0].id),x(!1)},[S]);(0,s.useEffect)(()=>{G().then(e=>{e&&z(!0)})},[G]),(0,s.useEffect)(()=>{C&&J()},[C,J]);let _=(0,s.useCallback)(async e=>{await fetch((0,j.api)("/api/workspaces"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"switch",workspaceId:e})}),await G(),T(null),x(!0),P({});let t=await fetch((0,j.api)("/api/panes")),s=await t.json();d(s),s.length>0&&T(s[0].id),x(!1),z(!0),I(!1)},[G]),B=(0,s.useCallback)(async()=>{let e=await fetch((0,j.api)("/api/workspaces"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"New Space",color:"#6366f1"})}),t=await e.json();await _(t.id)},[_]),[D,V]=(0,s.useState)("/");(0,s.useEffect)(()=>{fetch((0,j.api)("/api/config")).then(e=>e.json()).then(e=>{let t=e.devDirectories||[];t.length>0&&V(t[0])}).catch(()=>{})},[]);let H=(0,s.useCallback)(async e=>{let t=w.AGENT_TYPES[e],s="shell"===e?"Terminal":t?.name||"Agent",a=await fetch((0,j.api)("/api/panes"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:s,color:t?.color||"#6366f1",cwd:D,claudeSessionId:"shell"!==e?"new":void 0,agentType:e})}),n=await a.json();d(e=>[...e,n]),T(n.id),A(!1)},[D]),U=(0,s.useCallback)(async e=>{await fetch((0,j.api)(`/api/panes/${e}`),{method:"DELETE"}),P(t=>{let s={...t};return delete s[e],s}),d(t=>{let s=t.filter(t=>t.id!==e);return S===e&&T(s.length>0?s[0].id:null),s})},[S]),W=(0,s.useCallback)((e,t)=>{P(s=>({...s,[e]:t}))},[]),q=(0,s.useCallback)(e=>{if(O){if($.current){$.current=!1;return}L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{P(t=>(d(s=>{let a=s.find(s=>s.id!==e&&"idle"===t[s.id]);return a&&T(a.id),s}),t))},800)}},[O]),Y=(0,s.useCallback)(e=>{L.current&&(clearTimeout(L.current),L.current=null),$.current=!0,T(e)},[]);(0,s.useEffect)(()=>()=>{L.current&&clearTimeout(L.current)},[]);let K=u.filter(e=>e.id!==S&&"idle"===M[e.id]).length;if(!C)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center h-[80dvh] px-6",children:[(0,t.jsx)("img",{src:`${o}/spaces_icon.png`,alt:"Spaces",className:"w-14 h-14 mb-4 opacity-60"}),(0,t.jsx)("h1",{className:"text-lg font-bold mb-1",children:"Spaces"}),(0,t.jsx)("p",{className:"text-zinc-500 text-sm mb-6",children:"Choose a workspace"}),p?(0,t.jsx)(n.Loader2,{className:"w-5 h-5 animate-spin text-indigo-500"}):(0,t.jsxs)("div",{className:"w-full max-w-sm space-y-2",children:[g.map(e=>(0,t.jsxs)("button",{onClick:()=>_(e.id),className:"flex items-center gap-3 w-full p-3.5 bg-zinc-900 border border-zinc-800 rounded-lg active:bg-zinc-800",children:[(0,t.jsx)("span",{className:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"text-sm font-medium flex-1 text-left truncate",children:e.name}),(0,t.jsxs)("span",{className:"text-[11px] text-zinc-500",children:[e.paneCount||0," panes"]})]},e.id)),(0,t.jsxs)("button",{onClick:B,className:"flex items-center justify-center gap-2 w-full p-3 text-sm text-zinc-400 border border-zinc-800 border-dashed rounded-lg",children:[(0,t.jsx)(a.Plus,{className:"w-4 h-4"}),"New Workspace"]})]})]});if(m)return(0,t.jsx)("div",{className:"flex items-center justify-center h-[80dvh]",children:(0,t.jsx)(n.Loader2,{className:"w-5 h-5 animate-spin text-indigo-500"})});let X=u.find(e=>e.id===S);return(0,t.jsxs)("div",{className:"flex flex-col h-[calc(100dvh-64px)]",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-zinc-800 flex-shrink-0 bg-zinc-950",children:[(0,t.jsx)("button",{onClick:()=>z(!1),className:"p-1.5 text-zinc-500 hover:text-white",children:(0,t.jsx)(l.Home,{className:"w-4 h-4"})}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("button",{onClick:()=>I(!E),className:"flex items-center gap-1.5 px-2 py-1 text-xs bg-zinc-900 border border-zinc-800 rounded-md",children:[N&&(0,t.jsx)("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:N.color}}),(0,t.jsx)("span",{className:"max-w-[80px] truncate",children:N?.name||"Space"}),(0,t.jsx)(r.ChevronDown,{className:"w-3 h-3 text-zinc-500"})]}),E&&(0,t.jsx)("div",{className:"absolute z-50 top-full left-0 mt-1 w-56 bg-zinc-800 border border-zinc-700 rounded-lg shadow-xl overflow-hidden",children:g.map(e=>(0,t.jsxs)("button",{onClick:()=>_(e.id),className:"flex items-center gap-2 w-full px-3 py-2.5 text-xs text-left hover:bg-zinc-700",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"truncate flex-1",children:e.name}),(0,t.jsx)("span",{className:"text-zinc-500",children:e.paneCount||0})]},e.id))})]}),(0,t.jsxs)("div",{className:"flex-1 flex items-center gap-1 overflow-x-auto",children:[u.map(e=>{let s=S===e.id,a=!s&&"idle"===M[e.id];return(0,t.jsxs)("button",{onClick:()=>Y(e.id),className:(0,h.cn)("flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-full flex-shrink-0 border transition-shadow",s?"bg-zinc-800 border-zinc-600 text-white":a?"border-transparent text-zinc-300 animate-idle-pulse":"border-transparent text-zinc-500"),style:a?{"--pulse-color":e.color}:void 0,children:[(0,t.jsx)("span",{className:(0,h.cn)("w-1.5 h-1.5 rounded-full",a&&"animate-ping-slow"),style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"max-w-[60px] truncate",children:e.title})]},e.id)}),K>0&&(0,t.jsx)("span",{className:"flex-shrink-0 ml-1 px-1.5 py-0.5 text-[10px] font-bold rounded-full bg-amber-500/20 text-amber-400 border border-amber-500/30",children:K})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[(0,t.jsx)("button",{onClick:()=>F(!O),className:(0,h.cn)("p-1.5 rounded-md transition-colors",O?"text-amber-400 bg-amber-500/10":"text-zinc-600"),title:O?"Auto-switch: on":"Auto-switch: off",children:(0,t.jsx)(c.Layers,{className:"w-3.5 h-3.5"})}),X&&(0,t.jsx)("button",{onClick:()=>U(X.id),className:"p-1.5 text-zinc-500 hover:text-red-400",title:"Close pane",children:(0,t.jsx)(i.Trash2,{className:"w-3.5 h-3.5"})}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("button",{onClick:()=>A(!R),className:"p-1.5 bg-indigo-600 text-white rounded-md",children:(0,t.jsx)(a.Plus,{className:"w-3.5 h-3.5"})}),R&&(0,t.jsx)("div",{className:"absolute z-50 top-full right-0 mt-1 w-48 bg-zinc-800 border border-zinc-700 rounded-lg shadow-xl overflow-hidden",children:w.AGENT_LIST.map(e=>(0,t.jsxs)("button",{onClick:()=>H(e.id),className:"flex items-center gap-2 w-full px-3 py-2.5 text-xs text-left hover:bg-zinc-700",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{children:e.name})]},e.id))})]})]})]}),u.length>0?(0,t.jsx)("div",{className:"flex-1 relative min-h-0",children:u.map(s=>(0,t.jsx)(b,{pane:s,isVisible:s.id===S,onIdleChange:W,onUserInput:q,terminalToken:e},s.id))}):(0,t.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center gap-3",children:[(0,t.jsx)("img",{src:`${o}/spaces_icon.png`,alt:"",className:"w-12 h-12 opacity-20"}),(0,t.jsx)("p",{className:"text-zinc-500 text-sm",children:"No panes."}),(0,t.jsxs)("button",{onClick:()=>H("shell"),className:"px-4 py-2 text-sm bg-indigo-600 text-white rounded-lg flex items-center gap-2",children:[(0,t.jsx)(a.Plus,{className:"w-4 h-4"}),"Add Terminal"]})]})]})}e.s(["default",()=>k],19027)},16049,e=>{e.v(t=>Promise.all(["static/chunks/e40d2bd3b4ce8192.js"].map(t=>e.l(t))).then(()=>t(44908)))},59439,e=>{e.v(t=>Promise.all(["static/chunks/af8bfb72187b7cbf.js"].map(t=>e.l(t))).then(()=>t(93309)))},16091,e=>{e.v(t=>Promise.all(["static/chunks/9768207ca0a51abd.js"].map(t=>e.l(t))).then(()=>t(52216)))}]);
|