@jlongo78/agent-spaces 0.9.7 → 0.9.9
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 +17 -4
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +4 -0
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/routes-manifest.json +29 -0
- 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_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/analytics/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/cortex/page_client-reference-manifest.js +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_client-reference-manifest.js +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.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_client-reference-manifest.js +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.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_client-reference-manifest.js +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_client-reference-manifest.js +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_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 +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- 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 +2 -2
- 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 +3 -3
- 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 +1 -1
- package/.next/standalone/.next/server/app/admin/analytics.segments/_full.segment.rsc +3 -3
- 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 +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin/users/__PAGE__.segment.rsc +1 -1
- 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 +1 -1
- package/.next/standalone/.next/server/app/admin/users.segments/_full.segment.rsc +2 -2
- 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 +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap/analytics/__PAGE__.segment.rsc +1 -1
- 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 +1 -1
- package/.next/standalone/.next/server/app/analytics.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/analytics.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/analytics.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/analytics.segments/_tree.segment.rsc +2 -2
- 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/benchmark/lobes/route.js +1 -1
- package/.next/standalone/.next/server/app/api/benchmark/lobes/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/benchmark/run/route.js +1 -1
- package/.next/standalone/.next/server/app/api/benchmark/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/benchmark/runs/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/benchmark/runs/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/benchmark/runs/route.js +1 -1
- package/.next/standalone/.next/server/app/api/benchmark/runs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/benchmark/status/route.js +1 -1
- package/.next/standalone/.next/server/app/api/benchmark/status/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/claude/usage/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/claude/usage/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/claude/usage/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/claude/usage/route.js +8 -0
- package/.next/standalone/.next/server/app/api/claude/usage/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/claude/usage/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/claude/usage/route_client-reference-manifest.js +2 -0
- 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/cortex/context/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/context/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/curation/assess/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/curation/assess/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/curation/publish/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/curation/publish/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/curation/refine/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/curation/refine/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/curation/review/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/curation/review/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/curation/seed/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/curation/seed/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/export/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/export/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/federation/pending/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/federation/pending/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/federation/resolve/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/federation/resolve/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/federation/search/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/federation/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/federation/teach/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/federation/teach/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/graph/edges/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/graph/edges/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/graph/entities/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/graph/entities/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/graph/entities/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/graph/entities/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/graph/populate/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/graph/populate/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/import/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/import/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/import/status/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/import/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/ingest/bootstrap/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/ingest/bootstrap/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/ingest/status/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/ingest/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/knowledge/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/knowledge/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/knowledge/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/knowledge/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/lobes/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/lobes/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/lobes/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/lobes/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/lobes/share/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/lobes/share/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/marketplace/browse/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/marketplace/browse/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/marketplace/preview/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/marketplace/preview/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/mcp/call/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/mcp/call/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/mcp/tools/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/mcp/tools/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/search/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/settings/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/settings/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/status/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/timeline/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/timeline/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/usage/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/usage/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/cortex/workspace/[id]/context/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cortex/workspace/[id]/context/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/files/route.js +1 -1
- package/.next/standalone/.next/server/app/api/files/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/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/panes/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/panes/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/panes/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/panes/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/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/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]/diff/route.js +1 -1
- package/.next/standalone/.next/server/app/api/panes/[id]/diff/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/proxy/models/[modelId]/[...path]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/proxy/models/[modelId]/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/proxy/models/[modelId]/status/route.js +1 -1
- package/.next/standalone/.next/server/app/api/proxy/models/[modelId]/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/search/route.js +2 -2
- 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 +2 -2
- 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.js +1 -1
- package/.next/standalone/.next/server/app/api/tier/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/whisper/config/route.js +1 -1
- package/.next/standalone/.next/server/app/api/whisper/config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/whisper/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wizard/chart/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/wizard/chart/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/wizard/chart/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/wizard/chart/route.js +7 -0
- package/.next/standalone/.next/server/app/api/wizard/chart/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/wizard/chart/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/wizard/chart/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/wizard/chat/route.js +1 -1
- package/.next/standalone/.next/server/app/api/wizard/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route.js +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route.js +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route.js.nft.json +1 -1
- 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/[id]/todos/[todoId]/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/todos/[todoId]/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/todos/[todoId]/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/todos/[todoId]/route.js +8 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/todos/[todoId]/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/todos/[todoId]/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/todos/[todoId]/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/todos/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/todos/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/todos/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/todos/route.js +8 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/todos/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/todos/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/workspaces/[id]/todos/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/workspaces/route.js +2 -2
- package/.next/standalone/.next/server/app/api/workspaces/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/cortex.html +1 -1
- package/.next/standalone/.next/server/app/cortex.rsc +3 -3
- package/.next/standalone/.next/server/app/cortex.segments/!KGRlc2t0b3Ap/cortex/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/cortex.segments/!KGRlc2t0b3Ap/cortex.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/cortex.segments/!KGRlc2t0b3Ap.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/cortex.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/cortex.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/cortex.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/cortex.segments/_tree.segment.rsc +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/_index.segment.rsc +2 -2
- 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 +1 -1
- package/.next/standalone/.next/server/app/login.segments/login.segment.rsc +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_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 +2 -2
- package/.next/standalone/.next/server/app/m/projects.segments/_full.segment.rsc +2 -2
- 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 +2 -2
- 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 +1 -1
- 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 +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_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 +2 -2
- package/.next/standalone/.next/server/app/m/sessions.segments/_full.segment.rsc +2 -2
- 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 +2 -2
- 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 +1 -1
- 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 +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 +2 -2
- package/.next/standalone/.next/server/app/m/settings.segments/_full.segment.rsc +2 -2
- 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 +2 -2
- 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 +1 -1
- 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 +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 +3 -3
- package/.next/standalone/.next/server/app/m/terminal.segments/_full.segment.rsc +3 -3
- 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 +2 -2
- 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 +1 -1
- package/.next/standalone/.next/server/app/m.html +1 -1
- package/.next/standalone/.next/server/app/m.rsc +2 -2
- package/.next/standalone/.next/server/app/m.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m.segments/_index.segment.rsc +2 -2
- 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 +1 -1
- package/.next/standalone/.next/server/app/m.segments/m.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/network.html +1 -1
- package/.next/standalone/.next/server/app/network.rsc +2 -2
- package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap/network/__PAGE__.segment.rsc +1 -1
- 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 +1 -1
- package/.next/standalone/.next/server/app/network.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/network.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/network.segments/_index.segment.rsc +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap/projects/__PAGE__.segment.rsc +1 -1
- 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 +1 -1
- package/.next/standalone/.next/server/app/projects.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/projects.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/projects.segments/_index.segment.rsc +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap/sessions/__PAGE__.segment.rsc +1 -1
- 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 +1 -1
- package/.next/standalone/.next/server/app/sessions.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/sessions.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/sessions.segments/_index.segment.rsc +2 -2
- 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 +3 -3
- 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 +1 -1
- package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +2 -2
- 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 +3 -3
- 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 +1 -1
- package/.next/standalone/.next/server/app/terminal.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/terminal.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/terminal.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/terminal.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/vr/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/vr/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/vr.html +1 -1
- package/.next/standalone/.next/server/app/vr.rsc +3 -3
- package/.next/standalone/.next/server/app/vr.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/vr.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/vr.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/vr.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/vr.segments/vr/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/vr.segments/vr.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspaces.html +1 -1
- package/.next/standalone/.next/server/app/workspaces.rsc +2 -2
- package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap/workspaces/__PAGE__.segment.rsc +1 -1
- 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 +1 -1
- package/.next/standalone/.next/server/app/workspaces.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/workspaces.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspaces.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/workspaces.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app-paths-manifest.json +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__00e90fc6._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__01ab8675._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__03974f05._.js +111 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__bb331da9._.js → [root-of-the-server]__046c9b91._.js} +16 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04ae6bf0._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__056fa416._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ac4ea3f._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0b8e64cb._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0facd39e._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__10bc76a3._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__115f3934._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__11f155f1._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__160e7c73._.js +50 -33
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__17a3b966._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__17d3a2b2._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1a86c055._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__20b5e9c4._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__28d6fbd8._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2a3f866b._.js +119 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__a95bb38b._.js → [root-of-the-server]__316617e7._.js} +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__32ad8f71._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__35457394._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__35de78e6._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__3685ffcb._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__38954988._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__3a32b624._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__426ad936._.js +119 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__4985c034._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5c6ce9ed._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5cebe58a._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5d5e4789._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__65676930._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__67cab326._.js +58 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__698c6f01._.js +111 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__7ebc4280._.js → [root-of-the-server]__6c64af29._.js} +22 -9
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__73aed9f5._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__79b6a9bb._.js +111 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__e56abacf._.js → [root-of-the-server]__7db704c6._.js} +18 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__812ca02b._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__821f50fa._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8716b86e._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__884ef754._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__88cdbd68._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__89d9aba9._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8c2e1260._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8d536cb5._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8df8c5d1._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8f2ccc41._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__95c9d682._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__9e5d7774._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__9edcff87._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a049dfc2._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a5b4bb9a._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a83262a1._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a9cd1240._.js +111 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__efb8251e._.js → [root-of-the-server]__a9d7f822._.js} +16 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ad08c221._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ad585f2f._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__afcb8f7d._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__bc250d43._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__bce2a6e7._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c011bf91._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c0ac2895._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c37d6380._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__cae392eb._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__cc2616bb._.js +16 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d501fa9b._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d59c6c15._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d5c1db32._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__dba60c86._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__de14b9ae._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e10643d1._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e2a996e5._.js +127 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e3477417._.js +111 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__32dc5513._.js → [root-of-the-server]__e4db362e._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e4e70b86._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e54925af._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e8cbeaca._.js +111 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__cabaac2b._.js → [root-of-the-server]__e8edc5b0._.js} +16 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__eab4d83b._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ead29015._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__f056fd83._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__f0e99572._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__fe1e16d0._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ff9cd277._.js +111 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ffaea2ce._.js +111 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_claude_usage_route_actions_fe002ec1.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_wizard_chart_route_actions_888e2ec1.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_workspaces_[id]_todos_route_actions_0d4ffac5.js +3 -0
- package/.next/standalone/.next/server/chunks/ce889_server_app_api_workspaces_[id]_todos_[todoId]_route_actions_754fe6b9.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__2cffc362._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__f1050870._.js → [root-of-the-server]__47c97637._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__66aca5d4._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_20c2cf3a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_2a1d79e7._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_5c3c4cfa._.js +7 -5
- package/.next/standalone/.next/server/chunks/ssr/_5f55bf8f._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_ba432382._.js +7 -5
- package/.next/standalone/.next/server/chunks/ssr/src_app_(desktop)_cortex_page_tsx_0f33d8b3._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_(desktop)_settings_page_tsx_f74824b3._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_(desktop)_terminal_page_tsx_de5e8d85._.js +4 -4
- package/.next/standalone/.next/server/edge/chunks/[root-of-the-server]__90eeddae._.js +1 -1
- package/.next/standalone/.next/server/middleware-manifest.json +5 -5
- 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/{74d0ac0b1d0a1b79.js → 10b00b4f66102dcf.js} +1 -1
- package/.next/standalone/.next/static/chunks/14216197f9dcbe5b.css +3 -0
- package/.next/standalone/.next/static/chunks/{16eb77953dee9ea3.js → 19c71a8376c23c58.js} +1 -1
- package/.next/standalone/.next/static/chunks/{3e91fc608659c524.js → 350271fe79509caf.js} +1 -1
- package/.next/standalone/.next/static/chunks/4c9fb0a38f041a3d.js +85 -0
- package/.next/standalone/.next/static/chunks/{70423c7afd8abf5f.js → 597847c22200c212.js} +1 -1
- package/.next/standalone/.next/static/chunks/8f6f93ab45a5ff5b.js +1 -0
- package/.next/standalone/.next/static/chunks/{7ecd9bbb0ce4d68a.js → b7c8fe9b7275a84f.js} +1 -1
- package/.next/standalone/.next/static/chunks/{6245135a7afb8c7b.js → c9b10fc55516d142.js} +8 -6
- package/.next/standalone/.next/static/chunks/d0065f48eab94944.js +1 -0
- package/.next/standalone/.next/static/chunks/{e62bb488d02db247.js → d2566c2dcf53fef3.js} +1 -1
- package/.next/standalone/.next/static/chunks/{180c1b9ff31b979f.js → f7b34c807badf95d.js} +8 -6
- package/.next/standalone/.next/static/chunks/{fb0abd1933b2b2e1.js → ff7d85dade44d1f3.js} +1 -1
- package/.next/standalone/.spaces/cortex-context.md +35 -129
- package/.next/standalone/bin/spaces.js +7 -4
- package/.next/standalone/bin/terminal-server.js +48 -10
- package/.next/standalone/cortex-hook-debug.log +118 -23
- package/.next/standalone/docs/features/claude-usage.md +105 -0
- package/.next/standalone/docs/features/workspace-todos.md +127 -0
- package/.next/standalone/docs/superpowers/plans/2026-04-21-workspace-todos.md +1097 -0
- package/.next/standalone/docs/superpowers/plans/2026-04-22-claude-usage-display.md +749 -0
- package/.next/standalone/docs/superpowers/specs/2026-04-21-workspace-todos-design.md +180 -0
- package/.next/standalone/docs/superpowers/specs/2026-04-22-claude-usage-display-design.md +183 -0
- package/.next/standalone/package-lock.json +2 -2
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/src/app/(desktop)/settings/page.tsx +40 -1
- package/.next/standalone/src/app/(desktop)/terminal/page.tsx +98 -7
- package/.next/standalone/src/app/api/benchmark/run/route.ts +24 -3
- package/.next/standalone/src/app/api/claude/usage/route.ts +33 -0
- package/.next/standalone/src/app/api/config/route.ts +3 -0
- package/.next/standalone/src/app/api/cortex/context/route.ts +1 -1
- package/.next/standalone/src/app/api/cortex/knowledge/route.ts +1 -1
- package/.next/standalone/src/app/api/cortex/search/route.ts +14 -2
- package/.next/standalone/src/app/api/folders/route.ts +16 -6
- package/.next/standalone/src/app/api/network/panes/[id]/route.ts +27 -11
- package/.next/standalone/src/app/api/network/panes/route.ts +25 -14
- package/.next/standalone/src/app/api/network/projects/route.ts +11 -4
- package/.next/standalone/src/app/api/network/search/route.ts +21 -14
- package/.next/standalone/src/app/api/network/sessions/[id]/messages/route.ts +18 -11
- package/.next/standalone/src/app/api/network/sessions/[id]/route.ts +16 -9
- package/.next/standalone/src/app/api/network/sessions/route.ts +25 -18
- package/.next/standalone/src/app/api/network/workspaces/[id]/route.ts +21 -12
- package/.next/standalone/src/app/api/network/workspaces/route.ts +16 -14
- package/.next/standalone/src/app/api/whisper/config/route.ts +16 -8
- package/.next/standalone/src/app/api/wizard/chart/route.ts +129 -0
- package/.next/standalone/src/app/api/workspaces/[id]/todos/[todoId]/route.ts +55 -0
- package/.next/standalone/src/app/api/workspaces/[id]/todos/route.ts +43 -0
- package/.next/standalone/src/components/claude/claude-usage-strip.tsx +175 -0
- package/.next/standalone/src/components/cortex/benchmark-tab.tsx +14 -0
- package/.next/standalone/src/components/terminal/terminal-pane.tsx +78 -12
- package/.next/standalone/src/components/wizard/chart-wizard.tsx +405 -0
- package/.next/standalone/src/components/workspace/workspace-todos.tsx +265 -0
- package/.next/standalone/src/hooks/use-benchmark.ts +1 -0
- package/.next/standalone/src/hooks/use-claude-usage.ts +66 -0
- package/.next/standalone/src/hooks/use-speech-recognition.ts +2 -1
- package/.next/standalone/src/lib/claude/credentials.ts +36 -0
- package/.next/standalone/src/lib/claude/usage.ts +69 -0
- package/.next/standalone/src/lib/config.ts +3 -0
- package/.next/standalone/src/lib/cortex/benchmark.ts +17 -1
- package/.next/standalone/src/lib/cortex/index.ts +54 -1
- package/.next/standalone/src/lib/db/queries.ts +105 -90
- package/.next/standalone/src/lib/db/schema.ts +18 -0
- package/.next/standalone/src/lib/shell-user.ts +101 -0
- package/.next/standalone/src/types/claude.ts +39 -0
- package/.next/standalone/tests/db/workspace-todos.test.ts +156 -0
- package/bin/spaces.js +7 -4
- package/bin/terminal-server.js +48 -10
- package/package.json +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__00fdfbda._.js +0 -114
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04f04898._.js +0 -106
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0903a426._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__09e8ccc9._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__11c684b1._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1572d4ef._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__186cd0bb._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__194955d4._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1f054c65._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__212760e6._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__228595ec._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2384f98e._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__277d9445._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__283c890f._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2a2c5fc5._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2d7a454e._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2f300a68._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2f452778._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__35f8e77e._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__379fc2e9._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__3b40d79f._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__3d3dca2b._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__49e42a3a._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__4d5b78d2._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__4d903941._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__54163e52._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__563c0817._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5812f90a._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5c5e87f5._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__60d15b16._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__614458b7._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__69d315e5._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__6fe5e6c8._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__71f29038._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__74084e07._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__7921aa80._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__7e077dd8._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__857c60bb._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__874fe565._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8e2171f7._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__91e23c96._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__929ea03a._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__95659b2d._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__9679b91e._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__9d68157b._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a90729a1._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ac39ecc7._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ac84b704._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ad4346fa._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b0862d69._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b43306ee._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b689ff5e._.js +0 -106
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ba87daaa._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c0461005._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c1deb5f3._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c8a62f42._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__cb027619._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__cc6e2885._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__cf608218._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__cfc1290d._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d0109b9b._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d0125483._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d048ee6b._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d12644e7._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d95165f0._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e3cc946c._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e6fd27f8._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__eafd040b._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__f44c6882._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__f85283de._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__feceb3e4._.js +0 -98
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__843070a6._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_3ba93bdd._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_e84a0c06._.js +0 -3
- package/.next/standalone/.next/static/chunks/074df89a63b6a854.js +0 -1
- package/.next/standalone/.next/static/chunks/9d4164833c2c1fd6.js +0 -85
- package/.next/standalone/.next/static/chunks/bffaf378f7745d59.css +0 -3
- package/.next/standalone/.next/static/chunks/f091f4bf8d80fd07.js +0 -1
- /package/.next/standalone/.next/static/{0KefPNmR9NsrZHWWt9Xr7 → bAQs2gDlFrq3e8w9ni9tr}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{0KefPNmR9NsrZHWWt9Xr7 → bAQs2gDlFrq3e8w9ni9tr}/_clientMiddlewareManifest.json +0 -0
- /package/.next/standalone/.next/static/{0KefPNmR9NsrZHWWt9Xr7 → bAQs2gDlFrq3e8w9ni9tr}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,531278,e=>{"use strict";let t=(0,e.i(475254).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>t],531278)},107233,e=>{"use strict";let t=(0,e.i(475254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],107233)},727612,e=>{"use strict";let t=(0,e.i(475254).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],727612)},664659,e=>{"use strict";let t=(0,e.i(475254).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],664659)},463059,e=>{"use strict";let t=(0,e.i(475254).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],463059)},514764,e=>{"use strict";let t=(0,e.i(475254).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],514764)},387951,687246,e=>{"use strict";var t=e.i(475254);let n=(0,t.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"}]]);e.s(["Mic",()=>n],387951);let r=(0,t.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"}]]);e.s(["MicOff",()=>r],687246)},73359,e=>{"use strict";let t={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"},forge:{id:"forge",name:"Forge",command:"forge",resumeFlag:"--cid",supportsResume:!0,color:"#f43f5e",description:"ForgeCode.dev agentic CLI"},copilot:{id:"copilot",name:"Copilot CLI",command:"copilot",resumeFlag:"--resume",supportsResume:!0,color:"#6366f1",description:"GitHub Copilot CLI - agentic coding in your terminal"},pi:{id:"pi",name:"Pi",command:"pi",resumeFlag:"--continue",supportsResume:!0,color:"#f97316",description:"Pi Coding Agent - extensible AI development CLI"},shell:{id:"shell",name:"Shell",command:"",resumeFlag:"",supportsResume:!1,color:"#71717a",description:"Plain terminal shell"},custom:{id:"custom",name:"Custom",command:"",resumeFlag:"",supportsResume:!1,color:"#ec4899",description:"Custom command"}},n=Object.values(t);e.s(["AGENT_LIST",0,n,"AGENT_TYPES",0,t])},534623,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(531278),s=e.i(239616),a=e.i(618566),i=e.i(209165),l=e.i(28916);let c="spaces-terminal-token";function o({children:e}){let o=(0,a.useRouter)(),{isDesktop:u,basePath:d}=(0,l.useTier)(),[m,h]=(0,n.useState)("loading"),[p,x]=(0,n.useState)(""),[f,b]=(0,n.useState)(""),[g,w]=(0,n.useState)(""),[y,j]=(0,n.useState)(!1),v=(0,n.useRef)(null),k=`${d}/spaces_icon.png`;(0,n.useEffect)(()=>{if(u){x("desktop-local"),h("authorized");return}function e(){let e=sessionStorage.getItem(c);if(e){x(e),h("authorized");return}fetch((0,i.api)("/api/auth/totp/status")).then(e=>e.json()).then(e=>{e.enabled?(h("prompt"),setTimeout(()=>v.current?.focus(),100)):h("not-setup")}).catch(()=>h("not-setup"))}fetch((0,i.api)("/api/auth/me")).then(t=>{if(t.ok){x("session-auth"),h("authorized");return}return e()}).catch(()=>e())},[u]);let N=(0,n.useCallback)(async e=>{if(6!==e.length)return;j(!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"})}),n=await t.json();j(!1),n.success&&n.terminalToken?(sessionStorage.setItem(c,n.terminalToken),x(n.terminalToken),h("authorized")):(w(n.error||"Invalid code"),b(""),v.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(p)}):"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:k,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)(s.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:k,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:v,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&&N(t)},disabled:y,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}),y&&(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..."]}),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])},87309,e=>{"use strict";let t=(0,e.i(475254).default)("audio-lines",[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]);e.s(["AudioLines",()=>t],87309)},694351,e=>{"use strict";let t=(0,e.i(475254).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],694351)},23284,e=>{"use strict";var t=e.i(271645);function n(){let[e,n]=(0,t.useState)(!1),[r,s]=(0,t.useState)(!1),[a,i]=(0,t.useState)(""),[l,c]=(0,t.useState)(""),o=(0,t.useRef)(null);(0,t.useEffect)(()=>{let e,t;try{e=window.SpeechRecognition||window.webkitSpeechRecognition}catch{}if(s(!!e),e){try{(t=new e).continuous=!1,t.interimResults=!0,t.lang="en-US"}catch{s(!1);return}t.onresult=e=>{let t="",n="";for(let r=e.resultIndex;r<e.results.length;r++){let s=e.results[r];s.isFinal?n+=s[0].transcript:t+=s[0].transcript}n?(i(n),c("")):c(t)},t.onerror=()=>{n(!1)},t.onend=()=>{n(!1)},o.current=t}},[]);let u=(0,t.useCallback)(()=>{if(o.current&&!e){i(""),c("");try{o.current.start(),n(!0)}catch{}}},[e]);return{isListening:e,isSupported:r,transcript:a,interimTranscript:l,startListening:u,stopListening:(0,t.useCallback)(()=>{if(o.current){try{o.current.stop()}catch{}n(!1)}},[]),resetTranscript:(0,t.useCallback)(()=>{i(""),c("")},[])}}e.s(["useSpeechRecognition",()=>n])},114661,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(387951),s=e.i(687246),a=e.i(23284),i=e.i(975157);function l({onTranscript:e}){let{isListening:l,isSupported:c,transcript:o,interimTranscript:u,startListening:d,stopListening:m}=(0,a.useSpeechRecognition)();return((0,n.useEffect)(()=>{o&&e(o)},[o,e]),c)?(0,t.jsxs)("div",{className:"relative flex-shrink-0",children:[(0,t.jsx)("button",{onClick:l?m:d,className:(0,i.cn)("p-2.5 rounded-xl transition-colors",l?"bg-red-500 text-white animate-pulse":"bg-zinc-800 text-zinc-400 hover:text-white"),children:l?(0,t.jsx)(s.MicOff,{className:"w-4 h-4"}):(0,t.jsx)(r.Mic,{className:"w-4 h-4"})}),l&&u&&(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:u})]}):null}e.s(["VoiceInput",()=>l])},619027,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(107233),s=e.i(531278),a=e.i(664659),i=e.i(727612),l=e.i(694351),c=e.i(852008),o=e.i(247167),u=e.i(463059);let d=[{label:"Enter",data:"\r"},{label:"Ctrl+C",data:"\x03"},{label:"Esc",data:"\x1b"},{label:"Tab",data:" "},{label:"↑",data:"\x1b[A"},{label:"↓",data:"\x1b[B"},{label:"y",data:"y"},{label:"n",data:"n"}],m=[{label:"←",data:"\x1b[D"},{label:"→",data:"\x1b[C"},{label:"|",data:"|"},{label:"~",data:"~"},{label:"/",data:"/"},{label:"Ctrl+D",data:"\x04"},{label:"Ctrl+L",data:"\f"},{label:"Ctrl+Z",data:"\x1a"}];function h({onSend:e}){let[r,s]=(0,n.useState)(!1),a=(n,r)=>(0,t.jsx)("button",{onTouchStart:t=>{t.preventDefault(),e(n.data)},onClick:()=>e(n.data),className:`flex-shrink-0 px-3 py-1.5 text-xs font-mono border rounded select-none active:bg-zinc-600 ${r?"bg-indigo-600 border-indigo-500 text-white":"bg-zinc-800 border-zinc-700 text-zinc-300"}`,children:n.label},n.label);return(0,t.jsxs)("div",{className:"flex flex-col border-t border-zinc-800 bg-zinc-900",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1.5 overflow-x-auto",children:[d.map(e=>a(e,"Enter"===e.label)),(0,t.jsx)("button",{onClick:()=>s(!r),className:`flex-shrink-0 px-2 py-1.5 text-xs font-mono border rounded select-none ${r?"bg-zinc-700 border-zinc-600 text-zinc-200":"bg-zinc-800 border-zinc-700 text-zinc-500"}`,children:(0,t.jsx)(u.ChevronRight,{className:`w-3 h-3 transition-transform ${r?"rotate-90":""}`})})]}),r&&(0,t.jsx)("div",{className:"flex items-center gap-1 px-2 py-1.5 border-t border-zinc-800 overflow-x-auto",children:m.map(e=>a(e))})]})}var p=e.i(514764),x=e.i(114661),f=e.i(87309),b=e.i(975157);function g({onSend:e,size:r="md"}){let[s,a]=(0,n.useState)(!1),i=(0,n.useRef)(!1),l=(0,n.useRef)(null),c=!/Quest|Oculus|Pacific/i.test(navigator.userAgent)&&("SpeechRecognition"in window||"webkitSpeechRecognition"in window),o=(0,n.useCallback)(()=>{if(!i.current)return;let t=window.SpeechRecognition||window.webkitSpeechRecognition;if(!t)return;let n=new t;n.continuous=!0,n.interimResults=!1,n.lang="en-US",n.onresult=t=>{if(i.current){for(let n=t.resultIndex;n<t.results.length;n++)if(t.results[n].isFinal){let r=t.results[n][0].transcript.trim();r&&e(r+"\r")}}},n.onerror=e=>{if("not-allowed"===e.error||"service-not-allowed"===e.error){i.current=!1,a(!1);return}i.current&&setTimeout(o,500)},n.onend=()=>{i.current&&"visible"===document.visibilityState?setTimeout(o,100):i.current?a(!0):a(!1)},l.current=n,n.start()},[e]);(0,n.useEffect)(()=>{let e=()=>{"visible"===document.visibilityState&&i.current&&!l.current&&o()};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[o]),(0,n.useEffect)(()=>()=>{if(i.current=!1,l.current)try{l.current.abort()}catch{}},[]);let u=(0,n.useCallback)(()=>{if(i.current){if(i.current=!1,a(!1),l.current){try{l.current.abort()}catch{}l.current=null}}else i.current=!0,a(!0),o()},[o]);return c?(0,t.jsx)("button",{onClick:u,className:(0,b.cn)(`${"sm"===r?"p-1":"p-2.5"} rounded-full flex-shrink-0 transition-all`,s?"bg-green-600 text-white shadow-[0_0_12px_rgba(34,197,94,0.5)] animate-pulse":"bg-zinc-800 text-zinc-400 hover:text-green-400 hover:bg-zinc-700"),title:s?"Exit immersive voice":"Immersive voice (auto-send)",children:(0,t.jsx)(f.AudioLines,{className:"sm"===r?"w-3.5 h-3.5":"w-4 h-4"})}):null}function w({onSend:e}){let[r,s]=(0,n.useState)(""),a=(0,n.useRef)(null);(0,n.useEffect)(()=>{a.current&&(a.current.style.height="auto",a.current.style.height=`${Math.min(a.current.scrollHeight,96)}px`)},[r]);let i=(0,n.useCallback)(()=>{r.trim()&&(e(r+"\r"),s(""),a.current?.focus())},[r,e]),l=(0,n.useCallback)(e=>{s(t=>t?`${t} ${e}`:e),a.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)(x.VoiceInput,{onTranscript:l}),(0,t.jsx)(g,{onSend:e}),(0,t.jsx)("textarea",{ref:a,id:"mobile-terminal-input",value:r,onChange:e=>s(e.target.value),placeholder:"Type a command...",rows:1,className:(0,b.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:!r.trim(),className:(0,b.cn)("p-2.5 rounded-xl flex-shrink-0",r.trim()?"bg-indigo-500 text-white":"bg-zinc-800 text-zinc-600"),children:(0,t.jsx)(p.Send,{className:"w-4 h-4"})})]})})}let y=o.default.env.NEXT_PUBLIC_WS_PATH;function j({pane:r,terminalToken:s,isVisible:a,onIdleChange:i,onUserInput:l}){let c=(0,n.useRef)(null),o=(0,n.useRef)(null),u=(0,n.useRef)(null),d=(0,n.useRef)(null),[m,p]=(0,n.useState)(!1),[x,f]=(0,n.useState)(!1),b=(0,n.useRef)(r);b.current=r;let g=(0,n.useRef)(s);g.current=s;let j=(0,n.useRef)(l);j.current=l;let{idleState:v,markConnected:k,markDataReceived:N,markUserInput:C,markDisconnected:S}=function({paneId:e,onIdleChange:t}){let[r,s]=(0,n.useState)("initializing"),a=(0,n.useRef)(null),i=(0,n.useRef)(null),l=(0,n.useRef)(!1),c=(0,n.useRef)("initializing"),o=(0,n.useRef)(t);o.current=t;let u=(0,n.useRef)(e);u.current=e;let d=(0,n.useCallback)(e=>{c.current!==e&&(c.current=e,s(e),o.current?.(u.current,e))},[]),m=(0,n.useCallback)(()=>{a.current&&(clearTimeout(a.current),a.current=null),i.current&&(clearTimeout(i.current),i.current=null)},[]),h=(0,n.useCallback)(()=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{d("idle")},1500)},[d]),p=(0,n.useCallback)(()=>{m(),l.current=!0,d("initializing"),i.current=setTimeout(()=>{l.current=!1,"initializing"===c.current&&h()},3e3)},[m,d,h]),x=(0,n.useCallback)(()=>{l.current||(d("busy"),h())},[d,h]);return{idleState:r,markConnected:p,markDataReceived:x,markUserInput:(0,n.useCallback)(()=>{!l.current&&(d("busy"),a.current&&(clearTimeout(a.current),a.current=null))},[d]),markDisconnected:(0,n.useCallback)(()=>{m(),l.current=!1,d("initializing")},[m,d])}}({paneId:r.id,onIdleChange:i}),z=(0,n.useRef)(!1),T=(0,n.useRef)(!1),R=(0,n.useRef)(null),A=(0,n.useRef)(0),E=(0,n.useCallback)(async()=>{if(!c.current)return;b.current,T.current=!1,A.current=0;let{Terminal:t}=await e.A(116049),{FitAddon:n}=await e.A(359439),{WebLinksAddon:r}=await e.A(816091);o.current&&o.current.dispose();let s=new t({cursorBlink:!1,disableStdin:!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}),a=new n,i=new r;s.loadAddon(a),s.loadAddon(i),s.open(c.current);try{a.fit()}catch{}o.current=s,d.current=a;let l=()=>{try{a.fit()}catch{}};requestAnimationFrame(()=>requestAnimationFrame(l)),setTimeout(l,300);let m=()=>{let e,t,n,r,a;if(T.current)return;A.current>0&&(s.write("\x1b[2J\x1b[H"),s.clear());let i=new WebSocket((t=new URLSearchParams({paneId:(e=b.current).id,cwd:e.cwd,agentType:e.agentType||"shell",cols:String(s.cols),rows:String(s.rows)}),e.claudeSessionId&&t.set("agentSession",e.claudeSessionId),e.customCommand&&t.set("customCommand",e.customCommand),(n=g.current)&&t.set("terminalToken",n),r=y||"/ws",a="https:"===location.protocol?"wss:":"ws:",`${a}//${location.host}${r}?${t}`));u.current=i,i.onopen=()=>{p(!0),f(!1),z.current=!1,A.current=0,k()},i.onmessage=e=>{try{let t=JSON.parse(e.data);"data"===t.type?(s.write(t.data),z.current||N()):"exit"===t.type?(f(!0),z.current=!0,S(),s.write(`\r
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,531278,e=>{"use strict";let t=(0,e.i(475254).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>t],531278)},107233,e=>{"use strict";let t=(0,e.i(475254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],107233)},727612,e=>{"use strict";let t=(0,e.i(475254).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],727612)},664659,e=>{"use strict";let t=(0,e.i(475254).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],664659)},463059,e=>{"use strict";let t=(0,e.i(475254).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],463059)},514764,e=>{"use strict";let t=(0,e.i(475254).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],514764)},387951,687246,e=>{"use strict";var t=e.i(475254);let n=(0,t.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"}]]);e.s(["Mic",()=>n],387951);let r=(0,t.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"}]]);e.s(["MicOff",()=>r],687246)},73359,e=>{"use strict";let t={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"},forge:{id:"forge",name:"Forge",command:"forge",resumeFlag:"--cid",supportsResume:!0,color:"#f43f5e",description:"ForgeCode.dev agentic CLI"},copilot:{id:"copilot",name:"Copilot CLI",command:"copilot",resumeFlag:"--resume",supportsResume:!0,color:"#6366f1",description:"GitHub Copilot CLI - agentic coding in your terminal"},pi:{id:"pi",name:"Pi",command:"pi",resumeFlag:"--continue",supportsResume:!0,color:"#f97316",description:"Pi Coding Agent - extensible AI development CLI"},shell:{id:"shell",name:"Shell",command:"",resumeFlag:"",supportsResume:!1,color:"#71717a",description:"Plain terminal shell"},custom:{id:"custom",name:"Custom",command:"",resumeFlag:"",supportsResume:!1,color:"#ec4899",description:"Custom command"}},n=Object.values(t);e.s(["AGENT_LIST",0,n,"AGENT_TYPES",0,t])},534623,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(531278),s=e.i(239616),a=e.i(618566),i=e.i(209165),l=e.i(28916);let c="spaces-terminal-token";function o({children:e}){let o=(0,a.useRouter)(),{isDesktop:u,basePath:d}=(0,l.useTier)(),[m,h]=(0,n.useState)("loading"),[p,x]=(0,n.useState)(""),[f,b]=(0,n.useState)(""),[g,w]=(0,n.useState)(""),[y,j]=(0,n.useState)(!1),v=(0,n.useRef)(null),k=`${d}/spaces_icon.png`;(0,n.useEffect)(()=>{if(u){x("desktop-local"),h("authorized");return}function e(){let e=sessionStorage.getItem(c);if(e){x(e),h("authorized");return}fetch((0,i.api)("/api/auth/totp/status")).then(e=>e.json()).then(e=>{e.enabled?(h("prompt"),setTimeout(()=>v.current?.focus(),100)):h("not-setup")}).catch(()=>h("not-setup"))}fetch((0,i.api)("/api/auth/me")).then(t=>{if(t.ok){x("session-auth"),h("authorized");return}return e()}).catch(()=>e())},[u]);let N=(0,n.useCallback)(async e=>{if(6!==e.length)return;j(!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"})}),n=await t.json();j(!1),n.success&&n.terminalToken?(sessionStorage.setItem(c,n.terminalToken),x(n.terminalToken),h("authorized")):(w(n.error||"Invalid code"),b(""),v.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(p)}):"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:k,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)(s.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:k,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:v,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&&N(t)},disabled:y,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}),y&&(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..."]}),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])},87309,e=>{"use strict";let t=(0,e.i(475254).default)("audio-lines",[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]);e.s(["AudioLines",()=>t],87309)},694351,e=>{"use strict";let t=(0,e.i(475254).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],694351)},23284,e=>{"use strict";var t=e.i(271645);function n(){let[e,n]=(0,t.useState)(!1),[r,s]=(0,t.useState)(!1),[a,i]=(0,t.useState)(""),[l,c]=(0,t.useState)(""),o=(0,t.useRef)(null);(0,t.useEffect)(()=>{let e,t;try{e=window.SpeechRecognition||window.webkitSpeechRecognition}catch{}if(s(!!e),e){try{(t=new e).continuous=!1,t.interimResults=!0,t.lang="en-US"}catch{s(!1);return}t.onresult=e=>{let t="",n="";for(let r=e.resultIndex;r<e.results.length;r++){let s=e.results[r];s.isFinal?n+=s[0].transcript:t+=s[0].transcript}n?(i(n),c("")):c(t)},t.onerror=e=>{console.error("[SpeechRecognition] error:",e.error,e.message),n(!1)},t.onend=()=>{n(!1)},o.current=t}},[]);let u=(0,t.useCallback)(()=>{if(o.current&&!e){i(""),c("");try{o.current.start(),n(!0)}catch{}}},[e]);return{isListening:e,isSupported:r,transcript:a,interimTranscript:l,startListening:u,stopListening:(0,t.useCallback)(()=>{if(o.current){try{o.current.stop()}catch{}n(!1)}},[]),resetTranscript:(0,t.useCallback)(()=>{i(""),c("")},[])}}e.s(["useSpeechRecognition",()=>n])},114661,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(387951),s=e.i(687246),a=e.i(23284),i=e.i(975157);function l({onTranscript:e}){let{isListening:l,isSupported:c,transcript:o,interimTranscript:u,startListening:d,stopListening:m}=(0,a.useSpeechRecognition)();return((0,n.useEffect)(()=>{o&&e(o)},[o,e]),c)?(0,t.jsxs)("div",{className:"relative flex-shrink-0",children:[(0,t.jsx)("button",{onClick:l?m:d,className:(0,i.cn)("p-2.5 rounded-xl transition-colors",l?"bg-red-500 text-white animate-pulse":"bg-zinc-800 text-zinc-400 hover:text-white"),children:l?(0,t.jsx)(s.MicOff,{className:"w-4 h-4"}):(0,t.jsx)(r.Mic,{className:"w-4 h-4"})}),l&&u&&(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:u})]}):null}e.s(["VoiceInput",()=>l])},619027,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(107233),s=e.i(531278),a=e.i(664659),i=e.i(727612),l=e.i(694351),c=e.i(852008),o=e.i(247167),u=e.i(463059);let d=[{label:"Enter",data:"\r"},{label:"Ctrl+C",data:"\x03"},{label:"Esc",data:"\x1b"},{label:"Tab",data:" "},{label:"↑",data:"\x1b[A"},{label:"↓",data:"\x1b[B"},{label:"y",data:"y"},{label:"n",data:"n"}],m=[{label:"←",data:"\x1b[D"},{label:"→",data:"\x1b[C"},{label:"|",data:"|"},{label:"~",data:"~"},{label:"/",data:"/"},{label:"Ctrl+D",data:"\x04"},{label:"Ctrl+L",data:"\f"},{label:"Ctrl+Z",data:"\x1a"}];function h({onSend:e}){let[r,s]=(0,n.useState)(!1),a=(n,r)=>(0,t.jsx)("button",{onTouchStart:t=>{t.preventDefault(),e(n.data)},onClick:()=>e(n.data),className:`flex-shrink-0 px-3 py-1.5 text-xs font-mono border rounded select-none active:bg-zinc-600 ${r?"bg-indigo-600 border-indigo-500 text-white":"bg-zinc-800 border-zinc-700 text-zinc-300"}`,children:n.label},n.label);return(0,t.jsxs)("div",{className:"flex flex-col border-t border-zinc-800 bg-zinc-900",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1.5 overflow-x-auto",children:[d.map(e=>a(e,"Enter"===e.label)),(0,t.jsx)("button",{onClick:()=>s(!r),className:`flex-shrink-0 px-2 py-1.5 text-xs font-mono border rounded select-none ${r?"bg-zinc-700 border-zinc-600 text-zinc-200":"bg-zinc-800 border-zinc-700 text-zinc-500"}`,children:(0,t.jsx)(u.ChevronRight,{className:`w-3 h-3 transition-transform ${r?"rotate-90":""}`})})]}),r&&(0,t.jsx)("div",{className:"flex items-center gap-1 px-2 py-1.5 border-t border-zinc-800 overflow-x-auto",children:m.map(e=>a(e))})]})}var p=e.i(514764),x=e.i(114661),f=e.i(87309),b=e.i(975157);function g({onSend:e,size:r="md"}){let[s,a]=(0,n.useState)(!1),i=(0,n.useRef)(!1),l=(0,n.useRef)(null),c=!/Quest|Oculus|Pacific/i.test(navigator.userAgent)&&("SpeechRecognition"in window||"webkitSpeechRecognition"in window),o=(0,n.useCallback)(()=>{if(!i.current)return;let t=window.SpeechRecognition||window.webkitSpeechRecognition;if(!t)return;let n=new t;n.continuous=!0,n.interimResults=!1,n.lang="en-US",n.onresult=t=>{if(i.current){for(let n=t.resultIndex;n<t.results.length;n++)if(t.results[n].isFinal){let r=t.results[n][0].transcript.trim();r&&e(r+"\r")}}},n.onerror=e=>{if("not-allowed"===e.error||"service-not-allowed"===e.error){i.current=!1,a(!1);return}i.current&&setTimeout(o,500)},n.onend=()=>{i.current&&"visible"===document.visibilityState?setTimeout(o,100):i.current?a(!0):a(!1)},l.current=n,n.start()},[e]);(0,n.useEffect)(()=>{let e=()=>{"visible"===document.visibilityState&&i.current&&!l.current&&o()};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[o]),(0,n.useEffect)(()=>()=>{if(i.current=!1,l.current)try{l.current.abort()}catch{}},[]);let u=(0,n.useCallback)(()=>{if(i.current){if(i.current=!1,a(!1),l.current){try{l.current.abort()}catch{}l.current=null}}else i.current=!0,a(!0),o()},[o]);return c?(0,t.jsx)("button",{onClick:u,className:(0,b.cn)(`${"sm"===r?"p-1":"p-2.5"} rounded-full flex-shrink-0 transition-all`,s?"bg-green-600 text-white shadow-[0_0_12px_rgba(34,197,94,0.5)] animate-pulse":"bg-zinc-800 text-zinc-400 hover:text-green-400 hover:bg-zinc-700"),title:s?"Exit immersive voice":"Immersive voice (auto-send)",children:(0,t.jsx)(f.AudioLines,{className:"sm"===r?"w-3.5 h-3.5":"w-4 h-4"})}):null}function w({onSend:e}){let[r,s]=(0,n.useState)(""),a=(0,n.useRef)(null);(0,n.useEffect)(()=>{a.current&&(a.current.style.height="auto",a.current.style.height=`${Math.min(a.current.scrollHeight,96)}px`)},[r]);let i=(0,n.useCallback)(()=>{r.trim()&&(e(r+"\r"),s(""),a.current?.focus())},[r,e]),l=(0,n.useCallback)(e=>{s(t=>t?`${t} ${e}`:e),a.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)(x.VoiceInput,{onTranscript:l}),(0,t.jsx)(g,{onSend:e}),(0,t.jsx)("textarea",{ref:a,id:"mobile-terminal-input",value:r,onChange:e=>s(e.target.value),placeholder:"Type a command...",rows:1,className:(0,b.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:!r.trim(),className:(0,b.cn)("p-2.5 rounded-xl flex-shrink-0",r.trim()?"bg-indigo-500 text-white":"bg-zinc-800 text-zinc-600"),children:(0,t.jsx)(p.Send,{className:"w-4 h-4"})})]})})}let y=o.default.env.NEXT_PUBLIC_WS_PATH;function j({pane:r,terminalToken:s,isVisible:a,onIdleChange:i,onUserInput:l}){let c=(0,n.useRef)(null),o=(0,n.useRef)(null),u=(0,n.useRef)(null),d=(0,n.useRef)(null),[m,p]=(0,n.useState)(!1),[x,f]=(0,n.useState)(!1),b=(0,n.useRef)(r);b.current=r;let g=(0,n.useRef)(s);g.current=s;let j=(0,n.useRef)(l);j.current=l;let{idleState:v,markConnected:k,markDataReceived:N,markUserInput:C,markDisconnected:S}=function({paneId:e,onIdleChange:t}){let[r,s]=(0,n.useState)("initializing"),a=(0,n.useRef)(null),i=(0,n.useRef)(null),l=(0,n.useRef)(!1),c=(0,n.useRef)("initializing"),o=(0,n.useRef)(t);o.current=t;let u=(0,n.useRef)(e);u.current=e;let d=(0,n.useCallback)(e=>{c.current!==e&&(c.current=e,s(e),o.current?.(u.current,e))},[]),m=(0,n.useCallback)(()=>{a.current&&(clearTimeout(a.current),a.current=null),i.current&&(clearTimeout(i.current),i.current=null)},[]),h=(0,n.useCallback)(()=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{d("idle")},1500)},[d]),p=(0,n.useCallback)(()=>{m(),l.current=!0,d("initializing"),i.current=setTimeout(()=>{l.current=!1,"initializing"===c.current&&h()},3e3)},[m,d,h]),x=(0,n.useCallback)(()=>{l.current||(d("busy"),h())},[d,h]);return{idleState:r,markConnected:p,markDataReceived:x,markUserInput:(0,n.useCallback)(()=>{!l.current&&(d("busy"),a.current&&(clearTimeout(a.current),a.current=null))},[d]),markDisconnected:(0,n.useCallback)(()=>{m(),l.current=!1,d("initializing")},[m,d])}}({paneId:r.id,onIdleChange:i}),z=(0,n.useRef)(!1),T=(0,n.useRef)(!1),R=(0,n.useRef)(null),A=(0,n.useRef)(0),E=(0,n.useCallback)(async()=>{if(!c.current)return;b.current,T.current=!1,A.current=0;let{Terminal:t}=await e.A(116049),{FitAddon:n}=await e.A(359439),{WebLinksAddon:r}=await e.A(816091);o.current&&o.current.dispose();let s=new t({cursorBlink:!1,disableStdin:!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}),a=new n,i=new r;s.loadAddon(a),s.loadAddon(i),s.open(c.current);try{a.fit()}catch{}o.current=s,d.current=a;let l=()=>{try{a.fit()}catch{}};requestAnimationFrame(()=>requestAnimationFrame(l)),setTimeout(l,300);let m=()=>{let e,t,n,r,a;if(T.current)return;A.current>0&&(s.write("\x1b[2J\x1b[H"),s.clear());let i=new WebSocket((t=new URLSearchParams({paneId:(e=b.current).id,cwd:e.cwd,agentType:e.agentType||"shell",cols:String(s.cols),rows:String(s.rows)}),e.claudeSessionId&&t.set("agentSession",e.claudeSessionId),e.customCommand&&t.set("customCommand",e.customCommand),(n=g.current)&&t.set("terminalToken",n),r=y||"/ws",a="https:"===location.protocol?"wss:":"ws:",`${a}//${location.host}${r}?${t}`));u.current=i,i.onopen=()=>{p(!0),f(!1),z.current=!1,A.current=0,k()},i.onmessage=e=>{try{let t=JSON.parse(e.data);"data"===t.type?(s.write(t.data),z.current||N()):"exit"===t.type?(f(!0),z.current=!0,S(),s.write(`\r
|
|
2
2
|
\x1b[90m[Process exited with code ${t.exitCode}]\x1b[0m\r
|
|
3
3
|
`)):"error"===t.type&&s.write(`\r
|
|
4
4
|
\x1b[31m${t.data}\x1b[0m\r
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,367240,e=>{"use strict";let t=(0,e.i(475254).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"}]]);e.s(["RotateCcw",()=>t],367240)},398361,e=>{"use strict";let t=(0,e.i(475254).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"}]]);e.s(["Maximize2",()=>t],398361)},424134,778917,e=>{"use strict";var t=e.i(247167),r=e.i(843476),n=e.i(271645),i=e.i(174080),s=e.i(37727),a=e.i(788699),c=e.i(643531),o=e.i(367240),l=e.i(398361),d=e.i(475254);let u=(0,d.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"}]]),x=(0,d.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"}]]);e.s(["ExternalLink",()=>x],778917);var h=e.i(248256),m=e.i(761911),f=e.i(387951),p=e.i(687246),b=e.i(569074),g=e.i(87309);let y=(0,d.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),w=(0,d.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);var v=e.i(239616);let j=(0,d.default)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]);var N=e.i(531278),z=e.i(174886),k=e.i(209165);function S({paneId:e,onClose:t}){let[i,a]=(0,n.useState)(null),[l,d]=(0,n.useState)(!0),[u,x]=(0,n.useState)(null),[h,m]=(0,n.useState)(!1),[f,p]=(0,n.useState)(null),b=()=>{d(!0),x(null),fetch((0,k.api)(`/api/panes/${e}/diff`)).then(e=>e.ok?e.json():e.json().then(e=>{throw Error(e.error)})).then(e=>{a(e),d(!1)}).catch(e=>{x(e.message),d(!1)})};(0,n.useEffect)(()=>{b()},[e]);let g=async()=>{await fetch((0,k.api)(`/api/panes/${e}/diff`),{method:"POST"}),b()};if(l)return(0,r.jsx)("div",{className:"flex items-center justify-center py-8 bg-zinc-900 border-t border-zinc-700",children:(0,r.jsx)(N.Loader2,{className:"w-4 h-4 animate-spin text-zinc-500"})});if(u)return(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 bg-zinc-900 border-t border-zinc-700 text-xs",children:[(0,r.jsx)("span",{className:"text-red-400",children:u}),(0,r.jsx)("button",{onClick:t,className:"text-zinc-500 hover:text-white",children:(0,r.jsx)(s.X,{className:"w-3 h-3"})})]});if(!i||0===i.files.length&&0===i.untracked.length)return(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 bg-zinc-900 border-t border-zinc-700 text-xs",children:[(0,r.jsx)("span",{className:"text-zinc-500",children:"No changes since baseline"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{onClick:g,className:"text-zinc-500 hover:text-white",title:"Reset baseline",children:(0,r.jsx)(o.RotateCcw,{className:"w-3 h-3"})}),(0,r.jsx)("button",{onClick:t,className:"text-zinc-500 hover:text-white",children:(0,r.jsx)(s.X,{className:"w-3 h-3"})})]})]});let y=i.diff.split("\n").map((e,t)=>{let r="text-zinc-400",n="";return e.startsWith("+")&&!e.startsWith("+++")?(r="text-green-400",n="bg-green-500/10"):e.startsWith("-")&&!e.startsWith("---")?(r="text-red-400",n="bg-red-500/10"):e.startsWith("@@")?(r="text-cyan-400",n="bg-cyan-500/5"):e.startsWith("diff ")&&(r="text-zinc-300 font-bold"),{line:e,cls:r,bg:n,idx:t}}),w=f?y.filter((e,t)=>{let r=!1;for(let e=0;e<=t;e++)y[e].line.startsWith("diff ")&&y[e].line.includes(f)?r=!0:y[e].line.startsWith("diff ")&&e>0&&(r=!1);return r}):y,v=[...i.files,...i.untracked.map(e=>({path:e,status:"added",additions:0,deletions:0}))];return(0,r.jsxs)("div",{className:"flex flex-col bg-zinc-900 border-t border-zinc-700",style:{height:"40%",minHeight:150},children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-zinc-800 text-xs flex-shrink-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-zinc-500",children:[(0,r.jsxs)("span",{children:[v.length," file",1!==v.length?"s":""," changed"]}),(0,r.jsx)("span",{className:"text-zinc-700",children:"|"}),(0,r.jsxs)("span",{className:"font-mono text-[10px]",children:[i.baselineSha.slice(0,7),"..",i.currentSha.slice(0,7)]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("button",{onClick:g,className:"px-2 py-0.5 text-[10px] text-zinc-400 hover:text-white bg-zinc-800 rounded border border-zinc-700",title:"Mark as reviewed",children:"Reset Baseline"}),(0,r.jsx)("button",{onClick:()=>{i?.diff&&(navigator.clipboard.writeText(i.diff),m(!0),setTimeout(()=>m(!1),2e3))},className:"text-zinc-500 hover:text-white",title:"Copy diff",children:h?(0,r.jsx)(c.Check,{className:"w-3 h-3 text-green-400"}):(0,r.jsx)(z.Copy,{className:"w-3 h-3"})}),(0,r.jsx)("button",{onClick:t,className:"text-zinc-500 hover:text-white",title:"Close",children:(0,r.jsx)(s.X,{className:"w-3 h-3"})})]})]}),(0,r.jsxs)("div",{className:"flex flex-1 overflow-hidden min-h-0",children:[(0,r.jsxs)("div",{className:"w-48 flex-shrink-0 border-r border-zinc-800 overflow-y-auto",children:[(0,r.jsx)("button",{onClick:()=>p(null),className:`w-full text-left px-2 py-1 text-[10px] ${!f?"bg-zinc-800 text-zinc-200":"text-zinc-400 hover:bg-zinc-800/50"}`,children:"All files"}),v.map(e=>{var t;return(0,r.jsxs)("button",{onClick:()=>p(e.path),className:`w-full text-left px-2 py-1 text-[10px] flex items-center gap-1.5 ${f===e.path?"bg-zinc-800 text-zinc-200":"text-zinc-400 hover:bg-zinc-800/50"}`,children:["added"===(t=e.status)?(0,r.jsx)("span",{className:"text-green-400 text-[10px]",children:"A"}):"deleted"===t?(0,r.jsx)("span",{className:"text-red-400 text-[10px]",children:"D"}):"renamed"===t?(0,r.jsx)("span",{className:"text-blue-400 text-[10px]",children:"R"}):(0,r.jsx)("span",{className:"text-amber-400 text-[10px]",children:"M"}),(0,r.jsx)("span",{className:"truncate",children:e.path.split("/").pop()})]},e.path)})]}),(0,r.jsxs)("div",{className:"flex-1 overflow-auto font-mono text-[11px] leading-[18px]",children:[w.map(({line:e,cls:t,bg:n,idx:i})=>(0,r.jsx)("div",{className:`px-3 ${n} ${t} whitespace-pre`,children:e||" "},i)),i.truncated&&(0,r.jsx)("div",{className:"px-3 py-2 text-amber-400 text-[10px]",children:"Diff truncated at 500KB"})]})]})]})}var C=e.i(975157),T=e.i(73359),R=e.i(28916);let E=t.default.env.NEXT_PUBLIC_WS_PATH;function A({pane:t,onClose:d,onUpdate:N,isMaximized:z,onToggleMaximize:k,onMinimize:A,onPopout:M,onBrowse:$,isPopout:D,terminalToken:P,workspaceCollaboration:I,dragHandleProps:O}){let{hasCortex:B}=(0,R.useTier)(),F=(0,n.useRef)(null),L=(0,n.useRef)(null),q=(0,n.useRef)(null),U=(0,n.useRef)(null),W=(0,n.useRef)(""),_=(0,n.useRef)(null),K=()=>{try{U.current?.fit()}catch{}},[G,H]=(0,n.useState)(!1),[J,V]=(0,n.useState)(!1),[Y,X]=(0,n.useState)(t.title),[Q,Z]=(0,n.useState)(!1),[ee,et]=(0,n.useState)({x:0,y:0}),er=(0,n.useRef)(null),en=(0,n.useRef)(null),[ei,es]=(0,n.useState)(!1),[ea,ec]=(0,n.useState)(0),[eo,el]=(0,n.useState)([]),[ed,eu]=(0,n.useState)(!1),[ex,eh]=(0,n.useState)(!1),[em,ef]=(0,n.useState)("idle"),ep=(0,n.useRef)(!1),[eb,eg]=(0,n.useState)(""),ey=(0,n.useRef)(null),[ew,ev]=(0,n.useState)("off"),ej=(0,n.useRef)(null),[eN,ez]=(0,n.useState)(!1),ek=(0,n.useRef)(0),[eS,eC]=(0,n.useState)(!1),eT=(0,n.useRef)(!1),eR=(0,n.useRef)(null),[eE,eA]=(0,n.useState)(35),eM=(0,n.useRef)(35),[e$,eD]=(0,n.useState)(2e3),eP=(0,n.useRef)(2e3),[eI,eO]=(0,n.useState)(!0),eB=(0,n.useRef)(!0),[eF,eL]=(0,n.useState)(!1),[eq,eU]=(0,n.useState)(!1),[eW,e_]=(0,n.useState)(null),[eK,eG]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=navigator.userAgent||"";eu(/Quest|Oculus|Pacific/i.test(e))},[]),(0,n.useEffect)(()=>{if(!t.customModelId)return;let e=()=>{fetch(`/api/proxy/models/${t.customModelId}/status`).then(e=>e.ok?e.json():null).then(e=>{e?.status&&eG(e.status)}).catch(()=>{})};e();let r=setInterval(e,15e3);return()=>clearInterval(r)},[t.customModelId]),(0,n.useEffect)(()=>{if(!t.diffBaselineSha)return;let e=()=>{fetch(`/api/panes/${t.id}/diff?countOnly=true`).then(e=>e.ok?e.json():null).then(e=>{e?.fileCount!==void 0&&e_(e.fileCount)}).catch(()=>{})};e();let r=setInterval(e,3e4);return()=>clearInterval(r)},[t.id,t.diffBaselineSha]);let eH=(0,n.useRef)(t);eH.current=t;let eJ=(0,n.useRef)(N);eJ.current=N;let eV=(0,n.useRef)(P);eV.current=P;let eY=(0,n.useRef)(()=>{}),eX=(0,n.useRef)(!1),eQ=(0,n.useRef)(!1),eZ=(0,n.useRef)(null),e0=(0,n.useRef)(0),e1=(0,n.useCallback)(async()=>{if(!F.current)return;eH.current,eQ.current=!1,e0.current=0;let{Terminal:t}=await e.A(116049),{FitAddon:r}=await e.A(359439),{WebLinksAddon:n}=await e.A(816091);L.current&&L.current.dispose();let i=/Quest|Oculus|Pacific/i.test(navigator.userAgent),s=new t({cursorBlink:!i,disableStdin:i,fontSize:13,fontFamily:"'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, monospace",scrollback:1e4,fastScrollModifier:"alt",smoothScrollDuration:0,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}),a=new r,c=new n;s.loadAddon(a),s.loadAddon(c),await new Promise(e=>requestAnimationFrame(()=>{if(F.current){s.open(F.current);try{a.fit()}catch{}if(i&&F.current){let e=F.current.querySelector("textarea");e&&(e.setAttribute("readonly","true"),e.setAttribute("inputmode","none"),e.style.opacity="0",e.style.pointerEvents="none")}}e()})),s.attachCustomKeyEventHandler(e=>"keydown"!==e.type||(e.ctrlKey&&"c"===e.key&&s.hasSelection()?(navigator.clipboard?.writeText(s.getSelection()),s.clearSelection(),!1):!e.ctrlKey||"v"!==e.key)),L.current=s,U.current=a,requestAnimationFrame(()=>requestAnimationFrame(K)),setTimeout(K,300);let o=()=>{let e,t,r,n,i;if(eQ.current)return;e0.current>0&&(s.write("\x1b[2J\x1b[H"),s.clear());let a=new WebSocket((t=new URLSearchParams({paneId:(e=eH.current).id,cwd:e.cwd,agentType:e.agentType||"shell",cols:String(s.cols),rows:String(s.rows)}),e.claudeSessionId&&t.set("agentSession",e.claudeSessionId),e.customCommand&&t.set("customCommand",e.customCommand),e.nodeId&&t.set("nodeId",e.nodeId),e.customModelId&&t.set("customModelId",e.customModelId),(r=eV.current)&&t.set("terminalToken",r),n=E||"/ws",i="https:"===location.protocol?"wss:":"ws:",`${i}//${location.host}${n}?${t}`));q.current=a,a.onopen=()=>{H(!0),es(!1),eX.current=!1,e0.current=0,setTimeout(K,150)},a.onmessage=e=>{try{let r=JSON.parse(e.data);if("data"===r.type){var t;t=r.data,W.current+=t,null===_.current&&(_.current=requestAnimationFrame(()=>{_.current=null;let e=W.current;W.current="",e&&L.current&&(e=e.replace(/\x1b\[3J/g,""),L.current.write(e))}))}else if("exit"===r.type){es(!0),eX.current=!0;let e=r.reason?` — ${r.reason}`:"";s.write(`\r
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,367240,e=>{"use strict";let t=(0,e.i(475254).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"}]]);e.s(["RotateCcw",()=>t],367240)},398361,e=>{"use strict";let t=(0,e.i(475254).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"}]]);e.s(["Maximize2",()=>t],398361)},424134,778917,e=>{"use strict";var t=e.i(247167),r=e.i(843476),n=e.i(271645),i=e.i(174080),a=e.i(37727),s=e.i(788699),c=e.i(643531),o=e.i(367240),l=e.i(398361),d=e.i(475254);let u=(0,d.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"}]]),x=(0,d.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"}]]);e.s(["ExternalLink",()=>x],778917);var h=e.i(248256),m=e.i(761911),f=e.i(387951),p=e.i(687246),b=e.i(569074),g=e.i(87309);let y=(0,d.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),w=(0,d.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);var v=e.i(239616);let j=(0,d.default)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]);var N=e.i(531278),z=e.i(174886),k=e.i(209165);function S({paneId:e,onClose:t}){let[i,s]=(0,n.useState)(null),[l,d]=(0,n.useState)(!0),[u,x]=(0,n.useState)(null),[h,m]=(0,n.useState)(!1),[f,p]=(0,n.useState)(null),b=()=>{d(!0),x(null),fetch((0,k.api)(`/api/panes/${e}/diff`)).then(e=>e.ok?e.json():e.json().then(e=>{throw Error(e.error)})).then(e=>{s(e),d(!1)}).catch(e=>{x(e.message),d(!1)})};(0,n.useEffect)(()=>{b()},[e]);let g=async()=>{await fetch((0,k.api)(`/api/panes/${e}/diff`),{method:"POST"}),b()};if(l)return(0,r.jsx)("div",{className:"flex items-center justify-center py-8 bg-zinc-900 border-t border-zinc-700",children:(0,r.jsx)(N.Loader2,{className:"w-4 h-4 animate-spin text-zinc-500"})});if(u)return(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 bg-zinc-900 border-t border-zinc-700 text-xs",children:[(0,r.jsx)("span",{className:"text-red-400",children:u}),(0,r.jsx)("button",{onClick:t,className:"text-zinc-500 hover:text-white",children:(0,r.jsx)(a.X,{className:"w-3 h-3"})})]});if(!i||0===i.files.length&&0===i.untracked.length)return(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 bg-zinc-900 border-t border-zinc-700 text-xs",children:[(0,r.jsx)("span",{className:"text-zinc-500",children:"No changes since baseline"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{onClick:g,className:"text-zinc-500 hover:text-white",title:"Reset baseline",children:(0,r.jsx)(o.RotateCcw,{className:"w-3 h-3"})}),(0,r.jsx)("button",{onClick:t,className:"text-zinc-500 hover:text-white",children:(0,r.jsx)(a.X,{className:"w-3 h-3"})})]})]});let y=i.diff.split("\n").map((e,t)=>{let r="text-zinc-400",n="";return e.startsWith("+")&&!e.startsWith("+++")?(r="text-green-400",n="bg-green-500/10"):e.startsWith("-")&&!e.startsWith("---")?(r="text-red-400",n="bg-red-500/10"):e.startsWith("@@")?(r="text-cyan-400",n="bg-cyan-500/5"):e.startsWith("diff ")&&(r="text-zinc-300 font-bold"),{line:e,cls:r,bg:n,idx:t}}),w=f?y.filter((e,t)=>{let r=!1;for(let e=0;e<=t;e++)y[e].line.startsWith("diff ")&&y[e].line.includes(f)?r=!0:y[e].line.startsWith("diff ")&&e>0&&(r=!1);return r}):y,v=[...i.files,...i.untracked.map(e=>({path:e,status:"added",additions:0,deletions:0}))];return(0,r.jsxs)("div",{className:"flex flex-col bg-zinc-900 border-t border-zinc-700",style:{height:"40%",minHeight:150},children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-zinc-800 text-xs flex-shrink-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-zinc-500",children:[(0,r.jsxs)("span",{children:[v.length," file",1!==v.length?"s":""," changed"]}),(0,r.jsx)("span",{className:"text-zinc-700",children:"|"}),(0,r.jsxs)("span",{className:"font-mono text-[10px]",children:[i.baselineSha.slice(0,7),"..",i.currentSha.slice(0,7)]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("button",{onClick:g,className:"px-2 py-0.5 text-[10px] text-zinc-400 hover:text-white bg-zinc-800 rounded border border-zinc-700",title:"Mark as reviewed",children:"Reset Baseline"}),(0,r.jsx)("button",{onClick:()=>{i?.diff&&(navigator.clipboard.writeText(i.diff),m(!0),setTimeout(()=>m(!1),2e3))},className:"text-zinc-500 hover:text-white",title:"Copy diff",children:h?(0,r.jsx)(c.Check,{className:"w-3 h-3 text-green-400"}):(0,r.jsx)(z.Copy,{className:"w-3 h-3"})}),(0,r.jsx)("button",{onClick:t,className:"text-zinc-500 hover:text-white",title:"Close",children:(0,r.jsx)(a.X,{className:"w-3 h-3"})})]})]}),(0,r.jsxs)("div",{className:"flex flex-1 overflow-hidden min-h-0",children:[(0,r.jsxs)("div",{className:"w-48 flex-shrink-0 border-r border-zinc-800 overflow-y-auto",children:[(0,r.jsx)("button",{onClick:()=>p(null),className:`w-full text-left px-2 py-1 text-[10px] ${!f?"bg-zinc-800 text-zinc-200":"text-zinc-400 hover:bg-zinc-800/50"}`,children:"All files"}),v.map(e=>{var t;return(0,r.jsxs)("button",{onClick:()=>p(e.path),className:`w-full text-left px-2 py-1 text-[10px] flex items-center gap-1.5 ${f===e.path?"bg-zinc-800 text-zinc-200":"text-zinc-400 hover:bg-zinc-800/50"}`,children:["added"===(t=e.status)?(0,r.jsx)("span",{className:"text-green-400 text-[10px]",children:"A"}):"deleted"===t?(0,r.jsx)("span",{className:"text-red-400 text-[10px]",children:"D"}):"renamed"===t?(0,r.jsx)("span",{className:"text-blue-400 text-[10px]",children:"R"}):(0,r.jsx)("span",{className:"text-amber-400 text-[10px]",children:"M"}),(0,r.jsx)("span",{className:"truncate",children:e.path.split("/").pop()})]},e.path)})]}),(0,r.jsxs)("div",{className:"flex-1 overflow-auto font-mono text-[11px] leading-[18px]",children:[w.map(({line:e,cls:t,bg:n,idx:i})=>(0,r.jsx)("div",{className:`px-3 ${n} ${t} whitespace-pre`,children:e||" "},i)),i.truncated&&(0,r.jsx)("div",{className:"px-3 py-2 text-amber-400 text-[10px]",children:"Diff truncated at 500KB"})]})]})]})}var C=e.i(975157),T=e.i(73359),$=e.i(28916);let R=t.default.env.NEXT_PUBLIC_WS_PATH;function E({pane:t,onClose:d,onUpdate:N,isMaximized:z,onToggleMaximize:k,onMinimize:E,onPopout:A,onBrowse:M,isPopout:P,terminalToken:D,workspaceCollaboration:I,dragHandleProps:O}){let{hasCortex:B}=(0,$.useTier)(),F=(0,n.useRef)(null),L=(0,n.useRef)(null),q=(0,n.useRef)(null),U=(0,n.useRef)(null),W=(0,n.useRef)(""),K=(0,n.useRef)(null),V=()=>{try{U.current?.fit()}catch{}},[_,J]=(0,n.useState)(!1),[G,H]=(0,n.useState)(!1),[Y,X]=(0,n.useState)(t.title),[Q,Z]=(0,n.useState)(!1),[ee,et]=(0,n.useState)({x:0,y:0}),er=(0,n.useRef)(null),en=(0,n.useRef)(null),[ei,ea]=(0,n.useState)(!1),[es,ec]=(0,n.useState)(0),[eo,el]=(0,n.useState)([]),[ed,eu]=(0,n.useState)(!1),[ex,eh]=(0,n.useState)(!1),[em,ef]=(0,n.useState)("idle"),ep=(0,n.useRef)(!1),[eb,eg]=(0,n.useState)(""),ey=(0,n.useRef)(null),[ew,ev]=(0,n.useState)("off"),ej=(0,n.useRef)(null),[eN,ez]=(0,n.useState)(!1),ek=(0,n.useRef)(0),[eS,eC]=(0,n.useState)(!1),eT=(0,n.useRef)(!1),e$=(0,n.useRef)(null),[eR,eE]=(0,n.useState)(35),eA=(0,n.useRef)(35),[eM,eP]=(0,n.useState)(2e3),eD=(0,n.useRef)(2e3),[eI,eO]=(0,n.useState)(!0),eB=(0,n.useRef)(!0),[eF,eL]=(0,n.useState)(!1),[eq,eU]=(0,n.useState)(!1),[eW,eK]=(0,n.useState)(null),[eV,e_]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=navigator.userAgent||"";eu(/Quest|Oculus|Pacific/i.test(e))},[]),(0,n.useEffect)(()=>{if(!t.customModelId)return;let e=()=>{fetch(`/api/proxy/models/${t.customModelId}/status`).then(e=>e.ok?e.json():null).then(e=>{e?.status&&e_(e.status)}).catch(()=>{})};e();let r=setInterval(e,15e3);return()=>clearInterval(r)},[t.customModelId]),(0,n.useEffect)(()=>{if(!t.diffBaselineSha)return;let e=()=>{fetch(`/api/panes/${t.id}/diff?countOnly=true`).then(e=>e.ok?e.json():null).then(e=>{e?.fileCount!==void 0&&eK(e.fileCount)}).catch(()=>{})};e();let r=setInterval(e,3e4);return()=>clearInterval(r)},[t.id,t.diffBaselineSha]);let eJ=(0,n.useRef)(t);eJ.current=t;let eG=(0,n.useRef)(N);eG.current=N;let eH=(0,n.useRef)(D);eH.current=D;let eY=(0,n.useRef)(()=>{}),eX=(0,n.useRef)(!1),eQ=(0,n.useRef)(!1),eZ=(0,n.useRef)(null),e0=(0,n.useRef)(0),e1=(0,n.useCallback)(async()=>{if(!F.current)return;eJ.current,eQ.current=!1,e0.current=0;let{Terminal:t}=await e.A(116049),{FitAddon:r}=await e.A(359439),{WebLinksAddon:n}=await e.A(816091);L.current&&L.current.dispose();let i=/Quest|Oculus|Pacific/i.test(navigator.userAgent),a=new t({cursorBlink:!i,disableStdin:i,fontSize:13,fontFamily:"'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, monospace",scrollback:1e4,fastScrollModifier:"alt",smoothScrollDuration:0,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}),s=new r,c=new n;a.loadAddon(s),a.loadAddon(c),await new Promise(e=>requestAnimationFrame(()=>{if(F.current){a.open(F.current);try{s.fit()}catch{}if(i&&F.current){let e=F.current.querySelector("textarea");e&&(e.setAttribute("readonly","true"),e.setAttribute("inputmode","none"),e.style.opacity="0",e.style.pointerEvents="none")}}e()})),a.attachCustomKeyEventHandler(e=>{if("keydown"!==e.type)return!0;if(e.ctrlKey&&"c"===e.key&&a.hasSelection()){let e=a.getSelection();return e&&navigator.clipboard?.writeText&&navigator.clipboard.writeText(e).catch(()=>{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}),a.clearSelection(),!1}return!e.ctrlKey||"v"!==e.key}),L.current=a,U.current=s,requestAnimationFrame(()=>requestAnimationFrame(V)),setTimeout(V,300);let o=()=>{let e,t,r,n,i;if(eQ.current)return;e0.current>0&&(a.write("\x1b[2J\x1b[H"),a.clear());let s=new WebSocket((t=new URLSearchParams({paneId:(e=eJ.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),e.customModelId&&t.set("customModelId",e.customModelId),(r=eH.current)&&t.set("terminalToken",r),n=R||"/ws",i="https:"===location.protocol?"wss:":"ws:",`${i}//${location.host}${n}?${t}`));q.current=s,s.onopen=()=>{J(!0),ea(!1),eX.current=!1,e0.current=0,setTimeout(V,150)},s.onmessage=e=>{try{let r=JSON.parse(e.data);if("data"===r.type){var t;t=r.data,W.current+=t,null===K.current&&(K.current=requestAnimationFrame(()=>{K.current=null;let e=W.current;W.current="",e&&L.current&&(e=e.replace(/\x1b\[3J/g,""),L.current.write(e))}))}else if("exit"===r.type){ea(!0),eX.current=!0;let e=r.reason?` — ${r.reason}`:"";a.write(`\r
|
|
2
2
|
\x1b[90m[Process exited with code ${r.exitCode}${e}]\x1b[0m\r
|
|
3
|
-
`)}else"error"===r.type?
|
|
3
|
+
`)}else"error"===r.type?a.write(`\r
|
|
4
4
|
\x1b[31m${r.data}\x1b[0m\r
|
|
5
|
-
`):"session-detected"===r.type?
|
|
5
|
+
`):"session-detected"===r.type?eG.current(eJ.current.id,{claudeSessionId:r.sessionId}):"cortex-injection"===r.type?(ec(r.count||0),r.items&&el(r.items)):"collab-updated"===r.type&&eG.current(eJ.current.id,{isCollaborating:r.isCollaborating})}catch{}},s.onclose=()=>{if(J(!1),!eX.current&&!eQ.current){let e=e0.current;if(e<20){let t=Math.min(1e3*Math.pow(1.5,e),3e4);e0.current=e+1,eZ.current=setTimeout(o,t)}}},s.onerror=()=>{J(!1)}};a.onData(e=>{q.current?.readyState===WebSocket.OPEN&&q.current.send(JSON.stringify({type:"data",data:e}))}),a.onResize(({cols:e,rows:t})=>{q.current?.readyState===WebSocket.OPEN&&q.current.send(JSON.stringify({type:"resize",cols:e,rows:t}))}),o()},[]);(0,n.useEffect)(()=>(e1(),()=>{eQ.current=!0,eZ.current&&clearTimeout(eZ.current),q.current?.close(),L.current?.dispose()}),[e1]),(0,n.useEffect)(()=>{let e,t=new ResizeObserver(()=>{cancelAnimationFrame(e),e=requestAnimationFrame(V)});return F.current&&t.observe(F.current),()=>{cancelAnimationFrame(e),t.disconnect()}},[]),(0,n.useEffect)(()=>{setTimeout(V,50)},[z,ed]);let e5=()=>{N(t.id,{title:Y}),H(!1)},e3=e=>{console.log("[Voice]",e);try{localStorage.getItem("spaces-voice-debug")&&L.current&&L.current.write(`\r
|
|
6
|
+
\x1b[93m[Voice] ${e}\x1b[0m\r
|
|
7
|
+
`)}catch{}},e2=e=>{q.current?.readyState===WebSocket.OPEN?q.current.send(JSON.stringify({type:"data",data:e})):e3(`sendKey failed: WebSocket state=${q.current?.readyState}`)},e4=async()=>{if("off"!==ew){ej.current?.state==="recording"&&ej.current.stop();return}ev("listening");try{let e=await fetch("/api/whisper/config"),t=e.ok?await e.json():null,r=await navigator.mediaDevices.getUserMedia({audio:!0}),n=new AudioContext,i=n.createMediaStreamSource(r),a=n.createAnalyser();a.fftSize=512,i.connect(a);let s=MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":"audio/webm",c=new MediaRecorder(r,{mimeType:s}),o=[],l=!1;c.ondataavailable=e=>{e.data.size>0&&o.push(e.data)},c.onstop=async()=>{r.getTracks().forEach(e=>e.stop());try{i.disconnect()}catch{}try{n.close()}catch{}if(ej.current=null,!l||0===o.length)return void ev("off");let e=new Blob(o,{type:"audio/webm"});if(e.size<500)return void ev("off");ev("transcribing");try{let r="";if(t?.apiKey){console.log("[Voice] Transcribing via",t.backend||"direct");let n=new FormData;n.append("file",e,"audio.webm"),n.append("model",t.model),n.append("response_format","json"),n.append("language","en");let i=await fetch(t.apiUrl,{method:"POST",headers:{Authorization:`Bearer ${t.apiKey}`},body:n});i.ok?r=(await i.json()).text||"":console.error("[Voice] API error:",i.status,await i.text().catch(()=>""))}else{console.log("[Voice] Transcribing via server proxy, cfg:",t);let n=new FormData;n.append("audio",e,"dictation.webm");let i=await fetch("/api/whisper",{method:"POST",body:n});i.ok?r=(await i.json()).text||"":console.error("[Voice] Server proxy error:",i.status,await i.text().catch(()=>""))}console.log("[Voice] Result:",JSON.stringify(r)),r.trim()&&eg(e=>e?`${e} ${r.trim()}`:r.trim())}catch(e){console.error("[Voice] Exception:",e)}ev("off")};let d=new Uint8Array(a.frequencyBinCount),u=0,x=0,h=Date.now(),m=()=>{ej.current&&"recording"===ej.current.state&&((a.getByteFrequencyData(d),d.reduce((e,t)=>e+t,0)/d.length>20?(x++,u=Date.now(),x>=10&&(l=!0)):l||(x=0),l&&Date.now()-u>1500||!l&&Date.now()-h>1e4)?ej.current.stop():requestAnimationFrame(m))};c.start(250),ej.current=c,requestAnimationFrame(m)}catch(e){L.current&&L.current.write(`\r
|
|
6
8
|
\x1b[91m[Mic] ${e.name||"Error"}: ${e.message||"Failed to access microphone"}\x1b[0m\r
|
|
7
|
-
`),ev("off")}},
|
|
9
|
+
`),ev("off")}},e7=async()=>{if(eT.current){ev("listening");try{if(!e$.current){e3("Fetching whisper config...");let e=await fetch("/api/whisper/config");e.ok?(e$.current=await e.json(),e3(`Config: backend=${e$.current?.backend||"none"} hasKey=${!!e$.current?.apiKey}`)):e3(`Config fetch failed: ${e.status} ${await e.text().catch(()=>"")}`)}if(!eT.current)return;let e=await navigator.mediaDevices.getUserMedia({audio:!0});if(!eT.current)return void e.getTracks().forEach(e=>e.stop());let t=new AudioContext,r=t.createMediaStreamSource(e),n=t.createAnalyser();n.fftSize=512,r.connect(n);let i=MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":"audio/webm",a=new MediaRecorder(e,{mimeType:i}),s=[],c=!1;a.ondataavailable=e=>{e.data.size>0&&s.push(e.data)},a.onstop=async()=>{e.getTracks().forEach(e=>e.stop());try{r.disconnect()}catch{}try{t.close()}catch{}if(ej.current=null,!eT.current&&!e6.current)return void ev("off");if(!c||0===s.length){e3(`No speech detected (hasSpeech=${c} chunks=${s.length}) — restarting`),e6.current=!1,eT.current?setTimeout(e7,300):ev("off");return}let n=new Blob(s,{type:"audio/webm"});if(n.size<500){e3(`Blob too small (${n.size}b) — restarting`),setTimeout(e7,300);return}ev("transcribing");let i=e$.current;e3(`Transcribing blob=${n.size}b hasCfg=${!!i} hasKey=${!!i?.apiKey}`);try{let e="";if(i?.apiKey){e3(`Calling ${i.backend}: ${i.apiUrl}`);let t=new FormData;t.append("file",n,"audio.webm"),t.append("model",i.model),t.append("response_format","json"),t.append("language","en");let r=await fetch(i.apiUrl,{method:"POST",headers:{Authorization:`Bearer ${i.apiKey}`},body:t});if(r.ok)e=(await r.json()).text||"",e3(`Transcribed: "${e}"`);else{let e=await r.text().catch(()=>"");e3(`API error: ${r.status} ${e.slice(0,200)}`)}}else{e3("No API key — using server proxy /api/whisper");let t=new FormData;t.append("audio",n,"dictation.webm");let r=await fetch("/api/whisper",{method:"POST",body:t});if(r.ok)e=(await r.json()).text||"",e3(`Transcribed: "${e}"`);else{let e=await r.text().catch(()=>"");e3(`Proxy error: ${r.status} ${e.slice(0,200)}`)}}e3(`Result: "${e}" ws=${q.current?.readyState} immersive=${eT.current} draining=${e6.current}`),e.trim()&&(eT.current||e6.current)&&(eB.current?(e3(`Sending: "${e.trim()}" + Enter`),e2(e.trim()+"\r")):(e3(`Putting in input: "${e.trim()}"`),eg(t=>t?t+" "+e.trim():e.trim())))}catch(e){e3(`Exception: ${e.message||e}`)}e6.current=!1,eT.current?setTimeout(e7,800):ev("off")};let o=new Uint8Array(n.frequencyBinCount),l=0,d=0,u=Date.now(),x=()=>{ej.current&&"recording"===ej.current.state&&(eT.current?(n.getByteFrequencyData(o),o.reduce((e,t)=>e+t,0)/o.length>eA.current?(d++,l=Date.now(),d>=15&&(c=!0)):c||(d=0),c&&Date.now()-l>eD.current||!c&&Date.now()-u>1e4)?ej.current.stop():requestAnimationFrame(x):ej.current.stop())};a.start(250),ej.current=a,requestAnimationFrame(x)}catch(e){L.current&&L.current.write(`\r
|
|
8
10
|
\x1b[91m[Mic] ${e.name||"Error"}: ${e.message||"Failed to access microphone"}\x1b[0m\r
|
|
9
|
-
`),eT.current?setTimeout(
|
|
11
|
+
`),eT.current?setTimeout(e7,2e3):ev("off")}}},e6=(0,n.useRef)(!1),e9=(0,n.useRef)(null),e8=!("u">typeof navigator&&/Quest|Oculus|Pacific/i.test(navigator.userAgent))&&("SpeechRecognition"in window||"webkitSpeechRecognition"in window),te=e=>{if(!ep.current)return;let t=window.SpeechRecognition||window.webkitSpeechRecognition;if(!t)return;let r=new t;r.continuous=!0,r.interimResults=!0,r.lang="en-US";let n=0;r.onresult=t=>{if(!ep.current)return;let r="";for(let e=0;e<t.results.length;e++)t.results[e].isFinal&&(r+=t.results[e][0].transcript);if(r.length>n){let t=r.slice(n);if(console.log("[Voice] recognized:",JSON.stringify(t.trim()),"autoSend:",e,"ws:",q.current?.readyState),e&&eB.current)e2(t.trim()+"\r");else{var i=t.trim();if(q.current?.readyState===WebSocket.OPEN){let e=`\x1b[200~${i}\x1b[201~`;q.current.send(JSON.stringify({type:"data",data:e}))}else e3(`sendPaste failed: WebSocket state=${q.current?.readyState}`)}n=r.length}},r.onerror=t=>{if("not-allowed"===t.error||"service-not-allowed"===t.error){ep.current=!1,eh(!1),ef("idle");return}ep.current&&setTimeout(()=>te(e),500)},r.onend=()=>{ep.current&&"visible"===document.visibilityState?setTimeout(()=>te(e),100):ep.current||ef("idle")},r.onstart=()=>ef("listening"),e9.current=r,r.start()};(0,n.useEffect)(()=>{let e=()=>{"visible"===document.visibilityState&&ep.current&&!e9.current&&te(!0)};return document.addEventListener("visibilitychange",e),()=>{if(document.removeEventListener("visibilitychange",e),ep.current=!1,e9.current)try{e9.current.abort()}catch{}}},[]);let[tt,tr]=(0,n.useState)(null),[tn,ti]=(0,n.useState)(!1),ta=(0,n.useRef)(null);return eY.current=(0,n.useCallback)(async e=>{if(0===e.length)return;let t=eJ.current.cwd||"/",r=new FormData;for(let n of(r.append("dir",t),e))r.append("files",n);let n=e.map(e=>e.name).join(", ");tr(`Uploading ${e.length} file${e.length>1?"s":""}...`),ta.current&&clearTimeout(ta.current);try{let e=await fetch("/api/files",{method:"POST",body:r});if(e.ok){let r=await e.json();tr(`Uploaded ${r.files?.join(", ")||n} to ${t}`);let i=L.current;i&&i.write(`\r
|
|
10
12
|
\x1b[90m[Uploaded ${r.files?.join(", ")||n} → ${t}]\x1b[0m\r
|
|
11
|
-
`)}else tt("Upload failed")}catch{tt("Upload failed")}ti.current=setTimeout(()=>tt(null),4e3)},[]),(0,n.useEffect)(()=>{let e=F.current;if(!e)return;let t=t=>{if(!e.contains(t.target))return;let r=t.clipboardData?.items;if(!r)return;let n=[];for(let e=0;e<r.length;e++){let t=r[e];if("file"===t.kind){let e=t.getAsFile();e&&n.push(e)}}n.length>0&&(t.preventDefault(),t.stopPropagation(),eY.current(n))};document.addEventListener("paste",t,!0);let r=e=>{e.preventDefault(),e.stopPropagation(),tn(!0)},n=t=>{t.preventDefault(),e&&!e.contains(t.relatedTarget)&&tn(!1)},i=e=>{e.preventDefault(),e.stopPropagation(),tn(!1);let t=[];if(e.dataTransfer?.files)for(let r=0;r<e.dataTransfer.files.length;r++)t.push(e.dataTransfer.files[r]);t.length>0&&eY.current(t)};return e.addEventListener("dragover",r),e.addEventListener("dragleave",n),e.addEventListener("drop",i),()=>{document.removeEventListener("paste",t,!0),e.removeEventListener("dragover",r),e.removeEventListener("dragleave",n),e.removeEventListener("drop",i)}},[]),(0,n.useEffect)(()=>{if(!Q)return;let e=e=>{let t=e.target;er.current&&!er.current.contains(t)&&en.current&&!en.current.contains(t)&&Z(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[Q]),(0,r.jsxs)("div",{className:(0,C.cn)("flex flex-col border rounded-lg overflow-hidden",z?"h-full !rounded-none":"h-full","border-zinc-700"),style:{borderColor:`${t.color}60`},children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 text-xs select-none flex-shrink-0",style:{backgroundColor:`${t.color}30`,borderBottom:`1px solid ${t.color}40`},children:[O&&!D&&(0,r.jsx)("div",{...O,className:"flex-shrink-0 cursor-grab active:cursor-grabbing text-zinc-500 hover:text-zinc-300 -ml-1",children:(0,r.jsx)(w,{className:"w-3.5 h-3.5"})}),(0,r.jsxs)("div",{ref:er,className:"flex-shrink-0",children:[(0,r.jsx)("button",{onClick:e=>{let t=e.currentTarget.getBoundingClientRect();et({x:t.left,y:t.bottom+6}),Z(!Q)},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"}),Q&&(0,i.createPortal)((0,r.jsx)("div",{ref:en,className:"fixed z-[9999] bg-zinc-800 border border-zinc-600 rounded-xl p-3 shadow-2xl",style:{left:ee.x,top:ee.y},children:(0,r.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,r.jsx)("button",{onClick:()=>{N(t.id,{color:e}),Z(!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)]}),J?(0,r.jsxs)("div",{className:"flex items-center gap-1 flex-1",children:[(0,r.jsx)("input",{autoFocus:!0,value:Y,onChange:e=>X(e.target.value),onKeyDown:e=>{"Enter"===e.key&&e5(),"Escape"===e.key&&(X(t.title),V(!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,r.jsx)("button",{onClick:e5,className:"text-green-400 hover:text-green-300",children:(0,r.jsx)(c.Check,{className:"w-3 h-3"})})]}):(0,r.jsxs)("div",{className:"flex items-center gap-1 flex-1 min-w-0 group/title",children:[(0,r.jsx)("span",{onDoubleClick:()=>V(!0),className:"truncate text-zinc-300 font-medium cursor-default",children:t.title}),(0,r.jsx)("button",{onClick:()=>V(!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,r.jsx)(a.Pencil,{className:"w-2.5 h-2.5"})})]}),(0,r.jsx)("button",{onClick:()=>$?.(t.cwd),className:"text-[10px] text-zinc-500 truncate max-w-[120px] hover:text-amber-400 transition-colors",title:`Browse ${t.cwd}`,children:t.cwd.split(/[/\\]/).pop()}),t.agentType&&"shell"!==t.agentType&&(0,r.jsxs)("span",{className:"text-[9px] px-1.5 py-0.5 rounded font-medium flex items-center gap-1",style:{backgroundColor:`${T.AGENT_TYPES[t.agentType]?.color||"#6366f1"}20`,color:T.AGENT_TYPES[t.agentType]?.color||"#6366f1"},children:[T.AGENT_TYPES[t.agentType]?.name||t.agentType,t.customModelId&&(0,r.jsx)("span",{className:"flex items-center gap-1 border-l border-current pl-1 ml-0.5",children:(0,r.jsx)("span",{className:(0,C.cn)("w-1.5 h-1.5 rounded-full","RUNNING"===eK?"bg-green-500":"PROVISIONING"===eK||"STAGING"===eK?"bg-yellow-500 animate-pulse":"bg-red-500"),title:eK||"UNKNOWN"})})]}),t.nodeId&&(0,r.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,r.jsx)(h.Globe,{className:"w-2.5 h-2.5"}),"remote"]}),I&&"shell"!==t.agentType&&(0,r.jsx)("button",{onClick:async()=>{let e=!t.isCollaborating;await N(t.id,{isCollaborating:e}),q.current?.readyState===WebSocket.OPEN&&q.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,r.jsx)(m.Users,{className:"w-3 h-3"})}),!G&&!ei&&(0,r.jsx)("span",{className:"text-[10px] text-yellow-500",children:"connecting..."}),ei&&(0,r.jsx)("button",{onClick:()=>{eQ.current=!0,eZ.current&&clearTimeout(eZ.current),q.current?.close(),L.current?.dispose(),es(!1),eX.current=!1,setTimeout(e1,100)},className:"text-zinc-400 hover:text-white",title:"Restart",children:(0,r.jsx)(o.RotateCcw,{className:"w-3 h-3"})}),!D&&M&&(0,r.jsx)("button",{onClick:()=>{M&&(eQ.current=!0,eZ.current&&clearTimeout(eZ.current),q.current?.close(),L.current?.dispose(),M(t.id))},className:"text-zinc-300 hover:text-white",title:"Pop out to new window",children:(0,r.jsx)(x,{className:"w-3 h-3"})}),t.diffBaselineSha&&(0,r.jsxs)("button",{onClick:()=>eU(!eq),className:(0,C.cn)("relative text-zinc-300 hover:text-white",eq&&"text-indigo-400"),title:eq?"Hide diff":"Review changes",children:[(0,r.jsx)(j,{className:"w-3 h-3"}),null!=eW&&eW>0&&!eq&&(0,r.jsx)("span",{className:"absolute -top-1.5 -right-1.5 text-[8px] bg-indigo-500 text-white rounded-full w-3.5 h-3.5 flex items-center justify-center font-bold",children:eW>9?"9+":eW})]}),A&&!D&&(0,r.jsx)("button",{onClick:()=>A(t.id),className:"text-zinc-300 hover:text-yellow-400",title:"Minimize",children:(0,r.jsx)(y,{className:"w-3 h-3"})}),(0,r.jsx)("button",{onClick:()=>k(t.id),className:"text-zinc-300 hover:text-white",title:z?"Restore":"Maximize",children:z?(0,r.jsx)(u,{className:"w-3 h-3"}):(0,r.jsx)(l.Maximize2,{className:"w-3 h-3"})}),(0,r.jsx)("button",{onClick:()=>{confirm("Close this terminal?")&&d(t.id)},className:"text-zinc-300 hover:text-red-400",title:"Close",children:(0,r.jsx)(s.X,{className:"w-3 h-3"})})]}),(0,r.jsxs)("div",{ref:F,className:"flex-1 relative bg-[#0a0a0a]",style:{minHeight:0,flex:1},onClick:ed?e=>{e.preventDefault()}:void 0,onWheel:ed?e=>{e.preventDefault();let t=Date.now();Math.abs(e.deltaY)>10&&t-ek.current>200&&(ek.current=t,e3(e.deltaY<0?"\x1b[A":"\x1b[B"))}:void 0,children:[tr&&(0,r.jsx)("div",{className:"absolute inset-0 z-10 bg-indigo-500/10 border-2 border-dashed border-indigo-400 flex items-center justify-center pointer-events-none",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 bg-zinc-900/90 px-4 py-2 rounded-lg text-sm text-indigo-300",children:[(0,r.jsx)(b.Upload,{className:"w-4 h-4"}),"Drop files to upload to ",t.cwd.split(/[/\\]/).pop()||t.cwd]})}),te&&(0,r.jsx)("div",{className:"absolute bottom-2 left-1/2 -translate-x-1/2 z-10 bg-zinc-800/95 border border-zinc-600 px-3 py-1.5 rounded-lg text-xs text-zinc-300 shadow-lg",children:te})]}),eq&&(0,r.jsx)(S,{paneId:t.id,onClose:()=>eU(!1)}),ed&&(0,r.jsxs)("div",{className:"flex flex-col gap-1 px-2 py-1.5 flex-shrink-0 border-t border-zinc-700",style:{backgroundColor:`${t.color}15`,borderTopColor:`${t.color}30`},children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("input",{ref:ey,type:"text",value:eb,readOnly:!eN,onChange:e=>eg(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e3(eb?eb+"\r":"\r"),eg(""),ez(!1),ey.current?.blur())},onBlur:()=>ez(!1),placeholder:eS&&"listening"===ew?"Speak now...":eS&&"transcribing"===ew?"Sending...":eS?"Immersive mode active":"listening"===ew?"Listening...":"transcribing"===ew?"Transcribing...":eN?"Type here...":"Tap mic, keyboard, or type",className:(0,C.cn)("flex-1 text-zinc-200 text-sm px-3 py-2 rounded border focus:outline-none font-mono",eN?"bg-zinc-900 border-zinc-400 placeholder:text-zinc-500":"bg-zinc-900/50 border-zinc-700 placeholder:text-zinc-600"),autoComplete:"off",autoCorrect:"on",spellCheck:!1}),!eS&&(0,r.jsx)("button",{onClick:e2,className:(0,C.cn)("p-2 rounded border transition-all","off"===ew||eS?"bg-zinc-800 border-zinc-700 text-zinc-400 hover:text-white":"bg-red-500 border-red-400 text-white animate-pulse"),title:"Voice → input (review before send)",children:"off"===ew||eS?(0,r.jsx)(f.Mic,{className:"w-4 h-4"}):(0,r.jsx)(p.MicOff,{className:"w-4 h-4"})}),(0,r.jsx)("button",{onClick:()=>{if(eT.current){if(eT.current=!1,eC(!1),ej.current?.state==="recording"){e7.current=!0,ev("transcribing");try{ej.current.stop()}catch{}}else ev("off");eR.current=null}else eT.current=!0,eC(!0),e4()},className:(0,C.cn)("p-2 rounded-full border transition-all",eS?"bg-green-600 border-green-400 text-white shadow-[0_0_12px_rgba(34,197,94,0.5)] animate-pulse":"bg-zinc-800 border-zinc-700 text-zinc-500 hover:text-green-400 hover:border-green-600"),title:eS?"Exit immersive voice":"Immersive voice (auto-send)",children:(0,r.jsx)(g.AudioLines,{className:"w-4 h-4"})}),eS&&(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("button",{onClick:()=>eL(!eF),className:(0,C.cn)("p-1.5 rounded border transition-all",eF?"bg-zinc-700 border-zinc-600 text-zinc-200":"bg-zinc-800 border-zinc-700 text-zinc-500 hover:text-zinc-300"),title:"Voice settings",children:(0,r.jsx)(v.Settings,{className:"w-3.5 h-3.5"})}),eF&&(0,r.jsxs)("div",{className:"absolute bottom-full right-0 mb-2 p-3 bg-zinc-800 border border-zinc-600 rounded-lg shadow-xl z-50 min-w-[180px]",children:[(0,r.jsx)("div",{className:"text-[10px] text-zinc-400 font-medium mb-2",children:"Voice Settings"}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex justify-between text-[9px] text-zinc-500 mb-1",children:[(0,r.jsx)("span",{children:"Sensitivity"}),(0,r.jsx)("span",{className:"font-mono",children:eE})]}),(0,r.jsx)("input",{type:"range",min:10,max:120,value:eE,onChange:e=>{let t=Number(e.target.value);eA(t),eM.current=t},className:"w-full h-1.5 accent-green-500"}),(0,r.jsxs)("div",{className:"flex justify-between text-[8px] text-zinc-600",children:[(0,r.jsx)("span",{children:"Quiet"}),(0,r.jsx)("span",{children:"Loud"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex justify-between text-[9px] text-zinc-500 mb-1",children:[(0,r.jsx)("span",{children:"Pause before send"}),(0,r.jsxs)("span",{className:"font-mono",children:[(e$/1e3).toFixed(1),"s"]})]}),(0,r.jsx)("input",{type:"range",min:1e3,max:5e3,step:250,value:e$,onChange:e=>{let t=Number(e.target.value);eD(t),eP.current=t},className:"w-full h-1.5 accent-green-500"}),(0,r.jsxs)("div",{className:"flex justify-between text-[8px] text-zinc-600",children:[(0,r.jsx)("span",{children:"Fast"}),(0,r.jsx)("span",{children:"Patient"})]})]}),(0,r.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,r.jsx)("span",{className:"text-[9px] text-zinc-500",children:"Auto-send"}),(0,r.jsx)("div",{onClick:()=>{let e=!eI;eO(e),eB.current=e},className:(0,C.cn)("w-7 h-4 rounded-full relative transition-colors cursor-pointer",eI?"bg-green-600":"bg-zinc-600"),children:(0,r.jsx)("div",{className:(0,C.cn)("absolute top-0.5 w-3 h-3 rounded-full bg-white transition-transform",eI?"translate-x-3.5":"translate-x-0.5")})})]})]})]})]}),(0,r.jsx)("button",{onClick:()=>{e3(eb?eb+"\r":"\r"),eg("")},className:"px-3 py-2 text-[11px] font-mono bg-indigo-600 hover:bg-indigo-500 text-white rounded border border-indigo-500 font-medium",children:"Send"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("button",{onClick:()=>{ez(!0),setTimeout(()=>ey.current?.focus(),50)},className:(0,C.cn)("px-2 py-1 text-[10px] font-mono rounded border",eN?"bg-indigo-600 border-indigo-500 text-white":"bg-zinc-800 hover:bg-zinc-700 text-zinc-400 border-zinc-700"),children:"⌨"}),(0,r.jsx)("button",{onClick:()=>e3("\x1b"),className:"px-2 py-1 text-[10px] font-mono bg-zinc-800 hover:bg-zinc-700 text-zinc-400 rounded border border-zinc-700",children:"Esc"}),(0,r.jsx)("button",{onClick:()=>e3(" "),className:"px-2 py-1 text-[10px] font-mono bg-zinc-800 hover:bg-zinc-700 text-zinc-400 rounded border border-zinc-700",children:"Tab"}),(0,r.jsx)("button",{onClick:()=>e3("\x03"),className:"px-2 py-1 text-[10px] font-mono bg-zinc-800 hover:bg-zinc-700 text-zinc-400 rounded border border-zinc-700",children:"Ctrl+C"}),(0,r.jsx)("button",{onClick:()=>e3("\x1b[A"),className:"px-2 py-1 text-[10px] font-mono bg-zinc-800 hover:bg-zinc-700 text-zinc-400 rounded border border-zinc-700",children:"↑"}),(0,r.jsx)("button",{onClick:()=>e3("\x1b[B"),className:"px-2 py-1 text-[10px] font-mono bg-zinc-800 hover:bg-zinc-700 text-zinc-400 rounded border border-zinc-700",children:"↓"}),(0,r.jsx)("div",{className:"flex-1"}),(0,r.jsx)("button",{onClick:()=>eg(""),className:"px-2 py-1 text-[10px] font-mono bg-zinc-800 hover:bg-zinc-700 text-zinc-400 rounded border border-zinc-700",children:"Clear"})]})]}),!ed&&e9&&(0,r.jsxs)("div",{className:"flex items-center justify-end gap-1.5 px-2 py-1 flex-shrink-0 border-t border-zinc-700/50",style:{backgroundColor:`${t.color}08`},children:[ex&&(0,r.jsx)("span",{className:"text-[10px] text-green-400 animate-pulse mr-1",children:"listening"===em?"Listening...":"Voice active"}),(0,r.jsx)("button",{onClick:()=>{if(ep.current){if(ep.current=!1,eh(!1),ef("idle"),e6.current){try{e6.current.abort()}catch{}e6.current=null}}else e9&&(ep.current=!0,eh(!0),e8(!1),setTimeout(()=>L.current?.focus(),100))},className:(0,C.cn)("p-1 rounded border transition-all",ex&&!eS?"bg-green-900/50 border-green-500 text-green-400 hover:bg-red-900/50 hover:border-red-600 hover:text-red-400 shadow-[0_0_8px_rgba(34,197,94,0.3)]":"bg-zinc-800/50 border-zinc-700 text-zinc-500 hover:text-zinc-300 hover:bg-zinc-700"),title:"Dictation (text appears, you press Enter)",children:(0,r.jsx)(f.Mic,{className:"w-3.5 h-3.5"})}),(0,r.jsx)("button",{onClick:()=>{if(ep.current){if(ep.current=!1,eh(!1),ef("idle"),e6.current){try{e6.current.abort()}catch{}e6.current=null}}else e9&&(ep.current=!0,eh(!0),e8(!0),setTimeout(()=>L.current?.focus(),100))},className:(0,C.cn)("p-1 rounded-full border transition-all",ex&&!eS?"bg-green-600 border-green-400 text-white shadow-[0_0_10px_rgba(34,197,94,0.5)] animate-pulse":eS?"bg-zinc-800/50 border-zinc-700 text-zinc-600":"bg-zinc-800/50 border-zinc-700 text-zinc-500 hover:text-green-400 hover:border-green-600"),title:"Immersive voice (auto-send on silence)",children:(0,r.jsx)(g.AudioLines,{className:"w-3.5 h-3.5"})})]})]})}e.s(["TerminalPane",()=>A],424134)}]);
|
|
13
|
+
`)}else tr("Upload failed")}catch{tr("Upload failed")}ta.current=setTimeout(()=>tr(null),4e3)},[]),(0,n.useEffect)(()=>{let e=F.current;if(!e)return;let t=t=>{if(!e.contains(t.target))return;let r=t.clipboardData?.items;if(!r)return;let n=[];for(let e=0;e<r.length;e++){let t=r[e];if("file"===t.kind){let e=t.getAsFile();e&&n.push(e)}}n.length>0&&(t.preventDefault(),t.stopPropagation(),eY.current(n))};document.addEventListener("paste",t,!0);let r=e=>{e.preventDefault(),e.stopPropagation(),ti(!0)},n=t=>{t.preventDefault(),e&&!e.contains(t.relatedTarget)&&ti(!1)},i=e=>{e.preventDefault(),e.stopPropagation(),ti(!1);let t=[];if(e.dataTransfer?.files)for(let r=0;r<e.dataTransfer.files.length;r++)t.push(e.dataTransfer.files[r]);t.length>0&&eY.current(t)};return e.addEventListener("dragover",r),e.addEventListener("dragleave",n),e.addEventListener("drop",i),()=>{document.removeEventListener("paste",t,!0),e.removeEventListener("dragover",r),e.removeEventListener("dragleave",n),e.removeEventListener("drop",i)}},[]),(0,n.useEffect)(()=>{if(!Q)return;let e=e=>{let t=e.target;er.current&&!er.current.contains(t)&&en.current&&!en.current.contains(t)&&Z(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[Q]),(0,r.jsxs)("div",{className:(0,C.cn)("flex flex-col border rounded-lg overflow-hidden",z?"h-full !rounded-none":"h-full","border-zinc-700"),style:{borderColor:`${t.color}60`},children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 text-xs select-none flex-shrink-0",style:{backgroundColor:`${t.color}30`,borderBottom:`1px solid ${t.color}40`},children:[O&&!P&&(0,r.jsx)("div",{...O,className:"flex-shrink-0 cursor-grab active:cursor-grabbing text-zinc-500 hover:text-zinc-300 -ml-1",children:(0,r.jsx)(w,{className:"w-3.5 h-3.5"})}),(0,r.jsxs)("div",{ref:er,className:"flex-shrink-0",children:[(0,r.jsx)("button",{onClick:e=>{let t=e.currentTarget.getBoundingClientRect();et({x:t.left,y:t.bottom+6}),Z(!Q)},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"}),Q&&(0,i.createPortal)((0,r.jsx)("div",{ref:en,className:"fixed z-[9999] bg-zinc-800 border border-zinc-600 rounded-xl p-3 shadow-2xl",style:{left:ee.x,top:ee.y},children:(0,r.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,r.jsx)("button",{onClick:()=>{N(t.id,{color:e}),Z(!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)]}),G?(0,r.jsxs)("div",{className:"flex items-center gap-1 flex-1",children:[(0,r.jsx)("input",{autoFocus:!0,value:Y,onChange:e=>X(e.target.value),onKeyDown:e=>{"Enter"===e.key&&e5(),"Escape"===e.key&&(X(t.title),H(!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,r.jsx)("button",{onClick:e5,className:"text-green-400 hover:text-green-300",children:(0,r.jsx)(c.Check,{className:"w-3 h-3"})})]}):(0,r.jsxs)("div",{className:"flex items-center gap-1 flex-1 min-w-0 group/title",children:[(0,r.jsx)("span",{onDoubleClick:()=>H(!0),className:"truncate text-zinc-300 font-medium cursor-default",children:t.title}),(0,r.jsx)("button",{onClick:()=>H(!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,r.jsx)(s.Pencil,{className:"w-2.5 h-2.5"})})]}),(0,r.jsx)("button",{onClick:()=>M?.(t.cwd),className:"text-[10px] text-zinc-500 truncate max-w-[120px] hover:text-amber-400 transition-colors",title:`Browse ${t.cwd}`,children:t.cwd.split(/[/\\]/).pop()}),t.agentType&&"shell"!==t.agentType&&(0,r.jsxs)("span",{className:"text-[9px] px-1.5 py-0.5 rounded font-medium flex items-center gap-1",style:{backgroundColor:`${T.AGENT_TYPES[t.agentType]?.color||"#6366f1"}20`,color:T.AGENT_TYPES[t.agentType]?.color||"#6366f1"},children:[T.AGENT_TYPES[t.agentType]?.name||t.agentType,t.customModelId&&(0,r.jsx)("span",{className:"flex items-center gap-1 border-l border-current pl-1 ml-0.5",children:(0,r.jsx)("span",{className:(0,C.cn)("w-1.5 h-1.5 rounded-full","RUNNING"===eV?"bg-green-500":"PROVISIONING"===eV||"STAGING"===eV?"bg-yellow-500 animate-pulse":"bg-red-500"),title:eV||"UNKNOWN"})})]}),t.nodeId&&(0,r.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,r.jsx)(h.Globe,{className:"w-2.5 h-2.5"}),"remote"]}),I&&"shell"!==t.agentType&&(0,r.jsx)("button",{onClick:async()=>{let e=!t.isCollaborating;await N(t.id,{isCollaborating:e}),q.current?.readyState===WebSocket.OPEN&&q.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,r.jsx)(m.Users,{className:"w-3 h-3"})}),!_&&!ei&&(0,r.jsx)("span",{className:"text-[10px] text-yellow-500",children:"connecting..."}),ei&&(0,r.jsx)("button",{onClick:()=>{eQ.current=!0,eZ.current&&clearTimeout(eZ.current),q.current?.close(),L.current?.dispose(),ea(!1),eX.current=!1,setTimeout(e1,100)},className:"text-zinc-400 hover:text-white",title:"Restart",children:(0,r.jsx)(o.RotateCcw,{className:"w-3 h-3"})}),!P&&A&&(0,r.jsx)("button",{onClick:()=>{A&&(eQ.current=!0,eZ.current&&clearTimeout(eZ.current),q.current?.close(),L.current?.dispose(),A(t.id))},className:"text-zinc-300 hover:text-white",title:"Pop out to new window",children:(0,r.jsx)(x,{className:"w-3 h-3"})}),t.diffBaselineSha&&(0,r.jsxs)("button",{onClick:()=>eU(!eq),className:(0,C.cn)("relative text-zinc-300 hover:text-white",eq&&"text-indigo-400"),title:eq?"Hide diff":"Review changes",children:[(0,r.jsx)(j,{className:"w-3 h-3"}),null!=eW&&eW>0&&!eq&&(0,r.jsx)("span",{className:"absolute -top-1.5 -right-1.5 text-[8px] bg-indigo-500 text-white rounded-full w-3.5 h-3.5 flex items-center justify-center font-bold",children:eW>9?"9+":eW})]}),E&&!P&&(0,r.jsx)("button",{onClick:()=>E(t.id),className:"text-zinc-300 hover:text-yellow-400",title:"Minimize",children:(0,r.jsx)(y,{className:"w-3 h-3"})}),(0,r.jsx)("button",{onClick:()=>k(t.id),className:"text-zinc-300 hover:text-white",title:z?"Restore":"Maximize",children:z?(0,r.jsx)(u,{className:"w-3 h-3"}):(0,r.jsx)(l.Maximize2,{className:"w-3 h-3"})}),(0,r.jsx)("button",{onClick:()=>{confirm("Close this terminal?")&&d(t.id)},className:"text-zinc-300 hover:text-red-400",title:"Close",children:(0,r.jsx)(a.X,{className:"w-3 h-3"})})]}),(0,r.jsxs)("div",{ref:F,className:"flex-1 relative bg-[#0a0a0a]",style:{minHeight:0,flex:1},onClick:ed?e=>{e.preventDefault()}:void 0,onWheel:ed?e=>{e.preventDefault();let t=Date.now();Math.abs(e.deltaY)>10&&t-ek.current>200&&(ek.current=t,e2(e.deltaY<0?"\x1b[A":"\x1b[B"))}:void 0,children:[tn&&(0,r.jsx)("div",{className:"absolute inset-0 z-10 bg-indigo-500/10 border-2 border-dashed border-indigo-400 flex items-center justify-center pointer-events-none",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 bg-zinc-900/90 px-4 py-2 rounded-lg text-sm text-indigo-300",children:[(0,r.jsx)(b.Upload,{className:"w-4 h-4"}),"Drop files to upload to ",t.cwd.split(/[/\\]/).pop()||t.cwd]})}),tt&&(0,r.jsx)("div",{className:"absolute bottom-2 left-1/2 -translate-x-1/2 z-10 bg-zinc-800/95 border border-zinc-600 px-3 py-1.5 rounded-lg text-xs text-zinc-300 shadow-lg",children:tt})]}),eq&&(0,r.jsx)(S,{paneId:t.id,onClose:()=>eU(!1)}),ed&&(0,r.jsxs)("div",{className:"flex flex-col gap-1 px-2 py-1.5 flex-shrink-0 border-t border-zinc-700",style:{backgroundColor:`${t.color}15`,borderTopColor:`${t.color}30`},children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("input",{ref:ey,type:"text",value:eb,readOnly:!eN,onChange:e=>eg(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e2(eb?eb+"\r":"\r"),eg(""),ez(!1),ey.current?.blur())},onBlur:()=>ez(!1),placeholder:eS&&"listening"===ew?"Speak now...":eS&&"transcribing"===ew?"Sending...":eS?"Immersive mode active":"listening"===ew?"Listening...":"transcribing"===ew?"Transcribing...":eN?"Type here...":"Tap mic, keyboard, or type",className:(0,C.cn)("flex-1 text-zinc-200 text-sm px-3 py-2 rounded border focus:outline-none font-mono",eN?"bg-zinc-900 border-zinc-400 placeholder:text-zinc-500":"bg-zinc-900/50 border-zinc-700 placeholder:text-zinc-600"),autoComplete:"off",autoCorrect:"on",spellCheck:!1}),!eS&&(0,r.jsx)("button",{onClick:e4,className:(0,C.cn)("p-2 rounded border transition-all","off"===ew||eS?"bg-zinc-800 border-zinc-700 text-zinc-400 hover:text-white":"bg-red-500 border-red-400 text-white animate-pulse"),title:"Voice → input (review before send)",children:"off"===ew||eS?(0,r.jsx)(f.Mic,{className:"w-4 h-4"}):(0,r.jsx)(p.MicOff,{className:"w-4 h-4"})}),(0,r.jsx)("button",{onClick:()=>{if(eT.current){if(eT.current=!1,eC(!1),ej.current?.state==="recording"){e6.current=!0,ev("transcribing");try{ej.current.stop()}catch{}}else ev("off");e$.current=null}else eT.current=!0,eC(!0),e7()},className:(0,C.cn)("p-2 rounded-full border transition-all",eS?"bg-green-600 border-green-400 text-white shadow-[0_0_12px_rgba(34,197,94,0.5)] animate-pulse":"bg-zinc-800 border-zinc-700 text-zinc-500 hover:text-green-400 hover:border-green-600"),title:eS?"Exit immersive voice":"Immersive voice (auto-send)",children:(0,r.jsx)(g.AudioLines,{className:"w-4 h-4"})}),eS&&(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("button",{onClick:()=>eL(!eF),className:(0,C.cn)("p-1.5 rounded border transition-all",eF?"bg-zinc-700 border-zinc-600 text-zinc-200":"bg-zinc-800 border-zinc-700 text-zinc-500 hover:text-zinc-300"),title:"Voice settings",children:(0,r.jsx)(v.Settings,{className:"w-3.5 h-3.5"})}),eF&&(0,r.jsxs)("div",{className:"absolute bottom-full right-0 mb-2 p-3 bg-zinc-800 border border-zinc-600 rounded-lg shadow-xl z-50 min-w-[180px]",children:[(0,r.jsx)("div",{className:"text-[10px] text-zinc-400 font-medium mb-2",children:"Voice Settings"}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex justify-between text-[9px] text-zinc-500 mb-1",children:[(0,r.jsx)("span",{children:"Sensitivity"}),(0,r.jsx)("span",{className:"font-mono",children:eR})]}),(0,r.jsx)("input",{type:"range",min:10,max:120,value:eR,onChange:e=>{let t=Number(e.target.value);eE(t),eA.current=t},className:"w-full h-1.5 accent-green-500"}),(0,r.jsxs)("div",{className:"flex justify-between text-[8px] text-zinc-600",children:[(0,r.jsx)("span",{children:"Quiet"}),(0,r.jsx)("span",{children:"Loud"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex justify-between text-[9px] text-zinc-500 mb-1",children:[(0,r.jsx)("span",{children:"Pause before send"}),(0,r.jsxs)("span",{className:"font-mono",children:[(eM/1e3).toFixed(1),"s"]})]}),(0,r.jsx)("input",{type:"range",min:1e3,max:5e3,step:250,value:eM,onChange:e=>{let t=Number(e.target.value);eP(t),eD.current=t},className:"w-full h-1.5 accent-green-500"}),(0,r.jsxs)("div",{className:"flex justify-between text-[8px] text-zinc-600",children:[(0,r.jsx)("span",{children:"Fast"}),(0,r.jsx)("span",{children:"Patient"})]})]}),(0,r.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,r.jsx)("span",{className:"text-[9px] text-zinc-500",children:"Auto-send"}),(0,r.jsx)("div",{onClick:()=>{let e=!eI;eO(e),eB.current=e},className:(0,C.cn)("w-7 h-4 rounded-full relative transition-colors cursor-pointer",eI?"bg-green-600":"bg-zinc-600"),children:(0,r.jsx)("div",{className:(0,C.cn)("absolute top-0.5 w-3 h-3 rounded-full bg-white transition-transform",eI?"translate-x-3.5":"translate-x-0.5")})})]})]})]})]}),(0,r.jsx)("button",{onClick:()=>{e2(eb?eb+"\r":"\r"),eg("")},className:"px-3 py-2 text-[11px] font-mono bg-indigo-600 hover:bg-indigo-500 text-white rounded border border-indigo-500 font-medium",children:"Send"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("button",{onClick:()=>{ez(!0),setTimeout(()=>ey.current?.focus(),50)},className:(0,C.cn)("px-2 py-1 text-[10px] font-mono rounded border",eN?"bg-indigo-600 border-indigo-500 text-white":"bg-zinc-800 hover:bg-zinc-700 text-zinc-400 border-zinc-700"),children:"⌨"}),(0,r.jsx)("button",{onClick:()=>e2("\x1b"),className:"px-2 py-1 text-[10px] font-mono bg-zinc-800 hover:bg-zinc-700 text-zinc-400 rounded border border-zinc-700",children:"Esc"}),(0,r.jsx)("button",{onClick:()=>e2(" "),className:"px-2 py-1 text-[10px] font-mono bg-zinc-800 hover:bg-zinc-700 text-zinc-400 rounded border border-zinc-700",children:"Tab"}),(0,r.jsx)("button",{onClick:()=>e2("\x03"),className:"px-2 py-1 text-[10px] font-mono bg-zinc-800 hover:bg-zinc-700 text-zinc-400 rounded border border-zinc-700",children:"Ctrl+C"}),(0,r.jsx)("button",{onClick:()=>e2("\x1b[A"),className:"px-2 py-1 text-[10px] font-mono bg-zinc-800 hover:bg-zinc-700 text-zinc-400 rounded border border-zinc-700",children:"↑"}),(0,r.jsx)("button",{onClick:()=>e2("\x1b[B"),className:"px-2 py-1 text-[10px] font-mono bg-zinc-800 hover:bg-zinc-700 text-zinc-400 rounded border border-zinc-700",children:"↓"}),(0,r.jsx)("div",{className:"flex-1"}),(0,r.jsx)("button",{onClick:()=>eg(""),className:"px-2 py-1 text-[10px] font-mono bg-zinc-800 hover:bg-zinc-700 text-zinc-400 rounded border border-zinc-700",children:"Clear"})]})]}),!ed&&e8&&(0,r.jsxs)("div",{className:"flex items-center justify-end gap-1.5 px-2 py-1 flex-shrink-0 border-t border-zinc-700/50",style:{backgroundColor:`${t.color}08`},children:[ex&&(0,r.jsx)("span",{className:"text-[10px] text-green-400 animate-pulse mr-1",children:"listening"===em?"Listening...":"Voice active"}),(0,r.jsx)("button",{onClick:()=>{if(ep.current){if(ep.current=!1,eh(!1),ef("idle"),e9.current){try{e9.current.abort()}catch{}e9.current=null}}else e8&&(ep.current=!0,eh(!0),te(!1),setTimeout(()=>L.current?.focus(),100))},className:(0,C.cn)("p-1 rounded border transition-all",ex&&!eS?"bg-green-900/50 border-green-500 text-green-400 hover:bg-red-900/50 hover:border-red-600 hover:text-red-400 shadow-[0_0_8px_rgba(34,197,94,0.3)]":"bg-zinc-800/50 border-zinc-700 text-zinc-500 hover:text-zinc-300 hover:bg-zinc-700"),title:"Dictation (text appears, you press Enter)",children:(0,r.jsx)(f.Mic,{className:"w-3.5 h-3.5"})}),(0,r.jsx)("button",{onClick:()=>{if(ep.current){if(ep.current=!1,eh(!1),ef("idle"),e9.current){try{e9.current.abort()}catch{}e9.current=null}}else e8&&(ep.current=!0,eh(!0),te(!0),setTimeout(()=>L.current?.focus(),100))},className:(0,C.cn)("p-1 rounded-full border transition-all",ex&&!eS?"bg-green-600 border-green-400 text-white shadow-[0_0_10px_rgba(34,197,94,0.5)] animate-pulse":eS?"bg-zinc-800/50 border-zinc-700 text-zinc-600":"bg-zinc-800/50 border-zinc-700 text-zinc-500 hover:text-green-400 hover:border-green-600"),title:"Immersive voice (auto-send on silence)",children:(0,r.jsx)(g.AudioLines,{className:"w-3.5 h-3.5"})})]})]})}e.s(["TerminalPane",()=>E],424134)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,755838,(e,t,r)=>{"use strict";var n=e.r(271645),u="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},c=n.useState,s=n.useEffect,i=n.useLayoutEffect,o=n.useDebugValue;function a(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!u(e,r)}catch(e){return!0}}var l="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=c({inst:{value:r,getSnapshot:t}}),u=n[0].inst,l=n[1];return i(function(){u.value=r,u.getSnapshot=t,a(u)&&l({inst:u})},[e,r,t]),s(function(){return a(u)&&l({inst:u}),e(function(){a(u)&&l({inst:u})})},[e]),o(r),r};r.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:l},802239,(e,t,r)=>{"use strict";t.exports=e.r(755838)},752822,(e,t,r)=>{"use strict";var n=e.r(271645),u=e.r(802239),c="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=u.useSyncExternalStore,i=n.useRef,o=n.useEffect,a=n.useMemo,l=n.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,n,u){var f=i(null);if(null===f.current){var v={hasValue:!1,value:null};f.current=v}else v=f.current;var S=s(e,(f=a(function(){function e(e){if(!o){if(o=!0,s=e,e=n(e),void 0!==u&&v.hasValue){var t=v.value;if(u(t,e))return i=t}return i=e}if(t=i,c(s,e))return t;var r=n(e);return void 0!==u&&u(t,r)?(s=e,t):(s=e,i=r)}var s,i,o=!1,a=void 0===r?null:r;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]},[t,r,n,u]))[0],f[1]);return o(function(){v.hasValue=!0,v.value=S},[S]),l(S),S}},430224,(e,t,r)=>{"use strict";t.exports=e.r(752822)},23284,e=>{"use strict";var t=e.i(271645);function r(){let[e,r]=(0,t.useState)(!1),[n,u]=(0,t.useState)(!1),[c,s]=(0,t.useState)(""),[i,o]=(0,t.useState)(""),a=(0,t.useRef)(null);(0,t.useEffect)(()=>{let e,t;try{e=window.SpeechRecognition||window.webkitSpeechRecognition}catch{}if(u(!!e),e){try{(t=new e).continuous=!1,t.interimResults=!0,t.lang="en-US"}catch{u(!1);return}t.onresult=e=>{let t="",r="";for(let n=e.resultIndex;n<e.results.length;n++){let u=e.results[n];u.isFinal?r+=u[0].transcript:t+=u[0].transcript}r?(s(r),o("")):o(t)},t.onerror=e=>{console.error("[SpeechRecognition] error:",e.error,e.message),r(!1)},t.onend=()=>{r(!1)},a.current=t}},[]);let l=(0,t.useCallback)(()=>{if(a.current&&!e){s(""),o("");try{a.current.start(),r(!0)}catch{}}},[e]);return{isListening:e,isSupported:n,transcript:c,interimTranscript:i,startListening:l,stopListening:(0,t.useCallback)(()=>{if(a.current){try{a.current.stop()}catch{}r(!1)}},[]),resetTranscript:(0,t.useCallback)(()=>{s(""),o("")},[])}}e.s(["useSpeechRecognition",()=>r])},188077,e=>{e.v(t=>Promise.all(["static/chunks/44d17f5433cd8d6e.js","static/chunks/c4c1ff347fa86af0.js"].map(t=>e.l(t))).then(()=>t(532504)))}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,531278,e=>{"use strict";let t=(0,e.i(475254).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>t],531278)},266027,954616,e=>{"use strict";let t;var s=e.i(175555),i=e.i(540143),a=e.i(286491),r=e.i(915823),n=e.i(793803),o=e.i(619273),c=e.i(180166),l=class extends r.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;#a=void 0;#r=void 0;#n;#o;#s;#t;#c;#l;#u;#d;#h;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#i.addObserver(this),u(this.#i,this.options)?this.#y():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return d(this.#i,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return d(this.#i,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#f(),this.#g(),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.#b(),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&&h(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.#j();let a=this.#v();i&&(this.#i!==s||(0,o.resolveEnabled)(this.options.enabled,this.#i)!==(0,o.resolveEnabled)(t.enabled,this.#i)||a!==this.#p)&&this.#N(a)}getOptimisticResult(e){var t,s;let i=this.#e.getQueryCache().build(this.#e,e),a=this.createResult(i,e);return t=this,s=a,(0,o.shallowEqualObjects)(t.getCurrentResult(),s)||(this.#r=a,this.#o=this.options,this.#n=this.#i.state),a}getCurrentResult(){return this.#r}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.#r))}#y(e){this.#b();let t=this.#i.fetch(this.options,e);return e?.throwOnError||(t=t.catch(o.noop)),t}#j(){this.#f();let e=(0,o.resolveStaleTime)(this.options.staleTime,this.#i);if(o.isServer||this.#r.isStale||!(0,o.isValidTimeout)(e))return;let t=(0,o.timeUntilStale)(this.#r.dataUpdatedAt,e);this.#d=c.timeoutManager.setTimeout(()=>{this.#r.isStale||this.updateResult()},t+1)}#v(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#i):this.options.refetchInterval)??!1}#N(e){this.#g(),this.#p=e,!o.isServer&&!1!==(0,o.resolveEnabled)(this.options.enabled,this.#i)&&(0,o.isValidTimeout)(this.#p)&&0!==this.#p&&(this.#h=c.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||s.focusManager.isFocused())&&this.#y()},this.#p))}#x(){this.#j(),this.#N(this.#v())}#f(){this.#d&&(c.timeoutManager.clearTimeout(this.#d),this.#d=void 0)}#g(){this.#h&&(c.timeoutManager.clearInterval(this.#h),this.#h=void 0)}createResult(e,t){let s,i=this.#i,r=this.options,c=this.#r,l=this.#n,d=this.#o,m=e!==i?e.state:this.#a,{state:y}=e,x={...y},f=!1;if(t._optimisticResults){let s=this.hasListeners(),n=!s&&u(e,t),o=s&&h(e,i,t,r);(n||o)&&(x={...x,...(0,a.fetchState)(y.data,e.options)}),"isRestoring"===t._optimisticResults&&(x.fetchStatus="idle")}let{error:g,errorUpdatedAt:b,status:j}=x;s=x.data;let v=!1;if(void 0!==t.placeholderData&&void 0===s&&"pending"===j){let e;c?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(e=c.data,v=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,void 0!==e&&(j="success",s=(0,o.replaceData)(c?.data,e,t),f=!0)}if(t.select&&void 0!==s&&!v)if(c&&s===l?.data&&t.select===this.#c)s=this.#l;else try{this.#c=t.select,s=t.select(s),s=(0,o.replaceData)(c?.data,s,t),this.#l=s,this.#t=null}catch(e){this.#t=e}this.#t&&(g=this.#t,s=this.#l,b=Date.now(),j="error");let N="fetching"===x.fetchStatus,w="pending"===j,k="error"===j,S=w&&N,C=void 0!==s,R={status:j,fetchStatus:x.fetchStatus,isPending:w,isSuccess:"success"===j,isError:k,isInitialLoading:S,isLoading:S,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:N,isRefetching:N&&!w,isLoadingError:k&&!C,isPaused:"paused"===x.fetchStatus,isPlaceholderData:f,isRefetchError:k&&C,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)},r=()=>{a(this.#s=R.promise=(0,n.pendingThenable)())},o=this.#s;switch(o.status){case"pending":e.queryHash===i.queryHash&&a(o);break;case"fulfilled":(s||R.data!==o.value)&&r();break;case"rejected":s&&R.error===o.reason||r()}}return R}updateResult(){let e=this.#r,t=this.createResult(this.#i,this.options);if(this.#n=this.#i.state,this.#o=this.options,void 0!==this.#n.data&&(this.#u=this.#i),(0,o.shallowEqualObjects)(t,e))return;this.#r=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.#r).some(t=>this.#r[t]!==e[t]&&i.has(t))};this.#w({listeners:s()})}#b(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#i)return;let t=this.#i;this.#i=e,this.#a=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#w(e){i.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#i,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 i="function"==typeof s?s(e):s;return"always"===i||!1!==i&&p(e,t)}return!1}function h(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(247167);var m=e.i(271645),y=e.i(912598);e.i(843476);var x=m.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),f=m.createContext(!1);f.Provider;var g=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function b(e,t){return function(e,t,s){let a,r=m.useContext(f),n=m.useContext(x),c=(0,y.useQueryClient)(s),l=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(l);let u=c.getQueryCache().get(l.queryHash);if(l._optimisticResults=r?"isRestoring":"optimistic",l.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=l.staleTime;l.staleTime="function"==typeof t?(...s)=>e(t(...s)):e(t),"number"==typeof l.gcTime&&(l.gcTime=Math.max(l.gcTime,1e3))}a=u?.state.error&&"function"==typeof l.throwOnError?(0,o.shouldThrowError)(l.throwOnError,[u.state.error,u]):l.throwOnError,(l.suspense||l.experimental_prefetchInRender||a)&&!n.isReset()&&(l.retryOnMount=!1),m.useEffect(()=>{n.clearReset()},[n]);let d=!c.getQueryCache().get(l.queryHash),[h]=m.useState(()=>new t(c,l)),p=h.getOptimisticResult(l),b=!r&&!1!==e.subscribed;if(m.useSyncExternalStore(m.useCallback(e=>{let t=b?h.subscribe(i.notifyManager.batchCalls(e)):o.noop;return h.updateResult(),t},[h,b]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),m.useEffect(()=>{h.setOptions(l)},[l,h]),l?.suspense&&p.isPending)throw g(l,h,n);if((({result:e,errorResetBoundary:t,throwOnError:s,query:i,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(a&&void 0===e.data||(0,o.shouldThrowError)(s,[e.error,i])))({result:p,errorResetBoundary:n,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw p.error;if(c.getDefaultOptions().queries?._experimental_afterQuery?.(l,p),l.experimental_prefetchInRender&&!o.isServer&&p.isLoading&&p.isFetching&&!r){let e=d?g(l,h,n):u?.promise;e?.catch(o.noop).finally(()=>{h.updateResult()})}return l.notifyOnChangeProps?p:h.trackResult(p)}(e,l,t)}e.s(["useQuery",()=>b],266027);var j=e.i(114272),v=r,N=class extends v.Subscribable{#e;#r=void 0;#k;#S;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#C()}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.#k,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,o.hashKey)(t.mutationKey)!==(0,o.hashKey)(this.options.mutationKey)?this.reset():this.#k?.state.status==="pending"&&this.#k.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#k?.removeObserver(this)}onMutationUpdate(e){this.#C(),this.#w(e)}getCurrentResult(){return this.#r}reset(){this.#k?.removeObserver(this),this.#k=void 0,this.#C(),this.#w()}mutate(e,t){return this.#S=t,this.#k?.removeObserver(this),this.#k=this.#e.getMutationCache().build(this.#e,this.options),this.#k.addObserver(this),this.#k.execute(e)}#C(){let e=this.#k?.state??(0,j.getDefaultState)();this.#r={...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.#S&&this.hasListeners()){let t=this.#r.variables,s=this.#r.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#S.onSuccess?.(e.data,t,s,i)}catch(e){Promise.reject(e)}try{this.#S.onSettled?.(e.data,null,t,s,i)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#S.onError?.(e.error,t,s,i)}catch(e){Promise.reject(e)}try{this.#S.onSettled?.(void 0,e.error,t,s,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#r)})})}};function w(e,t){let s=(0,y.useQueryClient)(t),[a]=m.useState(()=>new N(s,e));m.useEffect(()=>{a.setOptions(e)},[a,e]);let r=m.useSyncExternalStore(m.useCallback(e=>a.subscribe(i.notifyManager.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),n=m.useCallback((e,t)=>{a.mutate(e,t).catch(o.noop)},[a]);if(r.error&&(0,o.shouldThrowError)(a.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:n,mutateAsync:r.mutate}}e.s(["useMutation",()=>w],954616)},203999,e=>{"use strict";var t=e.i(266027),s=e.i(954616),i=e.i(912598),a=e.i(209165);function r(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,i=50,r){return(0,t.useQuery)({queryKey:["messages",e,s,i,r],queryFn:async()=>{let t=r?(0,a.api)(`/api/network/proxy/${r}/sessions/${e}/messages?offset=${s}&limit=${i}`):(0,a.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,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 l(){let e=(0,i.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,i.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,i.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,i.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,i.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 y(){let e=(0,i.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 f(){return(0,t.useQuery)({queryKey:["workspaces","remote"],queryFn:async()=>(await fetch((0,a.api)("/api/workspaces?nodes=all"))).json()})}function g(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async({workspaceId:e,sessionId:t,nodeId:s,title:i,cwd:r,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:i,cwd:r,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,i.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 j(){let e=(0,i.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 v(){return(0,t.useQuery)({queryKey:["projects"],queryFn:async()=>(await fetch((0,a.api)("/api/projects"))).json()})}function N(){return(0,t.useQuery)({queryKey:["analytics"],queryFn:async()=>(await fetch((0,a.api)("/api/analytics/overview"))).json()})}function w(){let e=(0,i.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",()=>N,"useBulkAction",()=>j,"useDeleteTag",()=>m,"useMessages",()=>o,"useProjects",()=>v,"useRemoteWorkspaces",()=>f,"useRemoveSessionFromWorkspace",()=>b,"useRemoveTag",()=>d,"useRenameSession",()=>h,"useSession",()=>n,"useSessions",()=>r,"useSync",()=>w,"useTags",()=>p,"useToggleStar",()=>c,"useUpdateNotes",()=>l,"useUpdateTagColor",()=>y,"useWorkspaces",()=>x])},107233,e=>{"use strict";let t=(0,e.i(475254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],107233)},16715,e=>{"use strict";let t=(0,e.i(475254).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(475254).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)},595468,911588,e=>{"use strict";var t=e.i(475254);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],595468);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],911588)},349889,e=>{"use strict";var t=e.i(843476),s=e.i(271645),i=e.i(209165);function a(){let[e,a]=(0,s.useState)(null),[r,n]=(0,s.useState)(null),[o,c]=(0,s.useState)(null),[l,u]=(0,s.useState)(!1),[d,h]=(0,s.useState)({});(0,s.useEffect)(()=>{fetch((0,i.api)("/api/cortex/settings")).then(e=>e.json()).then(a).catch(()=>{}),fetch((0,i.api)("/api/cortex/usage")).then(e=>e.json()).then(c).catch(()=>{})},[]);let p=async e=>{u(!0);try{if((await fetch((0,i.api)("/api/cortex/settings"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok){let t={...e};for(let e of["anthropic_api_key","openai_api_key","voyage_api_key","groq_api_key"])t[e]&&(t[e]=`…${t[e].slice(-4)}`);a(e=>({...e,...t}))}}catch{}finally{u(!1)}},m=async(e=!1)=>{if(e&&!confirm("This will delete all existing knowledge and re-ingest from session files. Continue?"))return;await fetch((0,i.api)("/api/cortex/ingest/bootstrap"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clean:e})});let t=setInterval(async()=>{let e=await fetch((0,i.api)("/api/cortex/ingest/status")),s=await e.json();n(s),("complete"===s.status||"error"===s.status)&&(clearInterval(t),fetch((0,i.api)("/api/cortex/usage")).then(e=>e.json()).then(c).catch(()=>{}))},2e3)},y=e?.enabled??!1,x=y?"":"opacity-40 pointer-events-none";return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("h3",{className:"text-sm font-medium text-gray-200",children:["Cortex",(0,t.jsx)("span",{className:"ml-2 text-[9px] font-medium uppercase tracking-wider text-purple-400 bg-purple-400/10 px-1.5 py-0.5 rounded",children:"Beta"})]}),(0,t.jsxs)("label",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"Enable Cortex"}),(0,t.jsx)("input",{type:"checkbox",checked:y,disabled:!e,onChange:e=>p({enabled:e.target.checked}),className:"accent-purple-500"})]}),!e&&(0,t.jsx)("p",{className:"text-[10px] text-gray-500",children:"Loading…"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("span",{className:"text-xs text-gray-300 font-medium",children:"API Keys"}),(0,t.jsx)("p",{className:"text-[10px] text-gray-600 -mt-2",children:"Keys configured here override environment variables. Stored in ~/.spaces/config.json."}),[{key:"anthropic_api_key",label:"Anthropic",placeholder:"sk-ant-…",hint:"LLM distillation (Claude Haiku)"},{key:"voyage_api_key",label:"Voyage AI",placeholder:"pa-…",hint:"Embeddings — best for code/technical retrieval"},{key:"openai_api_key",label:"OpenAI",placeholder:"sk-proj-…",hint:"Embeddings fallback + transcription fallback"},{key:"groq_api_key",label:"Groq",placeholder:"gsk_…",hint:"Speech transcription (Quest voice input)"}].map(({key:s,label:i,placeholder:a,hint:r})=>(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:i}),e?.[s]?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-xs text-gray-500 font-mono",children:e[s]}),(0,t.jsx)("button",{onClick:()=>p({[s]:""}),className:"text-[10px] text-gray-600 hover:text-red-400",children:"remove"})]}):(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsx)("input",{type:"password",value:d[s]||"",onChange:e=>h(t=>({...t,[s]:e.target.value})),placeholder:a,className:"flex-1 text-xs bg-white/5 border border-white/10 rounded px-2 py-1 text-gray-300 placeholder-gray-600"}),(0,t.jsx)("button",{onClick:()=>{d[s]&&(p({[s]:d[s]}),h(e=>({...e,[s]:""})))},disabled:!d[s],className:"text-xs px-2 py-1 bg-purple-600 hover:bg-purple-500 text-white rounded disabled:opacity-30",children:"Save"})]}),(0,t.jsx)("p",{className:"text-[10px] text-gray-600",children:r})]},s))]}),(0,t.jsxs)("label",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"Debug logging"}),(0,t.jsx)("p",{className:"text-[10px] text-gray-600",children:"Verbose memory, LanceDB, embedding, and distillation logs in server console"})]}),(0,t.jsx)("input",{type:"checkbox",checked:e?.debug??!1,onChange:e=>p({debug:e.target.checked}),className:"accent-purple-500 shrink-0 ml-3"})]}),(0,t.jsxs)("div",{className:`block ${x}`,children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"Embedding provider"}),(0,t.jsx)("p",{className:"text-[10px] text-gray-500",children:"Voyage AI — voyage-3-lite (512-dim)"})]}),(0,t.jsxs)("div",{className:`block ${x}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"Context injection budget"}),(0,t.jsxs)("span",{className:"text-[10px] text-gray-500",children:[e?.injection?.max_tokens||2e3," tokens"]})]}),(0,t.jsx)("input",{type:"range",min:500,max:2e4,step:500,value:e?.injection?.max_tokens||2e3,onChange:e=>p({injection:{max_tokens:parseInt(e.target.value)}}),className:"w-full"}),(0,t.jsx)("p",{className:"text-[10px] text-gray-600 mt-0.5",children:"Tokens of retrieved knowledge injected per prompt (Claude context: 200K)"})]}),(0,t.jsxs)("label",{className:`flex items-center justify-between ${x}`,children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"LLM distillation"}),(0,t.jsx)("p",{className:"text-[10px] text-gray-600",children:"4 Haiku API calls per session end — cleaner knowledge at ~$0.03–0.05/session"})]}),(0,t.jsx)("input",{type:"checkbox",checked:e?.ingestion?.distillation??!0,onChange:e=>p({ingestion:{distillation:e.target.checked}}),className:"accent-purple-500 shrink-0 ml-3"})]}),(0,t.jsxs)("div",{className:`block ${x}`,children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"Federation sync mode"}),(0,t.jsx)("p",{className:"text-[10px] text-gray-600 mb-1",children:"How knowledge is shared across multiple Spaces instances"}),(0,t.jsxs)("select",{value:e?.federation?.sync_mode||"query-only",onChange:e=>p({federation:{sync_mode:e.target.value}}),className:"w-full text-xs bg-white/5 border border-white/10 rounded px-2 py-1 text-gray-300",children:[(0,t.jsx)("option",{value:"query-only",children:"Query Only — read from remotes, no push"}),(0,t.jsx)("option",{value:"background-sync",children:"Background Sync — periodic two-way sync"}),(0,t.jsx)("option",{value:"real-time-sync",children:"Real-time Sync — sync on every store"})]})]}),o&&o.distillation?.calls>0&&(0,t.jsxs)("div",{className:"pt-2 border-t border-white/5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"Distillation usage"}),(0,t.jsx)("button",{onClick:()=>fetch((0,i.api)("/api/cortex/usage"),{method:"DELETE"}).then(()=>c(null)),className:"text-[10px] text-gray-600 hover:text-gray-400",children:"reset"})]}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-500 space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:"API calls"}),(0,t.jsx)("span",{className:"text-gray-400",children:o.distillation.calls.toLocaleString()})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:"Tokens in / out"}),(0,t.jsxs)("span",{className:"text-gray-400",children:[(o.distillation.input_tokens/1e3).toFixed(1),"K / ",(o.distillation.output_tokens/1e3).toFixed(1),"K"]})]}),(0,t.jsxs)("div",{className:"flex justify-between font-medium",children:[(0,t.jsx)("span",{children:"Estimated cost"}),(0,t.jsxs)("span",{className:"text-purple-400",children:["$",o.distillation.estimated_cost_usd.toFixed(4)]})]})]})]}),(0,t.jsxs)("div",{className:`pt-2 border-t border-white/5 ${x}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{onClick:()=>m(!1),disabled:r?.status==="running",className:"text-xs px-3 py-1.5 bg-purple-600 hover:bg-purple-500 text-white rounded disabled:opacity-50",children:r?.status==="running"?"Ingesting...":"Incremental Ingest"}),(0,t.jsx)("button",{onClick:()=>m(!0),disabled:r?.status==="running",className:"text-xs px-3 py-1.5 bg-zinc-700 hover:bg-zinc-600 text-white rounded disabled:opacity-50",children:"Clean Re-ingest"})]}),(0,t.jsx)("p",{className:"text-[10px] text-gray-600 mt-1",children:"Incremental adds new sessions. Clean wipes all knowledge and re-processes everything."}),(r?.status==="running"||r?.status==="complete"||r?.status==="error")&&(0,t.jsxs)("div",{className:"mt-3 space-y-1.5",children:[(0,t.jsx)("div",{className:"w-full h-1.5 bg-white/5 rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all ${"error"===r.status?"bg-red-500":"complete"===r.status?"bg-green-500":"bg-purple-500"}`,style:{width:`${r.processedFiles/Math.max(r.totalFiles,1)*100}%`}})}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-500",children:[r.phase&&(0,t.jsxs)("span",{className:"text-gray-400",children:[r.phase," · "]}),r.processedFiles,"/",r.totalFiles," files",r.skippedFiles>0&&(0,t.jsxs)("span",{children:[" · ",r.skippedFiles," skipped"]}),r.totalChunks>0&&(0,t.jsxs)("span",{children:[" · ",r.totalChunks," chunks stored"]}),r.chunksSkipped>0&&(0,t.jsxs)("span",{children:[" · ",r.chunksSkipped," deduped"]})]}),r.errors?.length>0&&(0,t.jsxs)("div",{className:"text-[10px] text-red-400 max-h-20 overflow-y-auto space-y-0.5",children:[r.errors.slice(0,5).map((e,s)=>(0,t.jsx)("div",{className:"truncate",children:e},s)),r.errors.length>5&&(0,t.jsxs)("div",{className:"text-gray-500",children:["+",r.errors.length-5," more errors"]})]}),"complete"===r.status&&(0,t.jsxs)("div",{className:"text-[10px] text-green-400",children:["Complete — ",r.totalChunks," knowledge units from ",r.processedFiles-r.skippedFiles," sessions"]})]})]})]})}e.s(["CortexSettings",()=>a])},438090,e=>{"use strict";var t=e.i(843476),s=e.i(271645),i=e.i(203999),a=e.i(239616),r=e.i(16715),n=e.i(75505),o=e.i(531278),c=e.i(98919),l=e.i(595468),u=e.i(217923),d=e.i(107233),h=e.i(37727),p=e.i(911588),m=e.i(209165),y=e.i(209593),x=e.i(28916),f=e.i(349889);function g(){let{hasAuth:e,tier:g,version:b,hasCortex:j,cortexTierEnabled:v}=(0,x.useTier)(),N="u">typeof document&&document.cookie.includes("spaces-session="),w=(0,i.useSync)(),[k,S]=(0,s.useState)(""),[C,R]=(0,s.useState)(!1),[Q,T]=(0,s.useState)(!0),[O,E]=(0,s.useState)(!1),[q,F]=(0,s.useState)(""),[I,M]=(0,s.useState)(""),[z,K]=(0,s.useState)(""),[P,D]=(0,s.useState)(""),[_,A]=(0,s.useState)(!1),U=(0,s.useRef)(null),[L,$]=(0,s.useState)(null),[J,W]=(0,s.useState)([]),[B,H]=(0,s.useState)(""),[V,G]=(0,s.useState)(!1),[Y,Z]=(0,s.useState)(!0);(0,s.useEffect)(()=>{e?N?fetch((0,m.api)("/api/auth/me")).then(e=>e.json()).then(e=>{$(e),T(!1)}).catch(()=>T(!1)):fetch((0,m.api)("/api/auth/totp/status")).then(e=>e.json()).then(e=>{R(e.enabled),T(!1)}).catch(()=>T(!1)):T(!1)},[e,N]),(0,s.useEffect)(()=>{fetch((0,m.api)("/api/config")).then(e=>e.json()).then(e=>{G(e.telemetryOptOut),W(e.devDirectories||[]),Z(!1)}).catch(()=>Z(!1))},[]);let X=async e=>{W(e),await fetch((0,m.api)("/api/config"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({devDirectories:e})})},ee=()=>{let e=B.trim();!e||J.includes(e)||(e.startsWith("/")||/^[A-Za-z]:[\\/]/.test(e))&&(X([...J,e]),H(""))},et=async()=>{let e=await w.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})},es=async()=>{let e=!V;G(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})})},ei=async()=>{E(!0),D(""),K("");let e=await fetch((0,m.api)("/api/auth/totp/setup"),{method:"POST"}),t=await e.json();F(t.qrDataUrl),M(t.secret),setTimeout(()=>U.current?.focus(),100)},ea=async e=>{if(6!==e.length)return;A(!0),D("");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();A(!1),s.success?(R(!0),E(!1),F(""),M(""),K("")):(D(s.error||"Invalid code"),K(""),U.current?.focus())},er=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),E(!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..."]}):N?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.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."})]}):C&&!O?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.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:er,className:"text-xs text-zinc-500 hover:text-red-400 transition-colors",children:"Disable 2FA"})]}):O?(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.)"}),q?(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:q,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:I})]})]}):(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:U,type:"text",inputMode:"numeric",autoComplete:"one-time-code",placeholder:"000000",value:z,onChange:e=>{let t;K(t=e.target.value.replace(/\D/g,"").slice(0,6)),D(""),6===t.length&&ea(t)},disabled:_,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"}),_&&(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..."]}),P&&(0,t.jsx)("p",{className:"text-xs text-red-400 mt-2",children:P})]}),(0,t.jsx)("button",{onClick:()=>{E(!1),F(""),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:ei,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."}),J.length>0&&(0,t.jsx)("div",{className:"space-y-1.5 mb-3",children:J.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(J.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)(h.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:B,onChange:e=>H(e.target.value),onKeyDown:e=>"Enter"===e.key&&ee(),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:ee,disabled:!B.trim()||!(B.trim().startsWith("/")||/^[A-Za-z]:[\\/]/.test(B.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)(d.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)(r.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:et,disabled:w.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:[w.isPending?(0,t.jsx)(o.Loader2,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(r.RefreshCw,{className:"w-4 h-4"}),"Re-sync Now"]}),k&&(0,t.jsx)("p",{className:"text-xs text-green-600 mt-2",children:k})]}),(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)(u.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."}),Y?(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:!V,onChange:es,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"})]})]}),v&&(0,t.jsx)("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg p-5",children:(0,t.jsx)(f.CortexSettings,{})}),(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.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:g})]}),(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",()=>g])}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,531278,e=>{"use strict";let t=(0,e.i(475254).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>t],531278)},266027,954616,e=>{"use strict";let t;var s=e.i(175555),i=e.i(540143),a=e.i(286491),r=e.i(915823),n=e.i(793803),o=e.i(619273),c=e.i(180166),l=class extends r.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;#a=void 0;#r=void 0;#n;#o;#s;#t;#c;#l;#u;#d;#h;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#i.addObserver(this),u(this.#i,this.options)?this.#x():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return d(this.#i,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return d(this.#i,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#f(),this.#g(),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.#b(),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&&h(this.#i,s,this.options,t)&&this.#x(),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.#j();let a=this.#v();i&&(this.#i!==s||(0,o.resolveEnabled)(this.options.enabled,this.#i)!==(0,o.resolveEnabled)(t.enabled,this.#i)||a!==this.#p)&&this.#N(a)}getOptimisticResult(e){var t,s;let i=this.#e.getQueryCache().build(this.#e,e),a=this.createResult(i,e);return t=this,s=a,(0,o.shallowEqualObjects)(t.getCurrentResult(),s)||(this.#r=a,this.#o=this.options,this.#n=this.#i.state),a}getCurrentResult(){return this.#r}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.#x({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#x(e){this.#b();let t=this.#i.fetch(this.options,e);return e?.throwOnError||(t=t.catch(o.noop)),t}#j(){this.#f();let e=(0,o.resolveStaleTime)(this.options.staleTime,this.#i);if(o.isServer||this.#r.isStale||!(0,o.isValidTimeout)(e))return;let t=(0,o.timeUntilStale)(this.#r.dataUpdatedAt,e);this.#d=c.timeoutManager.setTimeout(()=>{this.#r.isStale||this.updateResult()},t+1)}#v(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#i):this.options.refetchInterval)??!1}#N(e){this.#g(),this.#p=e,!o.isServer&&!1!==(0,o.resolveEnabled)(this.options.enabled,this.#i)&&(0,o.isValidTimeout)(this.#p)&&0!==this.#p&&(this.#h=c.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||s.focusManager.isFocused())&&this.#x()},this.#p))}#y(){this.#j(),this.#N(this.#v())}#f(){this.#d&&(c.timeoutManager.clearTimeout(this.#d),this.#d=void 0)}#g(){this.#h&&(c.timeoutManager.clearInterval(this.#h),this.#h=void 0)}createResult(e,t){let s,i=this.#i,r=this.options,c=this.#r,l=this.#n,d=this.#o,m=e!==i?e.state:this.#a,{state:x}=e,y={...x},f=!1;if(t._optimisticResults){let s=this.hasListeners(),n=!s&&u(e,t),o=s&&h(e,i,t,r);(n||o)&&(y={...y,...(0,a.fetchState)(x.data,e.options)}),"isRestoring"===t._optimisticResults&&(y.fetchStatus="idle")}let{error:g,errorUpdatedAt:b,status:j}=y;s=y.data;let v=!1;if(void 0!==t.placeholderData&&void 0===s&&"pending"===j){let e;c?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(e=c.data,v=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,void 0!==e&&(j="success",s=(0,o.replaceData)(c?.data,e,t),f=!0)}if(t.select&&void 0!==s&&!v)if(c&&s===l?.data&&t.select===this.#c)s=this.#l;else try{this.#c=t.select,s=t.select(s),s=(0,o.replaceData)(c?.data,s,t),this.#l=s,this.#t=null}catch(e){this.#t=e}this.#t&&(g=this.#t,s=this.#l,b=Date.now(),j="error");let N="fetching"===y.fetchStatus,w="pending"===j,k="error"===j,S=w&&N,C=void 0!==s,R={status:j,fetchStatus:y.fetchStatus,isPending:w,isSuccess:"success"===j,isError:k,isInitialLoading:S,isLoading:S,data:s,dataUpdatedAt:y.dataUpdatedAt,error:g,errorUpdatedAt:b,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>m.dataUpdateCount||y.errorUpdateCount>m.errorUpdateCount,isFetching:N,isRefetching:N&&!w,isLoadingError:k&&!C,isPaused:"paused"===y.fetchStatus,isPlaceholderData:f,isRefetchError:k&&C,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)},r=()=>{a(this.#s=R.promise=(0,n.pendingThenable)())},o=this.#s;switch(o.status){case"pending":e.queryHash===i.queryHash&&a(o);break;case"fulfilled":(s||R.data!==o.value)&&r();break;case"rejected":s&&R.error===o.reason||r()}}return R}updateResult(){let e=this.#r,t=this.createResult(this.#i,this.options);if(this.#n=this.#i.state,this.#o=this.options,void 0!==this.#n.data&&(this.#u=this.#i),(0,o.shallowEqualObjects)(t,e))return;this.#r=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.#r).some(t=>this.#r[t]!==e[t]&&i.has(t))};this.#w({listeners:s()})}#b(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#i)return;let t=this.#i;this.#i=e,this.#a=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#w(e){i.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#i,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 i="function"==typeof s?s(e):s;return"always"===i||!1!==i&&p(e,t)}return!1}function h(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(247167);var m=e.i(271645),x=e.i(912598);e.i(843476);var y=m.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),f=m.createContext(!1);f.Provider;var g=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function b(e,t){return function(e,t,s){let a,r=m.useContext(f),n=m.useContext(y),c=(0,x.useQueryClient)(s),l=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(l);let u=c.getQueryCache().get(l.queryHash);if(l._optimisticResults=r?"isRestoring":"optimistic",l.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=l.staleTime;l.staleTime="function"==typeof t?(...s)=>e(t(...s)):e(t),"number"==typeof l.gcTime&&(l.gcTime=Math.max(l.gcTime,1e3))}a=u?.state.error&&"function"==typeof l.throwOnError?(0,o.shouldThrowError)(l.throwOnError,[u.state.error,u]):l.throwOnError,(l.suspense||l.experimental_prefetchInRender||a)&&!n.isReset()&&(l.retryOnMount=!1),m.useEffect(()=>{n.clearReset()},[n]);let d=!c.getQueryCache().get(l.queryHash),[h]=m.useState(()=>new t(c,l)),p=h.getOptimisticResult(l),b=!r&&!1!==e.subscribed;if(m.useSyncExternalStore(m.useCallback(e=>{let t=b?h.subscribe(i.notifyManager.batchCalls(e)):o.noop;return h.updateResult(),t},[h,b]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),m.useEffect(()=>{h.setOptions(l)},[l,h]),l?.suspense&&p.isPending)throw g(l,h,n);if((({result:e,errorResetBoundary:t,throwOnError:s,query:i,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(a&&void 0===e.data||(0,o.shouldThrowError)(s,[e.error,i])))({result:p,errorResetBoundary:n,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw p.error;if(c.getDefaultOptions().queries?._experimental_afterQuery?.(l,p),l.experimental_prefetchInRender&&!o.isServer&&p.isLoading&&p.isFetching&&!r){let e=d?g(l,h,n):u?.promise;e?.catch(o.noop).finally(()=>{h.updateResult()})}return l.notifyOnChangeProps?p:h.trackResult(p)}(e,l,t)}e.s(["useQuery",()=>b],266027);var j=e.i(114272),v=r,N=class extends v.Subscribable{#e;#r=void 0;#k;#S;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#C()}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.#k,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,o.hashKey)(t.mutationKey)!==(0,o.hashKey)(this.options.mutationKey)?this.reset():this.#k?.state.status==="pending"&&this.#k.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#k?.removeObserver(this)}onMutationUpdate(e){this.#C(),this.#w(e)}getCurrentResult(){return this.#r}reset(){this.#k?.removeObserver(this),this.#k=void 0,this.#C(),this.#w()}mutate(e,t){return this.#S=t,this.#k?.removeObserver(this),this.#k=this.#e.getMutationCache().build(this.#e,this.options),this.#k.addObserver(this),this.#k.execute(e)}#C(){let e=this.#k?.state??(0,j.getDefaultState)();this.#r={...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.#S&&this.hasListeners()){let t=this.#r.variables,s=this.#r.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#S.onSuccess?.(e.data,t,s,i)}catch(e){Promise.reject(e)}try{this.#S.onSettled?.(e.data,null,t,s,i)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#S.onError?.(e.error,t,s,i)}catch(e){Promise.reject(e)}try{this.#S.onSettled?.(void 0,e.error,t,s,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#r)})})}};function w(e,t){let s=(0,x.useQueryClient)(t),[a]=m.useState(()=>new N(s,e));m.useEffect(()=>{a.setOptions(e)},[a,e]);let r=m.useSyncExternalStore(m.useCallback(e=>a.subscribe(i.notifyManager.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),n=m.useCallback((e,t)=>{a.mutate(e,t).catch(o.noop)},[a]);if(r.error&&(0,o.shouldThrowError)(a.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:n,mutateAsync:r.mutate}}e.s(["useMutation",()=>w],954616)},203999,e=>{"use strict";var t=e.i(266027),s=e.i(954616),i=e.i(912598),a=e.i(209165);function r(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,i=50,r){return(0,t.useQuery)({queryKey:["messages",e,s,i,r],queryFn:async()=>{let t=r?(0,a.api)(`/api/network/proxy/${r}/sessions/${e}/messages?offset=${s}&limit=${i}`):(0,a.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,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 l(){let e=(0,i.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,i.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,i.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,i.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,i.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 x(){let e=(0,i.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 y(){return(0,t.useQuery)({queryKey:["workspaces"],queryFn:async()=>(await fetch((0,a.api)("/api/workspaces"))).json()})}function f(){return(0,t.useQuery)({queryKey:["workspaces","remote"],queryFn:async()=>(await fetch((0,a.api)("/api/workspaces?nodes=all"))).json()})}function g(){let e=(0,i.useQueryClient)();return(0,s.useMutation)({mutationFn:async({workspaceId:e,sessionId:t,nodeId:s,title:i,cwd:r,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:i,cwd:r,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,i.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 j(){let e=(0,i.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 v(){return(0,t.useQuery)({queryKey:["projects"],queryFn:async()=>(await fetch((0,a.api)("/api/projects"))).json()})}function N(){return(0,t.useQuery)({queryKey:["analytics"],queryFn:async()=>(await fetch((0,a.api)("/api/analytics/overview"))).json()})}function w(){let e=(0,i.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",()=>N,"useBulkAction",()=>j,"useDeleteTag",()=>m,"useMessages",()=>o,"useProjects",()=>v,"useRemoteWorkspaces",()=>f,"useRemoveSessionFromWorkspace",()=>b,"useRemoveTag",()=>d,"useRenameSession",()=>h,"useSession",()=>n,"useSessions",()=>r,"useSync",()=>w,"useTags",()=>p,"useToggleStar",()=>c,"useUpdateNotes",()=>l,"useUpdateTagColor",()=>x,"useWorkspaces",()=>y])},107233,e=>{"use strict";let t=(0,e.i(475254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],107233)},16715,e=>{"use strict";let t=(0,e.i(475254).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(475254).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)},595468,911588,e=>{"use strict";var t=e.i(475254);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],595468);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],911588)},349889,e=>{"use strict";var t=e.i(843476),s=e.i(271645),i=e.i(209165);function a(){let[e,a]=(0,s.useState)(null),[r,n]=(0,s.useState)(null),[o,c]=(0,s.useState)(null),[l,u]=(0,s.useState)(!1),[d,h]=(0,s.useState)({});(0,s.useEffect)(()=>{fetch((0,i.api)("/api/cortex/settings")).then(e=>e.json()).then(a).catch(()=>{}),fetch((0,i.api)("/api/cortex/usage")).then(e=>e.json()).then(c).catch(()=>{})},[]);let p=async e=>{u(!0);try{if((await fetch((0,i.api)("/api/cortex/settings"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok){let t={...e};for(let e of["anthropic_api_key","openai_api_key","voyage_api_key","groq_api_key"])t[e]&&(t[e]=`…${t[e].slice(-4)}`);a(e=>({...e,...t}))}}catch{}finally{u(!1)}},m=async(e=!1)=>{if(e&&!confirm("This will delete all existing knowledge and re-ingest from session files. Continue?"))return;await fetch((0,i.api)("/api/cortex/ingest/bootstrap"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clean:e})});let t=setInterval(async()=>{let e=await fetch((0,i.api)("/api/cortex/ingest/status")),s=await e.json();n(s),("complete"===s.status||"error"===s.status)&&(clearInterval(t),fetch((0,i.api)("/api/cortex/usage")).then(e=>e.json()).then(c).catch(()=>{}))},2e3)},x=e?.enabled??!1,y=x?"":"opacity-40 pointer-events-none";return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("h3",{className:"text-sm font-medium text-gray-200",children:["Cortex",(0,t.jsx)("span",{className:"ml-2 text-[9px] font-medium uppercase tracking-wider text-purple-400 bg-purple-400/10 px-1.5 py-0.5 rounded",children:"Beta"})]}),(0,t.jsxs)("label",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"Enable Cortex"}),(0,t.jsx)("input",{type:"checkbox",checked:x,disabled:!e,onChange:e=>p({enabled:e.target.checked}),className:"accent-purple-500"})]}),!e&&(0,t.jsx)("p",{className:"text-[10px] text-gray-500",children:"Loading…"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("span",{className:"text-xs text-gray-300 font-medium",children:"API Keys"}),(0,t.jsx)("p",{className:"text-[10px] text-gray-600 -mt-2",children:"Keys configured here override environment variables. Stored in ~/.spaces/config.json."}),[{key:"anthropic_api_key",label:"Anthropic",placeholder:"sk-ant-…",hint:"LLM distillation (Claude Haiku)"},{key:"voyage_api_key",label:"Voyage AI",placeholder:"pa-…",hint:"Embeddings — best for code/technical retrieval"},{key:"openai_api_key",label:"OpenAI",placeholder:"sk-proj-…",hint:"Embeddings fallback + transcription fallback"},{key:"groq_api_key",label:"Groq",placeholder:"gsk_…",hint:"Speech transcription (Quest voice input)"}].map(({key:s,label:i,placeholder:a,hint:r})=>(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:i}),e?.[s]?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-xs text-gray-500 font-mono",children:e[s]}),(0,t.jsx)("button",{onClick:()=>p({[s]:""}),className:"text-[10px] text-gray-600 hover:text-red-400",children:"remove"})]}):(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsx)("input",{type:"password",value:d[s]||"",onChange:e=>h(t=>({...t,[s]:e.target.value})),placeholder:a,className:"flex-1 text-xs bg-white/5 border border-white/10 rounded px-2 py-1 text-gray-300 placeholder-gray-600"}),(0,t.jsx)("button",{onClick:()=>{d[s]&&(p({[s]:d[s]}),h(e=>({...e,[s]:""})))},disabled:!d[s],className:"text-xs px-2 py-1 bg-purple-600 hover:bg-purple-500 text-white rounded disabled:opacity-30",children:"Save"})]}),(0,t.jsx)("p",{className:"text-[10px] text-gray-600",children:r})]},s))]}),(0,t.jsxs)("label",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"Debug logging"}),(0,t.jsx)("p",{className:"text-[10px] text-gray-600",children:"Verbose memory, LanceDB, embedding, and distillation logs in server console"})]}),(0,t.jsx)("input",{type:"checkbox",checked:e?.debug??!1,onChange:e=>p({debug:e.target.checked}),className:"accent-purple-500 shrink-0 ml-3"})]}),(0,t.jsxs)("div",{className:`block ${y}`,children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"Embedding provider"}),(0,t.jsx)("p",{className:"text-[10px] text-gray-500",children:"Voyage AI — voyage-3-lite (512-dim)"})]}),(0,t.jsxs)("div",{className:`block ${y}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"Context injection budget"}),(0,t.jsxs)("span",{className:"text-[10px] text-gray-500",children:[e?.injection?.max_tokens||2e3," tokens"]})]}),(0,t.jsx)("input",{type:"range",min:500,max:2e4,step:500,value:e?.injection?.max_tokens||2e3,onChange:e=>p({injection:{max_tokens:parseInt(e.target.value)}}),className:"w-full"}),(0,t.jsx)("p",{className:"text-[10px] text-gray-600 mt-0.5",children:"Tokens of retrieved knowledge injected per prompt (Claude context: 200K)"})]}),(0,t.jsxs)("label",{className:`flex items-center justify-between ${y}`,children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"LLM distillation"}),(0,t.jsx)("p",{className:"text-[10px] text-gray-600",children:"4 Haiku API calls per session end — cleaner knowledge at ~$0.03–0.05/session"})]}),(0,t.jsx)("input",{type:"checkbox",checked:e?.ingestion?.distillation??!0,onChange:e=>p({ingestion:{distillation:e.target.checked}}),className:"accent-purple-500 shrink-0 ml-3"})]}),(0,t.jsxs)("div",{className:`block ${y}`,children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"Federation sync mode"}),(0,t.jsx)("p",{className:"text-[10px] text-gray-600 mb-1",children:"How knowledge is shared across multiple Spaces instances"}),(0,t.jsxs)("select",{value:e?.federation?.sync_mode||"query-only",onChange:e=>p({federation:{sync_mode:e.target.value}}),className:"w-full text-xs bg-white/5 border border-white/10 rounded px-2 py-1 text-gray-300",children:[(0,t.jsx)("option",{value:"query-only",children:"Query Only — read from remotes, no push"}),(0,t.jsx)("option",{value:"background-sync",children:"Background Sync — periodic two-way sync"}),(0,t.jsx)("option",{value:"real-time-sync",children:"Real-time Sync — sync on every store"})]})]}),o&&o.distillation?.calls>0&&(0,t.jsxs)("div",{className:"pt-2 border-t border-white/5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"Distillation usage"}),(0,t.jsx)("button",{onClick:()=>fetch((0,i.api)("/api/cortex/usage"),{method:"DELETE"}).then(()=>c(null)),className:"text-[10px] text-gray-600 hover:text-gray-400",children:"reset"})]}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-500 space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:"API calls"}),(0,t.jsx)("span",{className:"text-gray-400",children:o.distillation.calls.toLocaleString()})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:"Tokens in / out"}),(0,t.jsxs)("span",{className:"text-gray-400",children:[(o.distillation.input_tokens/1e3).toFixed(1),"K / ",(o.distillation.output_tokens/1e3).toFixed(1),"K"]})]}),(0,t.jsxs)("div",{className:"flex justify-between font-medium",children:[(0,t.jsx)("span",{children:"Estimated cost"}),(0,t.jsxs)("span",{className:"text-purple-400",children:["$",o.distillation.estimated_cost_usd.toFixed(4)]})]})]})]}),(0,t.jsxs)("div",{className:`pt-2 border-t border-white/5 ${y}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{onClick:()=>m(!1),disabled:r?.status==="running",className:"text-xs px-3 py-1.5 bg-purple-600 hover:bg-purple-500 text-white rounded disabled:opacity-50",children:r?.status==="running"?"Ingesting...":"Incremental Ingest"}),(0,t.jsx)("button",{onClick:()=>m(!0),disabled:r?.status==="running",className:"text-xs px-3 py-1.5 bg-zinc-700 hover:bg-zinc-600 text-white rounded disabled:opacity-50",children:"Clean Re-ingest"})]}),(0,t.jsx)("p",{className:"text-[10px] text-gray-600 mt-1",children:"Incremental adds new sessions. Clean wipes all knowledge and re-processes everything."}),(r?.status==="running"||r?.status==="complete"||r?.status==="error")&&(0,t.jsxs)("div",{className:"mt-3 space-y-1.5",children:[(0,t.jsx)("div",{className:"w-full h-1.5 bg-white/5 rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all ${"error"===r.status?"bg-red-500":"complete"===r.status?"bg-green-500":"bg-purple-500"}`,style:{width:`${r.processedFiles/Math.max(r.totalFiles,1)*100}%`}})}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-500",children:[r.phase&&(0,t.jsxs)("span",{className:"text-gray-400",children:[r.phase," · "]}),r.processedFiles,"/",r.totalFiles," files",r.skippedFiles>0&&(0,t.jsxs)("span",{children:[" · ",r.skippedFiles," skipped"]}),r.totalChunks>0&&(0,t.jsxs)("span",{children:[" · ",r.totalChunks," chunks stored"]}),r.chunksSkipped>0&&(0,t.jsxs)("span",{children:[" · ",r.chunksSkipped," deduped"]})]}),r.errors?.length>0&&(0,t.jsxs)("div",{className:"text-[10px] text-red-400 max-h-20 overflow-y-auto space-y-0.5",children:[r.errors.slice(0,5).map((e,s)=>(0,t.jsx)("div",{className:"truncate",children:e},s)),r.errors.length>5&&(0,t.jsxs)("div",{className:"text-gray-500",children:["+",r.errors.length-5," more errors"]})]}),"complete"===r.status&&(0,t.jsxs)("div",{className:"text-[10px] text-green-400",children:["Complete — ",r.totalChunks," knowledge units from ",r.processedFiles-r.skippedFiles," sessions"]})]})]})]})}e.s(["CortexSettings",()=>a])},438090,e=>{"use strict";var t=e.i(843476),s=e.i(271645),i=e.i(203999),a=e.i(239616),r=e.i(16715),n=e.i(75505),o=e.i(531278),c=e.i(98919),l=e.i(595468),u=e.i(217923),d=e.i(107233),h=e.i(37727),p=e.i(911588);let m=(0,e.i(475254).default)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]);var x=e.i(209165),y=e.i(209593),f=e.i(28916),g=e.i(349889);function b(){let{hasAuth:e,tier:b,version:j,hasCortex:v,cortexTierEnabled:N}=(0,f.useTier)(),w="u">typeof document&&document.cookie.includes("spaces-session="),k=(0,i.useSync)(),[S,C]=(0,s.useState)(""),[R,T]=(0,s.useState)(!1),[Q,O]=(0,s.useState)(!0),[E,q]=(0,s.useState)(!1),[z,M]=(0,s.useState)(""),[F,I]=(0,s.useState)(""),[K,P]=(0,s.useState)(""),[D,_]=(0,s.useState)(""),[A,U]=(0,s.useState)(!1),L=(0,s.useRef)(null),[$,J]=(0,s.useState)(null),[W,B]=(0,s.useState)([]),[H,V]=(0,s.useState)(""),[G,Y]=(0,s.useState)(!1),[Z,X]=(0,s.useState)(!0),[ee,et]=(0,s.useState)(!1);(0,s.useEffect)(()=>{e?w?fetch((0,x.api)("/api/auth/me")).then(e=>e.json()).then(e=>{J(e),O(!1)}).catch(()=>O(!1)):fetch((0,x.api)("/api/auth/totp/status")).then(e=>e.json()).then(e=>{T(e.enabled),O(!1)}).catch(()=>O(!1)):O(!1)},[e,w]),(0,s.useEffect)(()=>{fetch((0,x.api)("/api/config")).then(e=>e.json()).then(e=>{Y(e.telemetryOptOut),B(e.devDirectories||[]),et(!!e.todosEnabled),X(!1)}).catch(()=>X(!1))},[]);let es=async()=>{let e=!ee;et(e),await fetch((0,x.api)("/api/config"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({todosEnabled:e})})},ei=async e=>{B(e),await fetch((0,x.api)("/api/config"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({devDirectories:e})})},ea=()=>{let e=H.trim();!e||W.includes(e)||(e.startsWith("/")||/^[A-Za-z]:[\\/]/.test(e))&&(ei([...W,e]),V(""))},er=async()=>{let e=await k.mutateAsync();C(`Synced ${e.projects} projects, ${e.sessions} sessions, enriched ${e.enriched}`),(0,y.track)("sync_completed",{projects:e.projects,sessions:e.sessions,enriched:e.enriched})},en=async()=>{let e=!G;Y(e),(0,y.setOptOut)(e),(0,y.track)("telemetry_toggled",{enabled:!e}),await fetch((0,x.api)("/api/config"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({telemetryOptOut:e})})},eo=async()=>{q(!0),_(""),P("");let e=await fetch((0,x.api)("/api/auth/totp/setup"),{method:"POST"}),t=await e.json();M(t.qrDataUrl),I(t.secret),setTimeout(()=>L.current?.focus(),100)},ec=async e=>{if(6!==e.length)return;U(!0),_("");let t=await fetch((0,x.api)("/api/auth/totp/verify"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,action:"enable"})}),s=await t.json();U(!1),s.success?(T(!0),q(!1),M(""),I(""),P("")):(_(s.error||"Invalid code"),P(""),L.current?.focus())},el=async()=>{confirm("Disable 2FA? You will need to set it up again to use terminals.")&&(await fetch((0,x.api)("/api/auth/totp/setup"),{method:"POST"}),T(!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:[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..."]}):w?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.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."})]}):R&&!E?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.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:el,className:"text-xs text-zinc-500 hover:text-red-400 transition-colors",children:"Disable 2FA"})]}):E?(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.)"}),z?(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:z,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:F})]})]}):(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:L,type:"text",inputMode:"numeric",autoComplete:"one-time-code",placeholder:"000000",value:K,onChange:e=>{let t;P(t=e.target.value.replace(/\D/g,"").slice(0,6)),_(""),6===t.length&&ec(t)},disabled:A,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"}),A&&(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..."]}),D&&(0,t.jsx)("p",{className:"text-xs text-red-400 mt-2",children:D})]}),(0,t.jsx)("button",{onClick:()=>{q(!1),M(""),I("")},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:eo,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."}),W.length>0&&(0,t.jsx)("div",{className:"space-y-1.5 mb-3",children:W.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:()=>{ei(W.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)(h.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:H,onChange:e=>V(e.target.value),onKeyDown:e=>"Enter"===e.key&&ea(),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:ea,disabled:!H.trim()||!(H.trim().startsWith("/")||/^[A-Za-z]:[\\/]/.test(H.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)(d.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)(r.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:er,disabled:k.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:[k.isPending?(0,t.jsx)(o.Loader2,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(r.RefreshCw,{className:"w-4 h-4"}),"Re-sync Now"]}),S&&(0,t.jsx)("p",{className:"text-xs text-green-600 mt-2",children:S})]}),(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)(m,{className:"w-4 h-4"}),"Experimental"]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-3",children:"Opt-in to features that are still being shaped."}),(0,t.jsxs)("label",{className:"flex items-start gap-3 cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:ee,onChange:es,className:"mt-0.5 w-4 h-4 rounded border-zinc-300 dark:border-zinc-700 text-indigo-500 focus:ring-indigo-500"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm",children:"Workspace todos"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:"Show a horizontal row of todo chips above the pane grid in each workspace."})]})]})]}),(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)(u.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."}),Z?(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:!G,onChange:en,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"})]})]}),N&&(0,t.jsx)("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-lg p-5",children:(0,t.jsx)(g.CortexSettings,{})}),(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.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:"})," ",j||"..."]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Tier:"})," ",(0,t.jsx)("span",{className:"capitalize",children:b})]}),(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],438090)}]);
|