@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
package/.next/standalone/.next/server/chunks/ssr/src_app_(desktop)_cortex_page_tsx_0f33d8b3._.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[417835,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(819721),e=a.i(119032),f=a.i(587532),g=a.i(405784),h=a.i(767552),i=a.i(781560),j=a.i(73570);let k={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"},l={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"},m={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 n({unit:a,onDelete:c,compact:d}){var f;let g,h=k[a.type]||k.context,m=(f=a.created,0===(g=Math.floor((Date.now()-new Date(f).getTime())/864e5))?"today":1===g?"1d ago":g<30?`${g}d ago`:g<365?`${Math.floor(g/30)}mo ago`:`${Math.floor(g/365)}y ago`),n=(a.contradiction_refs?.length??0)>0,o=a.evidence_score??a.confidence,p=null!=a.evidence_score?`${o.toFixed(2)} evidence`:`${Math.round(100*o)}%`,q=async()=>{await fetch((0,e.api)(`/api/cortex/knowledge/${a.id}`),{method:"DELETE"}),c?.(a.id)};return(0,b.jsxs)("div",{className:"group border border-white/5 rounded-lg p-3 hover:border-white/10 transition-colors",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1 flex-wrap",children:[(0,b.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${h}`,children:a.type.replace("_"," ")}),a.sensitivity&&(0,b.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${l[a.sensitivity]||l.internal}`,children:a.sensitivity}),a.scope&&(0,b.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded font-medium bg-purple-500/10 text-purple-400",children:a.scope.level}),(a.stale_score??0)>.3&&(0,b.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded font-medium bg-amber-500/20 text-amber-400",children:"stale"}),n&&(0,b.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,b.jsx)(j.AlertTriangle,{className:"w-2.5 h-2.5"})," contested"]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 text-[10px] text-gray-500 shrink-0",children:[(0,b.jsx)("span",{children:m}),c&&(0,b.jsx)("button",{onClick:q,className:"opacity-0 group-hover:opacity-100 transition-opacity text-red-400 hover:text-red-300",children:(0,b.jsx)(i.Trash2,{className:"w-3 h-3"})})]})]}),(0,b.jsx)("p",{className:"text-xs text-gray-300 mt-1.5 leading-relaxed line-clamp-3",children:a.text}),!d&&a.origin&&(0,b.jsxs)("div",{className:"flex items-center gap-1.5 mt-1.5 text-[10px] text-gray-500 flex-wrap",children:[(0,b.jsxs)("span",{children:["by ",a.origin.creator_entity_id.replace("person-","")]}),(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{children:["via ",a.origin.source_type.replace("_"," ")]}),(a.corroborations??0)>0&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{className:"text-green-400",children:[a.corroborations," corr."]})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,b.jsx)("div",{className:"flex-1 h-1 bg-white/5 rounded-full overflow-hidden",children:(0,b.jsx)("div",{className:"h-full bg-purple-500/50 rounded-full",style:{width:`${Math.round(100*o)}%`}})}),(0,b.jsx)("span",{className:"text-[10px] text-gray-500 tabular-nums",children:p})]})]})}function o(){let[a,d]=(0,c.useState)(""),[i,j]=(0,c.useState)([]),[l,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(null),[v,w]=(0,c.useState)(!1),x=async()=>{if(r.trim()){w(!0);try{let a=await fetch((0,e.api)(`/api/cortex/context?q=${encodeURIComponent(r)}&limit=5`));a.ok&&u(await a.json())}catch{}w(!1)}},y=(0,c.useCallback)(async a=>{o(!0);try{let b=new URLSearchParams({limit:"30"});a&&b.set("q",a);let c=await fetch((0,e.api)(`/api/cortex/search?${b}`));c.ok&&j((await c.json()).results||[])}catch{}o(!1)},[]);(0,c.useEffect)(()=>{y()},[y]);let z=a=>j(b=>b.filter(b=>b.id!==a));return(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsx)("div",{className:"p-4 border-b border-white/5",children:(0,b.jsxs)("div",{className:"relative max-w-md",children:[(0,b.jsx)(f.Search,{className:"absolute left-3 top-2.5 w-4 h-4 text-gray-500"}),(0,b.jsx)("input",{value:a,onChange:a=>d(a.target.value),onKeyDown:b=>"Enter"===b.key&&y(a.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,b.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,b.jsxs)("div",{className:"max-w-2xl space-y-2",children:[l&&(0,b.jsx)("p",{className:"text-sm text-gray-500 text-center py-8",children:"Loading..."}),!l&&0===i.length&&(0,b.jsx)("p",{className:"text-sm text-gray-500 text-center py-8",children:"No knowledge found"}),i.map(a=>(0,b.jsx)(n,{unit:a,onDelete:z},a.id)),(0,b.jsxs)("div",{className:"border-t border-white/5 mt-4 pt-4",children:[(0,b.jsxs)("button",{onClick:()=>q(!p),className:"flex items-center gap-2 text-xs text-gray-500 hover:text-gray-300 mb-3",children:[p?(0,b.jsx)(h.ChevronUp,{className:"w-3 h-3"}):(0,b.jsx)(g.ChevronDown,{className:"w-3 h-3"}),"Query Analyzer"]}),p&&(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex gap-3 mb-4",children:[(0,b.jsxs)("div",{className:"flex-1 relative",children:[(0,b.jsx)(f.Search,{className:"absolute left-3 top-2.5 w-4 h-4 text-gray-500"}),(0,b.jsx)("input",{value:r,onChange:a=>s(a.target.value),onKeyDown:a=>"Enter"===a.key&&x(),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,b.jsx)("button",{onClick:x,disabled:v,className:"px-5 py-2 text-sm bg-purple-600 hover:bg-purple-500 text-white rounded-lg disabled:opacity-50",children:v?"Analyzing...":"Analyze"})]}),!t&&!v&&(0,b.jsx)("p",{className:"text-sm text-gray-600 text-center py-8",children:"Enter a query to see how the Context Engine processes it"}),t&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/5 rounded-lg p-3",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-600 uppercase mb-1",children:"Intent"}),(0,b.jsx)("div",{className:`text-lg font-semibold ${m[t.intent?.intent]||"text-gray-400"}`,children:t.intent?.intent||"?"}),(0,b.jsxs)("div",{className:"text-[10px] text-gray-600",children:["confidence: ",(t.intent?.confidence??0).toFixed(2)]})]}),(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/5 rounded-lg p-3",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-600 uppercase mb-1",children:"Entities"}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[(t.entities||[]).map((a,c)=>(0,b.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 bg-white/5 border border-white/10 rounded text-gray-300",children:[a.entity?.type,":",a.entity?.name]},c)),(!t.entities||0===t.entities.length)&&(0,b.jsx)("span",{className:"text-[10px] text-gray-600",children:"none detected"})]})]}),(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/5 rounded-lg p-3",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-600 uppercase mb-1",children:"Timing"}),(0,b.jsxs)("div",{className:"text-lg font-semibold text-green-400",children:[t.timing?.totalMs??"?","ms"]}),(0,b.jsxs)("div",{className:"text-[10px] text-gray-600",children:["intent ",t.timing?.intentMs,"ms · search ",t.timing?.searchMs,"ms"]})]})]}),(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("div",{className:"text-[10px] text-gray-600 uppercase mb-2",children:["Results (",(t.results||[]).length,")"]}),(0,b.jsx)("div",{className:"space-y-1",children:(t.results||[]).map((a,c)=>(0,b.jsxs)("div",{className:"flex items-center gap-2 bg-white/[0.02] border border-white/5 rounded-lg px-3 py-2",children:[(0,b.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${k[a.type]||k.context}`,children:a.type?.replace("_"," ")}),(0,b.jsx)("span",{className:"text-xs text-gray-300 truncate flex-1",children:a.text}),(0,b.jsx)("span",{className:"text-[10px] text-gray-600 tabular-nums shrink-0",children:(a.relevance_score??0).toFixed(3)})]},c))})]})]})]})]})]})})]})}var p=a.i(565870);function q(a){return a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:a<0x40000000?`${(a/1048576).toFixed(1)} MB`:`${(a/0x40000000).toFixed(2)} GB`}function r({items:a,maxValue:c}){return(0,b.jsx)("div",{className:"space-y-1.5",children:a.map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-[10px] text-gray-500 w-24 text-right truncate",title:a.label,children:a.label}),(0,b.jsx)("div",{className:"flex-1 h-3 bg-white/[0.03] rounded-full overflow-hidden",children:(0,b.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.max(2,a.value/Math.max(c,1)*100)}%`,backgroundColor:a.color}})}),(0,b.jsx)("span",{className:"text-[10px] text-gray-400 w-14 text-right tabular-nums",children:a.value.toLocaleString()})]},a.label))})}function s({label:a,value:c,sub:d,color:e}){return(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-3",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-1",children:a}),(0,b.jsx)("div",{className:`text-lg font-semibold tabular-nums ${e||"text-white"}`,children:c}),d&&(0,b.jsx)("div",{className:"text-[10px] text-gray-600 mt-0.5",children:d})]})}let t=["#7c3aed","#06b6d4","#10b981","#f59e0b","#ef4444","#8b5cf6","#14b8a6","#22c55e","#eab308","#f97316"],u={decision:"#3b82f6",pattern:"#22c55e",preference:"#ec4899",error_fix:"#f59e0b",context:"#6b7280",code_pattern:"#06b6d4",command:"#f97316",conversation:"#64748b",summary:"#8b5cf6"};function v(){let[a,d]=(0,c.useState)(null),[f,g]=(0,c.useState)(!0);if((0,c.useEffect)(()=>{fetch((0,e.api)("/api/cortex/status")).then(a=>a.json()).then(a=>{a.enabled&&d(a)}).catch(()=>{}).finally(()=>g(!1))},[]),f)return(0,b.jsx)("div",{className:"p-6 text-sm text-gray-500",children:"Loading dashboard..."});if(!a)return(0,b.jsx)("div",{className:"p-6 text-sm text-gray-500",children:"Cortex is not active."});let h=Object.entries(a.lobes).sort((a,b)=>b[1].count-a[1].count),i=Math.max(...h.map(([,a])=>a.count),1),j=Math.max(...h.map(([,a])=>a.sizeBytes),1),k=a.usage,m=k?.distillation;return(0,b.jsxs)("div",{className:"p-6 max-w-4xl space-y-6",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,b.jsx)(s,{label:"Knowledge Units",value:a.totalCount.toLocaleString(),sub:`across ${h.length} lobes`,color:"text-purple-400"}),(0,b.jsx)(s,{label:"Storage",value:q(a.totalSizeBytes),sub:`${a.embedding_provider} (${a.embedding_dimensions}d)`}),(0,b.jsx)(s,{label:"Coverage",value:a.quality?a.quality.coverage_score.toFixed(2):"—",sub:a.quality?`${Math.round(100*a.quality.coverage_score)}% distilled`:"no data",color:a.quality?a.quality.coverage_score>.7?"text-green-400":a.quality.coverage_score>.3?"text-amber-400":"text-red-400":"text-gray-500"}),(0,b.jsx)(s,{label:"Distillation",value:m?`$${m.estimated_cost_usd.toFixed(2)}`:"Off",sub:m?`${m.calls.toLocaleString()} calls`:a.distillation?"No API key":"Disabled",color:m?"text-amber-400":"text-gray-500"})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Knowledge by Lobe"}),(0,b.jsx)(r,{items:h.map(([a,b],c)=>({label:b.label||a,value:b.count,color:t[c%t.length]})),maxValue:i})]}),(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Storage by Lobe"}),(0,b.jsx)(r,{items:h.map(([a,b],c)=>({label:b.label||a,value:b.sizeBytes,color:t[c%t.length]})),maxValue:j}),(0,b.jsxs)("div",{className:"mt-2 flex justify-between text-[10px] text-gray-600",children:[(0,b.jsxs)("span",{children:["Smallest: ",q(Math.min(...h.map(([,a])=>a.sizeBytes)))]}),(0,b.jsxs)("span",{children:["Total: ",q(a.totalSizeBytes)]})]})]})]}),a.quality&&(0,b.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Type Distribution"}),(0,b.jsx)(r,{items:Object.entries(a.quality.type_distribution).sort((a,b)=>b[1]-a[1]).map(([a,b])=>({label:a.replace("_"," "),value:b,color:u[a]||"#7c3aed"})),maxValue:Math.max(...Object.values(a.quality.type_distribution),1)})]}),(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Lobe Health"}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex justify-between text-[11px]",children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Stale units"}),(0,b.jsx)("span",{className:a.quality.stale_count>10?"text-amber-400":"text-gray-300",children:a.quality.stale_count})]}),(0,b.jsxs)("div",{className:"flex justify-between text-[11px]",children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Avg confidence"}),(0,b.jsx)("span",{className:"text-gray-300",children:a.quality.avg_confidence.toFixed(2)})]}),a.quality.top_accessed.length>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 mb-1",children:"Top accessed"}),(0,b.jsxs)("div",{className:"text-[11px] text-gray-400 truncate",children:["“",a.quality.top_accessed[0].text,"”"]})]}),a.quality.sensitivity_counts&&(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 mb-1",children:"Sensitivity"}),(0,b.jsx)("div",{className:"flex flex-wrap gap-1",children:Object.entries(a.quality.sensitivity_counts).map(([a,c])=>(0,b.jsxs)("span",{className:`text-[9px] px-1.5 py-0.5 rounded ${l[a]||l.internal}`,children:[c," ",a]},a))})]})]})]})]}),m&&(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Distillation Activity"}),(0,b.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500",children:"API Calls"}),(0,b.jsx)("div",{className:"text-sm font-medium text-white tabular-nums",children:m.calls.toLocaleString()})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500",children:"Input Tokens"}),(0,b.jsxs)("div",{className:"text-sm font-medium text-white tabular-nums",children:[(m.input_tokens/1e3).toFixed(1),"K"]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500",children:"Output Tokens"}),(0,b.jsxs)("div",{className:"text-sm font-medium text-white tabular-nums",children:[(m.output_tokens/1e3).toFixed(1),"K"]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500",children:"Estimated Cost"}),(0,b.jsxs)("div",{className:"text-sm font-medium text-amber-400 tabular-nums",children:["$",m.estimated_cost_usd.toFixed(4)]})]})]}),m.last_updated&&(0,b.jsxs)("div",{className:"mt-2 text-[10px] text-gray-600",children:["Last distillation: ",new Date(m.last_updated).toLocaleString()]}),k.by_model&&Object.keys(k.by_model).length>0&&(0,b.jsxs)("div",{className:"mt-3 border-t border-white/[0.04] pt-3",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 mb-2",children:"By Model"}),Object.entries(k.by_model).map(([a,c])=>(0,b.jsxs)("div",{className:"flex items-center justify-between text-[10px]",children:[(0,b.jsx)("span",{className:"text-gray-400 font-mono",children:a}),(0,b.jsxs)("span",{className:"text-gray-500",children:[c.calls," calls · $",c.estimated_cost_usd.toFixed(4)]})]},a))]})]}),(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"System"}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-1.5 text-[11px]",children:[(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Status"}),(0,b.jsx)("span",{className:"text-green-400",children:a.status})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Embedding"}),(0,b.jsxs)("span",{className:"text-gray-300",children:[a.embedding_provider," (",a.embedding_dimensions,"d)"]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Distillation"}),(0,b.jsx)("span",{className:a.distillation?"text-green-400":"text-gray-600",children:a.distillation?"Enabled":"Disabled"})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Lobes"}),(0,b.jsxs)("span",{className:"text-gray-300",children:[h.length," active"]})]})]})]})]})}var w=a.i(773320),x=a.i(839761),y=a.i(669520),z=a.i(883706);let A=(0,z.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 B=a.i(596221);let C=[{id:"seed",label:"Seed",icon:(0,b.jsx)(w.Upload,{className:"w-3.5 h-3.5"})},{id:"assess",label:"Assess",icon:(0,b.jsx)(x.BarChart3,{className:"w-3.5 h-3.5"})},{id:"review",label:"Review",icon:(0,b.jsx)(f.Search,{className:"w-3.5 h-3.5"})},{id:"refine",label:"Refine",icon:(0,b.jsx)(y.RefreshCw,{className:"w-3.5 h-3.5"})},{id:"publish",label:"Publish",icon:(0,b.jsx)(A,{className:"w-3.5 h-3.5"})}],D={decision:"#3b82f6",pattern:"#22c55e",preference:"#ec4899",error_fix:"#f59e0b",context:"#6b7280",code_pattern:"#06b6d4",command:"#f97316",conversation:"#64748b",summary:"#8b5cf6"};function E(){let a,[d,g]=(0,c.useState)([]),[h,i]=(0,c.useState)(""),[j,l]=(0,c.useState)("seed"),[m,n]=(0,c.useState)(""),[o,p]=(0,c.useState)(""),[q,r]=(0,c.useState)("auto"),[s,t]=(0,c.useState)(""),[u,v]=(0,c.useState)(!0),[z,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)(null),[L,M]=(0,c.useState)(""),[N,O]=(0,c.useState)("25"),[P,Q]=(0,c.useState)(!1),[R,S]=(0,c.useState)(null),[T,U]=(0,c.useState)(""),[V,W]=(0,c.useState)({decisions:!0,patterns:!0,preferences:!0,error_fixes:!0}),[X,Y]=(0,c.useState)(!1),[Z,$]=(0,c.useState)(null),[_,aa]=(0,c.useState)(""),[ab,ac]=(0,c.useState)(""),[ad,ae]=(0,c.useState)(""),[af,ag]=(0,c.useState)(""),[ah,ai]=(0,c.useState)("1.0.0"),[aj,ak]=(0,c.useState)("MIT"),[al,am]=(0,c.useState)(!1),[an,ao]=(0,c.useState)(null),ap=(0,c.useCallback)(()=>{G(null),K(null),S(null),$(null),ao(null),n("")},[]);(0,c.useEffect)(()=>{fetch((0,e.api)("/api/workspaces")).then(a=>a.json()).then(a=>{g(a),a.length>0&&i(a[0].id)}).catch(()=>{})},[]);let aq=async()=>{if(o.trim()&&h){E(!0),n(""),G(null);try{let a=await fetch((0,e.api)("/api/cortex/curation/seed"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:o,format:q,source_ref:s||void 0,workspace_id:h,distill:u})}),b=await a.json();if(!a.ok)throw Error(b.error||b.message||"Seed failed");G(b)}catch(a){n(a instanceof Error?a.message:"Seed failed")}finally{E(!1)}}},ar=async()=>{if(h){I(!0),n(""),K(null);try{let a=await fetch((0,e.api)(`/api/cortex/curation/assess?workspace_id=${encodeURIComponent(h)}`)),b=await a.json();if(!a.ok)throw Error(b.error||b.message||"Assessment failed");K(b)}catch(a){n(a instanceof Error?a.message:"Assessment failed")}finally{I(!1)}}},as=async()=>{if(h&&L.trim()){Q(!0),n(""),S(null);try{let a=new URLSearchParams({workspace_id:h,topic:L.trim(),limit:N}),b=await fetch((0,e.api)(`/api/cortex/curation/review?${a}`)),c=await b.json();if(!b.ok)throw Error(c.error||c.message||"Review failed");S(c)}catch(a){n(a instanceof Error?a.message:"Review failed")}finally{Q(!1)}}},at=async()=>{if(h){Y(!0),n(""),$(null);try{let a=Object.keys(V).filter(a=>V[a]),b=await fetch((0,e.api)("/api/cortex/curation/refine"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace_id:h,domain_context:T||void 0,types:a})}),c=await b.json();if(!b.ok)throw Error(c.error||c.message||"Refine failed");$(c)}catch(a){n(a instanceof Error?a.message:"Refine failed")}finally{Y(!1)}}},au=async()=>{if(h&&_.trim()){am(!0),n(""),ao(null);try{let a=await fetch((0,e.api)("/api/cortex/curation/publish"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace_id:h,name:_,author:ab||void 0,description:ad||void 0,tags:af?af.split(",").map(a=>a.trim()).filter(Boolean):[],version:ah,license:aj})}),b=await a.json();if(!a.ok)throw Error(b.error||b.message||"Publish failed");ao(b)}catch(a){n(a instanceof Error?a.message:"Publish failed")}finally{am(!1)}}},av="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",aw="text-[11px] text-gray-500 mb-1 block",ax="bg-white/[0.02] border border-white/[0.06] rounded-lg p-4";return(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsxs)("div",{className:"px-4 pt-4 pb-3 border-b border-white/5",children:[(0,b.jsx)("label",{className:aw,children:"Workspace"}),(0,b.jsxs)("select",{value:h,onChange:a=>{i(a.target.value),ap()},className:`${av} max-w-xs`,children:[0===d.length&&(0,b.jsx)("option",{value:"",disabled:!0,children:"No workspaces found"}),d.map(a=>(0,b.jsx)("option",{value:a.id,children:a.name},a.id))]})]}),(0,b.jsx)("div",{className:"px-4 py-3 border-b border-white/5",children:(0,b.jsx)("div",{className:"flex items-center",children:C.map((a,c)=>(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsxs)("button",{onClick:()=>{l(a.id),ap()},className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium border transition-colors ${j===a.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:[a.icon,a.label]}),c<C.length-1&&(0,b.jsx)("div",{className:"w-8 h-px bg-white/[0.06]"})]},a.id))})}),(0,b.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,b.jsxs)("div",{className:"max-w-2xl space-y-4",children:[m&&(0,b.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:m}),"seed"===j&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Document content"}),(0,b.jsx)("textarea",{value:o,onChange:a=>p(a.target.value),placeholder:"Paste document content here...",rows:8,className:av})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Format"}),(0,b.jsxs)("select",{value:q,onChange:a=>r(a.target.value),className:av,children:[(0,b.jsx)("option",{value:"auto",children:"Auto-detect"}),(0,b.jsx)("option",{value:"markdown",children:"Markdown"}),(0,b.jsx)("option",{value:"plaintext",children:"Plain text"}),(0,b.jsx)("option",{value:"csv",children:"CSV"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Source reference"}),(0,b.jsx)("input",{value:s,onChange:a=>t(a.target.value),placeholder:"e.g. docs/guide.md",className:av})]})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[(0,b.jsx)("input",{type:"checkbox",checked:u,onChange:a=>v(a.target.checked),className:"rounded border-white/20 bg-white/5 accent-purple-500"}),(0,b.jsx)("span",{className:"text-xs text-gray-400",children:"Distill after seeding"})]}),(0,b.jsxs)("button",{onClick:aq,disabled:z||!o.trim()||!h,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:[z?(0,b.jsx)(B.Loader2,{className:"w-4 h-4 animate-spin"}):(0,b.jsx)(w.Upload,{className:"w-4 h-4"}),"Seed Documents"]}),F&&(0,b.jsxs)("div",{className:ax,children:[(0,b.jsx)("div",{className:"text-xs font-medium text-gray-400 mb-3",children:"Seed Results"}),(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Chunks Created"}),(0,b.jsx)("div",{className:"text-lg font-semibold text-green-400 tabular-nums",children:F.chunksCreated})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Chunks Skipped"}),(0,b.jsx)("div",{className:"text-lg font-semibold text-amber-400 tabular-nums",children:F.chunksSkipped})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Errors"}),(0,b.jsx)("div",{className:`text-lg font-semibold tabular-nums ${F.errors.length>0?"text-red-400":"text-gray-500"}`,children:F.errors.length})]})]}),F.errors.length>0&&(0,b.jsx)("div",{className:"mt-3 space-y-1",children:F.errors.map((a,c)=>(0,b.jsx)("div",{className:"text-xs text-red-400/80",children:a},c))})]})]}),"assess"===j&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("button",{onClick:ar,disabled:H||!h,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,b.jsx)(B.Loader2,{className:"w-4 h-4 animate-spin"}):(0,b.jsx)(x.BarChart3,{className:"w-4 h-4"}),"Run Assessment"]}),J&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,b.jsxs)("div",{className:ax,children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Coverage Score"}),(0,b.jsx)("div",{className:`text-2xl font-semibold tabular-nums ${(a=J.coverage_score)>.7?"text-green-400":a>.3?"text-amber-400":"text-red-400"}`,children:J.coverage_score.toFixed(2)}),(0,b.jsxs)("div",{className:"text-[10px] text-gray-600 mt-0.5",children:[Math.round(100*J.coverage_score),"% covered"]})]}),(0,b.jsxs)("div",{className:ax,children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Total Units"}),(0,b.jsx)("div",{className:"text-2xl font-semibold text-white tabular-nums",children:J.total_units.toLocaleString()})]}),(0,b.jsxs)("div",{className:ax,children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Stale Count"}),(0,b.jsx)("div",{className:`text-2xl font-semibold tabular-nums ${J.stale_count>10?"text-amber-400":"text-gray-300"}`,children:J.stale_count})]})]}),J.type_distribution&&Object.keys(J.type_distribution).length>0&&(0,b.jsxs)("div",{className:ax,children:[(0,b.jsx)("div",{className:"text-xs font-medium text-gray-400 mb-3",children:"Type Distribution"}),(0,b.jsx)("div",{className:"space-y-1.5",children:Object.entries(J.type_distribution).sort((a,b)=>b[1]-a[1]).map(([a,c])=>{let d=Math.max(...Object.values(J.type_distribution),1);return(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-[10px] text-gray-500 w-24 text-right truncate",children:a.replace("_"," ")}),(0,b.jsx)("div",{className:"flex-1 h-3 bg-white/[0.03] rounded-full overflow-hidden",children:(0,b.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.max(2,c/d*100)}%`,backgroundColor:D[a]||"#7c3aed"}})}),(0,b.jsx)("span",{className:"text-[10px] text-gray-400 w-10 text-right tabular-nums",children:c})]},a)})})]})]})]}),"review"===j&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex gap-3",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("label",{className:aw,children:"Topic filter"}),(0,b.jsx)("input",{value:L,onChange:a=>M(a.target.value),onKeyDown:a=>"Enter"===a.key&&as(),placeholder:"Filter by topic (optional)",className:av})]}),(0,b.jsxs)("div",{className:"w-28",children:[(0,b.jsx)("label",{className:aw,children:"Limit"}),(0,b.jsxs)("select",{value:N,onChange:a=>O(a.target.value),className:av,children:[(0,b.jsx)("option",{value:"10",children:"10"}),(0,b.jsx)("option",{value:"25",children:"25"}),(0,b.jsx)("option",{value:"50",children:"50"})]})]})]}),(0,b.jsxs)("button",{onClick:as,disabled:P||!h||!L.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:[P?(0,b.jsx)(B.Loader2,{className:"w-4 h-4 animate-spin"}):(0,b.jsx)(f.Search,{className:"w-4 h-4"}),"Review"]}),R&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"text-[11px] text-gray-500",children:[R.total_matches," match",1!==R.total_matches?"es":""," for “",R.topic,"”"]}),Object.entries(R.by_type).map(([a,c])=>(0,b.jsxs)("details",{open:!0,className:ax,children:[(0,b.jsxs)("summary",{className:"flex items-center gap-2 cursor-pointer list-none",children:[(0,b.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${k[a]||k.context}`,children:a.replace("_"," ")}),(0,b.jsxs)("span",{className:"text-xs text-gray-500",children:[c.length," unit",1!==c.length?"s":""]})]}),(0,b.jsx)("div",{className:"mt-3 space-y-2",children:c.map((a,c)=>(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.04] rounded px-3 py-2",children:[(0,b.jsx)("div",{className:"text-xs text-gray-300 leading-relaxed",children:a.text}),(0,b.jsxs)("div",{className:"mt-1 text-[10px] text-gray-600",children:["confidence: ",a.confidence?.toFixed(2)," · similarity: ",a.similarity?.toFixed(3)]})]},c))})]},a))]})]}),"refine"===j&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.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,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Domain context"}),(0,b.jsx)("textarea",{value:T,onChange:a=>U(a.target.value),placeholder:"Describe the domain or project context to guide distillation...",rows:4,className:av})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Distillation passes"}),(0,b.jsx)("div",{className:"grid grid-cols-2 gap-2",children:Object.keys(V).map(a=>(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[(0,b.jsx)("input",{type:"checkbox",checked:V[a],onChange:b=>W(c=>({...c,[a]:b.target.checked})),className:"rounded border-white/20 bg-white/5 accent-purple-500"}),(0,b.jsx)("span",{className:"text-xs text-gray-400 capitalize",children:a.replace("_"," ")})]},a))})]}),(0,b.jsxs)("button",{onClick:at,disabled:X||!h,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:[X?(0,b.jsx)(B.Loader2,{className:"w-4 h-4 animate-spin"}):(0,b.jsx)(y.RefreshCw,{className:"w-4 h-4"}),"Refine Lobe"]}),Z&&(0,b.jsxs)("div",{className:ax,children:[(0,b.jsx)("div",{className:"text-xs font-medium text-gray-400 mb-3",children:"Refine Results"}),(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Source Units"}),(0,b.jsx)("div",{className:"text-lg font-semibold text-white tabular-nums",children:Z.source_units_found})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Purged"}),(0,b.jsx)("div",{className:"text-lg font-semibold text-amber-400 tabular-nums",children:Z.distilled_purged})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"New Units"}),(0,b.jsx)("div",{className:"text-lg font-semibold text-green-400 tabular-nums",children:Z.new_units_created})]})]})]})]}),"publish"===j&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Package name *"}),(0,b.jsx)("input",{value:_,onChange:a=>aa(a.target.value),placeholder:"my-knowledge-pack",className:av})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Author"}),(0,b.jsx)("input",{value:ab,onChange:a=>ac(a.target.value),placeholder:"Your name or org",className:av})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Description"}),(0,b.jsx)("textarea",{value:ad,onChange:a=>ae(a.target.value),placeholder:"Describe the knowledge pack...",rows:3,className:av})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Tags (comma-separated)"}),(0,b.jsx)("input",{value:af,onChange:a=>ag(a.target.value),placeholder:"e.g. typescript, react, patterns",className:av})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Version"}),(0,b.jsx)("input",{value:ah,onChange:a=>ai(a.target.value),placeholder:"1.0.0",className:av})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"License"}),(0,b.jsxs)("select",{value:aj,onChange:a=>ak(a.target.value),className:av,children:[(0,b.jsx)("option",{value:"MIT",children:"MIT"}),(0,b.jsx)("option",{value:"Apache-2.0",children:"Apache 2.0"}),(0,b.jsx)("option",{value:"GPL-3.0",children:"GPL 3.0"}),(0,b.jsx)("option",{value:"BSD-3-Clause",children:"BSD 3-Clause"}),(0,b.jsx)("option",{value:"CC-BY-4.0",children:"CC BY 4.0"}),(0,b.jsx)("option",{value:"Proprietary",children:"Proprietary"})]})]})]}),(0,b.jsxs)("button",{onClick:au,disabled:al||!_.trim()||!h,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:[al?(0,b.jsx)(B.Loader2,{className:"w-4 h-4 animate-spin"}):(0,b.jsx)(A,{className:"w-4 h-4"}),"Publish to Marketplace"]}),an&&(0,b.jsxs)("div",{className:ax,children:[an.quality_warning&&(0,b.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:an.quality_warning}),(0,b.jsx)("div",{className:"text-xs font-medium text-gray-400 mb-3",children:"Published"}),an.output_path&&(0,b.jsxs)("div",{className:"mb-2",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Output Path"}),(0,b.jsx)("div",{className:"text-xs text-gray-300 font-mono break-all",children:an.output_path})]}),an.pii_scrub&&(0,b.jsxs)("div",{className:"mt-2 pt-2 border-t border-white/[0.06]",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"PII Scrub"}),(0,b.jsxs)("div",{className:"flex gap-4 text-[11px] text-gray-400",children:[(0,b.jsxs)("span",{children:[an.pii_scrub.records_checked.toLocaleString()," records checked"]}),(0,b.jsxs)("span",{children:[an.pii_scrub.fields_scrubbed.toLocaleString()," fields scrubbed"]})]})]})]})]})]})})]})}var F=a.i(296101);function G({filename:a,manifest:d,onImport:e}){let[f,i]=(0,c.useState)(!1),j=d.marketplace??{},k=j.name||a,l=d.version||j.version||"0.0.0",m=j.author||d.author||"Unknown",n=j.description||d.description||"",o=j.tags||d.tags||[],p=j.license||d.license||"",q="number"==typeof j.coverage_score?j.coverage_score:-1,r="number"==typeof d.unit_count?d.unit_count:Array.isArray(d.units)?d.units.length:0,s=j.preview||d.preview||"",t=q<0?"N/A":`${Math.round(100*q)}%`;return(0,b.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,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:"shrink-0 w-9 h-9 rounded-lg bg-purple-500/10 flex items-center justify-center",children:(0,b.jsx)(A,{className:"w-4 h-4 text-purple-400"})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,b.jsx)("span",{className:"text-sm font-semibold text-gray-100 truncate",children:k}),(0,b.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-white/5 text-gray-400 font-mono shrink-0",children:["v",l]})]}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 mt-0.5",children:m})]})]}),n&&(0,b.jsx)("p",{className:"text-xs text-gray-400 leading-relaxed line-clamp-2",children:n}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.map(a=>(0,b.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-white/5 text-gray-400 border border-white/5",children:a},a)),p&&(0,b.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:p})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4 text-[11px]",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsx)("span",{className:"text-gray-600",children:"Coverage:"}),(0,b.jsx)("span",{className:`font-semibold tabular-nums ${q<0?"text-gray-500":q>.7?"text-green-400":q>.3?"text-amber-400":"text-red-400"}`,children:t})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsx)("span",{className:"text-gray-600",children:"Units:"}),(0,b.jsx)("span",{className:"text-gray-300 font-semibold tabular-nums",children:r})]})]}),s&&(0,b.jsxs)("div",{children:[(0,b.jsxs)("button",{onClick:()=>i(a=>!a),className:"flex items-center gap-1 text-[11px] text-gray-500 hover:text-gray-300 transition-colors",children:[f?(0,b.jsx)(h.ChevronUp,{className:"w-3 h-3"}):(0,b.jsx)(g.ChevronDown,{className:"w-3 h-3"}),f?"Hide preview":"Show preview"]}),f&&(0,b.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:s})]}),(0,b.jsx)("button",{onClick:()=>e(a,d),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 H=a.i(633508);function I({filename:a,hasDomainContext:d,onClose:f,onComplete:g}){let[h,i]=(0,c.useState)("personal"),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)("append"),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(!1),[v,w]=(0,c.useState)(null);(0,c.useEffect)(()=>{"workspace"===h&&fetch((0,e.api)("/api/workspaces")).then(a=>a.ok?a.json():null).then(a=>{let b=a?.workspaces??a??[];m(b),b.length>0&&!j&&k(b[0].id)}).catch(()=>{})},[h]);let x=async()=>{u(!0),w(null);try{let b={marketplace_file:a,target_layer:h,merge_strategy:n,re_embed:p};"workspace"===h&&j&&(b.workspace_id=j),d&&(b.apply_domain_context=r);let c=await fetch((0,e.api)("/api/cortex/import"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)});if(!c.ok){let a=await c.json().catch(()=>({}));throw Error(a?.error||`Request failed (${c.status})`)}g()}catch(a){w(a?.message||"Import failed")}finally{u(!1)}};return(0,b.jsx)("div",{className:"fixed inset-0 z-50 bg-black/60 flex items-center justify-center p-4",children:(0,b.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,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-100",children:"Import Pack"}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 mt-0.5 font-mono break-all",children:a})]}),(0,b.jsx)("button",{onClick:f,className:"shrink-0 text-gray-500 hover:text-gray-300 transition-colors","aria-label":"Close",children:(0,b.jsx)(H.X,{className:"w-4 h-4"})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] text-gray-500 uppercase tracking-wide mb-2",children:"Target layer"}),(0,b.jsx)("div",{className:"flex gap-2",children:[{value:"personal",label:"Personal"},{value:"workspace",label:"Workspace"},{value:"team",label:"Team"}].map(a=>(0,b.jsx)("button",{onClick:()=>i(a.value),className:`flex-1 py-1.5 text-xs font-medium rounded-lg border transition-colors ${h===a.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:a.label},a.value))})]}),"workspace"===h&&(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] text-gray-500 uppercase tracking-wide mb-2",children:"Workspace"}),0===l.length?(0,b.jsx)("p",{className:"text-xs text-gray-600",children:"No workspaces found"}):(0,b.jsx)("select",{value:j,onChange:a=>k(a.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:l.map(a=>(0,b.jsx)("option",{value:a.id,children:a.name},a.id))})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] text-gray-500 uppercase tracking-wide mb-2",children:"Merge strategy"}),(0,b.jsx)("div",{className:"flex gap-2",children:[{value:"append",label:"Append"},{value:"merge",label:"Merge"},{value:"replace",label:"Replace"}].map(a=>(0,b.jsx)("button",{onClick:()=>o(a.value),className:`flex-1 py-1.5 text-xs font-medium rounded-lg border transition-colors ${n===a.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:a.label},a.value))})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,b.jsxs)("label",{className:"flex items-center gap-2.5 cursor-pointer select-none group",children:[(0,b.jsx)("input",{type:"checkbox",checked:p,onChange:a=>q(a.target.checked),className:"w-3.5 h-3.5 accent-purple-500"}),(0,b.jsx)("span",{className:"text-xs text-gray-400 group-hover:text-gray-200 transition-colors",children:"Re-embed on import"})]}),d&&(0,b.jsxs)("label",{className:"flex items-center gap-2.5 cursor-pointer select-none group",children:[(0,b.jsx)("input",{type:"checkbox",checked:r,onChange:a=>s(a.target.checked),className:"w-3.5 h-3.5 accent-purple-500"}),(0,b.jsx)("span",{className:"text-xs text-gray-400 group-hover:text-gray-200 transition-colors",children:"Apply domain context"})]})]}),v&&(0,b.jsx)("p",{className:"text-xs text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg px-3 py-2",children:v}),(0,b.jsxs)("button",{onClick:x,disabled:t,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:[t&&(0,b.jsx)(B.Loader2,{className:"w-3.5 h-3.5 animate-spin"}),t?"Importing...":"Import"]})]})})}function J(){let[a,d]=(0,c.useState)([]),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(!1),[j,k]=(0,c.useState)(null),l=(0,c.useCallback)(async()=>{i(!0);try{let a=await fetch((0,e.api)("/api/cortex/marketplace/browse"));if(a.ok){let b=await a.json();d(b.packs??[]),b.directory&&g(b.directory)}}catch{}i(!1)},[]);(0,c.useEffect)(()=>{l()},[l]);let m=(a,b)=>{k({filename:a,manifest:b})},n=j?.manifest?.marketplace?.domain_context!=null||j?.manifest?.domain_context!=null;return(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsxs)("div",{className:"p-4 border-b border-white/5 flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-100",children:"Marketplace"}),f&&(0,b.jsx)("p",{className:"text-[11px] text-gray-600 font-mono mt-0.5 truncate",children:f})]}),(0,b.jsxs)("button",{onClick:l,disabled:h,className:"flex items-center gap-1.5 text-xs text-gray-400 hover:text-gray-200 transition-colors disabled:opacity-50",children:[(0,b.jsx)(y.RefreshCw,{className:`w-3.5 h-3.5 ${h?"animate-spin":""}`}),"Refresh"]})]}),(0,b.jsxs)("div",{className:"flex-1 overflow-y-auto p-4",children:[h&&0===a.length&&(0,b.jsx)("p",{className:"text-sm text-gray-500 text-center py-12",children:"Loading..."}),!h&&0===a.length&&(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-16 text-gray-600",children:[(0,b.jsx)(F.FolderOpen,{className:"w-8 h-8"}),(0,b.jsx)("p",{className:"text-sm",children:"No .cortexpack files found"})]}),a.length>0&&(0,b.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:a.map(a=>(0,b.jsx)(G,{filename:a.filename,manifest:a.manifest,onImport:m},a.filename))})]}),j&&(0,b.jsx)(I,{filename:j.filename,hasDomainContext:n,onClose:()=>k(null),onComplete:()=>{k(null),l()}})]})}var K=a.i(618155),L=a.i(923665),M=a.i(758042),N=a.i(994222),O=a.i(659854),P=a.i(48662),Q=a.i(467149);let R=(0,z.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 S=a.i(50522);let T=(0,z.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 U=a.i(433217),V=a.i(370025),W=a.i(937927);function X({label:a,value:c,sub:d,color:e}){return(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-3",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-1",children:a}),(0,b.jsx)("div",{className:`text-lg font-semibold tabular-nums ${e||"text-white"}`,children:c}),d&&(0,b.jsx)("div",{className:"text-[10px] text-gray-600 mt-0.5",children:d})]})}let Y={background:"#0f0f11",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"0.5rem",fontSize:"11px",color:"#d1d5db"};function Z(a){return a<-10?"#22c55e":a<0?"#86efac":a<5?"#f59e0b":"#ef4444"}function $({result:a}){let[d,e]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"border border-white/[0.05] rounded-lg overflow-hidden",children:[(0,b.jsxs)("button",{onClick:()=>e(a=>!a),className:"w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-white/[0.02] transition-colors",children:[(0,b.jsx)("span",{className:"text-gray-500",children:d?(0,b.jsx)(g.ChevronDown,{className:"w-3.5 h-3.5"}):(0,b.jsx)(S.ChevronRight,{className:"w-3.5 h-3.5"})}),(0,b.jsx)("span",{className:"text-xs text-gray-300 font-mono flex-1 truncate",title:a.task_id,children:a.task_id}),(0,b.jsx)("span",{className:"text-[10px] text-gray-600 w-20",children:a.category}),(0,b.jsx)("span",{className:"text-[10px] text-gray-600 w-12",children:a.difficulty}),(0,b.jsx)("span",{className:"text-[10px] tabular-nums w-16 text-right",style:{color:Z(a.tokens_delta_percent??0)},children:null!=a.tokens_delta_percent?`${a.tokens_delta_percent>0?"+":""}${a.tokens_delta_percent.toFixed(1)}%`:"—"}),(0,b.jsxs)("span",{className:"text-[10px] text-gray-400 tabular-nums w-20 text-right",children:[null!=a.quality_with?a.quality_with.toFixed(2):"—"," / ",null!=a.quality_without?a.quality_without.toFixed(2):"—"]})]}),d&&(0,b.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,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Tokens without"}),(0,b.jsxs)("div",{className:"text-xs text-gray-300 tabular-nums",children:[a.tokens_without_input??"—"," in / ",a.tokens_without_output??"—"," out"]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Tokens with"}),(0,b.jsxs)("div",{className:"text-xs text-gray-300 tabular-nums",children:[a.tokens_with_input??"—"," in / ",a.tokens_with_output??"—"," out"]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Injection"}),(0,b.jsxs)("div",{className:"text-xs text-gray-300 tabular-nums",children:[a.injection_tokens??"—"," tokens"]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Retrieval"}),(0,b.jsxs)("div",{className:"text-xs text-gray-300 tabular-nums",children:[a.retrieval_count??0," hits",null!=a.retrieval_avg_relevance?` \xb7 ${a.retrieval_avg_relevance.toFixed(3)} rel`:"",null!=a.retrieval_latency_ms?` \xb7 ${a.retrieval_latency_ms.toFixed(0)}ms`:""]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Quality improvement"}),(0,b.jsx)("div",{className:"text-xs tabular-nums",style:{color:(a.quality_improvement??0)>0?"#22c55e":(a.quality_improvement??0)<0?"#ef4444":"#6b7280"},children:null!=a.quality_improvement?`${a.quality_improvement>0?"+":""}${a.quality_improvement.toFixed(3)}`:"—"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Judge confidence"}),(0,b.jsx)("div",{className:"text-xs text-gray-300 tabular-nums",children:null!=a.judge_confidence?a.judge_confidence.toFixed(2):"—"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Duration without"}),(0,b.jsx)("div",{className:"text-xs text-gray-300 tabular-nums",children:null!=a.duration_without_ms?`${a.duration_without_ms.toFixed(0)}ms`:"—"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Duration with"}),(0,b.jsx)("div",{className:"text-xs text-gray-300 tabular-nums",children:null!=a.duration_with_ms?`${a.duration_with_ms.toFixed(0)}ms`:"—"})]})]})]})}function _({tier:a}){if(!a)return null;let c={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"}[a.toLowerCase()]||"bg-purple-500/20 text-purple-300 border-purple-500/30";return(0,b.jsx)("span",{className:`text-[9px] px-1.5 py-0.5 rounded border font-medium uppercase ${c}`,children:a})}let aa=["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"],ab={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 ac({current:a,total:c}){let d=c>0?Math.round(a/c*100):0;return(0,b.jsxs)("div",{className:"w-full",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,b.jsxs)("span",{className:"text-[10px] text-gray-500 tabular-nums",children:[a," / ",c>0?c:"?"," tasks"]}),(0,b.jsxs)("span",{className:"text-[10px] text-gray-500 tabular-nums",children:[d,"%"]})]}),(0,b.jsx)("div",{className:"h-1.5 bg-white/[0.06] rounded-full overflow-hidden",children:(0,b.jsx)("div",{className:"h-full bg-purple-500 rounded-full transition-all duration-500",style:{width:`${d}%`}})})]})}function ad({onRunComplete:a}){let d,{data:f}=(0,U.useQuery)({queryKey:["benchmark","status"],queryFn:async()=>{let a=await fetch((0,e.api)("/api/benchmark/status"));return a.ok?a.json():null},refetchInterval:3e3}),h=(d=(0,W.useQueryClient)(),(0,V.useMutation)({mutationFn:async a=>(await fetch((0,e.api)("/api/benchmark/run"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).json(),onSuccess:()=>{d.invalidateQueries({queryKey:["benchmark"]})}})),[i,j]=(0,c.useState)([]),[k,l]=(0,c.useState)("claude-haiku-4-5"),[m,n]=(0,c.useState)(!1),[o,p]=(0,c.useState)(!1),q=f?.running===!0,r=(0,c.useRef)(void 0);(0,c.useEffect)(()=>{!0!==r.current||q||f?.exitCode==null||a(),r.current=q},[q,f?.exitCode,a]);let s=f?.output?f.output.split("\n").filter(a=>a.trim().length>0).slice(-6):[];if(q)return(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4 space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(B.Loader2,{className:"w-3.5 h-3.5 text-purple-400 animate-spin"}),(0,b.jsxs)("span",{className:"text-xs font-medium text-gray-300",children:["Benchmark running — ",f?.preset,f?.categories&&"all"!==f.categories?` (${f.categories})`:""]})]}),(0,b.jsx)("span",{className:"text-[10px] text-gray-600 font-mono",children:f?.model})]}),(0,b.jsx)(ac,{current:f?.progress?.current??0,total:f?.progress?.total??0}),s.length>0&&(0,b.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:s.map((a,c)=>(0,b.jsx)("div",{className:"leading-relaxed",children:a},c))})]});let t=h.data?.error;return(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg overflow-hidden",children:[(0,b.jsx)("div",{className:"px-4 py-3 border-b border-white/[0.05]",children:(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400",children:"Run Benchmark"})}),(0,b.jsxs)("div",{className:"p-4 space-y-2",children:[Object.entries(ab).map(([a,c])=>(0,b.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,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-gray-300",children:c.label}),(0,b.jsx)("span",{className:"text-[10px] text-gray-600",children:c.desc})]}),(0,b.jsxs)("div",{className:"text-[10px] text-gray-600 mt-0.5 tabular-nums",children:[c.tasks," · ",c.time]})]}),(0,b.jsxs)("button",{onClick:()=>{h.mutate({preset:a})},disabled:h.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,b.jsx)(T,{className:"w-2.5 h-2.5"}),"Run"]})]},a)),(0,b.jsxs)("div",{className:"pt-1",children:[(0,b.jsxs)("button",{onClick:()=>p(a=>!a),className:"flex items-center gap-1.5 text-[11px] text-gray-500 hover:text-gray-400 transition-colors",children:[o?(0,b.jsx)(g.ChevronDown,{className:"w-3 h-3"}):(0,b.jsx)(S.ChevronRight,{className:"w-3 h-3"}),"Custom"]}),o&&(0,b.jsxs)("div",{className:"mt-3 space-y-3 pl-1",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-600 uppercase tracking-wider mb-2",children:"Categories"}),(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:aa.map(a=>{let c=i.includes(a);return(0,b.jsx)("button",{onClick:()=>{j(b=>b.includes(a)?b.filter(b=>b!==a):[...b,a])},className:`px-2 py-0.5 text-[10px] rounded border transition-colors ${c?"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:a},a)})}),0===i.length&&(0,b.jsx)("div",{className:"text-[10px] text-gray-600 mt-1",children:"None selected = all categories"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-600 uppercase tracking-wider mb-1",children:"Model"}),(0,b.jsxs)("select",{value:k,onChange:a=>l(a.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,b.jsx)("option",{value:"claude-haiku-4-5",children:"claude-haiku-4-5"}),(0,b.jsx)("option",{value:"claude-sonnet-4-5",children:"claude-sonnet-4-5"}),(0,b.jsx)("option",{value:"claude-opus-4-5",children:"claude-opus-4-5"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 mt-4",children:[(0,b.jsx)("input",{id:"no-judge",type:"checkbox",checked:m,onChange:a=>n(a.target.checked),className:"w-3.5 h-3.5 rounded accent-purple-500"}),(0,b.jsx)("label",{htmlFor:"no-judge",className:"text-[11px] text-gray-400 cursor-pointer",children:"Skip judge"})]})]}),(0,b.jsxs)("button",{onClick:function(){h.mutate({preset:"custom",categories:i.length>0?i.join(","):void 0,noJudge:m,model:k})},disabled:h.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,b.jsx)(T,{className:"w-3 h-3"}),"Run Custom"]})]})]}),t&&(0,b.jsx)("div",{className:"text-[11px] text-red-400 bg-red-500/10 border border-red-500/20 rounded-md px-3 py-2",children:t}),f&&!q&&null!=f.exitCode&&(0,b.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 ",f.exitCode,0===f.exitCode?" (success)":" (error)"]})]})]})}function ae(){let{data:a,isLoading:d,refetch:f}=(0,U.useQuery)({queryKey:["benchmark","runs"],queryFn:async()=>{let a=await fetch((0,e.api)("/api/benchmark/runs"));return a.ok?a.json():null}}),g=a?.runs??[],[h,i]=(0,c.useState)(null),j=h??g[0]?.id??null,{data:k,isLoading:l}=(0,U.useQuery)({queryKey:["benchmark","run",j],queryFn:async()=>{if(!j)return null;let a=await fetch((0,e.api)(`/api/benchmark/runs/${j}`));return a.ok?a.json():null},enabled:!!j}),{data:m}=(0,U.useQuery)({queryKey:["benchmark","lobes"],queryFn:async()=>{let a=await fetch((0,e.api)("/api/benchmark/lobes"));return a.ok?a.json():null}}),n=k?.summary??null,o=k?.categories??[],p=k?.results??[],q=m?.lobes??[],r=!d&&0===g.length;if(d)return(0,b.jsxs)("div",{className:"p-6 max-w-5xl space-y-6",children:[(0,b.jsx)(ad,{onRunComplete:()=>f()}),(0,b.jsx)("div",{className:"text-sm text-gray-500",children:"Loading benchmark data..."})]});if(r)return(0,b.jsxs)("div",{className:"p-6 max-w-5xl space-y-6",children:[(0,b.jsx)(ad,{onRunComplete:()=>f()}),(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-4 py-16 text-gray-600",children:[(0,b.jsx)(R,{className:"w-10 h-10"}),(0,b.jsxs)("p",{className:"text-sm text-center max-w-xs",children:["No benchmark data yet. Use the launcher above or run"," ",(0,b.jsx)("span",{className:"text-gray-500 font-mono text-xs",children:"npm run benchmark"})," ","to generate results."]})]})]});let s=o.map(a=>({name:a.category,delta:parseFloat(a.avgTokenDeltaPercent.toFixed(1))})),t=o.map(a=>({name:a.category,without:parseFloat(a.avgQualityWithout.toFixed(3)),with:parseFloat(a.avgQualityWith.toFixed(3))})),u=[...o].sort((a,b)=>b.hitRate-a.hitRate).map(a=>({name:a.category,hitRate:parseFloat((100*a.hitRate).toFixed(1))}));return(0,b.jsxs)("div",{className:"p-6 max-w-5xl space-y-6",children:[(0,b.jsx)(ad,{onRunComplete:()=>f()}),(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("label",{className:"text-[11px] text-gray-500 shrink-0",children:"Run"}),(0,b.jsx)("select",{value:j??"",onChange:a=>i(a.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:g.map(a=>(0,b.jsxs)("option",{value:a.id,children:[new Date(a.timestamp).toLocaleString()," — ",a.model," (",a.preset,", ",a.task_count," tasks)"]},a.id))})]}),n&&(0,b.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[(0,b.jsx)(X,{label:"Avg Token Delta",value:null!=n.avgTokenDeltaPercent?`${n.avgTokenDeltaPercent>0?"+":""}${n.avgTokenDeltaPercent.toFixed(1)}%`:"—",sub:"vs baseline",color:n.avgTokenDeltaPercent<0?"text-green-400":n.avgTokenDeltaPercent<5?"text-amber-400":"text-red-400"}),(0,b.jsx)(X,{label:"Quality (with)",value:n.avgQualityWith.toFixed(2),sub:"avg LLM judge score",color:"text-purple-400"}),(0,b.jsx)(X,{label:"Quality (without)",value:n.avgQualityWithout.toFixed(2),sub:"baseline"}),(0,b.jsx)(X,{label:"Tasks",value:n.taskCount.toString(),sub:`${o.length} categories`}),(0,b.jsx)(X,{label:"Avg Retrieval",value:n.avgRetrievalLatencyMs?`${n.avgRetrievalLatencyMs.toFixed(0)}ms`:"—",sub:n.avgRetrievalRelevance?`${n.avgRetrievalRelevance.toFixed(3)} relevance`:"relevance"})]}),l&&(0,b.jsx)("div",{className:"text-sm text-gray-500",children:"Loading run details..."}),o.length>0&&(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg overflow-hidden",children:[(0,b.jsx)("div",{className:"px-4 py-3 border-b border-white/[0.05]",children:(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400",children:"Category Breakdown"})}),(0,b.jsx)("div",{className:"overflow-x-auto",children:(0,b.jsxs)("table",{className:"w-full text-xs",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{className:"border-b border-white/[0.05]",children:[(0,b.jsx)("th",{className:"px-4 py-2 text-left text-[10px] text-gray-500 uppercase tracking-wider",children:"Category"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Tasks"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Token Delta"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Quality w/o"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Quality with"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Hit Rate"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Relevance"})]})}),(0,b.jsx)("tbody",{children:o.map((a,c)=>(0,b.jsxs)("tr",{className:`border-b border-white/[0.03] ${c%2==0?"":"bg-white/[0.01]"}`,children:[(0,b.jsx)("td",{className:"px-4 py-2 text-gray-300",children:a.category}),(0,b.jsx)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:a.taskCount}),(0,b.jsxs)("td",{className:"px-4 py-2 text-right tabular-nums font-medium",style:{color:Z(a.avgTokenDeltaPercent)},children:[a.avgTokenDeltaPercent>0?"+":"",a.avgTokenDeltaPercent.toFixed(1),"%"]}),(0,b.jsx)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:a.avgQualityWithout.toFixed(2)}),(0,b.jsx)("td",{className:"px-4 py-2 text-right text-gray-300 tabular-nums font-medium",children:a.avgQualityWith.toFixed(2)}),(0,b.jsxs)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:[(100*a.hitRate).toFixed(0),"%"]}),(0,b.jsx)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:a.avgRetrievalRelevance.toFixed(3)})]},a.category))})]})})]}),o.length>0&&(0,b.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Token Delta % by Category"}),(0,b.jsx)(P.ResponsiveContainer,{width:"100%",height:160,children:(0,b.jsxs)(K.BarChart,{data:s,margin:{top:4,right:4,bottom:4,left:0},children:[(0,b.jsx)(M.XAxis,{dataKey:"name",tick:{fontSize:10,fill:"#6b7280"}}),(0,b.jsx)(N.YAxis,{tick:{fontSize:10,fill:"#6b7280"}}),(0,b.jsx)(O.Tooltip,{contentStyle:Y,formatter:a=>[`${a>0?"+":""}${a}%`,"Token delta"]}),(0,b.jsx)(L.Bar,{dataKey:"delta",radius:[2,2,0,0],children:s.map((a,c)=>(0,b.jsx)(Q.Cell,{fill:Z(a.delta)},c))})]})})]}),(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Quality Score by Category"}),(0,b.jsxs)("div",{className:"flex items-center gap-4 mb-2",children:[(0,b.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-gray-500",children:[(0,b.jsx)("span",{className:"w-2 h-2 rounded-sm inline-block",style:{background:"#6b7280"}}),"Without"]}),(0,b.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-gray-500",children:[(0,b.jsx)("span",{className:"w-2 h-2 rounded-sm inline-block",style:{background:"#7c3aed"}}),"With Cortex"]})]}),(0,b.jsx)(P.ResponsiveContainer,{width:"100%",height:160,children:(0,b.jsxs)(K.BarChart,{data:t,margin:{top:4,right:4,bottom:4,left:0},children:[(0,b.jsx)(M.XAxis,{dataKey:"name",tick:{fontSize:10,fill:"#6b7280"}}),(0,b.jsx)(N.YAxis,{domain:[0,1],tick:{fontSize:10,fill:"#6b7280"}}),(0,b.jsx)(O.Tooltip,{contentStyle:Y}),(0,b.jsx)(L.Bar,{dataKey:"without",fill:"#4b5563",radius:[2,2,0,0]}),(0,b.jsx)(L.Bar,{dataKey:"with",fill:"#7c3aed",radius:[2,2,0,0]})]})})]}),(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4 md:col-span-2",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Knowledge Retrieval Hit Rate %"}),(0,b.jsx)(P.ResponsiveContainer,{width:"100%",height:120,children:(0,b.jsxs)(K.BarChart,{data:u,layout:"vertical",margin:{top:4,right:4,bottom:4,left:60},children:[(0,b.jsx)(M.XAxis,{type:"number",domain:[0,100],tick:{fontSize:10,fill:"#6b7280"}}),(0,b.jsx)(N.YAxis,{type:"category",dataKey:"name",tick:{fontSize:10,fill:"#6b7280"},width:56}),(0,b.jsx)(O.Tooltip,{contentStyle:Y,formatter:a=>[`${a}%`,"Hit rate"]}),(0,b.jsx)(L.Bar,{dataKey:"hitRate",fill:"#06b6d4",radius:[0,2,2,0]})]})})]})]}),q.length>0&&(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg overflow-hidden",children:[(0,b.jsx)("div",{className:"px-4 py-3 border-b border-white/[0.05]",children:(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400",children:"Lobe Scores"})}),(0,b.jsx)("div",{className:"overflow-x-auto",children:(0,b.jsxs)("table",{className:"w-full text-xs",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{className:"border-b border-white/[0.05]",children:[(0,b.jsx)("th",{className:"px-4 py-2 text-left text-[10px] text-gray-500 uppercase tracking-wider",children:"Lobe"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Overall"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Token Savings"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Quality +"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Coverage"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Badge"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Marketplace"})]})}),(0,b.jsx)("tbody",{children:q.map((a,c)=>(0,b.jsxs)("tr",{className:`border-b border-white/[0.03] ${c%2==0?"":"bg-white/[0.01]"}`,children:[(0,b.jsxs)("td",{className:"px-4 py-2",children:[(0,b.jsx)("div",{className:"text-gray-300",children:a.lobe_name}),(0,b.jsx)("div",{className:"text-[9px] text-gray-600 font-mono",children:a.lobe_id})]}),(0,b.jsx)("td",{className:"px-4 py-2 text-right text-purple-400 tabular-nums font-medium",children:null!=a.overall_score?a.overall_score.toFixed(2):"—"}),(0,b.jsx)("td",{className:"px-4 py-2 text-right tabular-nums",style:{color:(a.token_savings??0)>0?"#22c55e":"#6b7280"},children:null!=a.token_savings?`${a.token_savings>0?"+":""}${a.token_savings.toFixed(1)}%`:"—"}),(0,b.jsx)("td",{className:"px-4 py-2 text-right tabular-nums",style:{color:(a.quality_improvement??0)>0?"#22c55e":"#6b7280"},children:null!=a.quality_improvement?`${a.quality_improvement>0?"+":""}${a.quality_improvement.toFixed(3)}`:"—"}),(0,b.jsx)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:null!=a.coverage_score?a.coverage_score.toFixed(2):"—"}),(0,b.jsx)("td",{className:"px-4 py-2 text-right",children:(0,b.jsx)(_,{tier:a.badge_tier})}),(0,b.jsx)("td",{className:"px-4 py-2 text-right",children:a.marketplace_ready?(0,b.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,b.jsx)("span",{className:"text-[9px] text-gray-600",children:"—"})})]},a.id))})]})})]}),p.length>0&&(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg overflow-hidden",children:[(0,b.jsxs)("div",{className:"px-4 py-3 border-b border-white/[0.05] flex items-center justify-between",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400",children:"Task Results"}),(0,b.jsxs)("span",{className:"text-[10px] text-gray-600",children:[p.length," tasks"]})]}),(0,b.jsxs)("div",{className:"px-4 py-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 px-3 py-1 mb-1",children:[(0,b.jsx)("span",{className:"w-3.5"}),(0,b.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider flex-1",children:"Task ID"}),(0,b.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider w-20",children:"Category"}),(0,b.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider w-12",children:"Diff"}),(0,b.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider w-16 text-right",children:"Token %"}),(0,b.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider w-20 text-right",children:"Quality w/w"})]}),(0,b.jsx)("div",{className:"space-y-1",children:p.map(a=>(0,b.jsx)($,{result:a},a.id))})]})]})]})}let af=(0,d.default)(async()=>{},{loadableGenerated:{modules:[756409]},ssr:!1,loading:()=>(0,b.jsx)("div",{className:"flex-1 flex items-center justify-center text-gray-500 text-sm",children:"Loading graph..."})});function ag(){let[a,d]=(0,c.useState)("dashboard"),[f,g]=(0,c.useState)(null);(0,c.useEffect)(()=>{fetch((0,e.api)("/api/cortex/status")).then(a=>a.json()).then(g).catch(()=>{})},[]);let h=f?Object.values(f.layers||{}).reduce((a,b)=>a+(b.count||0),0):0;return(0,b.jsxs)("div",{className:"flex flex-col h-screen bg-gray-950",children:[(0,b.jsxs)("div",{className:"flex items-center border-b border-white/5 px-4 shrink-0",children:[(0,b.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(c=>(0,b.jsx)("button",{onClick:()=>d(c.key),className:`px-5 py-3 text-sm font-medium transition-colors border-b-2 ${a===c.key?"text-purple-400 border-purple-400":"text-gray-500 border-transparent hover:text-gray-300"}`,children:c.label},c.key))}),(0,b.jsxs)("div",{className:"ml-auto text-xs text-gray-600",children:[h," knowledge units"]})]}),(0,b.jsxs)("div",{className:"flex-1 overflow-y-auto",children:["dashboard"===a&&(0,b.jsx)(v,{}),"graph"===a&&(0,b.jsx)(af,{}),"knowledge"===a&&(0,b.jsx)(o,{}),"curation"===a&&(0,b.jsx)(E,{}),"marketplace"===a&&(0,b.jsx)(J,{}),"benchmark"===a&&(0,b.jsx)(ae,{}),"settings"===a&&(0,b.jsx)("div",{className:"p-6 max-w-2xl space-y-8",children:(0,b.jsx)(p.CortexSettings,{})})]})]})}a.s(["default",()=>ag],417835)}];
|
|
1
|
+
module.exports=[417835,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(819721),e=a.i(119032),f=a.i(587532),g=a.i(405784),h=a.i(767552),i=a.i(781560),j=a.i(73570);let k={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"},l={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"},m={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 n({unit:a,onDelete:c,compact:d}){var f;let g,h=k[a.type]||k.context,m=(f=a.created,0===(g=Math.floor((Date.now()-new Date(f).getTime())/864e5))?"today":1===g?"1d ago":g<30?`${g}d ago`:g<365?`${Math.floor(g/30)}mo ago`:`${Math.floor(g/365)}y ago`),n=(a.contradiction_refs?.length??0)>0,o=a.evidence_score??a.confidence,p=null!=a.evidence_score?`${o.toFixed(2)} evidence`:`${Math.round(100*o)}%`,q=async()=>{await fetch((0,e.api)(`/api/cortex/knowledge/${a.id}`),{method:"DELETE"}),c?.(a.id)};return(0,b.jsxs)("div",{className:"group border border-white/5 rounded-lg p-3 hover:border-white/10 transition-colors",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1 flex-wrap",children:[(0,b.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${h}`,children:a.type.replace("_"," ")}),a.sensitivity&&(0,b.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${l[a.sensitivity]||l.internal}`,children:a.sensitivity}),a.scope&&(0,b.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded font-medium bg-purple-500/10 text-purple-400",children:a.scope.level}),(a.stale_score??0)>.3&&(0,b.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded font-medium bg-amber-500/20 text-amber-400",children:"stale"}),n&&(0,b.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,b.jsx)(j.AlertTriangle,{className:"w-2.5 h-2.5"})," contested"]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 text-[10px] text-gray-500 shrink-0",children:[(0,b.jsx)("span",{children:m}),c&&(0,b.jsx)("button",{onClick:q,className:"opacity-0 group-hover:opacity-100 transition-opacity text-red-400 hover:text-red-300",children:(0,b.jsx)(i.Trash2,{className:"w-3 h-3"})})]})]}),(0,b.jsx)("p",{className:"text-xs text-gray-300 mt-1.5 leading-relaxed line-clamp-3",children:a.text}),!d&&a.origin&&(0,b.jsxs)("div",{className:"flex items-center gap-1.5 mt-1.5 text-[10px] text-gray-500 flex-wrap",children:[(0,b.jsxs)("span",{children:["by ",a.origin.creator_entity_id.replace("person-","")]}),(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{children:["via ",a.origin.source_type.replace("_"," ")]}),(a.corroborations??0)>0&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{className:"text-green-400",children:[a.corroborations," corr."]})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,b.jsx)("div",{className:"flex-1 h-1 bg-white/5 rounded-full overflow-hidden",children:(0,b.jsx)("div",{className:"h-full bg-purple-500/50 rounded-full",style:{width:`${Math.round(100*o)}%`}})}),(0,b.jsx)("span",{className:"text-[10px] text-gray-500 tabular-nums",children:p})]})]})}function o(){let[a,d]=(0,c.useState)(""),[i,j]=(0,c.useState)([]),[l,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(null),[v,w]=(0,c.useState)(!1),x=async()=>{if(r.trim()){w(!0);try{let a=await fetch((0,e.api)(`/api/cortex/context?q=${encodeURIComponent(r)}&limit=5`));a.ok&&u(await a.json())}catch{}w(!1)}},y=(0,c.useCallback)(async a=>{o(!0);try{let b=new URLSearchParams({limit:"30"});a&&b.set("q",a);let c=await fetch((0,e.api)(`/api/cortex/search?${b}`));c.ok&&j((await c.json()).results||[])}catch{}o(!1)},[]);(0,c.useEffect)(()=>{y()},[y]);let z=a=>j(b=>b.filter(b=>b.id!==a));return(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsx)("div",{className:"p-4 border-b border-white/5",children:(0,b.jsxs)("div",{className:"relative max-w-md",children:[(0,b.jsx)(f.Search,{className:"absolute left-3 top-2.5 w-4 h-4 text-gray-500"}),(0,b.jsx)("input",{value:a,onChange:a=>d(a.target.value),onKeyDown:b=>"Enter"===b.key&&y(a.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,b.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,b.jsxs)("div",{className:"max-w-2xl space-y-2",children:[l&&(0,b.jsx)("p",{className:"text-sm text-gray-500 text-center py-8",children:"Loading..."}),!l&&0===i.length&&(0,b.jsx)("p",{className:"text-sm text-gray-500 text-center py-8",children:"No knowledge found"}),i.map(a=>(0,b.jsx)(n,{unit:a,onDelete:z},a.id)),(0,b.jsxs)("div",{className:"border-t border-white/5 mt-4 pt-4",children:[(0,b.jsxs)("button",{onClick:()=>q(!p),className:"flex items-center gap-2 text-xs text-gray-500 hover:text-gray-300 mb-3",children:[p?(0,b.jsx)(h.ChevronUp,{className:"w-3 h-3"}):(0,b.jsx)(g.ChevronDown,{className:"w-3 h-3"}),"Query Analyzer"]}),p&&(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex gap-3 mb-4",children:[(0,b.jsxs)("div",{className:"flex-1 relative",children:[(0,b.jsx)(f.Search,{className:"absolute left-3 top-2.5 w-4 h-4 text-gray-500"}),(0,b.jsx)("input",{value:r,onChange:a=>s(a.target.value),onKeyDown:a=>"Enter"===a.key&&x(),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,b.jsx)("button",{onClick:x,disabled:v,className:"px-5 py-2 text-sm bg-purple-600 hover:bg-purple-500 text-white rounded-lg disabled:opacity-50",children:v?"Analyzing...":"Analyze"})]}),!t&&!v&&(0,b.jsx)("p",{className:"text-sm text-gray-600 text-center py-8",children:"Enter a query to see how the Context Engine processes it"}),t&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/5 rounded-lg p-3",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-600 uppercase mb-1",children:"Intent"}),(0,b.jsx)("div",{className:`text-lg font-semibold ${m[t.intent?.intent]||"text-gray-400"}`,children:t.intent?.intent||"?"}),(0,b.jsxs)("div",{className:"text-[10px] text-gray-600",children:["confidence: ",(t.intent?.confidence??0).toFixed(2)]})]}),(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/5 rounded-lg p-3",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-600 uppercase mb-1",children:"Entities"}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[(t.entities||[]).map((a,c)=>(0,b.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 bg-white/5 border border-white/10 rounded text-gray-300",children:[a.entity?.type,":",a.entity?.name]},c)),(!t.entities||0===t.entities.length)&&(0,b.jsx)("span",{className:"text-[10px] text-gray-600",children:"none detected"})]})]}),(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/5 rounded-lg p-3",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-600 uppercase mb-1",children:"Timing"}),(0,b.jsxs)("div",{className:"text-lg font-semibold text-green-400",children:[t.timing?.totalMs??"?","ms"]}),(0,b.jsxs)("div",{className:"text-[10px] text-gray-600",children:["intent ",t.timing?.intentMs,"ms · search ",t.timing?.searchMs,"ms"]})]})]}),(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("div",{className:"text-[10px] text-gray-600 uppercase mb-2",children:["Results (",(t.results||[]).length,")"]}),(0,b.jsx)("div",{className:"space-y-1",children:(t.results||[]).map((a,c)=>(0,b.jsxs)("div",{className:"flex items-center gap-2 bg-white/[0.02] border border-white/5 rounded-lg px-3 py-2",children:[(0,b.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${k[a.type]||k.context}`,children:a.type?.replace("_"," ")}),(0,b.jsx)("span",{className:"text-xs text-gray-300 truncate flex-1",children:a.text}),(0,b.jsx)("span",{className:"text-[10px] text-gray-600 tabular-nums shrink-0",children:(a.relevance_score??0).toFixed(3)})]},c))})]})]})]})]})]})})]})}var p=a.i(565870);function q(a){return a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:a<0x40000000?`${(a/1048576).toFixed(1)} MB`:`${(a/0x40000000).toFixed(2)} GB`}function r({items:a,maxValue:c}){return(0,b.jsx)("div",{className:"space-y-1.5",children:a.map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-[10px] text-gray-500 w-24 text-right truncate",title:a.label,children:a.label}),(0,b.jsx)("div",{className:"flex-1 h-3 bg-white/[0.03] rounded-full overflow-hidden",children:(0,b.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.max(2,a.value/Math.max(c,1)*100)}%`,backgroundColor:a.color}})}),(0,b.jsx)("span",{className:"text-[10px] text-gray-400 w-14 text-right tabular-nums",children:a.value.toLocaleString()})]},a.label))})}function s({label:a,value:c,sub:d,color:e}){return(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-3",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-1",children:a}),(0,b.jsx)("div",{className:`text-lg font-semibold tabular-nums ${e||"text-white"}`,children:c}),d&&(0,b.jsx)("div",{className:"text-[10px] text-gray-600 mt-0.5",children:d})]})}let t=["#7c3aed","#06b6d4","#10b981","#f59e0b","#ef4444","#8b5cf6","#14b8a6","#22c55e","#eab308","#f97316"],u={decision:"#3b82f6",pattern:"#22c55e",preference:"#ec4899",error_fix:"#f59e0b",context:"#6b7280",code_pattern:"#06b6d4",command:"#f97316",conversation:"#64748b",summary:"#8b5cf6"};function v(){let[a,d]=(0,c.useState)(null),[f,g]=(0,c.useState)(!0);if((0,c.useEffect)(()=>{fetch((0,e.api)("/api/cortex/status")).then(a=>a.json()).then(a=>{a.enabled&&d(a)}).catch(()=>{}).finally(()=>g(!1))},[]),f)return(0,b.jsx)("div",{className:"p-6 text-sm text-gray-500",children:"Loading dashboard..."});if(!a)return(0,b.jsx)("div",{className:"p-6 text-sm text-gray-500",children:"Cortex is not active."});let h=Object.entries(a.lobes).sort((a,b)=>b[1].count-a[1].count),i=Math.max(...h.map(([,a])=>a.count),1),j=Math.max(...h.map(([,a])=>a.sizeBytes),1),k=a.usage,m=k?.distillation;return(0,b.jsxs)("div",{className:"p-6 max-w-4xl space-y-6",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,b.jsx)(s,{label:"Knowledge Units",value:a.totalCount.toLocaleString(),sub:`across ${h.length} lobes`,color:"text-purple-400"}),(0,b.jsx)(s,{label:"Storage",value:q(a.totalSizeBytes),sub:`${a.embedding_provider} (${a.embedding_dimensions}d)`}),(0,b.jsx)(s,{label:"Coverage",value:a.quality?a.quality.coverage_score.toFixed(2):"—",sub:a.quality?`${Math.round(100*a.quality.coverage_score)}% distilled`:"no data",color:a.quality?a.quality.coverage_score>.7?"text-green-400":a.quality.coverage_score>.3?"text-amber-400":"text-red-400":"text-gray-500"}),(0,b.jsx)(s,{label:"Distillation",value:m?`$${m.estimated_cost_usd.toFixed(2)}`:"Off",sub:m?`${m.calls.toLocaleString()} calls`:a.distillation?"No API key":"Disabled",color:m?"text-amber-400":"text-gray-500"})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Knowledge by Lobe"}),(0,b.jsx)(r,{items:h.map(([a,b],c)=>({label:b.label||a,value:b.count,color:t[c%t.length]})),maxValue:i})]}),(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Storage by Lobe"}),(0,b.jsx)(r,{items:h.map(([a,b],c)=>({label:b.label||a,value:b.sizeBytes,color:t[c%t.length]})),maxValue:j}),(0,b.jsxs)("div",{className:"mt-2 flex justify-between text-[10px] text-gray-600",children:[(0,b.jsxs)("span",{children:["Smallest: ",q(Math.min(...h.map(([,a])=>a.sizeBytes)))]}),(0,b.jsxs)("span",{children:["Total: ",q(a.totalSizeBytes)]})]})]})]}),a.quality&&(0,b.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Type Distribution"}),(0,b.jsx)(r,{items:Object.entries(a.quality.type_distribution).sort((a,b)=>b[1]-a[1]).map(([a,b])=>({label:a.replace("_"," "),value:b,color:u[a]||"#7c3aed"})),maxValue:Math.max(...Object.values(a.quality.type_distribution),1)})]}),(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Lobe Health"}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex justify-between text-[11px]",children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Stale units"}),(0,b.jsx)("span",{className:a.quality.stale_count>10?"text-amber-400":"text-gray-300",children:a.quality.stale_count})]}),(0,b.jsxs)("div",{className:"flex justify-between text-[11px]",children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Avg confidence"}),(0,b.jsx)("span",{className:"text-gray-300",children:a.quality.avg_confidence.toFixed(2)})]}),a.quality.top_accessed.length>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 mb-1",children:"Top accessed"}),(0,b.jsxs)("div",{className:"text-[11px] text-gray-400 truncate",children:["“",a.quality.top_accessed[0].text,"”"]})]}),a.quality.sensitivity_counts&&(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 mb-1",children:"Sensitivity"}),(0,b.jsx)("div",{className:"flex flex-wrap gap-1",children:Object.entries(a.quality.sensitivity_counts).map(([a,c])=>(0,b.jsxs)("span",{className:`text-[9px] px-1.5 py-0.5 rounded ${l[a]||l.internal}`,children:[c," ",a]},a))})]})]})]})]}),m&&(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Distillation Activity"}),(0,b.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500",children:"API Calls"}),(0,b.jsx)("div",{className:"text-sm font-medium text-white tabular-nums",children:m.calls.toLocaleString()})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500",children:"Input Tokens"}),(0,b.jsxs)("div",{className:"text-sm font-medium text-white tabular-nums",children:[(m.input_tokens/1e3).toFixed(1),"K"]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500",children:"Output Tokens"}),(0,b.jsxs)("div",{className:"text-sm font-medium text-white tabular-nums",children:[(m.output_tokens/1e3).toFixed(1),"K"]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500",children:"Estimated Cost"}),(0,b.jsxs)("div",{className:"text-sm font-medium text-amber-400 tabular-nums",children:["$",m.estimated_cost_usd.toFixed(4)]})]})]}),m.last_updated&&(0,b.jsxs)("div",{className:"mt-2 text-[10px] text-gray-600",children:["Last distillation: ",new Date(m.last_updated).toLocaleString()]}),k.by_model&&Object.keys(k.by_model).length>0&&(0,b.jsxs)("div",{className:"mt-3 border-t border-white/[0.04] pt-3",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 mb-2",children:"By Model"}),Object.entries(k.by_model).map(([a,c])=>(0,b.jsxs)("div",{className:"flex items-center justify-between text-[10px]",children:[(0,b.jsx)("span",{className:"text-gray-400 font-mono",children:a}),(0,b.jsxs)("span",{className:"text-gray-500",children:[c.calls," calls · $",c.estimated_cost_usd.toFixed(4)]})]},a))]})]}),(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"System"}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-1.5 text-[11px]",children:[(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Status"}),(0,b.jsx)("span",{className:"text-green-400",children:a.status})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Embedding"}),(0,b.jsxs)("span",{className:"text-gray-300",children:[a.embedding_provider," (",a.embedding_dimensions,"d)"]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Distillation"}),(0,b.jsx)("span",{className:a.distillation?"text-green-400":"text-gray-600",children:a.distillation?"Enabled":"Disabled"})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Lobes"}),(0,b.jsxs)("span",{className:"text-gray-300",children:[h.length," active"]})]})]})]})]})}var w=a.i(773320),x=a.i(839761),y=a.i(669520),z=a.i(883706);let A=(0,z.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 B=a.i(596221);let C=[{id:"seed",label:"Seed",icon:(0,b.jsx)(w.Upload,{className:"w-3.5 h-3.5"})},{id:"assess",label:"Assess",icon:(0,b.jsx)(x.BarChart3,{className:"w-3.5 h-3.5"})},{id:"review",label:"Review",icon:(0,b.jsx)(f.Search,{className:"w-3.5 h-3.5"})},{id:"refine",label:"Refine",icon:(0,b.jsx)(y.RefreshCw,{className:"w-3.5 h-3.5"})},{id:"publish",label:"Publish",icon:(0,b.jsx)(A,{className:"w-3.5 h-3.5"})}],D={decision:"#3b82f6",pattern:"#22c55e",preference:"#ec4899",error_fix:"#f59e0b",context:"#6b7280",code_pattern:"#06b6d4",command:"#f97316",conversation:"#64748b",summary:"#8b5cf6"};function E(){let a,[d,g]=(0,c.useState)([]),[h,i]=(0,c.useState)(""),[j,l]=(0,c.useState)("seed"),[m,n]=(0,c.useState)(""),[o,p]=(0,c.useState)(""),[q,r]=(0,c.useState)("auto"),[s,t]=(0,c.useState)(""),[u,v]=(0,c.useState)(!0),[z,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)(null),[L,M]=(0,c.useState)(""),[N,O]=(0,c.useState)("25"),[P,Q]=(0,c.useState)(!1),[R,S]=(0,c.useState)(null),[T,U]=(0,c.useState)(""),[V,W]=(0,c.useState)({decisions:!0,patterns:!0,preferences:!0,error_fixes:!0}),[X,Y]=(0,c.useState)(!1),[Z,$]=(0,c.useState)(null),[_,aa]=(0,c.useState)(""),[ab,ac]=(0,c.useState)(""),[ad,ae]=(0,c.useState)(""),[af,ag]=(0,c.useState)(""),[ah,ai]=(0,c.useState)("1.0.0"),[aj,ak]=(0,c.useState)("MIT"),[al,am]=(0,c.useState)(!1),[an,ao]=(0,c.useState)(null),ap=(0,c.useCallback)(()=>{G(null),K(null),S(null),$(null),ao(null),n("")},[]);(0,c.useEffect)(()=>{fetch((0,e.api)("/api/workspaces")).then(a=>a.json()).then(a=>{g(a),a.length>0&&i(a[0].id)}).catch(()=>{})},[]);let aq=async()=>{if(o.trim()&&h){E(!0),n(""),G(null);try{let a=await fetch((0,e.api)("/api/cortex/curation/seed"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:o,format:q,source_ref:s||void 0,workspace_id:h,distill:u})}),b=await a.json();if(!a.ok)throw Error(b.error||b.message||"Seed failed");G(b)}catch(a){n(a instanceof Error?a.message:"Seed failed")}finally{E(!1)}}},ar=async()=>{if(h){I(!0),n(""),K(null);try{let a=await fetch((0,e.api)(`/api/cortex/curation/assess?workspace_id=${encodeURIComponent(h)}`)),b=await a.json();if(!a.ok)throw Error(b.error||b.message||"Assessment failed");K(b)}catch(a){n(a instanceof Error?a.message:"Assessment failed")}finally{I(!1)}}},as=async()=>{if(h&&L.trim()){Q(!0),n(""),S(null);try{let a=new URLSearchParams({workspace_id:h,topic:L.trim(),limit:N}),b=await fetch((0,e.api)(`/api/cortex/curation/review?${a}`)),c=await b.json();if(!b.ok)throw Error(c.error||c.message||"Review failed");S(c)}catch(a){n(a instanceof Error?a.message:"Review failed")}finally{Q(!1)}}},at=async()=>{if(h){Y(!0),n(""),$(null);try{let a=Object.keys(V).filter(a=>V[a]),b=await fetch((0,e.api)("/api/cortex/curation/refine"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace_id:h,domain_context:T||void 0,types:a})}),c=await b.json();if(!b.ok)throw Error(c.error||c.message||"Refine failed");$(c)}catch(a){n(a instanceof Error?a.message:"Refine failed")}finally{Y(!1)}}},au=async()=>{if(h&&_.trim()){am(!0),n(""),ao(null);try{let a=await fetch((0,e.api)("/api/cortex/curation/publish"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace_id:h,name:_,author:ab||void 0,description:ad||void 0,tags:af?af.split(",").map(a=>a.trim()).filter(Boolean):[],version:ah,license:aj})}),b=await a.json();if(!a.ok)throw Error(b.error||b.message||"Publish failed");ao(b)}catch(a){n(a instanceof Error?a.message:"Publish failed")}finally{am(!1)}}},av="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",aw="text-[11px] text-gray-500 mb-1 block",ax="bg-white/[0.02] border border-white/[0.06] rounded-lg p-4";return(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsxs)("div",{className:"px-4 pt-4 pb-3 border-b border-white/5",children:[(0,b.jsx)("label",{className:aw,children:"Workspace"}),(0,b.jsxs)("select",{value:h,onChange:a=>{i(a.target.value),ap()},className:`${av} max-w-xs`,children:[0===d.length&&(0,b.jsx)("option",{value:"",disabled:!0,children:"No workspaces found"}),d.map(a=>(0,b.jsx)("option",{value:a.id,children:a.name},a.id))]})]}),(0,b.jsx)("div",{className:"px-4 py-3 border-b border-white/5",children:(0,b.jsx)("div",{className:"flex items-center",children:C.map((a,c)=>(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsxs)("button",{onClick:()=>{l(a.id),ap()},className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium border transition-colors ${j===a.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:[a.icon,a.label]}),c<C.length-1&&(0,b.jsx)("div",{className:"w-8 h-px bg-white/[0.06]"})]},a.id))})}),(0,b.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,b.jsxs)("div",{className:"max-w-2xl space-y-4",children:[m&&(0,b.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:m}),"seed"===j&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Document content"}),(0,b.jsx)("textarea",{value:o,onChange:a=>p(a.target.value),placeholder:"Paste document content here...",rows:8,className:av})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Format"}),(0,b.jsxs)("select",{value:q,onChange:a=>r(a.target.value),className:av,children:[(0,b.jsx)("option",{value:"auto",children:"Auto-detect"}),(0,b.jsx)("option",{value:"markdown",children:"Markdown"}),(0,b.jsx)("option",{value:"plaintext",children:"Plain text"}),(0,b.jsx)("option",{value:"csv",children:"CSV"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Source reference"}),(0,b.jsx)("input",{value:s,onChange:a=>t(a.target.value),placeholder:"e.g. docs/guide.md",className:av})]})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[(0,b.jsx)("input",{type:"checkbox",checked:u,onChange:a=>v(a.target.checked),className:"rounded border-white/20 bg-white/5 accent-purple-500"}),(0,b.jsx)("span",{className:"text-xs text-gray-400",children:"Distill after seeding"})]}),(0,b.jsxs)("button",{onClick:aq,disabled:z||!o.trim()||!h,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:[z?(0,b.jsx)(B.Loader2,{className:"w-4 h-4 animate-spin"}):(0,b.jsx)(w.Upload,{className:"w-4 h-4"}),"Seed Documents"]}),F&&(0,b.jsxs)("div",{className:ax,children:[(0,b.jsx)("div",{className:"text-xs font-medium text-gray-400 mb-3",children:"Seed Results"}),(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Chunks Created"}),(0,b.jsx)("div",{className:"text-lg font-semibold text-green-400 tabular-nums",children:F.chunksCreated})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Chunks Skipped"}),(0,b.jsx)("div",{className:"text-lg font-semibold text-amber-400 tabular-nums",children:F.chunksSkipped})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Errors"}),(0,b.jsx)("div",{className:`text-lg font-semibold tabular-nums ${F.errors.length>0?"text-red-400":"text-gray-500"}`,children:F.errors.length})]})]}),F.errors.length>0&&(0,b.jsx)("div",{className:"mt-3 space-y-1",children:F.errors.map((a,c)=>(0,b.jsx)("div",{className:"text-xs text-red-400/80",children:a},c))})]})]}),"assess"===j&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("button",{onClick:ar,disabled:H||!h,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,b.jsx)(B.Loader2,{className:"w-4 h-4 animate-spin"}):(0,b.jsx)(x.BarChart3,{className:"w-4 h-4"}),"Run Assessment"]}),J&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,b.jsxs)("div",{className:ax,children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Coverage Score"}),(0,b.jsx)("div",{className:`text-2xl font-semibold tabular-nums ${(a=J.coverage_score)>.7?"text-green-400":a>.3?"text-amber-400":"text-red-400"}`,children:J.coverage_score.toFixed(2)}),(0,b.jsxs)("div",{className:"text-[10px] text-gray-600 mt-0.5",children:[Math.round(100*J.coverage_score),"% covered"]})]}),(0,b.jsxs)("div",{className:ax,children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Total Units"}),(0,b.jsx)("div",{className:"text-2xl font-semibold text-white tabular-nums",children:J.total_units.toLocaleString()})]}),(0,b.jsxs)("div",{className:ax,children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"Stale Count"}),(0,b.jsx)("div",{className:`text-2xl font-semibold tabular-nums ${J.stale_count>10?"text-amber-400":"text-gray-300"}`,children:J.stale_count})]})]}),J.type_distribution&&Object.keys(J.type_distribution).length>0&&(0,b.jsxs)("div",{className:ax,children:[(0,b.jsx)("div",{className:"text-xs font-medium text-gray-400 mb-3",children:"Type Distribution"}),(0,b.jsx)("div",{className:"space-y-1.5",children:Object.entries(J.type_distribution).sort((a,b)=>b[1]-a[1]).map(([a,c])=>{let d=Math.max(...Object.values(J.type_distribution),1);return(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-[10px] text-gray-500 w-24 text-right truncate",children:a.replace("_"," ")}),(0,b.jsx)("div",{className:"flex-1 h-3 bg-white/[0.03] rounded-full overflow-hidden",children:(0,b.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.max(2,c/d*100)}%`,backgroundColor:D[a]||"#7c3aed"}})}),(0,b.jsx)("span",{className:"text-[10px] text-gray-400 w-10 text-right tabular-nums",children:c})]},a)})})]})]})]}),"review"===j&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex gap-3",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("label",{className:aw,children:"Topic filter"}),(0,b.jsx)("input",{value:L,onChange:a=>M(a.target.value),onKeyDown:a=>"Enter"===a.key&&as(),placeholder:"Filter by topic (optional)",className:av})]}),(0,b.jsxs)("div",{className:"w-28",children:[(0,b.jsx)("label",{className:aw,children:"Limit"}),(0,b.jsxs)("select",{value:N,onChange:a=>O(a.target.value),className:av,children:[(0,b.jsx)("option",{value:"10",children:"10"}),(0,b.jsx)("option",{value:"25",children:"25"}),(0,b.jsx)("option",{value:"50",children:"50"})]})]})]}),(0,b.jsxs)("button",{onClick:as,disabled:P||!h||!L.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:[P?(0,b.jsx)(B.Loader2,{className:"w-4 h-4 animate-spin"}):(0,b.jsx)(f.Search,{className:"w-4 h-4"}),"Review"]}),R&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"text-[11px] text-gray-500",children:[R.total_matches," match",1!==R.total_matches?"es":""," for “",R.topic,"”"]}),Object.entries(R.by_type).map(([a,c])=>(0,b.jsxs)("details",{open:!0,className:ax,children:[(0,b.jsxs)("summary",{className:"flex items-center gap-2 cursor-pointer list-none",children:[(0,b.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${k[a]||k.context}`,children:a.replace("_"," ")}),(0,b.jsxs)("span",{className:"text-xs text-gray-500",children:[c.length," unit",1!==c.length?"s":""]})]}),(0,b.jsx)("div",{className:"mt-3 space-y-2",children:c.map((a,c)=>(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.04] rounded px-3 py-2",children:[(0,b.jsx)("div",{className:"text-xs text-gray-300 leading-relaxed",children:a.text}),(0,b.jsxs)("div",{className:"mt-1 text-[10px] text-gray-600",children:["confidence: ",a.confidence?.toFixed(2)," · similarity: ",a.similarity?.toFixed(3)]})]},c))})]},a))]})]}),"refine"===j&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.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,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Domain context"}),(0,b.jsx)("textarea",{value:T,onChange:a=>U(a.target.value),placeholder:"Describe the domain or project context to guide distillation...",rows:4,className:av})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Distillation passes"}),(0,b.jsx)("div",{className:"grid grid-cols-2 gap-2",children:Object.keys(V).map(a=>(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[(0,b.jsx)("input",{type:"checkbox",checked:V[a],onChange:b=>W(c=>({...c,[a]:b.target.checked})),className:"rounded border-white/20 bg-white/5 accent-purple-500"}),(0,b.jsx)("span",{className:"text-xs text-gray-400 capitalize",children:a.replace("_"," ")})]},a))})]}),(0,b.jsxs)("button",{onClick:at,disabled:X||!h,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:[X?(0,b.jsx)(B.Loader2,{className:"w-4 h-4 animate-spin"}):(0,b.jsx)(y.RefreshCw,{className:"w-4 h-4"}),"Refine Lobe"]}),Z&&(0,b.jsxs)("div",{className:ax,children:[(0,b.jsx)("div",{className:"text-xs font-medium text-gray-400 mb-3",children:"Refine Results"}),(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Source Units"}),(0,b.jsx)("div",{className:"text-lg font-semibold text-white tabular-nums",children:Z.source_units_found})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Purged"}),(0,b.jsx)("div",{className:"text-lg font-semibold text-amber-400 tabular-nums",children:Z.distilled_purged})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"New Units"}),(0,b.jsx)("div",{className:"text-lg font-semibold text-green-400 tabular-nums",children:Z.new_units_created})]})]})]})]}),"publish"===j&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Package name *"}),(0,b.jsx)("input",{value:_,onChange:a=>aa(a.target.value),placeholder:"my-knowledge-pack",className:av})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Author"}),(0,b.jsx)("input",{value:ab,onChange:a=>ac(a.target.value),placeholder:"Your name or org",className:av})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Description"}),(0,b.jsx)("textarea",{value:ad,onChange:a=>ae(a.target.value),placeholder:"Describe the knowledge pack...",rows:3,className:av})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Tags (comma-separated)"}),(0,b.jsx)("input",{value:af,onChange:a=>ag(a.target.value),placeholder:"e.g. typescript, react, patterns",className:av})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"Version"}),(0,b.jsx)("input",{value:ah,onChange:a=>ai(a.target.value),placeholder:"1.0.0",className:av})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:aw,children:"License"}),(0,b.jsxs)("select",{value:aj,onChange:a=>ak(a.target.value),className:av,children:[(0,b.jsx)("option",{value:"MIT",children:"MIT"}),(0,b.jsx)("option",{value:"Apache-2.0",children:"Apache 2.0"}),(0,b.jsx)("option",{value:"GPL-3.0",children:"GPL 3.0"}),(0,b.jsx)("option",{value:"BSD-3-Clause",children:"BSD 3-Clause"}),(0,b.jsx)("option",{value:"CC-BY-4.0",children:"CC BY 4.0"}),(0,b.jsx)("option",{value:"Proprietary",children:"Proprietary"})]})]})]}),(0,b.jsxs)("button",{onClick:au,disabled:al||!_.trim()||!h,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:[al?(0,b.jsx)(B.Loader2,{className:"w-4 h-4 animate-spin"}):(0,b.jsx)(A,{className:"w-4 h-4"}),"Publish to Marketplace"]}),an&&(0,b.jsxs)("div",{className:ax,children:[an.quality_warning&&(0,b.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:an.quality_warning}),(0,b.jsx)("div",{className:"text-xs font-medium text-gray-400 mb-3",children:"Published"}),an.output_path&&(0,b.jsxs)("div",{className:"mb-2",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-0.5",children:"Output Path"}),(0,b.jsx)("div",{className:"text-xs text-gray-300 font-mono break-all",children:an.output_path})]}),an.pii_scrub&&(0,b.jsxs)("div",{className:"mt-2 pt-2 border-t border-white/[0.06]",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase mb-1",children:"PII Scrub"}),(0,b.jsxs)("div",{className:"flex gap-4 text-[11px] text-gray-400",children:[(0,b.jsxs)("span",{children:[an.pii_scrub.records_checked.toLocaleString()," records checked"]}),(0,b.jsxs)("span",{children:[an.pii_scrub.fields_scrubbed.toLocaleString()," fields scrubbed"]})]})]})]})]})]})})]})}var F=a.i(296101);function G({filename:a,manifest:d,onImport:e}){let[f,i]=(0,c.useState)(!1),j=d.marketplace??{},k=j.name||a,l=d.version||j.version||"0.0.0",m=j.author||d.author||"Unknown",n=j.description||d.description||"",o=j.tags||d.tags||[],p=j.license||d.license||"",q="number"==typeof j.coverage_score?j.coverage_score:-1,r="number"==typeof d.unit_count?d.unit_count:Array.isArray(d.units)?d.units.length:0,s=j.preview||d.preview||"",t=q<0?"N/A":`${Math.round(100*q)}%`;return(0,b.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,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:"shrink-0 w-9 h-9 rounded-lg bg-purple-500/10 flex items-center justify-center",children:(0,b.jsx)(A,{className:"w-4 h-4 text-purple-400"})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,b.jsx)("span",{className:"text-sm font-semibold text-gray-100 truncate",children:k}),(0,b.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-white/5 text-gray-400 font-mono shrink-0",children:["v",l]})]}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 mt-0.5",children:m})]})]}),n&&(0,b.jsx)("p",{className:"text-xs text-gray-400 leading-relaxed line-clamp-2",children:n}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.map(a=>(0,b.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-white/5 text-gray-400 border border-white/5",children:a},a)),p&&(0,b.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:p})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4 text-[11px]",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsx)("span",{className:"text-gray-600",children:"Coverage:"}),(0,b.jsx)("span",{className:`font-semibold tabular-nums ${q<0?"text-gray-500":q>.7?"text-green-400":q>.3?"text-amber-400":"text-red-400"}`,children:t})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsx)("span",{className:"text-gray-600",children:"Units:"}),(0,b.jsx)("span",{className:"text-gray-300 font-semibold tabular-nums",children:r})]})]}),s&&(0,b.jsxs)("div",{children:[(0,b.jsxs)("button",{onClick:()=>i(a=>!a),className:"flex items-center gap-1 text-[11px] text-gray-500 hover:text-gray-300 transition-colors",children:[f?(0,b.jsx)(h.ChevronUp,{className:"w-3 h-3"}):(0,b.jsx)(g.ChevronDown,{className:"w-3 h-3"}),f?"Hide preview":"Show preview"]}),f&&(0,b.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:s})]}),(0,b.jsx)("button",{onClick:()=>e(a,d),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 H=a.i(633508);function I({filename:a,hasDomainContext:d,onClose:f,onComplete:g}){let[h,i]=(0,c.useState)("personal"),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)("append"),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(!1),[v,w]=(0,c.useState)(null);(0,c.useEffect)(()=>{"workspace"===h&&fetch((0,e.api)("/api/workspaces")).then(a=>a.ok?a.json():null).then(a=>{let b=a?.workspaces??a??[];m(b),b.length>0&&!j&&k(b[0].id)}).catch(()=>{})},[h]);let x=async()=>{u(!0),w(null);try{let b={marketplace_file:a,target_layer:h,merge_strategy:n,re_embed:p};"workspace"===h&&j&&(b.workspace_id=j),d&&(b.apply_domain_context=r);let c=await fetch((0,e.api)("/api/cortex/import"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)});if(!c.ok){let a=await c.json().catch(()=>({}));throw Error(a?.error||`Request failed (${c.status})`)}g()}catch(a){w(a?.message||"Import failed")}finally{u(!1)}};return(0,b.jsx)("div",{className:"fixed inset-0 z-50 bg-black/60 flex items-center justify-center p-4",children:(0,b.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,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-100",children:"Import Pack"}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 mt-0.5 font-mono break-all",children:a})]}),(0,b.jsx)("button",{onClick:f,className:"shrink-0 text-gray-500 hover:text-gray-300 transition-colors","aria-label":"Close",children:(0,b.jsx)(H.X,{className:"w-4 h-4"})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] text-gray-500 uppercase tracking-wide mb-2",children:"Target layer"}),(0,b.jsx)("div",{className:"flex gap-2",children:[{value:"personal",label:"Personal"},{value:"workspace",label:"Workspace"},{value:"team",label:"Team"}].map(a=>(0,b.jsx)("button",{onClick:()=>i(a.value),className:`flex-1 py-1.5 text-xs font-medium rounded-lg border transition-colors ${h===a.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:a.label},a.value))})]}),"workspace"===h&&(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] text-gray-500 uppercase tracking-wide mb-2",children:"Workspace"}),0===l.length?(0,b.jsx)("p",{className:"text-xs text-gray-600",children:"No workspaces found"}):(0,b.jsx)("select",{value:j,onChange:a=>k(a.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:l.map(a=>(0,b.jsx)("option",{value:a.id,children:a.name},a.id))})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] text-gray-500 uppercase tracking-wide mb-2",children:"Merge strategy"}),(0,b.jsx)("div",{className:"flex gap-2",children:[{value:"append",label:"Append"},{value:"merge",label:"Merge"},{value:"replace",label:"Replace"}].map(a=>(0,b.jsx)("button",{onClick:()=>o(a.value),className:`flex-1 py-1.5 text-xs font-medium rounded-lg border transition-colors ${n===a.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:a.label},a.value))})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,b.jsxs)("label",{className:"flex items-center gap-2.5 cursor-pointer select-none group",children:[(0,b.jsx)("input",{type:"checkbox",checked:p,onChange:a=>q(a.target.checked),className:"w-3.5 h-3.5 accent-purple-500"}),(0,b.jsx)("span",{className:"text-xs text-gray-400 group-hover:text-gray-200 transition-colors",children:"Re-embed on import"})]}),d&&(0,b.jsxs)("label",{className:"flex items-center gap-2.5 cursor-pointer select-none group",children:[(0,b.jsx)("input",{type:"checkbox",checked:r,onChange:a=>s(a.target.checked),className:"w-3.5 h-3.5 accent-purple-500"}),(0,b.jsx)("span",{className:"text-xs text-gray-400 group-hover:text-gray-200 transition-colors",children:"Apply domain context"})]})]}),v&&(0,b.jsx)("p",{className:"text-xs text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg px-3 py-2",children:v}),(0,b.jsxs)("button",{onClick:x,disabled:t,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:[t&&(0,b.jsx)(B.Loader2,{className:"w-3.5 h-3.5 animate-spin"}),t?"Importing...":"Import"]})]})})}function J(){let[a,d]=(0,c.useState)([]),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(!1),[j,k]=(0,c.useState)(null),l=(0,c.useCallback)(async()=>{i(!0);try{let a=await fetch((0,e.api)("/api/cortex/marketplace/browse"));if(a.ok){let b=await a.json();d(b.packs??[]),b.directory&&g(b.directory)}}catch{}i(!1)},[]);(0,c.useEffect)(()=>{l()},[l]);let m=(a,b)=>{k({filename:a,manifest:b})},n=j?.manifest?.marketplace?.domain_context!=null||j?.manifest?.domain_context!=null;return(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsxs)("div",{className:"p-4 border-b border-white/5 flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-100",children:"Marketplace"}),f&&(0,b.jsx)("p",{className:"text-[11px] text-gray-600 font-mono mt-0.5 truncate",children:f})]}),(0,b.jsxs)("button",{onClick:l,disabled:h,className:"flex items-center gap-1.5 text-xs text-gray-400 hover:text-gray-200 transition-colors disabled:opacity-50",children:[(0,b.jsx)(y.RefreshCw,{className:`w-3.5 h-3.5 ${h?"animate-spin":""}`}),"Refresh"]})]}),(0,b.jsxs)("div",{className:"flex-1 overflow-y-auto p-4",children:[h&&0===a.length&&(0,b.jsx)("p",{className:"text-sm text-gray-500 text-center py-12",children:"Loading..."}),!h&&0===a.length&&(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-16 text-gray-600",children:[(0,b.jsx)(F.FolderOpen,{className:"w-8 h-8"}),(0,b.jsx)("p",{className:"text-sm",children:"No .cortexpack files found"})]}),a.length>0&&(0,b.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:a.map(a=>(0,b.jsx)(G,{filename:a.filename,manifest:a.manifest,onImport:m},a.filename))})]}),j&&(0,b.jsx)(I,{filename:j.filename,hasDomainContext:n,onClose:()=>k(null),onComplete:()=>{k(null),l()}})]})}var K=a.i(618155),L=a.i(923665),M=a.i(758042),N=a.i(994222),O=a.i(659854),P=a.i(48662),Q=a.i(467149);let R=(0,z.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 S=a.i(50522);let T=(0,z.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 U=a.i(433217),V=a.i(370025),W=a.i(937927);function X({label:a,value:c,sub:d,color:e}){return(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-3",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-1",children:a}),(0,b.jsx)("div",{className:`text-lg font-semibold tabular-nums ${e||"text-white"}`,children:c}),d&&(0,b.jsx)("div",{className:"text-[10px] text-gray-600 mt-0.5",children:d})]})}let Y={background:"#0f0f11",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"0.5rem",fontSize:"11px",color:"#d1d5db"};function Z(a){return a<-10?"#22c55e":a<0?"#86efac":a<5?"#f59e0b":"#ef4444"}function $({result:a}){let[d,e]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"border border-white/[0.05] rounded-lg overflow-hidden",children:[(0,b.jsxs)("button",{onClick:()=>e(a=>!a),className:"w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-white/[0.02] transition-colors",children:[(0,b.jsx)("span",{className:"text-gray-500",children:d?(0,b.jsx)(g.ChevronDown,{className:"w-3.5 h-3.5"}):(0,b.jsx)(S.ChevronRight,{className:"w-3.5 h-3.5"})}),(0,b.jsx)("span",{className:"text-xs text-gray-300 font-mono flex-1 truncate",title:a.task_id,children:a.task_id}),(0,b.jsx)("span",{className:"text-[10px] text-gray-600 w-20",children:a.category}),(0,b.jsx)("span",{className:"text-[10px] text-gray-600 w-12",children:a.difficulty}),(0,b.jsx)("span",{className:"text-[10px] tabular-nums w-16 text-right",style:{color:Z(a.tokens_delta_percent??0)},children:null!=a.tokens_delta_percent?`${a.tokens_delta_percent>0?"+":""}${a.tokens_delta_percent.toFixed(1)}%`:"—"}),(0,b.jsxs)("span",{className:"text-[10px] text-gray-400 tabular-nums w-20 text-right",children:[null!=a.quality_with?a.quality_with.toFixed(2):"—"," / ",null!=a.quality_without?a.quality_without.toFixed(2):"—"]})]}),d&&(0,b.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,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Tokens without"}),(0,b.jsxs)("div",{className:"text-xs text-gray-300 tabular-nums",children:[a.tokens_without_input??"—"," in / ",a.tokens_without_output??"—"," out"]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Tokens with"}),(0,b.jsxs)("div",{className:"text-xs text-gray-300 tabular-nums",children:[a.tokens_with_input??"—"," in / ",a.tokens_with_output??"—"," out"]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Injection"}),(0,b.jsxs)("div",{className:"text-xs text-gray-300 tabular-nums",children:[a.injection_tokens??"—"," tokens"]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Retrieval"}),(0,b.jsxs)("div",{className:"text-xs text-gray-300 tabular-nums",children:[a.retrieval_count??0," hits",null!=a.retrieval_avg_relevance?` \xb7 ${a.retrieval_avg_relevance.toFixed(3)} rel`:"",null!=a.retrieval_latency_ms?` \xb7 ${a.retrieval_latency_ms.toFixed(0)}ms`:""]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Quality improvement"}),(0,b.jsx)("div",{className:"text-xs tabular-nums",style:{color:(a.quality_improvement??0)>0?"#22c55e":(a.quality_improvement??0)<0?"#ef4444":"#6b7280"},children:null!=a.quality_improvement?`${a.quality_improvement>0?"+":""}${a.quality_improvement.toFixed(3)}`:"—"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Judge confidence"}),(0,b.jsx)("div",{className:"text-xs text-gray-300 tabular-nums",children:null!=a.judge_confidence?a.judge_confidence.toFixed(2):"—"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Duration without"}),(0,b.jsx)("div",{className:"text-xs text-gray-300 tabular-nums",children:null!=a.duration_without_ms?`${a.duration_without_ms.toFixed(0)}ms`:"—"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[9px] text-gray-600 uppercase mb-0.5",children:"Duration with"}),(0,b.jsx)("div",{className:"text-xs text-gray-300 tabular-nums",children:null!=a.duration_with_ms?`${a.duration_with_ms.toFixed(0)}ms`:"—"})]})]})]})}function _({tier:a}){if(!a)return null;let c={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"}[a.toLowerCase()]||"bg-purple-500/20 text-purple-300 border-purple-500/30";return(0,b.jsx)("span",{className:`text-[9px] px-1.5 py-0.5 rounded border font-medium uppercase ${c}`,children:a})}let aa=["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"],ab={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 ac({current:a,total:c}){let d=c>0?Math.round(a/c*100):0;return(0,b.jsxs)("div",{className:"w-full",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,b.jsxs)("span",{className:"text-[10px] text-gray-500 tabular-nums",children:[a," / ",c>0?c:"?"," tasks"]}),(0,b.jsxs)("span",{className:"text-[10px] text-gray-500 tabular-nums",children:[d,"%"]})]}),(0,b.jsx)("div",{className:"h-1.5 bg-white/[0.06] rounded-full overflow-hidden",children:(0,b.jsx)("div",{className:"h-full bg-purple-500 rounded-full transition-all duration-500",style:{width:`${d}%`}})})]})}function ad({onRunComplete:a}){let d,{data:f}=(0,U.useQuery)({queryKey:["benchmark","status"],queryFn:async()=>{let a=await fetch((0,e.api)("/api/benchmark/status"));return a.ok?a.json():null},refetchInterval:3e3}),h=(d=(0,W.useQueryClient)(),(0,V.useMutation)({mutationFn:async a=>(await fetch((0,e.api)("/api/benchmark/run"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).json(),onSuccess:()=>{d.invalidateQueries({queryKey:["benchmark"]})}})),[i,j]=(0,c.useState)([]),[k,l]=(0,c.useState)("claude-haiku-4-5"),[m,n]=(0,c.useState)(!1),[o,p]=(0,c.useState)(1),[q,r]=(0,c.useState)(!1),s=f?.running===!0,t=(0,c.useRef)(void 0);(0,c.useEffect)(()=>{!0!==t.current||s||f?.exitCode==null||a(),t.current=s},[s,f?.exitCode,a]);let u=f?.output?f.output.split("\n").filter(a=>a.trim().length>0).slice(-6):[];if(s)return(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4 space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(B.Loader2,{className:"w-3.5 h-3.5 text-purple-400 animate-spin"}),(0,b.jsxs)("span",{className:"text-xs font-medium text-gray-300",children:["Benchmark running — ",f?.preset,f?.categories&&"all"!==f.categories?` (${f.categories})`:""]})]}),(0,b.jsx)("span",{className:"text-[10px] text-gray-600 font-mono",children:f?.model})]}),(0,b.jsx)(ac,{current:f?.progress?.current??0,total:f?.progress?.total??0}),u.length>0&&(0,b.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:u.map((a,c)=>(0,b.jsx)("div",{className:"leading-relaxed",children:a},c))})]});let v=h.data?.error;return(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg overflow-hidden",children:[(0,b.jsx)("div",{className:"px-4 py-3 border-b border-white/[0.05]",children:(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400",children:"Run Benchmark"})}),(0,b.jsxs)("div",{className:"p-4 space-y-2",children:[Object.entries(ab).map(([a,c])=>(0,b.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,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-gray-300",children:c.label}),(0,b.jsx)("span",{className:"text-[10px] text-gray-600",children:c.desc})]}),(0,b.jsxs)("div",{className:"text-[10px] text-gray-600 mt-0.5 tabular-nums",children:[c.tasks," · ",c.time]})]}),(0,b.jsxs)("button",{onClick:()=>{h.mutate({preset:a})},disabled:h.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,b.jsx)(T,{className:"w-2.5 h-2.5"}),"Run"]})]},a)),(0,b.jsxs)("div",{className:"pt-1",children:[(0,b.jsxs)("button",{onClick:()=>r(a=>!a),className:"flex items-center gap-1.5 text-[11px] text-gray-500 hover:text-gray-400 transition-colors",children:[q?(0,b.jsx)(g.ChevronDown,{className:"w-3 h-3"}):(0,b.jsx)(S.ChevronRight,{className:"w-3 h-3"}),"Custom"]}),q&&(0,b.jsxs)("div",{className:"mt-3 space-y-3 pl-1",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-600 uppercase tracking-wider mb-2",children:"Categories"}),(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:aa.map(a=>{let c=i.includes(a);return(0,b.jsx)("button",{onClick:()=>{j(b=>b.includes(a)?b.filter(b=>b!==a):[...b,a])},className:`px-2 py-0.5 text-[10px] rounded border transition-colors ${c?"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:a},a)})}),0===i.length&&(0,b.jsx)("div",{className:"text-[10px] text-gray-600 mt-1",children:"None selected = all categories"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-600 uppercase tracking-wider mb-1",children:"Model"}),(0,b.jsxs)("select",{value:k,onChange:a=>l(a.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,b.jsx)("option",{value:"claude-haiku-4-5",children:"claude-haiku-4-5"}),(0,b.jsx)("option",{value:"claude-sonnet-4-5",children:"claude-sonnet-4-5"}),(0,b.jsx)("option",{value:"claude-opus-4-5",children:"claude-opus-4-5"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-600 uppercase tracking-wider mb-1",children:"Concurrency"}),(0,b.jsx)("input",{type:"number",min:1,max:5,value:o,onChange:a=>p(Math.min(5,Math.max(1,parseInt(a.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,b.jsxs)("div",{className:"flex items-center gap-2 mt-4",children:[(0,b.jsx)("input",{id:"no-judge",type:"checkbox",checked:m,onChange:a=>n(a.target.checked),className:"w-3.5 h-3.5 rounded accent-purple-500"}),(0,b.jsx)("label",{htmlFor:"no-judge",className:"text-[11px] text-gray-400 cursor-pointer",children:"Skip judge"})]})]}),(0,b.jsxs)("button",{onClick:function(){h.mutate({preset:"custom",categories:i.length>0?i.join(","):void 0,noJudge:m,model:k,concurrency:o})},disabled:h.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,b.jsx)(T,{className:"w-3 h-3"}),"Run Custom"]})]})]}),v&&(0,b.jsx)("div",{className:"text-[11px] text-red-400 bg-red-500/10 border border-red-500/20 rounded-md px-3 py-2",children:v}),f&&!s&&null!=f.exitCode&&(0,b.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 ",f.exitCode,0===f.exitCode?" (success)":" (error)"]})]})]})}function ae(){let{data:a,isLoading:d,refetch:f}=(0,U.useQuery)({queryKey:["benchmark","runs"],queryFn:async()=>{let a=await fetch((0,e.api)("/api/benchmark/runs"));return a.ok?a.json():null}}),g=a?.runs??[],[h,i]=(0,c.useState)(null),j=h??g[0]?.id??null,{data:k,isLoading:l}=(0,U.useQuery)({queryKey:["benchmark","run",j],queryFn:async()=>{if(!j)return null;let a=await fetch((0,e.api)(`/api/benchmark/runs/${j}`));return a.ok?a.json():null},enabled:!!j}),{data:m}=(0,U.useQuery)({queryKey:["benchmark","lobes"],queryFn:async()=>{let a=await fetch((0,e.api)("/api/benchmark/lobes"));return a.ok?a.json():null}}),n=k?.summary??null,o=k?.categories??[],p=k?.results??[],q=m?.lobes??[],r=!d&&0===g.length;if(d)return(0,b.jsxs)("div",{className:"p-6 max-w-5xl space-y-6",children:[(0,b.jsx)(ad,{onRunComplete:()=>f()}),(0,b.jsx)("div",{className:"text-sm text-gray-500",children:"Loading benchmark data..."})]});if(r)return(0,b.jsxs)("div",{className:"p-6 max-w-5xl space-y-6",children:[(0,b.jsx)(ad,{onRunComplete:()=>f()}),(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-4 py-16 text-gray-600",children:[(0,b.jsx)(R,{className:"w-10 h-10"}),(0,b.jsxs)("p",{className:"text-sm text-center max-w-xs",children:["No benchmark data yet. Use the launcher above or run"," ",(0,b.jsx)("span",{className:"text-gray-500 font-mono text-xs",children:"npm run benchmark"})," ","to generate results."]})]})]});let s=o.map(a=>({name:a.category,delta:parseFloat(a.avgTokenDeltaPercent.toFixed(1))})),t=o.map(a=>({name:a.category,without:parseFloat(a.avgQualityWithout.toFixed(3)),with:parseFloat(a.avgQualityWith.toFixed(3))})),u=[...o].sort((a,b)=>b.hitRate-a.hitRate).map(a=>({name:a.category,hitRate:parseFloat((100*a.hitRate).toFixed(1))}));return(0,b.jsxs)("div",{className:"p-6 max-w-5xl space-y-6",children:[(0,b.jsx)(ad,{onRunComplete:()=>f()}),(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("label",{className:"text-[11px] text-gray-500 shrink-0",children:"Run"}),(0,b.jsx)("select",{value:j??"",onChange:a=>i(a.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:g.map(a=>(0,b.jsxs)("option",{value:a.id,children:[new Date(a.timestamp).toLocaleString()," — ",a.model," (",a.preset,", ",a.task_count," tasks)"]},a.id))})]}),n&&(0,b.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[(0,b.jsx)(X,{label:"Avg Token Delta",value:null!=n.avgTokenDeltaPercent?`${n.avgTokenDeltaPercent>0?"+":""}${n.avgTokenDeltaPercent.toFixed(1)}%`:"—",sub:"vs baseline",color:n.avgTokenDeltaPercent<0?"text-green-400":n.avgTokenDeltaPercent<5?"text-amber-400":"text-red-400"}),(0,b.jsx)(X,{label:"Quality (with)",value:n.avgQualityWith.toFixed(2),sub:"avg LLM judge score",color:"text-purple-400"}),(0,b.jsx)(X,{label:"Quality (without)",value:n.avgQualityWithout.toFixed(2),sub:"baseline"}),(0,b.jsx)(X,{label:"Tasks",value:n.taskCount.toString(),sub:`${o.length} categories`}),(0,b.jsx)(X,{label:"Avg Retrieval",value:n.avgRetrievalLatencyMs?`${n.avgRetrievalLatencyMs.toFixed(0)}ms`:"—",sub:n.avgRetrievalRelevance?`${n.avgRetrievalRelevance.toFixed(3)} relevance`:"relevance"})]}),l&&(0,b.jsx)("div",{className:"text-sm text-gray-500",children:"Loading run details..."}),o.length>0&&(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg overflow-hidden",children:[(0,b.jsx)("div",{className:"px-4 py-3 border-b border-white/[0.05]",children:(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400",children:"Category Breakdown"})}),(0,b.jsx)("div",{className:"overflow-x-auto",children:(0,b.jsxs)("table",{className:"w-full text-xs",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{className:"border-b border-white/[0.05]",children:[(0,b.jsx)("th",{className:"px-4 py-2 text-left text-[10px] text-gray-500 uppercase tracking-wider",children:"Category"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Tasks"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Token Delta"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Quality w/o"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Quality with"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Hit Rate"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Relevance"})]})}),(0,b.jsx)("tbody",{children:o.map((a,c)=>(0,b.jsxs)("tr",{className:`border-b border-white/[0.03] ${c%2==0?"":"bg-white/[0.01]"}`,children:[(0,b.jsx)("td",{className:"px-4 py-2 text-gray-300",children:a.category}),(0,b.jsx)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:a.taskCount}),(0,b.jsxs)("td",{className:"px-4 py-2 text-right tabular-nums font-medium",style:{color:Z(a.avgTokenDeltaPercent)},children:[a.avgTokenDeltaPercent>0?"+":"",a.avgTokenDeltaPercent.toFixed(1),"%"]}),(0,b.jsx)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:a.avgQualityWithout.toFixed(2)}),(0,b.jsx)("td",{className:"px-4 py-2 text-right text-gray-300 tabular-nums font-medium",children:a.avgQualityWith.toFixed(2)}),(0,b.jsxs)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:[(100*a.hitRate).toFixed(0),"%"]}),(0,b.jsx)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:a.avgRetrievalRelevance.toFixed(3)})]},a.category))})]})})]}),o.length>0&&(0,b.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Token Delta % by Category"}),(0,b.jsx)(P.ResponsiveContainer,{width:"100%",height:160,children:(0,b.jsxs)(K.BarChart,{data:s,margin:{top:4,right:4,bottom:4,left:0},children:[(0,b.jsx)(M.XAxis,{dataKey:"name",tick:{fontSize:10,fill:"#6b7280"}}),(0,b.jsx)(N.YAxis,{tick:{fontSize:10,fill:"#6b7280"}}),(0,b.jsx)(O.Tooltip,{contentStyle:Y,formatter:a=>[`${a>0?"+":""}${a}%`,"Token delta"]}),(0,b.jsx)(L.Bar,{dataKey:"delta",radius:[2,2,0,0],children:s.map((a,c)=>(0,b.jsx)(Q.Cell,{fill:Z(a.delta)},c))})]})})]}),(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Quality Score by Category"}),(0,b.jsxs)("div",{className:"flex items-center gap-4 mb-2",children:[(0,b.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-gray-500",children:[(0,b.jsx)("span",{className:"w-2 h-2 rounded-sm inline-block",style:{background:"#6b7280"}}),"Without"]}),(0,b.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-gray-500",children:[(0,b.jsx)("span",{className:"w-2 h-2 rounded-sm inline-block",style:{background:"#7c3aed"}}),"With Cortex"]})]}),(0,b.jsx)(P.ResponsiveContainer,{width:"100%",height:160,children:(0,b.jsxs)(K.BarChart,{data:t,margin:{top:4,right:4,bottom:4,left:0},children:[(0,b.jsx)(M.XAxis,{dataKey:"name",tick:{fontSize:10,fill:"#6b7280"}}),(0,b.jsx)(N.YAxis,{domain:[0,1],tick:{fontSize:10,fill:"#6b7280"}}),(0,b.jsx)(O.Tooltip,{contentStyle:Y}),(0,b.jsx)(L.Bar,{dataKey:"without",fill:"#4b5563",radius:[2,2,0,0]}),(0,b.jsx)(L.Bar,{dataKey:"with",fill:"#7c3aed",radius:[2,2,0,0]})]})})]}),(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg p-4 md:col-span-2",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400 mb-3",children:"Knowledge Retrieval Hit Rate %"}),(0,b.jsx)(P.ResponsiveContainer,{width:"100%",height:120,children:(0,b.jsxs)(K.BarChart,{data:u,layout:"vertical",margin:{top:4,right:4,bottom:4,left:60},children:[(0,b.jsx)(M.XAxis,{type:"number",domain:[0,100],tick:{fontSize:10,fill:"#6b7280"}}),(0,b.jsx)(N.YAxis,{type:"category",dataKey:"name",tick:{fontSize:10,fill:"#6b7280"},width:56}),(0,b.jsx)(O.Tooltip,{contentStyle:Y,formatter:a=>[`${a}%`,"Hit rate"]}),(0,b.jsx)(L.Bar,{dataKey:"hitRate",fill:"#06b6d4",radius:[0,2,2,0]})]})})]})]}),q.length>0&&(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg overflow-hidden",children:[(0,b.jsx)("div",{className:"px-4 py-3 border-b border-white/[0.05]",children:(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400",children:"Lobe Scores"})}),(0,b.jsx)("div",{className:"overflow-x-auto",children:(0,b.jsxs)("table",{className:"w-full text-xs",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{className:"border-b border-white/[0.05]",children:[(0,b.jsx)("th",{className:"px-4 py-2 text-left text-[10px] text-gray-500 uppercase tracking-wider",children:"Lobe"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Overall"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Token Savings"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Quality +"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Coverage"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Badge"}),(0,b.jsx)("th",{className:"px-4 py-2 text-right text-[10px] text-gray-500 uppercase tracking-wider",children:"Marketplace"})]})}),(0,b.jsx)("tbody",{children:q.map((a,c)=>(0,b.jsxs)("tr",{className:`border-b border-white/[0.03] ${c%2==0?"":"bg-white/[0.01]"}`,children:[(0,b.jsxs)("td",{className:"px-4 py-2",children:[(0,b.jsx)("div",{className:"text-gray-300",children:a.lobe_name}),(0,b.jsx)("div",{className:"text-[9px] text-gray-600 font-mono",children:a.lobe_id})]}),(0,b.jsx)("td",{className:"px-4 py-2 text-right text-purple-400 tabular-nums font-medium",children:null!=a.overall_score?a.overall_score.toFixed(2):"—"}),(0,b.jsx)("td",{className:"px-4 py-2 text-right tabular-nums",style:{color:(a.token_savings??0)>0?"#22c55e":"#6b7280"},children:null!=a.token_savings?`${a.token_savings>0?"+":""}${a.token_savings.toFixed(1)}%`:"—"}),(0,b.jsx)("td",{className:"px-4 py-2 text-right tabular-nums",style:{color:(a.quality_improvement??0)>0?"#22c55e":"#6b7280"},children:null!=a.quality_improvement?`${a.quality_improvement>0?"+":""}${a.quality_improvement.toFixed(3)}`:"—"}),(0,b.jsx)("td",{className:"px-4 py-2 text-right text-gray-400 tabular-nums",children:null!=a.coverage_score?a.coverage_score.toFixed(2):"—"}),(0,b.jsx)("td",{className:"px-4 py-2 text-right",children:(0,b.jsx)(_,{tier:a.badge_tier})}),(0,b.jsx)("td",{className:"px-4 py-2 text-right",children:a.marketplace_ready?(0,b.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,b.jsx)("span",{className:"text-[9px] text-gray-600",children:"—"})})]},a.id))})]})})]}),p.length>0&&(0,b.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-lg overflow-hidden",children:[(0,b.jsxs)("div",{className:"px-4 py-3 border-b border-white/[0.05] flex items-center justify-between",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-gray-400",children:"Task Results"}),(0,b.jsxs)("span",{className:"text-[10px] text-gray-600",children:[p.length," tasks"]})]}),(0,b.jsxs)("div",{className:"px-4 py-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 px-3 py-1 mb-1",children:[(0,b.jsx)("span",{className:"w-3.5"}),(0,b.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider flex-1",children:"Task ID"}),(0,b.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider w-20",children:"Category"}),(0,b.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider w-12",children:"Diff"}),(0,b.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider w-16 text-right",children:"Token %"}),(0,b.jsx)("span",{className:"text-[9px] text-gray-600 uppercase tracking-wider w-20 text-right",children:"Quality w/w"})]}),(0,b.jsx)("div",{className:"space-y-1",children:p.map(a=>(0,b.jsx)($,{result:a},a.id))})]})]})]})}let af=(0,d.default)(async()=>{},{loadableGenerated:{modules:[756409]},ssr:!1,loading:()=>(0,b.jsx)("div",{className:"flex-1 flex items-center justify-center text-gray-500 text-sm",children:"Loading graph..."})});function ag(){let[a,d]=(0,c.useState)("dashboard"),[f,g]=(0,c.useState)(null);(0,c.useEffect)(()=>{fetch((0,e.api)("/api/cortex/status")).then(a=>a.json()).then(g).catch(()=>{})},[]);let h=f?Object.values(f.layers||{}).reduce((a,b)=>a+(b.count||0),0):0;return(0,b.jsxs)("div",{className:"flex flex-col h-screen bg-gray-950",children:[(0,b.jsxs)("div",{className:"flex items-center border-b border-white/5 px-4 shrink-0",children:[(0,b.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(c=>(0,b.jsx)("button",{onClick:()=>d(c.key),className:`px-5 py-3 text-sm font-medium transition-colors border-b-2 ${a===c.key?"text-purple-400 border-purple-400":"text-gray-500 border-transparent hover:text-gray-300"}`,children:c.label},c.key))}),(0,b.jsxs)("div",{className:"ml-auto text-xs text-gray-600",children:[h," knowledge units"]})]}),(0,b.jsxs)("div",{className:"flex-1 overflow-y-auto",children:["dashboard"===a&&(0,b.jsx)(v,{}),"graph"===a&&(0,b.jsx)(af,{}),"knowledge"===a&&(0,b.jsx)(o,{}),"curation"===a&&(0,b.jsx)(E,{}),"marketplace"===a&&(0,b.jsx)(J,{}),"benchmark"===a&&(0,b.jsx)(ae,{}),"settings"===a&&(0,b.jsx)("div",{className:"p-6 max-w-2xl space-y-8",children:(0,b.jsx)(p.CortexSettings,{})})]})]})}a.s(["default",()=>ag],417835)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_app_%28desktop%29_cortex_page_tsx_0f33d8b3._.js.map
|