@jlongo78/agent-spaces 0.9.6 → 0.9.8
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 +68 -0
- package/.next/standalone/.claude/spaces-env.json +1 -0
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +1 -0
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +19 -19
- package/.next/standalone/.next/routes-manifest.json +6 -0
- 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 +2 -2
- package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin/analytics/__PAGE__.segment.rsc +1 -1
- 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 +2 -2
- 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/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/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 +2 -2
- package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap/settings/__PAGE__.segment.rsc +1 -1
- 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 +2 -2
- 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 +1 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__00e90fc6._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__01ab8675._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__03974f05._.js +98 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__bb331da9._.js → [root-of-the-server]__046c9b91._.js} +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04ae6bf0._.js +98 -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 +98 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__d95165f0._.js → [root-of-the-server]__0facd39e._.js} +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__10bc76a3._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__9d68157b._.js → [root-of-the-server]__115f3934._.js} +3 -3
- 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 +22 -33
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__91e23c96._.js → [root-of-the-server]__17a3b966._.js} +3 -3
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__277d9445._.js → [root-of-the-server]__17d3a2b2._.js} +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1a86c055._.js +98 -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 +98 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__04f04898._.js → [root-of-the-server]__2a3f866b._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__a95bb38b._.js → [root-of-the-server]__316617e7._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__32ad8f71._.js +98 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__6fe5e6c8._.js → [root-of-the-server]__35457394._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1f054c65._.js → [root-of-the-server]__35de78e6._.js} +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__3685ffcb._.js +98 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__614458b7._.js → [root-of-the-server]__38954988._.js} +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__426ad936._.js +106 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__4985c034._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5c6ce9ed._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5cebe58a._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5d5e4789._.js +98 -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 +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__6c64af29._.js +131 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__73aed9f5._.js +98 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__ac84b704._.js → [root-of-the-server]__79b6a9bb._.js} +3 -3
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__e56abacf._.js → [root-of-the-server]__7db704c6._.js} +4 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__812ca02b._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__821f50fa._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8716b86e._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__884ef754._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__88cdbd68._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__89d9aba9._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8d536cb5._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8df8c5d1._.js +98 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__2d7a454e._.js → [root-of-the-server]__8f2ccc41._.js} +3 -3
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__2a2c5fc5._.js → [root-of-the-server]__95c9d682._.js} +4 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__9e5d7774._.js +98 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__cc6e2885._.js → [root-of-the-server]__9edcff87._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a049dfc2._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a5b4bb9a._.js +98 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__929ea03a._.js → [root-of-the-server]__a83262a1._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a9cd1240._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a9d7f822._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ad08c221._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ad585f2f._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__afcb8f7d._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__bc250d43._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__bce2a6e7._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c011bf91._.js +98 -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]__c130a00c._.js +1 -1
- 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 +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__cc2616bb._.js +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d501fa9b._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d59c6c15._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d5c1db32._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d5d92527._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__dba60c86._.js +98 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__2384f98e._.js → [root-of-the-server]__de14b9ae._.js} +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e10643d1._.js +98 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__00fdfbda._.js → [root-of-the-server]__e2a996e5._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__4d903941._.js → [root-of-the-server]__e3477417._.js} +3 -3
- 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]__49e42a3a._.js → [root-of-the-server]__e4e70b86._.js} +3 -3
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__ac39ecc7._.js → [root-of-the-server]__e54925af._.js} +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e8edc5b0._.js +98 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__eafd040b._.js → [root-of-the-server]__eab4d83b._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ead29015._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__194955d4._.js → [root-of-the-server]__f056fd83._.js} +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__f0e99572._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__fe1e16d0._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ff9cd277._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ffaea2ce._.js +98 -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/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/_17b946fd._.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/_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)_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/0852575eb90c1e8d.js +85 -0
- package/.next/standalone/.next/static/chunks/{74d0ac0b1d0a1b79.js → 10b00b4f66102dcf.js} +1 -1
- package/.next/standalone/.next/static/chunks/{16eb77953dee9ea3.js → 19c71a8376c23c58.js} +1 -1
- package/.next/standalone/.next/static/chunks/2b769d1597e4fc1c.css +3 -0
- package/.next/standalone/.next/static/chunks/{3e91fc608659c524.js → 350271fe79509caf.js} +1 -1
- package/.next/standalone/.next/static/chunks/{70423c7afd8abf5f.js → 597847c22200c212.js} +1 -1
- package/.next/standalone/.next/static/chunks/{fb0abd1933b2b2e1.js → 7f6a14f1849fa94d.js} +1 -1
- 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/{180c1b9ff31b979f.js → f7b34c807badf95d.js} +8 -6
- package/.next/standalone/.spaces/cortex-context.md +50 -144
- package/.next/standalone/LICENSE +661 -661
- package/.next/standalone/NOTICE +5 -5
- package/.next/standalone/README.md +131 -131
- package/.next/standalone/bin/cortex-hook.js +79 -79
- package/.next/standalone/bin/cortex-hook.sh +62 -62
- package/.next/standalone/bin/cortex-learn-hook.js +138 -138
- package/.next/standalone/bin/cortex-mcp.js +60 -60
- package/.next/standalone/bin/cortex-pi-extension.ts +170 -170
- package/.next/standalone/bin/fix-standalone-externals.js +79 -79
- package/.next/standalone/bin/lib/auto-setup.js +110 -110
- package/.next/standalone/bin/mdns-service.js +171 -171
- package/.next/standalone/bin/postinstall.js +35 -35
- package/.next/standalone/bin/setup-admin.js +195 -195
- package/.next/standalone/bin/spaces-dev.js +247 -247
- package/.next/standalone/bin/spaces-install.js +660 -660
- package/.next/standalone/bin/spaces-postinstall.js +50 -50
- package/.next/standalone/bin/spaces-reset-totp.js +50 -50
- package/.next/standalone/bin/spaces-service.js +1046 -1046
- package/.next/standalone/bin/spaces-setup.js +253 -253
- package/.next/standalone/bin/spaces.js +808 -805
- package/.next/standalone/bin/ssh-auth-keys.sh +68 -68
- package/.next/standalone/bin/terminal-server.js +2819 -2781
- package/.next/standalone/cortex-hook-debug.log +57 -23
- package/.next/standalone/docker-compose.yml +28 -28
- package/.next/standalone/docs/architecture.md +387 -387
- package/.next/standalone/docs/cortex-integration-reference.md +268 -268
- package/.next/standalone/docs/cortex.md +293 -293
- package/.next/standalone/docs/getting-started.md +96 -96
- package/.next/standalone/docs/plans/2026-02-24-multi-agent-sessions-design.md +133 -133
- package/.next/standalone/docs/plans/2026-02-24-multi-agent-sessions-plan.md +959 -959
- package/.next/standalone/docs/plans/2026-03-02-security-audit.md +229 -229
- package/.next/standalone/docs/plans/2026-03-07-service-command-design.md +146 -146
- package/.next/standalone/docs/plans/2026-03-07-service-command-plan.md +254 -254
- package/.next/standalone/docs/server-install.md +564 -564
- package/.next/standalone/docs/social-card.html +150 -150
- package/.next/standalone/docs/superpowers/plans/2026-03-12-spaces-cortex.md +5270 -5270
- package/.next/standalone/docs/superpowers/plans/2026-03-13-cortex-wiring.md +1387 -1387
- package/.next/standalone/docs/superpowers/plans/2026-03-14-cortex-v2-entity-graph.md +1923 -1923
- package/.next/standalone/docs/superpowers/plans/2026-03-14-cortex-v2-knowledge-evolution.md +1113 -1113
- package/.next/standalone/docs/superpowers/plans/2026-03-15-cortex-v2-boundary-engine.md +853 -853
- package/.next/standalone/docs/superpowers/plans/2026-03-15-cortex-v2-context-engine.md +1274 -1274
- package/.next/standalone/docs/superpowers/plans/2026-03-15-cortex-v2-signal-ingestion.md +933 -933
- package/.next/standalone/docs/superpowers/plans/2026-03-16-cortex-lobes.md +1080 -1080
- package/.next/standalone/docs/superpowers/plans/2026-03-16-cortex-v2-gravity-system.md +768 -768
- package/.next/standalone/docs/superpowers/plans/2026-03-16-cortex-v2-ui.md +1108 -1108
- package/.next/standalone/docs/superpowers/plans/2026-03-18-cortex-ui-integration.md +1846 -1846
- package/.next/standalone/docs/superpowers/plans/2026-03-19-vr-phase1-shell.md +1639 -1639
- package/.next/standalone/docs/superpowers/plans/2026-03-27-dockview-pane-layout.md +98 -98
- package/.next/standalone/docs/superpowers/specs/2026-03-11-universe-view-design.md +320 -320
- package/.next/standalone/docs/superpowers/specs/2026-03-12-spaces-brain-design.md +720 -720
- package/.next/standalone/docs/superpowers/specs/2026-03-13-cortex-wiring-design.md +268 -268
- package/.next/standalone/docs/superpowers/specs/2026-03-14-cortex-v2-design.md +623 -623
- package/.next/standalone/docs/superpowers/specs/2026-03-16-cortex-lobes-design.md +263 -263
- package/.next/standalone/docs/superpowers/specs/2026-03-16-cortex-v2-ui-design.md +240 -240
- package/.next/standalone/docs/superpowers/specs/2026-03-16-pane-ux-design.md +77 -77
- package/.next/standalone/docs/superpowers/specs/2026-03-18-cortex-ui-integration-design.md +341 -341
- package/.next/standalone/docs/superpowers/specs/2026-03-19-vr-phase1-shell-design.md +288 -288
- package/.next/standalone/docs/superpowers/specs/2026-03-27-pane-diff-review-and-project-wizard-design.md +322 -322
- package/.next/standalone/docs/tiers.md +104 -104
- package/.next/standalone/eslint.config.mjs +18 -18
- package/.next/standalone/next.config.ts +20 -20
- package/.next/standalone/nginx.conf +53 -53
- package/.next/standalone/node_modules/@img/sharp-win32-x64/lib/sharp-win32-x64.node +0 -0
- package/.next/standalone/node_modules/@img/{sharp-linux-x64 → sharp-win32-x64}/package.json +39 -46
- package/.next/standalone/package-lock.json +14985 -14986
- package/.next/standalone/package.json +111 -111
- package/.next/standalone/postcss.config.mjs +7 -7
- package/.next/standalone/scripts/rebuild.cmd +65 -65
- package/.next/standalone/scripts/rebuild.sh +59 -59
- package/.next/standalone/server.js +1 -1
- package/.next/standalone/src/app/(desktop)/admin/analytics/page.tsx +266 -266
- package/.next/standalone/src/app/(desktop)/admin/users/page.tsx +399 -399
- package/.next/standalone/src/app/(desktop)/analytics/page.tsx +166 -166
- package/.next/standalone/src/app/(desktop)/cortex/page.tsx +81 -81
- package/.next/standalone/src/app/(desktop)/dashboard-client.tsx +56 -56
- package/.next/standalone/src/app/(desktop)/layout.tsx +18 -18
- package/.next/standalone/src/app/(desktop)/network/page.tsx +137 -137
- package/.next/standalone/src/app/(desktop)/page.tsx +17 -17
- package/.next/standalone/src/app/(desktop)/projects/page.tsx +68 -68
- package/.next/standalone/src/app/(desktop)/sessions/[id]/page.tsx +519 -519
- package/.next/standalone/src/app/(desktop)/sessions/page.tsx +145 -145
- package/.next/standalone/src/app/(desktop)/settings/page.tsx +446 -446
- package/.next/standalone/src/app/(desktop)/terminal/layout.tsx +7 -7
- package/.next/standalone/src/app/(desktop)/terminal/page.tsx +1330 -1291
- package/.next/standalone/src/app/(desktop)/terminal/pane/[id]/page.tsx +211 -211
- package/.next/standalone/src/app/(desktop)/terminal/remote/[nodeId]/[workspaceId]/page.tsx +252 -252
- package/.next/standalone/src/app/(desktop)/workspaces/page.tsx +12 -12
- package/.next/standalone/src/app/api/admin/analytics/route.ts +10 -10
- package/.next/standalone/src/app/api/admin/users/[id]/route.ts +20 -20
- package/.next/standalone/src/app/api/admin/users/route.ts +15 -15
- package/.next/standalone/src/app/api/analytics/overview/route.ts +80 -80
- package/.next/standalone/src/app/api/auth/login/route.ts +10 -10
- package/.next/standalone/src/app/api/auth/logout/route.ts +9 -9
- package/.next/standalone/src/app/api/auth/me/route.ts +22 -22
- package/.next/standalone/src/app/api/auth/totp/setup/route.ts +10 -10
- package/.next/standalone/src/app/api/auth/totp/status/route.ts +10 -10
- package/.next/standalone/src/app/api/auth/totp/verify/route.ts +10 -10
- package/.next/standalone/src/app/api/benchmark/lobes/route.ts +16 -16
- package/.next/standalone/src/app/api/benchmark/run/route.ts +113 -92
- package/.next/standalone/src/app/api/benchmark/runs/[id]/route.ts +26 -26
- package/.next/standalone/src/app/api/benchmark/runs/route.ts +16 -16
- package/.next/standalone/src/app/api/benchmark/status/route.ts +35 -35
- package/.next/standalone/src/app/api/bulk/route.ts +34 -34
- package/.next/standalone/src/app/api/chat/route.ts +85 -85
- package/.next/standalone/src/app/api/config/route.ts +30 -30
- package/.next/standalone/src/app/api/cortex/context/route.ts +78 -78
- package/.next/standalone/src/app/api/cortex/curation/assess/route.ts +27 -27
- package/.next/standalone/src/app/api/cortex/curation/publish/route.ts +23 -23
- package/.next/standalone/src/app/api/cortex/curation/refine/route.ts +23 -23
- package/.next/standalone/src/app/api/cortex/curation/review/route.ts +29 -29
- package/.next/standalone/src/app/api/cortex/curation/seed/route.ts +23 -23
- package/.next/standalone/src/app/api/cortex/export/route.ts +40 -40
- package/.next/standalone/src/app/api/cortex/federation/pending/route.ts +20 -20
- package/.next/standalone/src/app/api/cortex/federation/resolve/route.ts +43 -43
- package/.next/standalone/src/app/api/cortex/federation/search/route.ts +35 -35
- package/.next/standalone/src/app/api/cortex/federation/teach/route.ts +76 -76
- package/.next/standalone/src/app/api/cortex/graph/edges/route.ts +112 -112
- package/.next/standalone/src/app/api/cortex/graph/entities/[id]/route.ts +73 -73
- package/.next/standalone/src/app/api/cortex/graph/entities/route.ts +75 -75
- package/.next/standalone/src/app/api/cortex/graph/populate/route.ts +203 -203
- package/.next/standalone/src/app/api/cortex/import/route.ts +75 -75
- package/.next/standalone/src/app/api/cortex/import/status/route.ts +15 -15
- package/.next/standalone/src/app/api/cortex/ingest/bootstrap/route.ts +39 -39
- package/.next/standalone/src/app/api/cortex/ingest/status/route.ts +15 -15
- package/.next/standalone/src/app/api/cortex/knowledge/[id]/route.ts +91 -91
- package/.next/standalone/src/app/api/cortex/knowledge/route.ts +97 -97
- package/.next/standalone/src/app/api/cortex/lobes/[id]/route.ts +67 -67
- package/.next/standalone/src/app/api/cortex/lobes/route.ts +22 -22
- package/.next/standalone/src/app/api/cortex/lobes/share/route.ts +80 -80
- package/.next/standalone/src/app/api/cortex/marketplace/browse/route.ts +43 -43
- package/.next/standalone/src/app/api/cortex/marketplace/preview/route.ts +46 -46
- package/.next/standalone/src/app/api/cortex/mcp/call/route.ts +11 -11
- package/.next/standalone/src/app/api/cortex/mcp/tools/route.ts +8 -8
- package/.next/standalone/src/app/api/cortex/search/route.ts +57 -45
- package/.next/standalone/src/app/api/cortex/settings/route.ts +35 -35
- package/.next/standalone/src/app/api/cortex/status/route.ts +169 -169
- package/.next/standalone/src/app/api/cortex/timeline/route.ts +42 -42
- package/.next/standalone/src/app/api/cortex/usage/route.ts +31 -31
- package/.next/standalone/src/app/api/cortex/workspace/[id]/context/route.ts +41 -41
- package/.next/standalone/src/app/api/events/route.ts +40 -40
- package/.next/standalone/src/app/api/files/route.ts +187 -187
- package/.next/standalone/src/app/api/folders/route.ts +107 -97
- package/.next/standalone/src/app/api/network/connect-callback/route.ts +11 -11
- package/.next/standalone/src/app/api/network/connect-request/[id]/route.ts +11 -11
- package/.next/standalone/src/app/api/network/connect-request/route.ts +17 -17
- package/.next/standalone/src/app/api/network/discovered/route.ts +9 -9
- package/.next/standalone/src/app/api/network/handshake/route.ts +25 -25
- package/.next/standalone/src/app/api/network/health/route.ts +10 -10
- package/.next/standalone/src/app/api/network/identity/route.ts +15 -15
- package/.next/standalone/src/app/api/network/keys/[id]/route.ts +10 -10
- package/.next/standalone/src/app/api/network/keys/route.ts +15 -15
- package/.next/standalone/src/app/api/network/nodes/[id]/route.ts +15 -15
- package/.next/standalone/src/app/api/network/nodes/check/route.ts +9 -9
- package/.next/standalone/src/app/api/network/nodes/route.ts +15 -15
- package/.next/standalone/src/app/api/network/panes/[id]/route.ts +78 -62
- package/.next/standalone/src/app/api/network/panes/route.ts +61 -50
- package/.next/standalone/src/app/api/network/projects/route.ts +32 -25
- package/.next/standalone/src/app/api/network/proxy/[nodeId]/[...path]/route.ts +25 -25
- package/.next/standalone/src/app/api/network/search/route.ts +45 -38
- package/.next/standalone/src/app/api/network/sessions/[id]/messages/route.ts +43 -36
- package/.next/standalone/src/app/api/network/sessions/[id]/route.ts +41 -34
- package/.next/standalone/src/app/api/network/sessions/route.ts +50 -43
- package/.next/standalone/src/app/api/network/terminal/token/route.ts +10 -10
- package/.next/standalone/src/app/api/network/workspaces/[id]/route.ts +80 -71
- package/.next/standalone/src/app/api/network/workspaces/route.ts +87 -85
- package/.next/standalone/src/app/api/panes/[id]/diff/route.ts +121 -121
- package/.next/standalone/src/app/api/panes/[id]/route.ts +60 -60
- package/.next/standalone/src/app/api/panes/route.ts +39 -39
- package/.next/standalone/src/app/api/projects/route.ts +13 -13
- package/.next/standalone/src/app/api/proxy/models/[modelId]/[...path]/route.ts +80 -80
- package/.next/standalone/src/app/api/proxy/models/[modelId]/status/route.ts +33 -33
- package/.next/standalone/src/app/api/search/route.ts +47 -47
- package/.next/standalone/src/app/api/sessions/[id]/chat/route.ts +120 -120
- package/.next/standalone/src/app/api/sessions/[id]/messages/route.ts +34 -34
- package/.next/standalone/src/app/api/sessions/[id]/route.ts +73 -73
- package/.next/standalone/src/app/api/sessions/route.ts +64 -64
- package/.next/standalone/src/app/api/sync/route.ts +24 -24
- package/.next/standalone/src/app/api/tags/route.ts +35 -35
- package/.next/standalone/src/app/api/tier/route.ts +16 -16
- package/.next/standalone/src/app/api/updates/route.ts +65 -65
- package/.next/standalone/src/app/api/whisper/config/route.ts +50 -42
- package/.next/standalone/src/app/api/whisper/route.ts +91 -91
- package/.next/standalone/src/app/api/wizard/chart/route.ts +129 -0
- package/.next/standalone/src/app/api/wizard/chat/route.ts +113 -113
- package/.next/standalone/src/app/api/workspaces/[id]/context/[key]/route.ts +39 -39
- package/.next/standalone/src/app/api/workspaces/[id]/context/route.ts +28 -28
- package/.next/standalone/src/app/api/workspaces/[id]/messages/[msgId]/route.ts +17 -17
- package/.next/standalone/src/app/api/workspaces/[id]/messages/route.ts +39 -39
- package/.next/standalone/src/app/api/workspaces/[id]/route.ts +47 -47
- package/.next/standalone/src/app/api/workspaces/[id]/sessions/route.ts +62 -62
- package/.next/standalone/src/app/api/workspaces/route.ts +79 -79
- package/.next/standalone/src/app/globals.css +88 -88
- package/.next/standalone/src/app/layout.tsx +33 -33
- package/.next/standalone/src/app/login/layout.tsx +7 -7
- package/.next/standalone/src/app/login/page.tsx +315 -315
- package/.next/standalone/src/app/m/layout.tsx +16 -16
- package/.next/standalone/src/app/m/page.tsx +118 -118
- package/.next/standalone/src/app/m/projects/page.tsx +64 -64
- package/.next/standalone/src/app/m/sessions/[id]/page.tsx +168 -168
- package/.next/standalone/src/app/m/sessions/page.tsx +177 -177
- package/.next/standalone/src/app/m/settings/page.tsx +230 -230
- package/.next/standalone/src/app/m/terminal/page.tsx +413 -413
- package/.next/standalone/src/app/vr/page.tsx +21 -21
- package/.next/standalone/src/app/vr/vr-app.tsx +163 -163
- package/.next/standalone/src/app/vr/vr-controls.tsx +139 -139
- package/.next/standalone/src/app/vr/vr-door.tsx +82 -82
- package/.next/standalone/src/app/vr/vr-environment.tsx +71 -71
- package/.next/standalone/src/app/vr/vr-gaze.tsx +89 -89
- package/.next/standalone/src/app/vr/vr-layout.ts +49 -49
- package/.next/standalone/src/app/vr/vr-lobby.tsx +97 -97
- package/.next/standalone/src/app/vr/vr-pane.tsx +195 -195
- package/.next/standalone/src/app/vr/vr-room.tsx +79 -79
- package/.next/standalone/src/app/vr/vr-terminal.tsx +303 -303
- package/.next/standalone/src/components/auth/totp-gate.tsx +183 -183
- package/.next/standalone/src/components/bus/activity-panel.tsx +261 -261
- package/.next/standalone/src/components/common/color-picker.tsx +35 -35
- package/.next/standalone/src/components/common/dev-directory-picker.tsx +339 -339
- package/.next/standalone/src/components/common/folder-picker.tsx +200 -200
- package/.next/standalone/src/components/common/tag-picker.tsx +190 -190
- package/.next/standalone/src/components/common/workspace-picker.tsx +113 -113
- package/.next/standalone/src/components/cortex/benchmark-tab.tsx +894 -880
- package/.next/standalone/src/components/cortex/constants.ts +29 -29
- package/.next/standalone/src/components/cortex/cortex-dashboard.tsx +304 -304
- package/.next/standalone/src/components/cortex/cortex-indicator.tsx +44 -44
- package/.next/standalone/src/components/cortex/cortex-panel.tsx +140 -140
- package/.next/standalone/src/components/cortex/cortex-settings.tsx +280 -280
- package/.next/standalone/src/components/cortex/curation-tab.tsx +810 -810
- package/.next/standalone/src/components/cortex/entity-detail.tsx +101 -101
- package/.next/standalone/src/components/cortex/entity-graph.tsx +382 -382
- package/.next/standalone/src/components/cortex/import-dialog.tsx +212 -212
- package/.next/standalone/src/components/cortex/injection-badge.tsx +72 -72
- package/.next/standalone/src/components/cortex/knowledge-card.tsx +109 -109
- package/.next/standalone/src/components/cortex/knowledge-tab.tsx +158 -158
- package/.next/standalone/src/components/cortex/lobe-settings.tsx +215 -215
- package/.next/standalone/src/components/cortex/marketplace-card.tsx +126 -126
- package/.next/standalone/src/components/cortex/marketplace-tab.tsx +113 -113
- package/.next/standalone/src/components/dashboard/activity-chart.tsx +41 -41
- package/.next/standalone/src/components/dashboard/model-usage-chart.tsx +61 -61
- package/.next/standalone/src/components/dashboard/recent-sessions.tsx +68 -68
- package/.next/standalone/src/components/dashboard/stats-cards.tsx +36 -36
- package/.next/standalone/src/components/files/file-explorer.tsx +703 -703
- package/.next/standalone/src/components/layout/providers.tsx +38 -38
- package/.next/standalone/src/components/layout/sidebar.tsx +170 -170
- package/.next/standalone/src/components/layout/tier-provider.tsx +53 -53
- package/.next/standalone/src/components/layout/update-banner.tsx +92 -92
- package/.next/standalone/src/components/mobile/bottom-nav.tsx +46 -46
- package/.next/standalone/src/components/mobile/immersive-voice-button.tsx +123 -123
- package/.next/standalone/src/components/mobile/mobile-chat-input.tsx +244 -244
- package/.next/standalone/src/components/mobile/mobile-header.tsx +44 -44
- package/.next/standalone/src/components/mobile/mobile-session-card.tsx +56 -56
- package/.next/standalone/src/components/mobile/mobile-terminal-input.tsx +74 -74
- package/.next/standalone/src/components/mobile/mobile-terminal-pane.tsx +302 -302
- package/.next/standalone/src/components/mobile/mobile-terminal-toolbar.tsx +76 -76
- package/.next/standalone/src/components/mobile/pull-to-refresh.tsx +82 -82
- package/.next/standalone/src/components/mobile/voice-input.tsx +53 -53
- package/.next/standalone/src/components/network/api-key-list.tsx +190 -190
- package/.next/standalone/src/components/network/connection-requests.tsx +94 -94
- package/.next/standalone/src/components/network/node-add-dialog.tsx +131 -131
- package/.next/standalone/src/components/network/node-badge.tsx +26 -26
- package/.next/standalone/src/components/network/node-list.tsx +207 -207
- package/.next/standalone/src/components/network/node-selector.tsx +49 -49
- package/.next/standalone/src/components/sessions/session-filters.tsx +116 -116
- package/.next/standalone/src/components/sessions/session-list.tsx +485 -485
- package/.next/standalone/src/components/terminal/pane-diff-panel.tsx +179 -179
- package/.next/standalone/src/components/terminal/terminal-pane.tsx +1530 -1464
- package/.next/standalone/src/components/viewer/chat-input.tsx +275 -275
- package/.next/standalone/src/components/viewer/message-renderer.tsx +551 -551
- package/.next/standalone/src/components/wizard/chart-wizard.tsx +405 -0
- package/.next/standalone/src/components/wizard/project-wizard.tsx +153 -153
- package/.next/standalone/src/components/wizard/wizard-chat.tsx +99 -99
- package/.next/standalone/src/components/wizard/wizard-plan-summary.tsx +103 -103
- package/.next/standalone/src/components/wizard/wizard-review.tsx +225 -225
- package/.next/standalone/src/components/workspace/universe-cluster.tsx +131 -131
- package/.next/standalone/src/components/workspace/universe-orb.tsx +128 -128
- package/.next/standalone/src/components/workspace/universe-types.ts +22 -22
- package/.next/standalone/src/components/workspace/universe-utils.ts +11 -11
- package/.next/standalone/src/components/workspace/universe-view.tsx +397 -397
- package/.next/standalone/src/components/workspace/workspace-chooser.tsx +634 -634
- package/.next/standalone/src/hooks/use-benchmark.ts +72 -71
- package/.next/standalone/src/hooks/use-bus.ts +147 -147
- package/.next/standalone/src/hooks/use-idle-detection.ts +79 -79
- package/.next/standalone/src/hooks/use-network.ts +229 -229
- package/.next/standalone/src/hooks/use-sessions.ts +437 -437
- package/.next/standalone/src/hooks/use-speech-recognition.ts +114 -113
- package/.next/standalone/src/hooks/use-sse.ts +35 -35
- package/.next/standalone/src/hooks/use-tier.ts +39 -39
- package/.next/standalone/src/lib/agents.ts +97 -97
- package/.next/standalone/src/lib/aider/parser.ts +111 -111
- package/.next/standalone/src/lib/api.ts +19 -19
- package/.next/standalone/src/lib/auth.ts +47 -47
- package/.next/standalone/src/lib/claude/parser.ts +212 -212
- package/.next/standalone/src/lib/claude/stats.ts +204 -204
- package/.next/standalone/src/lib/codex/parser.test.ts +111 -111
- package/.next/standalone/src/lib/codex/parser.ts +287 -287
- package/.next/standalone/src/lib/config.ts +132 -132
- package/.next/standalone/src/lib/cortex/benchmark.ts +83 -67
- package/.next/standalone/src/lib/cortex/config.ts +42 -42
- package/.next/standalone/src/lib/cortex/debug.ts +10 -10
- package/.next/standalone/src/lib/cortex/distillation/usage-store.ts +18 -18
- package/.next/standalone/src/lib/cortex/graph/resolver.ts +10 -10
- package/.next/standalone/src/lib/cortex/graph/types.ts +22 -22
- package/.next/standalone/src/lib/cortex/index.ts +109 -56
- package/.next/standalone/src/lib/cortex/ingestion/bootstrap.ts +14 -14
- package/.next/standalone/src/lib/cortex/knowledge/compat.ts +14 -14
- package/.next/standalone/src/lib/cortex/knowledge/contradiction.ts +10 -10
- package/.next/standalone/src/lib/cortex/knowledge/types.ts +67 -67
- package/.next/standalone/src/lib/cortex/lobes/config.ts +16 -16
- package/.next/standalone/src/lib/cortex/lobes/resolver.ts +8 -8
- package/.next/standalone/src/lib/cortex/lobes/shares.ts +14 -14
- package/.next/standalone/src/lib/cortex/mcp/server.ts +12 -12
- package/.next/standalone/src/lib/cortex/portability/exporter.ts +6 -6
- package/.next/standalone/src/lib/cortex/portability/importer.ts +10 -10
- package/.next/standalone/src/lib/cortex/retrieval/context-engine.ts +10 -10
- package/.next/standalone/src/lib/cortex/types.ts +39 -39
- package/.next/standalone/src/lib/cost-calculator.ts +48 -48
- package/.next/standalone/src/lib/db/init.ts +71 -71
- package/.next/standalone/src/lib/db/queries.ts +740 -827
- package/.next/standalone/src/lib/db/schema.ts +206 -206
- package/.next/standalone/src/lib/events/sse.ts +36 -36
- package/.next/standalone/src/lib/forge/parser.ts +52 -52
- package/.next/standalone/src/lib/gemini/parser.ts +258 -258
- package/.next/standalone/src/lib/license.ts +56 -56
- package/.next/standalone/src/lib/pro.ts +31 -31
- package/.next/standalone/src/lib/shell-user.ts +101 -0
- package/.next/standalone/src/lib/sync/indexer.ts +504 -504
- package/.next/standalone/src/lib/sync/watcher.ts +64 -64
- package/.next/standalone/src/lib/teams.ts +31 -31
- package/.next/standalone/src/lib/telemetry.ts +75 -75
- package/.next/standalone/src/lib/terminal/server.ts +188 -188
- package/.next/standalone/src/lib/tier.ts +38 -38
- package/.next/standalone/src/lib/utils.ts +72 -72
- package/.next/standalone/src/lib/vms/manager.ts +121 -121
- package/.next/standalone/src/middleware.ts +133 -133
- package/.next/standalone/src/types/claude.ts +208 -208
- package/.next/standalone/src/types/network.ts +61 -61
- package/.next/standalone/tests/setup.ts +8 -8
- package/.next/standalone/tsconfig.json +34 -34
- package/.next/standalone/vitest.config.ts +24 -24
- package/LICENSE +661 -661
- package/README.md +131 -131
- package/bin/cortex-hook.js +79 -79
- package/bin/cortex-hook.sh +62 -62
- package/bin/cortex-learn-hook.js +138 -138
- package/bin/cortex-mcp.js +60 -60
- package/bin/cortex-pi-extension.ts +170 -170
- package/bin/fix-standalone-externals.js +79 -79
- package/bin/lib/auto-setup.js +110 -110
- package/bin/mdns-service.js +171 -171
- package/bin/postinstall.js +35 -35
- package/bin/setup-admin.js +195 -195
- package/bin/spaces-dev.js +247 -247
- package/bin/spaces-install.js +660 -660
- package/bin/spaces-postinstall.js +50 -50
- package/bin/spaces-reset-totp.js +50 -50
- package/bin/spaces-service.js +1046 -1046
- package/bin/spaces-setup.js +253 -253
- package/bin/spaces.js +808 -805
- package/bin/ssh-auth-keys.sh +68 -68
- package/bin/terminal-server.js +2819 -2781
- package/package.json +111 -111
- 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]__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]__283c890f._.js +0 -3
- 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]__4d5b78d2._.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]__69d315e5._.js +0 -3
- 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]__7ebc4280._.js +0 -131
- 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]__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]__a90729a1._.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]__cabaac2b._.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]__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]__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]__efb8251e._.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/_e84a0c06._.js +0 -3
- package/.next/standalone/.next/static/chunks/470cade58d4eceeb.css +0 -3
- package/.next/standalone/.next/static/chunks/9d4164833c2c1fd6.js +0 -85
- package/.next/standalone/.next/static/chunks/f091f4bf8d80fd07.js +0 -1
- package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/README.md +0 -46
- package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +0 -221
- package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/index.js +0 -1
- package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3 +0 -0
- package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/package.json +0 -42
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +0 -46
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +0 -221
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +0 -1
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +0 -42
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +0 -30
- package/.next/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
- package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
- package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +0 -46
- /package/.next/standalone/.next/static/{5S4TviTCiNiTjf6KjXjBo → u1pHON3drz1mBi7owkbBP}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{5S4TviTCiNiTjf6KjXjBo → u1pHON3drz1mBi7owkbBP}/_clientMiddlewareManifest.json +0 -0
- /package/.next/standalone/.next/static/{5S4TviTCiNiTjf6KjXjBo → u1pHON3drz1mBi7owkbBP}/_ssgManifest.js +0 -0
- /package/.next/standalone/node_modules/@img/{sharp-libvips-linux-x64 → sharp-win32-x64}/versions.json +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,365061,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(770703),r=e.i(209165),l=e.i(555436),i=e.i(664659),n=e.i(655900),c=e.i(727612),d=e.i(878894);let x={decision:"bg-blue-500/20 text-blue-400",preference:"bg-pink-500/20 text-pink-400",pattern:"bg-green-500/20 text-green-400",error_fix:"bg-amber-500/20 text-amber-400",context:"bg-gray-500/20 text-gray-400",code_pattern:"bg-cyan-500/20 text-cyan-400",command:"bg-orange-500/20 text-orange-400",conversation:"bg-slate-500/20 text-slate-400",summary:"bg-violet-500/20 text-violet-400"},o={public:"bg-green-500/20 text-green-400",internal:"bg-indigo-500/20 text-indigo-400",restricted:"bg-amber-500/20 text-amber-400",confidential:"bg-red-500/20 text-red-400"},p={debugging:"text-red-400",architecture:"text-blue-400",onboarding:"text-green-400",policy:"text-purple-400","how-to":"text-amber-400",review:"text-pink-400",security:"text-red-500",general:"text-gray-400"};function m({unit:e,onDelete:s,compact:a}){var l;let i,n=x[e.type]||x.context,p=(l=e.created,0===(i=Math.floor((Date.now()-new Date(l).getTime())/864e5))?"today":1===i?"1d ago":i<30?`${i}d ago`:i<365?`${Math.floor(i/30)}mo ago`:`${Math.floor(i/365)}y ago`),m=(e.contradiction_refs?.length??0)>0,h=e.evidence_score??e.confidence,u=null!=e.evidence_score?`${h.toFixed(2)} evidence`:`${Math.round(100*h)}%`,g=async()=>{await fetch((0,r.api)(`/api/cortex/knowledge/${e.id}`),{method:"DELETE"}),s?.(e.id)};return(0,t.jsxs)("div",{className:"group border border-white/5 rounded-lg p-3 hover:border-white/10 transition-colors",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-wrap",children:[(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${n}`,children:e.type.replace("_"," ")}),e.sensitivity&&(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${o[e.sensitivity]||o.internal}`,children:e.sensitivity}),e.scope&&(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded font-medium bg-purple-500/10 text-purple-400",children:e.scope.level}),(e.stale_score??0)>.3&&(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded font-medium bg-amber-500/20 text-amber-400",children:"stale"}),m&&(0,t.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 rounded font-medium bg-amber-500/20 text-amber-400 flex items-center gap-0.5",children:[(0,t.jsx)(d.AlertTriangle,{className:"w-2.5 h-2.5"})," contested"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[10px] text-gray-500 shrink-0",children:[(0,t.jsx)("span",{children:p}),s&&(0,t.jsx)("button",{onClick:g,className:"opacity-0 group-hover:opacity-100 transition-opacity text-red-400 hover:text-red-300",children:(0,t.jsx)(c.Trash2,{className:"w-3 h-3"})})]})]}),(0,t.jsx)("p",{className:"text-xs text-gray-300 mt-1.5 leading-relaxed line-clamp-3",children:e.text}),!a&&e.origin&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-1.5 text-[10px] text-gray-500 flex-wrap",children:[(0,t.jsxs)("span",{children:["by ",e.origin.creator_entity_id.replace("person-","")]}),(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:["via ",e.origin.source_type.replace("_"," ")]}),(e.corroborations??0)>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{className:"text-green-400",children:[e.corroborations," corr."]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,t.jsx)("div",{className:"flex-1 h-1 bg-white/5 rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:"h-full bg-purple-500/50 rounded-full",style:{width:`${Math.round(100*h)}%`}})}),(0,t.jsx)("span",{className:"text-[10px] text-gray-500 tabular-nums",children:u})]})]})}function h(){let[e,a]=(0,s.useState)(""),[c,d]=(0,s.useState)([]),[o,h]=(0,s.useState)(!1),[u,g]=(0,s.useState)(!1),[b,j]=(0,s.useState)(""),[y,v]=(0,s.useState)(null),[N,f]=(0,s.useState)(!1),w=async()=>{if(b.trim()){f(!0);try{let e=await fetch((0,r.api)(`/api/cortex/context?q=${encodeURIComponent(b)}&limit=5`));e.ok&&v(await e.json())}catch{}f(!1)}},k=(0,s.useCallback)(async e=>{h(!0);try{let t=new URLSearchParams({limit:"30"});e&&t.set("q",e);let s=await fetch((0,r.api)(`/api/cortex/search?${t}`));s.ok&&d((await s.json()).results||[])}catch{}h(!1)},[]);(0,s.useEffect)(()=>{k()},[k]);let _=e=>d(t=>t.filter(t=>t.id!==e));return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsx)("div",{className:"p-4 border-b border-white/5",children:(0,t.jsxs)("div",{className:"relative max-w-md",children:[(0,t.jsx)(l.Search,{className:"absolute left-3 top-2.5 w-4 h-4 text-gray-500"}),(0,t.jsx)("input",{value:e,onChange:e=>a(e.target.value),onKeyDown:t=>"Enter"===t.key&&k(e.trim()||void 0),placeholder:"Search knowledge...",className:"w-full pl-9 pr-4 py-2 text-sm bg-white/5 border border-white/10 rounded-lg text-gray-300 placeholder-gray-600 focus:outline-none focus:border-purple-500/50"})]})}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,t.jsxs)("div",{className:"max-w-2xl space-y-2",children:[o&&(0,t.jsx)("p",{className:"text-sm text-gray-500 text-center py-8",children:"Loading..."}),!o&&0===c.length&&(0,t.jsx)("p",{className:"text-sm text-gray-500 text-center py-8",children:"No knowledge found"}),c.map(e=>(0,t.jsx)(m,{unit:e,onDelete:_},e.id)),(0,t.jsxs)("div",{className:"border-t border-white/5 mt-4 pt-4",children:[(0,t.jsxs)("button",{onClick:()=>g(!u),className:"flex items-center gap-2 text-xs text-gray-500 hover:text-gray-300 mb-3",children:[u?(0,t.jsx)(n.ChevronUp,{className:"w-3 h-3"}):(0,t.jsx)(i.ChevronDown,{className:"w-3 h-3"}),"Query Analyzer"]}),u&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex gap-3 mb-4",children:[(0,t.jsxs)("div",{className:"flex-1 relative",children:[(0,t.jsx)(l.Search,{className:"absolute left-3 top-2.5 w-4 h-4 text-gray-500"}),(0,t.jsx)("input",{value:b,onChange:e=>j(e.target.value),onKeyDown:e=>"Enter"===e.key&&w(),placeholder:"Enter a query to analyze...",className:"w-full pl-9 pr-4 py-2 text-sm bg-white/5 border border-white/10 rounded-lg text-gray-300 placeholder-gray-600 focus:outline-none focus:border-purple-500/50"})]}),(0,t.jsx)("button",{onClick:w,disabled:N,className:"px-5 py-2 text-sm bg-purple-600 hover:bg-purple-500 text-white rounded-lg disabled:opacity-50",children:N?"Analyzing...":"Analyze"})]}),!y&&!N&&(0,t.jsx)("p",{className:"text-sm text-gray-600 text-center py-8",children:"Enter a query to see how the Context Engine processes it"}),y&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/5 rounded-lg p-3",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-600 uppercase mb-1",children:"Intent"}),(0,t.jsx)("div",{className:`text-lg font-semibold ${p[y.intent?.intent]||"text-gray-400"}`,children:y.intent?.intent||"?"}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-600",children:["confidence: ",(y.intent?.confidence??0).toFixed(2)]})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/5 rounded-lg p-3",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-600 uppercase mb-1",children:"Entities"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[(y.entities||[]).map((e,s)=>(0,t.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 bg-white/5 border border-white/10 rounded text-gray-300",children:[e.entity?.type,":",e.entity?.name]},s)),(!y.entities||0===y.entities.length)&&(0,t.jsx)("span",{className:"text-[10px] text-gray-600",children:"none detected"})]})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/5 rounded-lg p-3",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-600 uppercase mb-1",children:"Timing"}),(0,t.jsxs)("div",{className:"text-lg font-semibold text-green-400",children:[y.timing?.totalMs??"?","ms"]}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-600",children:["intent ",y.timing?.intentMs,"ms · search ",y.timing?.searchMs,"ms"]})]})]}),(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("div",{className:"text-[10px] text-gray-600 uppercase mb-2",children:["Results (",(y.results||[]).length,")"]}),(0,t.jsx)("div",{className:"space-y-1",children:(y.results||[]).map((e,s)=>(0,t.jsxs)("div",{className:"flex items-center gap-2 bg-white/[0.02] border border-white/5 rounded-lg px-3 py-2",children:[(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${x[e.type]||x.context}`,children:e.type?.replace("_"," ")}),(0,t.jsx)("span",{className:"text-xs text-gray-300 truncate flex-1",children:e.text}),(0,t.jsx)("span",{className:"text-[10px] text-gray-600 tabular-nums shrink-0",children:(e.relevance_score??0).toFixed(3)})]},s))})]})]})]})]})]})})]})}var u=e.i(349889);function g(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<0x40000000?`${(e/1048576).toFixed(1)} MB`:`${(e/0x40000000).toFixed(2)} GB`}function b({items:e,maxValue:s}){return(0,t.jsx)("div",{className:"space-y-1.5",children:e.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-[10px] text-gray-500 w-24 text-right truncate",title:e.label,children:e.label}),(0,t.jsx)("div",{className:"flex-1 h-3 bg-white/[0.03] rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.max(2,e.value/Math.max(s,1)*100)}%`,backgroundColor:e.color}})}),(0,t.jsx)("span",{className:"text-[10px] text-gray-400 w-14 text-right tabular-nums",children:e.value.toLocaleString()})]},e.label))})}function j({label:e,value:s,sub:a,color:r}){return(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-3",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-1",children:e}),(0,t.jsx)("div",{className:`text-lg font-semibold tabular-nums ${r||"text-white"}`,children:s}),a&&(0,t.jsx)("div",{className:"text-[10px] text-gray-600 mt-0.5",children:a})]})}let y=["#7c3aed","#06b6d4","#10b981","#f59e0b","#ef4444","#8b5cf6","#14b8a6","#22c55e","#eab308","#f97316"],v={decision:"#3b82f6",pattern:"#22c55e",preference:"#ec4899",error_fix:"#f59e0b",context:"#6b7280",code_pattern:"#06b6d4",command:"#f97316",conversation:"#64748b",summary:"#8b5cf6"};function N(){let[e,a]=(0,s.useState)(null),[l,i]=(0,s.useState)(!0);if((0,s.useEffect)(()=>{fetch((0,r.api)("/api/cortex/status")).then(e=>e.json()).then(e=>{e.enabled&&a(e)}).catch(()=>{}).finally(()=>i(!1))},[]),l)return(0,t.jsx)("div",{className:"p-6 text-sm text-gray-500",children:"Loading dashboard..."});if(!e)return(0,t.jsx)("div",{className:"p-6 text-sm text-gray-500",children:"Cortex is not active."});let n=Object.entries(e.lobes).sort((e,t)=>t[1].count-e[1].count),c=Math.max(...n.map(([,e])=>e.count),1),d=Math.max(...n.map(([,e])=>e.sizeBytes),1),x=e.usage,p=x?.distillation;return(0,t.jsxs)("div",{className:"p-6 max-w-4xl space-y-6",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,t.jsx)(j,{label:"Knowledge Units",value:e.totalCount.toLocaleString(),sub:`across ${n.length} lobes`,color:"text-purple-400"}),(0,t.jsx)(j,{label:"Storage",value:g(e.totalSizeBytes),sub:`${e.embedding_provider} (${e.embedding_dimensions}d)`}),(0,t.jsx)(j,{label:"Coverage",value:e.quality?e.quality.coverage_score.toFixed(2):"—",sub:e.quality?`${Math.round(100*e.quality.coverage_score)}% distilled`:"no data",color:e.quality?e.quality.coverage_score>.7?"text-green-400":e.quality.coverage_score>.3?"text-amber-400":"text-red-400":"text-gray-500"}),(0,t.jsx)(j,{label:"Distillation",value:p?`$${p.estimated_cost_usd.toFixed(2)}`:"Off",sub:p?`${p.calls.toLocaleString()} calls`:e.distillation?"No API key":"Disabled",color:p?"text-amber-400":"text-gray-500"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Knowledge by Lobe"}),(0,t.jsx)(b,{items:n.map(([e,t],s)=>({label:t.label||e,value:t.count,color:y[s%y.length]})),maxValue:c})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Storage by Lobe"}),(0,t.jsx)(b,{items:n.map(([e,t],s)=>({label:t.label||e,value:t.sizeBytes,color:y[s%y.length]})),maxValue:d}),(0,t.jsxs)("div",{className:"mt-2 flex justify-between text-[10px] text-gray-600",children:[(0,t.jsxs)("span",{children:["Smallest: ",g(Math.min(...n.map(([,e])=>e.sizeBytes)))]}),(0,t.jsxs)("span",{children:["Total: ",g(e.totalSizeBytes)]})]})]})]}),e.quality&&(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Type Distribution"}),(0,t.jsx)(b,{items:Object.entries(e.quality.type_distribution).sort((e,t)=>t[1]-e[1]).map(([e,t])=>({label:e.replace("_"," "),value:t,color:v[e]||"#7c3aed"})),maxValue:Math.max(...Object.values(e.quality.type_distribution),1)})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Lobe Health"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex justify-between text-[11px]",children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Stale units"}),(0,t.jsx)("span",{className:e.quality.stale_count>10?"text-amber-400":"text-gray-300",children:e.quality.stale_count})]}),(0,t.jsxs)("div",{className:"flex justify-between text-[11px]",children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Avg confidence"}),(0,t.jsx)("span",{className:"text-gray-300",children:e.quality.avg_confidence.toFixed(2)})]}),e.quality.top_accessed.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 mb-1",children:"Top accessed"}),(0,t.jsxs)("div",{className:"text-[11px] text-gray-400 truncate",children:["“",e.quality.top_accessed[0].text,"”"]})]}),e.quality.sensitivity_counts&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 mb-1",children:"Sensitivity"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:Object.entries(e.quality.sensitivity_counts).map(([e,s])=>(0,t.jsxs)("span",{className:`text-[9px] px-1.5 py-0.5 rounded ${o[e]||o.internal}`,children:[s," ",e]},e))})]})]})]})]}),p&&(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Distillation Activity"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500",children:"API Calls"}),(0,t.jsx)("div",{className:"text-sm font-medium text-white tabular-nums",children:p.calls.toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500",children:"Input Tokens"}),(0,t.jsxs)("div",{className:"text-sm font-medium text-white tabular-nums",children:[(p.input_tokens/1e3).toFixed(1),"K"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500",children:"Output Tokens"}),(0,t.jsxs)("div",{className:"text-sm font-medium text-white tabular-nums",children:[(p.output_tokens/1e3).toFixed(1),"K"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500",children:"Estimated Cost"}),(0,t.jsxs)("div",{className:"text-sm font-medium text-amber-400 tabular-nums",children:["$",p.estimated_cost_usd.toFixed(4)]})]})]}),p.last_updated&&(0,t.jsxs)("div",{className:"mt-2 text-[10px] text-gray-600",children:["Last distillation: ",new Date(p.last_updated).toLocaleString()]}),x.by_model&&Object.keys(x.by_model).length>0&&(0,t.jsxs)("div",{className:"mt-3 border-t border-white/[0.04] pt-3",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 mb-2",children:"By Model"}),Object.entries(x.by_model).map(([e,s])=>(0,t.jsxs)("div",{className:"flex items-center justify-between text-[10px]",children:[(0,t.jsx)("span",{className:"text-gray-400 font-mono",children:e}),(0,t.jsxs)("span",{className:"text-gray-500",children:[s.calls," calls · $",s.estimated_cost_usd.toFixed(4)]})]},e))]})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"System"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-1.5 text-[11px]",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Status"}),(0,t.jsx)("span",{className:"text-green-400",children:e.status})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Embedding"}),(0,t.jsxs)("span",{className:"text-gray-300",children:[e.embedding_provider," (",e.embedding_dimensions,"d)"]})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Distillation"}),(0,t.jsx)("span",{className:e.distillation?"text-green-400":"text-gray-600",children:e.distillation?"Enabled":"Disabled"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Lobes"}),(0,t.jsxs)("span",{className:"text-gray-300",children:[n.length," active"]})]})]})]})]})}var f=e.i(569074),w=e.i(217923),k=e.i(16715),_=e.i(475254);let S=(0,_.default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);var C=e.i(531278);let $=[{id:"seed",label:"Seed",icon:(0,t.jsx)(f.Upload,{className:"w-3.5 h-3.5"})},{id:"assess",label:"Assess",icon:(0,t.jsx)(w.BarChart3,{className:"w-3.5 h-3.5"})},{id:"review",label:"Review",icon:(0,t.jsx)(l.Search,{className:"w-3.5 h-3.5"})},{id:"refine",label:"Refine",icon:(0,t.jsx)(k.RefreshCw,{className:"w-3.5 h-3.5"})},{id:"publish",label:"Publish",icon:(0,t.jsx)(S,{className:"w-3.5 h-3.5"})}],R={decision:"#3b82f6",pattern:"#22c55e",preference:"#ec4899",error_fix:"#f59e0b",context:"#6b7280",code_pattern:"#06b6d4",command:"#f97316",conversation:"#64748b",summary:"#8b5cf6"};function F(){let e,[a,i]=(0,s.useState)([]),[n,c]=(0,s.useState)(""),[d,o]=(0,s.useState)("seed"),[p,m]=(0,s.useState)(""),[h,u]=(0,s.useState)(""),[g,b]=(0,s.useState)("auto"),[j,y]=(0,s.useState)(""),[v,N]=(0,s.useState)(!0),[_,F]=(0,s.useState)(!1),[T,q]=(0,s.useState)(null),[D,L]=(0,s.useState)(!1),[M,P]=(0,s.useState)(null),[A,E]=(0,s.useState)(""),[B,O]=(0,s.useState)("25"),[K,z]=(0,s.useState)(!1),[Q,I]=(0,s.useState)(null),[U,W]=(0,s.useState)(""),[V,G]=(0,s.useState)({decisions:!0,patterns:!0,preferences:!0,error_fixes:!0}),[H,J]=(0,s.useState)(!1),[Y,X]=(0,s.useState)(null),[Z,ee]=(0,s.useState)(""),[et,es]=(0,s.useState)(""),[ea,er]=(0,s.useState)(""),[el,ei]=(0,s.useState)(""),[en,ec]=(0,s.useState)("1.0.0"),[ed,ex]=(0,s.useState)("MIT"),[eo,ep]=(0,s.useState)(!1),[em,eh]=(0,s.useState)(null),eu=(0,s.useCallback)(()=>{q(null),P(null),I(null),X(null),eh(null),m("")},[]);(0,s.useEffect)(()=>{fetch((0,r.api)("/api/workspaces")).then(e=>e.json()).then(e=>{i(e),e.length>0&&c(e[0].id)}).catch(()=>{})},[]);let eg=async()=>{if(h.trim()&&n){F(!0),m(""),q(null);try{let e=await fetch((0,r.api)("/api/cortex/curation/seed"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:h,format:g,source_ref:j||void 0,workspace_id:n,distill:v})}),t=await e.json();if(!e.ok)throw Error(t.error||t.message||"Seed failed");q(t)}catch(e){m(e instanceof Error?e.message:"Seed failed")}finally{F(!1)}}},eb=async()=>{if(n){L(!0),m(""),P(null);try{let e=await fetch((0,r.api)(`/api/cortex/curation/assess?workspace_id=${encodeURIComponent(n)}`)),t=await e.json();if(!e.ok)throw Error(t.error||t.message||"Assessment failed");P(t)}catch(e){m(e instanceof Error?e.message:"Assessment failed")}finally{L(!1)}}},ej=async()=>{if(n&&A.trim()){z(!0),m(""),I(null);try{let e=new URLSearchParams({workspace_id:n,topic:A.trim(),limit:B}),t=await fetch((0,r.api)(`/api/cortex/curation/review?${e}`)),s=await t.json();if(!t.ok)throw Error(s.error||s.message||"Review failed");I(s)}catch(e){m(e instanceof Error?e.message:"Review failed")}finally{z(!1)}}},ey=async()=>{if(n){J(!0),m(""),X(null);try{let e=Object.keys(V).filter(e=>V[e]),t=await fetch((0,r.api)("/api/cortex/curation/refine"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace_id:n,domain_context:U||void 0,types:e})}),s=await t.json();if(!t.ok)throw Error(s.error||s.message||"Refine failed");X(s)}catch(e){m(e instanceof Error?e.message:"Refine failed")}finally{J(!1)}}},ev=async()=>{if(n&&Z.trim()){ep(!0),m(""),eh(null);try{let e=await fetch((0,r.api)("/api/cortex/curation/publish"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace_id:n,name:Z,author:et||void 0,description:ea||void 0,tags:el?el.split(",").map(e=>e.trim()).filter(Boolean):[],version:en,license:ed})}),t=await e.json();if(!e.ok)throw Error(t.error||t.message||"Publish failed");eh(t)}catch(e){m(e instanceof Error?e.message:"Publish failed")}finally{ep(!1)}}},eN="w-full px-3 py-2 text-sm bg-white/5 border border-white/10 rounded-lg text-gray-300 placeholder-gray-600 focus:outline-none focus:border-purple-500/50",ef="text-[11px] text-gray-500 mb-1 block",ew="bg-white/[0.02] border border-white/[0.06] rounded-lg p-4";return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"px-4 pt-4 pb-3 border-b border-white/5",children:[(0,t.jsx)("label",{className:ef,children:"Workspace"}),(0,t.jsxs)("select",{value:n,onChange:e=>{c(e.target.value),eu()},className:`${eN} max-w-xs`,children:[0===a.length&&(0,t.jsx)("option",{value:"",disabled:!0,children:"No workspaces found"}),a.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,t.jsx)("div",{className:"px-4 py-3 border-b border-white/5",children:(0,t.jsx)("div",{className:"flex items-center",children:$.map((e,s)=>(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsxs)("button",{onClick:()=>{o(e.id),eu()},className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium border transition-colors ${d===e.id?"bg-purple-500/20 border-purple-500/30 text-purple-400":"bg-white/[0.03] border-white/[0.06] text-gray-500 hover:text-gray-300 hover:bg-white/[0.06]"}`,children:[e.icon,e.label]}),s<$.length-1&&(0,t.jsx)("div",{className:"w-8 h-px bg-white/[0.06]"})]},e.id))})}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,t.jsxs)("div",{className:"max-w-2xl space-y-4",children:[p&&(0,t.jsx)("div",{className:"bg-red-500/10 border border-red-500/20 text-red-400 rounded-lg px-4 py-2.5 text-sm",children:p}),"seed"===d&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Document content"}),(0,t.jsx)("textarea",{value:h,onChange:e=>u(e.target.value),placeholder:"Paste document content here...",rows:8,className:eN})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Format"}),(0,t.jsxs)("select",{value:g,onChange:e=>b(e.target.value),className:eN,children:[(0,t.jsx)("option",{value:"auto",children:"Auto-detect"}),(0,t.jsx)("option",{value:"markdown",children:"Markdown"}),(0,t.jsx)("option",{value:"plaintext",children:"Plain text"}),(0,t.jsx)("option",{value:"csv",children:"CSV"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Source reference"}),(0,t.jsx)("input",{value:j,onChange:e=>y(e.target.value),placeholder:"e.g. docs/guide.md",className:eN})]})]}),(0,t.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[(0,t.jsx)("input",{type:"checkbox",checked:v,onChange:e=>N(e.target.checked),className:"rounded border-white/20 bg-white/5 accent-purple-500"}),(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"Distill after seeding"})]}),(0,t.jsxs)("button",{onClick:eg,disabled:_||!h.trim()||!n,className:"flex items-center gap-2 px-4 py-2 text-sm bg-purple-600 hover:bg-purple-500 text-white rounded-lg disabled:opacity-50 transition-colors",children:[_?(0,t.jsx)(C.Loader2,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(f.Upload,{className:"w-4 h-4"}),"Seed Documents"]}),T&&(0,t.jsxs)("div",{className:ew,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-gray-400 mb-3",children:"Seed Results"}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Chunks Created"}),(0,t.jsx)("div",{className:"text-lg font-semibold text-green-400 tabular-nums",children:T.chunksCreated})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Chunks Skipped"}),(0,t.jsx)("div",{className:"text-lg font-semibold text-amber-400 tabular-nums",children:T.chunksSkipped})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Errors"}),(0,t.jsx)("div",{className:`text-lg font-semibold tabular-nums ${T.errors.length>0?"text-red-400":"text-gray-500"}`,children:T.errors.length})]})]}),T.errors.length>0&&(0,t.jsx)("div",{className:"mt-3 space-y-1",children:T.errors.map((e,s)=>(0,t.jsx)("div",{className:"text-xs text-red-400/80",children:e},s))})]})]}),"assess"===d&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:eb,disabled:D||!n,className:"flex items-center gap-2 px-4 py-2 text-sm bg-purple-600 hover:bg-purple-500 text-white rounded-lg disabled:opacity-50 transition-colors",children:[D?(0,t.jsx)(C.Loader2,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(w.BarChart3,{className:"w-4 h-4"}),"Run Assessment"]}),M&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsxs)("div",{className:ew,children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Coverage Score"}),(0,t.jsx)("div",{className:`text-2xl font-semibold tabular-nums ${(e=M.coverage_score)>.7?"text-green-400":e>.3?"text-amber-400":"text-red-400"}`,children:M.coverage_score.toFixed(2)}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-600 mt-0.5",children:[Math.round(100*M.coverage_score),"% covered"]})]}),(0,t.jsxs)("div",{className:ew,children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Total Units"}),(0,t.jsx)("div",{className:"text-2xl font-semibold text-white tabular-nums",children:M.total_units.toLocaleString()})]}),(0,t.jsxs)("div",{className:ew,children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Stale Count"}),(0,t.jsx)("div",{className:`text-2xl font-semibold tabular-nums ${M.stale_count>10?"text-amber-400":"text-gray-300"}`,children:M.stale_count})]})]}),M.type_distribution&&Object.keys(M.type_distribution).length>0&&(0,t.jsxs)("div",{className:ew,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-gray-400 mb-3",children:"Type Distribution"}),(0,t.jsx)("div",{className:"space-y-1.5",children:Object.entries(M.type_distribution).sort((e,t)=>t[1]-e[1]).map(([e,s])=>{let a=Math.max(...Object.values(M.type_distribution),1);return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-[10px] text-gray-500 w-24 text-right truncate",children:e.replace("_"," ")}),(0,t.jsx)("div",{className:"flex-1 h-3 bg-white/[0.03] rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.max(2,s/a*100)}%`,backgroundColor:R[e]||"#7c3aed"}})}),(0,t.jsx)("span",{className:"text-[10px] text-gray-400 w-10 text-right tabular-nums",children:s})]},e)})})]})]})]}),"review"===d&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:ef,children:"Topic filter"}),(0,t.jsx)("input",{value:A,onChange:e=>E(e.target.value),onKeyDown:e=>"Enter"===e.key&&ej(),placeholder:"Filter by topic (optional)",className:eN})]}),(0,t.jsxs)("div",{className:"w-28",children:[(0,t.jsx)("label",{className:ef,children:"Limit"}),(0,t.jsxs)("select",{value:B,onChange:e=>O(e.target.value),className:eN,children:[(0,t.jsx)("option",{value:"10",children:"10"}),(0,t.jsx)("option",{value:"25",children:"25"}),(0,t.jsx)("option",{value:"50",children:"50"})]})]})]}),(0,t.jsxs)("button",{onClick:ej,disabled:K||!n||!A.trim(),className:"flex items-center gap-2 px-4 py-2 text-sm bg-purple-600 hover:bg-purple-500 text-white rounded-lg disabled:opacity-50 transition-colors",children:[K?(0,t.jsx)(C.Loader2,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(l.Search,{className:"w-4 h-4"}),"Review"]}),Q&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"text-[11px] text-gray-500",children:[Q.total_matches," match",1!==Q.total_matches?"es":""," for “",Q.topic,"”"]}),Object.entries(Q.by_type).map(([e,s])=>(0,t.jsxs)("details",{open:!0,className:ew,children:[(0,t.jsxs)("summary",{className:"flex items-center gap-2 cursor-pointer list-none",children:[(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${x[e]||x.context}`,children:e.replace("_"," ")}),(0,t.jsxs)("span",{className:"text-xs text-gray-500",children:[s.length," unit",1!==s.length?"s":""]})]}),(0,t.jsx)("div",{className:"mt-3 space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.04] rounded px-3 py-2",children:[(0,t.jsx)("div",{className:"text-xs text-gray-300 leading-relaxed",children:e.text}),(0,t.jsxs)("div",{className:"mt-1 text-[10px] text-gray-600",children:["confidence: ",e.confidence?.toFixed(2)," · similarity: ",e.similarity?.toFixed(3)]})]},s))})]},e))]})]}),"refine"===d&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"bg-amber-500/10 border border-amber-500/20 text-amber-400 rounded-lg px-4 py-2.5 text-xs leading-relaxed",children:"Refine uses LLM distillation and requires an API key configured in Cortex settings. Without a key, refinement will run in passthrough mode."}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Domain context"}),(0,t.jsx)("textarea",{value:U,onChange:e=>W(e.target.value),placeholder:"Describe the domain or project context to guide distillation...",rows:4,className:eN})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Distillation passes"}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-2",children:Object.keys(V).map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[(0,t.jsx)("input",{type:"checkbox",checked:V[e],onChange:t=>G(s=>({...s,[e]:t.target.checked})),className:"rounded border-white/20 bg-white/5 accent-purple-500"}),(0,t.jsx)("span",{className:"text-xs text-gray-400 capitalize",children:e.replace("_"," ")})]},e))})]}),(0,t.jsxs)("button",{onClick:ey,disabled:H||!n,className:"flex items-center gap-2 px-4 py-2 text-sm bg-purple-600 hover:bg-purple-500 text-white rounded-lg disabled:opacity-50 transition-colors",children:[H?(0,t.jsx)(C.Loader2,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(k.RefreshCw,{className:"w-4 h-4"}),"Refine Lobe"]}),Y&&(0,t.jsxs)("div",{className:ew,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-gray-400 mb-3",children:"Refine Results"}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Source Units"}),(0,t.jsx)("div",{className:"text-lg font-semibold text-white tabular-nums",children:Y.source_units_found})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Purged"}),(0,t.jsx)("div",{className:"text-lg font-semibold text-amber-400 tabular-nums",children:Y.distilled_purged})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"New Units"}),(0,t.jsx)("div",{className:"text-lg font-semibold text-green-400 tabular-nums",children:Y.new_units_created})]})]})]})]}),"publish"===d&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Package name *"}),(0,t.jsx)("input",{value:Z,onChange:e=>ee(e.target.value),placeholder:"my-knowledge-pack",className:eN})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Author"}),(0,t.jsx)("input",{value:et,onChange:e=>es(e.target.value),placeholder:"Your name or org",className:eN})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Description"}),(0,t.jsx)("textarea",{value:ea,onChange:e=>er(e.target.value),placeholder:"Describe the knowledge pack...",rows:3,className:eN})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Tags (comma-separated)"}),(0,t.jsx)("input",{value:el,onChange:e=>ei(e.target.value),placeholder:"e.g. typescript, react, patterns",className:eN})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Version"}),(0,t.jsx)("input",{value:en,onChange:e=>ec(e.target.value),placeholder:"1.0.0",className:eN})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"License"}),(0,t.jsxs)("select",{value:ed,onChange:e=>ex(e.target.value),className:eN,children:[(0,t.jsx)("option",{value:"MIT",children:"MIT"}),(0,t.jsx)("option",{value:"Apache-2.0",children:"Apache 2.0"}),(0,t.jsx)("option",{value:"GPL-3.0",children:"GPL 3.0"}),(0,t.jsx)("option",{value:"BSD-3-Clause",children:"BSD 3-Clause"}),(0,t.jsx)("option",{value:"CC-BY-4.0",children:"CC BY 4.0"}),(0,t.jsx)("option",{value:"Proprietary",children:"Proprietary"})]})]})]}),(0,t.jsxs)("button",{onClick:ev,disabled:eo||!Z.trim()||!n,className:"flex items-center gap-2 px-4 py-2 text-sm bg-purple-600 hover:bg-purple-500 text-white rounded-lg disabled:opacity-50 transition-colors",children:[eo?(0,t.jsx)(C.Loader2,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(S,{className:"w-4 h-4"}),"Publish to Marketplace"]}),em&&(0,t.jsxs)("div",{className:ew,children:[em.quality_warning&&(0,t.jsx)("div",{className:"mb-3 bg-amber-500/10 border border-amber-500/20 text-amber-400 rounded px-3 py-2 text-xs",children:em.quality_warning}),(0,t.jsx)("div",{className:"text-xs font-medium text-gray-400 mb-3",children:"Published"}),em.output_path&&(0,t.jsxs)("div",{className:"mb-2",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Output Path"}),(0,t.jsx)("div",{className:"text-xs text-gray-300 font-mono break-all",children:em.output_path})]}),em.pii_scrub&&(0,t.jsxs)("div",{className:"mt-2 pt-2 border-t border-white/[0.06]",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"PII Scrub"}),(0,t.jsxs)("div",{className:"flex gap-4 text-[11px] text-gray-400",children:[(0,t.jsxs)("span",{children:[em.pii_scrub.records_checked.toLocaleString()," records checked"]}),(0,t.jsxs)("span",{children:[em.pii_scrub.fields_scrubbed.toLocaleString()," fields scrubbed"]})]})]})]})]})]})})]})}var T=e.i(75505);function q({filename:e,manifest:a,onImport:r}){let[l,c]=(0,s.useState)(!1),d=a.marketplace??{},x=d.name||e,o=a.version||d.version||"0.0.0",p=d.author||a.author||"Unknown",m=d.description||a.description||"",h=d.tags||a.tags||[],u=d.license||a.license||"",g="number"==typeof d.coverage_score?d.coverage_score:-1,b="number"==typeof a.unit_count?a.unit_count:Array.isArray(a.units)?a.units.length:0,j=d.preview||a.preview||"",y=g<0?"N/A":`${Math.round(100*g)}%`;return(0,t.jsxs)("div",{className:"border border-white/10 rounded-xl p-4 bg-white/[0.02] flex flex-col gap-3 hover:border-white/20 transition-colors",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"shrink-0 w-9 h-9 rounded-lg bg-purple-500/10 flex items-center justify-center",children:(0,t.jsx)(S,{className:"w-4 h-4 text-purple-400"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-gray-100 truncate",children:x}),(0,t.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-white/5 text-gray-400 font-mono shrink-0",children:["v",o]})]}),(0,t.jsx)("p",{className:"text-[11px] text-gray-500 mt-0.5",children:p})]})]}),m&&(0,t.jsx)("p",{className:"text-xs text-gray-400 leading-relaxed line-clamp-2",children:m}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[h.map(e=>(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-white/5 text-gray-400 border border-white/5",children:e},e)),u&&(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-purple-500/10 text-purple-400 border border-purple-500/20 font-medium",children:u})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 text-[11px]",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-gray-600",children:"Coverage:"}),(0,t.jsx)("span",{className:`font-semibold tabular-nums ${g<0?"text-gray-500":g>.7?"text-green-400":g>.3?"text-amber-400":"text-red-400"}`,children:y})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-gray-600",children:"Units:"}),(0,t.jsx)("span",{className:"text-gray-300 font-semibold tabular-nums",children:b})]})]}),j&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>c(e=>!e),className:"flex items-center gap-1 text-[11px] text-gray-500 hover:text-gray-300 transition-colors",children:[l?(0,t.jsx)(n.ChevronUp,{className:"w-3 h-3"}):(0,t.jsx)(i.ChevronDown,{className:"w-3 h-3"}),l?"Hide preview":"Show preview"]}),l&&(0,t.jsx)("pre",{className:"mt-2 text-[10px] text-gray-400 bg-white/[0.03] border border-white/5 rounded-lg p-3 overflow-x-auto whitespace-pre-wrap break-all",children:j})]}),(0,t.jsx)("button",{onClick:()=>r(e,a),className:"w-full py-2 text-sm font-medium bg-purple-600 hover:bg-purple-500 text-white rounded-lg transition-colors",children:"Import"})]})}var D=e.i(37727);function L({filename:e,hasDomainContext:a,onClose:l,onComplete:i}){let[n,c]=(0,s.useState)("personal"),[d,x]=(0,s.useState)(""),[o,p]=(0,s.useState)([]),[m,h]=(0,s.useState)("append"),[u,g]=(0,s.useState)(!1),[b,j]=(0,s.useState)(!1),[y,v]=(0,s.useState)(!1),[N,f]=(0,s.useState)(null);(0,s.useEffect)(()=>{"workspace"===n&&fetch((0,r.api)("/api/workspaces")).then(e=>e.ok?e.json():null).then(e=>{let t=e?.workspaces??e??[];p(t),t.length>0&&!d&&x(t[0].id)}).catch(()=>{})},[n]);let w=async()=>{v(!0),f(null);try{let t={marketplace_file:e,target_layer:n,merge_strategy:m,re_embed:u};"workspace"===n&&d&&(t.workspace_id=d),a&&(t.apply_domain_context=b);let s=await fetch((0,r.api)("/api/cortex/import"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e?.error||`Request failed (${s.status})`)}i()}catch(e){f(e?.message||"Import failed")}finally{v(!1)}};return(0,t.jsx)("div",{className:"fixed inset-0 z-50 bg-black/60 flex items-center justify-center p-4",children:(0,t.jsxs)("div",{className:"bg-gray-900 border border-white/10 rounded-xl p-6 max-w-md w-full flex flex-col gap-5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-gray-100",children:"Import Pack"}),(0,t.jsx)("p",{className:"text-[11px] text-gray-500 mt-0.5 font-mono break-all",children:e})]}),(0,t.jsx)("button",{onClick:l,className:"shrink-0 text-gray-500 hover:text-gray-300 transition-colors","aria-label":"Close",children:(0,t.jsx)(D.X,{className:"w-4 h-4"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] text-gray-500 uppercase tracking-wide mb-2",children:"Target layer"}),(0,t.jsx)("div",{className:"flex gap-2",children:[{value:"personal",label:"Personal"},{value:"workspace",label:"Workspace"},{value:"team",label:"Team"}].map(e=>(0,t.jsx)("button",{onClick:()=>c(e.value),className:`flex-1 py-1.5 text-xs font-medium rounded-lg border transition-colors ${n===e.value?"bg-purple-600 border-purple-500 text-white":"bg-white/5 border-white/10 text-gray-400 hover:border-white/20 hover:text-gray-200"}`,children:e.label},e.value))})]}),"workspace"===n&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] text-gray-500 uppercase tracking-wide mb-2",children:"Workspace"}),0===o.length?(0,t.jsx)("p",{className:"text-xs text-gray-600",children:"No workspaces found"}):(0,t.jsx)("select",{value:d,onChange:e=>x(e.target.value),className:"w-full py-2 px-3 text-sm bg-white/5 border border-white/10 rounded-lg text-gray-300 focus:outline-none focus:border-purple-500/50",children:o.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] text-gray-500 uppercase tracking-wide mb-2",children:"Merge strategy"}),(0,t.jsx)("div",{className:"flex gap-2",children:[{value:"append",label:"Append"},{value:"merge",label:"Merge"},{value:"replace",label:"Replace"}].map(e=>(0,t.jsx)("button",{onClick:()=>h(e.value),className:`flex-1 py-1.5 text-xs font-medium rounded-lg border transition-colors ${m===e.value?"bg-purple-600 border-purple-500 text-white":"bg-white/5 border-white/10 text-gray-400 hover:border-white/20 hover:text-gray-200"}`,children:e.label},e.value))})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2.5 cursor-pointer select-none group",children:[(0,t.jsx)("input",{type:"checkbox",checked:u,onChange:e=>g(e.target.checked),className:"w-3.5 h-3.5 accent-purple-500"}),(0,t.jsx)("span",{className:"text-xs text-gray-400 group-hover:text-gray-200 transition-colors",children:"Re-embed on import"})]}),a&&(0,t.jsxs)("label",{className:"flex items-center gap-2.5 cursor-pointer select-none group",children:[(0,t.jsx)("input",{type:"checkbox",checked:b,onChange:e=>j(e.target.checked),className:"w-3.5 h-3.5 accent-purple-500"}),(0,t.jsx)("span",{className:"text-xs text-gray-400 group-hover:text-gray-200 transition-colors",children:"Apply domain context"})]})]}),N&&(0,t.jsx)("p",{className:"text-xs text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg px-3 py-2",children:N}),(0,t.jsxs)("button",{onClick:w,disabled:y,className:"w-full py-2 text-sm font-medium bg-purple-600 hover:bg-purple-500 text-white rounded-lg transition-colors disabled:opacity-50 flex items-center justify-center gap-2",children:[y&&(0,t.jsx)(C.Loader2,{className:"w-3.5 h-3.5 animate-spin"}),y?"Importing...":"Import"]})]})})}function M(){let[e,a]=(0,s.useState)([]),[l,i]=(0,s.useState)(""),[n,c]=(0,s.useState)(!1),[d,x]=(0,s.useState)(null),o=(0,s.useCallback)(async()=>{c(!0);try{let e=await fetch((0,r.api)("/api/cortex/marketplace/browse"));if(e.ok){let t=await e.json();a(t.packs??[]),t.directory&&i(t.directory)}}catch{}c(!1)},[]);(0,s.useEffect)(()=>{o()},[o]);let p=(e,t)=>{x({filename:e,manifest:t})},m=d?.manifest?.marketplace?.domain_context!=null||d?.manifest?.domain_context!=null;return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"p-4 border-b border-white/5 flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-gray-100",children:"Marketplace"}),l&&(0,t.jsx)("p",{className:"text-[11px] text-gray-600 font-mono mt-0.5 truncate",children:l})]}),(0,t.jsxs)("button",{onClick:o,disabled:n,className:"flex items-center gap-1.5 text-xs text-gray-400 hover:text-gray-200 transition-colors disabled:opacity-50",children:[(0,t.jsx)(k.RefreshCw,{className:`w-3.5 h-3.5 ${n?"animate-spin":""}`}),"Refresh"]})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto p-4",children:[n&&0===e.length&&(0,t.jsx)("p",{className:"text-sm text-gray-500 text-center py-12",children:"Loading..."}),!n&&0===e.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-16 text-gray-600",children:[(0,t.jsx)(T.FolderOpen,{className:"w-8 h-8"}),(0,t.jsx)("p",{className:"text-sm",children:"No .cortexpack files found"})]}),e.length>0&&(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:e.map(e=>(0,t.jsx)(q,{filename:e.filename,manifest:e.manifest,onImport:p},e.filename))})]}),d&&(0,t.jsx)(L,{filename:d.filename,hasDomainContext:m,onClose:()=>x(null),onComplete:()=>{x(null),o()}})]})}var P=e.i(509694),A=e.i(475225),E=e.i(785183),B=e.i(93230),O=e.i(234239),K=e.i(731195),z=e.i(322787);let Q=(0,_.default)("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);var I=e.i(463059);let U=(0,_.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var W=e.i(266027),V=e.i(954616),G=e.i(912598);function H({label:e,value:s,sub:a,color:r}){return(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-3",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-1",children:e}),(0,t.jsx)("div",{className:`text-lg font-semibold tabular-nums ${r||"text-white"}`,children:s}),a&&(0,t.jsx)("div",{className:"text-[10px] text-gray-600 mt-0.5",children:a})]})}let J={background:"#0f0f11",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"0.5rem",fontSize:"11px",color:"#d1d5db"};function Y(e){return e<-10?"#22c55e":e<0?"#86efac":e<5?"#f59e0b":"#ef4444"}function X({result:e}){let[a,r]=(0,s.useState)(!1);return(0,t.jsxs)("div",{className:"border border-white/[0.05] rounded-lg overflow-hidden",children:[(0,t.jsxs)("button",{onClick:()=>r(e=>!e),className:"w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-white/[0.02] transition-colors",children:[(0,t.jsx)("span",{className:"text-gray-500",children:a?(0,t.jsx)(i.ChevronDown,{className:"w-3.5 h-3.5"}):(0,t.jsx)(I.ChevronRight,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("span",{className:"text-xs text-gray-300 font-mono flex-1 truncate",title:e.task_id,children:e.task_id}),(0,t.jsx)("span",{className:"text-[10px] text-gray-600 w-20",children:e.category}),(0,t.jsx)("span",{className:"text-[10px] text-gray-600 w-12",children:e.difficulty}),(0,t.jsx)("span",{className:"text-[10px] tabular-nums w-16 text-right",style:{color:Y(e.tokens_delta_percent??0)},children:null!=e.tokens_delta_percent?`${e.tokens_delta_percent>0?"+":""}${e.tokens_delta_percent.toFixed(1)}%`:"—"}),(0,t.jsxs)("span",{className:"text-[10px] text-gray-400 tabular-nums w-20 text-right",children:[null!=e.quality_with?e.quality_with.toFixed(2):"—"," / ",null!=e.quality_without?e.quality_without.toFixed(2):"—"]})]}),a&&(0,t.jsxs)("div",{className:"px-8 pb-3 pt-1 grid grid-cols-2 md:grid-cols-4 gap-3 bg-white/[0.01] border-t border-white/[0.05]",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Tokens without"}),(0,t.jsxs)("div",{className:"text-xs text-gray-300 tabular-nums",children:[e.tokens_without_input??"—"," in / ",e.tokens_without_output??"—"," out"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Tokens with"}),(0,t.jsxs)("div",{className:"text-xs text-gray-300 tabular-nums",children:[e.tokens_with_input??"—"," in / ",e.tokens_with_output??"—"," out"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Injection"}),(0,t.jsxs)("div",{className:"text-xs text-gray-300 tabular-nums",children:[e.injection_tokens??"—"," tokens"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Retrieval"}),(0,t.jsxs)("div",{className:"text-xs text-gray-300 tabular-nums",children:[e.retrieval_count??0," hits",null!=e.retrieval_avg_relevance?` \xb7 ${e.retrieval_avg_relevance.toFixed(3)} rel`:"",null!=e.retrieval_latency_ms?` \xb7 ${e.retrieval_latency_ms.toFixed(0)}ms`:""]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Quality improvement"}),(0,t.jsx)("div",{className:"text-xs tabular-nums",style:{color:(e.quality_improvement??0)>0?"#22c55e":(e.quality_improvement??0)<0?"#ef4444":"#6b7280"},children:null!=e.quality_improvement?`${e.quality_improvement>0?"+":""}${e.quality_improvement.toFixed(3)}`:"—"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Judge confidence"}),(0,t.jsx)("div",{className:"text-xs text-gray-300 tabular-nums",children:null!=e.judge_confidence?e.judge_confidence.toFixed(2):"—"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Duration without"}),(0,t.jsx)("div",{className:"text-xs text-gray-300 tabular-nums",children:null!=e.duration_without_ms?`${e.duration_without_ms.toFixed(0)}ms`:"—"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Duration with"}),(0,t.jsx)("div",{className:"text-xs text-gray-300 tabular-nums",children:null!=e.duration_with_ms?`${e.duration_with_ms.toFixed(0)}ms`:"—"})]})]})]})}function Z({tier:e}){if(!e)return null;let s={gold:"bg-yellow-500/20 text-yellow-300 border-yellow-500/30",silver:"bg-gray-400/20 text-gray-300 border-gray-400/30",bronze:"bg-orange-500/20 text-orange-300 border-orange-500/30"}[e.toLowerCase()]||"bg-purple-500/20 text-purple-300 border-purple-500/30";return(0,t.jsx)("span",{className:`text-[9px] px-1.5 py-0.5 rounded border font-medium uppercase ${s}`,children:e})}let ee=["codebase-qa","bug-fixing","code-generation","refactoring","style-convention","decision-recall","cross-session","error-recovery","domain-knowledge","multi-layer","performance-optimization","api-integration","security-access","meta-self","lobe-specific"],et={quick:{label:"Quick Test",desc:"Single task per category",tasks:"~15 tasks",time:"~3 min"},standard:{label:"Standard",desc:"5 tasks per category",tasks:"~75 tasks",time:"~20 min"},full:{label:"Comprehensive",desc:"All tasks",tasks:"~156 tasks",time:"~1 hour"}};function es({current:e,total:s}){let a=s>0?Math.round(e/s*100):0;return(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsxs)("span",{className:"text-[10px] text-gray-500 tabular-nums",children:[e," / ",s>0?s:"?"," tasks"]}),(0,t.jsxs)("span",{className:"text-[10px] text-gray-500 tabular-nums",children:[a,"%"]})]}),(0,t.jsx)("div",{className:"h-1.5 bg-white/[0.06] rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:"h-full bg-purple-500 rounded-full transition-all duration-500",style:{width:`${a}%`}})})]})}function ea({onRunComplete:e}){let a,{data:l}=(0,W.useQuery)({queryKey:["benchmark","status"],queryFn:async()=>{let e=await fetch((0,r.api)("/api/benchmark/status"));return e.ok?e.json():null},refetchInterval:3e3}),n=(a=(0,G.useQueryClient)(),(0,V.useMutation)({mutationFn:async e=>(await fetch((0,r.api)("/api/benchmark/run"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["benchmark"]})}})),[c,d]=(0,s.useState)([]),[x,o]=(0,s.useState)("claude-haiku-4-5"),[p,m]=(0,s.useState)(!1),[h,u]=(0,s.useState)(!1),g=l?.running===!0,b=(0,s.useRef)(void 0);(0,s.useEffect)(()=>{!0!==b.current||g||l?.exitCode==null||e(),b.current=g},[g,l?.exitCode,e]);let j=l?.output?l.output.split("\n").filter(e=>e.trim().length>0).slice(-6):[];if(g)return(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4 space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(C.Loader2,{className:"w-3.5 h-3.5 text-purple-400 animate-spin"}),(0,t.jsxs)("span",{className:"text-xs font-medium text-gray-300",children:["Benchmark running — ",l?.preset,l?.categories&&"all"!==l.categories?` (${l.categories})`:""]})]}),(0,t.jsx)("span",{className:"text-[10px] text-gray-600 font-mono",children:l?.model})]}),(0,t.jsx)(es,{current:l?.progress?.current??0,total:l?.progress?.total??0}),j.length>0&&(0,t.jsx)("div",{className:"bg-black/30 rounded-md p-3 font-mono text-[10px] text-gray-500 space-y-0.5 max-h-28 overflow-y-auto",children:j.map((e,s)=>(0,t.jsx)("div",{className:"leading-relaxed",children:e},s))})]});let y=n.data?.error;return(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg overflow-hidden",children:[(0,t.jsx)("div",{className:"px-4 py-3 border-b border-white/[0.05]",children:(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400",children:"Run Benchmark"})}),(0,t.jsxs)("div",{className:"p-4 space-y-2",children:[Object.entries(et).map(([e,s])=>(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 rounded-lg border border-white/[0.05] hover:border-white/[0.10] hover:bg-white/[0.02] transition-colors",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-300",children:s.label}),(0,t.jsx)("span",{className:"text-[10px] text-gray-600",children:s.desc})]}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-600 mt-0.5 tabular-nums",children:[s.tasks," · ",s.time]})]}),(0,t.jsxs)("button",{onClick:()=>{n.mutate({preset:e})},disabled:n.isPending,className:"ml-4 flex items-center gap-1.5 px-3 py-1 text-[11px] font-medium rounded-md bg-purple-600/20 text-purple-300 border border-purple-500/20 hover:bg-purple-600/30 hover:border-purple-500/40 disabled:opacity-50 disabled:cursor-not-allowed transition-colors shrink-0",children:[(0,t.jsx)(U,{className:"w-2.5 h-2.5"}),"Run"]})]},e)),(0,t.jsxs)("div",{className:"pt-1",children:[(0,t.jsxs)("button",{onClick:()=>u(e=>!e),className:"flex items-center gap-1.5 text-[11px] text-gray-500 hover:text-gray-400 transition-colors",children:[h?(0,t.jsx)(i.ChevronDown,{className:"w-3 h-3"}):(0,t.jsx)(I.ChevronRight,{className:"w-3 h-3"}),"Custom"]}),h&&(0,t.jsxs)("div",{className:"mt-3 space-y-3 pl-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-600 uppercase tracking-wider mb-2",children:"Categories"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:ee.map(e=>{let s=c.includes(e);return(0,t.jsx)("button",{onClick:()=>{d(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},className:`px-2 py-0.5 text-[10px] rounded border transition-colors ${s?"bg-purple-500/20 text-purple-300 border-purple-500/30":"bg-white/[0.03] text-gray-500 border-white/[0.06] hover:text-gray-400 hover:border-white/[0.10]"}`,children:e},e)})}),0===c.length&&(0,t.jsx)("div",{className:"text-[10px] text-gray-600 mt-1",children:"None selected = all categories"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-600 uppercase tracking-wider mb-1",children:"Model"}),(0,t.jsxs)("select",{value:x,onChange:e=>o(e.target.value),className:"px-2.5 py-1 text-xs bg-white/5 border border-white/10 rounded-md text-gray-300 focus:outline-none focus:border-purple-500/50",children:[(0,t.jsx)("option",{value:"claude-haiku-4-5",children:"claude-haiku-4-5"}),(0,t.jsx)("option",{value:"claude-sonnet-4-5",children:"claude-sonnet-4-5"}),(0,t.jsx)("option",{value:"claude-opus-4-5",children:"claude-opus-4-5"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-4",children:[(0,t.jsx)("input",{id:"no-judge",type:"checkbox",checked:p,onChange:e=>m(e.target.checked),className:"w-3.5 h-3.5 rounded accent-purple-500"}),(0,t.jsx)("label",{htmlFor:"no-judge",className:"text-[11px] text-gray-400 cursor-pointer",children:"Skip judge"})]})]}),(0,t.jsxs)("button",{onClick:function(){n.mutate({preset:"custom",categories:c.length>0?c.join(","):void 0,noJudge:p,model:x})},disabled:n.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md bg-purple-600/20 text-purple-300 border border-purple-500/20 hover:bg-purple-600/30 hover:border-purple-500/40 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[(0,t.jsx)(U,{className:"w-3 h-3"}),"Run Custom"]})]})]}),y&&(0,t.jsx)("div",{className:"text-[11px] text-red-400 bg-red-500/10 border border-red-500/20 rounded-md px-3 py-2",children:y}),l&&!g&&null!=l.exitCode&&(0,t.jsxs)("div",{className:"text-[11px] text-gray-500 bg-white/[0.02] border border-white/[0.05] rounded-md px-3 py-2",children:["Last run finished — exit code ",l.exitCode,0===l.exitCode?" (success)":" (error)"]})]})]})}function er(){let{data:e,isLoading:a,refetch:l}=(0,W.useQuery)({queryKey:["benchmark","runs"],queryFn:async()=>{let e=await fetch((0,r.api)("/api/benchmark/runs"));return e.ok?e.json():null}}),i=e?.runs??[],[n,c]=(0,s.useState)(null),d=n??i[0]?.id??null,{data:x,isLoading:o}=(0,W.useQuery)({queryKey:["benchmark","run",d],queryFn:async()=>{if(!d)return null;let e=await fetch((0,r.api)(`/api/benchmark/runs/${d}`));return e.ok?e.json():null},enabled:!!d}),{data:p}=(0,W.useQuery)({queryKey:["benchmark","lobes"],queryFn:async()=>{let e=await fetch((0,r.api)("/api/benchmark/lobes"));return e.ok?e.json():null}}),m=x?.summary??null,h=x?.categories??[],u=x?.results??[],g=p?.lobes??[],b=!a&&0===i.length;if(a)return(0,t.jsxs)("div",{className:"p-6 max-w-5xl space-y-6",children:[(0,t.jsx)(ea,{onRunComplete:()=>l()}),(0,t.jsx)("div",{className:"text-sm text-gray-500",children:"Loading benchmark data..."})]});if(b)return(0,t.jsxs)("div",{className:"p-6 max-w-5xl space-y-6",children:[(0,t.jsx)(ea,{onRunComplete:()=>l()}),(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-4 py-16 text-gray-600",children:[(0,t.jsx)(Q,{className:"w-10 h-10"}),(0,t.jsxs)("p",{className:"text-sm text-center max-w-xs",children:["No benchmark data yet. Use the launcher above or run"," ",(0,t.jsx)("span",{className:"text-gray-500 font-mono text-xs",children:"npm run benchmark"})," ","to generate results."]})]})]});let j=h.map(e=>({name:e.category,delta:parseFloat(e.avgTokenDeltaPercent.toFixed(1))})),y=h.map(e=>({name:e.category,without:parseFloat(e.avgQualityWithout.toFixed(3)),with:parseFloat(e.avgQualityWith.toFixed(3))})),v=[...h].sort((e,t)=>t.hitRate-e.hitRate).map(e=>({name:e.category,hitRate:parseFloat((100*e.hitRate).toFixed(1))}));return(0,t.jsxs)("div",{className:"p-6 max-w-5xl space-y-6",children:[(0,t.jsx)(ea,{onRunComplete:()=>l()}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-[11px] text-gray-500 shrink-0",children:"Run"}),(0,t.jsx)("select",{value:d??"",onChange:e=>c(e.target.value||null),className:"px-3 py-1.5 text-xs bg-white/5 border border-white/10 rounded-lg text-gray-300 focus:outline-none focus:border-purple-500/50",children:i.map(e=>(0,t.jsxs)("option",{value:e.id,children:[new Date(e.timestamp).toLocaleString()," — ",e.model," (",e.preset,", ",e.task_count," tasks)"]},e.id))})]}),m&&(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[(0,t.jsx)(H,{label:"Avg Token Delta",value:null!=m.avgTokenDeltaPercent?`${m.avgTokenDeltaPercent>0?"+":""}${m.avgTokenDeltaPercent.toFixed(1)}%`:"—",sub:"vs baseline",color:m.avgTokenDeltaPercent<0?"text-green-400":m.avgTokenDeltaPercent<5?"text-amber-400":"text-red-400"}),(0,t.jsx)(H,{label:"Quality (with)",value:m.avgQualityWith.toFixed(2),sub:"avg LLM judge score",color:"text-purple-400"}),(0,t.jsx)(H,{label:"Quality (without)",value:m.avgQualityWithout.toFixed(2),sub:"baseline"}),(0,t.jsx)(H,{label:"Tasks",value:m.taskCount.toString(),sub:`${h.length} categories`}),(0,t.jsx)(H,{label:"Avg Retrieval",value:m.avgRetrievalLatencyMs?`${m.avgRetrievalLatencyMs.toFixed(0)}ms`:"—",sub:m.avgRetrievalRelevance?`${m.avgRetrievalRelevance.toFixed(3)} relevance`:"relevance"})]}),o&&(0,t.jsx)("div",{className:"text-sm text-gray-500",children:"Loading run details..."}),h.length>0&&(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg overflow-hidden",children:[(0,t.jsx)("div",{className:"px-4 py-3 border-b border-white/[0.05]",children:(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400",children:"Category Breakdown"})}),(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-white/[0.05]",children:[(0,t.jsx)("th",{className:"px-4 py-2 text-left text-[10px] text-gray-500 uppercase tracking-wider",children:"Category"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Tasks"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Token Delta"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Quality w/o"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Quality with"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Hit Rate"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Relevance"})]})}),(0,t.jsx)("tbody",{children:h.map((e,s)=>(0,t.jsxs)("tr",{className:`border-b border-white/[0.03] ${s%2==0?"":"bg-white/[0.01]"}`,children:[(0,t.jsx)("td",{className:"px-4 py-2 text-gray-300",children:e.category}),(0,t.jsx)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:e.taskCount}),(0,t.jsxs)("td",{className:"px-4 py-2 text-right tabular-nums font-medium",style:{color:Y(e.avgTokenDeltaPercent)},children:[e.avgTokenDeltaPercent>0?"+":"",e.avgTokenDeltaPercent.toFixed(1),"%"]}),(0,t.jsx)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:e.avgQualityWithout.toFixed(2)}),(0,t.jsx)("td",{className:"px-4 py-2 text-right text-gray-300 tabular-nums font-medium",children:e.avgQualityWith.toFixed(2)}),(0,t.jsxs)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:[(100*e.hitRate).toFixed(0),"%"]}),(0,t.jsx)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:e.avgRetrievalRelevance.toFixed(3)})]},e.category))})]})})]}),h.length>0&&(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Token Delta % by Category"}),(0,t.jsx)(K.ResponsiveContainer,{width:"100%",height:160,children:(0,t.jsxs)(P.BarChart,{data:j,margin:{top:4,right:4,bottom:4,left:0},children:[(0,t.jsx)(E.XAxis,{dataKey:"name",tick:{fontSize:10,fill:"#6b7280"}}),(0,t.jsx)(B.YAxis,{tick:{fontSize:10,fill:"#6b7280"}}),(0,t.jsx)(O.Tooltip,{contentStyle:J,formatter:e=>[`${e>0?"+":""}${e}%`,"Token delta"]}),(0,t.jsx)(A.Bar,{dataKey:"delta",radius:[2,2,0,0],children:j.map((e,s)=>(0,t.jsx)(z.Cell,{fill:Y(e.delta)},s))})]})})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Quality Score by Category"}),(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-gray-500",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-sm inline-block",style:{background:"#6b7280"}}),"Without"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-gray-500",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-sm inline-block",style:{background:"#7c3aed"}}),"With Cortex"]})]}),(0,t.jsx)(K.ResponsiveContainer,{width:"100%",height:160,children:(0,t.jsxs)(P.BarChart,{data:y,margin:{top:4,right:4,bottom:4,left:0},children:[(0,t.jsx)(E.XAxis,{dataKey:"name",tick:{fontSize:10,fill:"#6b7280"}}),(0,t.jsx)(B.YAxis,{domain:[0,1],tick:{fontSize:10,fill:"#6b7280"}}),(0,t.jsx)(O.Tooltip,{contentStyle:J}),(0,t.jsx)(A.Bar,{dataKey:"without",fill:"#4b5563",radius:[2,2,0,0]}),(0,t.jsx)(A.Bar,{dataKey:"with",fill:"#7c3aed",radius:[2,2,0,0]})]})})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4 md:col-span-2",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Knowledge Retrieval Hit Rate %"}),(0,t.jsx)(K.ResponsiveContainer,{width:"100%",height:120,children:(0,t.jsxs)(P.BarChart,{data:v,layout:"vertical",margin:{top:4,right:4,bottom:4,left:60},children:[(0,t.jsx)(E.XAxis,{type:"number",domain:[0,100],tick:{fontSize:10,fill:"#6b7280"}}),(0,t.jsx)(B.YAxis,{type:"category",dataKey:"name",tick:{fontSize:10,fill:"#6b7280"},width:56}),(0,t.jsx)(O.Tooltip,{contentStyle:J,formatter:e=>[`${e}%`,"Hit rate"]}),(0,t.jsx)(A.Bar,{dataKey:"hitRate",fill:"#06b6d4",radius:[0,2,2,0]})]})})]})]}),g.length>0&&(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg overflow-hidden",children:[(0,t.jsx)("div",{className:"px-4 py-3 border-b border-white/[0.05]",children:(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400",children:"Lobe Scores"})}),(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-white/[0.05]",children:[(0,t.jsx)("th",{className:"px-4 py-2 text-left text-[10px] text-gray-500 uppercase tracking-wider",children:"Lobe"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Overall"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Token Savings"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Quality +"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Coverage"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Badge"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Marketplace"})]})}),(0,t.jsx)("tbody",{children:g.map((e,s)=>(0,t.jsxs)("tr",{className:`border-b border-white/[0.03] ${s%2==0?"":"bg-white/[0.01]"}`,children:[(0,t.jsxs)("td",{className:"px-4 py-2",children:[(0,t.jsx)("div",{className:"text-gray-300",children:e.lobe_name}),(0,t.jsx)("div",{className:"text-[9px] text-gray-600 font-mono",children:e.lobe_id})]}),(0,t.jsx)("td",{className:"px-4 py-2 text-right text-purple-400 tabular-nums font-medium",children:null!=e.overall_score?e.overall_score.toFixed(2):"—"}),(0,t.jsx)("td",{className:"px-4 py-2 text-right tabular-nums",style:{color:(e.token_savings??0)>0?"#22c55e":"#6b7280"},children:null!=e.token_savings?`${e.token_savings>0?"+":""}${e.token_savings.toFixed(1)}%`:"—"}),(0,t.jsx)("td",{className:"px-4 py-2 text-right tabular-nums",style:{color:(e.quality_improvement??0)>0?"#22c55e":"#6b7280"},children:null!=e.quality_improvement?`${e.quality_improvement>0?"+":""}${e.quality_improvement.toFixed(3)}`:"—"}),(0,t.jsx)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:null!=e.coverage_score?e.coverage_score.toFixed(2):"—"}),(0,t.jsx)("td",{className:"px-4 py-2 text-right",children:(0,t.jsx)(Z,{tier:e.badge_tier})}),(0,t.jsx)("td",{className:"px-4 py-2 text-right",children:e.marketplace_ready?(0,t.jsx)("span",{className:"text-[9px] px-1.5 py-0.5 rounded border bg-green-500/10 text-green-400 border-green-500/20",children:"Ready"}):(0,t.jsx)("span",{className:"text-[9px] text-gray-600",children:"—"})})]},e.id))})]})})]}),u.length>0&&(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-4 py-3 border-b border-white/[0.05] flex items-center justify-between",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400",children:"Task Results"}),(0,t.jsxs)("span",{className:"text-[10px] text-gray-600",children:[u.length," tasks"]})]}),(0,t.jsxs)("div",{className:"px-4 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-1 mb-1",children:[(0,t.jsx)("span",{className:"w-3.5"}),(0,t.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider flex-1",children:"Task ID"}),(0,t.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider w-20",children:"Category"}),(0,t.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider w-12",children:"Diff"}),(0,t.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider w-16 text-right",children:"Token %"}),(0,t.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider w-20 text-right",children:"Quality w/w"})]}),(0,t.jsx)("div",{className:"space-y-1",children:u.map(e=>(0,t.jsx)(X,{result:e},e.id))})]})]})]})}let el=(0,a.default)(()=>e.A(830077).then(e=>({default:e.EntityGraphView})),{loadableGenerated:{modules:[756409]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center text-gray-500 text-sm",children:"Loading graph..."})});function ei(){let[e,a]=(0,s.useState)("dashboard"),[l,i]=(0,s.useState)(null);(0,s.useEffect)(()=>{fetch((0,r.api)("/api/cortex/status")).then(e=>e.json()).then(i).catch(()=>{})},[]);let n=l?Object.values(l.layers||{}).reduce((e,t)=>e+(t.count||0),0):0;return(0,t.jsxs)("div",{className:"flex flex-col h-screen bg-gray-950",children:[(0,t.jsxs)("div",{className:"flex items-center border-b border-white/5 px-4 shrink-0",children:[(0,t.jsx)("div",{className:"flex",children:[{key:"dashboard",label:"Dashboard"},{key:"graph",label:"Graph"},{key:"knowledge",label:"Knowledge"},{key:"curation",label:"Curation"},{key:"marketplace",label:"Marketplace"},{key:"benchmark",label:"Benchmark"},{key:"settings",label:"Settings"}].map(s=>(0,t.jsx)("button",{onClick:()=>a(s.key),className:`px-5 py-3 text-sm font-medium transition-colors border-b-2 ${e===s.key?"text-purple-400 border-purple-400":"text-gray-500 border-transparent hover:text-gray-300"}`,children:s.label},s.key))}),(0,t.jsxs)("div",{className:"ml-auto text-xs text-gray-600",children:[n," knowledge units"]})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:["dashboard"===e&&(0,t.jsx)(N,{}),"graph"===e&&(0,t.jsx)(el,{}),"knowledge"===e&&(0,t.jsx)(h,{}),"curation"===e&&(0,t.jsx)(F,{}),"marketplace"===e&&(0,t.jsx)(M,{}),"benchmark"===e&&(0,t.jsx)(er,{}),"settings"===e&&(0,t.jsx)("div",{className:"p-6 max-w-2xl space-y-8",children:(0,t.jsx)(u.CortexSettings,{})})]})]})}e.s(["default",()=>ei],365061)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,365061,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(770703),r=e.i(209165),l=e.i(555436),i=e.i(664659),n=e.i(655900),c=e.i(727612),d=e.i(878894);let x={decision:"bg-blue-500/20 text-blue-400",preference:"bg-pink-500/20 text-pink-400",pattern:"bg-green-500/20 text-green-400",error_fix:"bg-amber-500/20 text-amber-400",context:"bg-gray-500/20 text-gray-400",code_pattern:"bg-cyan-500/20 text-cyan-400",command:"bg-orange-500/20 text-orange-400",conversation:"bg-slate-500/20 text-slate-400",summary:"bg-violet-500/20 text-violet-400"},o={public:"bg-green-500/20 text-green-400",internal:"bg-indigo-500/20 text-indigo-400",restricted:"bg-amber-500/20 text-amber-400",confidential:"bg-red-500/20 text-red-400"},p={debugging:"text-red-400",architecture:"text-blue-400",onboarding:"text-green-400",policy:"text-purple-400","how-to":"text-amber-400",review:"text-pink-400",security:"text-red-500",general:"text-gray-400"};function m({unit:e,onDelete:s,compact:a}){var l;let i,n=x[e.type]||x.context,p=(l=e.created,0===(i=Math.floor((Date.now()-new Date(l).getTime())/864e5))?"today":1===i?"1d ago":i<30?`${i}d ago`:i<365?`${Math.floor(i/30)}mo ago`:`${Math.floor(i/365)}y ago`),m=(e.contradiction_refs?.length??0)>0,h=e.evidence_score??e.confidence,u=null!=e.evidence_score?`${h.toFixed(2)} evidence`:`${Math.round(100*h)}%`,g=async()=>{await fetch((0,r.api)(`/api/cortex/knowledge/${e.id}`),{method:"DELETE"}),s?.(e.id)};return(0,t.jsxs)("div",{className:"group border border-white/5 rounded-lg p-3 hover:border-white/10 transition-colors",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-wrap",children:[(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${n}`,children:e.type.replace("_"," ")}),e.sensitivity&&(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${o[e.sensitivity]||o.internal}`,children:e.sensitivity}),e.scope&&(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded font-medium bg-purple-500/10 text-purple-400",children:e.scope.level}),(e.stale_score??0)>.3&&(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded font-medium bg-amber-500/20 text-amber-400",children:"stale"}),m&&(0,t.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 rounded font-medium bg-amber-500/20 text-amber-400 flex items-center gap-0.5",children:[(0,t.jsx)(d.AlertTriangle,{className:"w-2.5 h-2.5"})," contested"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[10px] text-gray-500 shrink-0",children:[(0,t.jsx)("span",{children:p}),s&&(0,t.jsx)("button",{onClick:g,className:"opacity-0 group-hover:opacity-100 transition-opacity text-red-400 hover:text-red-300",children:(0,t.jsx)(c.Trash2,{className:"w-3 h-3"})})]})]}),(0,t.jsx)("p",{className:"text-xs text-gray-300 mt-1.5 leading-relaxed line-clamp-3",children:e.text}),!a&&e.origin&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-1.5 text-[10px] text-gray-500 flex-wrap",children:[(0,t.jsxs)("span",{children:["by ",e.origin.creator_entity_id.replace("person-","")]}),(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:["via ",e.origin.source_type.replace("_"," ")]}),(e.corroborations??0)>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{className:"text-green-400",children:[e.corroborations," corr."]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,t.jsx)("div",{className:"flex-1 h-1 bg-white/5 rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:"h-full bg-purple-500/50 rounded-full",style:{width:`${Math.round(100*h)}%`}})}),(0,t.jsx)("span",{className:"text-[10px] text-gray-500 tabular-nums",children:u})]})]})}function h(){let[e,a]=(0,s.useState)(""),[c,d]=(0,s.useState)([]),[o,h]=(0,s.useState)(!1),[u,g]=(0,s.useState)(!1),[b,j]=(0,s.useState)(""),[y,v]=(0,s.useState)(null),[N,f]=(0,s.useState)(!1),w=async()=>{if(b.trim()){f(!0);try{let e=await fetch((0,r.api)(`/api/cortex/context?q=${encodeURIComponent(b)}&limit=5`));e.ok&&v(await e.json())}catch{}f(!1)}},k=(0,s.useCallback)(async e=>{h(!0);try{let t=new URLSearchParams({limit:"30"});e&&t.set("q",e);let s=await fetch((0,r.api)(`/api/cortex/search?${t}`));s.ok&&d((await s.json()).results||[])}catch{}h(!1)},[]);(0,s.useEffect)(()=>{k()},[k]);let _=e=>d(t=>t.filter(t=>t.id!==e));return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsx)("div",{className:"p-4 border-b border-white/5",children:(0,t.jsxs)("div",{className:"relative max-w-md",children:[(0,t.jsx)(l.Search,{className:"absolute left-3 top-2.5 w-4 h-4 text-gray-500"}),(0,t.jsx)("input",{value:e,onChange:e=>a(e.target.value),onKeyDown:t=>"Enter"===t.key&&k(e.trim()||void 0),placeholder:"Search knowledge...",className:"w-full pl-9 pr-4 py-2 text-sm bg-white/5 border border-white/10 rounded-lg text-gray-300 placeholder-gray-600 focus:outline-none focus:border-purple-500/50"})]})}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,t.jsxs)("div",{className:"max-w-2xl space-y-2",children:[o&&(0,t.jsx)("p",{className:"text-sm text-gray-500 text-center py-8",children:"Loading..."}),!o&&0===c.length&&(0,t.jsx)("p",{className:"text-sm text-gray-500 text-center py-8",children:"No knowledge found"}),c.map(e=>(0,t.jsx)(m,{unit:e,onDelete:_},e.id)),(0,t.jsxs)("div",{className:"border-t border-white/5 mt-4 pt-4",children:[(0,t.jsxs)("button",{onClick:()=>g(!u),className:"flex items-center gap-2 text-xs text-gray-500 hover:text-gray-300 mb-3",children:[u?(0,t.jsx)(n.ChevronUp,{className:"w-3 h-3"}):(0,t.jsx)(i.ChevronDown,{className:"w-3 h-3"}),"Query Analyzer"]}),u&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex gap-3 mb-4",children:[(0,t.jsxs)("div",{className:"flex-1 relative",children:[(0,t.jsx)(l.Search,{className:"absolute left-3 top-2.5 w-4 h-4 text-gray-500"}),(0,t.jsx)("input",{value:b,onChange:e=>j(e.target.value),onKeyDown:e=>"Enter"===e.key&&w(),placeholder:"Enter a query to analyze...",className:"w-full pl-9 pr-4 py-2 text-sm bg-white/5 border border-white/10 rounded-lg text-gray-300 placeholder-gray-600 focus:outline-none focus:border-purple-500/50"})]}),(0,t.jsx)("button",{onClick:w,disabled:N,className:"px-5 py-2 text-sm bg-purple-600 hover:bg-purple-500 text-white rounded-lg disabled:opacity-50",children:N?"Analyzing...":"Analyze"})]}),!y&&!N&&(0,t.jsx)("p",{className:"text-sm text-gray-600 text-center py-8",children:"Enter a query to see how the Context Engine processes it"}),y&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/5 rounded-lg p-3",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-600 uppercase mb-1",children:"Intent"}),(0,t.jsx)("div",{className:`text-lg font-semibold ${p[y.intent?.intent]||"text-gray-400"}`,children:y.intent?.intent||"?"}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-600",children:["confidence: ",(y.intent?.confidence??0).toFixed(2)]})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/5 rounded-lg p-3",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-600 uppercase mb-1",children:"Entities"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[(y.entities||[]).map((e,s)=>(0,t.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 bg-white/5 border border-white/10 rounded text-gray-300",children:[e.entity?.type,":",e.entity?.name]},s)),(!y.entities||0===y.entities.length)&&(0,t.jsx)("span",{className:"text-[10px] text-gray-600",children:"none detected"})]})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/5 rounded-lg p-3",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-600 uppercase mb-1",children:"Timing"}),(0,t.jsxs)("div",{className:"text-lg font-semibold text-green-400",children:[y.timing?.totalMs??"?","ms"]}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-600",children:["intent ",y.timing?.intentMs,"ms · search ",y.timing?.searchMs,"ms"]})]})]}),(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("div",{className:"text-[10px] text-gray-600 uppercase mb-2",children:["Results (",(y.results||[]).length,")"]}),(0,t.jsx)("div",{className:"space-y-1",children:(y.results||[]).map((e,s)=>(0,t.jsxs)("div",{className:"flex items-center gap-2 bg-white/[0.02] border border-white/5 rounded-lg px-3 py-2",children:[(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${x[e.type]||x.context}`,children:e.type?.replace("_"," ")}),(0,t.jsx)("span",{className:"text-xs text-gray-300 truncate flex-1",children:e.text}),(0,t.jsx)("span",{className:"text-[10px] text-gray-600 tabular-nums shrink-0",children:(e.relevance_score??0).toFixed(3)})]},s))})]})]})]})]})]})})]})}var u=e.i(349889);function g(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<0x40000000?`${(e/1048576).toFixed(1)} MB`:`${(e/0x40000000).toFixed(2)} GB`}function b({items:e,maxValue:s}){return(0,t.jsx)("div",{className:"space-y-1.5",children:e.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-[10px] text-gray-500 w-24 text-right truncate",title:e.label,children:e.label}),(0,t.jsx)("div",{className:"flex-1 h-3 bg-white/[0.03] rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.max(2,e.value/Math.max(s,1)*100)}%`,backgroundColor:e.color}})}),(0,t.jsx)("span",{className:"text-[10px] text-gray-400 w-14 text-right tabular-nums",children:e.value.toLocaleString()})]},e.label))})}function j({label:e,value:s,sub:a,color:r}){return(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-3",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-1",children:e}),(0,t.jsx)("div",{className:`text-lg font-semibold tabular-nums ${r||"text-white"}`,children:s}),a&&(0,t.jsx)("div",{className:"text-[10px] text-gray-600 mt-0.5",children:a})]})}let y=["#7c3aed","#06b6d4","#10b981","#f59e0b","#ef4444","#8b5cf6","#14b8a6","#22c55e","#eab308","#f97316"],v={decision:"#3b82f6",pattern:"#22c55e",preference:"#ec4899",error_fix:"#f59e0b",context:"#6b7280",code_pattern:"#06b6d4",command:"#f97316",conversation:"#64748b",summary:"#8b5cf6"};function N(){let[e,a]=(0,s.useState)(null),[l,i]=(0,s.useState)(!0);if((0,s.useEffect)(()=>{fetch((0,r.api)("/api/cortex/status")).then(e=>e.json()).then(e=>{e.enabled&&a(e)}).catch(()=>{}).finally(()=>i(!1))},[]),l)return(0,t.jsx)("div",{className:"p-6 text-sm text-gray-500",children:"Loading dashboard..."});if(!e)return(0,t.jsx)("div",{className:"p-6 text-sm text-gray-500",children:"Cortex is not active."});let n=Object.entries(e.lobes).sort((e,t)=>t[1].count-e[1].count),c=Math.max(...n.map(([,e])=>e.count),1),d=Math.max(...n.map(([,e])=>e.sizeBytes),1),x=e.usage,p=x?.distillation;return(0,t.jsxs)("div",{className:"p-6 max-w-4xl space-y-6",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,t.jsx)(j,{label:"Knowledge Units",value:e.totalCount.toLocaleString(),sub:`across ${n.length} lobes`,color:"text-purple-400"}),(0,t.jsx)(j,{label:"Storage",value:g(e.totalSizeBytes),sub:`${e.embedding_provider} (${e.embedding_dimensions}d)`}),(0,t.jsx)(j,{label:"Coverage",value:e.quality?e.quality.coverage_score.toFixed(2):"—",sub:e.quality?`${Math.round(100*e.quality.coverage_score)}% distilled`:"no data",color:e.quality?e.quality.coverage_score>.7?"text-green-400":e.quality.coverage_score>.3?"text-amber-400":"text-red-400":"text-gray-500"}),(0,t.jsx)(j,{label:"Distillation",value:p?`$${p.estimated_cost_usd.toFixed(2)}`:"Off",sub:p?`${p.calls.toLocaleString()} calls`:e.distillation?"No API key":"Disabled",color:p?"text-amber-400":"text-gray-500"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Knowledge by Lobe"}),(0,t.jsx)(b,{items:n.map(([e,t],s)=>({label:t.label||e,value:t.count,color:y[s%y.length]})),maxValue:c})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Storage by Lobe"}),(0,t.jsx)(b,{items:n.map(([e,t],s)=>({label:t.label||e,value:t.sizeBytes,color:y[s%y.length]})),maxValue:d}),(0,t.jsxs)("div",{className:"mt-2 flex justify-between text-[10px] text-gray-600",children:[(0,t.jsxs)("span",{children:["Smallest: ",g(Math.min(...n.map(([,e])=>e.sizeBytes)))]}),(0,t.jsxs)("span",{children:["Total: ",g(e.totalSizeBytes)]})]})]})]}),e.quality&&(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Type Distribution"}),(0,t.jsx)(b,{items:Object.entries(e.quality.type_distribution).sort((e,t)=>t[1]-e[1]).map(([e,t])=>({label:e.replace("_"," "),value:t,color:v[e]||"#7c3aed"})),maxValue:Math.max(...Object.values(e.quality.type_distribution),1)})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Lobe Health"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex justify-between text-[11px]",children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Stale units"}),(0,t.jsx)("span",{className:e.quality.stale_count>10?"text-amber-400":"text-gray-300",children:e.quality.stale_count})]}),(0,t.jsxs)("div",{className:"flex justify-between text-[11px]",children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Avg confidence"}),(0,t.jsx)("span",{className:"text-gray-300",children:e.quality.avg_confidence.toFixed(2)})]}),e.quality.top_accessed.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 mb-1",children:"Top accessed"}),(0,t.jsxs)("div",{className:"text-[11px] text-gray-400 truncate",children:["“",e.quality.top_accessed[0].text,"”"]})]}),e.quality.sensitivity_counts&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 mb-1",children:"Sensitivity"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:Object.entries(e.quality.sensitivity_counts).map(([e,s])=>(0,t.jsxs)("span",{className:`text-[9px] px-1.5 py-0.5 rounded ${o[e]||o.internal}`,children:[s," ",e]},e))})]})]})]})]}),p&&(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Distillation Activity"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500",children:"API Calls"}),(0,t.jsx)("div",{className:"text-sm font-medium text-white tabular-nums",children:p.calls.toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500",children:"Input Tokens"}),(0,t.jsxs)("div",{className:"text-sm font-medium text-white tabular-nums",children:[(p.input_tokens/1e3).toFixed(1),"K"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500",children:"Output Tokens"}),(0,t.jsxs)("div",{className:"text-sm font-medium text-white tabular-nums",children:[(p.output_tokens/1e3).toFixed(1),"K"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500",children:"Estimated Cost"}),(0,t.jsxs)("div",{className:"text-sm font-medium text-amber-400 tabular-nums",children:["$",p.estimated_cost_usd.toFixed(4)]})]})]}),p.last_updated&&(0,t.jsxs)("div",{className:"mt-2 text-[10px] text-gray-600",children:["Last distillation: ",new Date(p.last_updated).toLocaleString()]}),x.by_model&&Object.keys(x.by_model).length>0&&(0,t.jsxs)("div",{className:"mt-3 border-t border-white/[0.04] pt-3",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 mb-2",children:"By Model"}),Object.entries(x.by_model).map(([e,s])=>(0,t.jsxs)("div",{className:"flex items-center justify-between text-[10px]",children:[(0,t.jsx)("span",{className:"text-gray-400 font-mono",children:e}),(0,t.jsxs)("span",{className:"text-gray-500",children:[s.calls," calls · $",s.estimated_cost_usd.toFixed(4)]})]},e))]})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"System"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-1.5 text-[11px]",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Status"}),(0,t.jsx)("span",{className:"text-green-400",children:e.status})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Embedding"}),(0,t.jsxs)("span",{className:"text-gray-300",children:[e.embedding_provider," (",e.embedding_dimensions,"d)"]})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Distillation"}),(0,t.jsx)("span",{className:e.distillation?"text-green-400":"text-gray-600",children:e.distillation?"Enabled":"Disabled"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Lobes"}),(0,t.jsxs)("span",{className:"text-gray-300",children:[n.length," active"]})]})]})]})]})}var f=e.i(569074),w=e.i(217923),k=e.i(16715),_=e.i(475254);let C=(0,_.default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);var S=e.i(531278);let $=[{id:"seed",label:"Seed",icon:(0,t.jsx)(f.Upload,{className:"w-3.5 h-3.5"})},{id:"assess",label:"Assess",icon:(0,t.jsx)(w.BarChart3,{className:"w-3.5 h-3.5"})},{id:"review",label:"Review",icon:(0,t.jsx)(l.Search,{className:"w-3.5 h-3.5"})},{id:"refine",label:"Refine",icon:(0,t.jsx)(k.RefreshCw,{className:"w-3.5 h-3.5"})},{id:"publish",label:"Publish",icon:(0,t.jsx)(C,{className:"w-3.5 h-3.5"})}],R={decision:"#3b82f6",pattern:"#22c55e",preference:"#ec4899",error_fix:"#f59e0b",context:"#6b7280",code_pattern:"#06b6d4",command:"#f97316",conversation:"#64748b",summary:"#8b5cf6"};function F(){let e,[a,i]=(0,s.useState)([]),[n,c]=(0,s.useState)(""),[d,o]=(0,s.useState)("seed"),[p,m]=(0,s.useState)(""),[h,u]=(0,s.useState)(""),[g,b]=(0,s.useState)("auto"),[j,y]=(0,s.useState)(""),[v,N]=(0,s.useState)(!0),[_,F]=(0,s.useState)(!1),[T,q]=(0,s.useState)(null),[D,L]=(0,s.useState)(!1),[M,P]=(0,s.useState)(null),[A,E]=(0,s.useState)(""),[B,O]=(0,s.useState)("25"),[K,z]=(0,s.useState)(!1),[I,Q]=(0,s.useState)(null),[U,W]=(0,s.useState)(""),[V,G]=(0,s.useState)({decisions:!0,patterns:!0,preferences:!0,error_fixes:!0}),[H,J]=(0,s.useState)(!1),[Y,X]=(0,s.useState)(null),[Z,ee]=(0,s.useState)(""),[et,es]=(0,s.useState)(""),[ea,er]=(0,s.useState)(""),[el,ei]=(0,s.useState)(""),[en,ec]=(0,s.useState)("1.0.0"),[ed,ex]=(0,s.useState)("MIT"),[eo,ep]=(0,s.useState)(!1),[em,eh]=(0,s.useState)(null),eu=(0,s.useCallback)(()=>{q(null),P(null),Q(null),X(null),eh(null),m("")},[]);(0,s.useEffect)(()=>{fetch((0,r.api)("/api/workspaces")).then(e=>e.json()).then(e=>{i(e),e.length>0&&c(e[0].id)}).catch(()=>{})},[]);let eg=async()=>{if(h.trim()&&n){F(!0),m(""),q(null);try{let e=await fetch((0,r.api)("/api/cortex/curation/seed"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:h,format:g,source_ref:j||void 0,workspace_id:n,distill:v})}),t=await e.json();if(!e.ok)throw Error(t.error||t.message||"Seed failed");q(t)}catch(e){m(e instanceof Error?e.message:"Seed failed")}finally{F(!1)}}},eb=async()=>{if(n){L(!0),m(""),P(null);try{let e=await fetch((0,r.api)(`/api/cortex/curation/assess?workspace_id=${encodeURIComponent(n)}`)),t=await e.json();if(!e.ok)throw Error(t.error||t.message||"Assessment failed");P(t)}catch(e){m(e instanceof Error?e.message:"Assessment failed")}finally{L(!1)}}},ej=async()=>{if(n&&A.trim()){z(!0),m(""),Q(null);try{let e=new URLSearchParams({workspace_id:n,topic:A.trim(),limit:B}),t=await fetch((0,r.api)(`/api/cortex/curation/review?${e}`)),s=await t.json();if(!t.ok)throw Error(s.error||s.message||"Review failed");Q(s)}catch(e){m(e instanceof Error?e.message:"Review failed")}finally{z(!1)}}},ey=async()=>{if(n){J(!0),m(""),X(null);try{let e=Object.keys(V).filter(e=>V[e]),t=await fetch((0,r.api)("/api/cortex/curation/refine"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace_id:n,domain_context:U||void 0,types:e})}),s=await t.json();if(!t.ok)throw Error(s.error||s.message||"Refine failed");X(s)}catch(e){m(e instanceof Error?e.message:"Refine failed")}finally{J(!1)}}},ev=async()=>{if(n&&Z.trim()){ep(!0),m(""),eh(null);try{let e=await fetch((0,r.api)("/api/cortex/curation/publish"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace_id:n,name:Z,author:et||void 0,description:ea||void 0,tags:el?el.split(",").map(e=>e.trim()).filter(Boolean):[],version:en,license:ed})}),t=await e.json();if(!e.ok)throw Error(t.error||t.message||"Publish failed");eh(t)}catch(e){m(e instanceof Error?e.message:"Publish failed")}finally{ep(!1)}}},eN="w-full px-3 py-2 text-sm bg-white/5 border border-white/10 rounded-lg text-gray-300 placeholder-gray-600 focus:outline-none focus:border-purple-500/50",ef="text-[11px] text-gray-500 mb-1 block",ew="bg-white/[0.02] border border-white/[0.06] rounded-lg p-4";return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"px-4 pt-4 pb-3 border-b border-white/5",children:[(0,t.jsx)("label",{className:ef,children:"Workspace"}),(0,t.jsxs)("select",{value:n,onChange:e=>{c(e.target.value),eu()},className:`${eN} max-w-xs`,children:[0===a.length&&(0,t.jsx)("option",{value:"",disabled:!0,children:"No workspaces found"}),a.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,t.jsx)("div",{className:"px-4 py-3 border-b border-white/5",children:(0,t.jsx)("div",{className:"flex items-center",children:$.map((e,s)=>(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsxs)("button",{onClick:()=>{o(e.id),eu()},className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium border transition-colors ${d===e.id?"bg-purple-500/20 border-purple-500/30 text-purple-400":"bg-white/[0.03] border-white/[0.06] text-gray-500 hover:text-gray-300 hover:bg-white/[0.06]"}`,children:[e.icon,e.label]}),s<$.length-1&&(0,t.jsx)("div",{className:"w-8 h-px bg-white/[0.06]"})]},e.id))})}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,t.jsxs)("div",{className:"max-w-2xl space-y-4",children:[p&&(0,t.jsx)("div",{className:"bg-red-500/10 border border-red-500/20 text-red-400 rounded-lg px-4 py-2.5 text-sm",children:p}),"seed"===d&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Document content"}),(0,t.jsx)("textarea",{value:h,onChange:e=>u(e.target.value),placeholder:"Paste document content here...",rows:8,className:eN})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Format"}),(0,t.jsxs)("select",{value:g,onChange:e=>b(e.target.value),className:eN,children:[(0,t.jsx)("option",{value:"auto",children:"Auto-detect"}),(0,t.jsx)("option",{value:"markdown",children:"Markdown"}),(0,t.jsx)("option",{value:"plaintext",children:"Plain text"}),(0,t.jsx)("option",{value:"csv",children:"CSV"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Source reference"}),(0,t.jsx)("input",{value:j,onChange:e=>y(e.target.value),placeholder:"e.g. docs/guide.md",className:eN})]})]}),(0,t.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[(0,t.jsx)("input",{type:"checkbox",checked:v,onChange:e=>N(e.target.checked),className:"rounded border-white/20 bg-white/5 accent-purple-500"}),(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"Distill after seeding"})]}),(0,t.jsxs)("button",{onClick:eg,disabled:_||!h.trim()||!n,className:"flex items-center gap-2 px-4 py-2 text-sm bg-purple-600 hover:bg-purple-500 text-white rounded-lg disabled:opacity-50 transition-colors",children:[_?(0,t.jsx)(S.Loader2,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(f.Upload,{className:"w-4 h-4"}),"Seed Documents"]}),T&&(0,t.jsxs)("div",{className:ew,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-gray-400 mb-3",children:"Seed Results"}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Chunks Created"}),(0,t.jsx)("div",{className:"text-lg font-semibold text-green-400 tabular-nums",children:T.chunksCreated})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Chunks Skipped"}),(0,t.jsx)("div",{className:"text-lg font-semibold text-amber-400 tabular-nums",children:T.chunksSkipped})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Errors"}),(0,t.jsx)("div",{className:`text-lg font-semibold tabular-nums ${T.errors.length>0?"text-red-400":"text-gray-500"}`,children:T.errors.length})]})]}),T.errors.length>0&&(0,t.jsx)("div",{className:"mt-3 space-y-1",children:T.errors.map((e,s)=>(0,t.jsx)("div",{className:"text-xs text-red-400/80",children:e},s))})]})]}),"assess"===d&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:eb,disabled:D||!n,className:"flex items-center gap-2 px-4 py-2 text-sm bg-purple-600 hover:bg-purple-500 text-white rounded-lg disabled:opacity-50 transition-colors",children:[D?(0,t.jsx)(S.Loader2,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(w.BarChart3,{className:"w-4 h-4"}),"Run Assessment"]}),M&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsxs)("div",{className:ew,children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Coverage Score"}),(0,t.jsx)("div",{className:`text-2xl font-semibold tabular-nums ${(e=M.coverage_score)>.7?"text-green-400":e>.3?"text-amber-400":"text-red-400"}`,children:M.coverage_score.toFixed(2)}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-600 mt-0.5",children:[Math.round(100*M.coverage_score),"% covered"]})]}),(0,t.jsxs)("div",{className:ew,children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Total Units"}),(0,t.jsx)("div",{className:"text-2xl font-semibold text-white tabular-nums",children:M.total_units.toLocaleString()})]}),(0,t.jsxs)("div",{className:ew,children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Stale Count"}),(0,t.jsx)("div",{className:`text-2xl font-semibold tabular-nums ${M.stale_count>10?"text-amber-400":"text-gray-300"}`,children:M.stale_count})]})]}),M.type_distribution&&Object.keys(M.type_distribution).length>0&&(0,t.jsxs)("div",{className:ew,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-gray-400 mb-3",children:"Type Distribution"}),(0,t.jsx)("div",{className:"space-y-1.5",children:Object.entries(M.type_distribution).sort((e,t)=>t[1]-e[1]).map(([e,s])=>{let a=Math.max(...Object.values(M.type_distribution),1);return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-[10px] text-gray-500 w-24 text-right truncate",children:e.replace("_"," ")}),(0,t.jsx)("div",{className:"flex-1 h-3 bg-white/[0.03] rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.max(2,s/a*100)}%`,backgroundColor:R[e]||"#7c3aed"}})}),(0,t.jsx)("span",{className:"text-[10px] text-gray-400 w-10 text-right tabular-nums",children:s})]},e)})})]})]})]}),"review"===d&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:ef,children:"Topic filter"}),(0,t.jsx)("input",{value:A,onChange:e=>E(e.target.value),onKeyDown:e=>"Enter"===e.key&&ej(),placeholder:"Filter by topic (optional)",className:eN})]}),(0,t.jsxs)("div",{className:"w-28",children:[(0,t.jsx)("label",{className:ef,children:"Limit"}),(0,t.jsxs)("select",{value:B,onChange:e=>O(e.target.value),className:eN,children:[(0,t.jsx)("option",{value:"10",children:"10"}),(0,t.jsx)("option",{value:"25",children:"25"}),(0,t.jsx)("option",{value:"50",children:"50"})]})]})]}),(0,t.jsxs)("button",{onClick:ej,disabled:K||!n||!A.trim(),className:"flex items-center gap-2 px-4 py-2 text-sm bg-purple-600 hover:bg-purple-500 text-white rounded-lg disabled:opacity-50 transition-colors",children:[K?(0,t.jsx)(S.Loader2,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(l.Search,{className:"w-4 h-4"}),"Review"]}),I&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"text-[11px] text-gray-500",children:[I.total_matches," match",1!==I.total_matches?"es":""," for “",I.topic,"”"]}),Object.entries(I.by_type).map(([e,s])=>(0,t.jsxs)("details",{open:!0,className:ew,children:[(0,t.jsxs)("summary",{className:"flex items-center gap-2 cursor-pointer list-none",children:[(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${x[e]||x.context}`,children:e.replace("_"," ")}),(0,t.jsxs)("span",{className:"text-xs text-gray-500",children:[s.length," unit",1!==s.length?"s":""]})]}),(0,t.jsx)("div",{className:"mt-3 space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.04] rounded px-3 py-2",children:[(0,t.jsx)("div",{className:"text-xs text-gray-300 leading-relaxed",children:e.text}),(0,t.jsxs)("div",{className:"mt-1 text-[10px] text-gray-600",children:["confidence: ",e.confidence?.toFixed(2)," · similarity: ",e.similarity?.toFixed(3)]})]},s))})]},e))]})]}),"refine"===d&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"bg-amber-500/10 border border-amber-500/20 text-amber-400 rounded-lg px-4 py-2.5 text-xs leading-relaxed",children:"Refine uses LLM distillation and requires an API key configured in Cortex settings. Without a key, refinement will run in passthrough mode."}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Domain context"}),(0,t.jsx)("textarea",{value:U,onChange:e=>W(e.target.value),placeholder:"Describe the domain or project context to guide distillation...",rows:4,className:eN})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Distillation passes"}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-2",children:Object.keys(V).map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[(0,t.jsx)("input",{type:"checkbox",checked:V[e],onChange:t=>G(s=>({...s,[e]:t.target.checked})),className:"rounded border-white/20 bg-white/5 accent-purple-500"}),(0,t.jsx)("span",{className:"text-xs text-gray-400 capitalize",children:e.replace("_"," ")})]},e))})]}),(0,t.jsxs)("button",{onClick:ey,disabled:H||!n,className:"flex items-center gap-2 px-4 py-2 text-sm bg-purple-600 hover:bg-purple-500 text-white rounded-lg disabled:opacity-50 transition-colors",children:[H?(0,t.jsx)(S.Loader2,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(k.RefreshCw,{className:"w-4 h-4"}),"Refine Lobe"]}),Y&&(0,t.jsxs)("div",{className:ew,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-gray-400 mb-3",children:"Refine Results"}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Source Units"}),(0,t.jsx)("div",{className:"text-lg font-semibold text-white tabular-nums",children:Y.source_units_found})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Purged"}),(0,t.jsx)("div",{className:"text-lg font-semibold text-amber-400 tabular-nums",children:Y.distilled_purged})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"New Units"}),(0,t.jsx)("div",{className:"text-lg font-semibold text-green-400 tabular-nums",children:Y.new_units_created})]})]})]})]}),"publish"===d&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Package name *"}),(0,t.jsx)("input",{value:Z,onChange:e=>ee(e.target.value),placeholder:"my-knowledge-pack",className:eN})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Author"}),(0,t.jsx)("input",{value:et,onChange:e=>es(e.target.value),placeholder:"Your name or org",className:eN})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Description"}),(0,t.jsx)("textarea",{value:ea,onChange:e=>er(e.target.value),placeholder:"Describe the knowledge pack...",rows:3,className:eN})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Tags (comma-separated)"}),(0,t.jsx)("input",{value:el,onChange:e=>ei(e.target.value),placeholder:"e.g. typescript, react, patterns",className:eN})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"Version"}),(0,t.jsx)("input",{value:en,onChange:e=>ec(e.target.value),placeholder:"1.0.0",className:eN})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:ef,children:"License"}),(0,t.jsxs)("select",{value:ed,onChange:e=>ex(e.target.value),className:eN,children:[(0,t.jsx)("option",{value:"MIT",children:"MIT"}),(0,t.jsx)("option",{value:"Apache-2.0",children:"Apache 2.0"}),(0,t.jsx)("option",{value:"GPL-3.0",children:"GPL 3.0"}),(0,t.jsx)("option",{value:"BSD-3-Clause",children:"BSD 3-Clause"}),(0,t.jsx)("option",{value:"CC-BY-4.0",children:"CC BY 4.0"}),(0,t.jsx)("option",{value:"Proprietary",children:"Proprietary"})]})]})]}),(0,t.jsxs)("button",{onClick:ev,disabled:eo||!Z.trim()||!n,className:"flex items-center gap-2 px-4 py-2 text-sm bg-purple-600 hover:bg-purple-500 text-white rounded-lg disabled:opacity-50 transition-colors",children:[eo?(0,t.jsx)(S.Loader2,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(C,{className:"w-4 h-4"}),"Publish to Marketplace"]}),em&&(0,t.jsxs)("div",{className:ew,children:[em.quality_warning&&(0,t.jsx)("div",{className:"mb-3 bg-amber-500/10 border border-amber-500/20 text-amber-400 rounded px-3 py-2 text-xs",children:em.quality_warning}),(0,t.jsx)("div",{className:"text-xs font-medium text-gray-400 mb-3",children:"Published"}),em.output_path&&(0,t.jsxs)("div",{className:"mb-2",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Output Path"}),(0,t.jsx)("div",{className:"text-xs text-gray-300 font-mono break-all",children:em.output_path})]}),em.pii_scrub&&(0,t.jsxs)("div",{className:"mt-2 pt-2 border-t border-white/[0.06]",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"PII Scrub"}),(0,t.jsxs)("div",{className:"flex gap-4 text-[11px] text-gray-400",children:[(0,t.jsxs)("span",{children:[em.pii_scrub.records_checked.toLocaleString()," records checked"]}),(0,t.jsxs)("span",{children:[em.pii_scrub.fields_scrubbed.toLocaleString()," fields scrubbed"]})]})]})]})]})]})})]})}var T=e.i(75505);function q({filename:e,manifest:a,onImport:r}){let[l,c]=(0,s.useState)(!1),d=a.marketplace??{},x=d.name||e,o=a.version||d.version||"0.0.0",p=d.author||a.author||"Unknown",m=d.description||a.description||"",h=d.tags||a.tags||[],u=d.license||a.license||"",g="number"==typeof d.coverage_score?d.coverage_score:-1,b="number"==typeof a.unit_count?a.unit_count:Array.isArray(a.units)?a.units.length:0,j=d.preview||a.preview||"",y=g<0?"N/A":`${Math.round(100*g)}%`;return(0,t.jsxs)("div",{className:"border border-white/10 rounded-xl p-4 bg-white/[0.02] flex flex-col gap-3 hover:border-white/20 transition-colors",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"shrink-0 w-9 h-9 rounded-lg bg-purple-500/10 flex items-center justify-center",children:(0,t.jsx)(C,{className:"w-4 h-4 text-purple-400"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-gray-100 truncate",children:x}),(0,t.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-white/5 text-gray-400 font-mono shrink-0",children:["v",o]})]}),(0,t.jsx)("p",{className:"text-[11px] text-gray-500 mt-0.5",children:p})]})]}),m&&(0,t.jsx)("p",{className:"text-xs text-gray-400 leading-relaxed line-clamp-2",children:m}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[h.map(e=>(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-white/5 text-gray-400 border border-white/5",children:e},e)),u&&(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-purple-500/10 text-purple-400 border border-purple-500/20 font-medium",children:u})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 text-[11px]",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-gray-600",children:"Coverage:"}),(0,t.jsx)("span",{className:`font-semibold tabular-nums ${g<0?"text-gray-500":g>.7?"text-green-400":g>.3?"text-amber-400":"text-red-400"}`,children:y})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-gray-600",children:"Units:"}),(0,t.jsx)("span",{className:"text-gray-300 font-semibold tabular-nums",children:b})]})]}),j&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>c(e=>!e),className:"flex items-center gap-1 text-[11px] text-gray-500 hover:text-gray-300 transition-colors",children:[l?(0,t.jsx)(n.ChevronUp,{className:"w-3 h-3"}):(0,t.jsx)(i.ChevronDown,{className:"w-3 h-3"}),l?"Hide preview":"Show preview"]}),l&&(0,t.jsx)("pre",{className:"mt-2 text-[10px] text-gray-400 bg-white/[0.03] border border-white/5 rounded-lg p-3 overflow-x-auto whitespace-pre-wrap break-all",children:j})]}),(0,t.jsx)("button",{onClick:()=>r(e,a),className:"w-full py-2 text-sm font-medium bg-purple-600 hover:bg-purple-500 text-white rounded-lg transition-colors",children:"Import"})]})}var D=e.i(37727);function L({filename:e,hasDomainContext:a,onClose:l,onComplete:i}){let[n,c]=(0,s.useState)("personal"),[d,x]=(0,s.useState)(""),[o,p]=(0,s.useState)([]),[m,h]=(0,s.useState)("append"),[u,g]=(0,s.useState)(!1),[b,j]=(0,s.useState)(!1),[y,v]=(0,s.useState)(!1),[N,f]=(0,s.useState)(null);(0,s.useEffect)(()=>{"workspace"===n&&fetch((0,r.api)("/api/workspaces")).then(e=>e.ok?e.json():null).then(e=>{let t=e?.workspaces??e??[];p(t),t.length>0&&!d&&x(t[0].id)}).catch(()=>{})},[n]);let w=async()=>{v(!0),f(null);try{let t={marketplace_file:e,target_layer:n,merge_strategy:m,re_embed:u};"workspace"===n&&d&&(t.workspace_id=d),a&&(t.apply_domain_context=b);let s=await fetch((0,r.api)("/api/cortex/import"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e?.error||`Request failed (${s.status})`)}i()}catch(e){f(e?.message||"Import failed")}finally{v(!1)}};return(0,t.jsx)("div",{className:"fixed inset-0 z-50 bg-black/60 flex items-center justify-center p-4",children:(0,t.jsxs)("div",{className:"bg-gray-900 border border-white/10 rounded-xl p-6 max-w-md w-full flex flex-col gap-5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-gray-100",children:"Import Pack"}),(0,t.jsx)("p",{className:"text-[11px] text-gray-500 mt-0.5 font-mono break-all",children:e})]}),(0,t.jsx)("button",{onClick:l,className:"shrink-0 text-gray-500 hover:text-gray-300 transition-colors","aria-label":"Close",children:(0,t.jsx)(D.X,{className:"w-4 h-4"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] text-gray-500 uppercase tracking-wide mb-2",children:"Target layer"}),(0,t.jsx)("div",{className:"flex gap-2",children:[{value:"personal",label:"Personal"},{value:"workspace",label:"Workspace"},{value:"team",label:"Team"}].map(e=>(0,t.jsx)("button",{onClick:()=>c(e.value),className:`flex-1 py-1.5 text-xs font-medium rounded-lg border transition-colors ${n===e.value?"bg-purple-600 border-purple-500 text-white":"bg-white/5 border-white/10 text-gray-400 hover:border-white/20 hover:text-gray-200"}`,children:e.label},e.value))})]}),"workspace"===n&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] text-gray-500 uppercase tracking-wide mb-2",children:"Workspace"}),0===o.length?(0,t.jsx)("p",{className:"text-xs text-gray-600",children:"No workspaces found"}):(0,t.jsx)("select",{value:d,onChange:e=>x(e.target.value),className:"w-full py-2 px-3 text-sm bg-white/5 border border-white/10 rounded-lg text-gray-300 focus:outline-none focus:border-purple-500/50",children:o.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] text-gray-500 uppercase tracking-wide mb-2",children:"Merge strategy"}),(0,t.jsx)("div",{className:"flex gap-2",children:[{value:"append",label:"Append"},{value:"merge",label:"Merge"},{value:"replace",label:"Replace"}].map(e=>(0,t.jsx)("button",{onClick:()=>h(e.value),className:`flex-1 py-1.5 text-xs font-medium rounded-lg border transition-colors ${m===e.value?"bg-purple-600 border-purple-500 text-white":"bg-white/5 border-white/10 text-gray-400 hover:border-white/20 hover:text-gray-200"}`,children:e.label},e.value))})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2.5 cursor-pointer select-none group",children:[(0,t.jsx)("input",{type:"checkbox",checked:u,onChange:e=>g(e.target.checked),className:"w-3.5 h-3.5 accent-purple-500"}),(0,t.jsx)("span",{className:"text-xs text-gray-400 group-hover:text-gray-200 transition-colors",children:"Re-embed on import"})]}),a&&(0,t.jsxs)("label",{className:"flex items-center gap-2.5 cursor-pointer select-none group",children:[(0,t.jsx)("input",{type:"checkbox",checked:b,onChange:e=>j(e.target.checked),className:"w-3.5 h-3.5 accent-purple-500"}),(0,t.jsx)("span",{className:"text-xs text-gray-400 group-hover:text-gray-200 transition-colors",children:"Apply domain context"})]})]}),N&&(0,t.jsx)("p",{className:"text-xs text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg px-3 py-2",children:N}),(0,t.jsxs)("button",{onClick:w,disabled:y,className:"w-full py-2 text-sm font-medium bg-purple-600 hover:bg-purple-500 text-white rounded-lg transition-colors disabled:opacity-50 flex items-center justify-center gap-2",children:[y&&(0,t.jsx)(S.Loader2,{className:"w-3.5 h-3.5 animate-spin"}),y?"Importing...":"Import"]})]})})}function M(){let[e,a]=(0,s.useState)([]),[l,i]=(0,s.useState)(""),[n,c]=(0,s.useState)(!1),[d,x]=(0,s.useState)(null),o=(0,s.useCallback)(async()=>{c(!0);try{let e=await fetch((0,r.api)("/api/cortex/marketplace/browse"));if(e.ok){let t=await e.json();a(t.packs??[]),t.directory&&i(t.directory)}}catch{}c(!1)},[]);(0,s.useEffect)(()=>{o()},[o]);let p=(e,t)=>{x({filename:e,manifest:t})},m=d?.manifest?.marketplace?.domain_context!=null||d?.manifest?.domain_context!=null;return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"p-4 border-b border-white/5 flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-gray-100",children:"Marketplace"}),l&&(0,t.jsx)("p",{className:"text-[11px] text-gray-600 font-mono mt-0.5 truncate",children:l})]}),(0,t.jsxs)("button",{onClick:o,disabled:n,className:"flex items-center gap-1.5 text-xs text-gray-400 hover:text-gray-200 transition-colors disabled:opacity-50",children:[(0,t.jsx)(k.RefreshCw,{className:`w-3.5 h-3.5 ${n?"animate-spin":""}`}),"Refresh"]})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto p-4",children:[n&&0===e.length&&(0,t.jsx)("p",{className:"text-sm text-gray-500 text-center py-12",children:"Loading..."}),!n&&0===e.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-16 text-gray-600",children:[(0,t.jsx)(T.FolderOpen,{className:"w-8 h-8"}),(0,t.jsx)("p",{className:"text-sm",children:"No .cortexpack files found"})]}),e.length>0&&(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:e.map(e=>(0,t.jsx)(q,{filename:e.filename,manifest:e.manifest,onImport:p},e.filename))})]}),d&&(0,t.jsx)(L,{filename:d.filename,hasDomainContext:m,onClose:()=>x(null),onComplete:()=>{x(null),o()}})]})}var P=e.i(509694),A=e.i(475225),E=e.i(785183),B=e.i(93230),O=e.i(234239),K=e.i(731195),z=e.i(322787);let I=(0,_.default)("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);var Q=e.i(463059);let U=(0,_.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var W=e.i(266027),V=e.i(954616),G=e.i(912598);function H({label:e,value:s,sub:a,color:r}){return(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-3",children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-1",children:e}),(0,t.jsx)("div",{className:`text-lg font-semibold tabular-nums ${r||"text-white"}`,children:s}),a&&(0,t.jsx)("div",{className:"text-[10px] text-gray-600 mt-0.5",children:a})]})}let J={background:"#0f0f11",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"0.5rem",fontSize:"11px",color:"#d1d5db"};function Y(e){return e<-10?"#22c55e":e<0?"#86efac":e<5?"#f59e0b":"#ef4444"}function X({result:e}){let[a,r]=(0,s.useState)(!1);return(0,t.jsxs)("div",{className:"border border-white/[0.05] rounded-lg overflow-hidden",children:[(0,t.jsxs)("button",{onClick:()=>r(e=>!e),className:"w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-white/[0.02] transition-colors",children:[(0,t.jsx)("span",{className:"text-gray-500",children:a?(0,t.jsx)(i.ChevronDown,{className:"w-3.5 h-3.5"}):(0,t.jsx)(Q.ChevronRight,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("span",{className:"text-xs text-gray-300 font-mono flex-1 truncate",title:e.task_id,children:e.task_id}),(0,t.jsx)("span",{className:"text-[10px] text-gray-600 w-20",children:e.category}),(0,t.jsx)("span",{className:"text-[10px] text-gray-600 w-12",children:e.difficulty}),(0,t.jsx)("span",{className:"text-[10px] tabular-nums w-16 text-right",style:{color:Y(e.tokens_delta_percent??0)},children:null!=e.tokens_delta_percent?`${e.tokens_delta_percent>0?"+":""}${e.tokens_delta_percent.toFixed(1)}%`:"—"}),(0,t.jsxs)("span",{className:"text-[10px] text-gray-400 tabular-nums w-20 text-right",children:[null!=e.quality_with?e.quality_with.toFixed(2):"—"," / ",null!=e.quality_without?e.quality_without.toFixed(2):"—"]})]}),a&&(0,t.jsxs)("div",{className:"px-8 pb-3 pt-1 grid grid-cols-2 md:grid-cols-4 gap-3 bg-white/[0.01] border-t border-white/[0.05]",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Tokens without"}),(0,t.jsxs)("div",{className:"text-xs text-gray-300 tabular-nums",children:[e.tokens_without_input??"—"," in / ",e.tokens_without_output??"—"," out"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Tokens with"}),(0,t.jsxs)("div",{className:"text-xs text-gray-300 tabular-nums",children:[e.tokens_with_input??"—"," in / ",e.tokens_with_output??"—"," out"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Injection"}),(0,t.jsxs)("div",{className:"text-xs text-gray-300 tabular-nums",children:[e.injection_tokens??"—"," tokens"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Retrieval"}),(0,t.jsxs)("div",{className:"text-xs text-gray-300 tabular-nums",children:[e.retrieval_count??0," hits",null!=e.retrieval_avg_relevance?` \xb7 ${e.retrieval_avg_relevance.toFixed(3)} rel`:"",null!=e.retrieval_latency_ms?` \xb7 ${e.retrieval_latency_ms.toFixed(0)}ms`:""]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Quality improvement"}),(0,t.jsx)("div",{className:"text-xs tabular-nums",style:{color:(e.quality_improvement??0)>0?"#22c55e":(e.quality_improvement??0)<0?"#ef4444":"#6b7280"},children:null!=e.quality_improvement?`${e.quality_improvement>0?"+":""}${e.quality_improvement.toFixed(3)}`:"—"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Judge confidence"}),(0,t.jsx)("div",{className:"text-xs text-gray-300 tabular-nums",children:null!=e.judge_confidence?e.judge_confidence.toFixed(2):"—"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Duration without"}),(0,t.jsx)("div",{className:"text-xs text-gray-300 tabular-nums",children:null!=e.duration_without_ms?`${e.duration_without_ms.toFixed(0)}ms`:"—"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Duration with"}),(0,t.jsx)("div",{className:"text-xs text-gray-300 tabular-nums",children:null!=e.duration_with_ms?`${e.duration_with_ms.toFixed(0)}ms`:"—"})]})]})]})}function Z({tier:e}){if(!e)return null;let s={gold:"bg-yellow-500/20 text-yellow-300 border-yellow-500/30",silver:"bg-gray-400/20 text-gray-300 border-gray-400/30",bronze:"bg-orange-500/20 text-orange-300 border-orange-500/30"}[e.toLowerCase()]||"bg-purple-500/20 text-purple-300 border-purple-500/30";return(0,t.jsx)("span",{className:`text-[9px] px-1.5 py-0.5 rounded border font-medium uppercase ${s}`,children:e})}let ee=["codebase-qa","bug-fixing","code-generation","refactoring","style-convention","decision-recall","cross-session","error-recovery","domain-knowledge","multi-layer","performance-optimization","api-integration","security-access","meta-self","lobe-specific"],et={quick:{label:"Quick Test",desc:"Single task per category",tasks:"~15 tasks",time:"~3 min"},standard:{label:"Standard",desc:"5 tasks per category",tasks:"~75 tasks",time:"~20 min"},full:{label:"Comprehensive",desc:"All tasks",tasks:"~156 tasks",time:"~1 hour"}};function es({current:e,total:s}){let a=s>0?Math.round(e/s*100):0;return(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsxs)("span",{className:"text-[10px] text-gray-500 tabular-nums",children:[e," / ",s>0?s:"?"," tasks"]}),(0,t.jsxs)("span",{className:"text-[10px] text-gray-500 tabular-nums",children:[a,"%"]})]}),(0,t.jsx)("div",{className:"h-1.5 bg-white/[0.06] rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:"h-full bg-purple-500 rounded-full transition-all duration-500",style:{width:`${a}%`}})})]})}function ea({onRunComplete:e}){let a,{data:l}=(0,W.useQuery)({queryKey:["benchmark","status"],queryFn:async()=>{let e=await fetch((0,r.api)("/api/benchmark/status"));return e.ok?e.json():null},refetchInterval:3e3}),n=(a=(0,G.useQueryClient)(),(0,V.useMutation)({mutationFn:async e=>(await fetch((0,r.api)("/api/benchmark/run"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json(),onSuccess:()=>{a.invalidateQueries({queryKey:["benchmark"]})}})),[c,d]=(0,s.useState)([]),[x,o]=(0,s.useState)("claude-haiku-4-5"),[p,m]=(0,s.useState)(!1),[h,u]=(0,s.useState)(1),[g,b]=(0,s.useState)(!1),j=l?.running===!0,y=(0,s.useRef)(void 0);(0,s.useEffect)(()=>{!0!==y.current||j||l?.exitCode==null||e(),y.current=j},[j,l?.exitCode,e]);let v=l?.output?l.output.split("\n").filter(e=>e.trim().length>0).slice(-6):[];if(j)return(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4 space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(S.Loader2,{className:"w-3.5 h-3.5 text-purple-400 animate-spin"}),(0,t.jsxs)("span",{className:"text-xs font-medium text-gray-300",children:["Benchmark running — ",l?.preset,l?.categories&&"all"!==l.categories?` (${l.categories})`:""]})]}),(0,t.jsx)("span",{className:"text-[10px] text-gray-600 font-mono",children:l?.model})]}),(0,t.jsx)(es,{current:l?.progress?.current??0,total:l?.progress?.total??0}),v.length>0&&(0,t.jsx)("div",{className:"bg-black/30 rounded-md p-3 font-mono text-[10px] text-gray-500 space-y-0.5 max-h-28 overflow-y-auto",children:v.map((e,s)=>(0,t.jsx)("div",{className:"leading-relaxed",children:e},s))})]});let N=n.data?.error;return(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg overflow-hidden",children:[(0,t.jsx)("div",{className:"px-4 py-3 border-b border-white/[0.05]",children:(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400",children:"Run Benchmark"})}),(0,t.jsxs)("div",{className:"p-4 space-y-2",children:[Object.entries(et).map(([e,s])=>(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 rounded-lg border border-white/[0.05] hover:border-white/[0.10] hover:bg-white/[0.02] transition-colors",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-300",children:s.label}),(0,t.jsx)("span",{className:"text-[10px] text-gray-600",children:s.desc})]}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-600 mt-0.5 tabular-nums",children:[s.tasks," · ",s.time]})]}),(0,t.jsxs)("button",{onClick:()=>{n.mutate({preset:e})},disabled:n.isPending,className:"ml-4 flex items-center gap-1.5 px-3 py-1 text-[11px] font-medium rounded-md bg-purple-600/20 text-purple-300 border border-purple-500/20 hover:bg-purple-600/30 hover:border-purple-500/40 disabled:opacity-50 disabled:cursor-not-allowed transition-colors shrink-0",children:[(0,t.jsx)(U,{className:"w-2.5 h-2.5"}),"Run"]})]},e)),(0,t.jsxs)("div",{className:"pt-1",children:[(0,t.jsxs)("button",{onClick:()=>b(e=>!e),className:"flex items-center gap-1.5 text-[11px] text-gray-500 hover:text-gray-400 transition-colors",children:[g?(0,t.jsx)(i.ChevronDown,{className:"w-3 h-3"}):(0,t.jsx)(Q.ChevronRight,{className:"w-3 h-3"}),"Custom"]}),g&&(0,t.jsxs)("div",{className:"mt-3 space-y-3 pl-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-600 uppercase tracking-wider mb-2",children:"Categories"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:ee.map(e=>{let s=c.includes(e);return(0,t.jsx)("button",{onClick:()=>{d(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},className:`px-2 py-0.5 text-[10px] rounded border transition-colors ${s?"bg-purple-500/20 text-purple-300 border-purple-500/30":"bg-white/[0.03] text-gray-500 border-white/[0.06] hover:text-gray-400 hover:border-white/[0.10]"}`,children:e},e)})}),0===c.length&&(0,t.jsx)("div",{className:"text-[10px] text-gray-600 mt-1",children:"None selected = all categories"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-600 uppercase tracking-wider mb-1",children:"Model"}),(0,t.jsxs)("select",{value:x,onChange:e=>o(e.target.value),className:"px-2.5 py-1 text-xs bg-white/5 border border-white/10 rounded-md text-gray-300 focus:outline-none focus:border-purple-500/50",children:[(0,t.jsx)("option",{value:"claude-haiku-4-5",children:"claude-haiku-4-5"}),(0,t.jsx)("option",{value:"claude-sonnet-4-5",children:"claude-sonnet-4-5"}),(0,t.jsx)("option",{value:"claude-opus-4-5",children:"claude-opus-4-5"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] text-gray-600 uppercase tracking-wider mb-1",children:"Concurrency"}),(0,t.jsx)("input",{type:"number",min:1,max:5,value:h,onChange:e=>u(Math.min(5,Math.max(1,parseInt(e.target.value)||1))),className:"w-16 px-2.5 py-1 text-xs bg-white/5 border border-white/10 rounded-md text-gray-300 focus:outline-none focus:border-purple-500/50"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-4",children:[(0,t.jsx)("input",{id:"no-judge",type:"checkbox",checked:p,onChange:e=>m(e.target.checked),className:"w-3.5 h-3.5 rounded accent-purple-500"}),(0,t.jsx)("label",{htmlFor:"no-judge",className:"text-[11px] text-gray-400 cursor-pointer",children:"Skip judge"})]})]}),(0,t.jsxs)("button",{onClick:function(){n.mutate({preset:"custom",categories:c.length>0?c.join(","):void 0,noJudge:p,model:x,concurrency:h})},disabled:n.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md bg-purple-600/20 text-purple-300 border border-purple-500/20 hover:bg-purple-600/30 hover:border-purple-500/40 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[(0,t.jsx)(U,{className:"w-3 h-3"}),"Run Custom"]})]})]}),N&&(0,t.jsx)("div",{className:"text-[11px] text-red-400 bg-red-500/10 border border-red-500/20 rounded-md px-3 py-2",children:N}),l&&!j&&null!=l.exitCode&&(0,t.jsxs)("div",{className:"text-[11px] text-gray-500 bg-white/[0.02] border border-white/[0.05] rounded-md px-3 py-2",children:["Last run finished — exit code ",l.exitCode,0===l.exitCode?" (success)":" (error)"]})]})]})}function er(){let{data:e,isLoading:a,refetch:l}=(0,W.useQuery)({queryKey:["benchmark","runs"],queryFn:async()=>{let e=await fetch((0,r.api)("/api/benchmark/runs"));return e.ok?e.json():null}}),i=e?.runs??[],[n,c]=(0,s.useState)(null),d=n??i[0]?.id??null,{data:x,isLoading:o}=(0,W.useQuery)({queryKey:["benchmark","run",d],queryFn:async()=>{if(!d)return null;let e=await fetch((0,r.api)(`/api/benchmark/runs/${d}`));return e.ok?e.json():null},enabled:!!d}),{data:p}=(0,W.useQuery)({queryKey:["benchmark","lobes"],queryFn:async()=>{let e=await fetch((0,r.api)("/api/benchmark/lobes"));return e.ok?e.json():null}}),m=x?.summary??null,h=x?.categories??[],u=x?.results??[],g=p?.lobes??[],b=!a&&0===i.length;if(a)return(0,t.jsxs)("div",{className:"p-6 max-w-5xl space-y-6",children:[(0,t.jsx)(ea,{onRunComplete:()=>l()}),(0,t.jsx)("div",{className:"text-sm text-gray-500",children:"Loading benchmark data..."})]});if(b)return(0,t.jsxs)("div",{className:"p-6 max-w-5xl space-y-6",children:[(0,t.jsx)(ea,{onRunComplete:()=>l()}),(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-4 py-16 text-gray-600",children:[(0,t.jsx)(I,{className:"w-10 h-10"}),(0,t.jsxs)("p",{className:"text-sm text-center max-w-xs",children:["No benchmark data yet. Use the launcher above or run"," ",(0,t.jsx)("span",{className:"text-gray-500 font-mono text-xs",children:"npm run benchmark"})," ","to generate results."]})]})]});let j=h.map(e=>({name:e.category,delta:parseFloat(e.avgTokenDeltaPercent.toFixed(1))})),y=h.map(e=>({name:e.category,without:parseFloat(e.avgQualityWithout.toFixed(3)),with:parseFloat(e.avgQualityWith.toFixed(3))})),v=[...h].sort((e,t)=>t.hitRate-e.hitRate).map(e=>({name:e.category,hitRate:parseFloat((100*e.hitRate).toFixed(1))}));return(0,t.jsxs)("div",{className:"p-6 max-w-5xl space-y-6",children:[(0,t.jsx)(ea,{onRunComplete:()=>l()}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-[11px] text-gray-500 shrink-0",children:"Run"}),(0,t.jsx)("select",{value:d??"",onChange:e=>c(e.target.value||null),className:"px-3 py-1.5 text-xs bg-white/5 border border-white/10 rounded-lg text-gray-300 focus:outline-none focus:border-purple-500/50",children:i.map(e=>(0,t.jsxs)("option",{value:e.id,children:[new Date(e.timestamp).toLocaleString()," — ",e.model," (",e.preset,", ",e.task_count," tasks)"]},e.id))})]}),m&&(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[(0,t.jsx)(H,{label:"Avg Token Delta",value:null!=m.avgTokenDeltaPercent?`${m.avgTokenDeltaPercent>0?"+":""}${m.avgTokenDeltaPercent.toFixed(1)}%`:"—",sub:"vs baseline",color:m.avgTokenDeltaPercent<0?"text-green-400":m.avgTokenDeltaPercent<5?"text-amber-400":"text-red-400"}),(0,t.jsx)(H,{label:"Quality (with)",value:m.avgQualityWith.toFixed(2),sub:"avg LLM judge score",color:"text-purple-400"}),(0,t.jsx)(H,{label:"Quality (without)",value:m.avgQualityWithout.toFixed(2),sub:"baseline"}),(0,t.jsx)(H,{label:"Tasks",value:m.taskCount.toString(),sub:`${h.length} categories`}),(0,t.jsx)(H,{label:"Avg Retrieval",value:m.avgRetrievalLatencyMs?`${m.avgRetrievalLatencyMs.toFixed(0)}ms`:"—",sub:m.avgRetrievalRelevance?`${m.avgRetrievalRelevance.toFixed(3)} relevance`:"relevance"})]}),o&&(0,t.jsx)("div",{className:"text-sm text-gray-500",children:"Loading run details..."}),h.length>0&&(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg overflow-hidden",children:[(0,t.jsx)("div",{className:"px-4 py-3 border-b border-white/[0.05]",children:(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400",children:"Category Breakdown"})}),(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-white/[0.05]",children:[(0,t.jsx)("th",{className:"px-4 py-2 text-left text-[10px] text-gray-500 uppercase tracking-wider",children:"Category"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Tasks"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Token Delta"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Quality w/o"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Quality with"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Hit Rate"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Relevance"})]})}),(0,t.jsx)("tbody",{children:h.map((e,s)=>(0,t.jsxs)("tr",{className:`border-b border-white/[0.03] ${s%2==0?"":"bg-white/[0.01]"}`,children:[(0,t.jsx)("td",{className:"px-4 py-2 text-gray-300",children:e.category}),(0,t.jsx)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:e.taskCount}),(0,t.jsxs)("td",{className:"px-4 py-2 text-right tabular-nums font-medium",style:{color:Y(e.avgTokenDeltaPercent)},children:[e.avgTokenDeltaPercent>0?"+":"",e.avgTokenDeltaPercent.toFixed(1),"%"]}),(0,t.jsx)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:e.avgQualityWithout.toFixed(2)}),(0,t.jsx)("td",{className:"px-4 py-2 text-right text-gray-300 tabular-nums font-medium",children:e.avgQualityWith.toFixed(2)}),(0,t.jsxs)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:[(100*e.hitRate).toFixed(0),"%"]}),(0,t.jsx)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:e.avgRetrievalRelevance.toFixed(3)})]},e.category))})]})})]}),h.length>0&&(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Token Delta % by Category"}),(0,t.jsx)(K.ResponsiveContainer,{width:"100%",height:160,children:(0,t.jsxs)(P.BarChart,{data:j,margin:{top:4,right:4,bottom:4,left:0},children:[(0,t.jsx)(E.XAxis,{dataKey:"name",tick:{fontSize:10,fill:"#6b7280"}}),(0,t.jsx)(B.YAxis,{tick:{fontSize:10,fill:"#6b7280"}}),(0,t.jsx)(O.Tooltip,{contentStyle:J,formatter:e=>[`${e>0?"+":""}${e}%`,"Token delta"]}),(0,t.jsx)(A.Bar,{dataKey:"delta",radius:[2,2,0,0],children:j.map((e,s)=>(0,t.jsx)(z.Cell,{fill:Y(e.delta)},s))})]})})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Quality Score by Category"}),(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-gray-500",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-sm inline-block",style:{background:"#6b7280"}}),"Without"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-gray-500",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-sm inline-block",style:{background:"#7c3aed"}}),"With Cortex"]})]}),(0,t.jsx)(K.ResponsiveContainer,{width:"100%",height:160,children:(0,t.jsxs)(P.BarChart,{data:y,margin:{top:4,right:4,bottom:4,left:0},children:[(0,t.jsx)(E.XAxis,{dataKey:"name",tick:{fontSize:10,fill:"#6b7280"}}),(0,t.jsx)(B.YAxis,{domain:[0,1],tick:{fontSize:10,fill:"#6b7280"}}),(0,t.jsx)(O.Tooltip,{contentStyle:J}),(0,t.jsx)(A.Bar,{dataKey:"without",fill:"#4b5563",radius:[2,2,0,0]}),(0,t.jsx)(A.Bar,{dataKey:"with",fill:"#7c3aed",radius:[2,2,0,0]})]})})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4 md:col-span-2",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Knowledge Retrieval Hit Rate %"}),(0,t.jsx)(K.ResponsiveContainer,{width:"100%",height:120,children:(0,t.jsxs)(P.BarChart,{data:v,layout:"vertical",margin:{top:4,right:4,bottom:4,left:60},children:[(0,t.jsx)(E.XAxis,{type:"number",domain:[0,100],tick:{fontSize:10,fill:"#6b7280"}}),(0,t.jsx)(B.YAxis,{type:"category",dataKey:"name",tick:{fontSize:10,fill:"#6b7280"},width:56}),(0,t.jsx)(O.Tooltip,{contentStyle:J,formatter:e=>[`${e}%`,"Hit rate"]}),(0,t.jsx)(A.Bar,{dataKey:"hitRate",fill:"#06b6d4",radius:[0,2,2,0]})]})})]})]}),g.length>0&&(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg overflow-hidden",children:[(0,t.jsx)("div",{className:"px-4 py-3 border-b border-white/[0.05]",children:(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400",children:"Lobe Scores"})}),(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-white/[0.05]",children:[(0,t.jsx)("th",{className:"px-4 py-2 text-left text-[10px] text-gray-500 uppercase tracking-wider",children:"Lobe"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Overall"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Token Savings"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Quality +"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Coverage"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Badge"}),(0,t.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Marketplace"})]})}),(0,t.jsx)("tbody",{children:g.map((e,s)=>(0,t.jsxs)("tr",{className:`border-b border-white/[0.03] ${s%2==0?"":"bg-white/[0.01]"}`,children:[(0,t.jsxs)("td",{className:"px-4 py-2",children:[(0,t.jsx)("div",{className:"text-gray-300",children:e.lobe_name}),(0,t.jsx)("div",{className:"text-[9px] text-gray-600 font-mono",children:e.lobe_id})]}),(0,t.jsx)("td",{className:"px-4 py-2 text-right text-purple-400 tabular-nums font-medium",children:null!=e.overall_score?e.overall_score.toFixed(2):"—"}),(0,t.jsx)("td",{className:"px-4 py-2 text-right tabular-nums",style:{color:(e.token_savings??0)>0?"#22c55e":"#6b7280"},children:null!=e.token_savings?`${e.token_savings>0?"+":""}${e.token_savings.toFixed(1)}%`:"—"}),(0,t.jsx)("td",{className:"px-4 py-2 text-right tabular-nums",style:{color:(e.quality_improvement??0)>0?"#22c55e":"#6b7280"},children:null!=e.quality_improvement?`${e.quality_improvement>0?"+":""}${e.quality_improvement.toFixed(3)}`:"—"}),(0,t.jsx)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:null!=e.coverage_score?e.coverage_score.toFixed(2):"—"}),(0,t.jsx)("td",{className:"px-4 py-2 text-right",children:(0,t.jsx)(Z,{tier:e.badge_tier})}),(0,t.jsx)("td",{className:"px-4 py-2 text-right",children:e.marketplace_ready?(0,t.jsx)("span",{className:"text-[9px] px-1.5 py-0.5 rounded border bg-green-500/10 text-green-400 border-green-500/20",children:"Ready"}):(0,t.jsx)("span",{className:"text-[9px] text-gray-600",children:"—"})})]},e.id))})]})})]}),u.length>0&&(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-4 py-3 border-b border-white/[0.05] flex items-center justify-between",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-gray-400",children:"Task Results"}),(0,t.jsxs)("span",{className:"text-[10px] text-gray-600",children:[u.length," tasks"]})]}),(0,t.jsxs)("div",{className:"px-4 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-1 mb-1",children:[(0,t.jsx)("span",{className:"w-3.5"}),(0,t.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider flex-1",children:"Task ID"}),(0,t.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider w-20",children:"Category"}),(0,t.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider w-12",children:"Diff"}),(0,t.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider w-16 text-right",children:"Token %"}),(0,t.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider w-20 text-right",children:"Quality w/w"})]}),(0,t.jsx)("div",{className:"space-y-1",children:u.map(e=>(0,t.jsx)(X,{result:e},e.id))})]})]})]})}let el=(0,a.default)(()=>e.A(830077).then(e=>({default:e.EntityGraphView})),{loadableGenerated:{modules:[756409]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center text-gray-500 text-sm",children:"Loading graph..."})});function ei(){let[e,a]=(0,s.useState)("dashboard"),[l,i]=(0,s.useState)(null);(0,s.useEffect)(()=>{fetch((0,r.api)("/api/cortex/status")).then(e=>e.json()).then(i).catch(()=>{})},[]);let n=l?Object.values(l.layers||{}).reduce((e,t)=>e+(t.count||0),0):0;return(0,t.jsxs)("div",{className:"flex flex-col h-screen bg-gray-950",children:[(0,t.jsxs)("div",{className:"flex items-center border-b border-white/5 px-4 shrink-0",children:[(0,t.jsx)("div",{className:"flex",children:[{key:"dashboard",label:"Dashboard"},{key:"graph",label:"Graph"},{key:"knowledge",label:"Knowledge"},{key:"curation",label:"Curation"},{key:"marketplace",label:"Marketplace"},{key:"benchmark",label:"Benchmark"},{key:"settings",label:"Settings"}].map(s=>(0,t.jsx)("button",{onClick:()=>a(s.key),className:`px-5 py-3 text-sm font-medium transition-colors border-b-2 ${e===s.key?"text-purple-400 border-purple-400":"text-gray-500 border-transparent hover:text-gray-300"}`,children:s.label},s.key))}),(0,t.jsxs)("div",{className:"ml-auto text-xs text-gray-600",children:[n," knowledge units"]})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:["dashboard"===e&&(0,t.jsx)(N,{}),"graph"===e&&(0,t.jsx)(el,{}),"knowledge"===e&&(0,t.jsx)(h,{}),"curation"===e&&(0,t.jsx)(F,{}),"marketplace"===e&&(0,t.jsx)(M,{}),"benchmark"===e&&(0,t.jsx)(er,{}),"settings"===e&&(0,t.jsx)("div",{className:"p-6 max-w-2xl space-y-8",children:(0,t.jsx)(u.CortexSettings,{})})]})]})}e.s(["default",()=>ei],365061)}]);
|