@geminilight/mindos 0.6.76 → 0.6.78
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/_standalone/.mindos-build-version +1 -1
- package/_standalone/.next/BUILD_ID +1 -1
- package/_standalone/.next/app-path-routes-manifest.json +25 -23
- package/_standalone/.next/build-manifest.json +3 -3
- package/_standalone/.next/cache/.previewinfo +1 -1
- package/_standalone/.next/cache/.rscinfo +1 -1
- package/_standalone/.next/cache/config.json +3 -3
- package/_standalone/.next/prerender-manifest.json +3 -3
- package/_standalone/.next/react-loadable-manifest.json +4 -4
- package/_standalone/.next/required-server-files.json +2 -1
- package/_standalone/.next/routes-manifest.json +12 -0
- package/_standalone/.next/server/app/.well-known/agent-card.json/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/_global-error.html +2 -2
- package/_standalone/.next/server/app/_global-error.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/_standalone/.next/server/app/_not-found/page.js +1 -1
- package/_standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page.js +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/agents/page.js +1 -1
- package/_standalone/.next/server/app/agents/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/agents/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/delegations/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/discover/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/config/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/detect/route.js +1 -1
- package/_standalone/.next/server/app/api/acp/detect/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/install/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/registry/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/session/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agent-activity/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agents/copy-skill/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/agents/copy-skill/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agents/custom/detect/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agents/custom/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/ask/route.js +2 -2
- package/_standalone/.next/server/app/api/ask/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/ask/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/ask-sessions/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/auth/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/backlinks/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/backlinks/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/bootstrap/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/bootstrap/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/changes/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/changes/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/channels/verify/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/connect/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/embedding/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/export/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/export/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/extract-pdf/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/file/import/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/file/import/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/file/raw/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/file/raw/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/file/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/file/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/files/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/graph/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/graph/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/activity/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/config/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/feishu/long-connection/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/im/feishu/long-connection/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/status/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/im/status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/test/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/webhook/feishu/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/im/webhook/feishu/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/webhook-status/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/im/webhook-status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/inbox/clip/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/inbox/clip/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/inbox/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/inbox/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/init/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/lint/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/lint/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/agents/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/mcp/agents/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/direct-tools/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/install/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/install-skill/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/restart/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/tools/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/uninstall/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/monitoring/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/monitoring/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/obsidian/compat-report/route.js +1 -0
- package/_standalone/.next/server/app/api/obsidian/compat-report/route.js.nft.json +1 -0
- package/_standalone/.next/server/app/api/obsidian/compat-report/route_client-reference-manifest.js +1 -0
- package/_standalone/.next/server/app/api/obsidian/import/route.js +1 -0
- package/_standalone/.next/server/app/api/obsidian/import/route.js.nft.json +1 -0
- package/_standalone/.next/server/app/api/obsidian/import/route_client-reference-manifest.js +1 -0
- package/_standalone/.next/server/app/api/recent-files/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/recent-files/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/search/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/list-models/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/reset-token/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/test-key/route.js +1 -1
- package/_standalone/.next/server/app/api/settings/test-key/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/check-path/route.js +1 -1
- package/_standalone/.next/server/app/api/setup/check-path/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/check-port/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/generate-token/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/ls/route.js +1 -1
- package/_standalone/.next/server/app/api/setup/ls/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/route.js +1 -1
- package/_standalone/.next/server/app/api/setup/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/space-overview/route.js +1 -1
- package/_standalone/.next/server/app/api/space-overview/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/space-overview/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/sync/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/tree-version/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/tree-version/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/uninstall/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update-check/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update-status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/workflows/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/changelog/page.js +1 -1
- package/_standalone/.next/server/app/changelog/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/changelog/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/changes/page.js +1 -1
- package/_standalone/.next/server/app/changes/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/changes/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page.js +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/echo/page.js +1 -1
- package/_standalone/.next/server/app/echo/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/echo/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/explore/page.js +1 -1
- package/_standalone/.next/server/app/explore/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/explore/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/help/page.js +1 -1
- package/_standalone/.next/server/app/help/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/help/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/inbox/history/page.js +1 -1
- package/_standalone/.next/server/app/inbox/history/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/inbox/history/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/login/page.js +1 -1
- package/_standalone/.next/server/app/login/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/page.js +1 -1
- package/_standalone/.next/server/app/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/setup/page.js +2 -2
- package/_standalone/.next/server/app/setup/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/trash/page.js +3 -3
- package/_standalone/.next/server/app/trash/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/trash/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/view/[...path]/page.js +2 -2
- package/_standalone/.next/server/app/view/[...path]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/view/[...path]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app-paths-manifest.json +25 -23
- package/_standalone/.next/server/chunks/1299.js +1 -1
- package/_standalone/.next/server/chunks/{7686.js → 2057.js} +3 -3
- package/_standalone/.next/server/chunks/4802.js +37 -37
- package/_standalone/.next/server/chunks/5299.js +1 -1
- package/_standalone/.next/server/chunks/6223.js +1 -1
- package/_standalone/.next/server/chunks/7531.js +1 -0
- package/_standalone/.next/server/middleware-build-manifest.js +1 -1
- package/_standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/_standalone/.next/server/pages/500.html +2 -2
- package/_standalone/.next/server/server-reference-manifest.js +1 -1
- package/_standalone/.next/server/server-reference-manifest.json +1 -1
- package/_standalone/.next/static/chunks/{5484.a70877a2667d0779.js → 1768.1e964db7834ecb4f.js} +1 -1
- package/_standalone/.next/static/chunks/{4878.ad1f431d34ff03fc.js → 1937.e178266395104aa3.js} +1 -1
- package/_standalone/.next/static/chunks/{5358-15ceeb8c1cd9889d.js → 5358-4d1ef32068d304de.js} +2 -2
- package/_standalone/.next/static/chunks/{5581-c3be891101a3e511.js → 5581-c29703cc06a6c8dc.js} +2 -2
- package/_standalone/.next/static/chunks/app/.well-known/agent-card.json/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/_global-error/page-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/a2a/agents/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/a2a/delegations/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/a2a/discover/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/a2a/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/acp/config/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/acp/detect/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/acp/install/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/acp/registry/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/acp/session/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/agent-activity/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/agents/copy-skill/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/agents/custom/detect/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/agents/custom/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/ask/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/ask-sessions/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/auth/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/backlinks/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/bootstrap/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/changes/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/channels/verify/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/connect/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/embedding/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/export/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/extract-pdf/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/file/import/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/file/raw/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/file/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/files/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/git/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/graph/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/health/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/im/activity/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/im/config/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/im/feishu/long-connection/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/im/status/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/im/test/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/im/webhook/feishu/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/im/webhook-status/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/inbox/clip/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/inbox/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/init/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/lint/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/agents/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/direct-tools/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/install/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/install-skill/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/restart/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/status/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/tools/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/uninstall/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/monitoring/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/obsidian/compat-report/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/obsidian/import/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/recent-files/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/restart/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/search/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/settings/list-models/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/settings/reset-token/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/settings/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/settings/test-key/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/setup/check-path/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/setup/check-port/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/setup/generate-token/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/setup/ls/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/setup/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/skills/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/space-overview/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/sync/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/tree-version/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/uninstall/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/update/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/update-check/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/update-status/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/api/workflows/route-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/changes/page-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/echo/page-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/{layout-55af7e1870f7d59b.js → layout-5832614ed6a78167.js} +65 -65
- package/_standalone/.next/static/chunks/app/loading-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/setup/page-6135642c48cbf4e8.js +1 -0
- package/_standalone/.next/static/chunks/app/trash/{page-77dfe3df94abafb4.js → page-21dc1c6b6490cae8.js} +1 -1
- package/_standalone/.next/static/chunks/app/view/[...path]/loading-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/app/view/[...path]/{page-6791166d03535cb7.js → page-e5330470ce362641.js} +2 -2
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6359573cc0d7ff3b.js +1 -0
- package/_standalone/.next/static/chunks/webpack-6a9916defe5b8b6d.js +1 -0
- package/_standalone/.next/static/yJdsYbp_76hvDnNeV7OCT/_buildManifest.js +1 -0
- package/_standalone/.next/trace +72 -72
- package/_standalone/.next/types/routes.d.ts +3 -1
- package/_standalone/.next/types/validator.ts +18 -0
- package/_standalone/__tests__/acp/subprocess.test.ts +80 -0
- package/_standalone/__tests__/agent/model-config.test.ts +90 -0
- package/_standalone/__tests__/api/acp-detect.test.ts +4 -3
- package/_standalone/__tests__/api/obsidian-compat-report.test.ts +62 -0
- package/_standalone/__tests__/api/obsidian-import.test.ts +89 -0
- package/_standalone/__tests__/api/setup-path-utils.test.ts +188 -0
- package/_standalone/__tests__/ask/agent-selector-capsule.test.tsx +34 -0
- package/_standalone/__tests__/ask/ask-content-agent-capsule-visibility.test.tsx +195 -0
- package/_standalone/__tests__/ask/ask-content-input-during-run.test.tsx +1 -1
- package/_standalone/__tests__/fixtures/obsidian-community-fixtures.ts +92 -0
- package/_standalone/__tests__/obsidian-compat/community-smoke.test.ts +62 -0
- package/_standalone/__tests__/obsidian-compat/obsidian-import.test.ts +126 -0
- package/_standalone/__tests__/obsidian-compat/plugin-manager.test.ts +28 -0
- package/_standalone/__tests__/scripts/extract-pdf-runtime.test.ts +139 -0
- package/_standalone/components/ask/AgentSelectorCapsule.tsx +5 -4
- package/_standalone/components/ask/AskContent.tsx +2 -2
- package/_standalone/components/setup/StepKB.tsx +66 -17
- package/_standalone/lib/obsidian-compat/index.ts +1 -0
- package/_standalone/lib/obsidian-compat/plugin-manager.ts +13 -0
- package/_standalone/next.config.ts +2 -0
- package/_standalone/package-lock.json +2 -2
- package/_standalone/package.json +1 -1
- package/_standalone/server.js +1 -1
- package/_standalone/tsconfig.tsbuildinfo +1 -1
- package/app/__tests__/acp/subprocess.test.ts +80 -0
- package/app/__tests__/agent/model-config.test.ts +90 -0
- package/app/__tests__/api/acp-detect.test.ts +4 -3
- package/app/__tests__/api/obsidian-compat-report.test.ts +62 -0
- package/app/__tests__/api/obsidian-import.test.ts +89 -0
- package/app/__tests__/api/setup-path-utils.test.ts +188 -0
- package/app/__tests__/ask/agent-selector-capsule.test.tsx +34 -0
- package/app/__tests__/ask/ask-content-agent-capsule-visibility.test.tsx +195 -0
- package/app/__tests__/ask/ask-content-input-during-run.test.tsx +1 -1
- package/app/__tests__/fixtures/obsidian-community-fixtures.ts +92 -0
- package/app/__tests__/obsidian-compat/community-smoke.test.ts +62 -0
- package/app/__tests__/obsidian-compat/obsidian-import.test.ts +126 -0
- package/app/__tests__/obsidian-compat/plugin-manager.test.ts +28 -0
- package/app/__tests__/scripts/extract-pdf-runtime.test.ts +139 -0
- package/app/app/api/obsidian/compat-report/route.ts +33 -0
- package/app/app/api/obsidian/import/route.ts +37 -0
- package/app/app/api/setup/check-path/route.ts +16 -2
- package/app/app/api/setup/path-utils.ts +123 -1
- package/app/app/api/setup/route.ts +11 -1
- package/app/components/ask/AgentSelectorCapsule.tsx +5 -4
- package/app/components/ask/AskContent.tsx +2 -2
- package/app/components/setup/StepKB.tsx +66 -17
- package/app/components/setup/index.tsx +19 -1
- package/app/lib/acp/detect-local.ts +105 -24
- package/app/lib/acp/subprocess.ts +2 -1
- package/app/lib/agent/model.ts +2 -1
- package/app/lib/i18n/modules/onboarding.ts +2 -0
- package/app/lib/obsidian-compat/index.ts +1 -0
- package/app/lib/obsidian-compat/obsidian-import.ts +118 -0
- package/app/lib/obsidian-compat/plugin-manager.ts +13 -0
- package/app/lib/settings.ts +17 -5
- package/app/next.config.ts +2 -0
- package/app/package.json +1 -1
- package/package.json +1 -1
- package/_standalone/.next/static/chunks/app/.well-known/agent-card.json/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/_global-error/page-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/a2a/agents/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/a2a/delegations/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/a2a/discover/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/a2a/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/acp/config/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/acp/detect/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/acp/install/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/acp/registry/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/acp/session/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/agent-activity/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/agents/copy-skill/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/agents/custom/detect/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/agents/custom/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/ask/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/ask-sessions/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/auth/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/backlinks/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/bootstrap/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/changes/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/channels/verify/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/connect/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/embedding/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/export/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/extract-pdf/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/file/import/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/file/raw/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/file/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/files/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/git/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/graph/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/health/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/im/activity/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/im/config/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/im/feishu/long-connection/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/im/status/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/im/test/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/im/webhook/feishu/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/im/webhook-status/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/inbox/clip/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/inbox/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/init/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/lint/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/agents/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/direct-tools/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/install/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/install-skill/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/restart/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/status/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/tools/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/uninstall/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/monitoring/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/recent-files/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/restart/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/search/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/settings/list-models/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/settings/reset-token/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/settings/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/settings/test-key/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/setup/check-path/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/setup/check-port/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/setup/generate-token/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/setup/ls/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/setup/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/skills/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/space-overview/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/sync/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/tree-version/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/uninstall/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/update/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/update-check/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/update-status/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/api/workflows/route-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/changes/page-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/echo/page-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/loading-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/app/setup/page-64d7fa097ef3f367.js +0 -1
- package/_standalone/.next/static/chunks/app/view/[...path]/loading-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6d0a0465c7af74d1.js +0 -1
- package/_standalone/.next/static/chunks/webpack-aeeb4e3ebba9ef3c.js +0 -1
- package/_standalone/.next/static/f4SL2Rxm_VRCg6oVg9EuX/_buildManifest.js +0 -1
- package/_standalone/lib/obsidian-compat/compatibility-report.ts +0 -131
- package/_standalone/lib/obsidian-compat/manifest.ts +0 -90
- /package/_standalone/.next/static/{f4SL2Rxm_VRCg6oVg9EuX → yJdsYbp_76hvDnNeV7OCT}/_ssgManifest.js +0 -0
package/_standalone/.next/static/chunks/{5484.a70877a2667d0779.js → 1768.1e964db7834ecb4f.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5484],{439:(e,t,s)=>{s.d(t,{A:()=>r});let r=(0,s(90425).A)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},5484:(e,t,s)=>{s.r(t),s.d(t,{default:()=>tm});var r=s(95155),a=s(12115),n=s(86901),l=s(68806),o=s(89363),i=s(90425);let d=(0,i.A)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);var c=s(91958),u=s(6962),m=s(68459),x=s(13545),p=s(6296),h=s(9199),g=s(12651),b=s(33210),f=s(94961),v=s(73321),j=s(35581),y=s(22356),N=s(22164),k=s(49619),w=s(92972),S=s(20171),C=s(47376),A=s(51842),z=s(79704),T=s(60112);function M(e,t=[],s,r){let a=C.T_[e],n="zh"===r?a.nameZh:a.name,l=new Set(t.filter(e=>e&&e!==s).map(e=>e.trim().toLowerCase()));if(!l.has(n.trim().toLowerCase()))return n;let o=2;for(;l.has(`${n} ${o}`.toLowerCase());)o++;return`${n} ${o}`}function E({form:e,t,locale:s,layout:a="full"}){let n=C.T_[e.protocol],l="zh"===s?"名称":"Name",o="zh"===s?"协议":"Protocol",i="zh"===s?"可选,默认使用协议名称":"Optional, defaults to protocol name",d=e.isDuplicateName?"zh"===s?"名称已存在":"Name already exists":void 0;return(0,r.jsxs)("div",{className:"space-y-3",children:["compact"===a?(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,r.jsx)(S.D0,{label:l,hint:d,hintError:e.isDuplicateName,children:(0,r.jsx)(S.pd,{value:e.name,onChange:t=>e.setName(t.target.value),placeholder:i,autoFocus:!0})}),(0,r.jsx)(S.D0,{label:o,children:(0,r.jsx)(S.l6,{value:e.protocol,onChange:t=>e.setProtocol(t.target.value),children:C.jt.map(e=>(0,r.jsx)("option",{value:e,children:"zh"===s?C.T_[e].nameZh:C.T_[e].name},e))})})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.D0,{label:l,hint:d,hintError:e.isDuplicateName,children:(0,r.jsx)(S.pd,{value:e.name,onChange:t=>e.setName(t.target.value),placeholder:i})}),(0,r.jsx)(S.D0,{label:o,children:(0,r.jsx)(S.l6,{value:e.protocol,onChange:t=>e.setProtocol(t.target.value),children:C.jt.map(e=>(0,r.jsx)("option",{value:e,children:"zh"===s?C.T_[e].nameZh:C.T_[e].name},e))})})]}),(0,r.jsx)(S.D0,{label:"Base URL",children:(0,r.jsx)(S.pd,{value:e.baseUrl,onChange:t=>e.setBaseUrl(t.target.value),placeholder:n.fixedBaseUrl||"https://api.example.com/v1"})}),(0,r.jsx)(S.D0,{label:(0,r.jsxs)(r.Fragment,{children:["API Key ",(0,r.jsx)("span",{className:"text-muted-foreground/50 font-normal",children:"zh"===s?"(可选)":"(optional)"})]}),children:(0,r.jsx)(S.yA,{value:e.apiKey,onChange:e.setApiKey,placeholder:"sk-..."})}),(0,r.jsx)(S.D0,{label:"zh"===s?"模型":"Model",children:(0,r.jsx)(z.A,{value:e.model,onChange:e.setModel,placeholder:n.defaultModel,provider:e.protocol,apiKey:e.apiKey,baseUrl:e.baseUrl,supportsListModels:!!e.baseUrl.trim(),allowNoKey:!0,browseLabel:t.settings.ai.listModels,noModelsLabel:t.settings.ai.noModelsFound})})]})}var R=s(94514),I=s(53961);function P({result:e,disabled:t,onTest:s,t:a}){let n="testing"===e.state,l="ok"===e.state,o="error"===e.state;return(0,r.jsxs)("button",{type:"button",disabled:t||n,onClick:s,className:`inline-flex items-center gap-1.5 px-3.5 py-1.5 text-sm font-medium rounded-lg transition-all duration-200 disabled:cursor-not-allowed ${l?"bg-success/10 text-success border border-success/20":o?"bg-destructive/8 text-destructive border border-destructive/20 hover:bg-destructive/12":"border border-border text-muted-foreground hover:text-foreground hover:border-foreground/20 disabled:opacity-40"}`,children:[n?(0,r.jsx)(p.A,{size:13,className:"animate-spin"}):l?(0,r.jsx)(R.A,{size:13}):o?(0,r.jsx)(x.A,{size:13}):(0,r.jsx)(I.A,{size:13}),n?a.settings.ai.testKeyTesting:l&&null!=e.latency?a.settings.ai.testKeyOk(e.latency):o?function(e,t){switch(t){case"auth_error":return e.settings.ai.testKeyAuthError;case"model_not_found":return e.settings.ai.testKeyModelNotFound;case"endpoint_error":return e.settings.ai.testKeyEndpointError;case"rate_limited":return e.settings.ai.testKeyRateLimited;case"network_error":return e.settings.ai.testKeyNetworkError;default:return e.settings.ai.testKeyUnknown}}(a,e.code):a.settings.ai.testKey]})}var U=s(41585),$=s(4235);let D={checking:!1,available:null,isSelf:!1,suggestion:null};function F({label:e,hint:t,value:s,onChange:n,status:l,onCheckPort:o,m:i}){let d=(0,a.useRef)(void 0);return(0,a.useEffect)(()=>()=>clearTimeout(d.current),[]),(0,r.jsxs)("div",{className:"space-y-1",children:[e&&(0,r.jsx)("label",{className:"text-xs font-medium text-foreground",children:e}),t&&(0,r.jsx)("p",{className:"text-2xs text-muted-foreground",children:t}),(0,r.jsx)("input",{type:"number",min:1024,max:65535,value:s,onChange:e=>{let t=parseInt(e.target.value,10)||s;n(t),clearTimeout(d.current),t>=1024&&t<=65535&&(d.current=setTimeout(()=>o(t),500))},onBlur:()=>{clearTimeout(d.current),s>=1024&&s<=65535&&o(s)},className:"w-full px-2.5 py-1.5 text-sm rounded-lg border border-border bg-muted/30 text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring tabular-nums"}),l.checking&&(0,r.jsxs)("p",{className:"text-xs flex items-center gap-1 text-muted-foreground",children:[(0,r.jsx)(p.A,{size:11,className:"animate-spin"})," ",i.portChecking]}),!l.checking&&!1===l.available&&!l.invalid&&(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("p",{className:"text-xs flex items-center gap-1 text-[var(--amber)]",children:[(0,r.jsx)(U.A,{size:11})," ",i.portInUse(s)]}),null!==l.suggestion&&(0,r.jsx)("button",{type:"button",onClick:()=>{n(l.suggestion),setTimeout(()=>o(l.suggestion),0)},className:"text-xs px-2 py-0.5 rounded border border-[var(--amber)] text-[var(--amber)] transition-colors hover:bg-[var(--amber-subtle)]",children:i.portSuggest(l.suggestion)})]}),!l.checking&&l.invalid&&(0,r.jsxs)("p",{className:"text-xs flex items-center gap-1 text-destructive",children:[(0,r.jsx)(U.A,{size:11})," 1024 – 65535"]}),!l.checking&&!0===l.available&&(0,r.jsxs)("p",{className:"text-xs flex items-center gap-1 text-success",children:[(0,r.jsx)(g.A,{size:11})," ",l.isSelf?i.portSelf:i.portAvailable]})]})}function L({message:e,sub:t}){return(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"text-center space-y-4 max-w-sm px-6",children:[(0,r.jsx)(p.A,{size:32,className:"animate-spin mx-auto text-[var(--amber)]"}),(0,r.jsx)("p",{className:"text-sm font-medium text-foreground",children:e}),t&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:t})]})})}function O({m:e}){let[t,s]=(0,a.useState)(0),[n,l]=(0,a.useState)(0),[o,i]=(0,a.useState)(D),[d,c]=(0,a.useState)(!1),[u,m]=(0,a.useState)(null),[x,p]=(0,a.useState)(void 0),h=(0,a.useRef)(void 0);(0,a.useEffect)(()=>{(0,y.n)("/api/settings").then(e=>{let t=e.port||3456;s(t),l(t)}).catch(()=>{})},[]),(0,a.useEffect)(()=>()=>clearInterval(h.current),[]);let g=n!==t,b=n<1024||n>65535,f=o.checking||!1===o.available&&!o.isSelf,v=(0,a.useCallback)(async e=>{if(e<1024||e>65535)return void i({...D,available:!1,invalid:!0});i({...D,checking:!0});try{let t=await (0,y.n)("/api/setup/check-port",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({port:e})});i({checking:!1,available:t.available,isSelf:t.isSelf??!1,suggestion:t.suggestion??null})}catch{i(D)}},[]),j=async()=>{if(g&&!b&&!f&&!d){c(!0);try{let t=await (0,y.n)("/api/setup/check-port",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({port:n})});if(!t.available&&!t.isSelf){i({checking:!1,available:!1,isSelf:!1,suggestion:t.suggestion??null}),c(!1),$.oR.error(e.portInUse(n));return}await (0,y.n)("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({port:n})}),m(e.portWebRestarting),p(e.portRedirecting);try{await (0,y.n)("/api/restart",{method:"POST"})}catch{}let s=`${window.location.protocol}//${window.location.hostname}:${n}`,r=Date.now()+3e4;h.current=setInterval(async()=>{if(Date.now()>r){clearInterval(h.current),m(null),c(!1),$.oR.error(e.portRestartTimeout);return}try{(await fetch(`${s}/api/health`,{signal:AbortSignal.timeout(2e3)})).ok&&(clearInterval(h.current),window.location.href=s)}catch{}},1500)}catch{c(!1),$.oR.error(e.portUpdateFailed)}}};return 0===t?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5 px-4 pt-4 pb-3",children:[(0,r.jsx)("div",{className:"w-7 h-7 rounded-lg bg-muted flex items-center justify-center shrink-0",children:(0,r.jsx)(w.A,{size:14,className:"text-muted-foreground"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:e.webPortLabel}),(0,r.jsx)("p",{className:"text-2xs text-muted-foreground",children:e.webPortHint})]})]}),(0,r.jsxs)("div",{className:"px-4 pb-4 space-y-3",children:[(0,r.jsx)(F,{label:"",hint:"",value:n,onChange:e=>{l(e),i(D)},status:o,onCheckPort:v,m:e}),(0,r.jsx)("button",{type:"button",onClick:j,disabled:!g||b||f||d,className:"w-full py-2 rounded-lg text-xs font-medium transition-colors bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:d?e.portUpdating:e.portUpdateBtn})]})]}),u&&(0,r.jsx)(L,{message:u,sub:x})]})}function B({data:e,updateAi:t,updateAgent:s,t:l}){let{locale:o}=(0,j.Y)(),i=e.envOverrides??{},d=e.ai.providers.find(t=>t.id===e.ai.activeProvider),c=d?C.T_[d.protocol]:null,[u,m]=(0,a.useState)({}),[p,h]=(0,a.useState)(!1),g=(0,a.useRef)(void 0),b=(0,a.useRef)(e.ai.activeProvider);(0,a.useEffect)(()=>{b.current!==e.ai.activeProvider&&(b.current=e.ai.activeProvider,m({}),g.current&&(clearTimeout(g.current),g.current=void 0))},[e.ai.activeProvider]),(0,a.useEffect)(()=>()=>{g.current&&clearTimeout(g.current)},[]),(0,a.useEffect)(()=>{let t=e.agent?.reconnectRetries??3;try{localStorage.setItem("mindos-reconnect-retries",String(t))}catch(e){console.warn("[AiTab] localStorage setItem reconnectRetries failed:",e)}},[e.agent?.reconnectRetries]);let f=(0,a.useCallback)(async()=>{if(!d)return;let e=d.id;m(t=>({...t,[e]:{state:"testing"}}));try{let t={provider:d.protocol};d.apiKey&&(t.apiKey=d.apiKey),d.model&&(t.model=d.model),d.baseUrl&&(t.baseUrl=d.baseUrl);let s=await fetch("/api/settings/test-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await s.json();r.ok?(m(t=>({...t,[e]:{state:"ok",latency:r.latency}})),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{m(t=>({...t,[e]:{state:"idle"}}))},8e3)):m(t=>({...t,[e]:{state:"error",error:r.error,code:r.code}}))}catch{m(t=>({...t,[e]:{state:"error",code:"network_error",error:"Network error"}}))}},[d]),v=(0,a.useCallback)(s=>{d&&("apiKey"in s&&m(e=>({...e,[d.id]:{state:"idle"}})),t({providers:e.ai.providers.map(e=>e.id===d.id?{...e,...s}:e)}))},[d,e.ai.providers,t]),y=d?(0,C.Ux)(d.protocol):void 0,w=!!y&&i[y],M=!!c?.apiKeyFallback,E=(0,a.useCallback)(()=>{if(!d)return;let s=C.T_[d.protocol];m(e=>({...e,[d.id]:{state:"idle"}})),t({providers:e.ai.providers.map(e=>e.id===d.id?{...e,apiKey:"",model:"",baseUrl:s?.fixedBaseUrl??""}:e)})},[d,e.ai.providers,t]),R=(0,a.useCallback)(()=>{if(!d)return;let s=e.ai.providers.filter(e=>e.id!==d.id);t({activeProvider:s.length>0?s[0].id:"",providers:s}),m(e=>{let t={...e};return delete t[d.id],t})},[d,e.ai.providers,t]),I=(0,a.useCallback)(s=>{let r={id:s.id||(0,T.mV)(),name:s.name,protocol:s.protocol,apiKey:s.apiKey,model:s.model,baseUrl:s.baseUrl};t({activeProvider:r.id,providers:[...e.ai.providers,r]}),h(!1)},[e.ai.providers,t]),P=d?.name??("zh"===o?"未选择":"No provider");return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)(S.L7,{icon:(0,r.jsx)(n.A,{size:15}),title:l.settings.ai.provider,description:P,children:[(0,r.jsx)(A.A,{value:e.ai.activeProvider,onChange:e=>{"skip"!==e&&t({activeProvider:e}),h(!1)},compact:!0,customProviders:e.ai.providers,onAdd:()=>{let t=C.T_.openai,s="zh"===o?t.nameZh:t.name,r=new Set(e.ai.providers.map(e=>e.name.toLowerCase())),a=s;if(r.has(a.toLowerCase())){let e=2;for(;r.has(`${s} (${e})`.toLowerCase());)e++;a=`${s} (${e})`}h(!0)}}),p&&(0,r.jsx)(K,{onSave:I,onCancel:()=>h(!1),t:l,existingNames:e.ai.providers.map(e=>e.name)},"new"),!p&&d&&(0,r.jsxs)("div",{className:"space-y-3 pt-3 border-t border-border",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,r.jsx)(S.D0,{label:"zh"===o?"名称":"Name",children:(0,r.jsx)(S.pd,{value:d.name,onChange:e=>v({name:e.target.value}),placeholder:"zh"===o?"输入名称":"Enter name"})}),(0,r.jsx)(S.D0,{label:"zh"===o?"协议":"Protocol",children:(0,r.jsx)(S.l6,{value:d.protocol,onChange:e=>v({protocol:e.target.value}),children:C.jt.map(e=>(0,r.jsx)("option",{value:e,children:"zh"===o?C.T_[e].nameZh:C.T_[e].name},e))})})]}),(0,r.jsxs)(S.D0,{label:(0,r.jsxs)(r.Fragment,{children:[l.settings.ai.apiKey," ",y&&(0,r.jsx)(S.Bt,{overridden:i[y]})]}),hint:c&&w?l.settings.ai.envFieldNote(y):c&&M?l.settings.ai.keyOptionalHint:void 0,children:[(0,r.jsx)(S.yA,{value:d.apiKey,onChange:e=>v({apiKey:e}),placeholder:"sk-..."}),c?.signupUrl&&!d.apiKey&&!w&&(0,r.jsxs)("a",{href:c.signupUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs mt-1.5 hover:underline",style:{color:"var(--amber)"},children:[(0,r.jsx)(N.A,{size:10}),M?"zh"===o?`下载 ${c.nameZh}`:`Download ${c.name}`:"zh"===o?`获取 ${c.nameZh} API Key`:`Get ${c.name} API Key`]})]}),(c?.supportsBaseUrl||d.baseUrl)&&(0,r.jsx)(S.D0,{label:"Base URL",children:(0,r.jsx)(S.pd,{value:d.baseUrl,onChange:e=>v({baseUrl:e.target.value}),placeholder:c?.fixedBaseUrl||(0,C.Ot)(d.protocol)||"https://api.openai.com/v1"})}),(0,r.jsx)(S.D0,{label:"zh"===o?"模型":"Model",children:(0,r.jsx)(z.A,{value:d.model,onChange:e=>v({model:e}),placeholder:c?.defaultModel??"",provider:d.protocol,apiKey:d.apiKey,envKey:!!w,baseUrl:d.baseUrl,supportsListModels:!!d.baseUrl?.trim()||!!c?.supportsListModels,allowNoKey:!!d.baseUrl?.trim(),browseLabel:l.settings.ai.listModels,noModelsLabel:l.settings.ai.noModelsFound})}),(0,r.jsx)(_,{provider:d.protocol,result:u[d.id]??{state:"idle"},hasKey:!!d.apiKey,hasEnv:!!w,hasConfig:!!(d.apiKey||d.model||d.baseUrl),onTest:f,onReset:E,onDelete:R,t:l})]}),!p&&Object.values(i).some(Boolean)&&(0,r.jsxs)("div",{className:"flex items-start gap-2 text-xs text-[var(--amber)] bg-[var(--amber-subtle)] border border-[var(--amber)]/20 rounded-lg px-3 py-2.5",children:[(0,r.jsx)(x.A,{size:13,className:"shrink-0 mt-0.5"}),(0,r.jsx)("span",{children:l.settings.ai.envHint})]})]}),(0,r.jsxs)(S.L7,{icon:(0,r.jsx)(k.A,{size:15}),title:l.settings.agent.title,description:l.settings.agent.subtitle??"Configure how the AI agent operates",children:[(0,r.jsx)(S.pM,{label:l.settings.agent.maxSteps,hint:l.settings.agent.maxStepsHint,children:(0,r.jsxs)(S.l6,{value:String(e.agent?.maxSteps??20),onChange:e=>s({maxSteps:Number(e.target.value)}),className:"w-20",children:[(0,r.jsx)("option",{value:"5",children:"5"}),(0,r.jsx)("option",{value:"10",children:"10"}),(0,r.jsx)("option",{value:"15",children:"15"}),(0,r.jsx)("option",{value:"20",children:"20"}),(0,r.jsx)("option",{value:"25",children:"25"}),(0,r.jsx)("option",{value:"30",children:"30"})]})}),(0,r.jsx)(S.pM,{label:l.settings.agent.contextStrategy,hint:l.settings.agent.contextStrategyHint,children:(0,r.jsxs)(S.l6,{value:e.agent?.contextStrategy??"auto",onChange:e=>s({contextStrategy:e.target.value}),className:"w-24",children:[(0,r.jsx)("option",{value:"auto",children:l.settings.agent.contextStrategyAuto}),(0,r.jsx)("option",{value:"off",children:l.settings.agent.contextStrategyOff})]})}),(0,r.jsx)(S.pM,{label:l.settings.agent.reconnectRetries,hint:l.settings.agent.reconnectRetriesHint,children:(0,r.jsxs)(S.l6,{value:String(e.agent?.reconnectRetries??3),onChange:e=>{let t=Number(e.target.value);s({reconnectRetries:t});try{localStorage.setItem("mindos-reconnect-retries",String(t))}catch(e){console.warn("[AiTab] localStorage setItem reconnectRetries failed:",e)}},className:"w-20",children:[(0,r.jsx)("option",{value:"0",children:"Off"}),(0,r.jsx)("option",{value:"1",children:"1"}),(0,r.jsx)("option",{value:"2",children:"2"}),(0,r.jsx)("option",{value:"3",children:"3"}),(0,r.jsx)("option",{value:"5",children:"5"}),(0,r.jsx)("option",{value:"10",children:"10"})]})}),c?.supportsThinking&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.pM,{label:l.settings.agent.thinking,hint:l.settings.agent.thinkingHint,children:(0,r.jsx)(S.lM,{checked:e.agent?.enableThinking??!1,onChange:()=>s({enableThinking:!e.agent?.enableThinking})})}),e.agent?.enableThinking&&(0,r.jsx)(S.D0,{label:l.settings.agent.thinkingBudget,hint:l.settings.agent.thinkingBudgetHint,children:(0,r.jsx)(S.pd,{type:"number",value:String(e.agent?.thinkingBudget??5e3),onChange:e=>{let t=parseInt(e.target.value,10);isNaN(t)||s({thinkingBudget:Math.max(1e3,Math.min(5e4,t))})},min:1e3,max:5e4,step:1e3})})]})]}),(0,r.jsx)(O,{m:l.settings?.mcp??{}}),(0,r.jsx)(H,{})]})}function _({provider:e,result:t,hasKey:s,hasEnv:n,hasConfig:l,onTest:o,onReset:i,onDelete:d,t:c}){let[u,x]=(0,a.useState)(null),p=(0,a.useRef)(void 0),g=!!C.T_[e]?.apiKeyFallback;(0,a.useEffect)(()=>()=>{p.current&&clearTimeout(p.current)},[]);let b=e=>{u===e?("reset"===e?i?.():d?.(),x(null),p.current&&clearTimeout(p.current)):(x(e),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>x(null),3e3))},{locale:f}=(0,j.Y)();return(0,r.jsx)("div",{className:"space-y-2 pt-2",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)(P,{result:t,disabled:!(s||n||g),onTest:o,t:c}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[i&&l&&(0,r.jsxs)("button",{type:"button",onClick:()=>b("reset"),onBlur:()=>{"reset"===u&&(x(null),p.current&&clearTimeout(p.current))},className:`inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg transition-all duration-200 ${"reset"===u?"bg-destructive/10 text-destructive border border-destructive/25 font-medium":"text-muted-foreground/60 hover:text-muted-foreground hover:bg-muted/50"}`,children:[(0,r.jsx)(h.A,{size:12}),"reset"===u?"zh"===f?"确认重置?":"Confirm?":"zh"===f?"重置":"Reset"]}),d&&(0,r.jsxs)("button",{type:"button",onClick:()=>b("delete"),onBlur:()=>{"delete"===u&&(x(null),p.current&&clearTimeout(p.current))},className:`inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg transition-all duration-200 ${"delete"===u?"bg-destructive/10 text-destructive border border-destructive/25 font-medium":"text-muted-foreground/60 hover:text-muted-foreground hover:bg-muted/50"}`,children:[(0,r.jsx)(m.A,{size:12}),"delete"===u?"zh"===f?"确认删除?":"Confirm?":"zh"===f?"删除":"Delete"]})]})]})})}function K({initial:e,onSave:t,onCancel:s,onDelete:n,t:l,existingNames:o}){let{locale:i}=(0,j.Y)(),d=function({initial:e,onSave:t,locale:s,existingNames:r}){let n=(0,a.useMemo)(()=>e?.name??M(e?.protocol??"openai",r,e?.name,s),[e?.name,e?.protocol,r,s]),[l,o]=(0,a.useState)(n),[i,d]=(0,a.useState)(e?.protocol??"openai"),[c,u]=(0,a.useState)(e?.apiKey??""),[m,x]=(0,a.useState)(e?.model??""),[p,h]=(0,a.useState)(e?.baseUrl??""),[g,b]=(0,a.useState)({state:"idle"}),[f,v]=(0,a.useState)(!!e?.name),j=(0,a.useMemo)(()=>M(i,r,e?.name,s),[i,r,e?.name,s]);(0,a.useEffect)(()=>{f||o(j)},[j,f]);let y=(0,a.useCallback)(e=>{v(!0),o(e)},[]),N=(0,a.useCallback)(e=>{d(e),b({state:"idle"})},[]),k=l.trim()||j,w=!!(k&&r?.some(t=>t!==e?.name&&t.toLowerCase()===k.toLowerCase())),S=!!(p.trim()&&m.trim()&&!w),C="zh"===s?"接口地址和模型为必填":"Base URL and model are required",A="zh"===s?"名称已存在,请使用其他名称":"Name already exists, please use a different name",z=(0,a.useCallback)(async()=>{if(w)return void b({state:"error",error:A});if(!p.trim()||!m.trim())return void b({state:"error",error:C});b({state:"testing"});try{let t=await fetch("/api/settings/test-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e?.id?{provider:e.id,apiKey:c,model:m,baseUrl:p}:{provider:i,apiKey:c,model:m,baseUrl:p,baseProviderId:i})}),s=await t.json();s.ok?b({state:"ok",latency:s.latency}):b({state:"error",error:s.error||"Test failed",code:s.code})}catch{b({state:"error",code:"network_error",error:"Network error"})}},[w,A,p,m,e?.id,c,i,C]),E=(0,a.useCallback)(()=>{w?b({state:"error",error:A}):p.trim()&&m.trim()?t({id:e?.id||(0,T.mV)(),name:k,protocol:i,apiKey:c,model:m.trim(),baseUrl:p.trim()}):b({state:"error",error:C})},[w,A,p,m,C,t,e?.id,k,i,c]);return{name:l,setName:y,protocol:i,setProtocol:N,apiKey:c,setApiKey:u,model:m,setModel:x,baseUrl:p,setBaseUrl:h,testResult:g,canSave:S,isDuplicateName:w,handleTest:z,handleSave:E}}({initial:e,onSave:t,locale:i,existingNames:o}),[c,u]=(0,a.useState)(!1),x=(0,a.useRef)(void 0);(0,a.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]);let p=e?.id?"zh"===i?"编辑 Provider":"Edit Provider":"zh"===i?"添加 Provider":"Add Provider",h=[];return d.name.trim()||h.push("zh"===i?"名称":"Name"),d.baseUrl.trim()||h.push("zh"===i?"接口地址":"Base URL"),d.model.trim()||h.push("zh"===i?"模型":"Model"),(0,r.jsxs)("div",{className:"mt-3 rounded-lg border border-border overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:p}),(0,r.jsx)("button",{type:"button",onClick:s,className:"p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors","aria-label":"zh"===i?"关闭":"Close",children:(0,r.jsx)(b.A,{size:14})})]}),(0,r.jsxs)("div",{className:"p-4",children:[(0,r.jsx)(E,{form:d,t:l,locale:i,layout:"compact"}),(0,r.jsxs)("div",{className:"flex items-center gap-2 pt-4",children:[(0,r.jsx)(P,{result:d.testResult,disabled:!d.canSave,onTest:d.handleTest,t:l}),n&&e?.id&&(0,r.jsxs)("button",{type:"button",onClick:()=>{c?(n(),x.current&&clearTimeout(x.current)):(u(!0),x.current=setTimeout(()=>u(!1),3e3))},onBlur:()=>{u(!1),x.current&&clearTimeout(x.current)},className:`inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg transition-all duration-200 ${c?"bg-destructive/10 text-destructive border border-destructive/25 font-medium":"text-muted-foreground/60 hover:text-muted-foreground hover:bg-muted/50"}`,children:[(0,r.jsx)(m.A,{size:12}),c?"zh"===i?"确认删除?":"Confirm?":"zh"===i?"删除":"Delete"]}),(0,r.jsxs)("div",{className:"flex-1",children:[d.isDuplicateName&&(0,r.jsx)("span",{className:"text-2xs text-destructive pl-2",children:"zh"===i?"名称已存在":"Name already exists"}),!d.isDuplicateName&&!d.canSave&&h.length>0&&(0,r.jsx)("span",{className:"text-2xs text-muted-foreground/60 pl-2",children:"zh"===i?`需要: ${h.join("、")}`:`Required: ${h.join(", ")}`})]}),(0,r.jsx)("button",{type:"button",onClick:s,className:"px-3 py-1.5 text-sm rounded-lg text-muted-foreground hover:text-foreground transition-colors",children:l.settings?.customProviders?.modal?.buttonCancel??"Cancel"}),(0,r.jsx)("button",{type:"button",onClick:d.handleSave,disabled:!d.canSave,className:"px-4 py-1.5 text-sm font-medium rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] hover:bg-[var(--amber)]/90 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"zh"===i?"保存":"Save"})]})]})]})}function H(){let{t:e}=(0,j.Y)(),[t,s]=(0,a.useState)("panel");return(0,a.useEffect)(()=>{try{let e=localStorage.getItem("ask-mode");"popup"===e&&s("popup")}catch(e){console.warn("[AiTab] localStorage getItem ask-mode failed:",e)}},[]),(0,r.jsx)(S.L7,{icon:(0,r.jsx)(w.A,{size:15}),title:e.settings.askDisplayMode?.label??"Display Mode",description:e.settings.askDisplayMode?.hint??"Side panel stays docked on the right. Popup opens a floating dialog.",children:(0,r.jsxs)(S.l6,{value:t,onChange:e=>(e=>{s(e);try{localStorage.setItem("ask-mode",e)}catch(e){console.warn("[AiTab] localStorage setItem ask-mode failed:",e)}window.dispatchEvent(new StorageEvent("storage",{key:"ask-mode",newValue:e}))})(e.target.value),children:[(0,r.jsx)("option",{value:"panel",children:e.settings.askDisplayMode?.panel??"Side Panel"}),(0,r.jsx)("option",{value:"popup",children:e.settings.askDisplayMode?.popup??"Popup"})]})})}var G=s(51900),V=s(36999),J=s(92451),q=s(97810);let W=(0,i.A)("type",[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]),Y=(0,i.A)("a-large-small",[["path",{d:"m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16",key:"xik6mr"}],["path",{d:"M15.697 14h5.606",key:"1stdlc"}],["path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16",key:"d5nyq2"}],["path",{d:"M3.304 13h6.392",key:"1q3zxz"}]]),Z=(0,i.A)("columns-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);var X=s(66088),Q=s(21362);let ee=[{value:"680px",label:"Narrow",width:42},{value:"780px",label:"Default",width:56},{value:"960px",label:"Wide",width:75},{value:"100%",label:"Full",width:100}],et=[{value:"lora",label:"Lora",category:"Serif",style:{fontFamily:"Lora, Georgia, serif"}},{value:"ibm-plex-sans",label:"IBM Plex Sans",category:"Sans",style:{fontFamily:"'IBM Plex Sans', sans-serif"}},{value:"inter",label:"Inter",category:"Sans",style:{fontFamily:"var(--font-inter), sans-serif"}},{value:"ibm-plex-mono",label:"IBM Plex Mono",category:"Mono",style:{fontFamily:"'IBM Plex Mono', monospace"}}];function es({icon:e,label:t,children:s}){return(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e}),(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:t})]}),s]})}function er({options:e,value:t,onChange:s}){return(0,r.jsx)("div",{className:"flex gap-2",children:e.map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>s(e.value),className:`flex items-center gap-1.5 px-3.5 py-2 text-sm font-medium rounded-xl transition-all ${t===e.value?"bg-[var(--amber)] text-[var(--amber-foreground)] shadow-sm":"bg-muted/50 text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:[e.icon,e.label]},e.value))})}function ea({font:e,setFont:t,fontSize:s,setFontSize:n,contentWidth:l,setContentWidth:o,dark:i,setDark:c,locale:u,setLocale:m,t:x}){let[p,h]=(0,a.useState)(!1),[g,b]=(0,a.useState)(()=>localStorage.getItem("theme")??"system"),[f,v]=(0,a.useState)(()=>localStorage.getItem("locale")??"system"),j=x.settings.appearance;return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)(S.L7,{icon:(0,r.jsx)(d,{size:15}),title:j.preferencesTitle??"Preferences",children:[(0,r.jsx)(es,{icon:(0,r.jsx)(G.A,{size:14}),label:j.colorTheme,children:(0,r.jsx)(er,{options:[{value:"system",label:j.system,icon:(0,r.jsx)(w.A,{size:14})},{value:"dark",label:j.dark,icon:(0,r.jsx)(V.A,{size:14})},{value:"light",label:j.light,icon:(0,r.jsx)(G.A,{size:14})}],value:g,onChange:e=>{b(e),localStorage.setItem("theme",e);let t="system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches:"dark"===e;c(t),document.documentElement.classList.toggle("dark",t)}})}),(0,r.jsx)(es,{icon:(0,r.jsx)(J.A,{size:14}),label:j.language,children:(0,r.jsx)(er,{options:[{value:"system",label:j.system,icon:(0,r.jsx)(w.A,{size:14})},{value:"en",label:"EN"},{value:"zh",label:"中文"}],value:f,onChange:e=>{v(e),localStorage.setItem("locale",e);let t="system"===e?navigator.language.startsWith("zh")?"zh":"en":e;m(t),document.cookie=`locale=${t};path=/;max-age=31536000;SameSite=Lax`}})})]}),(0,r.jsxs)(S.L7,{icon:(0,r.jsx)(q.A,{size:15}),title:j.readingTitle??"Reading",description:j.readingDesc??"Customize how your notes look",children:[(0,r.jsx)(es,{icon:(0,r.jsx)(W,{size:14}),label:j.readingFont,children:(0,r.jsx)("div",{className:"space-y-0.5",children:et.map(s=>{let a=e===s.value;return(0,r.jsxs)("button",{type:"button",onClick:()=>t(s.value),className:`flex items-center gap-4 w-full px-3 py-2.5 rounded-lg transition-all text-left relative ${a?"bg-[var(--amber-subtle)]":"hover:bg-muted/50"}`,children:[a&&(0,r.jsx)("div",{className:"absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full bg-[var(--amber)]"}),(0,r.jsx)("span",{className:`text-xl font-medium w-10 text-center shrink-0 ${a?"text-foreground":"text-muted-foreground/60"}`,style:{fontFamily:s.style.fontFamily},children:"Aa"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,r.jsx)("span",{className:`text-sm font-medium ${a?"text-foreground":"text-muted-foreground"}`,style:{fontFamily:s.style.fontFamily},children:s.label}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground/50",children:s.category})]}),(0,r.jsx)("p",{className:`text-sm truncate mt-0.5 ${a?"text-muted-foreground":"text-muted-foreground/40"}`,style:{fontFamily:s.style.fontFamily},children:j.fontPreview})]})]},s.value)})})}),(0,r.jsx)(es,{icon:(0,r.jsx)(Y,{size:14}),label:j.fontSize,children:(0,r.jsxs)("div",{className:"px-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground/60 shrink-0",style:{fontSize:"11px"},children:"A"}),(0,r.jsx)("input",{type:"range",min:14,max:17,step:1,value:parseInt(s),onChange:e=>n(`${e.target.value}px`),className:"flex-1 h-1.5 rounded-full appearance-none bg-muted cursor-pointer accent-[var(--amber)] [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[var(--amber)] [&::-webkit-slider-thumb]:shadow-sm [&::-webkit-slider-thumb]:cursor-pointer [&::-webkit-slider-thumb]:transition-transform [&::-webkit-slider-thumb]:hover:scale-110 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-[var(--amber)] [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:shadow-sm [&::-moz-range-thumb]:cursor-pointer"}),(0,r.jsx)("span",{className:"text-base text-muted-foreground/60 shrink-0",children:"A"})]}),(0,r.jsx)("div",{className:"text-center mt-1.5",children:(0,r.jsxs)("span",{className:"text-xs tabular-nums text-muted-foreground",children:[parseInt(s),"px"]})}),(0,r.jsx)("p",{className:"text-muted-foreground leading-relaxed mt-2 px-1",style:{fontSize:s,fontFamily:et.find(t=>t.value===e)?.style.fontFamily},children:j.fontSizePreview})]})}),(0,r.jsx)(es,{icon:(0,r.jsx)(Z,{size:14}),label:j.contentWidth,children:(0,r.jsx)("div",{className:"space-y-1",children:ee.map(e=>{let t=l===e.value;return(0,r.jsxs)("button",{type:"button",onClick:()=>o(e.value),className:`flex items-center gap-3 w-full px-3 py-2 rounded-lg transition-all ${t?"bg-[var(--amber-subtle)]":"hover:bg-muted/50"}`,children:[(0,r.jsx)("div",{className:"flex-1 h-2 rounded-full bg-muted/40 overflow-hidden",children:(0,r.jsx)("div",{className:`h-full rounded-full transition-all ${t?"bg-[var(--amber)]":"bg-muted-foreground/20"}`,style:{width:`${e.width}%`}})}),(0,r.jsx)("span",{className:`text-sm shrink-0 w-14 text-right ${t?"text-foreground font-medium":"text-muted-foreground"}`,children:e.label})]},e.value)})})})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground/40 px-0.5",children:j.browserNote}),(0,r.jsxs)("div",{className:"border-t border-border pt-4",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>h(!p),className:"flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:[p?(0,r.jsx)(X.A,{size:14}):(0,r.jsx)(Q.A,{size:14}),x.settings.tabs.shortcuts]}),p&&(0,r.jsx)("div",{className:"mt-3 space-y-0.5",children:x.shortcuts.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center justify-between py-1.5 px-1",children:[(0,r.jsx)("span",{className:"text-sm text-foreground",children:e.description}),(0,r.jsx)("div",{className:"flex items-center gap-1",children:e.keys.map((e,t)=>(0,r.jsx)("kbd",{className:"px-1.5 py-0.5 text-2xs font-mono bg-muted border border-border rounded text-muted-foreground",children:e},t))})]},t))})]})]})}let en=(0,i.A)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),el=(0,i.A)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);var eo=s(67635),ei=s(61878);let ed=(0,i.A)("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);var ec=s(65576),eu=s(39498),em=s(7834);function ex(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<0x40000000?`${(e/1048576).toFixed(1)} MB`:`${(e/0x40000000).toFixed(2)} GB`}var ep=s(11690),eh=s(9339);let eg=(0,eh.createServerReference)("00feca4f045dae5532c9896f7aaa9936d1991a0f3d",eh.callServer,void 0,eh.findSourceMapURL,"scanExampleFilesAction"),eb=(0,eh.createServerReference)("007bf37caaabc373ea7e94364c9e24bf2c0fcdb88d",eh.callServer,void 0,eh.findSourceMapURL,"cleanupExamplesAction");function ef({data:e,setData:t,t:s}){let l=e.envOverrides??{},o=s.settings.knowledge,i=s.settings.appearance,[d,x]=(0,a.useState)(()=>"1"===localStorage.getItem("mindos:labs-echo")),[g,b]=(0,a.useState)(()=>"1"===localStorage.getItem("mindos:labs-workflows")),[f,v]=(0,a.useState)(()=>"true"===localStorage.getItem("show-hidden-files")),[j,N]=(0,a.useState)(null),[k,w]=(0,a.useState)(!1),[C,A]=(0,a.useState)(null);(0,a.useEffect)(()=>{eg().then(e=>N(e.files.length)).catch(e=>{console.warn("[KnowledgeTab] scanExampleFilesAction failed:",e)})},[]);let[z,T]=(0,a.useState)(null),[M,E]=(0,a.useState)(!1);(0,a.useEffect)(()=>{(0,y.n)("/api/setup").then(e=>{let t=e.guideState;t&&(T(t.active),E(!!t.dismissed))}).catch(e=>{console.error("Failed to fetch guide state:",e)})},[]);let I=(0,a.useCallback)(()=>{let e=!M;E(e);let t={dismissed:e};e||(t.active=!0),(0,y.n)("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:t})}).then(()=>window.dispatchEvent(new Event("guide-state-updated"))).catch(t=>{console.error("Failed to update guide state:",t),E(!e)})},[M]),P=(0,a.useCallback)(()=>{(0,y.n)("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:{active:!0,dismissed:!1,walkthroughStep:0,walkthroughDismissed:!1}})}).then(()=>{T(!0),E(!1),window.dispatchEvent(new Event("guide-state-updated"))}).catch(e=>console.error("Failed to restart walkthrough:",e))},[]),U=e.embedding??{enabled:!1,provider:"local",baseUrl:"",apiKey:"",model:""},D=e.embeddingStatus??{enabled:!1,ready:!1,building:!1,docCount:0},F=U.provider||"local",[L,O]=(0,a.useState)(null),[B,_]=(0,a.useState)(!1);(0,a.useEffect)(()=>{U.enabled&&"local"===F&&(0,y.n)("/api/embedding").then(e=>O(e.downloaded)).catch(()=>O(!1))},[U.enabled,F]),(0,a.useEffect)(()=>{if(!B)return;let e=setInterval(()=>{(0,y.n)("/api/embedding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"status"})}).then(e=>{e.downloaded&&(O(!0),_(!1),$.oR.success?.("Model downloaded successfully")??(0,$.oR)("Model downloaded")),e.error&&(_(!1),$.oR.error?.(e.error)??(0,$.oR)(e.error))}).catch(()=>{})},3e3);return()=>clearInterval(e)},[B]);let K=(0,a.useCallback)(()=>{_(!0),(0,y.n)("/api/embedding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"download",model:U.model||void 0})}).catch(()=>_(!1))},[U.model]),H=(0,a.useSyncExternalStore)(()=>()=>{},()=>`${window.location.protocol}//${window.location.hostname}`,()=>"http://localhost"),[G,V]=(0,a.useState)(!1),[J,q]=(0,a.useState)(null),[W,Y]=(0,a.useState)(!1),[Z,X]=(0,a.useState)(!1),Q=!!e.authToken,ee=J??e.authToken??"";async function et(){V(!0);try{let e=await (0,y.n)("/api/settings/reset-token",{method:"POST"});q(e.token),t(t=>t?{...t,authToken:e.token}:t)}finally{V(!1)}}async function es(){t(e=>e?{...e,authToken:""}:e),q(null)}return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)(S.L7,{icon:(0,r.jsx)(en,{size:15}),title:o.cardTitle??"Knowledge Base",description:o.mindRootHint,children:[(0,r.jsx)(S.D0,{label:(0,r.jsxs)(r.Fragment,{children:[o.mindRoot," ",(0,r.jsx)(S.Bt,{overridden:l.MIND_ROOT})]}),hint:l.MIND_ROOT?o.envNote:o.mindRootHint,children:(0,r.jsx)(S.pd,{value:e.mindRoot,onChange:e=>t(t=>t?{...t,mindRoot:e.target.value}:t),placeholder:"/path/to/your/notes"})}),(0,r.jsx)(S.pM,{label:o.showHiddenFiles,hint:o.showHiddenFilesHint,children:(0,r.jsx)(S.lM,{checked:f,onChange:()=>{let e=!f;v(e),(0,ep.Fo)(e)}})}),null!==j&&j>0&&null===C&&(0,r.jsx)(S.pM,{label:o.cleanupExamples,hint:o.cleanupExamplesHint,children:(0,r.jsxs)("button",{onClick:()=>X(!0),disabled:k,title:k?s.hints.cleanupInProgress:void 0,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors shrink-0 disabled:opacity-50",children:[k?(0,r.jsx)(p.A,{size:12,className:"animate-spin"}):(0,r.jsx)(m.A,{size:12}),o.cleanupExamplesButton,(0,r.jsx)("span",{className:"ml-1 tabular-nums text-2xs opacity-70",children:j})]})}),null!==C&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-xs text-success",children:[(0,r.jsx)(R.A,{size:14}),o.cleanupExamplesDone(C)]})]}),(0,r.jsxs)(S.L7,{icon:(0,r.jsx)(el,{size:15}),title:o.securityTitle??"Security",children:[(0,r.jsx)(S.D0,{label:o.webPassword,hint:o.webPasswordHint,children:(0,r.jsx)(S.yA,{value:e.webPassword??"",onChange:e=>t(t=>t?{...t,webPassword:e}:t),placeholder:o.passwordPlaceholder??"Leave empty to disable"})}),(0,r.jsx)(S.D0,{label:o.authToken,hint:Q?o.authTokenHint:o.authTokenNone,children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 bg-background border border-border rounded-lg min-h-[38px]",children:[(0,r.jsx)("code",{className:"flex-1 text-xs font-mono text-foreground break-all select-all",children:ee||(0,r.jsx)("span",{className:"text-muted-foreground italic",children:o.tokenNotSet??"— not set —"})}),ee&&(0,r.jsx)("button",{type:"button",onClick:function(){let t=J??e.authToken??"";t&&(0,em.l)(t).then(e=>{e&&$.oR.copy()})},className:"shrink-0 p-1 rounded text-muted-foreground hover:text-foreground transition-colors",title:o.authTokenCopy,children:(0,r.jsx)(eo.A,{size:13})})]}),e.mcpPort&&(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:[o.authTokenMcpPort,": ",(0,r.jsx)("code",{className:"font-mono",children:e.mcpPort}),ee&&(0,r.jsxs)(r.Fragment,{children:[" \xa0\xb7\xa0 ",o.mcpUrl??"MCP URL",": ",(0,r.jsx)("code",{className:"font-mono select-all",children:`${H}:${e.mcpPort}/mcp`})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("button",{type:"button",onClick:function(){Y(!0)},disabled:G,title:G?s.hints.tokenResetInProgress:void 0,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[(0,r.jsx)(c.A,{size:14,className:G?"animate-spin":""}),o.authTokenReset]}),Q&&(0,r.jsxs)("button",{type:"button",onClick:es,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-destructive hover:border-destructive/50 transition-colors",children:[(0,r.jsx)(m.A,{size:14}),o.authTokenClear]})]}),J&&(0,r.jsx)("p",{className:"text-xs text-[var(--amber-text)]",children:o.tokenGenerated})]})})]}),null!==z&&(0,r.jsxs)(S.L7,{icon:(0,r.jsx)(n.A,{size:15}),title:s.guide?.title??"Getting Started",children:[(0,r.jsx)(S.pM,{label:s.guide?.showGuide??"Show getting started guide",children:(0,r.jsx)(S.lM,{checked:!M,onChange:()=>I()})}),(0,r.jsxs)("button",{onClick:P,className:"flex items-center gap-1.5 mt-2 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[(0,r.jsx)(h.A,{size:14}),o.restartWalkthrough??"Restart walkthrough"]})]}),(0,r.jsxs)(S.L7,{icon:(0,r.jsx)(ei.A,{size:15}),title:"Embedding Search",description:"Enable semantic search with vector embeddings. Finds notes by meaning, not just exact words.",children:[(0,r.jsx)(S.pM,{label:"Enable embedding search",hint:"Combines keyword matching (BM25) with semantic similarity.",children:(0,r.jsx)(S.lM,{checked:U.enabled,onChange:()=>{t(e=>e?{...e,embedding:{...U,enabled:!U.enabled}}:e)}})}),U.enabled&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>t(e=>e?{...e,embedding:{...U,provider:"local",model:U.model||"Xenova/bge-small-zh-v1.5"}}:e),className:`flex-1 px-3 py-2 text-sm rounded-lg border transition-colors text-center ${"local"===F?"border-[var(--amber)] text-[var(--amber)] bg-[var(--amber)]/10":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:[(0,r.jsx)("span",{className:"font-medium",children:"Local (Free)"}),(0,r.jsx)("span",{className:"block text-xs opacity-70 mt-0.5",children:"Runs on your machine, no API key needed"})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>t(e=>e?{...e,embedding:{...U,provider:"api",model:U.model||"text-embedding-3-small"}}:e),className:`flex-1 px-3 py-2 text-sm rounded-lg border transition-colors text-center ${"api"===F?"border-[var(--amber)] text-[var(--amber)] bg-[var(--amber)]/10":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:[(0,r.jsx)("span",{className:"font-medium",children:"API"}),(0,r.jsx)("span",{className:"block text-xs opacity-70 mt-0.5",children:"OpenAI, DeepSeek, Ollama, etc."})]})]}),"local"===F&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.D0,{label:"Model",hint:"Choose a model. Smaller models are faster.",children:(0,r.jsx)("div",{className:"space-y-1.5",children:[{id:"Xenova/bge-small-zh-v1.5",label:"BGE Small ZH (33MB)",desc:"Chinese + English"},{id:"Xenova/all-MiniLM-L6-v2",label:"MiniLM L6 (23MB)",desc:"English only"},{id:"Xenova/bge-small-en-v1.5",label:"BGE Small EN (33MB)",desc:"English only"}].map(e=>(0,r.jsxs)("label",{className:`flex items-center gap-3 px-3 py-2 rounded-lg border cursor-pointer transition-colors ${U.model===e.id?"border-[var(--amber)] bg-[var(--amber)]/5":"border-border hover:bg-muted"}`,children:[(0,r.jsx)("input",{type:"radio",name:"local-model",checked:U.model===e.id,onChange:()=>t(t=>t?{...t,embedding:{...U,model:e.id}}:t),className:"accent-[var(--amber)]"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.label}),(0,r.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:e.desc})]})]},e.id))})}),!1===L&&!B&&(0,r.jsxs)("button",{type:"button",onClick:K,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-opacity",children:[(0,r.jsx)(u.A,{size:14}),"Download Model"]}),B&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,r.jsx)(p.A,{size:14,className:"animate-spin"}),(0,r.jsx)("span",{children:"Downloading model... This may take a minute."})]}),!0===L&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-xs text-success",children:[(0,r.jsx)(R.A,{size:12}),(0,r.jsx)("span",{children:"Model ready"})]})]}),"api"===F&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"flex gap-2 flex-wrap",children:[{label:"OpenAI",baseUrl:"https://api.openai.com/v1",model:"text-embedding-3-small"},{label:"DeepSeek",baseUrl:"https://api.deepseek.com/v1",model:"deepseek-embed"},{label:"Ollama",baseUrl:"http://localhost:11434/v1",model:"nomic-embed-text"}].map(e=>(0,r.jsx)("button",{type:"button",onClick:()=>{t(t=>t?{...t,embedding:{...U,baseUrl:e.baseUrl,model:e.model}}:t)},className:`px-2.5 py-1 text-xs rounded-md border transition-colors ${U.baseUrl===e.baseUrl?"border-[var(--amber)] text-[var(--amber)] bg-[var(--amber)]/10":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:e.label},e.label))}),(0,r.jsx)(S.D0,{label:"Base URL",hint:"OpenAI-compatible embedding endpoint",children:(0,r.jsx)(S.pd,{value:U.baseUrl,onChange:e=>t(t=>t?{...t,embedding:{...U,baseUrl:e.target.value}}:t),placeholder:"https://api.openai.com/v1"})}),(0,r.jsx)(S.D0,{label:"API Key",hint:"Leave empty for local providers (e.g., Ollama)",children:(0,r.jsx)(S.yA,{value:U.apiKey,onChange:e=>t(t=>t?{...t,embedding:{...U,apiKey:e}}:t),placeholder:"sk-..."})}),(0,r.jsx)(S.D0,{label:"Model",hint:"Embedding model name",children:(0,r.jsx)(S.pd,{value:U.model,onChange:e=>t(t=>t?{...t,embedding:{...U,model:e.target.value}}:t),placeholder:"text-embedding-3-small"})})]}),(0,r.jsx)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground pt-1",children:D.building?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.A,{size:12,className:"animate-spin"}),(0,r.jsx)("span",{children:"Building embedding index..."})]}):D.ready?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(R.A,{size:12,className:"text-success"}),(0,r.jsxs)("span",{children:[D.docCount," documents indexed"]})]}):(0,r.jsx)("span",{children:"Index will be built on first search"})})]})]}),(0,r.jsx)(S.L7,{icon:(0,r.jsx)(ed,{size:15}),title:i.labsTitle??"Labs",description:i.labsDesc??"Experimental features that are still in development.",children:(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(ev,{label:i.labsEcho??"Echo",description:i.labsEchoDesc??"Reflective journaling powered by your notes.",checked:d,onChange:e=>{x(e),localStorage.setItem("mindos:labs-echo",e?"1":"0"),window.dispatchEvent(new Event("mindos:labs-changed"))}}),(0,r.jsx)(ev,{label:i.labsWorkflows??"Flows",description:i.labsWorkflowsDesc??"Visual workflow automation for agents.",checked:g,onChange:e=>{b(e),localStorage.setItem("mindos:labs-workflows",e?"1":"0"),window.dispatchEvent(new Event("mindos:labs-changed"))}})]})}),(0,r.jsx)(ej,{k:o}),(0,r.jsx)(eu.TM,{open:W,title:o.authTokenReset??"Regenerate Token",message:o.authTokenResetConfirm,confirmLabel:o.authTokenReset??"Regenerate",cancelLabel:o.cancel??"Cancel",onConfirm:()=>{Y(!1),et()},onCancel:()=>Y(!1)}),(0,r.jsx)(eu.TM,{open:Z,title:o.cleanupExamples??"Cleanup Examples",message:null!==j?o.cleanupExamplesConfirm(j):"",confirmLabel:o.cleanupExamplesButton??"Clean up",cancelLabel:o.cancel??"Cancel",variant:"destructive",onConfirm:async()=>{X(!1),w(!0);let e=await eb();w(!1),e.success&&(A(e.deleted),N(0))},onCancel:()=>X(!1)})]})}function ev({label:e,description:t,checked:s,onChange:a}){return(0,r.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer group",children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-foreground block",children:e}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:t})]}),(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":s,onClick:()=>a(!s),className:`relative w-9 h-5 rounded-full transition-colors shrink-0 ${s?"bg-[var(--amber)]":"bg-muted-foreground/20"}`,children:(0,r.jsx)("span",{className:`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white shadow-sm transition-transform ${s?"translate-x-4":"translate-x-0"}`})})]})}function ej({k:e}){let[t,s]=(0,a.useState)(!1),[n,l]=(0,a.useState)(null),[o,i]=(0,a.useState)(!1),d=(0,a.useCallback)(async()=>{i(!0);try{let e=await (0,y.n)("/api/monitoring",{timeout:5e3});l(e)}catch{}i(!1)},[]),c=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{if(!t){c.current=!1;return}c.current||(d(),c.current=!0);let e=setInterval(d,1e4);return()=>clearInterval(e)},[t,d]),(0,r.jsxs)("div",{className:"border-t border-border pt-5",children:[(0,r.jsxs)("button",{onClick:()=>s(e=>!e),className:"flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors w-full",children:[t?(0,r.jsx)(X.A,{size:14}):(0,r.jsx)(Q.A,{size:14}),(0,r.jsx)(ec.A,{size:12}),e.monitoringTitle??"System Monitoring",o&&(0,r.jsx)(p.A,{size:10,className:"animate-spin ml-1"})]}),t&&n&&(0,r.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-x-6 gap-y-2 text-xs",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorHeap??"Heap"}),(0,r.jsxs)("span",{className:"ml-2 tabular-nums",children:[ex(n.system.memory.heapUsed)," / ",ex(n.system.memory.heapTotal)]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorRss??"RSS"}),(0,r.jsx)("span",{className:"ml-2 tabular-nums",children:ex(n.system.memory.rss)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorUptime??"Uptime"}),(0,r.jsx)("span",{className:"ml-2 tabular-nums",children:function(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let s=Math.floor(t/60);if(s<60)return`${s}m ${t%60}s`;let r=Math.floor(s/60);if(r<24)return`${r}h ${s%60}m`;let a=Math.floor(r/24);return`${a}d ${r%24}h`}(n.system.uptimeMs)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorNode??"Node"}),(0,r.jsx)("span",{className:"ml-2",children:n.system.nodeVersion})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorRequests??"Requests"}),(0,r.jsx)("span",{className:"ml-2 tabular-nums",children:n.application.agentRequests})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorToolCalls??"Tool Calls"}),(0,r.jsx)("span",{className:"ml-2 tabular-nums",children:n.application.toolExecutions})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorTokens??"Tokens"}),(0,r.jsx)("span",{className:"ml-2 tabular-nums",children:(n.application.totalTokens.input+n.application.totalTokens.output).toLocaleString()})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorFiles??"Files"}),(0,r.jsxs)("span",{className:"ml-2 tabular-nums",children:[n.knowledgeBase.fileCount," (",ex(n.knowledgeBase.totalSizeBytes),")"]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"MCP"}),(0,r.jsx)("span",{className:"ml-2",children:n.mcp.running?e.monitorMcpRunning?.(n.mcp.port)??`Running :${n.mcp.port}`:e.monitorMcpStopped??"Stopped"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorErrors??"Errors"}),(0,r.jsx)("span",{className:"ml-2 tabular-nums",children:n.application.errors})]})]}),t&&!n&&!o&&(0,r.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:e.monitoringFailed??"Failed to load monitoring data"})]})}var ey=s(402),eN=s(10762),ek=s(439),ew=s(15411),eS=s(7915),eC=s(70617),eA=s(51914),ez=s(49387);let eT=(0,s(37206).default)(()=>Promise.all([s.e(3013),s.e(3637)]).then(s.bind(s,63637)),{loadableGenerated:{webpack:()=>[63637]},ssr:!1});function eM({skill:e,expanded:t,onExpand:s,onToggle:a,onDelete:n,onEditStart:l,onEditSave:o,onEditCancel:i,editing:d,editContent:c,setEditContent:u,editError:h,saving:g,fullContent:b,loadingContent:f,loadErrors:v,m:j}){return(0,r.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>s(e.name),children:[t?(0,r.jsx)(X.A,{size:12}):(0,r.jsx)(Q.A,{size:12}),(0,r.jsx)("span",{className:"text-xs font-medium flex-1",children:e.name}),(0,r.jsx)("span",{className:`text-2xs px-1.5 py-0.5 rounded ${"builtin"===e.source?"bg-muted text-muted-foreground":"bg-[var(--amber-subtle)] text-[var(--amber-text)]"}`,children:"builtin"===e.source?j?.skillBuiltin??"Built-in":j?.skillUser??"Custom"}),(0,r.jsx)(S.lM,{size:"sm",checked:e.enabled,onClick:t=>{t.stopPropagation(),a(e.name,!e.enabled)}})]}),t&&(0,r.jsxs)("div",{className:"px-3 py-2 border-t border-border text-xs space-y-2 bg-muted/20",children:[(0,r.jsx)("p",{className:"text-muted-foreground",children:e.description||"No description"}),(0,r.jsx)("p",{className:"text-muted-foreground font-mono text-2xs",children:e.path}),f===e.name?(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,r.jsx)(p.A,{size:10,className:"animate-spin"}),(0,r.jsx)("span",{className:"text-2xs",children:"Loading..."})]}):b[e.name]?(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-2xs text-muted-foreground font-medium",children:j?.skillContent??"Content"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[e.editable&&d!==e.name&&(0,r.jsxs)("button",{onClick:()=>l(e.name),className:"flex items-center gap-1 text-2xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,r.jsx)(ez.A,{size:10}),j?.editSkill??"Edit"]}),e.editable&&(0,r.jsxs)("button",{onClick:()=>n(e.name),className:"flex items-center gap-1 text-2xs text-destructive hover:underline",children:[(0,r.jsx)(m.A,{size:10}),j?.deleteSkill??"Delete"]})]})]}),d===e.name?(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)("textarea",{value:c,onChange:e=>u(e.target.value),rows:Math.min(20,(c.match(/\n/g)||[]).length+3),className:"w-full px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring resize-y font-mono"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("button",{onClick:()=>o(e.name),disabled:g,className:"flex items-center gap-1 px-2.5 py-1 text-xs rounded-md disabled:opacity-40 disabled:cursor-not-allowed transition-colors bg-[var(--amber)] text-[var(--amber-foreground)]",children:[g&&(0,r.jsx)(p.A,{size:10,className:"animate-spin"}),j?.saveSkill??"Save"]}),(0,r.jsx)("button",{onClick:i,className:"px-2.5 py-1 text-xs rounded-md border border-border text-muted-foreground hover:text-foreground transition-colors",children:j?.cancelSkill??"Cancel"})]}),h&&(0,r.jsxs)("p",{className:"text-2xs text-destructive flex items-center gap-1",children:[(0,r.jsx)(x.A,{size:10}),h]})]}):(0,r.jsx)("div",{className:"w-full rounded-md border border-border bg-background/50 max-h-[300px] overflow-y-auto px-2.5 py-1.5 text-xs [&_.prose]:max-w-none [&_.prose]:text-xs [&_h1]:text-sm [&_h2]:text-xs [&_h3]:text-xs [&_pre]:text-2xs [&_code]:text-2xs",children:(0,r.jsx)(eT,{content:function(e){if(!e.startsWith("---"))return e;let t=e.indexOf("\n---",3);return -1===t?e:e.slice(t+4).replace(/^\n+/,"")}(b[e.name])})})]}):v[e.name]?(0,r.jsxs)("p",{className:"text-2xs text-destructive flex items-center gap-1",children:[(0,r.jsx)(x.A,{size:10}),v[e.name]]}):null]})]})}let eE=e=>`---
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1768],{439:(e,t,s)=>{s.d(t,{A:()=>r});let r=(0,s(90425).A)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},27006:(e,t,s)=>{s.r(t),s.d(t,{default:()=>tm});var r=s(95155),a=s(12115),n=s(86901),l=s(68806),o=s(89363),i=s(90425);let d=(0,i.A)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);var c=s(91958),u=s(6962),m=s(68459),x=s(13545),p=s(6296),h=s(9199),g=s(12651),b=s(33210),f=s(94961),v=s(73321),j=s(35581),y=s(22356),N=s(22164),k=s(49619),w=s(92972),S=s(20171),C=s(47376),A=s(51842),z=s(79704),T=s(60112);function M(e,t=[],s,r){let a=C.T_[e],n="zh"===r?a.nameZh:a.name,l=new Set(t.filter(e=>e&&e!==s).map(e=>e.trim().toLowerCase()));if(!l.has(n.trim().toLowerCase()))return n;let o=2;for(;l.has(`${n} ${o}`.toLowerCase());)o++;return`${n} ${o}`}function E({form:e,t,locale:s,layout:a="full"}){let n=C.T_[e.protocol],l="zh"===s?"名称":"Name",o="zh"===s?"协议":"Protocol",i="zh"===s?"可选,默认使用协议名称":"Optional, defaults to protocol name",d=e.isDuplicateName?"zh"===s?"名称已存在":"Name already exists":void 0;return(0,r.jsxs)("div",{className:"space-y-3",children:["compact"===a?(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,r.jsx)(S.D0,{label:l,hint:d,hintError:e.isDuplicateName,children:(0,r.jsx)(S.pd,{value:e.name,onChange:t=>e.setName(t.target.value),placeholder:i,autoFocus:!0})}),(0,r.jsx)(S.D0,{label:o,children:(0,r.jsx)(S.l6,{value:e.protocol,onChange:t=>e.setProtocol(t.target.value),children:C.jt.map(e=>(0,r.jsx)("option",{value:e,children:"zh"===s?C.T_[e].nameZh:C.T_[e].name},e))})})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.D0,{label:l,hint:d,hintError:e.isDuplicateName,children:(0,r.jsx)(S.pd,{value:e.name,onChange:t=>e.setName(t.target.value),placeholder:i})}),(0,r.jsx)(S.D0,{label:o,children:(0,r.jsx)(S.l6,{value:e.protocol,onChange:t=>e.setProtocol(t.target.value),children:C.jt.map(e=>(0,r.jsx)("option",{value:e,children:"zh"===s?C.T_[e].nameZh:C.T_[e].name},e))})})]}),(0,r.jsx)(S.D0,{label:"Base URL",children:(0,r.jsx)(S.pd,{value:e.baseUrl,onChange:t=>e.setBaseUrl(t.target.value),placeholder:n.fixedBaseUrl||"https://api.example.com/v1"})}),(0,r.jsx)(S.D0,{label:(0,r.jsxs)(r.Fragment,{children:["API Key ",(0,r.jsx)("span",{className:"text-muted-foreground/50 font-normal",children:"zh"===s?"(可选)":"(optional)"})]}),children:(0,r.jsx)(S.yA,{value:e.apiKey,onChange:e.setApiKey,placeholder:"sk-..."})}),(0,r.jsx)(S.D0,{label:"zh"===s?"模型":"Model",children:(0,r.jsx)(z.A,{value:e.model,onChange:e.setModel,placeholder:n.defaultModel,provider:e.protocol,apiKey:e.apiKey,baseUrl:e.baseUrl,supportsListModels:!!e.baseUrl.trim(),allowNoKey:!0,browseLabel:t.settings.ai.listModels,noModelsLabel:t.settings.ai.noModelsFound})})]})}var R=s(94514),I=s(53961);function P({result:e,disabled:t,onTest:s,t:a}){let n="testing"===e.state,l="ok"===e.state,o="error"===e.state;return(0,r.jsxs)("button",{type:"button",disabled:t||n,onClick:s,className:`inline-flex items-center gap-1.5 px-3.5 py-1.5 text-sm font-medium rounded-lg transition-all duration-200 disabled:cursor-not-allowed ${l?"bg-success/10 text-success border border-success/20":o?"bg-destructive/8 text-destructive border border-destructive/20 hover:bg-destructive/12":"border border-border text-muted-foreground hover:text-foreground hover:border-foreground/20 disabled:opacity-40"}`,children:[n?(0,r.jsx)(p.A,{size:13,className:"animate-spin"}):l?(0,r.jsx)(R.A,{size:13}):o?(0,r.jsx)(x.A,{size:13}):(0,r.jsx)(I.A,{size:13}),n?a.settings.ai.testKeyTesting:l&&null!=e.latency?a.settings.ai.testKeyOk(e.latency):o?function(e,t){switch(t){case"auth_error":return e.settings.ai.testKeyAuthError;case"model_not_found":return e.settings.ai.testKeyModelNotFound;case"endpoint_error":return e.settings.ai.testKeyEndpointError;case"rate_limited":return e.settings.ai.testKeyRateLimited;case"network_error":return e.settings.ai.testKeyNetworkError;default:return e.settings.ai.testKeyUnknown}}(a,e.code):a.settings.ai.testKey]})}var U=s(41585),$=s(4235);let D={checking:!1,available:null,isSelf:!1,suggestion:null};function F({label:e,hint:t,value:s,onChange:n,status:l,onCheckPort:o,m:i}){let d=(0,a.useRef)(void 0);return(0,a.useEffect)(()=>()=>clearTimeout(d.current),[]),(0,r.jsxs)("div",{className:"space-y-1",children:[e&&(0,r.jsx)("label",{className:"text-xs font-medium text-foreground",children:e}),t&&(0,r.jsx)("p",{className:"text-2xs text-muted-foreground",children:t}),(0,r.jsx)("input",{type:"number",min:1024,max:65535,value:s,onChange:e=>{let t=parseInt(e.target.value,10)||s;n(t),clearTimeout(d.current),t>=1024&&t<=65535&&(d.current=setTimeout(()=>o(t),500))},onBlur:()=>{clearTimeout(d.current),s>=1024&&s<=65535&&o(s)},className:"w-full px-2.5 py-1.5 text-sm rounded-lg border border-border bg-muted/30 text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring tabular-nums"}),l.checking&&(0,r.jsxs)("p",{className:"text-xs flex items-center gap-1 text-muted-foreground",children:[(0,r.jsx)(p.A,{size:11,className:"animate-spin"})," ",i.portChecking]}),!l.checking&&!1===l.available&&!l.invalid&&(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("p",{className:"text-xs flex items-center gap-1 text-[var(--amber)]",children:[(0,r.jsx)(U.A,{size:11})," ",i.portInUse(s)]}),null!==l.suggestion&&(0,r.jsx)("button",{type:"button",onClick:()=>{n(l.suggestion),setTimeout(()=>o(l.suggestion),0)},className:"text-xs px-2 py-0.5 rounded border border-[var(--amber)] text-[var(--amber)] transition-colors hover:bg-[var(--amber-subtle)]",children:i.portSuggest(l.suggestion)})]}),!l.checking&&l.invalid&&(0,r.jsxs)("p",{className:"text-xs flex items-center gap-1 text-destructive",children:[(0,r.jsx)(U.A,{size:11})," 1024 – 65535"]}),!l.checking&&!0===l.available&&(0,r.jsxs)("p",{className:"text-xs flex items-center gap-1 text-success",children:[(0,r.jsx)(g.A,{size:11})," ",l.isSelf?i.portSelf:i.portAvailable]})]})}function L({message:e,sub:t}){return(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"text-center space-y-4 max-w-sm px-6",children:[(0,r.jsx)(p.A,{size:32,className:"animate-spin mx-auto text-[var(--amber)]"}),(0,r.jsx)("p",{className:"text-sm font-medium text-foreground",children:e}),t&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:t})]})})}function O({m:e}){let[t,s]=(0,a.useState)(0),[n,l]=(0,a.useState)(0),[o,i]=(0,a.useState)(D),[d,c]=(0,a.useState)(!1),[u,m]=(0,a.useState)(null),[x,p]=(0,a.useState)(void 0),h=(0,a.useRef)(void 0);(0,a.useEffect)(()=>{(0,y.n)("/api/settings").then(e=>{let t=e.port||3456;s(t),l(t)}).catch(()=>{})},[]),(0,a.useEffect)(()=>()=>clearInterval(h.current),[]);let g=n!==t,b=n<1024||n>65535,f=o.checking||!1===o.available&&!o.isSelf,v=(0,a.useCallback)(async e=>{if(e<1024||e>65535)return void i({...D,available:!1,invalid:!0});i({...D,checking:!0});try{let t=await (0,y.n)("/api/setup/check-port",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({port:e})});i({checking:!1,available:t.available,isSelf:t.isSelf??!1,suggestion:t.suggestion??null})}catch{i(D)}},[]),j=async()=>{if(g&&!b&&!f&&!d){c(!0);try{let t=await (0,y.n)("/api/setup/check-port",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({port:n})});if(!t.available&&!t.isSelf){i({checking:!1,available:!1,isSelf:!1,suggestion:t.suggestion??null}),c(!1),$.oR.error(e.portInUse(n));return}await (0,y.n)("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({port:n})}),m(e.portWebRestarting),p(e.portRedirecting);try{await (0,y.n)("/api/restart",{method:"POST"})}catch{}let s=`${window.location.protocol}//${window.location.hostname}:${n}`,r=Date.now()+3e4;h.current=setInterval(async()=>{if(Date.now()>r){clearInterval(h.current),m(null),c(!1),$.oR.error(e.portRestartTimeout);return}try{(await fetch(`${s}/api/health`,{signal:AbortSignal.timeout(2e3)})).ok&&(clearInterval(h.current),window.location.href=s)}catch{}},1500)}catch{c(!1),$.oR.error(e.portUpdateFailed)}}};return 0===t?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5 px-4 pt-4 pb-3",children:[(0,r.jsx)("div",{className:"w-7 h-7 rounded-lg bg-muted flex items-center justify-center shrink-0",children:(0,r.jsx)(w.A,{size:14,className:"text-muted-foreground"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:e.webPortLabel}),(0,r.jsx)("p",{className:"text-2xs text-muted-foreground",children:e.webPortHint})]})]}),(0,r.jsxs)("div",{className:"px-4 pb-4 space-y-3",children:[(0,r.jsx)(F,{label:"",hint:"",value:n,onChange:e=>{l(e),i(D)},status:o,onCheckPort:v,m:e}),(0,r.jsx)("button",{type:"button",onClick:j,disabled:!g||b||f||d,className:"w-full py-2 rounded-lg text-xs font-medium transition-colors bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:d?e.portUpdating:e.portUpdateBtn})]})]}),u&&(0,r.jsx)(L,{message:u,sub:x})]})}function B({data:e,updateAi:t,updateAgent:s,t:l}){let{locale:o}=(0,j.Y)(),i=e.envOverrides??{},d=e.ai.providers.find(t=>t.id===e.ai.activeProvider),c=d?C.T_[d.protocol]:null,[u,m]=(0,a.useState)({}),[p,h]=(0,a.useState)(!1),g=(0,a.useRef)(void 0),b=(0,a.useRef)(e.ai.activeProvider);(0,a.useEffect)(()=>{b.current!==e.ai.activeProvider&&(b.current=e.ai.activeProvider,m({}),g.current&&(clearTimeout(g.current),g.current=void 0))},[e.ai.activeProvider]),(0,a.useEffect)(()=>()=>{g.current&&clearTimeout(g.current)},[]),(0,a.useEffect)(()=>{let t=e.agent?.reconnectRetries??3;try{localStorage.setItem("mindos-reconnect-retries",String(t))}catch(e){console.warn("[AiTab] localStorage setItem reconnectRetries failed:",e)}},[e.agent?.reconnectRetries]);let f=(0,a.useCallback)(async()=>{if(!d)return;let e=d.id;m(t=>({...t,[e]:{state:"testing"}}));try{let t={provider:d.protocol};d.apiKey&&(t.apiKey=d.apiKey),d.model&&(t.model=d.model),d.baseUrl&&(t.baseUrl=d.baseUrl);let s=await fetch("/api/settings/test-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await s.json();r.ok?(m(t=>({...t,[e]:{state:"ok",latency:r.latency}})),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{m(t=>({...t,[e]:{state:"idle"}}))},8e3)):m(t=>({...t,[e]:{state:"error",error:r.error,code:r.code}}))}catch{m(t=>({...t,[e]:{state:"error",code:"network_error",error:"Network error"}}))}},[d]),v=(0,a.useCallback)(s=>{d&&("apiKey"in s&&m(e=>({...e,[d.id]:{state:"idle"}})),t({providers:e.ai.providers.map(e=>e.id===d.id?{...e,...s}:e)}))},[d,e.ai.providers,t]),y=d?(0,C.Ux)(d.protocol):void 0,w=!!y&&i[y],M=!!c?.apiKeyFallback,E=(0,a.useCallback)(()=>{if(!d)return;let s=C.T_[d.protocol];m(e=>({...e,[d.id]:{state:"idle"}})),t({providers:e.ai.providers.map(e=>e.id===d.id?{...e,apiKey:"",model:"",baseUrl:s?.fixedBaseUrl??""}:e)})},[d,e.ai.providers,t]),R=(0,a.useCallback)(()=>{if(!d)return;let s=e.ai.providers.filter(e=>e.id!==d.id);t({activeProvider:s.length>0?s[0].id:"",providers:s}),m(e=>{let t={...e};return delete t[d.id],t})},[d,e.ai.providers,t]),I=(0,a.useCallback)(s=>{let r={id:s.id||(0,T.mV)(),name:s.name,protocol:s.protocol,apiKey:s.apiKey,model:s.model,baseUrl:s.baseUrl};t({activeProvider:r.id,providers:[...e.ai.providers,r]}),h(!1)},[e.ai.providers,t]),P=d?.name??("zh"===o?"未选择":"No provider");return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)(S.L7,{icon:(0,r.jsx)(n.A,{size:15}),title:l.settings.ai.provider,description:P,children:[(0,r.jsx)(A.A,{value:e.ai.activeProvider,onChange:e=>{"skip"!==e&&t({activeProvider:e}),h(!1)},compact:!0,customProviders:e.ai.providers,onAdd:()=>{let t=C.T_.openai,s="zh"===o?t.nameZh:t.name,r=new Set(e.ai.providers.map(e=>e.name.toLowerCase())),a=s;if(r.has(a.toLowerCase())){let e=2;for(;r.has(`${s} (${e})`.toLowerCase());)e++;a=`${s} (${e})`}h(!0)}}),p&&(0,r.jsx)(K,{onSave:I,onCancel:()=>h(!1),t:l,existingNames:e.ai.providers.map(e=>e.name)},"new"),!p&&d&&(0,r.jsxs)("div",{className:"space-y-3 pt-3 border-t border-border",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,r.jsx)(S.D0,{label:"zh"===o?"名称":"Name",children:(0,r.jsx)(S.pd,{value:d.name,onChange:e=>v({name:e.target.value}),placeholder:"zh"===o?"输入名称":"Enter name"})}),(0,r.jsx)(S.D0,{label:"zh"===o?"协议":"Protocol",children:(0,r.jsx)(S.l6,{value:d.protocol,onChange:e=>v({protocol:e.target.value}),children:C.jt.map(e=>(0,r.jsx)("option",{value:e,children:"zh"===o?C.T_[e].nameZh:C.T_[e].name},e))})})]}),(0,r.jsxs)(S.D0,{label:(0,r.jsxs)(r.Fragment,{children:[l.settings.ai.apiKey," ",y&&(0,r.jsx)(S.Bt,{overridden:i[y]})]}),hint:c&&w?l.settings.ai.envFieldNote(y):c&&M?l.settings.ai.keyOptionalHint:void 0,children:[(0,r.jsx)(S.yA,{value:d.apiKey,onChange:e=>v({apiKey:e}),placeholder:"sk-..."}),c?.signupUrl&&!d.apiKey&&!w&&(0,r.jsxs)("a",{href:c.signupUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs mt-1.5 hover:underline",style:{color:"var(--amber)"},children:[(0,r.jsx)(N.A,{size:10}),M?"zh"===o?`下载 ${c.nameZh}`:`Download ${c.name}`:"zh"===o?`获取 ${c.nameZh} API Key`:`Get ${c.name} API Key`]})]}),(c?.supportsBaseUrl||d.baseUrl)&&(0,r.jsx)(S.D0,{label:"Base URL",children:(0,r.jsx)(S.pd,{value:d.baseUrl,onChange:e=>v({baseUrl:e.target.value}),placeholder:c?.fixedBaseUrl||(0,C.Ot)(d.protocol)||"https://api.openai.com/v1"})}),(0,r.jsx)(S.D0,{label:"zh"===o?"模型":"Model",children:(0,r.jsx)(z.A,{value:d.model,onChange:e=>v({model:e}),placeholder:c?.defaultModel??"",provider:d.protocol,apiKey:d.apiKey,envKey:!!w,baseUrl:d.baseUrl,supportsListModels:!!d.baseUrl?.trim()||!!c?.supportsListModels,allowNoKey:!!d.baseUrl?.trim(),browseLabel:l.settings.ai.listModels,noModelsLabel:l.settings.ai.noModelsFound})}),(0,r.jsx)(_,{provider:d.protocol,result:u[d.id]??{state:"idle"},hasKey:!!d.apiKey,hasEnv:!!w,hasConfig:!!(d.apiKey||d.model||d.baseUrl),onTest:f,onReset:E,onDelete:R,t:l})]}),!p&&Object.values(i).some(Boolean)&&(0,r.jsxs)("div",{className:"flex items-start gap-2 text-xs text-[var(--amber)] bg-[var(--amber-subtle)] border border-[var(--amber)]/20 rounded-lg px-3 py-2.5",children:[(0,r.jsx)(x.A,{size:13,className:"shrink-0 mt-0.5"}),(0,r.jsx)("span",{children:l.settings.ai.envHint})]})]}),(0,r.jsxs)(S.L7,{icon:(0,r.jsx)(k.A,{size:15}),title:l.settings.agent.title,description:l.settings.agent.subtitle??"Configure how the AI agent operates",children:[(0,r.jsx)(S.pM,{label:l.settings.agent.maxSteps,hint:l.settings.agent.maxStepsHint,children:(0,r.jsxs)(S.l6,{value:String(e.agent?.maxSteps??20),onChange:e=>s({maxSteps:Number(e.target.value)}),className:"w-20",children:[(0,r.jsx)("option",{value:"5",children:"5"}),(0,r.jsx)("option",{value:"10",children:"10"}),(0,r.jsx)("option",{value:"15",children:"15"}),(0,r.jsx)("option",{value:"20",children:"20"}),(0,r.jsx)("option",{value:"25",children:"25"}),(0,r.jsx)("option",{value:"30",children:"30"})]})}),(0,r.jsx)(S.pM,{label:l.settings.agent.contextStrategy,hint:l.settings.agent.contextStrategyHint,children:(0,r.jsxs)(S.l6,{value:e.agent?.contextStrategy??"auto",onChange:e=>s({contextStrategy:e.target.value}),className:"w-24",children:[(0,r.jsx)("option",{value:"auto",children:l.settings.agent.contextStrategyAuto}),(0,r.jsx)("option",{value:"off",children:l.settings.agent.contextStrategyOff})]})}),(0,r.jsx)(S.pM,{label:l.settings.agent.reconnectRetries,hint:l.settings.agent.reconnectRetriesHint,children:(0,r.jsxs)(S.l6,{value:String(e.agent?.reconnectRetries??3),onChange:e=>{let t=Number(e.target.value);s({reconnectRetries:t});try{localStorage.setItem("mindos-reconnect-retries",String(t))}catch(e){console.warn("[AiTab] localStorage setItem reconnectRetries failed:",e)}},className:"w-20",children:[(0,r.jsx)("option",{value:"0",children:"Off"}),(0,r.jsx)("option",{value:"1",children:"1"}),(0,r.jsx)("option",{value:"2",children:"2"}),(0,r.jsx)("option",{value:"3",children:"3"}),(0,r.jsx)("option",{value:"5",children:"5"}),(0,r.jsx)("option",{value:"10",children:"10"})]})}),c?.supportsThinking&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.pM,{label:l.settings.agent.thinking,hint:l.settings.agent.thinkingHint,children:(0,r.jsx)(S.lM,{checked:e.agent?.enableThinking??!1,onChange:()=>s({enableThinking:!e.agent?.enableThinking})})}),e.agent?.enableThinking&&(0,r.jsx)(S.D0,{label:l.settings.agent.thinkingBudget,hint:l.settings.agent.thinkingBudgetHint,children:(0,r.jsx)(S.pd,{type:"number",value:String(e.agent?.thinkingBudget??5e3),onChange:e=>{let t=parseInt(e.target.value,10);isNaN(t)||s({thinkingBudget:Math.max(1e3,Math.min(5e4,t))})},min:1e3,max:5e4,step:1e3})})]})]}),(0,r.jsx)(O,{m:l.settings?.mcp??{}}),(0,r.jsx)(H,{})]})}function _({provider:e,result:t,hasKey:s,hasEnv:n,hasConfig:l,onTest:o,onReset:i,onDelete:d,t:c}){let[u,x]=(0,a.useState)(null),p=(0,a.useRef)(void 0),g=!!C.T_[e]?.apiKeyFallback;(0,a.useEffect)(()=>()=>{p.current&&clearTimeout(p.current)},[]);let b=e=>{u===e?("reset"===e?i?.():d?.(),x(null),p.current&&clearTimeout(p.current)):(x(e),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>x(null),3e3))},{locale:f}=(0,j.Y)();return(0,r.jsx)("div",{className:"space-y-2 pt-2",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)(P,{result:t,disabled:!(s||n||g),onTest:o,t:c}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[i&&l&&(0,r.jsxs)("button",{type:"button",onClick:()=>b("reset"),onBlur:()=>{"reset"===u&&(x(null),p.current&&clearTimeout(p.current))},className:`inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg transition-all duration-200 ${"reset"===u?"bg-destructive/10 text-destructive border border-destructive/25 font-medium":"text-muted-foreground/60 hover:text-muted-foreground hover:bg-muted/50"}`,children:[(0,r.jsx)(h.A,{size:12}),"reset"===u?"zh"===f?"确认重置?":"Confirm?":"zh"===f?"重置":"Reset"]}),d&&(0,r.jsxs)("button",{type:"button",onClick:()=>b("delete"),onBlur:()=>{"delete"===u&&(x(null),p.current&&clearTimeout(p.current))},className:`inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg transition-all duration-200 ${"delete"===u?"bg-destructive/10 text-destructive border border-destructive/25 font-medium":"text-muted-foreground/60 hover:text-muted-foreground hover:bg-muted/50"}`,children:[(0,r.jsx)(m.A,{size:12}),"delete"===u?"zh"===f?"确认删除?":"Confirm?":"zh"===f?"删除":"Delete"]})]})]})})}function K({initial:e,onSave:t,onCancel:s,onDelete:n,t:l,existingNames:o}){let{locale:i}=(0,j.Y)(),d=function({initial:e,onSave:t,locale:s,existingNames:r}){let n=(0,a.useMemo)(()=>e?.name??M(e?.protocol??"openai",r,e?.name,s),[e?.name,e?.protocol,r,s]),[l,o]=(0,a.useState)(n),[i,d]=(0,a.useState)(e?.protocol??"openai"),[c,u]=(0,a.useState)(e?.apiKey??""),[m,x]=(0,a.useState)(e?.model??""),[p,h]=(0,a.useState)(e?.baseUrl??""),[g,b]=(0,a.useState)({state:"idle"}),[f,v]=(0,a.useState)(!!e?.name),j=(0,a.useMemo)(()=>M(i,r,e?.name,s),[i,r,e?.name,s]);(0,a.useEffect)(()=>{f||o(j)},[j,f]);let y=(0,a.useCallback)(e=>{v(!0),o(e)},[]),N=(0,a.useCallback)(e=>{d(e),b({state:"idle"})},[]),k=l.trim()||j,w=!!(k&&r?.some(t=>t!==e?.name&&t.toLowerCase()===k.toLowerCase())),S=!!(p.trim()&&m.trim()&&!w),C="zh"===s?"接口地址和模型为必填":"Base URL and model are required",A="zh"===s?"名称已存在,请使用其他名称":"Name already exists, please use a different name",z=(0,a.useCallback)(async()=>{if(w)return void b({state:"error",error:A});if(!p.trim()||!m.trim())return void b({state:"error",error:C});b({state:"testing"});try{let t=await fetch("/api/settings/test-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e?.id?{provider:e.id,apiKey:c,model:m,baseUrl:p}:{provider:i,apiKey:c,model:m,baseUrl:p,baseProviderId:i})}),s=await t.json();s.ok?b({state:"ok",latency:s.latency}):b({state:"error",error:s.error||"Test failed",code:s.code})}catch{b({state:"error",code:"network_error",error:"Network error"})}},[w,A,p,m,e?.id,c,i,C]),E=(0,a.useCallback)(()=>{w?b({state:"error",error:A}):p.trim()&&m.trim()?t({id:e?.id||(0,T.mV)(),name:k,protocol:i,apiKey:c,model:m.trim(),baseUrl:p.trim()}):b({state:"error",error:C})},[w,A,p,m,C,t,e?.id,k,i,c]);return{name:l,setName:y,protocol:i,setProtocol:N,apiKey:c,setApiKey:u,model:m,setModel:x,baseUrl:p,setBaseUrl:h,testResult:g,canSave:S,isDuplicateName:w,handleTest:z,handleSave:E}}({initial:e,onSave:t,locale:i,existingNames:o}),[c,u]=(0,a.useState)(!1),x=(0,a.useRef)(void 0);(0,a.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]);let p=e?.id?"zh"===i?"编辑 Provider":"Edit Provider":"zh"===i?"添加 Provider":"Add Provider",h=[];return d.name.trim()||h.push("zh"===i?"名称":"Name"),d.baseUrl.trim()||h.push("zh"===i?"接口地址":"Base URL"),d.model.trim()||h.push("zh"===i?"模型":"Model"),(0,r.jsxs)("div",{className:"mt-3 rounded-lg border border-border overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:p}),(0,r.jsx)("button",{type:"button",onClick:s,className:"p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors","aria-label":"zh"===i?"关闭":"Close",children:(0,r.jsx)(b.A,{size:14})})]}),(0,r.jsxs)("div",{className:"p-4",children:[(0,r.jsx)(E,{form:d,t:l,locale:i,layout:"compact"}),(0,r.jsxs)("div",{className:"flex items-center gap-2 pt-4",children:[(0,r.jsx)(P,{result:d.testResult,disabled:!d.canSave,onTest:d.handleTest,t:l}),n&&e?.id&&(0,r.jsxs)("button",{type:"button",onClick:()=>{c?(n(),x.current&&clearTimeout(x.current)):(u(!0),x.current=setTimeout(()=>u(!1),3e3))},onBlur:()=>{u(!1),x.current&&clearTimeout(x.current)},className:`inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg transition-all duration-200 ${c?"bg-destructive/10 text-destructive border border-destructive/25 font-medium":"text-muted-foreground/60 hover:text-muted-foreground hover:bg-muted/50"}`,children:[(0,r.jsx)(m.A,{size:12}),c?"zh"===i?"确认删除?":"Confirm?":"zh"===i?"删除":"Delete"]}),(0,r.jsxs)("div",{className:"flex-1",children:[d.isDuplicateName&&(0,r.jsx)("span",{className:"text-2xs text-destructive pl-2",children:"zh"===i?"名称已存在":"Name already exists"}),!d.isDuplicateName&&!d.canSave&&h.length>0&&(0,r.jsx)("span",{className:"text-2xs text-muted-foreground/60 pl-2",children:"zh"===i?`需要: ${h.join("、")}`:`Required: ${h.join(", ")}`})]}),(0,r.jsx)("button",{type:"button",onClick:s,className:"px-3 py-1.5 text-sm rounded-lg text-muted-foreground hover:text-foreground transition-colors",children:l.settings?.customProviders?.modal?.buttonCancel??"Cancel"}),(0,r.jsx)("button",{type:"button",onClick:d.handleSave,disabled:!d.canSave,className:"px-4 py-1.5 text-sm font-medium rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] hover:bg-[var(--amber)]/90 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"zh"===i?"保存":"Save"})]})]})]})}function H(){let{t:e}=(0,j.Y)(),[t,s]=(0,a.useState)("panel");return(0,a.useEffect)(()=>{try{let e=localStorage.getItem("ask-mode");"popup"===e&&s("popup")}catch(e){console.warn("[AiTab] localStorage getItem ask-mode failed:",e)}},[]),(0,r.jsx)(S.L7,{icon:(0,r.jsx)(w.A,{size:15}),title:e.settings.askDisplayMode?.label??"Display Mode",description:e.settings.askDisplayMode?.hint??"Side panel stays docked on the right. Popup opens a floating dialog.",children:(0,r.jsxs)(S.l6,{value:t,onChange:e=>(e=>{s(e);try{localStorage.setItem("ask-mode",e)}catch(e){console.warn("[AiTab] localStorage setItem ask-mode failed:",e)}window.dispatchEvent(new StorageEvent("storage",{key:"ask-mode",newValue:e}))})(e.target.value),children:[(0,r.jsx)("option",{value:"panel",children:e.settings.askDisplayMode?.panel??"Side Panel"}),(0,r.jsx)("option",{value:"popup",children:e.settings.askDisplayMode?.popup??"Popup"})]})})}var G=s(51900),V=s(36999),J=s(92451),q=s(97810);let W=(0,i.A)("type",[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]),Y=(0,i.A)("a-large-small",[["path",{d:"m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16",key:"xik6mr"}],["path",{d:"M15.697 14h5.606",key:"1stdlc"}],["path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16",key:"d5nyq2"}],["path",{d:"M3.304 13h6.392",key:"1q3zxz"}]]),Z=(0,i.A)("columns-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);var X=s(66088),Q=s(21362);let ee=[{value:"680px",label:"Narrow",width:42},{value:"780px",label:"Default",width:56},{value:"960px",label:"Wide",width:75},{value:"100%",label:"Full",width:100}],et=[{value:"lora",label:"Lora",category:"Serif",style:{fontFamily:"Lora, Georgia, serif"}},{value:"ibm-plex-sans",label:"IBM Plex Sans",category:"Sans",style:{fontFamily:"'IBM Plex Sans', sans-serif"}},{value:"inter",label:"Inter",category:"Sans",style:{fontFamily:"var(--font-inter), sans-serif"}},{value:"ibm-plex-mono",label:"IBM Plex Mono",category:"Mono",style:{fontFamily:"'IBM Plex Mono', monospace"}}];function es({icon:e,label:t,children:s}){return(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e}),(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:t})]}),s]})}function er({options:e,value:t,onChange:s}){return(0,r.jsx)("div",{className:"flex gap-2",children:e.map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>s(e.value),className:`flex items-center gap-1.5 px-3.5 py-2 text-sm font-medium rounded-xl transition-all ${t===e.value?"bg-[var(--amber)] text-[var(--amber-foreground)] shadow-sm":"bg-muted/50 text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:[e.icon,e.label]},e.value))})}function ea({font:e,setFont:t,fontSize:s,setFontSize:n,contentWidth:l,setContentWidth:o,dark:i,setDark:c,locale:u,setLocale:m,t:x}){let[p,h]=(0,a.useState)(!1),[g,b]=(0,a.useState)(()=>localStorage.getItem("theme")??"system"),[f,v]=(0,a.useState)(()=>localStorage.getItem("locale")??"system"),j=x.settings.appearance;return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)(S.L7,{icon:(0,r.jsx)(d,{size:15}),title:j.preferencesTitle??"Preferences",children:[(0,r.jsx)(es,{icon:(0,r.jsx)(G.A,{size:14}),label:j.colorTheme,children:(0,r.jsx)(er,{options:[{value:"system",label:j.system,icon:(0,r.jsx)(w.A,{size:14})},{value:"dark",label:j.dark,icon:(0,r.jsx)(V.A,{size:14})},{value:"light",label:j.light,icon:(0,r.jsx)(G.A,{size:14})}],value:g,onChange:e=>{b(e),localStorage.setItem("theme",e);let t="system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches:"dark"===e;c(t),document.documentElement.classList.toggle("dark",t)}})}),(0,r.jsx)(es,{icon:(0,r.jsx)(J.A,{size:14}),label:j.language,children:(0,r.jsx)(er,{options:[{value:"system",label:j.system,icon:(0,r.jsx)(w.A,{size:14})},{value:"en",label:"EN"},{value:"zh",label:"中文"}],value:f,onChange:e=>{v(e),localStorage.setItem("locale",e);let t="system"===e?navigator.language.startsWith("zh")?"zh":"en":e;m(t),document.cookie=`locale=${t};path=/;max-age=31536000;SameSite=Lax`}})})]}),(0,r.jsxs)(S.L7,{icon:(0,r.jsx)(q.A,{size:15}),title:j.readingTitle??"Reading",description:j.readingDesc??"Customize how your notes look",children:[(0,r.jsx)(es,{icon:(0,r.jsx)(W,{size:14}),label:j.readingFont,children:(0,r.jsx)("div",{className:"space-y-0.5",children:et.map(s=>{let a=e===s.value;return(0,r.jsxs)("button",{type:"button",onClick:()=>t(s.value),className:`flex items-center gap-4 w-full px-3 py-2.5 rounded-lg transition-all text-left relative ${a?"bg-[var(--amber-subtle)]":"hover:bg-muted/50"}`,children:[a&&(0,r.jsx)("div",{className:"absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full bg-[var(--amber)]"}),(0,r.jsx)("span",{className:`text-xl font-medium w-10 text-center shrink-0 ${a?"text-foreground":"text-muted-foreground/60"}`,style:{fontFamily:s.style.fontFamily},children:"Aa"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,r.jsx)("span",{className:`text-sm font-medium ${a?"text-foreground":"text-muted-foreground"}`,style:{fontFamily:s.style.fontFamily},children:s.label}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground/50",children:s.category})]}),(0,r.jsx)("p",{className:`text-sm truncate mt-0.5 ${a?"text-muted-foreground":"text-muted-foreground/40"}`,style:{fontFamily:s.style.fontFamily},children:j.fontPreview})]})]},s.value)})})}),(0,r.jsx)(es,{icon:(0,r.jsx)(Y,{size:14}),label:j.fontSize,children:(0,r.jsxs)("div",{className:"px-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground/60 shrink-0",style:{fontSize:"11px"},children:"A"}),(0,r.jsx)("input",{type:"range",min:14,max:17,step:1,value:parseInt(s),onChange:e=>n(`${e.target.value}px`),className:"flex-1 h-1.5 rounded-full appearance-none bg-muted cursor-pointer accent-[var(--amber)] [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[var(--amber)] [&::-webkit-slider-thumb]:shadow-sm [&::-webkit-slider-thumb]:cursor-pointer [&::-webkit-slider-thumb]:transition-transform [&::-webkit-slider-thumb]:hover:scale-110 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-[var(--amber)] [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:shadow-sm [&::-moz-range-thumb]:cursor-pointer"}),(0,r.jsx)("span",{className:"text-base text-muted-foreground/60 shrink-0",children:"A"})]}),(0,r.jsx)("div",{className:"text-center mt-1.5",children:(0,r.jsxs)("span",{className:"text-xs tabular-nums text-muted-foreground",children:[parseInt(s),"px"]})}),(0,r.jsx)("p",{className:"text-muted-foreground leading-relaxed mt-2 px-1",style:{fontSize:s,fontFamily:et.find(t=>t.value===e)?.style.fontFamily},children:j.fontSizePreview})]})}),(0,r.jsx)(es,{icon:(0,r.jsx)(Z,{size:14}),label:j.contentWidth,children:(0,r.jsx)("div",{className:"space-y-1",children:ee.map(e=>{let t=l===e.value;return(0,r.jsxs)("button",{type:"button",onClick:()=>o(e.value),className:`flex items-center gap-3 w-full px-3 py-2 rounded-lg transition-all ${t?"bg-[var(--amber-subtle)]":"hover:bg-muted/50"}`,children:[(0,r.jsx)("div",{className:"flex-1 h-2 rounded-full bg-muted/40 overflow-hidden",children:(0,r.jsx)("div",{className:`h-full rounded-full transition-all ${t?"bg-[var(--amber)]":"bg-muted-foreground/20"}`,style:{width:`${e.width}%`}})}),(0,r.jsx)("span",{className:`text-sm shrink-0 w-14 text-right ${t?"text-foreground font-medium":"text-muted-foreground"}`,children:e.label})]},e.value)})})})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground/40 px-0.5",children:j.browserNote}),(0,r.jsxs)("div",{className:"border-t border-border pt-4",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>h(!p),className:"flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:[p?(0,r.jsx)(X.A,{size:14}):(0,r.jsx)(Q.A,{size:14}),x.settings.tabs.shortcuts]}),p&&(0,r.jsx)("div",{className:"mt-3 space-y-0.5",children:x.shortcuts.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center justify-between py-1.5 px-1",children:[(0,r.jsx)("span",{className:"text-sm text-foreground",children:e.description}),(0,r.jsx)("div",{className:"flex items-center gap-1",children:e.keys.map((e,t)=>(0,r.jsx)("kbd",{className:"px-1.5 py-0.5 text-2xs font-mono bg-muted border border-border rounded text-muted-foreground",children:e},t))})]},t))})]})]})}let en=(0,i.A)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),el=(0,i.A)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);var eo=s(67635),ei=s(61878);let ed=(0,i.A)("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);var ec=s(65576),eu=s(39498),em=s(7834);function ex(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<0x40000000?`${(e/1048576).toFixed(1)} MB`:`${(e/0x40000000).toFixed(2)} GB`}var ep=s(56811),eh=s(9339);let eg=(0,eh.createServerReference)("002c79b10da7b686f6b350532ac99b1a77fe215ffe",eh.callServer,void 0,eh.findSourceMapURL,"scanExampleFilesAction"),eb=(0,eh.createServerReference)("002a2b9edd38a7833a1a3441e1faa643fce4ba62cc",eh.callServer,void 0,eh.findSourceMapURL,"cleanupExamplesAction");function ef({data:e,setData:t,t:s}){let l=e.envOverrides??{},o=s.settings.knowledge,i=s.settings.appearance,[d,x]=(0,a.useState)(()=>"1"===localStorage.getItem("mindos:labs-echo")),[g,b]=(0,a.useState)(()=>"1"===localStorage.getItem("mindos:labs-workflows")),[f,v]=(0,a.useState)(()=>"true"===localStorage.getItem("show-hidden-files")),[j,N]=(0,a.useState)(null),[k,w]=(0,a.useState)(!1),[C,A]=(0,a.useState)(null);(0,a.useEffect)(()=>{eg().then(e=>N(e.files.length)).catch(e=>{console.warn("[KnowledgeTab] scanExampleFilesAction failed:",e)})},[]);let[z,T]=(0,a.useState)(null),[M,E]=(0,a.useState)(!1);(0,a.useEffect)(()=>{(0,y.n)("/api/setup").then(e=>{let t=e.guideState;t&&(T(t.active),E(!!t.dismissed))}).catch(e=>{console.error("Failed to fetch guide state:",e)})},[]);let I=(0,a.useCallback)(()=>{let e=!M;E(e);let t={dismissed:e};e||(t.active=!0),(0,y.n)("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:t})}).then(()=>window.dispatchEvent(new Event("guide-state-updated"))).catch(t=>{console.error("Failed to update guide state:",t),E(!e)})},[M]),P=(0,a.useCallback)(()=>{(0,y.n)("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:{active:!0,dismissed:!1,walkthroughStep:0,walkthroughDismissed:!1}})}).then(()=>{T(!0),E(!1),window.dispatchEvent(new Event("guide-state-updated"))}).catch(e=>console.error("Failed to restart walkthrough:",e))},[]),U=e.embedding??{enabled:!1,provider:"local",baseUrl:"",apiKey:"",model:""},D=e.embeddingStatus??{enabled:!1,ready:!1,building:!1,docCount:0},F=U.provider||"local",[L,O]=(0,a.useState)(null),[B,_]=(0,a.useState)(!1);(0,a.useEffect)(()=>{U.enabled&&"local"===F&&(0,y.n)("/api/embedding").then(e=>O(e.downloaded)).catch(()=>O(!1))},[U.enabled,F]),(0,a.useEffect)(()=>{if(!B)return;let e=setInterval(()=>{(0,y.n)("/api/embedding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"status"})}).then(e=>{e.downloaded&&(O(!0),_(!1),$.oR.success?.("Model downloaded successfully")??(0,$.oR)("Model downloaded")),e.error&&(_(!1),$.oR.error?.(e.error)??(0,$.oR)(e.error))}).catch(()=>{})},3e3);return()=>clearInterval(e)},[B]);let K=(0,a.useCallback)(()=>{_(!0),(0,y.n)("/api/embedding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"download",model:U.model||void 0})}).catch(()=>_(!1))},[U.model]),H=(0,a.useSyncExternalStore)(()=>()=>{},()=>`${window.location.protocol}//${window.location.hostname}`,()=>"http://localhost"),[G,V]=(0,a.useState)(!1),[J,q]=(0,a.useState)(null),[W,Y]=(0,a.useState)(!1),[Z,X]=(0,a.useState)(!1),Q=!!e.authToken,ee=J??e.authToken??"";async function et(){V(!0);try{let e=await (0,y.n)("/api/settings/reset-token",{method:"POST"});q(e.token),t(t=>t?{...t,authToken:e.token}:t)}finally{V(!1)}}async function es(){t(e=>e?{...e,authToken:""}:e),q(null)}return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)(S.L7,{icon:(0,r.jsx)(en,{size:15}),title:o.cardTitle??"Knowledge Base",description:o.mindRootHint,children:[(0,r.jsx)(S.D0,{label:(0,r.jsxs)(r.Fragment,{children:[o.mindRoot," ",(0,r.jsx)(S.Bt,{overridden:l.MIND_ROOT})]}),hint:l.MIND_ROOT?o.envNote:o.mindRootHint,children:(0,r.jsx)(S.pd,{value:e.mindRoot,onChange:e=>t(t=>t?{...t,mindRoot:e.target.value}:t),placeholder:"/path/to/your/notes"})}),(0,r.jsx)(S.pM,{label:o.showHiddenFiles,hint:o.showHiddenFilesHint,children:(0,r.jsx)(S.lM,{checked:f,onChange:()=>{let e=!f;v(e),(0,ep.Fo)(e)}})}),null!==j&&j>0&&null===C&&(0,r.jsx)(S.pM,{label:o.cleanupExamples,hint:o.cleanupExamplesHint,children:(0,r.jsxs)("button",{onClick:()=>X(!0),disabled:k,title:k?s.hints.cleanupInProgress:void 0,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors shrink-0 disabled:opacity-50",children:[k?(0,r.jsx)(p.A,{size:12,className:"animate-spin"}):(0,r.jsx)(m.A,{size:12}),o.cleanupExamplesButton,(0,r.jsx)("span",{className:"ml-1 tabular-nums text-2xs opacity-70",children:j})]})}),null!==C&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-xs text-success",children:[(0,r.jsx)(R.A,{size:14}),o.cleanupExamplesDone(C)]})]}),(0,r.jsxs)(S.L7,{icon:(0,r.jsx)(el,{size:15}),title:o.securityTitle??"Security",children:[(0,r.jsx)(S.D0,{label:o.webPassword,hint:o.webPasswordHint,children:(0,r.jsx)(S.yA,{value:e.webPassword??"",onChange:e=>t(t=>t?{...t,webPassword:e}:t),placeholder:o.passwordPlaceholder??"Leave empty to disable"})}),(0,r.jsx)(S.D0,{label:o.authToken,hint:Q?o.authTokenHint:o.authTokenNone,children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 bg-background border border-border rounded-lg min-h-[38px]",children:[(0,r.jsx)("code",{className:"flex-1 text-xs font-mono text-foreground break-all select-all",children:ee||(0,r.jsx)("span",{className:"text-muted-foreground italic",children:o.tokenNotSet??"— not set —"})}),ee&&(0,r.jsx)("button",{type:"button",onClick:function(){let t=J??e.authToken??"";t&&(0,em.l)(t).then(e=>{e&&$.oR.copy()})},className:"shrink-0 p-1 rounded text-muted-foreground hover:text-foreground transition-colors",title:o.authTokenCopy,children:(0,r.jsx)(eo.A,{size:13})})]}),e.mcpPort&&(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:[o.authTokenMcpPort,": ",(0,r.jsx)("code",{className:"font-mono",children:e.mcpPort}),ee&&(0,r.jsxs)(r.Fragment,{children:[" \xa0\xb7\xa0 ",o.mcpUrl??"MCP URL",": ",(0,r.jsx)("code",{className:"font-mono select-all",children:`${H}:${e.mcpPort}/mcp`})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("button",{type:"button",onClick:function(){Y(!0)},disabled:G,title:G?s.hints.tokenResetInProgress:void 0,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[(0,r.jsx)(c.A,{size:14,className:G?"animate-spin":""}),o.authTokenReset]}),Q&&(0,r.jsxs)("button",{type:"button",onClick:es,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-destructive hover:border-destructive/50 transition-colors",children:[(0,r.jsx)(m.A,{size:14}),o.authTokenClear]})]}),J&&(0,r.jsx)("p",{className:"text-xs text-[var(--amber-text)]",children:o.tokenGenerated})]})})]}),null!==z&&(0,r.jsxs)(S.L7,{icon:(0,r.jsx)(n.A,{size:15}),title:s.guide?.title??"Getting Started",children:[(0,r.jsx)(S.pM,{label:s.guide?.showGuide??"Show getting started guide",children:(0,r.jsx)(S.lM,{checked:!M,onChange:()=>I()})}),(0,r.jsxs)("button",{onClick:P,className:"flex items-center gap-1.5 mt-2 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[(0,r.jsx)(h.A,{size:14}),o.restartWalkthrough??"Restart walkthrough"]})]}),(0,r.jsxs)(S.L7,{icon:(0,r.jsx)(ei.A,{size:15}),title:"Embedding Search",description:"Enable semantic search with vector embeddings. Finds notes by meaning, not just exact words.",children:[(0,r.jsx)(S.pM,{label:"Enable embedding search",hint:"Combines keyword matching (BM25) with semantic similarity.",children:(0,r.jsx)(S.lM,{checked:U.enabled,onChange:()=>{t(e=>e?{...e,embedding:{...U,enabled:!U.enabled}}:e)}})}),U.enabled&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>t(e=>e?{...e,embedding:{...U,provider:"local",model:U.model||"Xenova/bge-small-zh-v1.5"}}:e),className:`flex-1 px-3 py-2 text-sm rounded-lg border transition-colors text-center ${"local"===F?"border-[var(--amber)] text-[var(--amber)] bg-[var(--amber)]/10":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:[(0,r.jsx)("span",{className:"font-medium",children:"Local (Free)"}),(0,r.jsx)("span",{className:"block text-xs opacity-70 mt-0.5",children:"Runs on your machine, no API key needed"})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>t(e=>e?{...e,embedding:{...U,provider:"api",model:U.model||"text-embedding-3-small"}}:e),className:`flex-1 px-3 py-2 text-sm rounded-lg border transition-colors text-center ${"api"===F?"border-[var(--amber)] text-[var(--amber)] bg-[var(--amber)]/10":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:[(0,r.jsx)("span",{className:"font-medium",children:"API"}),(0,r.jsx)("span",{className:"block text-xs opacity-70 mt-0.5",children:"OpenAI, DeepSeek, Ollama, etc."})]})]}),"local"===F&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.D0,{label:"Model",hint:"Choose a model. Smaller models are faster.",children:(0,r.jsx)("div",{className:"space-y-1.5",children:[{id:"Xenova/bge-small-zh-v1.5",label:"BGE Small ZH (33MB)",desc:"Chinese + English"},{id:"Xenova/all-MiniLM-L6-v2",label:"MiniLM L6 (23MB)",desc:"English only"},{id:"Xenova/bge-small-en-v1.5",label:"BGE Small EN (33MB)",desc:"English only"}].map(e=>(0,r.jsxs)("label",{className:`flex items-center gap-3 px-3 py-2 rounded-lg border cursor-pointer transition-colors ${U.model===e.id?"border-[var(--amber)] bg-[var(--amber)]/5":"border-border hover:bg-muted"}`,children:[(0,r.jsx)("input",{type:"radio",name:"local-model",checked:U.model===e.id,onChange:()=>t(t=>t?{...t,embedding:{...U,model:e.id}}:t),className:"accent-[var(--amber)]"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.label}),(0,r.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:e.desc})]})]},e.id))})}),!1===L&&!B&&(0,r.jsxs)("button",{type:"button",onClick:K,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-opacity",children:[(0,r.jsx)(u.A,{size:14}),"Download Model"]}),B&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,r.jsx)(p.A,{size:14,className:"animate-spin"}),(0,r.jsx)("span",{children:"Downloading model... This may take a minute."})]}),!0===L&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-xs text-success",children:[(0,r.jsx)(R.A,{size:12}),(0,r.jsx)("span",{children:"Model ready"})]})]}),"api"===F&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"flex gap-2 flex-wrap",children:[{label:"OpenAI",baseUrl:"https://api.openai.com/v1",model:"text-embedding-3-small"},{label:"DeepSeek",baseUrl:"https://api.deepseek.com/v1",model:"deepseek-embed"},{label:"Ollama",baseUrl:"http://localhost:11434/v1",model:"nomic-embed-text"}].map(e=>(0,r.jsx)("button",{type:"button",onClick:()=>{t(t=>t?{...t,embedding:{...U,baseUrl:e.baseUrl,model:e.model}}:t)},className:`px-2.5 py-1 text-xs rounded-md border transition-colors ${U.baseUrl===e.baseUrl?"border-[var(--amber)] text-[var(--amber)] bg-[var(--amber)]/10":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:e.label},e.label))}),(0,r.jsx)(S.D0,{label:"Base URL",hint:"OpenAI-compatible embedding endpoint",children:(0,r.jsx)(S.pd,{value:U.baseUrl,onChange:e=>t(t=>t?{...t,embedding:{...U,baseUrl:e.target.value}}:t),placeholder:"https://api.openai.com/v1"})}),(0,r.jsx)(S.D0,{label:"API Key",hint:"Leave empty for local providers (e.g., Ollama)",children:(0,r.jsx)(S.yA,{value:U.apiKey,onChange:e=>t(t=>t?{...t,embedding:{...U,apiKey:e}}:t),placeholder:"sk-..."})}),(0,r.jsx)(S.D0,{label:"Model",hint:"Embedding model name",children:(0,r.jsx)(S.pd,{value:U.model,onChange:e=>t(t=>t?{...t,embedding:{...U,model:e.target.value}}:t),placeholder:"text-embedding-3-small"})})]}),(0,r.jsx)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground pt-1",children:D.building?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.A,{size:12,className:"animate-spin"}),(0,r.jsx)("span",{children:"Building embedding index..."})]}):D.ready?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(R.A,{size:12,className:"text-success"}),(0,r.jsxs)("span",{children:[D.docCount," documents indexed"]})]}):(0,r.jsx)("span",{children:"Index will be built on first search"})})]})]}),(0,r.jsx)(S.L7,{icon:(0,r.jsx)(ed,{size:15}),title:i.labsTitle??"Labs",description:i.labsDesc??"Experimental features that are still in development.",children:(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(ev,{label:i.labsEcho??"Echo",description:i.labsEchoDesc??"Reflective journaling powered by your notes.",checked:d,onChange:e=>{x(e),localStorage.setItem("mindos:labs-echo",e?"1":"0"),window.dispatchEvent(new Event("mindos:labs-changed"))}}),(0,r.jsx)(ev,{label:i.labsWorkflows??"Flows",description:i.labsWorkflowsDesc??"Visual workflow automation for agents.",checked:g,onChange:e=>{b(e),localStorage.setItem("mindos:labs-workflows",e?"1":"0"),window.dispatchEvent(new Event("mindos:labs-changed"))}})]})}),(0,r.jsx)(ej,{k:o}),(0,r.jsx)(eu.TM,{open:W,title:o.authTokenReset??"Regenerate Token",message:o.authTokenResetConfirm,confirmLabel:o.authTokenReset??"Regenerate",cancelLabel:o.cancel??"Cancel",onConfirm:()=>{Y(!1),et()},onCancel:()=>Y(!1)}),(0,r.jsx)(eu.TM,{open:Z,title:o.cleanupExamples??"Cleanup Examples",message:null!==j?o.cleanupExamplesConfirm(j):"",confirmLabel:o.cleanupExamplesButton??"Clean up",cancelLabel:o.cancel??"Cancel",variant:"destructive",onConfirm:async()=>{X(!1),w(!0);let e=await eb();w(!1),e.success&&(A(e.deleted),N(0))},onCancel:()=>X(!1)})]})}function ev({label:e,description:t,checked:s,onChange:a}){return(0,r.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer group",children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-foreground block",children:e}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:t})]}),(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":s,onClick:()=>a(!s),className:`relative w-9 h-5 rounded-full transition-colors shrink-0 ${s?"bg-[var(--amber)]":"bg-muted-foreground/20"}`,children:(0,r.jsx)("span",{className:`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white shadow-sm transition-transform ${s?"translate-x-4":"translate-x-0"}`})})]})}function ej({k:e}){let[t,s]=(0,a.useState)(!1),[n,l]=(0,a.useState)(null),[o,i]=(0,a.useState)(!1),d=(0,a.useCallback)(async()=>{i(!0);try{let e=await (0,y.n)("/api/monitoring",{timeout:5e3});l(e)}catch{}i(!1)},[]),c=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{if(!t){c.current=!1;return}c.current||(d(),c.current=!0);let e=setInterval(d,1e4);return()=>clearInterval(e)},[t,d]),(0,r.jsxs)("div",{className:"border-t border-border pt-5",children:[(0,r.jsxs)("button",{onClick:()=>s(e=>!e),className:"flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors w-full",children:[t?(0,r.jsx)(X.A,{size:14}):(0,r.jsx)(Q.A,{size:14}),(0,r.jsx)(ec.A,{size:12}),e.monitoringTitle??"System Monitoring",o&&(0,r.jsx)(p.A,{size:10,className:"animate-spin ml-1"})]}),t&&n&&(0,r.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-x-6 gap-y-2 text-xs",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorHeap??"Heap"}),(0,r.jsxs)("span",{className:"ml-2 tabular-nums",children:[ex(n.system.memory.heapUsed)," / ",ex(n.system.memory.heapTotal)]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorRss??"RSS"}),(0,r.jsx)("span",{className:"ml-2 tabular-nums",children:ex(n.system.memory.rss)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorUptime??"Uptime"}),(0,r.jsx)("span",{className:"ml-2 tabular-nums",children:function(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let s=Math.floor(t/60);if(s<60)return`${s}m ${t%60}s`;let r=Math.floor(s/60);if(r<24)return`${r}h ${s%60}m`;let a=Math.floor(r/24);return`${a}d ${r%24}h`}(n.system.uptimeMs)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorNode??"Node"}),(0,r.jsx)("span",{className:"ml-2",children:n.system.nodeVersion})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorRequests??"Requests"}),(0,r.jsx)("span",{className:"ml-2 tabular-nums",children:n.application.agentRequests})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorToolCalls??"Tool Calls"}),(0,r.jsx)("span",{className:"ml-2 tabular-nums",children:n.application.toolExecutions})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorTokens??"Tokens"}),(0,r.jsx)("span",{className:"ml-2 tabular-nums",children:(n.application.totalTokens.input+n.application.totalTokens.output).toLocaleString()})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorFiles??"Files"}),(0,r.jsxs)("span",{className:"ml-2 tabular-nums",children:[n.knowledgeBase.fileCount," (",ex(n.knowledgeBase.totalSizeBytes),")"]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"MCP"}),(0,r.jsx)("span",{className:"ml-2",children:n.mcp.running?e.monitorMcpRunning?.(n.mcp.port)??`Running :${n.mcp.port}`:e.monitorMcpStopped??"Stopped"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:e.monitorErrors??"Errors"}),(0,r.jsx)("span",{className:"ml-2 tabular-nums",children:n.application.errors})]})]}),t&&!n&&!o&&(0,r.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:e.monitoringFailed??"Failed to load monitoring data"})]})}var ey=s(402),eN=s(10762),ek=s(439),ew=s(15411),eS=s(7915),eC=s(70617),eA=s(51914),ez=s(49387);let eT=(0,s(37206).default)(()=>Promise.all([s.e(3013),s.e(3637)]).then(s.bind(s,63637)),{loadableGenerated:{webpack:()=>[63637]},ssr:!1});function eM({skill:e,expanded:t,onExpand:s,onToggle:a,onDelete:n,onEditStart:l,onEditSave:o,onEditCancel:i,editing:d,editContent:c,setEditContent:u,editError:h,saving:g,fullContent:b,loadingContent:f,loadErrors:v,m:j}){return(0,r.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>s(e.name),children:[t?(0,r.jsx)(X.A,{size:12}):(0,r.jsx)(Q.A,{size:12}),(0,r.jsx)("span",{className:"text-xs font-medium flex-1",children:e.name}),(0,r.jsx)("span",{className:`text-2xs px-1.5 py-0.5 rounded ${"builtin"===e.source?"bg-muted text-muted-foreground":"bg-[var(--amber-subtle)] text-[var(--amber-text)]"}`,children:"builtin"===e.source?j?.skillBuiltin??"Built-in":j?.skillUser??"Custom"}),(0,r.jsx)(S.lM,{size:"sm",checked:e.enabled,onClick:t=>{t.stopPropagation(),a(e.name,!e.enabled)}})]}),t&&(0,r.jsxs)("div",{className:"px-3 py-2 border-t border-border text-xs space-y-2 bg-muted/20",children:[(0,r.jsx)("p",{className:"text-muted-foreground",children:e.description||"No description"}),(0,r.jsx)("p",{className:"text-muted-foreground font-mono text-2xs",children:e.path}),f===e.name?(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,r.jsx)(p.A,{size:10,className:"animate-spin"}),(0,r.jsx)("span",{className:"text-2xs",children:"Loading..."})]}):b[e.name]?(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-2xs text-muted-foreground font-medium",children:j?.skillContent??"Content"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[e.editable&&d!==e.name&&(0,r.jsxs)("button",{onClick:()=>l(e.name),className:"flex items-center gap-1 text-2xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,r.jsx)(ez.A,{size:10}),j?.editSkill??"Edit"]}),e.editable&&(0,r.jsxs)("button",{onClick:()=>n(e.name),className:"flex items-center gap-1 text-2xs text-destructive hover:underline",children:[(0,r.jsx)(m.A,{size:10}),j?.deleteSkill??"Delete"]})]})]}),d===e.name?(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)("textarea",{value:c,onChange:e=>u(e.target.value),rows:Math.min(20,(c.match(/\n/g)||[]).length+3),className:"w-full px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring resize-y font-mono"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("button",{onClick:()=>o(e.name),disabled:g,className:"flex items-center gap-1 px-2.5 py-1 text-xs rounded-md disabled:opacity-40 disabled:cursor-not-allowed transition-colors bg-[var(--amber)] text-[var(--amber-foreground)]",children:[g&&(0,r.jsx)(p.A,{size:10,className:"animate-spin"}),j?.saveSkill??"Save"]}),(0,r.jsx)("button",{onClick:i,className:"px-2.5 py-1 text-xs rounded-md border border-border text-muted-foreground hover:text-foreground transition-colors",children:j?.cancelSkill??"Cancel"})]}),h&&(0,r.jsxs)("p",{className:"text-2xs text-destructive flex items-center gap-1",children:[(0,r.jsx)(x.A,{size:10}),h]})]}):(0,r.jsx)("div",{className:"w-full rounded-md border border-border bg-background/50 max-h-[300px] overflow-y-auto px-2.5 py-1.5 text-xs [&_.prose]:max-w-none [&_.prose]:text-xs [&_h1]:text-sm [&_h2]:text-xs [&_h3]:text-xs [&_pre]:text-2xs [&_code]:text-2xs",children:(0,r.jsx)(eT,{content:function(e){if(!e.startsWith("---"))return e;let t=e.indexOf("\n---",3);return -1===t?e:e.slice(t+4).replace(/^\n+/,"")}(b[e.name])})})]}):v[e.name]?(0,r.jsxs)("p",{className:"text-2xs text-destructive flex items-center gap-1",children:[(0,r.jsx)(x.A,{size:10}),v[e.name]]}):null]})]})}let eE=e=>`---
|
|
2
2
|
name: ${e}
|
|
3
3
|
description: >
|
|
4
4
|
Describe WHEN the agent should use this
|
package/_standalone/.next/static/chunks/{4878.ad1f431d34ff03fc.js → 1937.e178266395104aa3.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1937],{51937:(e,s,t)=>{t.r(s),t.d(s,{default:()=>h});var a=t(95155),r=t(12115),n=t(47650),i=t(33210),l=t(86901),o=t(41585),c=t(38798),d=t(6296),u=t(73321),m=t(91337),x=t(9339);let p=(0,x.createServerReference)("70419f305533c76addb37678969d8346b90abbc86d",x.callServer,void 0,x.findSourceMapURL,"createSpaceAction");var b=t(5292),f=t(70620);function h({t:e,dirPaths:s}){let t=(0,u.useRouter)(),[x,h]=(0,r.useState)(!1),[g,v]=(0,r.useState)(""),[N,j]=(0,r.useState)(""),[w,y]=(0,r.useState)(""),[k,S]=(0,r.useState)(!1),[C,A]=(0,r.useState)(""),[E,I]=(0,r.useState)(""),[L,z]=(0,r.useState)(null),[R,D]=(0,r.useState)(!0),K=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=()=>{h(!0),A(""),I(""),setTimeout(()=>K.current?.focus(),80)};return window.addEventListener("mindos:create-space",e),()=>window.removeEventListener("mindos:create-space",e)},[]),(0,r.useEffect)(()=>{x&&null===L&&(0,b.w)().then(e=>{z(e),D(e)})},[x,L]);let M=(0,r.useCallback)(()=>{h(!1),v(""),j(""),y(""),A(""),I(""),z(null)},[]),P=(0,r.useCallback)(s=>s.includes("/")||s.includes("\\")?(I(e.home.spaceNameNoSlash??"Name cannot contain / or \\"),!1):(I(""),!0),[e]),T=(0,r.useMemo)(()=>{let e=g.trim();return e?(w?w+"/":"")+e+"/":""},[g,w]),$=(0,r.useCallback)(async()=>{if(!g.trim()||k||!P(g))return;S(!0),A("");let s=g.trim(),a=await p(s,N,w);if(a.success){let e=a.path??s;R&&L&&(0,b.V)(s,e,N),M(),t.refresh(),window.dispatchEvent(new Event("mindos:files-changed")),t.push(`/view/${(0,m.O0)(e+"/")}`)}else(a.error??"").includes("already exists")?A(e.home.spaceExists??"A space with this name already exists"):A(e.home.spaceCreateFailed??"Failed to create space");S(!1)},[g,N,w,k,M,t,e,P,R,L]),_=(0,r.useCallback)(e=>{"Escape"===e.key&&M(),"Enter"===e.key&&!e.shiftKey&&e.target instanceof HTMLInputElement&&(e.preventDefault(),$())},[M,$]);if(!x)return null;let F=e.home;return(0,n.createPortal)((0,a.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",onKeyDown:_,children:[(0,a.jsx)("div",{className:"absolute inset-0 overlay-backdrop",onClick:M}),(0,a.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":F.newSpace,className:"relative w-full max-w-md mx-4 rounded-2xl border border-border bg-card shadow-xl",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-5 pt-5 pb-3",children:[(0,a.jsx)("h3",{className:"text-base font-semibold text-foreground",children:F.newSpace}),(0,a.jsx)("button",{onClick:M,className:"p-1 rounded-md text-muted-foreground hover:bg-muted transition-colors",children:(0,a.jsx)(i.A,{size:14})})]}),(0,a.jsxs)("div",{className:"px-5 pb-5 flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:F.spaceLocation??"Location"}),(0,a.jsx)(f.A,{dirPaths:s,value:w,onChange:y,rootLabel:F.rootLevel??"Root"})]}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:F.spaceName}),(0,a.jsx)("input",{ref:K,type:"text",value:g,onChange:e=>{v(e.target.value),A(""),P(e.target.value)},placeholder:"e.g. \uD83D\uDCDD Notes",maxLength:80,"aria-invalid":!!E,"aria-describedby":E?"space-name-hint":void 0,className:`w-full px-3 py-2 text-sm rounded-lg border bg-background outline-none transition-colors ${E?"border-error focus-visible:border-error":"border-border focus-visible:ring-1 focus-visible:ring-ring"}`}),E&&(0,a.jsx)("span",{id:"space-name-hint",className:"text-xs text-error",children:E})]}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("label",{className:"text-xs font-medium text-muted-foreground",children:[F.spaceDescription," ",(0,a.jsxs)("span",{className:"opacity-50",children:["(",F.optional??"optional",")"]})]}),(0,a.jsx)("input",{type:"text",value:N,onChange:e=>j(e.target.value),placeholder:F.spaceDescPlaceholder??"Describe the purpose of this space",maxLength:200,className:"w-full px-3 py-2 text-sm rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors"})]}),(0,a.jsxs)("div",{className:"flex items-start gap-2.5 px-1 py-1",children:[(0,a.jsx)("button",{type:"button",role:"switch","aria-checked":R,disabled:!L,title:L?void 0:e.hints.configureAiKey,onClick:()=>D(e=>!e),className:`relative mt-0.5 inline-flex shrink-0 h-4 w-7 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 ${R?"bg-[var(--amber)]":"bg-muted"}`,children:(0,a.jsx)("span",{className:`pointer-events-none inline-block h-3 w-3 rounded-full bg-white shadow-sm transition-transform ${R?"translate-x-3":"translate-x-0"}`})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(l.A,{size:12,className:"text-[var(--amber)] shrink-0"}),(0,a.jsx)("span",{className:"text-xs font-medium text-foreground",children:F.aiInit??"AI initialize content"})]}),!1===L&&(0,a.jsxs)("p",{className:"text-2xs text-muted-foreground mt-0.5 flex items-center gap-1",children:[(0,a.jsx)(o.A,{size:10,className:"text-[var(--amber)] shrink-0"}),F.aiInitNoKey??"Configure an API key in Settings → AI to enable"]}),L&&R&&(0,a.jsx)("p",{className:"text-2xs text-muted-foreground mt-0.5",children:F.aiInitHint??"AI will generate README and INSTRUCTION for this space"})]})]}),T&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground font-mono px-1",children:[(0,a.jsx)(c.A,{size:12,className:"shrink-0 text-[var(--amber)]"}),(0,a.jsx)("span",{className:"truncate",children:T})]}),C&&(0,a.jsx)("span",{role:"alert",className:"text-xs text-error px-1",children:C}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-1",children:[(0,a.jsx)("button",{onClick:M,className:"px-4 py-2 rounded-lg text-sm font-medium text-muted-foreground transition-colors hover:bg-muted",children:F.cancelCreate}),(0,a.jsxs)("button",{onClick:$,disabled:!g.trim()||k||!!E,className:"flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-medium bg-[var(--amber)] text-[var(--amber-foreground)] transition-colors hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",children:[k&&(0,a.jsx)(d.A,{size:14,className:"animate-spin"}),F.createSpace]})]})]})]})]}),document.body)}}}]);
|