switchboard-router 0.9.60 → 0.9.62
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/app/.next/static/chunks/1321-5586527eb9770b48.js +1 -0
- package/app/.next/static/chunks/4601-44deee06e6597c34.js +1 -0
- package/app/{.next-cli-build/static/chunks/app/(dashboard)/dashboard/agent-library/page-fa24110e606e19b6.js → .next/static/chunks/app/(dashboard)/dashboard/agent-library/page-5099a8abbc816db2.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-7b00fb83303d1d11.js → page-f19524e912fe1985.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-e59f3822e2167ab7.js → page-5ffac5b1a7f569eb.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-d994adf3e0ce78c1.js → page-e88926cdf34f51b4.js} +1 -1
- package/app/{.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-99d3be5c7da63d57.js → .next/static/chunks/app/(dashboard)/dashboard/combos/page-f18e04dca95f62e1.js} +1 -1
- package/app/{.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/routing/page-650dc0927f999aaf.js → .next/static/chunks/app/(dashboard)/dashboard/combos/routing/page-0fbb282f4f13b383.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/console-log/{page-eefda4a8f32e649e.js → page-a6d96961aa96c6f6.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/{page-adba2750c4fbf61e.js → page-57222cb64d90dbc5.js} +1 -1
- package/app/{.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-e6fc3a5c25ce1247.js → .next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-b538f94596e78384.js} +1 -1
- package/app/{.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-078eb5d8bfc3f4d1.js → .next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-e5f3c1f8be627058.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-7dfde081613f35f3.js → page-3b278b46c2e9b047.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/{page-1d63cfd88010b65f.js → page-768e0fe3ec5c50cb.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-281c93713fd1e960.js → page-932db86bb9b65c82.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/{page-f44e14a7efc8f81a.js → page-77d678509c4b9807.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/{page-0e0047609d5634c9.js → page-be26ebe2eb5fe86f.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-7650a3a5ee2467f7.js +10 -0
- package/app/{.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/page-604dae851964c441.js → .next/static/chunks/app/(dashboard)/dashboard/providers/new/page-40b58bbd9ed53384.js} +1 -1
- package/app/{.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-e1c9f4ce8466e3ad.js → .next/static/chunks/app/(dashboard)/dashboard/providers/page-62fb355a1fda21fb.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/pxpipe/{page-6ca234b58c5e9feb.js → page-da3416bfce941d67.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/{page-cf70f587dc7ab205.js → page-c9a257b85e05472a.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/skills/[id]/{page-ea262b6192d5a92c.js → page-2141fe25b428c1a8.js} +1 -1
- package/app/{.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-36d107b083ad3a43.js → .next/static/chunks/app/(dashboard)/dashboard/skills/page-459447066f6cd1d5.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/token-saver/{page-14e5599c720c645b.js → page-93ce8e180c126dcc.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/{page-687e09f904b04cea.js → page-b6c5cc339e7a5ef3.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/{page-195bdcbea10136e1.js → page-492962969724f559.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/{layout-6dfa9d7deb27d461.js → layout-c0725f0b6b7f0bea.js} +1 -1
- package/app/.next/static/chunks/app/dashboard/settings/pricing/page-e08a7bfc3255b9c7.js +1 -0
- package/app/.next/static/chunks/app/layout-5fa07c6e20da16ba.js +1 -0
- package/app/.next/static/chunks/app/login/{page-f326e6c17a8b0e04.js → page-df9fdce0e38e5f58.js} +1 -1
- package/app/.next/static/media/catalog.b2c6512a.json +38874 -0
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +14 -14
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/prerender-manifest.json +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/catalog/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/doctor/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/export/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/mcp/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/skills/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/sync/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/updates/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +6 -6
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-full-catalog/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-picker-labels/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/fx-settings/manual-configs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/fx-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/fx-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/manual-configs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/picker-labels/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/live/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/strategy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/health/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/metrics/route.js +2 -2
- package/app/.next-cli-build/server/app/api/mgmt/v1/metrics/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/routing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/usage/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/routable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/defaults/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/cache/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/prepare/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/remove-unavailable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/cancel/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/feedback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/insights/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/learn/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/versions/promote/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/versions/rollback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/skills/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/token-saver/vault-stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +14 -14
- package/app/.next-cli-build/server/chunks/1350.js +1 -1
- package/app/.next-cli-build/server/chunks/2847.js +1 -1
- package/app/.next-cli-build/server/chunks/3464.js +1 -1
- package/app/.next-cli-build/server/chunks/369.js +16 -14
- package/app/.next-cli-build/server/chunks/3904.js +1 -1
- package/app/.next-cli-build/server/chunks/4454.js +1 -1
- package/app/.next-cli-build/server/chunks/4646.js +1 -1
- package/app/.next-cli-build/server/chunks/5139.js +1 -1
- package/app/.next-cli-build/server/chunks/7662.js +1 -1
- package/app/.next-cli-build/server/chunks/7757.js +1 -1
- package/app/.next-cli-build/server/chunks/869.js +1 -1
- package/app/.next-cli-build/server/chunks/8998.js +8 -8
- package/app/.next-cli-build/server/chunks/static/media/catalog.b2c6512a.json +38874 -0
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/app/.next-cli-build/static/chunks/1321-5586527eb9770b48.js +1 -0
- package/app/.next-cli-build/static/chunks/4601-44deee06e6597c34.js +1 -0
- package/app/{.next/static/chunks/app/(dashboard)/dashboard/agent-library/page-fa24110e606e19b6.js → .next-cli-build/static/chunks/app/(dashboard)/dashboard/agent-library/page-5099a8abbc816db2.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-7b00fb83303d1d11.js → page-f19524e912fe1985.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-e59f3822e2167ab7.js → page-5ffac5b1a7f569eb.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-d994adf3e0ce78c1.js → page-e88926cdf34f51b4.js} +1 -1
- package/app/{.next/static/chunks/app/(dashboard)/dashboard/combos/page-99d3be5c7da63d57.js → .next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-f18e04dca95f62e1.js} +1 -1
- package/app/{.next/static/chunks/app/(dashboard)/dashboard/combos/routing/page-650dc0927f999aaf.js → .next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/routing/page-0fbb282f4f13b383.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/{page-eefda4a8f32e649e.js → page-a6d96961aa96c6f6.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/{page-adba2750c4fbf61e.js → page-57222cb64d90dbc5.js} +1 -1
- package/app/{.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-e6fc3a5c25ce1247.js → .next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-b538f94596e78384.js} +1 -1
- package/app/{.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-078eb5d8bfc3f4d1.js → .next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-e5f3c1f8be627058.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-7dfde081613f35f3.js → page-3b278b46c2e9b047.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/{page-1d63cfd88010b65f.js → page-768e0fe3ec5c50cb.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-281c93713fd1e960.js → page-932db86bb9b65c82.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-f44e14a7efc8f81a.js → page-77d678509c4b9807.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/{page-0e0047609d5634c9.js → page-be26ebe2eb5fe86f.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-7650a3a5ee2467f7.js +10 -0
- package/app/{.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-604dae851964c441.js → .next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/page-40b58bbd9ed53384.js} +1 -1
- package/app/{.next/static/chunks/app/(dashboard)/dashboard/providers/page-e1c9f4ce8466e3ad.js → .next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-62fb355a1fda21fb.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/{page-6ca234b58c5e9feb.js → page-da3416bfce941d67.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-cf70f587dc7ab205.js → page-c9a257b85e05472a.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/[id]/{page-ea262b6192d5a92c.js → page-2141fe25b428c1a8.js} +1 -1
- package/app/{.next/static/chunks/app/(dashboard)/dashboard/skills/page-36d107b083ad3a43.js → .next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-459447066f6cd1d5.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/{page-14e5599c720c645b.js → page-93ce8e180c126dcc.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-687e09f904b04cea.js → page-b6c5cc339e7a5ef3.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/{page-195bdcbea10136e1.js → page-492962969724f559.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-6dfa9d7deb27d461.js → layout-c0725f0b6b7f0bea.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/dashboard/settings/pricing/page-e08a7bfc3255b9c7.js +1 -0
- package/app/.next-cli-build/static/chunks/app/layout-5fa07c6e20da16ba.js +1 -0
- package/app/.next-cli-build/static/chunks/app/login/{page-f326e6c17a8b0e04.js → page-df9fdce0e38e5f58.js} +1 -1
- package/app/.next-cli-build/static/media/catalog.b2c6512a.json +38874 -0
- package/app/open-sse/identity/tls/bin/darwin/arm64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/darwin/x64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/linux/arm64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/linux/x64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/win32/arm64/switchboard-claude-tls.exe +0 -0
- package/app/open-sse/identity/tls/bin/win32/x64/switchboard-claude-tls.exe +0 -0
- package/app/open-sse/providers/generated/catalog.json +37152 -0
- package/app/package.json +3 -2
- package/cli.js +5 -1
- package/package.json +1 -1
- package/src/shared/heapSize.js +35 -0
- package/app/.next/static/chunks/1321-0ab72f9128c10ae8.js +0 -1
- package/app/.next/static/chunks/4707-8ea6ba647d0a40c9.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-9bc17a08bc8f466c.js +0 -10
- package/app/.next/static/chunks/app/dashboard/settings/pricing/page-423a4c1e078872dd.js +0 -1
- package/app/.next/static/chunks/app/layout-26e1615874db4cd7.js +0 -1
- package/app/.next/static/media/catalog.fb7b1b70.json +0 -1722
- package/app/.next-cli-build/server/chunks/static/media/catalog.fb7b1b70.json +0 -1722
- package/app/.next-cli-build/static/chunks/1321-0ab72f9128c10ae8.js +0 -1
- package/app/.next-cli-build/static/chunks/4707-8ea6ba647d0a40c9.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-9bc17a08bc8f466c.js +0 -10
- package/app/.next-cli-build/static/chunks/app/dashboard/settings/pricing/page-423a4c1e078872dd.js +0 -1
- package/app/.next-cli-build/static/chunks/app/layout-26e1615874db4cd7.js +0 -1
- package/app/.next-cli-build/static/media/catalog.fb7b1b70.json +0 -1722
- /package/app/.next/static/{kn4tTYMd_zh76SjzZUnxP → cd9DZQ978U7eW2QFBhfwd}/_buildManifest.js +0 -0
- /package/app/.next/static/{kn4tTYMd_zh76SjzZUnxP → cd9DZQ978U7eW2QFBhfwd}/_ssgManifest.js +0 -0
- /package/app/.next-cli-build/static/{kn4tTYMd_zh76SjzZUnxP → cd9DZQ978U7eW2QFBhfwd}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{kn4tTYMd_zh76SjzZUnxP → cd9DZQ978U7eW2QFBhfwd}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6897],{5194:(e,s,t)=>{Promise.resolve().then(t.bind(t,66176))},35497:(e,s,t)=>{"use strict";t.d(s,{x0:()=>N.default,Ex:()=>o.default,$n:()=>a.default,nh:()=>$.default,Zp:()=>i.default,Qv:()=>d.CardSkeleton,CK:()=>h.default,uo:()=>n.ConfirmModal,G9:()=>y.default,wI:()=>w.default,vj:()=>v.default,vE:()=>j.default,pd:()=>r.default,Mh:()=>f.default,uR:()=>p.default,Nf:()=>u.default,aF:()=>n.default,rq:()=>x.default,gw:()=>k.default,LF:()=>m.default,Wx:()=>P.default,gM:()=>g.default,Iz:()=>C.default,l6:()=>l.default,lM:()=>c.default,m_:()=>S.default,jK:()=>b.default});var a=t(92542),r=t(11910),l=t(98),i=t(84588),n=t(81127),d=t(25086);t(56319);var o=t(56061),c=t(98542);t(61929),t(21110),t(92622),t(8823),t(92173);var m=t(90882),x=t(72908),p=t(28815),h=t(45455),u=t(28058),b=t(4809);t(21931),t(80752),t(40197);var g=t(23615);t(44736);var f=t(62899);t(94230);var y=t(30815),j=t(23936),v=t(95088),w=t(73579),N=t(96748),k=t(4823),C=t(28067),S=t(97677),P=t(51825),$=t(29366);t(76361),t(91450)},66176:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>d});var a=t(95155),r=t(12115),l=t(35497),i=t(77251),n=t(65921);function d(){let e,s,[t,d]=(0,r.useState)(null),[c,m]=(0,r.useState)(!0),[x,p]=(0,r.useState)(""),h=(0,n.i)(),[u,b]=(0,r.useState)(null),[g,f]=(0,r.useState)(null),[y,j]=(0,r.useState)("overview");(0,r.useEffect)(()=>{{let e=new URLSearchParams(window.location.search).get("tab");e&&["overview","skills","mcp","catalog","advanced"].includes(e)&&j(e)}},[]);let[v,w]=(0,r.useState)({id:"",name:"",transport:"stdio",command:"npx",args:"-y @modelcontextprotocol/server-filesystem .",url:"",notes:""}),[N,k]=(0,r.useState)([]),[C,S]=(0,r.useState)([]),[P,$]=(0,r.useState)(""),[E,T]=(0,r.useState)([]),[I,O]=(0,r.useState)(""),[M,z]=(0,r.useState)(""),[A,L]=(0,r.useState)(""),[U,R]=(0,r.useState)(""),[D,Z]=(0,r.useState)(!1),[J,G]=(0,r.useState)(""),[_,F]=(0,r.useState)(""),[K,H]=(0,r.useState)({}),[Q,W]=(0,r.useState)(null),[B,q]=(0,r.useState)(!1),[Y,V]=(0,r.useState)(""),[X,ee]=(0,r.useState)(null),es=(0,r.useCallback)(async()=>{m(!0);try{let e=await fetch("/api/agent-library",{cache:"no-store"}),s=await e.json();if(!e.ok)throw Error(s.error||"Load failed");d(s)}catch(e){h.error(e.message)}finally{m(!1)}},[]),et=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/agent-library/updates",{cache:"no-store"}),s=await e.json();if(!e.ok)return;let t={};for(let e of s.results||[])t[e.id]=e;H(t)}catch{}},[]);(0,r.useEffect)(()=>{es(),et(),fetch("/api/agent-library/catalog").then(async e=>{let s=await e.json().catch(()=>({}));if(!e.ok)throw Error(s.error||"Failed to load skill catalog");k(s.presets||[]),S(s.mcpPresets||[])}).catch(e=>h.error(e.message))},[es,et]);let ea=t?.settings||{},er=t?.agents||{};async function el(e){p("settings");try{let s=await fetch("/api/agent-library",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),t=await s.json();if(!s.ok)throw Error(t.error||"Save failed");h.success("Settings saved"),await es()}catch(e){h.error(e.message)}finally{p("")}}async function ei(e){p(e),f(null);try{let s=await fetch("/api/agent-library/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,confirm:"clean"===e||void 0})}),t=await s.json();if(!s.ok)throw Error(t.error||t.message||"Sync failed");f(t);let a="dry-run"===e?`Dry-run: ${t.summary?.skillsSynced??0} skill ops, ${t.summary?.mcpOk??0} MCP ok, ${t.conflictCount||0} conflicts`:"clean"===e?"Removed Switchboard-managed projections only":`Applied: ${t.summary?.skillsSynced??0} skills synced, ${t.conflictCount||0} conflicts protected`;t.conflictCount?h.warning(a):h.success(a),await es()}catch(e){h.error(e.message)}finally{p("")}}async function en(){p("doctor");try{let e=await fetch("/api/agent-library/doctor",{cache:"no-store"}),s=await e.json();if(!e.ok)throw Error(s.error||"Doctor failed");b(s),s.ok?h.success("Doctor: no blocking errors"):h.warning(`Doctor: ${s.issues?.filter(e=>"error"===e.severity).length||0} errors`)}catch(e){h.error(e.message)}finally{p("")}}async function ed(e){e?.preventDefault?.(),p("mcp");try{let e=v.args?function(e){let s=[],t="",a=!1,r="";for(let l=0;l<e.length;l++){let i=e[l];r?"\\"===i&&'"'===r&&void 0!==e[l+1]?t+=e[++l]:i===r?r="":t+=i:'"'===i||"'"===i?(r=i,a=!0):"\\"===i&&void 0!==e[l+1]?t+=e[++l]:/\s/.test(i)?((t||a)&&s.push(t),t="",a=!1):(t+=i,a=!0)}return(t||a)&&s.push(t),s}(v.args):[],s=await fetch("/api/agent-library/mcp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:v.id,name:v.name||v.id,transport:v.transport,command:"stdio"===v.transport?v.command:void 0,args:"stdio"===v.transport?e:void 0,url:"stdio"!==v.transport?v.url:void 0,notes:v.notes})}),t=await s.json();if(!s.ok)throw Error(t.error||"MCP save failed");t.warnings?.length?h.warning(t.warnings.join(" \xb7 ")):h.success(`MCP ${t.server?.id} saved (Apply to project)`),w({id:"",name:"",transport:"stdio",command:"npx",args:"",url:"",notes:""}),await es()}catch(e){h.error(e.message)}finally{p("")}}async function eo(e){p(`mcp-preset-${e.id}`);try{let s=await fetch("/api/agent-library/mcp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id,name:e.name||e.id,transport:e.transport||"stdio",command:e.command,args:e.args,url:e.url,env:e.env,notes:e.notes})}),t=await s.json();if(!s.ok)throw Error(t.error||"MCP preset save failed");h.success(`MCP ${t.server?.id||e.id} saved to library. Click Apply sync to project to agents.`),await es()}catch(e){h.error(e.message)}finally{p("")}}function ec(e){w({id:e.id,name:e.name||e.id,transport:e.transport||"stdio",command:e.command||"npx",args:(e.args||[]).join(" "),url:e.url||"",notes:e.notes||""}),h.success(`Loaded ${e.name} into form below. Edit parameters as needed and click Save.`)}async function em(e){if(await (0,i.l)({message:`Remove MCP ${e} from library? (targets updated on next Apply)`,confirmText:"Continue"})){p("mcp-del");try{let s=await fetch(`/api/agent-library/mcp?id=${encodeURIComponent(e)}`,{method:"DELETE"}),t=await s.json();if(!s.ok)throw Error(t.error||"Delete failed");h.success("MCP removed from library"),await es()}catch(e){h.error(e.message)}finally{p("")}}}async function ex(e){if(await (0,i.l)({message:`Remove skill ${e} from library?`,confirmText:"Continue"})){p("skill-del");try{let s=await fetch(`/api/agent-library/skills?id=${encodeURIComponent(e)}`,{method:"DELETE"}),t=await s.json();if(!s.ok)throw Error(t.error||"Delete failed");h.success("Skill removed from library"),await es(),await et()}catch(e){h.error(e.message)}finally{p("")}}}async function ep(){p("skill-add");try{let e=await fetch("/api/agent-library/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:J,markdown:_,source:"manual"})}),s=await e.json();if(!e.ok)throw Error(s.error);h.success(`Skill ${s.id} installed in library`),G(""),F(""),await es()}catch(e){h.error(e.message)}finally{p("")}}async function eh(e){p("upd-preview"),q(!1);try{let s=await fetch("/api/agent-library/updates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"preview",skillId:e})}),t=await s.json();if(!s.ok||!t.ok)throw Error(t.message||t.error||"Preview failed");W({id:e,markdown:t.markdown,contentHash:t.contentHash})}catch(e){h.error(e.message)}finally{p("")}}async function eu(){if(Q){p("upd-apply");try{let e=await fetch("/api/agent-library/updates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update",skillId:Q.id,confirmed:B,expectedHash:Q.contentHash})}),s=await e.json();if(!e.ok||!s.ok)throw Error(s.message||s.error||"Update failed");h.success(s.warning||`Updated ${s.id}`),W(null),q(!1),await es(),await et()}catch(e){h.error(e.message)}finally{p("")}}}async function eb(e){if(e?.preventDefault?.(),P.trim()){p("resolve"),O("");try{let e=await fetch("/api/agent-library/catalog",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"resolve",input:P.trim()})}),s=await e.json();if(!e.ok||!s.ok)throw Error(s.message||s.error||"Resolution failed");let t=s.skills||[];T(t),1===t.length?(L(t[0].skillId),z(t[0].rawUrl),R(t[0].preview||""),Z(!1),h.success(`Resolved skill: ${t[0].skillId}`)):t.length>1&&(L(""),z(""),R(""),Z(!1),h.success(`Found ${t.length} skills in ${s.repo||"repository"}. Select one below.`))}catch(e){h.error(e.message)}finally{p("")}}}async function eg(e){p("preview");try{let s=await fetch("/api/agent-library/catalog",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"preview",url:e})}),t=await s.json();if(!s.ok||!t.ok)throw Error(t.error||"Preview failed");R(t.preview||""),h.success(`Preview loaded (${t.bytes} bytes)`)}catch(e){h.error(e.message)}finally{p("")}}async function ef(){p("catalog");try{let e=await fetch("/api/agent-library/catalog",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"install",skillId:A,url:M,confirmed:D})}),s=await e.json();if(!e.ok)throw Error(s.message||s.error||"Install failed");O(s.id||A),h.success(s.warning||`Installed ${s.id}`),Z(!1),await es(),await et()}catch(e){h.error(e.message)}finally{p("")}}async function ey(){p("export");try{let e=await fetch("/api/agent-library/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({destPath:Y||void 0})}),s=await e.json();if(!e.ok)throw Error(s.message||s.error||"Export failed");h.success(`Exported AgentSync layout to ${s.path}`)}catch(e){h.error(e.message)}finally{p("")}}return(0,a.jsxs)("div",{className:"max-w-5xl mx-auto space-y-5 pb-12",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("h1",{className:"text-[17px] font-semibold text-text-main",children:"Agent library"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted leading-relaxed max-w-2xl",children:["One Switchboard-owned library of ",(0,a.jsx)("strong",{className:"text-text-main",children:"skills"})," and"," ",(0,a.jsx)("strong",{className:"text-text-main",children:"MCP servers"}),", projected into Claude Code, Codex, OpenCode, Gemini CLI, and Cursor. Managed entries use the"," ",(0,a.jsx)("code",{className:"text-[11px] font-mono",children:"sb-"})," namespace so we never overwrite your existing skills or MCP keys."]})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm text-text-main cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",className:"accent-[var(--color-primary)]","aria-label":"Sync enabled",checked:!1!==ea.enabled,disabled:!!x,onChange:e=>el({enabled:e.target.checked})}),"Sync enabled"]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:!!x||!1===ea.enabled,loading:"dry-run"===x,onClick:()=>ei("dry-run"),children:"Dry-run"}),(0,a.jsx)(l.$n,{size:"sm",disabled:!!x||!1===ea.enabled,loading:"apply"===x,onClick:()=>ei("apply"),children:"Apply sync"}),(0,a.jsx)(l.$n,{size:"sm",variant:"outline",disabled:!!x,loading:"doctor"===x,onClick:en,children:"Doctor"})]})]}),(0,a.jsxs)("p",{className:"text-[11px] text-text-subtle mt-2 font-mono break-all",children:["Library: ",t?.libraryRoot||"…",ea.linkMode?` \xb7 mode=${ea.linkMode}`:"",ea.scope?` \xb7 scope=${ea.scope}`:""]})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 border-b border-border pb-0",children:[{id:"overview",label:"Overview"},{id:"skills",label:"Skills"},{id:"mcp",label:"MCP"},{id:"catalog",label:"Catalog"},{id:"advanced",label:"Advanced"}].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>{j(e.id);try{window.history.replaceState(null,"",`?tab=${e.id}`)}catch{}},className:`px-3 py-2 text-xs font-medium rounded-t-md transition-colors ${y===e.id?"bg-surface border border-border border-b-surface text-primary -mb-px":"text-text-muted hover:text-text-main"}`,children:e.label},e.id))}),c&&(0,a.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}),"Loading…"]}),!c&&"overview"===y&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"How it works"}),(0,a.jsxs)("ol",{className:"text-xs text-text-muted space-y-1.5 list-decimal pl-4 leading-relaxed",children:[(0,a.jsxs)("li",{children:["Skills and MCP servers live only in Switchboard's library (",(0,a.jsx)("code",{className:"font-mono",children:"~/.switchboard/agent-library"}),")."]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{className:"text-text-main",children:"Apply sync"})," projects them into each enabled agent under namespaced paths/keys (",(0,a.jsx)("code",{className:"font-mono",children:"sb-*"}),")."]}),(0,a.jsxs)("li",{children:["If a path already exists and is ",(0,a.jsx)("em",{children:"not"})," marked managed, we"," ",(0,a.jsx)("strong",{className:"text-text-main",children:"skip"})," it (never overwrite)."]}),(0,a.jsx)("li",{children:"Turn individual agents or skills/MCP off with the toggles below."})]})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-3",children:"Targets"}),(0,a.jsx)("div",{className:"space-y-2",children:Object.values(er).map(e=>{let s=ea.targets?.[e.id]||{skills:!0,mcp:!0};return(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 py-2 border-b border-border-subtle last:border-0",children:[(0,a.jsx)("span",{className:"text-sm text-text-main",children:e.label}),(0,a.jsxs)("div",{className:"flex gap-4 text-xs text-text-muted",children:[(0,a.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox","aria-label":`${e.label} skills projection`,checked:!1!==s.skills,disabled:!e.supportsSkills||!!x,onChange:t=>el({targets:{...ea.targets,[e.id]:{...s,skills:t.target.checked}}})}),"Skills"]}),(0,a.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox","aria-label":`${e.label} MCP projection`,checked:!1!==s.mcp,disabled:!e.supportsMcp||!!x,onChange:t=>el({targets:{...ea.targets,[e.id]:{...s,mcp:t.target.checked}}})}),"MCP"]})]})]},e.id)})})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-3",children:"Safety & link mode"}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 text-xs",children:[(0,a.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Link mode"}),(0,a.jsxs)("select",{className:"bg-surface border border-border rounded-md px-2 py-1.5 text-text-main",value:ea.linkMode||"copy",disabled:!!x,onChange:e=>el({linkMode:e.target.value}),children:[(0,a.jsx)("option",{value:"copy",children:"Copy (safe default on Windows)"}),(0,a.jsx)("option",{value:"symlink",children:"Symlink (instant updates; may need privileges on Windows)"})]})]}),(0,a.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Scope"}),(0,a.jsxs)("select",{className:"bg-surface border border-border rounded-md px-2 py-1.5 text-text-main",value:ea.scope||"global",disabled:!!x,onChange:e=>el({scope:e.target.value,projectPath:"project"===e.target.value?ea.projectPath||"":null}),children:[(0,a.jsx)("option",{value:"global",children:"Global (user home agents)"}),(0,a.jsx)("option",{value:"project",children:"Project (paths under project folder)"})]})]}),"project"===ea.scope&&(0,a.jsxs)("label",{className:"flex flex-col gap-1 sm:col-span-2",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Project path (absolute)"}),(0,a.jsx)("input",{className:"bg-surface border border-border rounded-md px-2 py-1.5 font-mono text-text-main",value:X??ea.projectPath??"",placeholder:"/Users/you/my-app",disabled:!!x,onChange:e=>ee(e.target.value),onBlur:function(){null===X||(ee(null),X!==(ea.projectPath||"")&&el({projectPath:X}))},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.currentTarget.blur())}})]}),(0,a.jsxs)("label",{className:"flex items-start gap-2 sm:col-span-2 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",className:"mt-0.5","aria-label":"Never overwrite user-owned files",checked:!1!==ea.neverOverwriteUser,disabled:!!x,onChange:async e=>{e.target.checked?el({neverOverwriteUser:!0}):await (0,i.l)({message:"Allow overwriting paths that are NOT Switchboard-managed? This can replace your personal skills/MCP. Continue?",confirmText:"Continue"})&&el({neverOverwriteUser:!1,confirmAllowOverwrite:!0})}}),(0,a.jsxs)("span",{className:"text-text-muted leading-relaxed",children:[(0,a.jsx)("strong",{className:"text-text-main",children:"Never overwrite user-owned files"})," ","(recommended). Only touch ",(0,a.jsx)("code",{className:"font-mono",children:"sb-*"})," managed entries."]})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox","aria-label":"Auto-include Switchboard product skills",checked:!1!==ea.includeProductSkills,disabled:!!x,onChange:e=>el({includeProductSkills:e.target.checked})}),(0,a.jsx)("span",{className:"text-text-muted",children:"Auto-include Switchboard product skills (entry + chat)"})]})]})]}),(0,a.jsx)(l.Zp,{padding:"md",className:"border-primary/20 bg-primary/5",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"space-y-1 max-w-xl",children:[(0,a.jsxs)("div",{className:"text-xs font-semibold text-text-main flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"hub"}),"Featured: Executor.sh Tool Gateway & MCP Presets"]}),(0,a.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:["Connect your AI agents to OpenAPI, GraphQL, MCP servers, and custom JavaScript functions via ",(0,a.jsx)("strong",{children:"Executor.sh"})," (",(0,a.jsx)("code",{className:"font-mono text-primary",children:"npx -y executor mcp"}),")."]})]}),(0,a.jsx)(l.$n,{size:"sm",variant:"primary",onClick:()=>j("mcp"),children:"Manage MCP Gateways"})]})}),(0,a.jsxs)("div",{className:"grid sm:grid-cols-3 gap-3",children:[(0,a.jsx)(o,{label:"Skills in library",value:String(t?.skills?.length??0)}),(0,a.jsx)(o,{label:"MCP servers",value:String(t?.mcpServers?.length??0)}),(0,a.jsx)(o,{label:"Last sync",value:t?.state?.lastSync?.at?new Date(t.state.lastSync.at).toLocaleString():"—"})]}),g&&(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Last sync detail"}),(0,a.jsx)("pre",{className:"text-[11px] font-mono text-text-muted overflow-x-auto max-h-48 bg-surface-2 p-2 rounded",children:JSON.stringify(g.summary||g,null,2)}),g.skills?.filter(e=>"conflict"===e.action).length>0&&(0,a.jsxs)("div",{className:"mt-2 text-xs text-amber-600 dark:text-amber-400",children:["Conflicts (protected):",(0,a.jsx)("ul",{className:"list-disc pl-4 mt-1",children:g.skills.filter(e=>"conflict"===e.action).map((e,s)=>(0,a.jsxs)("li",{children:[e.agent,"/",e.skillId,": ",e.message||e.reason]},s))})]})]}),u&&(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Doctor"}),u.issues?.length===0?(0,a.jsx)("p",{className:"text-xs text-green-600",children:"No issues"}):(0,a.jsx)("ul",{className:"text-xs space-y-1",children:u.issues?.map((e,s)=>(0,a.jsxs)("li",{className:"error"===e.severity?"text-red-500":"text-amber-600 dark:text-amber-400",children:["[",e.severity,"] ",e.message]},s))})]})]}),!c&&"skills"===y&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"Library skills"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(l.$n,{size:"sm",variant:"ghost",disabled:!!x,onClick:async()=>{p("upd-check");try{await et(),h.success("Update check complete")}finally{p("")}},children:"Check updates"}),(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:!!x,onClick:async()=>{p("ensure");try{let e=await fetch("/api/agent-library/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"ensure_product"})}),s=await e.json().catch(()=>({}));if(!e.ok||!1===s.ok)throw Error(s.error||"Failed to ensure product skills");await es(),h.success("Product skills ensured")}catch(e){h.error(e.message)}finally{p("")}},children:"Refresh product skills"})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(t?.skills||[]).map(e=>(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2 p-3 rounded-lg border border-border-subtle bg-surface-2/50",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-text-main",children:e.title||e.id}),(0,a.jsx)(l.Ex,{size:"sm",variant:"default",children:(0,a.jsxs)("code",{className:"text-[10px]",children:["sb-",e.id]})}),K[e.id]?.status==="update"&&(0,a.jsx)(l.Ex,{size:"sm",variant:"warning",children:"update available"}),K[e.id]?.status==="error"&&(0,a.jsx)("span",{className:"text-[10px] text-text-subtle",title:K[e.id]?.message||"check failed",children:"check failed"})]}),(0,a.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5 line-clamp-2",children:e.description||"—"})]}),(0,a.jsxs)("div",{className:"flex gap-1 shrink-0",children:[K[e.id]?.status==="update"&&(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:!!x,loading:"upd-preview"===x&&Q?.id===e.id,onClick:()=>eh(e.id),children:"Update"}),(0,a.jsx)(l.$n,{size:"sm",variant:"ghost",disabled:!!x,onClick:()=>ex(e.id),children:"Remove"})]})]},e.id)),!t?.skills?.length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No skills yet. Enable product skills or add manually."})]})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"Detected on this machine"}),(0,a.jsx)(l.Ex,{size:"sm",variant:"default",children:"read-only"})]}),(0,a.jsxs)("p",{className:"text-[11px] text-text-muted mb-3 leading-relaxed",children:["Skills already present in agent tool dirs (e.g. ",(0,a.jsx)("code",{className:"font-mono",children:"~/.claude/skills"}),","," ",(0,a.jsx)("code",{className:"font-mono",children:"~/.agents/skills"}),"), installed by other tooling. Switchboard does not manage them — import via the Catalog tab to manage them here."]}),(0,a.jsxs)("div",{className:"space-y-2 max-h-72 overflow-auto",children:[(t?.detectedSkills||[]).map(e=>(0,a.jsx)("div",{className:"flex items-start justify-between gap-2 p-3 rounded-lg border border-border-subtle bg-surface-2/50",children:(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-text-main",children:e.title||e.id}),e.managedBySwitchboard&&(0,a.jsx)(l.Ex,{size:"sm",variant:"primary",children:"sb-managed"}),(e.agents||[]).map(e=>(0,a.jsx)(l.Ex,{size:"sm",variant:"default",children:e},e))]}),(0,a.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5 line-clamp-2",children:e.description||"—"})]})},e.id)),!t?.detectedSkills?.length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No skills found in agent tool directories."})]})]}),Q&&(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsxs)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:["Update preview — ",(0,a.jsx)("code",{className:"text-[12px]",children:Q.id})]}),(0,a.jsx)("p",{className:"text-[11px] text-text-subtle mb-2",children:"Full incoming SKILL.md shown below. Exactly these bytes are installed on confirm — if upstream changes in between, the update is refused and you preview again."}),(0,a.jsx)("pre",{className:"text-[10px] font-mono max-h-64 overflow-auto bg-surface-2 p-2 rounded border border-border-subtle whitespace-pre-wrap",children:Q.markdown}),(0,a.jsxs)("label",{className:"flex items-start gap-2 text-xs text-text-muted cursor-pointer mt-2",children:[(0,a.jsx)("input",{type:"checkbox","aria-label":"I reviewed this skill update and understand it may instruct agents to run tools or shell commands",checked:B,onChange:e=>q(e.target.checked)}),"I reviewed this skill and understand it may instruct agents to run tools/shell commands."]}),(0,a.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,a.jsx)(l.$n,{size:"sm",disabled:!B||!!x,loading:"upd-apply"===x,onClick:eu,children:"Apply update"}),(0,a.jsx)(l.$n,{size:"sm",variant:"ghost",disabled:!!x,onClick:()=>{W(null),q(!1)},children:"Cancel"})]})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Add skill (paste SKILL.md)"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("input",{className:"w-full bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"skill-id (e.g. my-review)",value:J,onChange:e=>G(e.target.value)}),(0,a.jsx)("textarea",{className:"w-full h-40 bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"---\nname: my-skill\ndescription: ...\n---\n\n# ...",value:_,onChange:e=>F(e.target.value)}),(0,a.jsx)(l.$n,{size:"sm",disabled:!J||!_||!!x,loading:"skill-add"===x,onClick:ep,children:"Add to library"})]})]})]}),!c&&"mcp"===y&&(0,a.jsxs)("div",{className:"space-y-4",children:[(e=C.find(e=>"executor"===e.id)||{id:"executor",name:"Executor.sh (Tool Gateway)",description:"Unified MCP tool gateway for OpenAPI, GraphQL, MCP servers & sandboxed JavaScript functions (executor.sh)",transport:"stdio",command:"npx",args:["-y","executor","mcp"],notes:"Executor.sh tool execution gateway (https://executor.sh)",docsUrl:"https://executor.sh"},s=(t?.mcpServers||[]).some(e=>"executor"===e.id||"sb-executor"===e.id),(0,a.jsx)(l.Zp,{padding:"md",className:"border-primary/30 bg-primary/5",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"space-y-1 max-w-xl",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"hub"}),(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"Executor.sh Tool Gateway"}),(0,a.jsx)(l.Ex,{variant:"primary",size:"sm",children:"FEATURED GATEWAY"}),s&&(0,a.jsx)(l.Ex,{variant:"default",size:"sm",children:"Installed in Library"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted leading-relaxed",children:"Connect your AI agents to OpenAPI, GraphQL, MCP servers, and custom JavaScript functions through a single managed endpoint with local-first credential management."}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 pt-1 text-[11px] font-mono text-text-subtle",children:[(0,a.jsxs)("span",{children:["Command: ",(0,a.jsx)("code",{className:"text-text-main",children:"npx -y executor mcp"})]}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsxs)("a",{href:"https://executor.sh",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline inline-flex items-center gap-0.5",children:["executor.sh docs",(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"open_in_new"})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 shrink-0",children:[(0,a.jsx)(l.$n,{size:"sm",variant:s?"outline":"primary",disabled:s||!!x,loading:"mcp-preset-executor"===x,onClick:()=>eo(e),children:s?"Installed":"Add Executor Gateway"}),(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:!!x,onClick:()=>ec(e),children:"Customize"})]})]})})),C.filter(e=>"executor"!==e.id).length>0&&(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-1",children:"Popular MCP Server Presets"}),(0,a.jsx)("p",{className:"text-[11px] text-text-subtle mb-3",children:"1-click presets for common Model Context Protocol servers."}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-3",children:C.filter(e=>"executor"!==e.id).map(e=>{let s=(t?.mcpServers||[]).some(s=>s.id===e.id||s.id===`sb-${e.id}`);return(0,a.jsxs)("div",{className:"p-3 rounded-lg border border-border-subtle bg-surface-2/40 hover:bg-surface-2/70 flex flex-col justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-1",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main",children:e.name}),s&&(0,a.jsx)(l.Ex,{size:"sm",variant:"default",children:"Installed"})]}),(0,a.jsx)("p",{className:"text-[11px] text-text-muted mt-1 line-clamp-2",children:e.description})]}),(0,a.jsxs)("div",{className:"flex gap-1.5 pt-1",children:[(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:s||!!x,loading:x===`mcp-preset-${e.id}`,onClick:()=>eo(e),children:s?"Installed":"Add"}),(0,a.jsx)(l.$n,{size:"sm",variant:"ghost",disabled:!!x,onClick:()=>ec(e),children:"Customize"})]})]},e.id)})})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-1",children:"MCP servers in library"}),(0,a.jsxs)("p",{className:"text-[11px] text-text-subtle mb-3",children:["Prefer ",(0,a.jsxs)("code",{className:"font-mono",children:["$","{GITHUB_TOKEN}"]})," style env values — do not paste raw API keys if you can avoid it. Keys are projected as"," ",(0,a.jsx)("code",{className:"font-mono",children:"sb-*"})," only."]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(t?.mcpServers||[]).map(e=>(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2 p-3 rounded-lg border border-border-subtle",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm text-text-main font-medium",children:e.name}),(0,a.jsx)("code",{className:"text-[10px] text-text-subtle",children:e.id}),(0,a.jsxs)("div",{className:"text-[11px] text-text-muted mt-1",children:[e.transport||"stdio"," \xb7"," ",e.command?`${e.command} ${(e.args||[]).map(e=>/[\s"'\\]/.test(e)?`"${e.replace(/(["\\])/g,"\\$1")}"`:e).join(" ")}`:e.url]})]}),(0,a.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>em(e.id),children:"Remove"})]},e.id)),!t?.mcpServers?.length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No MCP servers in library yet. Add Executor.sh or another preset above."})]})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-3",children:"Add Custom MCP server"}),(0,a.jsxs)("form",{className:"grid gap-2 sm:grid-cols-2",onSubmit:ed,children:[(0,a.jsx)("input",{required:!0,className:"bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"id (e.g. filesystem)",value:v.id,onChange:e=>w({...v,id:e.target.value})}),(0,a.jsx)("input",{className:"bg-surface border border-border rounded-md px-2 py-1.5 text-xs",placeholder:"Display name",value:v.name,onChange:e=>w({...v,name:e.target.value})}),(0,a.jsxs)("select",{className:"bg-surface border border-border rounded-md px-2 py-1.5 text-xs",value:v.transport,onChange:e=>w({...v,transport:e.target.value}),children:[(0,a.jsx)("option",{value:"stdio",children:"stdio (command)"}),(0,a.jsx)("option",{value:"http",children:"http (url)"}),(0,a.jsx)("option",{value:"sse",children:"sse (url)"})]}),"stdio"===v.transport?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{className:"bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"command",value:v.command,onChange:e=>w({...v,command:e.target.value})}),(0,a.jsx)("input",{className:"sm:col-span-2 bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"args (space-separated)",value:v.args,onChange:e=>w({...v,args:e.target.value})})]}):(0,a.jsx)("input",{className:"sm:col-span-1 bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"https://...",value:v.url,onChange:e=>w({...v,url:e.target.value})}),(0,a.jsx)("div",{className:"sm:col-span-2",children:(0,a.jsx)(l.$n,{size:"sm",type:"submit",loading:"mcp"===x,disabled:!!x,children:"Save to library"})})]})]})]}),!c&&"catalog"===y&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-1",children:"Smart Import (Command, Repo, or URL)"}),(0,a.jsxs)("p",{className:"text-[11px] text-text-subtle mb-3",children:["Paste CLI commands like ",(0,a.jsx)("code",{className:"font-mono text-primary",children:"npx skills add citrolabs/ego-lite"}),", GitHub repositories like ",(0,a.jsx)("code",{className:"font-mono text-primary",children:"citrolabs/ego-lite"}),", or direct ",(0,a.jsx)("code",{className:"font-mono text-primary",children:"SKILL.md"})," URLs."]}),(0,a.jsxs)("form",{onSubmit:eb,className:"space-y-2.5",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{className:"flex-1 bg-surface border border-border rounded-md px-2.5 py-1.5 text-xs font-mono text-text-main placeholder:text-text-subtle",placeholder:"e.g. npx skills add citrolabs/ego-lite, anthropics/skills, or https://github.com/...",value:P,disabled:!!x,onChange:e=>{$(e.target.value),O("")}}),(0,a.jsx)(l.$n,{size:"sm",type:"submit",disabled:!P.trim()||!!x,loading:"resolve"===x,children:"Resolve & Preview"}),P&&(0,a.jsx)(l.$n,{type:"button",size:"sm",variant:"ghost",disabled:!!x,onClick:()=>{$(""),T([]),L(""),z(""),R(""),Z(!1),O("")},children:"Clear"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 text-[11px] text-text-subtle pt-1",children:[(0,a.jsx)("span",{className:"font-medium text-text-muted",children:"Quick try:"}),["npx skills add citrolabs/ego-lite","anthropics/skills","citrolabs/ego-lite"].map(e=>(0,a.jsx)("button",{type:"button",className:"px-2 py-0.5 rounded border border-border-subtle bg-surface-2 hover:bg-surface text-text-main hover:border-primary font-mono text-[10px] transition-colors cursor-pointer",disabled:!!x,onClick:()=>{$(e),O(""),p("resolve"),fetch("/api/agent-library/catalog",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"resolve",input:e})}).then(e=>e.json()).then(e=>{if(!e.ok)throw Error(e.message||e.error||"Resolution failed");let s=e.skills||[];T(s),1===s.length?(L(s[0].skillId),z(s[0].rawUrl),R(s[0].preview||""),Z(!1),h.success(`Resolved skill: ${s[0].skillId}`)):s.length>1&&(L(""),z(""),R(""),Z(!1),h.success(`Found ${s.length} skills in ${e.repo||"repository"}. Select one below.`))}).catch(e=>h.error(e.message)).finally(()=>p(""))},children:e},e))]})]}),E.length>1&&(0,a.jsxs)("div",{className:"mt-4 pt-3 border-t border-border-subtle space-y-2",children:[(0,a.jsxs)("div",{className:"text-xs font-medium text-text-main flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"folder_open"}),"Found ",E.length," skills in repository:"]}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:E.map(e=>(0,a.jsxs)("button",{type:"button",className:`w-full text-left p-2.5 rounded-lg border transition-all text-xs cursor-pointer ${M===e.rawUrl?"border-primary bg-primary/5 shadow-sm":"border-border-subtle hover:border-border bg-surface-2/40"}`,onClick:()=>{L(e.skillId),z(e.rawUrl),Z(!1),e.preview?R(e.preview):eg(e.rawUrl)},children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-1",children:[(0,a.jsx)("span",{className:"font-semibold text-text-main",children:e.title||e.skillId}),(0,a.jsx)(l.Ex,{size:"sm",variant:M===e.rawUrl?"primary":"default",children:(0,a.jsxs)("code",{className:"text-[10px]",children:["sb-",e.skillId]})})]}),(0,a.jsx)("div",{className:"text-[11px] font-mono text-text-subtle mt-1 truncate",children:e.path}),e.description&&(0,a.jsx)("p",{className:"text-[11px] text-text-muted mt-1 line-clamp-2",children:e.description})]},e.path||e.skillId))})]}),M&&(0,a.jsxs)("div",{className:"mt-4 pt-3 border-t border-border-subtle space-y-3",children:[(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,a.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("span",{className:"text-[11px] text-text-muted",children:["Skill ID (installed as sb-",A||"...",")"]}),(0,a.jsx)("input",{className:"w-full bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono text-text-main",placeholder:"skill-id",value:A,disabled:!!x,onChange:e=>L(e.target.value)})]}),(0,a.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,a.jsx)("span",{className:"text-[11px] text-text-muted",children:"Resolved Raw Source URL"}),(0,a.jsx)("input",{className:"w-full bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono text-text-main",placeholder:"https://.../SKILL.md",value:M,disabled:!!x,onChange:e=>z(e.target.value)})]})]}),U?(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("span",{className:"text-[11px] text-text-muted",children:"SKILL.md preview:"}),(0,a.jsx)("pre",{className:"text-[10px] font-mono max-h-56 overflow-auto bg-surface-2 p-2.5 rounded-lg border border-border-subtle whitespace-pre-wrap",children:U})]}):(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:!M||!!x,loading:"preview"===x,onClick:()=>eg(M),children:"Load Preview"}),(0,a.jsxs)("label",{className:"flex items-start gap-2 text-xs text-text-muted cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox","aria-label":"I reviewed this catalog skill and understand it may instruct agents to run tools or shell commands",checked:D,disabled:!!x,onChange:e=>Z(e.target.checked)}),(0,a.jsx)("span",{children:"I reviewed this skill and understand it may instruct agents to run tools or shell commands."})]}),(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsx)(l.$n,{size:"sm",disabled:!M||!A||!D||!!x,loading:"catalog"===x,onClick:ef,children:"Install into library"})})]}),I&&(0,a.jsxs)("div",{className:"mt-4 p-3 rounded-lg bg-green-500/10 border border-green-500/30 flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"text-xs text-green-700 dark:text-green-300",children:[(0,a.jsx)("strong",{children:I})," is installed in your Switchboard library. Apply sync to project it into Claude, Codex, Gemini, OpenCode, and Cursor."]}),(0,a.jsx)(l.$n,{size:"sm",variant:"primary",loading:"apply"===x,disabled:!!x,onClick:()=>ei("apply"),children:"Apply sync to all agents now"})]})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-1",children:"Trusted presets"}),(0,a.jsx)("p",{className:"text-[11px] text-text-subtle mb-3",children:"One-click standard skills from official sources."}),(0,a.jsx)("div",{className:"space-y-2",children:N.map(e=>(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 p-2.5 rounded-lg border border-border-subtle bg-surface-2/40 hover:bg-surface-2/70 transition-colors",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs font-semibold text-text-main",children:e.name}),(0,a.jsx)("div",{className:"text-[11px] text-text-muted",children:e.description})]}),(0,a.jsxs)("div",{className:"flex gap-1.5",children:[(0,a.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>{Z(!1),$(e.rawUrl),z(e.rawUrl),L(e.skillId),T([]),O(""),eg(e.rawUrl)},children:"Preview"}),(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",onClick:()=>{$(e.rawUrl),z(e.rawUrl),L(e.skillId),T([]),Z(!1),O(""),eg(e.rawUrl)},children:"Select"})]})]},e.id))})]})]}),!c&&"advanced"===y&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Clean managed projections"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-3",children:["Removes only ",(0,a.jsx)("code",{className:"font-mono",children:"sb-*"})," skills and MCP keys written by Switchboard. Your other skills/MCP stay untouched."]}),(0,a.jsx)(l.$n,{size:"sm",variant:"outline",disabled:!!x,loading:"clean"===x,onClick:async()=>{await (0,i.l)({message:"Remove all Switchboard-managed skill/MCP projections from targets?",confirmText:"Continue"})&&ei("clean")},children:"Clean managed only"})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Export AgentSync layout"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Writes a coexistence-friendly ",(0,a.jsx)("code",{className:"font-mono",children:".agents/"})," tree (skills + agentsync.toml). Does not run agentsync. Paths must be under your home or project directory."]}),(0,a.jsx)("input",{className:"w-full bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono mb-2",placeholder:"Optional dest (default ~/switchboard-agents-export/.agents)",value:Y,onChange:e=>V(e.target.value)}),(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:!!x,loading:"export"===x,onClick:ey,children:"Export"})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Coexistence"}),(0,a.jsxs)("ul",{className:"text-xs text-text-muted space-y-1 list-disc pl-4",children:[(0,a.jsxs)("li",{children:["Switchboard only owns ",(0,a.jsx)("code",{className:"font-mono",children:"sb-*"})," skill directories and MCP keys."]}),(0,a.jsx)("li",{children:"AgentSync / skillbook may manage other paths — avoid pointing both at the same un-namespaced skill."}),(0,a.jsx)("li",{children:"Product skills for HTTP agents remain under Dashboard → Skills (separate)."})]})]})]})]})}function o({label:e,value:s}){return(0,a.jsxs)(l.Zp,{padding:"sm",children:[(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-text-subtle font-semibold",children:e}),(0,a.jsx)("div",{className:"text-sm text-text-main mt-1 font-medium truncate",title:s,children:s})]})}}},e=>{e.O(0,[2574,3862,782,8500,594,1321,4707,1330,8441,3794,7358],()=>e(e.s=5194)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6897],{5194:(e,s,t)=>{Promise.resolve().then(t.bind(t,66176))},35497:(e,s,t)=>{"use strict";t.d(s,{x0:()=>N.default,Ex:()=>o.default,$n:()=>a.default,nh:()=>$.default,Zp:()=>i.default,Qv:()=>d.CardSkeleton,CK:()=>h.default,uo:()=>n.ConfirmModal,G9:()=>y.default,wI:()=>w.default,vj:()=>v.default,vE:()=>j.default,pd:()=>r.default,Mh:()=>f.default,uR:()=>p.default,Nf:()=>u.default,aF:()=>n.default,rq:()=>x.default,gw:()=>k.default,LF:()=>m.default,Wx:()=>P.default,gM:()=>g.default,Iz:()=>C.default,l6:()=>l.default,lM:()=>c.default,m_:()=>S.default,jK:()=>b.default});var a=t(92542),r=t(11910),l=t(98),i=t(84588),n=t(81127),d=t(25086);t(56319);var o=t(56061),c=t(98542);t(61929),t(21110),t(92622),t(8823),t(92173);var m=t(90882),x=t(72908),p=t(28815),h=t(45455),u=t(28058),b=t(4809);t(21931),t(80752),t(40197);var g=t(23615);t(44736);var f=t(62899);t(94230);var y=t(30815),j=t(23936),v=t(95088),w=t(73579),N=t(96748),k=t(4823),C=t(28067),S=t(97677),P=t(51825),$=t(29366);t(76361),t(91450)},66176:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>d});var a=t(95155),r=t(12115),l=t(35497),i=t(77251),n=t(65921);function d(){let e,s,[t,d]=(0,r.useState)(null),[c,m]=(0,r.useState)(!0),[x,p]=(0,r.useState)(""),h=(0,n.i)(),[u,b]=(0,r.useState)(null),[g,f]=(0,r.useState)(null),[y,j]=(0,r.useState)("overview");(0,r.useEffect)(()=>{{let e=new URLSearchParams(window.location.search).get("tab");e&&["overview","skills","mcp","catalog","advanced"].includes(e)&&j(e)}},[]);let[v,w]=(0,r.useState)({id:"",name:"",transport:"stdio",command:"npx",args:"-y @modelcontextprotocol/server-filesystem .",url:"",notes:""}),[N,k]=(0,r.useState)([]),[C,S]=(0,r.useState)([]),[P,$]=(0,r.useState)(""),[E,T]=(0,r.useState)([]),[I,O]=(0,r.useState)(""),[M,z]=(0,r.useState)(""),[A,L]=(0,r.useState)(""),[U,R]=(0,r.useState)(""),[D,Z]=(0,r.useState)(!1),[J,G]=(0,r.useState)(""),[_,F]=(0,r.useState)(""),[K,H]=(0,r.useState)({}),[Q,W]=(0,r.useState)(null),[B,q]=(0,r.useState)(!1),[Y,V]=(0,r.useState)(""),[X,ee]=(0,r.useState)(null),es=(0,r.useCallback)(async()=>{m(!0);try{let e=await fetch("/api/agent-library",{cache:"no-store"}),s=await e.json();if(!e.ok)throw Error(s.error||"Load failed");d(s)}catch(e){h.error(e.message)}finally{m(!1)}},[]),et=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/agent-library/updates",{cache:"no-store"}),s=await e.json();if(!e.ok)return;let t={};for(let e of s.results||[])t[e.id]=e;H(t)}catch{}},[]);(0,r.useEffect)(()=>{es(),et(),fetch("/api/agent-library/catalog").then(async e=>{let s=await e.json().catch(()=>({}));if(!e.ok)throw Error(s.error||"Failed to load skill catalog");k(s.presets||[]),S(s.mcpPresets||[])}).catch(e=>h.error(e.message))},[es,et]);let ea=t?.settings||{},er=t?.agents||{};async function el(e){p("settings");try{let s=await fetch("/api/agent-library",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),t=await s.json();if(!s.ok)throw Error(t.error||"Save failed");h.success("Settings saved"),await es()}catch(e){h.error(e.message)}finally{p("")}}async function ei(e){p(e),f(null);try{let s=await fetch("/api/agent-library/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,confirm:"clean"===e||void 0})}),t=await s.json();if(!s.ok)throw Error(t.error||t.message||"Sync failed");f(t);let a="dry-run"===e?`Dry-run: ${t.summary?.skillsSynced??0} skill ops, ${t.summary?.mcpOk??0} MCP ok, ${t.conflictCount||0} conflicts`:"clean"===e?"Removed Switchboard-managed projections only":`Applied: ${t.summary?.skillsSynced??0} skills synced, ${t.conflictCount||0} conflicts protected`;t.conflictCount?h.warning(a):h.success(a),await es()}catch(e){h.error(e.message)}finally{p("")}}async function en(){p("doctor");try{let e=await fetch("/api/agent-library/doctor",{cache:"no-store"}),s=await e.json();if(!e.ok)throw Error(s.error||"Doctor failed");b(s),s.ok?h.success("Doctor: no blocking errors"):h.warning(`Doctor: ${s.issues?.filter(e=>"error"===e.severity).length||0} errors`)}catch(e){h.error(e.message)}finally{p("")}}async function ed(e){e?.preventDefault?.(),p("mcp");try{let e=v.args?function(e){let s=[],t="",a=!1,r="";for(let l=0;l<e.length;l++){let i=e[l];r?"\\"===i&&'"'===r&&void 0!==e[l+1]?t+=e[++l]:i===r?r="":t+=i:'"'===i||"'"===i?(r=i,a=!0):"\\"===i&&void 0!==e[l+1]?t+=e[++l]:/\s/.test(i)?((t||a)&&s.push(t),t="",a=!1):(t+=i,a=!0)}return(t||a)&&s.push(t),s}(v.args):[],s=await fetch("/api/agent-library/mcp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:v.id,name:v.name||v.id,transport:v.transport,command:"stdio"===v.transport?v.command:void 0,args:"stdio"===v.transport?e:void 0,url:"stdio"!==v.transport?v.url:void 0,notes:v.notes})}),t=await s.json();if(!s.ok)throw Error(t.error||"MCP save failed");t.warnings?.length?h.warning(t.warnings.join(" \xb7 ")):h.success(`MCP ${t.server?.id} saved (Apply to project)`),w({id:"",name:"",transport:"stdio",command:"npx",args:"",url:"",notes:""}),await es()}catch(e){h.error(e.message)}finally{p("")}}async function eo(e){p(`mcp-preset-${e.id}`);try{let s=await fetch("/api/agent-library/mcp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id,name:e.name||e.id,transport:e.transport||"stdio",command:e.command,args:e.args,url:e.url,env:e.env,notes:e.notes})}),t=await s.json();if(!s.ok)throw Error(t.error||"MCP preset save failed");h.success(`MCP ${t.server?.id||e.id} saved to library. Click Apply sync to project to agents.`),await es()}catch(e){h.error(e.message)}finally{p("")}}function ec(e){w({id:e.id,name:e.name||e.id,transport:e.transport||"stdio",command:e.command||"npx",args:(e.args||[]).join(" "),url:e.url||"",notes:e.notes||""}),h.success(`Loaded ${e.name} into form below. Edit parameters as needed and click Save.`)}async function em(e){if(await (0,i.l)({message:`Remove MCP ${e} from library? (targets updated on next Apply)`,confirmText:"Continue"})){p("mcp-del");try{let s=await fetch(`/api/agent-library/mcp?id=${encodeURIComponent(e)}`,{method:"DELETE"}),t=await s.json();if(!s.ok)throw Error(t.error||"Delete failed");h.success("MCP removed from library"),await es()}catch(e){h.error(e.message)}finally{p("")}}}async function ex(e){if(await (0,i.l)({message:`Remove skill ${e} from library?`,confirmText:"Continue"})){p("skill-del");try{let s=await fetch(`/api/agent-library/skills?id=${encodeURIComponent(e)}`,{method:"DELETE"}),t=await s.json();if(!s.ok)throw Error(t.error||"Delete failed");h.success("Skill removed from library"),await es(),await et()}catch(e){h.error(e.message)}finally{p("")}}}async function ep(){p("skill-add");try{let e=await fetch("/api/agent-library/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:J,markdown:_,source:"manual"})}),s=await e.json();if(!e.ok)throw Error(s.error);h.success(`Skill ${s.id} installed in library`),G(""),F(""),await es()}catch(e){h.error(e.message)}finally{p("")}}async function eh(e){p("upd-preview"),q(!1);try{let s=await fetch("/api/agent-library/updates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"preview",skillId:e})}),t=await s.json();if(!s.ok||!t.ok)throw Error(t.message||t.error||"Preview failed");W({id:e,markdown:t.markdown,contentHash:t.contentHash})}catch(e){h.error(e.message)}finally{p("")}}async function eu(){if(Q){p("upd-apply");try{let e=await fetch("/api/agent-library/updates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update",skillId:Q.id,confirmed:B,expectedHash:Q.contentHash})}),s=await e.json();if(!e.ok||!s.ok)throw Error(s.message||s.error||"Update failed");h.success(s.warning||`Updated ${s.id}`),W(null),q(!1),await es(),await et()}catch(e){h.error(e.message)}finally{p("")}}}async function eb(e){if(e?.preventDefault?.(),P.trim()){p("resolve"),O("");try{let e=await fetch("/api/agent-library/catalog",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"resolve",input:P.trim()})}),s=await e.json();if(!e.ok||!s.ok)throw Error(s.message||s.error||"Resolution failed");let t=s.skills||[];T(t),1===t.length?(L(t[0].skillId),z(t[0].rawUrl),R(t[0].preview||""),Z(!1),h.success(`Resolved skill: ${t[0].skillId}`)):t.length>1&&(L(""),z(""),R(""),Z(!1),h.success(`Found ${t.length} skills in ${s.repo||"repository"}. Select one below.`))}catch(e){h.error(e.message)}finally{p("")}}}async function eg(e){p("preview");try{let s=await fetch("/api/agent-library/catalog",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"preview",url:e})}),t=await s.json();if(!s.ok||!t.ok)throw Error(t.error||"Preview failed");R(t.preview||""),h.success(`Preview loaded (${t.bytes} bytes)`)}catch(e){h.error(e.message)}finally{p("")}}async function ef(){p("catalog");try{let e=await fetch("/api/agent-library/catalog",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"install",skillId:A,url:M,confirmed:D})}),s=await e.json();if(!e.ok)throw Error(s.message||s.error||"Install failed");O(s.id||A),h.success(s.warning||`Installed ${s.id}`),Z(!1),await es(),await et()}catch(e){h.error(e.message)}finally{p("")}}async function ey(){p("export");try{let e=await fetch("/api/agent-library/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({destPath:Y||void 0})}),s=await e.json();if(!e.ok)throw Error(s.message||s.error||"Export failed");h.success(`Exported AgentSync layout to ${s.path}`)}catch(e){h.error(e.message)}finally{p("")}}return(0,a.jsxs)("div",{className:"max-w-5xl mx-auto space-y-5 pb-12",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("h1",{className:"text-[17px] font-semibold text-text-main",children:"Agent library"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted leading-relaxed max-w-2xl",children:["One Switchboard-owned library of ",(0,a.jsx)("strong",{className:"text-text-main",children:"skills"})," and"," ",(0,a.jsx)("strong",{className:"text-text-main",children:"MCP servers"}),", projected into Claude Code, Codex, OpenCode, Gemini CLI, and Cursor. Managed entries use the"," ",(0,a.jsx)("code",{className:"text-[11px] font-mono",children:"sb-"})," namespace so we never overwrite your existing skills or MCP keys."]})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm text-text-main cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",className:"accent-[var(--color-primary)]","aria-label":"Sync enabled",checked:!1!==ea.enabled,disabled:!!x,onChange:e=>el({enabled:e.target.checked})}),"Sync enabled"]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:!!x||!1===ea.enabled,loading:"dry-run"===x,onClick:()=>ei("dry-run"),children:"Dry-run"}),(0,a.jsx)(l.$n,{size:"sm",disabled:!!x||!1===ea.enabled,loading:"apply"===x,onClick:()=>ei("apply"),children:"Apply sync"}),(0,a.jsx)(l.$n,{size:"sm",variant:"outline",disabled:!!x,loading:"doctor"===x,onClick:en,children:"Doctor"})]})]}),(0,a.jsxs)("p",{className:"text-[11px] text-text-subtle mt-2 font-mono break-all",children:["Library: ",t?.libraryRoot||"…",ea.linkMode?` \xb7 mode=${ea.linkMode}`:"",ea.scope?` \xb7 scope=${ea.scope}`:""]})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 border-b border-border pb-0",children:[{id:"overview",label:"Overview"},{id:"skills",label:"Skills"},{id:"mcp",label:"MCP"},{id:"catalog",label:"Catalog"},{id:"advanced",label:"Advanced"}].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>{j(e.id);try{window.history.replaceState(null,"",`?tab=${e.id}`)}catch{}},className:`px-3 py-2 text-xs font-medium rounded-t-md transition-colors ${y===e.id?"bg-surface border border-border border-b-surface text-primary -mb-px":"text-text-muted hover:text-text-main"}`,children:e.label},e.id))}),c&&(0,a.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}),"Loading…"]}),!c&&"overview"===y&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"How it works"}),(0,a.jsxs)("ol",{className:"text-xs text-text-muted space-y-1.5 list-decimal pl-4 leading-relaxed",children:[(0,a.jsxs)("li",{children:["Skills and MCP servers live only in Switchboard's library (",(0,a.jsx)("code",{className:"font-mono",children:"~/.switchboard/agent-library"}),")."]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{className:"text-text-main",children:"Apply sync"})," projects them into each enabled agent under namespaced paths/keys (",(0,a.jsx)("code",{className:"font-mono",children:"sb-*"}),")."]}),(0,a.jsxs)("li",{children:["If a path already exists and is ",(0,a.jsx)("em",{children:"not"})," marked managed, we"," ",(0,a.jsx)("strong",{className:"text-text-main",children:"skip"})," it (never overwrite)."]}),(0,a.jsx)("li",{children:"Turn individual agents or skills/MCP off with the toggles below."})]})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-3",children:"Targets"}),(0,a.jsx)("div",{className:"space-y-2",children:Object.values(er).map(e=>{let s=ea.targets?.[e.id]||{skills:!0,mcp:!0};return(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 py-2 border-b border-border-subtle last:border-0",children:[(0,a.jsx)("span",{className:"text-sm text-text-main",children:e.label}),(0,a.jsxs)("div",{className:"flex gap-4 text-xs text-text-muted",children:[(0,a.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox","aria-label":`${e.label} skills projection`,checked:!1!==s.skills,disabled:!e.supportsSkills||!!x,onChange:t=>el({targets:{...ea.targets,[e.id]:{...s,skills:t.target.checked}}})}),"Skills"]}),(0,a.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox","aria-label":`${e.label} MCP projection`,checked:!1!==s.mcp,disabled:!e.supportsMcp||!!x,onChange:t=>el({targets:{...ea.targets,[e.id]:{...s,mcp:t.target.checked}}})}),"MCP"]})]})]},e.id)})})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-3",children:"Safety & link mode"}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 text-xs",children:[(0,a.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Link mode"}),(0,a.jsxs)("select",{className:"bg-surface border border-border rounded-md px-2 py-1.5 text-text-main",value:ea.linkMode||"copy",disabled:!!x,onChange:e=>el({linkMode:e.target.value}),children:[(0,a.jsx)("option",{value:"copy",children:"Copy (safe default on Windows)"}),(0,a.jsx)("option",{value:"symlink",children:"Symlink (instant updates; may need privileges on Windows)"})]})]}),(0,a.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Scope"}),(0,a.jsxs)("select",{className:"bg-surface border border-border rounded-md px-2 py-1.5 text-text-main",value:ea.scope||"global",disabled:!!x,onChange:e=>el({scope:e.target.value,projectPath:"project"===e.target.value?ea.projectPath||"":null}),children:[(0,a.jsx)("option",{value:"global",children:"Global (user home agents)"}),(0,a.jsx)("option",{value:"project",children:"Project (paths under project folder)"})]})]}),"project"===ea.scope&&(0,a.jsxs)("label",{className:"flex flex-col gap-1 sm:col-span-2",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Project path (absolute)"}),(0,a.jsx)("input",{className:"bg-surface border border-border rounded-md px-2 py-1.5 font-mono text-text-main",value:X??ea.projectPath??"",placeholder:"/Users/you/my-app",disabled:!!x,onChange:e=>ee(e.target.value),onBlur:function(){null===X||(ee(null),X!==(ea.projectPath||"")&&el({projectPath:X}))},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.currentTarget.blur())}})]}),(0,a.jsxs)("label",{className:"flex items-start gap-2 sm:col-span-2 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",className:"mt-0.5","aria-label":"Never overwrite user-owned files",checked:!1!==ea.neverOverwriteUser,disabled:!!x,onChange:async e=>{e.target.checked?el({neverOverwriteUser:!0}):await (0,i.l)({message:"Allow overwriting paths that are NOT Switchboard-managed? This can replace your personal skills/MCP. Continue?",confirmText:"Continue"})&&el({neverOverwriteUser:!1,confirmAllowOverwrite:!0})}}),(0,a.jsxs)("span",{className:"text-text-muted leading-relaxed",children:[(0,a.jsx)("strong",{className:"text-text-main",children:"Never overwrite user-owned files"})," ","(recommended). Only touch ",(0,a.jsx)("code",{className:"font-mono",children:"sb-*"})," managed entries."]})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox","aria-label":"Auto-include Switchboard product skills",checked:!1!==ea.includeProductSkills,disabled:!!x,onChange:e=>el({includeProductSkills:e.target.checked})}),(0,a.jsx)("span",{className:"text-text-muted",children:"Auto-include Switchboard product skills (entry + chat)"})]})]})]}),(0,a.jsx)(l.Zp,{padding:"md",className:"border-primary/20 bg-primary/5",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"space-y-1 max-w-xl",children:[(0,a.jsxs)("div",{className:"text-xs font-semibold text-text-main flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"hub"}),"Featured: Executor.sh Tool Gateway & MCP Presets"]}),(0,a.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:["Connect your AI agents to OpenAPI, GraphQL, MCP servers, and custom JavaScript functions via ",(0,a.jsx)("strong",{children:"Executor.sh"})," (",(0,a.jsx)("code",{className:"font-mono text-primary",children:"npx -y executor mcp"}),")."]})]}),(0,a.jsx)(l.$n,{size:"sm",variant:"primary",onClick:()=>j("mcp"),children:"Manage MCP Gateways"})]})}),(0,a.jsxs)("div",{className:"grid sm:grid-cols-3 gap-3",children:[(0,a.jsx)(o,{label:"Skills in library",value:String(t?.skills?.length??0)}),(0,a.jsx)(o,{label:"MCP servers",value:String(t?.mcpServers?.length??0)}),(0,a.jsx)(o,{label:"Last sync",value:t?.state?.lastSync?.at?new Date(t.state.lastSync.at).toLocaleString():"—"})]}),g&&(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Last sync detail"}),(0,a.jsx)("pre",{className:"text-[11px] font-mono text-text-muted overflow-x-auto max-h-48 bg-surface-2 p-2 rounded",children:JSON.stringify(g.summary||g,null,2)}),g.skills?.filter(e=>"conflict"===e.action).length>0&&(0,a.jsxs)("div",{className:"mt-2 text-xs text-amber-600 dark:text-amber-400",children:["Conflicts (protected):",(0,a.jsx)("ul",{className:"list-disc pl-4 mt-1",children:g.skills.filter(e=>"conflict"===e.action).map((e,s)=>(0,a.jsxs)("li",{children:[e.agent,"/",e.skillId,": ",e.message||e.reason]},s))})]})]}),u&&(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Doctor"}),u.issues?.length===0?(0,a.jsx)("p",{className:"text-xs text-green-600",children:"No issues"}):(0,a.jsx)("ul",{className:"text-xs space-y-1",children:u.issues?.map((e,s)=>(0,a.jsxs)("li",{className:"error"===e.severity?"text-red-500":"text-amber-600 dark:text-amber-400",children:["[",e.severity,"] ",e.message]},s))})]})]}),!c&&"skills"===y&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"Library skills"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(l.$n,{size:"sm",variant:"ghost",disabled:!!x,onClick:async()=>{p("upd-check");try{await et(),h.success("Update check complete")}finally{p("")}},children:"Check updates"}),(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:!!x,onClick:async()=>{p("ensure");try{let e=await fetch("/api/agent-library/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"ensure_product"})}),s=await e.json().catch(()=>({}));if(!e.ok||!1===s.ok)throw Error(s.error||"Failed to ensure product skills");await es(),h.success("Product skills ensured")}catch(e){h.error(e.message)}finally{p("")}},children:"Refresh product skills"})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(t?.skills||[]).map(e=>(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2 p-3 rounded-lg border border-border-subtle bg-surface-2/50",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-text-main",children:e.title||e.id}),(0,a.jsx)(l.Ex,{size:"sm",variant:"default",children:(0,a.jsxs)("code",{className:"text-[10px]",children:["sb-",e.id]})}),K[e.id]?.status==="update"&&(0,a.jsx)(l.Ex,{size:"sm",variant:"warning",children:"update available"}),K[e.id]?.status==="error"&&(0,a.jsx)("span",{className:"text-[10px] text-text-subtle",title:K[e.id]?.message||"check failed",children:"check failed"})]}),(0,a.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5 line-clamp-2",children:e.description||"—"})]}),(0,a.jsxs)("div",{className:"flex gap-1 shrink-0",children:[K[e.id]?.status==="update"&&(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:!!x,loading:"upd-preview"===x&&Q?.id===e.id,onClick:()=>eh(e.id),children:"Update"}),(0,a.jsx)(l.$n,{size:"sm",variant:"ghost",disabled:!!x,onClick:()=>ex(e.id),children:"Remove"})]})]},e.id)),!t?.skills?.length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No skills yet. Enable product skills or add manually."})]})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"Detected on this machine"}),(0,a.jsx)(l.Ex,{size:"sm",variant:"default",children:"read-only"})]}),(0,a.jsxs)("p",{className:"text-[11px] text-text-muted mb-3 leading-relaxed",children:["Skills already present in agent tool dirs (e.g. ",(0,a.jsx)("code",{className:"font-mono",children:"~/.claude/skills"}),","," ",(0,a.jsx)("code",{className:"font-mono",children:"~/.agents/skills"}),"), installed by other tooling. Switchboard does not manage them — import via the Catalog tab to manage them here."]}),(0,a.jsxs)("div",{className:"space-y-2 max-h-72 overflow-auto",children:[(t?.detectedSkills||[]).map(e=>(0,a.jsx)("div",{className:"flex items-start justify-between gap-2 p-3 rounded-lg border border-border-subtle bg-surface-2/50",children:(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-text-main",children:e.title||e.id}),e.managedBySwitchboard&&(0,a.jsx)(l.Ex,{size:"sm",variant:"primary",children:"sb-managed"}),(e.agents||[]).map(e=>(0,a.jsx)(l.Ex,{size:"sm",variant:"default",children:e},e))]}),(0,a.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5 line-clamp-2",children:e.description||"—"})]})},e.id)),!t?.detectedSkills?.length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No skills found in agent tool directories."})]})]}),Q&&(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsxs)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:["Update preview — ",(0,a.jsx)("code",{className:"text-[12px]",children:Q.id})]}),(0,a.jsx)("p",{className:"text-[11px] text-text-subtle mb-2",children:"Full incoming SKILL.md shown below. Exactly these bytes are installed on confirm — if upstream changes in between, the update is refused and you preview again."}),(0,a.jsx)("pre",{className:"text-[10px] font-mono max-h-64 overflow-auto bg-surface-2 p-2 rounded border border-border-subtle whitespace-pre-wrap",children:Q.markdown}),(0,a.jsxs)("label",{className:"flex items-start gap-2 text-xs text-text-muted cursor-pointer mt-2",children:[(0,a.jsx)("input",{type:"checkbox","aria-label":"I reviewed this skill update and understand it may instruct agents to run tools or shell commands",checked:B,onChange:e=>q(e.target.checked)}),"I reviewed this skill and understand it may instruct agents to run tools/shell commands."]}),(0,a.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,a.jsx)(l.$n,{size:"sm",disabled:!B||!!x,loading:"upd-apply"===x,onClick:eu,children:"Apply update"}),(0,a.jsx)(l.$n,{size:"sm",variant:"ghost",disabled:!!x,onClick:()=>{W(null),q(!1)},children:"Cancel"})]})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Add skill (paste SKILL.md)"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("input",{className:"w-full bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"skill-id (e.g. my-review)",value:J,onChange:e=>G(e.target.value)}),(0,a.jsx)("textarea",{className:"w-full h-40 bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"---\nname: my-skill\ndescription: ...\n---\n\n# ...",value:_,onChange:e=>F(e.target.value)}),(0,a.jsx)(l.$n,{size:"sm",disabled:!J||!_||!!x,loading:"skill-add"===x,onClick:ep,children:"Add to library"})]})]})]}),!c&&"mcp"===y&&(0,a.jsxs)("div",{className:"space-y-4",children:[(e=C.find(e=>"executor"===e.id)||{id:"executor",name:"Executor.sh (Tool Gateway)",description:"Unified MCP tool gateway for OpenAPI, GraphQL, MCP servers & sandboxed JavaScript functions (executor.sh)",transport:"stdio",command:"npx",args:["-y","executor","mcp"],notes:"Executor.sh tool execution gateway (https://executor.sh)",docsUrl:"https://executor.sh"},s=(t?.mcpServers||[]).some(e=>"executor"===e.id||"sb-executor"===e.id),(0,a.jsx)(l.Zp,{padding:"md",className:"border-primary/30 bg-primary/5",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"space-y-1 max-w-xl",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"hub"}),(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"Executor.sh Tool Gateway"}),(0,a.jsx)(l.Ex,{variant:"primary",size:"sm",children:"FEATURED GATEWAY"}),s&&(0,a.jsx)(l.Ex,{variant:"default",size:"sm",children:"Installed in Library"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted leading-relaxed",children:"Connect your AI agents to OpenAPI, GraphQL, MCP servers, and custom JavaScript functions through a single managed endpoint with local-first credential management."}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 pt-1 text-[11px] font-mono text-text-subtle",children:[(0,a.jsxs)("span",{children:["Command: ",(0,a.jsx)("code",{className:"text-text-main",children:"npx -y executor mcp"})]}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsxs)("a",{href:"https://executor.sh",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline inline-flex items-center gap-0.5",children:["executor.sh docs",(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"open_in_new"})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 shrink-0",children:[(0,a.jsx)(l.$n,{size:"sm",variant:s?"outline":"primary",disabled:s||!!x,loading:"mcp-preset-executor"===x,onClick:()=>eo(e),children:s?"Installed":"Add Executor Gateway"}),(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:!!x,onClick:()=>ec(e),children:"Customize"})]})]})})),C.filter(e=>"executor"!==e.id).length>0&&(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-1",children:"Popular MCP Server Presets"}),(0,a.jsx)("p",{className:"text-[11px] text-text-subtle mb-3",children:"1-click presets for common Model Context Protocol servers."}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-3",children:C.filter(e=>"executor"!==e.id).map(e=>{let s=(t?.mcpServers||[]).some(s=>s.id===e.id||s.id===`sb-${e.id}`);return(0,a.jsxs)("div",{className:"p-3 rounded-lg border border-border-subtle bg-surface-2/40 hover:bg-surface-2/70 flex flex-col justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-1",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main",children:e.name}),s&&(0,a.jsx)(l.Ex,{size:"sm",variant:"default",children:"Installed"})]}),(0,a.jsx)("p",{className:"text-[11px] text-text-muted mt-1 line-clamp-2",children:e.description})]}),(0,a.jsxs)("div",{className:"flex gap-1.5 pt-1",children:[(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:s||!!x,loading:x===`mcp-preset-${e.id}`,onClick:()=>eo(e),children:s?"Installed":"Add"}),(0,a.jsx)(l.$n,{size:"sm",variant:"ghost",disabled:!!x,onClick:()=>ec(e),children:"Customize"})]})]},e.id)})})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-1",children:"MCP servers in library"}),(0,a.jsxs)("p",{className:"text-[11px] text-text-subtle mb-3",children:["Prefer ",(0,a.jsxs)("code",{className:"font-mono",children:["$","{GITHUB_TOKEN}"]})," style env values — do not paste raw API keys if you can avoid it. Keys are projected as"," ",(0,a.jsx)("code",{className:"font-mono",children:"sb-*"})," only."]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(t?.mcpServers||[]).map(e=>(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2 p-3 rounded-lg border border-border-subtle",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm text-text-main font-medium",children:e.name}),(0,a.jsx)("code",{className:"text-[10px] text-text-subtle",children:e.id}),(0,a.jsxs)("div",{className:"text-[11px] text-text-muted mt-1",children:[e.transport||"stdio"," \xb7"," ",e.command?`${e.command} ${(e.args||[]).map(e=>/[\s"'\\]/.test(e)?`"${e.replace(/(["\\])/g,"\\$1")}"`:e).join(" ")}`:e.url]})]}),(0,a.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>em(e.id),children:"Remove"})]},e.id)),!t?.mcpServers?.length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No MCP servers in library yet. Add Executor.sh or another preset above."})]})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-3",children:"Add Custom MCP server"}),(0,a.jsxs)("form",{className:"grid gap-2 sm:grid-cols-2",onSubmit:ed,children:[(0,a.jsx)("input",{required:!0,className:"bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"id (e.g. filesystem)",value:v.id,onChange:e=>w({...v,id:e.target.value})}),(0,a.jsx)("input",{className:"bg-surface border border-border rounded-md px-2 py-1.5 text-xs",placeholder:"Display name",value:v.name,onChange:e=>w({...v,name:e.target.value})}),(0,a.jsxs)("select",{className:"bg-surface border border-border rounded-md px-2 py-1.5 text-xs",value:v.transport,onChange:e=>w({...v,transport:e.target.value}),children:[(0,a.jsx)("option",{value:"stdio",children:"stdio (command)"}),(0,a.jsx)("option",{value:"http",children:"http (url)"}),(0,a.jsx)("option",{value:"sse",children:"sse (url)"})]}),"stdio"===v.transport?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{className:"bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"command",value:v.command,onChange:e=>w({...v,command:e.target.value})}),(0,a.jsx)("input",{className:"sm:col-span-2 bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"args (space-separated)",value:v.args,onChange:e=>w({...v,args:e.target.value})})]}):(0,a.jsx)("input",{className:"sm:col-span-1 bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"https://...",value:v.url,onChange:e=>w({...v,url:e.target.value})}),(0,a.jsx)("div",{className:"sm:col-span-2",children:(0,a.jsx)(l.$n,{size:"sm",type:"submit",loading:"mcp"===x,disabled:!!x,children:"Save to library"})})]})]})]}),!c&&"catalog"===y&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-1",children:"Smart Import (Command, Repo, or URL)"}),(0,a.jsxs)("p",{className:"text-[11px] text-text-subtle mb-3",children:["Paste CLI commands like ",(0,a.jsx)("code",{className:"font-mono text-primary",children:"npx skills add citrolabs/ego-lite"}),", GitHub repositories like ",(0,a.jsx)("code",{className:"font-mono text-primary",children:"citrolabs/ego-lite"}),", or direct ",(0,a.jsx)("code",{className:"font-mono text-primary",children:"SKILL.md"})," URLs."]}),(0,a.jsxs)("form",{onSubmit:eb,className:"space-y-2.5",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{className:"flex-1 bg-surface border border-border rounded-md px-2.5 py-1.5 text-xs font-mono text-text-main placeholder:text-text-subtle",placeholder:"e.g. npx skills add citrolabs/ego-lite, anthropics/skills, or https://github.com/...",value:P,disabled:!!x,onChange:e=>{$(e.target.value),O("")}}),(0,a.jsx)(l.$n,{size:"sm",type:"submit",disabled:!P.trim()||!!x,loading:"resolve"===x,children:"Resolve & Preview"}),P&&(0,a.jsx)(l.$n,{type:"button",size:"sm",variant:"ghost",disabled:!!x,onClick:()=>{$(""),T([]),L(""),z(""),R(""),Z(!1),O("")},children:"Clear"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 text-[11px] text-text-subtle pt-1",children:[(0,a.jsx)("span",{className:"font-medium text-text-muted",children:"Quick try:"}),["npx skills add citrolabs/ego-lite","anthropics/skills","citrolabs/ego-lite"].map(e=>(0,a.jsx)("button",{type:"button",className:"px-2 py-0.5 rounded border border-border-subtle bg-surface-2 hover:bg-surface text-text-main hover:border-primary font-mono text-[10px] transition-colors cursor-pointer",disabled:!!x,onClick:()=>{$(e),O(""),p("resolve"),fetch("/api/agent-library/catalog",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"resolve",input:e})}).then(e=>e.json()).then(e=>{if(!e.ok)throw Error(e.message||e.error||"Resolution failed");let s=e.skills||[];T(s),1===s.length?(L(s[0].skillId),z(s[0].rawUrl),R(s[0].preview||""),Z(!1),h.success(`Resolved skill: ${s[0].skillId}`)):s.length>1&&(L(""),z(""),R(""),Z(!1),h.success(`Found ${s.length} skills in ${e.repo||"repository"}. Select one below.`))}).catch(e=>h.error(e.message)).finally(()=>p(""))},children:e},e))]})]}),E.length>1&&(0,a.jsxs)("div",{className:"mt-4 pt-3 border-t border-border-subtle space-y-2",children:[(0,a.jsxs)("div",{className:"text-xs font-medium text-text-main flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"folder_open"}),"Found ",E.length," skills in repository:"]}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:E.map(e=>(0,a.jsxs)("button",{type:"button",className:`w-full text-left p-2.5 rounded-lg border transition-all text-xs cursor-pointer ${M===e.rawUrl?"border-primary bg-primary/5 shadow-sm":"border-border-subtle hover:border-border bg-surface-2/40"}`,onClick:()=>{L(e.skillId),z(e.rawUrl),Z(!1),e.preview?R(e.preview):eg(e.rawUrl)},children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-1",children:[(0,a.jsx)("span",{className:"font-semibold text-text-main",children:e.title||e.skillId}),(0,a.jsx)(l.Ex,{size:"sm",variant:M===e.rawUrl?"primary":"default",children:(0,a.jsxs)("code",{className:"text-[10px]",children:["sb-",e.skillId]})})]}),(0,a.jsx)("div",{className:"text-[11px] font-mono text-text-subtle mt-1 truncate",children:e.path}),e.description&&(0,a.jsx)("p",{className:"text-[11px] text-text-muted mt-1 line-clamp-2",children:e.description})]},e.path||e.skillId))})]}),M&&(0,a.jsxs)("div",{className:"mt-4 pt-3 border-t border-border-subtle space-y-3",children:[(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,a.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("span",{className:"text-[11px] text-text-muted",children:["Skill ID (installed as sb-",A||"...",")"]}),(0,a.jsx)("input",{className:"w-full bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono text-text-main",placeholder:"skill-id",value:A,disabled:!!x,onChange:e=>L(e.target.value)})]}),(0,a.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,a.jsx)("span",{className:"text-[11px] text-text-muted",children:"Resolved Raw Source URL"}),(0,a.jsx)("input",{className:"w-full bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono text-text-main",placeholder:"https://.../SKILL.md",value:M,disabled:!!x,onChange:e=>z(e.target.value)})]})]}),U?(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("span",{className:"text-[11px] text-text-muted",children:"SKILL.md preview:"}),(0,a.jsx)("pre",{className:"text-[10px] font-mono max-h-56 overflow-auto bg-surface-2 p-2.5 rounded-lg border border-border-subtle whitespace-pre-wrap",children:U})]}):(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:!M||!!x,loading:"preview"===x,onClick:()=>eg(M),children:"Load Preview"}),(0,a.jsxs)("label",{className:"flex items-start gap-2 text-xs text-text-muted cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox","aria-label":"I reviewed this catalog skill and understand it may instruct agents to run tools or shell commands",checked:D,disabled:!!x,onChange:e=>Z(e.target.checked)}),(0,a.jsx)("span",{children:"I reviewed this skill and understand it may instruct agents to run tools or shell commands."})]}),(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsx)(l.$n,{size:"sm",disabled:!M||!A||!D||!!x,loading:"catalog"===x,onClick:ef,children:"Install into library"})})]}),I&&(0,a.jsxs)("div",{className:"mt-4 p-3 rounded-lg bg-green-500/10 border border-green-500/30 flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"text-xs text-green-700 dark:text-green-300",children:[(0,a.jsx)("strong",{children:I})," is installed in your Switchboard library. Apply sync to project it into Claude, Codex, Gemini, OpenCode, and Cursor."]}),(0,a.jsx)(l.$n,{size:"sm",variant:"primary",loading:"apply"===x,disabled:!!x,onClick:()=>ei("apply"),children:"Apply sync to all agents now"})]})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-1",children:"Trusted presets"}),(0,a.jsx)("p",{className:"text-[11px] text-text-subtle mb-3",children:"One-click standard skills from official sources."}),(0,a.jsx)("div",{className:"space-y-2",children:N.map(e=>(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 p-2.5 rounded-lg border border-border-subtle bg-surface-2/40 hover:bg-surface-2/70 transition-colors",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs font-semibold text-text-main",children:e.name}),(0,a.jsx)("div",{className:"text-[11px] text-text-muted",children:e.description})]}),(0,a.jsxs)("div",{className:"flex gap-1.5",children:[(0,a.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>{Z(!1),$(e.rawUrl),z(e.rawUrl),L(e.skillId),T([]),O(""),eg(e.rawUrl)},children:"Preview"}),(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",onClick:()=>{$(e.rawUrl),z(e.rawUrl),L(e.skillId),T([]),Z(!1),O(""),eg(e.rawUrl)},children:"Select"})]})]},e.id))})]})]}),!c&&"advanced"===y&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Clean managed projections"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-3",children:["Removes only ",(0,a.jsx)("code",{className:"font-mono",children:"sb-*"})," skills and MCP keys written by Switchboard. Your other skills/MCP stay untouched."]}),(0,a.jsx)(l.$n,{size:"sm",variant:"outline",disabled:!!x,loading:"clean"===x,onClick:async()=>{await (0,i.l)({message:"Remove all Switchboard-managed skill/MCP projections from targets?",confirmText:"Continue"})&&ei("clean")},children:"Clean managed only"})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Export AgentSync layout"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Writes a coexistence-friendly ",(0,a.jsx)("code",{className:"font-mono",children:".agents/"})," tree (skills + agentsync.toml). Does not run agentsync. Paths must be under your home or project directory."]}),(0,a.jsx)("input",{className:"w-full bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono mb-2",placeholder:"Optional dest (default ~/switchboard-agents-export/.agents)",value:Y,onChange:e=>V(e.target.value)}),(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:!!x,loading:"export"===x,onClick:ey,children:"Export"})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Coexistence"}),(0,a.jsxs)("ul",{className:"text-xs text-text-muted space-y-1 list-disc pl-4",children:[(0,a.jsxs)("li",{children:["Switchboard only owns ",(0,a.jsx)("code",{className:"font-mono",children:"sb-*"})," skill directories and MCP keys."]}),(0,a.jsx)("li",{children:"AgentSync / skillbook may manage other paths — avoid pointing both at the same un-namespaced skill."}),(0,a.jsx)("li",{children:"Product skills for HTTP agents remain under Dashboard → Skills (separate)."})]})]})]})]})}function o({label:e,value:s}){return(0,a.jsxs)(l.Zp,{padding:"sm",children:[(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-text-subtle font-semibold",children:e}),(0,a.jsx)("div",{className:"text-sm text-text-main mt-1 font-medium truncate",title:s,children:s})]})}}},e=>{e.O(0,[2574,3862,782,8500,594,4601,1321,1330,8441,3794,7358],()=>e(e.s=5194)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4465],{35497:(e,t,r)=>{"use strict";r.d(t,{x0:()=>j.default,Ex:()=>d.default,$n:()=>a.default,nh:()=>C.default,Zp:()=>i.default,Qv:()=>o.CardSkeleton,CK:()=>h.default,uo:()=>n.ConfirmModal,G9:()=>v.default,wI:()=>y.default,vj:()=>N.default,vE:()=>w.default,pd:()=>s.default,Mh:()=>b.default,uR:()=>p.default,Nf:()=>x.default,aF:()=>n.default,rq:()=>u.default,gw:()=>S.default,LF:()=>m.default,Wx:()=>k.default,gM:()=>g.default,Iz:()=>I.default,l6:()=>l.default,lM:()=>c.default,m_:()=>A.default,jK:()=>f.default});var a=r(92542),s=r(11910),l=r(98),i=r(84588),n=r(81127),o=r(25086);r(56319);var d=r(56061),c=r(98542);r(61929),r(21110),r(92622),r(8823),r(92173);var m=r(90882),u=r(72908),p=r(28815),h=r(45455),x=r(28058),f=r(4809);r(21931),r(80752),r(40197);var g=r(23615);r(44736);var b=r(62899);r(94230);var v=r(30815),w=r(23936),N=r(95088),y=r(73579),j=r(96748),S=r(4823),I=r(28067),A=r(97677),k=r(51825),C=r(29366);r(76361),r(91450)},55774:(e,t,r)=>{Promise.resolve().then(r.bind(r,88512))},88512:(e,t,r)=>{"use strict";r.d(t,{default:()=>v});var a=r(95155),s=r(12115),l=r(35497),i=r(28777),n=r(88105),o=r(5772);let d="basic-chat.sessions",c="basic-chat.activeSessionId",m="basic-chat.activeProviderId",u="basic-chat.draft";function p(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`chat_${Date.now()}_${Math.random().toString(16).slice(2)}`}function h(e){if("string"==typeof e)return e;if(null==e)return"";if(Array.isArray(e))return e.map(h).filter(Boolean).join(" ");if("object"==typeof e){if("string"==typeof e.message)return e.message;if("string"==typeof e.error)return e.error;try{return JSON.stringify(e)}catch{}}return String(e)}function x(e=""){let t=h(e).replace(/\s+/g," ").trim();return t?t.length>52?`${t.slice(0,52).trimEnd()}…`:t:"New chat"}async function f(e){return await new Promise((t,r)=>{let a=new FileReader;a.onload=()=>t(String(a.result||"")),a.onerror=()=>r(a.error||Error("Failed to read file")),a.readAsDataURL(e)})}function g(e){return e?.name||function(e=""){return String(e).replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()||"Unknown"}(e?.provider||e?.id||"provider")}function b(e){return h(e?.providerSpecificData?.prefix)||h(e?.provider)||h(e?.id)}function v(){let[e,t]=(0,s.useState)([]),[r,v]=(0,s.useState)(!0),[w,N]=(0,s.useState)(""),[y,j]=(0,s.useState)(""),[S,I]=(0,s.useState)(""),[A,k]=(0,s.useState)(()=>{try{let e=function(e,t){try{return JSON.parse(e)}catch{return t}}(globalThis.localStorage.getItem(d),[]);return Array.isArray(e)?e.map(e=>({...e,messages:Array.isArray(e.messages)?e.messages:[]})):[]}catch{return[]}}),[C,D]=(0,s.useState)(()=>globalThis.localStorage.getItem(c)||""),[$,M]=(0,s.useState)(()=>globalThis.localStorage.getItem(m)||""),[O,E]=(0,s.useState)(""),[_,T]=(0,s.useState)(()=>globalThis.localStorage.getItem(u)||""),[R,U]=(0,s.useState)([]),[z,P]=(0,s.useState)(!1),[q,F]=(0,s.useState)(""),[J,K]=(0,s.useState)(""),[B,L]=(0,s.useState)(!1),[W,G]=(0,s.useState)(!1),[H,Q]=(0,s.useState)(!1),Y=(0,s.useRef)(null),Z=(0,s.useRef)(null),V=(0,s.useRef)(!1),X=(0,s.useRef)(null),ee=(0,s.useRef)(null);(0,s.useEffect)(()=>{L(!0)},[]),(0,s.useEffect)(()=>{let e=!1;return async function(){v(!0),N("");try{let[r,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/combos",{cache:"no-store"}).catch(()=>null)]),s=await r.json().catch(()=>({}));if(!r.ok)throw Error(s?.error||`Failed to load providers (HTTP ${r.status}).`);let l=Array.isArray(s.connections)?s.connections.filter(e=>e?.isActive!==!1):[],o=a&&a.ok?await a.json().catch(()=>({})):{},d=Array.isArray(o?.combos)?o.combos.filter(e=>!e.kind||"llm"===e.kind):[];if(0===l.length&&0===d.length){e||(t([]),N("No providers connected yet."));return}let c=new Map;for(let e of l){let t=e.provider||e.id,r=g(e),a=(0,n.mq)(t)?"openai-compatible":(0,n.gb)(t)?"anthropic-compatible":t;c.has(t)||c.set(t,{providerId:t,providerName:r,providerType:a,connections:[],models:[]});let s=c.get(t);s.providerName=s.providerName||r,s.providerType=s.providerType||a,s.connections.push(e);let l=(0,i.KC)(t).map(t=>(function(e,t){if(!e?.id)return null;let r=`${b(t)}/${e.id}`;return{id:r,requestModel:r,name:e.name||e.id,providerId:t.provider,providerName:g(t),source:"static"}})(t,e)).filter(Boolean);s.models.push(...l)}for(let e of(await Promise.all(l.map(async e=>{try{let t=await fetch(`/api/providers/${encodeURIComponent(e.id)}/models`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)return{connection:e,models:[]};let a=(Array.isArray(r?.models)?r.models:Array.isArray(r?.data)?r.data:Array.isArray(r?.results)?r.results:Array.isArray(r)?r:[]).map(t=>(function(e,t){let r="string"==typeof e?e:e?.id||e?.name||e?.model||"";if(!r)return null;let a="string"==typeof e?e:e?.name||e?.displayName||r,s=r;if((0,n.mq)(t.provider)||(0,n.gb)(t.provider)){let e=b(t);e&&!r.startsWith(`${e}/`)&&(s=`${e}/${r}`)}return{id:s,requestModel:s,name:a,providerId:t.provider,providerName:g(t),source:"live"}})(t,e)).filter(Boolean);return{connection:e,models:a}}catch{return{connection:e,models:[]}}})))){let t=e.connection.provider||e.connection.id,r=c.get(t);r&&r.models.push(...e.models)}let m=Array.from(c.values()).map(e=>({...e,models:(function(e){let t=new Map;for(let r of e)r?.id&&(t.has(r.id)||t.set(r.id,r));return Array.from(t.values())})(e.models).sort((e,t)=>e.name.localeCompare(t.name))})).filter(e=>e.models.length>0).sort((e,t)=>e.providerName.localeCompare(t.providerName));if(d.length>0){let e=d.map(e=>({id:e.name,requestModel:e.name,name:`${e.name} (${e.models?.length||0} models)`,providerId:"combos",providerName:"Combos & Routing",source:"combo"}));m.unshift({providerId:"combos",providerName:"Combos & Routing",providerType:"combo",connections:[],models:e})}e||(t(m),0===m.length&&N("Providers connected but no models available."))}catch(r){e||(N(h(r?.message)||"Failed to load providers/models."),t([]))}finally{e||v(!1)}}(),()=>{e=!0}},[]),(0,s.useEffect)(()=>{let e=e=>{X.current&&!X.current.contains(e.target)&&G(!1),ee.current&&!ee.current.contains(e.target)&&Q(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let et=(0,s.useMemo)(()=>{let t=new Map;for(let r of e)for(let e of r.models)t.set(e.id,{...e,providerId:r.providerId,providerName:r.providerName});return t},[e]),er=(0,s.useMemo)(()=>e.find(e=>e.providerId===$)||e[0]||null,[e,$]),ea=(0,s.useMemo)(()=>{if(O&&et.has(O))return et.get(O);if(C){let e=A.find(e=>e.id===C);if(e?.modelId&&et.has(e.modelId))return et.get(e.modelId)}return er?.models?.[0]||null},[O,et,er,A,C]),es=(0,s.useMemo)(()=>A.find(e=>e.id===C)||null,[A,C]),el=es?.messages||[],ei=(0,s.useMemo)(()=>[...A].sort((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()),[A]),en=!z&&!!ea&&(_.trim().length>0||R.length>0);(0,s.useEffect)(()=>{if(B&&!A.some(e=>(e.messages||[]).some(e=>"streaming"===e.status)))try{globalThis.localStorage.setItem(d,JSON.stringify(A)),globalThis.localStorage.setItem(c,C),globalThis.localStorage.setItem(m,$),globalThis.localStorage.setItem(u,_)}catch{}},[B,A,C,$,_]),(0,s.useEffect)(()=>{if(!B||r||V.current||0===e.length)return;let t=e.find(e=>e.providerId===$)||e[0],a=O&&et.has(O)?et.get(O):t.models[0];if(A.length>0){let e=A.find(e=>e.id===C)||A[0],r=e?.modelId&&et.has(e.modelId)?et.get(e.modelId):a;V.current=!0,D(e.id),M(r?.providerId||t.providerId),E(r?.id||a.id);return}let s={id:p(),title:"New chat",providerId:t.providerId,providerName:t.providerName,modelId:a.id,modelName:a.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]};V.current=!0,k([s]),D(s.id),M(t.providerId),E(a.id)},[B,r,e,et,A,C,$,O]);let eo=(e,t)=>{k(r=>r.map(r=>r.id===e?t({...r,messages:Array.isArray(r.messages)?r.messages.map(e=>({...e})):[]}):r))},ed=e=>e?{id:p(),title:"New chat",providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]}:null,ec=()=>{Z.current?.abort(),Z.current=null,P(!1),F(""),K("")},em=async e=>{let t=Array.from(e.target.files||[]);if(0===t.length)return;let r=t.filter(e=>e.type.startsWith("image/"));if(0===r.length){I("Only image files are supported."),e.target.value="";return}I("");let a=await Promise.all(r.map(async e=>({id:p(),name:e.name,type:e.type,size:e.size,dataUrl:await f(e)})));U(e=>[...e,...a]),e.target.value=""},eu=async()=>{let e=ea||er?.models?.[0]||null;if(!e)return;let t=_.trim();if(!t&&0===R.length)return;let r=C,a=A.find(e=>e.id===r);if(!a){if(!(a=ed(e)))return;r=a.id,k(e=>[a,...e]),D(r)}let s={id:p(),role:"user",content:t,attachments:R.map(e=>({id:e.id,name:e.name,type:e.type,dataUrl:e.dataUrl})),createdAt:new Date().toISOString()},l=p(),i={id:l,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming"},n=[...a.messages||[],s,i];k(a=>a.map(a=>a.id===r?{...a,providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,messages:n,updatedAt:new Date().toISOString(),title:"New chat"===a.title?x(t):a.title}:a)),T(""),U([]),j(""),P(!0),F(l),K(""),Z.current?.abort(),Z.current=new AbortController;let o=n.filter(e=>"assistant"!==e.role||e.id!==l).map(e=>({role:e.role,content:"user"===e.role?function(e){let t=h(e.content).trim(),r=Array.isArray(e.attachments)?e.attachments:[];if(0===r.length)return t;let a=[];for(let e of(t&&a.push({type:"text",text:t}),r))e?.dataUrl&&a.push({type:"image_url",image_url:{url:e.dataUrl}});return a.length>0?a:t}(e):e.content}));try{var d;let a,s=await fetch("/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({model:e.requestModel||e.id,messages:o,stream:!0}),signal:Z.current.signal});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(h(e.error||e.message||`Request failed (${s.status})`))}let i=s.body?.getReader();if(!i){let e=await s.json().catch(()=>({})),t=h(e?.choices?.[0]?.message?.content||e?.output_text||e?.error||e?.message||"");eo(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:t,status:"done"}:e),updatedAt:new Date().toISOString()}));return}let n=new TextDecoder,c="",m="";for(;;){let{value:e,done:t}=await i.read();if(t)break;let a=(c+=n.decode(e,{stream:!0})).split(/\r?\n/);for(let e of(c=a.pop()||"",a)){let t=e.trim();if(!t.startsWith("data:"))continue;let a=t.slice(5).trim();if(a&&"[DONE]"!==a)try{let e=JSON.parse(a),t=function(e){if(!e||"object"!=typeof e)return"";let t=e.choices?.[0];return[(t?.delta||{}).content,t?.message?.content,e.output_text,e.text].map(h).filter(Boolean)[0]||""}(e);if(!t)continue;m+=t,K(m),eo(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:m,status:"streaming"}:e),updatedAt:new Date().toISOString()}))}catch{}}}eo(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:m||e.content,status:"done"}:e),updatedAt:new Date().toISOString()})),d=r,a=x(t),eo(d,e=>({...e,title:"New chat"===e.title?a:e.title,updatedAt:new Date().toISOString()}))}catch(e){if("AbortError"===e.name)eo(r,e=>({...e,messages:e.messages.flatMap(e=>e.id!==l?[e]:h(e.content)?[{...e,status:"stopped"}]:[]),updatedAt:new Date().toISOString()}));else{let t=h(e?.message||e);eo(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:e.content||`Error: ${t}`,status:"error"}:e),updatedAt:new Date().toISOString()})),j(t||"Failed to send message.")}}finally{P(!1),F(""),K(""),Z.current=null}},ep=ea?`${ea.name}`:"Select model",eh=ea?ea.requestModel:"Choose from connected providers";return(0,a.jsx)("div",{className:"relative flex-1 flex flex-col h-full min-h-0 min-w-0 bg-[#212121] text-white overflow-hidden",children:(0,a.jsxs)("div",{className:"relative mx-auto flex flex-1 h-full min-h-0 w-full max-w-4xl flex-col",children:[(0,a.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-3 px-4 py-3 lg:px-6",children:[(0,a.jsxs)("div",{ref:X,className:"relative",children:[(0,a.jsx)("button",{type:"button",onClick:()=>G(e=>!e),className:"flex items-center gap-3 rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-left transition hover:bg-white/8",children:(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-semibold text-white",children:ep}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-white/70",children:"expand_more"})]}),(0,a.jsx)("p",{className:"truncate text-xs text-white/55",children:eh})]})}),W?(0,a.jsxs)("div",{className:"absolute left-0 top-[calc(100%+10px)] z-30 w-[min(520px,calc(100vw-2rem))] overflow-hidden rounded-[20px] border border-white/10 bg-[#262626] shadow-2xl shadow-black/50",children:[(0,a.jsxs)("div",{className:"border-b border-white/10 px-4 py-3",children:[(0,a.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Models"}),(0,a.jsx)("p",{className:"text-sm text-white/75",children:"Only from connected providers"})]}),(0,a.jsx)("div",{className:"max-h-[60vh] overflow-y-auto p-2 custom-scrollbar",children:e.map(e=>(0,a.jsxs)("div",{className:"mb-2 rounded-[16px] border border-white/10 bg-black/20 p-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-2 py-2",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-white",children:e.providerName}),(0,a.jsx)(l.Ex,{size:"sm",variant:"default",children:e.models.length})]}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:e.models.map(e=>{let t=e.id===O;return(0,a.jsx)("button",{type:"button",onClick:()=>(e=>{let t=et.get(e);if(!t)return;let r=A.find(e=>e.id===C);if(r&&r.messages.length>0){let e=ed(t);if(!e)return;k(t=>[e,...t]),D(e.id)}else if(r)k(e=>e.map(e=>e.id===r.id?{...e,providerId:t.providerId,providerName:t.providerName,modelId:t.id,modelName:t.name}:e)),D(r.id);else{let e=ed(t);if(!e)return;k(t=>[e,...t]),D(e.id)}M(t.providerId),E(t.id),G(!1)})(e.id),className:`rounded-[14px] border px-3 py-3 text-left transition ${t?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-white",children:e.name}),(0,a.jsx)("p",{className:"truncate text-[11px] text-white/45",children:e.requestModel})]}),t?(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-blue-300",children:"check_circle"}):null]})},e.id)})})]},e.providerId))})]}):null]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(l.$n,{variant:"ghost",size:"sm",icon:"add",onClick:()=>{ec();let e=ed(ea);e&&(k(t=>[e,...t]),D(e.id),M(e.providerId),E(e.modelId),T(""),U([]),F(""),K(""))},disabled:!ea,children:"New conversation"}),(0,a.jsx)("button",{type:"button",onClick:()=>Q(e=>!e),className:"rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-sm text-white/80 transition hover:bg-white/8",children:"History"}),(0,a.jsx)(l.$n,{variant:"ghost",size:"sm",icon:"delete",onClick:()=>{if(!C)return;ec();let e=A.filter(e=>e.id!==C),t=e[0]||null;k(e),t?(D(t.id),M(t.providerId),E(t.modelId)):(D(""),M(""),E(""))},disabled:!C||0===A.length,children:"Clear"})]})]}),H?(0,a.jsxs)("div",{ref:ee,className:"absolute right-4 top-[72px] z-20 w-[min(360px,calc(100vw-2rem))] rounded-[20px] border border-white/10 bg-[#262626] p-2 shadow-2xl shadow-black/50 lg:right-6",children:[(0,a.jsx)("div",{className:"px-3 py-2",children:(0,a.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Recent chats"})}),(0,a.jsx)("div",{className:"max-h-[48vh] space-y-2 overflow-y-auto p-1 custom-scrollbar",children:0===ei.length?(0,a.jsx)("div",{className:"rounded-[16px] border border-dashed border-white/10 bg-white/5 p-4 text-sm text-white/55",children:"No conversations yet."}):ei.map(e=>{let t=e.id===C,r=[...e.messages||[]].reverse().find(e=>"user"===e.role)||e.messages?.[0];return(0,a.jsx)("button",{type:"button",onClick:()=>{var t;let r;return t=e.id,void((r=A.find(e=>e.id===t))&&(ec(),D(t),M(r.providerId||$),E(r.modelId||O),Q(!1)))},className:`w-full rounded-[16px] border px-3 py-3 text-left transition ${t?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-white",children:e.title}),(0,a.jsx)("p",{className:"mt-1 truncate text-xs text-white/50",children:h(r?.content)||"Empty chat"})]}),(0,a.jsx)("span",{className:"text-[10px] text-white/40 shrink-0",children:function(e){if(!e)return"Now";let t=new Date(e).getTime();if(Number.isNaN(t))return"Now";let r=Math.max(1,Math.round((Date.now()-t)/6e4));if(r<60)return`${r}m`;let a=Math.round(r/60);return a<24?`${a}h`:`${Math.round(a/24)}d`}(e.updatedAt)})]})},e.id)})})]}):null,w?(0,a.jsx)("div",{className:"mt-4 rounded-[18px] border border-rose-500/20 bg-rose-500/10 px-4 py-3 text-rose-100",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"error"}),(0,a.jsx)("p",{className:"text-sm leading-6",children:w})]})}):null,(0,a.jsxs)("div",{className:"flex flex-1 flex-col min-h-0",children:[(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto py-4 custom-scrollbar",children:[0===el.length?(0,a.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center px-4 text-center",children:(0,a.jsxs)("div",{className:"max-w-xl space-y-4",children:[(0,a.jsx)("div",{className:"mx-auto flex size-16 items-center justify-center rounded-[20px] border border-white/10 bg-white/5 text-white/80",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[30px]",children:"chat"})}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h2",{className:"text-2xl font-semibold text-white",children:"Start a conversation"}),(0,a.jsx)("p",{className:"text-sm leading-6 text-white/60",children:"Simple chat interface to interact with any AI model from connected providers. Select a model and start chatting!"})]})]})}):null,(0,a.jsx)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4",children:el.map(e=>{let t="user"===e.role,r="assistant"===e.role,s=r&&e.id===q&&"streaming"===e.status,l=h(e.content)||(r?J:"");return(0,a.jsx)("div",{className:`flex w-full ${t?"justify-end":"justify-start"} mb-6`,children:(0,a.jsxs)("div",{className:`max-w-[min(88%,42rem)] ${t?"rounded-3xl bg-[#2f2f2f] px-5 py-3.5 text-white":"text-white/90"}`,children:[(0,a.jsx)("div",{className:"mb-1 flex items-center justify-between gap-3",children:(0,a.jsx)("span",{className:"text-xs font-semibold",children:t?"You":es?.modelName||ea?.name||"Assistant"})}),e.attachments?.length?(0,a.jsx)("div",{className:"mb-3 grid grid-cols-2 gap-2 sm:grid-cols-3 mt-2",children:e.attachments.map(e=>(0,a.jsx)("a",{href:e.dataUrl,target:"_blank",rel:"noreferrer",className:"overflow-hidden rounded-[18px] border border-white/10 bg-black/20",children:(0,a.jsx)(o.default,{src:e.dataUrl,alt:e.name,width:320,height:112,unoptimized:!0,className:"h-28 w-full object-cover"})},e.id))}):null,(0,a.jsxs)("div",{className:"whitespace-pre-wrap break-words text-[15px] leading-7",children:[l,r&&s&&!J?(0,a.jsx)("span",{className:"inline-block animate-pulse",children:"▋"}):null]}),r&&"stopped"===e.status?(0,a.jsx)("p",{className:"mt-1 text-xs italic text-white/45",children:"Generation stopped"}):null]})},e.id)})})]}),(0,a.jsxs)("div",{className:"shrink-0 pt-2",children:[y?(0,a.jsx)("div",{className:"mx-auto mb-3 w-full max-w-3xl px-4",children:(0,a.jsx)("div",{className:"rounded-[18px] border border-rose-500/20 bg-rose-500/10 px-4 py-2 text-sm text-rose-100",role:"alert",children:y})}):null,S?(0,a.jsx)("div",{className:"mx-auto mb-3 w-full max-w-3xl px-4",children:(0,a.jsx)("div",{className:"rounded-[18px] border border-amber-500/20 bg-amber-500/10 px-4 py-2 text-sm text-amber-100",role:"status",children:S})}):null,R.length>0?(0,a.jsx)("div",{className:"mx-auto mb-3 flex w-full max-w-3xl flex-wrap gap-2 px-4",children:R.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-3 py-2",children:[(0,a.jsx)("span",{className:"text-xs text-white/80 max-w-[12rem] truncate",children:e.name}),(0,a.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void U(e=>e.filter(e=>e.id!==t))},className:"text-white/55 hover:text-white","aria-label":"Remove attachment",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]},e.id))}):null,(0,a.jsx)("div",{className:"mx-auto w-full max-w-3xl px-4 pb-2",children:(0,a.jsxs)("div",{className:"rounded-[26px] bg-[#2f2f2f] px-3 pt-3 pb-2 shadow-[0_0_15px_rgba(0,0,0,0.10)] ring-1 ring-white/5",children:[(0,a.jsx)("textarea",{value:_,onChange:e=>T(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),en&&eu())},placeholder:"Message AI",rows:1,className:"w-full resize-none bg-transparent px-2 text-[15px] leading-6 text-white outline-none placeholder:text-white/40 custom-scrollbar max-h-[25vh] overflow-y-auto"}),(0,a.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>Y.current?.click(),disabled:!ea||r,"aria-label":"Attach image",className:"p-2 text-white/50 hover:text-white transition rounded-full hover:bg-white/5",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"attach_file"})}),(0,a.jsx)("input",{ref:Y,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:em}),(0,a.jsx)("span",{className:"text-xs font-medium text-white/30 truncate max-w-[120px]",children:ea?ea.name:"No model"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[z?(0,a.jsx)("button",{type:"button",onClick:()=>{Z.current?.abort()},"aria-label":"Stop generating",className:"p-2 text-white bg-white/10 hover:bg-white/20 transition rounded-full h-8 w-8 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop"})}):null,(0,a.jsx)("button",{type:"button",onClick:eu,disabled:!en,"aria-label":"Send message",className:`h-8 w-8 rounded-full flex items-center justify-center transition ${en?"bg-white text-black hover:opacity-90":"bg-white/10 text-white/30 cursor-not-allowed"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})})]})]})]})})]}),(0,a.jsx)("p",{className:"mx-auto mt-2 max-w-3xl px-4 pb-4 text-center text-[11px] text-white/30",children:"Model list is filtered from connected providers."})]})]})})}}},e=>{e.O(0,[2574,3862,782,8500,594,1321,4707,1330,8441,3794,7358],()=>e(e.s=55774)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4465],{35497:(e,t,r)=>{"use strict";r.d(t,{x0:()=>j.default,Ex:()=>d.default,$n:()=>a.default,nh:()=>C.default,Zp:()=>i.default,Qv:()=>o.CardSkeleton,CK:()=>h.default,uo:()=>n.ConfirmModal,G9:()=>v.default,wI:()=>y.default,vj:()=>N.default,vE:()=>w.default,pd:()=>s.default,Mh:()=>b.default,uR:()=>p.default,Nf:()=>x.default,aF:()=>n.default,rq:()=>u.default,gw:()=>S.default,LF:()=>m.default,Wx:()=>k.default,gM:()=>g.default,Iz:()=>I.default,l6:()=>l.default,lM:()=>c.default,m_:()=>A.default,jK:()=>f.default});var a=r(92542),s=r(11910),l=r(98),i=r(84588),n=r(81127),o=r(25086);r(56319);var d=r(56061),c=r(98542);r(61929),r(21110),r(92622),r(8823),r(92173);var m=r(90882),u=r(72908),p=r(28815),h=r(45455),x=r(28058),f=r(4809);r(21931),r(80752),r(40197);var g=r(23615);r(44736);var b=r(62899);r(94230);var v=r(30815),w=r(23936),N=r(95088),y=r(73579),j=r(96748),S=r(4823),I=r(28067),A=r(97677),k=r(51825),C=r(29366);r(76361),r(91450)},55774:(e,t,r)=>{Promise.resolve().then(r.bind(r,88512))},88512:(e,t,r)=>{"use strict";r.d(t,{default:()=>v});var a=r(95155),s=r(12115),l=r(35497),i=r(28777),n=r(88105),o=r(5772);let d="basic-chat.sessions",c="basic-chat.activeSessionId",m="basic-chat.activeProviderId",u="basic-chat.draft";function p(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`chat_${Date.now()}_${Math.random().toString(16).slice(2)}`}function h(e){if("string"==typeof e)return e;if(null==e)return"";if(Array.isArray(e))return e.map(h).filter(Boolean).join(" ");if("object"==typeof e){if("string"==typeof e.message)return e.message;if("string"==typeof e.error)return e.error;try{return JSON.stringify(e)}catch{}}return String(e)}function x(e=""){let t=h(e).replace(/\s+/g," ").trim();return t?t.length>52?`${t.slice(0,52).trimEnd()}…`:t:"New chat"}async function f(e){return await new Promise((t,r)=>{let a=new FileReader;a.onload=()=>t(String(a.result||"")),a.onerror=()=>r(a.error||Error("Failed to read file")),a.readAsDataURL(e)})}function g(e){return e?.name||function(e=""){return String(e).replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()||"Unknown"}(e?.provider||e?.id||"provider")}function b(e){return h(e?.providerSpecificData?.prefix)||h(e?.provider)||h(e?.id)}function v(){let[e,t]=(0,s.useState)([]),[r,v]=(0,s.useState)(!0),[w,N]=(0,s.useState)(""),[y,j]=(0,s.useState)(""),[S,I]=(0,s.useState)(""),[A,k]=(0,s.useState)(()=>{try{let e=function(e,t){try{return JSON.parse(e)}catch{return t}}(globalThis.localStorage.getItem(d),[]);return Array.isArray(e)?e.map(e=>({...e,messages:Array.isArray(e.messages)?e.messages:[]})):[]}catch{return[]}}),[C,D]=(0,s.useState)(()=>globalThis.localStorage.getItem(c)||""),[$,M]=(0,s.useState)(()=>globalThis.localStorage.getItem(m)||""),[O,E]=(0,s.useState)(""),[_,T]=(0,s.useState)(()=>globalThis.localStorage.getItem(u)||""),[R,U]=(0,s.useState)([]),[z,P]=(0,s.useState)(!1),[q,F]=(0,s.useState)(""),[J,K]=(0,s.useState)(""),[B,L]=(0,s.useState)(!1),[W,G]=(0,s.useState)(!1),[H,Q]=(0,s.useState)(!1),Y=(0,s.useRef)(null),Z=(0,s.useRef)(null),V=(0,s.useRef)(!1),X=(0,s.useRef)(null),ee=(0,s.useRef)(null);(0,s.useEffect)(()=>{L(!0)},[]),(0,s.useEffect)(()=>{let e=!1;return async function(){v(!0),N("");try{let[r,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/combos",{cache:"no-store"}).catch(()=>null)]),s=await r.json().catch(()=>({}));if(!r.ok)throw Error(s?.error||`Failed to load providers (HTTP ${r.status}).`);let l=Array.isArray(s.connections)?s.connections.filter(e=>e?.isActive!==!1):[],o=a&&a.ok?await a.json().catch(()=>({})):{},d=Array.isArray(o?.combos)?o.combos.filter(e=>!e.kind||"llm"===e.kind):[];if(0===l.length&&0===d.length){e||(t([]),N("No providers connected yet."));return}let c=new Map;for(let e of l){let t=e.provider||e.id,r=g(e),a=(0,n.mq)(t)?"openai-compatible":(0,n.gb)(t)?"anthropic-compatible":t;c.has(t)||c.set(t,{providerId:t,providerName:r,providerType:a,connections:[],models:[]});let s=c.get(t);s.providerName=s.providerName||r,s.providerType=s.providerType||a,s.connections.push(e);let l=(0,i.KC)(t).map(t=>(function(e,t){if(!e?.id)return null;let r=`${b(t)}/${e.id}`;return{id:r,requestModel:r,name:e.name||e.id,providerId:t.provider,providerName:g(t),source:"static"}})(t,e)).filter(Boolean);s.models.push(...l)}for(let e of(await Promise.all(l.map(async e=>{try{let t=await fetch(`/api/providers/${encodeURIComponent(e.id)}/models`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)return{connection:e,models:[]};let a=(Array.isArray(r?.models)?r.models:Array.isArray(r?.data)?r.data:Array.isArray(r?.results)?r.results:Array.isArray(r)?r:[]).map(t=>(function(e,t){let r="string"==typeof e?e:e?.id||e?.name||e?.model||"";if(!r)return null;let a="string"==typeof e?e:e?.name||e?.displayName||r,s=r;if((0,n.mq)(t.provider)||(0,n.gb)(t.provider)){let e=b(t);e&&!r.startsWith(`${e}/`)&&(s=`${e}/${r}`)}return{id:s,requestModel:s,name:a,providerId:t.provider,providerName:g(t),source:"live"}})(t,e)).filter(Boolean);return{connection:e,models:a}}catch{return{connection:e,models:[]}}})))){let t=e.connection.provider||e.connection.id,r=c.get(t);r&&r.models.push(...e.models)}let m=Array.from(c.values()).map(e=>({...e,models:(function(e){let t=new Map;for(let r of e)r?.id&&(t.has(r.id)||t.set(r.id,r));return Array.from(t.values())})(e.models).sort((e,t)=>e.name.localeCompare(t.name))})).filter(e=>e.models.length>0).sort((e,t)=>e.providerName.localeCompare(t.providerName));if(d.length>0){let e=d.map(e=>({id:e.name,requestModel:e.name,name:`${e.name} (${e.models?.length||0} models)`,providerId:"combos",providerName:"Combos & Routing",source:"combo"}));m.unshift({providerId:"combos",providerName:"Combos & Routing",providerType:"combo",connections:[],models:e})}e||(t(m),0===m.length&&N("Providers connected but no models available."))}catch(r){e||(N(h(r?.message)||"Failed to load providers/models."),t([]))}finally{e||v(!1)}}(),()=>{e=!0}},[]),(0,s.useEffect)(()=>{let e=e=>{X.current&&!X.current.contains(e.target)&&G(!1),ee.current&&!ee.current.contains(e.target)&&Q(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let et=(0,s.useMemo)(()=>{let t=new Map;for(let r of e)for(let e of r.models)t.set(e.id,{...e,providerId:r.providerId,providerName:r.providerName});return t},[e]),er=(0,s.useMemo)(()=>e.find(e=>e.providerId===$)||e[0]||null,[e,$]),ea=(0,s.useMemo)(()=>{if(O&&et.has(O))return et.get(O);if(C){let e=A.find(e=>e.id===C);if(e?.modelId&&et.has(e.modelId))return et.get(e.modelId)}return er?.models?.[0]||null},[O,et,er,A,C]),es=(0,s.useMemo)(()=>A.find(e=>e.id===C)||null,[A,C]),el=es?.messages||[],ei=(0,s.useMemo)(()=>[...A].sort((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()),[A]),en=!z&&!!ea&&(_.trim().length>0||R.length>0);(0,s.useEffect)(()=>{if(B&&!A.some(e=>(e.messages||[]).some(e=>"streaming"===e.status)))try{globalThis.localStorage.setItem(d,JSON.stringify(A)),globalThis.localStorage.setItem(c,C),globalThis.localStorage.setItem(m,$),globalThis.localStorage.setItem(u,_)}catch{}},[B,A,C,$,_]),(0,s.useEffect)(()=>{if(!B||r||V.current||0===e.length)return;let t=e.find(e=>e.providerId===$)||e[0],a=O&&et.has(O)?et.get(O):t.models[0];if(A.length>0){let e=A.find(e=>e.id===C)||A[0],r=e?.modelId&&et.has(e.modelId)?et.get(e.modelId):a;V.current=!0,D(e.id),M(r?.providerId||t.providerId),E(r?.id||a.id);return}let s={id:p(),title:"New chat",providerId:t.providerId,providerName:t.providerName,modelId:a.id,modelName:a.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]};V.current=!0,k([s]),D(s.id),M(t.providerId),E(a.id)},[B,r,e,et,A,C,$,O]);let eo=(e,t)=>{k(r=>r.map(r=>r.id===e?t({...r,messages:Array.isArray(r.messages)?r.messages.map(e=>({...e})):[]}):r))},ed=e=>e?{id:p(),title:"New chat",providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]}:null,ec=()=>{Z.current?.abort(),Z.current=null,P(!1),F(""),K("")},em=async e=>{let t=Array.from(e.target.files||[]);if(0===t.length)return;let r=t.filter(e=>e.type.startsWith("image/"));if(0===r.length){I("Only image files are supported."),e.target.value="";return}I("");let a=await Promise.all(r.map(async e=>({id:p(),name:e.name,type:e.type,size:e.size,dataUrl:await f(e)})));U(e=>[...e,...a]),e.target.value=""},eu=async()=>{let e=ea||er?.models?.[0]||null;if(!e)return;let t=_.trim();if(!t&&0===R.length)return;let r=C,a=A.find(e=>e.id===r);if(!a){if(!(a=ed(e)))return;r=a.id,k(e=>[a,...e]),D(r)}let s={id:p(),role:"user",content:t,attachments:R.map(e=>({id:e.id,name:e.name,type:e.type,dataUrl:e.dataUrl})),createdAt:new Date().toISOString()},l=p(),i={id:l,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming"},n=[...a.messages||[],s,i];k(a=>a.map(a=>a.id===r?{...a,providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,messages:n,updatedAt:new Date().toISOString(),title:"New chat"===a.title?x(t):a.title}:a)),T(""),U([]),j(""),P(!0),F(l),K(""),Z.current?.abort(),Z.current=new AbortController;let o=n.filter(e=>"assistant"!==e.role||e.id!==l).map(e=>({role:e.role,content:"user"===e.role?function(e){let t=h(e.content).trim(),r=Array.isArray(e.attachments)?e.attachments:[];if(0===r.length)return t;let a=[];for(let e of(t&&a.push({type:"text",text:t}),r))e?.dataUrl&&a.push({type:"image_url",image_url:{url:e.dataUrl}});return a.length>0?a:t}(e):e.content}));try{var d;let a,s=await fetch("/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({model:e.requestModel||e.id,messages:o,stream:!0}),signal:Z.current.signal});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(h(e.error||e.message||`Request failed (${s.status})`))}let i=s.body?.getReader();if(!i){let e=await s.json().catch(()=>({})),t=h(e?.choices?.[0]?.message?.content||e?.output_text||e?.error||e?.message||"");eo(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:t,status:"done"}:e),updatedAt:new Date().toISOString()}));return}let n=new TextDecoder,c="",m="";for(;;){let{value:e,done:t}=await i.read();if(t)break;let a=(c+=n.decode(e,{stream:!0})).split(/\r?\n/);for(let e of(c=a.pop()||"",a)){let t=e.trim();if(!t.startsWith("data:"))continue;let a=t.slice(5).trim();if(a&&"[DONE]"!==a)try{let e=JSON.parse(a),t=function(e){if(!e||"object"!=typeof e)return"";let t=e.choices?.[0];return[(t?.delta||{}).content,t?.message?.content,e.output_text,e.text].map(h).filter(Boolean)[0]||""}(e);if(!t)continue;m+=t,K(m),eo(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:m,status:"streaming"}:e),updatedAt:new Date().toISOString()}))}catch{}}}eo(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:m||e.content,status:"done"}:e),updatedAt:new Date().toISOString()})),d=r,a=x(t),eo(d,e=>({...e,title:"New chat"===e.title?a:e.title,updatedAt:new Date().toISOString()}))}catch(e){if("AbortError"===e.name)eo(r,e=>({...e,messages:e.messages.flatMap(e=>e.id!==l?[e]:h(e.content)?[{...e,status:"stopped"}]:[]),updatedAt:new Date().toISOString()}));else{let t=h(e?.message||e);eo(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:e.content||`Error: ${t}`,status:"error"}:e),updatedAt:new Date().toISOString()})),j(t||"Failed to send message.")}}finally{P(!1),F(""),K(""),Z.current=null}},ep=ea?`${ea.name}`:"Select model",eh=ea?ea.requestModel:"Choose from connected providers";return(0,a.jsx)("div",{className:"relative flex-1 flex flex-col h-full min-h-0 min-w-0 bg-[#212121] text-white overflow-hidden",children:(0,a.jsxs)("div",{className:"relative mx-auto flex flex-1 h-full min-h-0 w-full max-w-4xl flex-col",children:[(0,a.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-3 px-4 py-3 lg:px-6",children:[(0,a.jsxs)("div",{ref:X,className:"relative",children:[(0,a.jsx)("button",{type:"button",onClick:()=>G(e=>!e),className:"flex items-center gap-3 rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-left transition hover:bg-white/8",children:(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-semibold text-white",children:ep}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-white/70",children:"expand_more"})]}),(0,a.jsx)("p",{className:"truncate text-xs text-white/55",children:eh})]})}),W?(0,a.jsxs)("div",{className:"absolute left-0 top-[calc(100%+10px)] z-30 w-[min(520px,calc(100vw-2rem))] overflow-hidden rounded-[20px] border border-white/10 bg-[#262626] shadow-2xl shadow-black/50",children:[(0,a.jsxs)("div",{className:"border-b border-white/10 px-4 py-3",children:[(0,a.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Models"}),(0,a.jsx)("p",{className:"text-sm text-white/75",children:"Only from connected providers"})]}),(0,a.jsx)("div",{className:"max-h-[60vh] overflow-y-auto p-2 custom-scrollbar",children:e.map(e=>(0,a.jsxs)("div",{className:"mb-2 rounded-[16px] border border-white/10 bg-black/20 p-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-2 py-2",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-white",children:e.providerName}),(0,a.jsx)(l.Ex,{size:"sm",variant:"default",children:e.models.length})]}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:e.models.map(e=>{let t=e.id===O;return(0,a.jsx)("button",{type:"button",onClick:()=>(e=>{let t=et.get(e);if(!t)return;let r=A.find(e=>e.id===C);if(r&&r.messages.length>0){let e=ed(t);if(!e)return;k(t=>[e,...t]),D(e.id)}else if(r)k(e=>e.map(e=>e.id===r.id?{...e,providerId:t.providerId,providerName:t.providerName,modelId:t.id,modelName:t.name}:e)),D(r.id);else{let e=ed(t);if(!e)return;k(t=>[e,...t]),D(e.id)}M(t.providerId),E(t.id),G(!1)})(e.id),className:`rounded-[14px] border px-3 py-3 text-left transition ${t?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-white",children:e.name}),(0,a.jsx)("p",{className:"truncate text-[11px] text-white/45",children:e.requestModel})]}),t?(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-blue-300",children:"check_circle"}):null]})},e.id)})})]},e.providerId))})]}):null]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(l.$n,{variant:"ghost",size:"sm",icon:"add",onClick:()=>{ec();let e=ed(ea);e&&(k(t=>[e,...t]),D(e.id),M(e.providerId),E(e.modelId),T(""),U([]),F(""),K(""))},disabled:!ea,children:"New conversation"}),(0,a.jsx)("button",{type:"button",onClick:()=>Q(e=>!e),className:"rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-sm text-white/80 transition hover:bg-white/8",children:"History"}),(0,a.jsx)(l.$n,{variant:"ghost",size:"sm",icon:"delete",onClick:()=>{if(!C)return;ec();let e=A.filter(e=>e.id!==C),t=e[0]||null;k(e),t?(D(t.id),M(t.providerId),E(t.modelId)):(D(""),M(""),E(""))},disabled:!C||0===A.length,children:"Clear"})]})]}),H?(0,a.jsxs)("div",{ref:ee,className:"absolute right-4 top-[72px] z-20 w-[min(360px,calc(100vw-2rem))] rounded-[20px] border border-white/10 bg-[#262626] p-2 shadow-2xl shadow-black/50 lg:right-6",children:[(0,a.jsx)("div",{className:"px-3 py-2",children:(0,a.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Recent chats"})}),(0,a.jsx)("div",{className:"max-h-[48vh] space-y-2 overflow-y-auto p-1 custom-scrollbar",children:0===ei.length?(0,a.jsx)("div",{className:"rounded-[16px] border border-dashed border-white/10 bg-white/5 p-4 text-sm text-white/55",children:"No conversations yet."}):ei.map(e=>{let t=e.id===C,r=[...e.messages||[]].reverse().find(e=>"user"===e.role)||e.messages?.[0];return(0,a.jsx)("button",{type:"button",onClick:()=>{var t;let r;return t=e.id,void((r=A.find(e=>e.id===t))&&(ec(),D(t),M(r.providerId||$),E(r.modelId||O),Q(!1)))},className:`w-full rounded-[16px] border px-3 py-3 text-left transition ${t?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-white",children:e.title}),(0,a.jsx)("p",{className:"mt-1 truncate text-xs text-white/50",children:h(r?.content)||"Empty chat"})]}),(0,a.jsx)("span",{className:"text-[10px] text-white/40 shrink-0",children:function(e){if(!e)return"Now";let t=new Date(e).getTime();if(Number.isNaN(t))return"Now";let r=Math.max(1,Math.round((Date.now()-t)/6e4));if(r<60)return`${r}m`;let a=Math.round(r/60);return a<24?`${a}h`:`${Math.round(a/24)}d`}(e.updatedAt)})]})},e.id)})})]}):null,w?(0,a.jsx)("div",{className:"mt-4 rounded-[18px] border border-rose-500/20 bg-rose-500/10 px-4 py-3 text-rose-100",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"error"}),(0,a.jsx)("p",{className:"text-sm leading-6",children:w})]})}):null,(0,a.jsxs)("div",{className:"flex flex-1 flex-col min-h-0",children:[(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto py-4 custom-scrollbar",children:[0===el.length?(0,a.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center px-4 text-center",children:(0,a.jsxs)("div",{className:"max-w-xl space-y-4",children:[(0,a.jsx)("div",{className:"mx-auto flex size-16 items-center justify-center rounded-[20px] border border-white/10 bg-white/5 text-white/80",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[30px]",children:"chat"})}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h2",{className:"text-2xl font-semibold text-white",children:"Start a conversation"}),(0,a.jsx)("p",{className:"text-sm leading-6 text-white/60",children:"Simple chat interface to interact with any AI model from connected providers. Select a model and start chatting!"})]})]})}):null,(0,a.jsx)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4",children:el.map(e=>{let t="user"===e.role,r="assistant"===e.role,s=r&&e.id===q&&"streaming"===e.status,l=h(e.content)||(r?J:"");return(0,a.jsx)("div",{className:`flex w-full ${t?"justify-end":"justify-start"} mb-6`,children:(0,a.jsxs)("div",{className:`max-w-[min(88%,42rem)] ${t?"rounded-3xl bg-[#2f2f2f] px-5 py-3.5 text-white":"text-white/90"}`,children:[(0,a.jsx)("div",{className:"mb-1 flex items-center justify-between gap-3",children:(0,a.jsx)("span",{className:"text-xs font-semibold",children:t?"You":es?.modelName||ea?.name||"Assistant"})}),e.attachments?.length?(0,a.jsx)("div",{className:"mb-3 grid grid-cols-2 gap-2 sm:grid-cols-3 mt-2",children:e.attachments.map(e=>(0,a.jsx)("a",{href:e.dataUrl,target:"_blank",rel:"noreferrer",className:"overflow-hidden rounded-[18px] border border-white/10 bg-black/20",children:(0,a.jsx)(o.default,{src:e.dataUrl,alt:e.name,width:320,height:112,unoptimized:!0,className:"h-28 w-full object-cover"})},e.id))}):null,(0,a.jsxs)("div",{className:"whitespace-pre-wrap break-words text-[15px] leading-7",children:[l,r&&s&&!J?(0,a.jsx)("span",{className:"inline-block animate-pulse",children:"▋"}):null]}),r&&"stopped"===e.status?(0,a.jsx)("p",{className:"mt-1 text-xs italic text-white/45",children:"Generation stopped"}):null]})},e.id)})})]}),(0,a.jsxs)("div",{className:"shrink-0 pt-2",children:[y?(0,a.jsx)("div",{className:"mx-auto mb-3 w-full max-w-3xl px-4",children:(0,a.jsx)("div",{className:"rounded-[18px] border border-rose-500/20 bg-rose-500/10 px-4 py-2 text-sm text-rose-100",role:"alert",children:y})}):null,S?(0,a.jsx)("div",{className:"mx-auto mb-3 w-full max-w-3xl px-4",children:(0,a.jsx)("div",{className:"rounded-[18px] border border-amber-500/20 bg-amber-500/10 px-4 py-2 text-sm text-amber-100",role:"status",children:S})}):null,R.length>0?(0,a.jsx)("div",{className:"mx-auto mb-3 flex w-full max-w-3xl flex-wrap gap-2 px-4",children:R.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-3 py-2",children:[(0,a.jsx)("span",{className:"text-xs text-white/80 max-w-[12rem] truncate",children:e.name}),(0,a.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void U(e=>e.filter(e=>e.id!==t))},className:"text-white/55 hover:text-white","aria-label":"Remove attachment",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]},e.id))}):null,(0,a.jsx)("div",{className:"mx-auto w-full max-w-3xl px-4 pb-2",children:(0,a.jsxs)("div",{className:"rounded-[26px] bg-[#2f2f2f] px-3 pt-3 pb-2 shadow-[0_0_15px_rgba(0,0,0,0.10)] ring-1 ring-white/5",children:[(0,a.jsx)("textarea",{value:_,onChange:e=>T(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),en&&eu())},placeholder:"Message AI",rows:1,className:"w-full resize-none bg-transparent px-2 text-[15px] leading-6 text-white outline-none placeholder:text-white/40 custom-scrollbar max-h-[25vh] overflow-y-auto"}),(0,a.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>Y.current?.click(),disabled:!ea||r,"aria-label":"Attach image",className:"p-2 text-white/50 hover:text-white transition rounded-full hover:bg-white/5",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"attach_file"})}),(0,a.jsx)("input",{ref:Y,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:em}),(0,a.jsx)("span",{className:"text-xs font-medium text-white/30 truncate max-w-[120px]",children:ea?ea.name:"No model"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[z?(0,a.jsx)("button",{type:"button",onClick:()=>{Z.current?.abort()},"aria-label":"Stop generating",className:"p-2 text-white bg-white/10 hover:bg-white/20 transition rounded-full h-8 w-8 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop"})}):null,(0,a.jsx)("button",{type:"button",onClick:eu,disabled:!en,"aria-label":"Send message",className:`h-8 w-8 rounded-full flex items-center justify-center transition ${en?"bg-white text-black hover:opacity-90":"bg-white/10 text-white/30 cursor-not-allowed"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})})]})]})]})})]}),(0,a.jsx)("p",{className:"mx-auto mt-2 max-w-3xl px-4 pb-4 text-center text-[11px] text-white/30",children:"Model list is filtered from connected providers."})]})]})})}}},e=>{e.O(0,[2574,3862,782,8500,594,4601,1321,1330,8441,3794,7358],()=>e(e.s=55774)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3554],{7769:(e,r,s)=>{Promise.resolve().then(s.bind(s,85309))},85309:(e,r,s)=>{"use strict";s.d(r,{default:()=>u});var t=s(95155),a=s(12115),i=s(98500),l=s.n(i),o=s(35497),c=s(3534),d=s(28777),n=s(88105),x=s(9056),v=s(78559);function u({toolId:e,machineId:r}){let s=c.dM[e],[i,m]=(0,a.useState)([]),[p,h]=(0,a.useState)(!0),[f,j]=(0,a.useState)(null),[P,b]=(0,a.useState)({}),[g,w]=(0,a.useState)({}),[k,N]=(0,a.useState)([]),[y,E]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=!0;return h(!0),j(null),(async()=>{try{let[r,s,t]=await Promise.all([fetch("/api/providers"),fetch("/api/keys"),fetch("/api/settings")]);if(!e)return;if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error||`Failed to load providers (${r.status})`)}if(m((await r.json()).connections||[]),s.ok){let e=await s.json();N(e.keys||[])}t.ok&&b(await t.json())}catch(r){(0,v.s)("Error loading tool data:",r),e&&j(r instanceof Error?r.message:String(r))}finally{e&&h(!1)}})(),()=>{e=!1}},[y]);let A=()=>i.filter(e=>!1!==e.isActive).map(e=>({...e,provider:(0,n.rs)(e.provider)})),S=(0,a.useCallback)((e,r,s)=>{w(t=>t[e]?.[r]===s?t:{...t,[e]:{...t[e],[r]:s}})},[]);return s?p?(0,t.jsx)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:(0,t.jsx)(o.Qv,{})}):(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,t.jsxs)(l(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),r?(0,t.jsxs)("p",{className:"text-xs text-text-muted font-mono",children:["Machine: ",r]}):null,f&&(0,t.jsxs)("div",{role:"alert",className:"flex flex-wrap items-center justify-between gap-2 rounded border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-600 dark:text-red-400",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"error"}),"Error loading tool data: ",f]}),(0,t.jsxs)("button",{type:"button",onClick:()=>E(e=>e+1),className:"flex items-center gap-1 rounded border border-red-500/40 px-2 py-1 font-medium hover:bg-red-500/10",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"}),"Retry"]})]}),(()=>{let r,a,i,l=(r=A(),a=[],i=new Set,r.forEach(e=>{let r=(0,n.rs)(e.provider),s=d.Xg[r]||r;(0,d.KC)(r).forEach(t=>{let l=`${s}/${t.id}`;i.has(l)||(i.add(l),a.push({value:l,label:`${s}/${t.id}`,provider:r,alias:s,connectionName:e.name,modelId:t.id}))})}),a).length>0||A().some(e=>(0,n.mq)(e.provider)||(0,n.gb)(e.provider)),o={tool:s,isExpanded:!0,onToggle:()=>{},baseUrl:window.location.origin,apiKeys:k,tunnelEnabled:!!P.tunnelPublicUrl,tunnelPublicUrl:P.tunnelPublicUrl||"",tailscaleEnabled:!!P.tailscaleUrl,tailscaleUrl:P.tailscaleUrl||"",cloudEnabled:!!P.cloudEnabled};switch(e){case"claude":return(0,t.jsx)(x.Tk,{...o,activeProviders:A(),modelMappings:g[e]||{},onModelMappingChange:(r,s)=>S(e,r,s),hasActiveProviders:l});case"codex":return(0,t.jsx)(x.Ah,{...o,activeProviders:A()});case"opencode":return(0,t.jsx)(x.qO,{...o,activeProviders:A()});case"cowork":return(0,t.jsx)(x.Q6,{...o,activeProviders:A(),hasActiveProviders:l,cloudUrl:""});case"droid":return(0,t.jsx)(x.ZM,{...o,activeProviders:A(),hasActiveProviders:l});case"openclaw":return(0,t.jsx)(x.yZ,{...o,activeProviders:A(),hasActiveProviders:l});case"hermes":return(0,t.jsx)(x.RF,{...o,activeProviders:A(),hasActiveProviders:l});case"cline":return(0,t.jsx)(x.aG,{...o,activeProviders:A()});case"kilo":return(0,t.jsx)(x.c9,{...o,activeProviders:A()});case"deepseek-tui":return(0,t.jsx)(x.lF,{...o,activeProviders:A(),hasActiveProviders:l});case"jcode":return(0,t.jsx)(x.mW,{...o,activeProviders:A(),hasActiveProviders:l});case"grok":return(0,t.jsx)(x.wg,{...o,activeProviders:A(),hasActiveProviders:l});case"pi":return(0,t.jsx)(x.S3,{...o,activeProviders:A(),hasActiveProviders:l});case"fx":return(0,t.jsx)(x.pr,{...o,activeProviders:A(),hasActiveProviders:l});case"aider":return(0,t.jsx)(x.qn,{...o,activeProviders:A(),hasActiveProviders:l});case"gemini-cli":return(0,t.jsx)(x.Ib,{...o,activeProviders:A(),hasActiveProviders:l});default:return(0,t.jsx)(x.a7,{toolId:e,...o,activeProviders:A()})}})()]}):(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,t.jsxs)(l(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"Tool not found or disabled."})]})}}},e=>{e.O(0,[2574,3862,782,8500,594,1321,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3554],{7769:(e,r,s)=>{Promise.resolve().then(s.bind(s,85309))},85309:(e,r,s)=>{"use strict";s.d(r,{default:()=>u});var t=s(95155),a=s(12115),i=s(98500),l=s.n(i),o=s(35497),c=s(3534),d=s(28777),n=s(88105),x=s(9056),v=s(78559);function u({toolId:e,machineId:r}){let s=c.dM[e],[i,m]=(0,a.useState)([]),[p,h]=(0,a.useState)(!0),[f,j]=(0,a.useState)(null),[P,b]=(0,a.useState)({}),[g,w]=(0,a.useState)({}),[k,N]=(0,a.useState)([]),[y,E]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=!0;return h(!0),j(null),(async()=>{try{let[r,s,t]=await Promise.all([fetch("/api/providers"),fetch("/api/keys"),fetch("/api/settings")]);if(!e)return;if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error||`Failed to load providers (${r.status})`)}if(m((await r.json()).connections||[]),s.ok){let e=await s.json();N(e.keys||[])}t.ok&&b(await t.json())}catch(r){(0,v.s)("Error loading tool data:",r),e&&j(r instanceof Error?r.message:String(r))}finally{e&&h(!1)}})(),()=>{e=!1}},[y]);let A=()=>i.filter(e=>!1!==e.isActive).map(e=>({...e,provider:(0,n.rs)(e.provider)})),S=(0,a.useCallback)((e,r,s)=>{w(t=>t[e]?.[r]===s?t:{...t,[e]:{...t[e],[r]:s}})},[]);return s?p?(0,t.jsx)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:(0,t.jsx)(o.Qv,{})}):(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,t.jsxs)(l(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),r?(0,t.jsxs)("p",{className:"text-xs text-text-muted font-mono",children:["Machine: ",r]}):null,f&&(0,t.jsxs)("div",{role:"alert",className:"flex flex-wrap items-center justify-between gap-2 rounded border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-600 dark:text-red-400",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"error"}),"Error loading tool data: ",f]}),(0,t.jsxs)("button",{type:"button",onClick:()=>E(e=>e+1),className:"flex items-center gap-1 rounded border border-red-500/40 px-2 py-1 font-medium hover:bg-red-500/10",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"}),"Retry"]})]}),(()=>{let r,a,i,l=(r=A(),a=[],i=new Set,r.forEach(e=>{let r=(0,n.rs)(e.provider),s=d.Xg[r]||r;(0,d.KC)(r).forEach(t=>{let l=`${s}/${t.id}`;i.has(l)||(i.add(l),a.push({value:l,label:`${s}/${t.id}`,provider:r,alias:s,connectionName:e.name,modelId:t.id}))})}),a).length>0||A().some(e=>(0,n.mq)(e.provider)||(0,n.gb)(e.provider)),o={tool:s,isExpanded:!0,onToggle:()=>{},baseUrl:window.location.origin,apiKeys:k,tunnelEnabled:!!P.tunnelPublicUrl,tunnelPublicUrl:P.tunnelPublicUrl||"",tailscaleEnabled:!!P.tailscaleUrl,tailscaleUrl:P.tailscaleUrl||"",cloudEnabled:!!P.cloudEnabled};switch(e){case"claude":return(0,t.jsx)(x.Tk,{...o,activeProviders:A(),modelMappings:g[e]||{},onModelMappingChange:(r,s)=>S(e,r,s),hasActiveProviders:l});case"codex":return(0,t.jsx)(x.Ah,{...o,activeProviders:A()});case"opencode":return(0,t.jsx)(x.qO,{...o,activeProviders:A()});case"cowork":return(0,t.jsx)(x.Q6,{...o,activeProviders:A(),hasActiveProviders:l,cloudUrl:""});case"droid":return(0,t.jsx)(x.ZM,{...o,activeProviders:A(),hasActiveProviders:l});case"openclaw":return(0,t.jsx)(x.yZ,{...o,activeProviders:A(),hasActiveProviders:l});case"hermes":return(0,t.jsx)(x.RF,{...o,activeProviders:A(),hasActiveProviders:l});case"cline":return(0,t.jsx)(x.aG,{...o,activeProviders:A()});case"kilo":return(0,t.jsx)(x.c9,{...o,activeProviders:A()});case"deepseek-tui":return(0,t.jsx)(x.lF,{...o,activeProviders:A(),hasActiveProviders:l});case"jcode":return(0,t.jsx)(x.mW,{...o,activeProviders:A(),hasActiveProviders:l});case"grok":return(0,t.jsx)(x.wg,{...o,activeProviders:A(),hasActiveProviders:l});case"pi":return(0,t.jsx)(x.S3,{...o,activeProviders:A(),hasActiveProviders:l});case"fx":return(0,t.jsx)(x.pr,{...o,activeProviders:A(),hasActiveProviders:l});case"aider":return(0,t.jsx)(x.qn,{...o,activeProviders:A(),hasActiveProviders:l});case"gemini-cli":return(0,t.jsx)(x.Ib,{...o,activeProviders:A(),hasActiveProviders:l});default:return(0,t.jsx)(x.a7,{toolId:e,...o,activeProviders:A()})}})()]}):(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,t.jsxs)(l(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"Tool not found or disabled."})]})}}},e=>{e.O(0,[2574,3862,782,8500,594,4601,1321,1330,6683,8441,3794,7358],()=>e(e.s=7769)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{12750:(e,s,l)=>{Promise.resolve().then(l.bind(l,53501))},53501:(e,s,l)=>{"use strict";l.d(s,{default:()=>g});var t=l(95155),r=l(12115),a=l(35497),i=l(3534),n=l(9056),o=l(98500),d=l.n(o),c=l(5772);function x({toolId:e,tool:s,status:l}){let r=s?.configType==="guide"?{label:"Guide",cls:"bg-blue-500/10 text-blue-600 dark:text-blue-400"}:l?l.installed?l.hasSwitchboard?{label:"Connected",cls:"bg-green-500/10 text-green-600 dark:text-green-400 border border-green-500/20"}:{label:"Installed \xb7 not configured",cls:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/25"}:{label:"Not installed",cls:"bg-orange-500/15 text-orange-600 dark:text-orange-400 border border-orange-500/25"}:{label:"Not detected",cls:"bg-gray-500/10 text-gray-500",title:"Not detected — detection is by config file presence on this machine"};return(0,t.jsx)(d(),{href:`/dashboard/cli-tools/${e}`,className:"block",children:(0,t.jsx)(a.Zp,{padding:"sm",className:"h-full overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,t.jsx)("div",{className:"flex h-full flex-col gap-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:s.image?(0,t.jsx)(c.default,{src:s.image,alt:s.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):s.icon?(0,t.jsx)("span",{className:"material-symbols-outlined text-[28px]",style:{color:s.color},children:s.icon}):null}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"font-medium text-sm truncate",children:s.name}),(0,t.jsx)("span",{className:`inline-block mt-1 px-1.5 py-0.5 text-[10px] font-medium rounded-full ${r.cls}`,title:r.title||r.label,children:r.label})]}),(0,t.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px] shrink-0",children:"chevron_right"})]})})})})}var m=l(78559);function g({machineId:e}){let[s,l]=(0,r.useState)(!0),[o,d]=(0,r.useState)({}),[c,u]=(0,r.useState)(null),p=(0,r.useCallback)(async()=>{l(!0),u(null);try{let e=await fetch("/api/cli-tools/all-statuses");if(!e.ok){let s=await e.json().catch(()=>({}));throw Error(s.error||`Failed to load tool statuses (${e.status})`)}d(await e.json())}catch(e){(0,m.s)("Error fetching tool statuses:",e),u(e instanceof Error?e.message:String(e))}finally{l(!1)}},[]);if((0,r.useEffect)(()=>{p()},[p]),s)return(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:[(0,t.jsx)(a.Qv,{}),(0,t.jsx)(a.Qv,{}),(0,t.jsx)(a.Qv,{}),(0,t.jsx)(a.Qv,{}),(0,t.jsx)(a.Qv,{}),(0,t.jsx)(a.Qv,{})]});let b=Object.entries(i.dM),h=Object.entries(i.wn);return(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-6 px-1 sm:px-0",children:[c&&(0,t.jsxs)("div",{role:"alert",className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-600 dark:text-red-400",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"error"}),"Failed to load tool statuses: ",c]}),(0,t.jsxs)("button",{type:"button",onClick:p,className:"flex items-center gap-1 rounded border border-red-500/40 px-2 py-1 font-medium hover:bg-red-500/10",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"}),"Retry"]})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:b.map(([e,s])=>(0,t.jsx)(x,{toolId:e,tool:s,status:o[e]},e))}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 sm:gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"security"}),(0,t.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"MITM Tools"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:h.map(([e,s])=>(0,t.jsx)(n.gY,{tool:s},e))})]})]})}}},e=>{e.O(0,[2574,3862,782,8500,594,1321,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{12750:(e,s,l)=>{Promise.resolve().then(l.bind(l,53501))},53501:(e,s,l)=>{"use strict";l.d(s,{default:()=>g});var t=l(95155),r=l(12115),a=l(35497),i=l(3534),n=l(9056),o=l(98500),d=l.n(o),c=l(5772);function x({toolId:e,tool:s,status:l}){let r=s?.configType==="guide"?{label:"Guide",cls:"bg-blue-500/10 text-blue-600 dark:text-blue-400"}:l?l.installed?l.hasSwitchboard?{label:"Connected",cls:"bg-green-500/10 text-green-600 dark:text-green-400 border border-green-500/20"}:{label:"Installed \xb7 not configured",cls:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/25"}:{label:"Not installed",cls:"bg-orange-500/15 text-orange-600 dark:text-orange-400 border border-orange-500/25"}:{label:"Not detected",cls:"bg-gray-500/10 text-gray-500",title:"Not detected — detection is by config file presence on this machine"};return(0,t.jsx)(d(),{href:`/dashboard/cli-tools/${e}`,className:"block",children:(0,t.jsx)(a.Zp,{padding:"sm",className:"h-full overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,t.jsx)("div",{className:"flex h-full flex-col gap-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:s.image?(0,t.jsx)(c.default,{src:s.image,alt:s.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):s.icon?(0,t.jsx)("span",{className:"material-symbols-outlined text-[28px]",style:{color:s.color},children:s.icon}):null}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"font-medium text-sm truncate",children:s.name}),(0,t.jsx)("span",{className:`inline-block mt-1 px-1.5 py-0.5 text-[10px] font-medium rounded-full ${r.cls}`,title:r.title||r.label,children:r.label})]}),(0,t.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px] shrink-0",children:"chevron_right"})]})})})})}var m=l(78559);function g({machineId:e}){let[s,l]=(0,r.useState)(!0),[o,d]=(0,r.useState)({}),[c,u]=(0,r.useState)(null),p=(0,r.useCallback)(async()=>{l(!0),u(null);try{let e=await fetch("/api/cli-tools/all-statuses");if(!e.ok){let s=await e.json().catch(()=>({}));throw Error(s.error||`Failed to load tool statuses (${e.status})`)}d(await e.json())}catch(e){(0,m.s)("Error fetching tool statuses:",e),u(e instanceof Error?e.message:String(e))}finally{l(!1)}},[]);if((0,r.useEffect)(()=>{p()},[p]),s)return(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:[(0,t.jsx)(a.Qv,{}),(0,t.jsx)(a.Qv,{}),(0,t.jsx)(a.Qv,{}),(0,t.jsx)(a.Qv,{}),(0,t.jsx)(a.Qv,{}),(0,t.jsx)(a.Qv,{})]});let b=Object.entries(i.dM),h=Object.entries(i.wn);return(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-6 px-1 sm:px-0",children:[c&&(0,t.jsxs)("div",{role:"alert",className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-600 dark:text-red-400",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"error"}),"Failed to load tool statuses: ",c]}),(0,t.jsxs)("button",{type:"button",onClick:p,className:"flex items-center gap-1 rounded border border-red-500/40 px-2 py-1 font-medium hover:bg-red-500/10",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"}),"Retry"]})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:b.map(([e,s])=>(0,t.jsx)(x,{toolId:e,tool:s,status:o[e]},e))}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 sm:gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"security"}),(0,t.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"MITM Tools"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:h.map(([e,s])=>(0,t.jsx)(n.gY,{tool:s},e))})]})]})}}},e=>{e.O(0,[2574,3862,782,8500,594,4601,1321,1330,6683,8441,3794,7358],()=>e(e.s=12750)),_N_E=e.O()}]);
|