@geminilight/mindos 0.6.50 β 0.6.52
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 +15 -15
- 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 +1 -1
- 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.js +2 -2
- 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 +11 -6
- package/_standalone/.next/server/app/_global-error.segments/_full.segment.rsc +11 -6
- 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 +6 -1
- package/_standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/_standalone/.next/server/app/_not-found/page.js +2 -2
- 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 +2 -2
- 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 +3 -3
- 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_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/ask/route.js +31 -31
- 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 +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 +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 +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/export/route.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 +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/route.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 +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 +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 +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/inbox/route.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 +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/mcp/agents/route.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/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/uninstall/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/monitoring/route.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/recent-files/route.js +1 -1
- 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 +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 +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_client-reference-manifest.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_client-reference-manifest.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/sync/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/tree-version/route.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 +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/changes/page.js +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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/login/page.js +2 -2
- 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 +2 -2
- 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 +15 -15
- package/_standalone/.next/server/chunks/2190.js +1 -1
- package/_standalone/.next/server/chunks/2673.js +52 -0
- package/_standalone/.next/server/chunks/4241.js +1 -219
- package/_standalone/.next/server/chunks/8408.js +219 -0
- package/_standalone/.next/server/instrumentation.js +1 -1
- 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/next-font-manifest.js +1 -1
- package/_standalone/.next/server/next-font-manifest.json +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/1053-c519cb347faa75e2.js +29 -0
- package/_standalone/.next/static/chunks/{1814.2ee1d03297c0bccd.js β 1814.72f7fe7c61e2b647.js} +1 -1
- package/_standalone/.next/static/chunks/{1880-c2a9e76201841c86.js β 1880-3ec02adc80531825.js} +1 -1
- package/_standalone/.next/static/chunks/6636-9bbc90fb3b8731fe.js +6 -0
- package/_standalone/.next/static/chunks/7035-032641fb6f4e07b2.js +1 -0
- package/_standalone/.next/static/chunks/app/.well-known/agent-card.json/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/_global-error/page-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/agents/[agentKey]/{page-773071a99c4daac2.js β page-074d6aafc2606561.js} +1 -1
- package/_standalone/.next/static/chunks/app/agents/{page-0d9920b591ce999f.js β page-710d8c80fa86e93e.js} +2 -2
- package/_standalone/.next/static/chunks/app/api/a2a/agents/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/a2a/delegations/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/a2a/discover/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/a2a/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/acp/config/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/acp/detect/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/acp/install/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/acp/registry/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/acp/session/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/agent-activity/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/ask/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/ask-sessions/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/auth/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/backlinks/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/bootstrap/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/changes/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/export/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/extract-pdf/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/file/import/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/file/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/files/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/git/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/graph/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/health/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/inbox/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/init/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/agents/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/install/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/install-skill/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/restart/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/status/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/uninstall/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/monitoring/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/recent-files/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/restart/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/search/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/settings/list-models/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/settings/reset-token/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/settings/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/settings/test-key/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/setup/check-path/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/setup/check-port/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/setup/generate-token/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/setup/ls/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/setup/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/skills/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/sync/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/tree-version/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/uninstall/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/update/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/update-check/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/update-status/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/api/workflows/route-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/echo/page-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/{layout-5b51589d4eedab68.js β layout-e706f9a963b177ba.js} +20 -20
- package/_standalone/.next/static/chunks/app/loading-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/page-2595175820acfd65.js +7 -0
- package/_standalone/.next/static/chunks/app/setup/page-99f40e9337388cda.js +1 -0
- package/_standalone/.next/static/chunks/app/trash/page-61c6210fac1e9710.js +1 -0
- package/_standalone/.next/static/chunks/app/view/[...path]/loading-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/app/view/[...path]/page-798359c36f10ef8d.js +12 -0
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-b07a5983e85bc5e3.js +1 -0
- package/_standalone/.next/static/chunks/{webpack-7b276daaa930d480.js β webpack-bbd44cbc83dc0aa4.js} +1 -1
- package/_standalone/.next/static/css/ef1151f74f00d91a.css +1 -0
- package/_standalone/.next/trace +64 -63
- package/_standalone/app/globals.css +1 -1
- package/_standalone/components/ActivityBar.tsx +1 -1
- package/_standalone/components/AskFab.tsx +4 -4
- package/_standalone/components/ExportModal.tsx +4 -1
- package/_standalone/components/FileTree.tsx +13 -5
- package/_standalone/components/Panel.tsx +5 -12
- package/_standalone/components/RightAgentDetailPanel.tsx +5 -4
- package/_standalone/components/RightAskPanel.tsx +5 -4
- package/_standalone/components/agents/AgentsPrimitives.tsx +7 -3
- package/_standalone/components/ask/ProviderModelCapsule.tsx +16 -3
- package/_standalone/components/settings/AiTab.tsx +1 -0
- package/_standalone/components/settings/Primitives.tsx +84 -3
- package/_standalone/instrumentation.ts +3 -1
- package/_standalone/lib/config/animation.ts +76 -0
- package/_standalone/lib/config/icon-scale.ts +35 -0
- package/_standalone/lib/config/panel-sizes.ts +58 -0
- package/_standalone/lib/hooks/useFocusTrap.ts +65 -0
- package/_standalone/lib/i18n/modules/knowledge.ts +16 -8
- package/_standalone/lib/i18n/modules/onboarding.ts +2 -2
- package/_standalone/lib/i18n/modules/settings.ts +4 -0
- package/_standalone/tsconfig.tsbuildinfo +1 -1
- package/app/app/api/ask/route.ts +47 -15
- package/app/app/globals.css +1 -1
- package/app/app/loading.tsx +80 -0
- package/app/app/view/[...path]/loading.tsx +32 -9
- package/app/components/ActivityBar.tsx +1 -1
- package/app/components/AskFab.tsx +4 -4
- package/app/components/ExportModal.tsx +4 -1
- package/app/components/FileTree.tsx +13 -5
- package/app/components/HomeContent.tsx +29 -12
- package/app/components/Panel.tsx +5 -12
- package/app/components/RightAgentDetailPanel.tsx +5 -4
- package/app/components/RightAskPanel.tsx +5 -4
- package/app/components/TrashPageClient.tsx +4 -4
- package/app/components/agents/AgentsPrimitives.tsx +7 -3
- package/app/components/ask/ProviderModelCapsule.tsx +16 -3
- package/app/components/settings/AiTab.tsx +1 -0
- package/app/components/settings/Primitives.tsx +84 -3
- package/app/components/ui/Toaster.tsx +1 -1
- package/app/instrumentation.ts +3 -1
- package/app/lib/config/animation.ts +76 -0
- package/app/lib/config/icon-scale.ts +35 -0
- package/app/lib/config/panel-sizes.ts +58 -0
- package/app/lib/hooks/useFocusTrap.ts +65 -0
- package/app/lib/i18n/modules/knowledge.ts +16 -8
- package/app/lib/i18n/modules/onboarding.ts +2 -2
- package/app/lib/i18n/modules/settings.ts +4 -0
- package/bin/commands/dev.js +10 -0
- package/bin/commands/doctor.js +18 -6
- package/bin/commands/start.js +17 -8
- package/bin/lib/cli-shim.js +166 -0
- package/package.json +1 -1
- package/_standalone/.next/server/chunks/273.js +0 -52
- package/_standalone/.next/server/chunks/6622.js +0 -1
- package/_standalone/.next/static/chunks/1053-8cb7fd1bfbbbedd3.js +0 -29
- package/_standalone/.next/static/chunks/4563-b2a2ce80aff845af.js +0 -6
- package/_standalone/.next/static/chunks/app/.well-known/agent-card.json/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/_global-error/page-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/a2a/agents/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/a2a/delegations/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/a2a/discover/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/a2a/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/acp/config/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/acp/detect/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/acp/install/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/acp/registry/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/acp/session/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/agent-activity/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/ask/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/ask-sessions/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/auth/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/backlinks/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/bootstrap/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/changes/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/export/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/extract-pdf/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/file/import/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/file/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/files/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/git/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/graph/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/health/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/inbox/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/init/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/agents/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/install/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/install-skill/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/restart/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/status/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/uninstall/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/monitoring/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/recent-files/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/restart/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/search/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/settings/list-models/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/settings/reset-token/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/settings/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/settings/test-key/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/setup/check-path/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/setup/check-port/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/setup/generate-token/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/setup/ls/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/setup/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/skills/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/sync/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/tree-version/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/uninstall/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/update/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/update-check/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/update-status/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/api/workflows/route-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/echo/page-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/page-9ba25963d955f3d4.js +0 -7
- package/_standalone/.next/static/chunks/app/setup/page-81c37de31c9a5beb.js +0 -1
- package/_standalone/.next/static/chunks/app/trash/page-20ee39622ea5047a.js +0 -1
- package/_standalone/.next/static/chunks/app/view/[...path]/loading-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/app/view/[...path]/page-67c4bf985a579c77.js +0 -12
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-84943536516b00b2.js +0 -1
- package/_standalone/.next/static/css/bc9179074eaf65ae.css +0 -1
- /package/_standalone/.next/static/{2qUKZF7S693ZZWFgkTSUY β IiTZbEzZo8l5MSUxlDwKp}/_buildManifest.js +0 -0
- /package/_standalone/.next/static/{2qUKZF7S693ZZWFgkTSUY β IiTZbEzZo8l5MSUxlDwKp}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI shim creation + PATH injection for non-Desktop installs.
|
|
3
|
+
* Mirrors desktop/src/install-cli-shim.ts but uses only Node.js APIs (no Electron).
|
|
4
|
+
*
|
|
5
|
+
* Creates ~/.mindos/bin/mindos and injects PATH into shell rc files
|
|
6
|
+
* so AI Agents (Claude Code, Cursor, etc.) can find the `mindos` command.
|
|
7
|
+
*/
|
|
8
|
+
import {
|
|
9
|
+
existsSync,
|
|
10
|
+
readFileSync,
|
|
11
|
+
writeFileSync,
|
|
12
|
+
appendFileSync,
|
|
13
|
+
mkdirSync,
|
|
14
|
+
chmodSync,
|
|
15
|
+
} from 'node:fs';
|
|
16
|
+
import { resolve } from 'node:path';
|
|
17
|
+
import { homedir, platform } from 'node:os';
|
|
18
|
+
import { CLI_PATH } from './constants.js';
|
|
19
|
+
|
|
20
|
+
const SHELL_MARKER = '# MindOS CLI';
|
|
21
|
+
const home = homedir();
|
|
22
|
+
|
|
23
|
+
function shimDir() {
|
|
24
|
+
return resolve(home, '.mindos', 'bin');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function shimPath() {
|
|
28
|
+
return resolve(shimDir(), platform() === 'win32' ? 'mindos.cmd' : 'mindos');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function shellSingleQuote(s) {
|
|
32
|
+
return `'${s.replace(/'/g, `'\"'\"'`)}'`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function writeUnixShim(cliJs) {
|
|
36
|
+
const cliLit = shellSingleQuote(cliJs);
|
|
37
|
+
const script = `#!/bin/sh
|
|
38
|
+
# Generated by MindOS CLI β overwritten on each mindos start.
|
|
39
|
+
|
|
40
|
+
cd "$HOME" 2>/dev/null || true
|
|
41
|
+
|
|
42
|
+
CLI=${cliLit}
|
|
43
|
+
|
|
44
|
+
if [ ! -f "$CLI" ]; then
|
|
45
|
+
NPM_ROOT=$(npm root -g 2>/dev/null)
|
|
46
|
+
NPM_CLI="\${NPM_ROOT}/@geminilight/mindos/bin/cli.js"
|
|
47
|
+
if [ -f "$NPM_CLI" ]; then
|
|
48
|
+
CLI="$NPM_CLI"
|
|
49
|
+
else
|
|
50
|
+
echo "mindos: CLI not found. Reinstall: npm install -g @geminilight/mindos" >&2
|
|
51
|
+
exit 127
|
|
52
|
+
fi
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
if [ -x "$HOME/.mindos/node/bin/node" ]; then
|
|
56
|
+
exec "$HOME/.mindos/node/bin/node" "$CLI" "$@"
|
|
57
|
+
fi
|
|
58
|
+
if command -v node >/dev/null 2>&1; then
|
|
59
|
+
exec node "$CLI" "$@"
|
|
60
|
+
fi
|
|
61
|
+
echo "mindos: Node.js not found. Install Node 18+ or run MindOS Desktop (it installs Node under ~/.mindos/node)." >&2
|
|
62
|
+
exit 127
|
|
63
|
+
`;
|
|
64
|
+
mkdirSync(shimDir(), { recursive: true });
|
|
65
|
+
writeFileSync(shimPath(), script, 'utf-8');
|
|
66
|
+
try { chmodSync(shimPath(), 0o755); } catch { /* ignore */ }
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Append ~/.mindos/bin to PATH in relevant shell rc files (idempotent).
|
|
71
|
+
* AI Agents run commands via non-interactive shells:
|
|
72
|
+
* - Non-interactive zsh reads ~/.zshenv (NOT ~/.zshrc)
|
|
73
|
+
* - Non-interactive bash reads ~/.bashrc (some systems) or nothing
|
|
74
|
+
* - Fish reads ~/.config/fish/conf.d/*.fish always
|
|
75
|
+
*/
|
|
76
|
+
function appendPathToShellRc() {
|
|
77
|
+
if (platform() === 'win32') return false;
|
|
78
|
+
|
|
79
|
+
const block = `\n${SHELL_MARKER}\nexport PATH="$HOME/.mindos/bin:$PATH"\n`;
|
|
80
|
+
|
|
81
|
+
const targets =
|
|
82
|
+
platform() === 'darwin'
|
|
83
|
+
? [
|
|
84
|
+
{ name: '.zshenv', mustCreate: true },
|
|
85
|
+
{ name: '.zshrc', mustCreate: false },
|
|
86
|
+
{ name: '.bashrc', mustCreate: true },
|
|
87
|
+
{ name: '.bash_profile', mustCreate: false },
|
|
88
|
+
]
|
|
89
|
+
: [
|
|
90
|
+
{ name: '.bashrc', mustCreate: true },
|
|
91
|
+
{ name: '.zshenv', mustCreate: true },
|
|
92
|
+
{ name: '.zshrc', mustCreate: false },
|
|
93
|
+
{ name: '.profile', mustCreate: false },
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
let appended = false;
|
|
97
|
+
|
|
98
|
+
for (const { name, mustCreate } of targets) {
|
|
99
|
+
const full = resolve(home, name);
|
|
100
|
+
const fileExists = existsSync(full);
|
|
101
|
+
|
|
102
|
+
if (!fileExists && !mustCreate) continue;
|
|
103
|
+
|
|
104
|
+
if (fileExists) {
|
|
105
|
+
try {
|
|
106
|
+
const content = readFileSync(full, 'utf-8');
|
|
107
|
+
if (content.includes(SHELL_MARKER) || content.includes('# MindOS Desktop')
|
|
108
|
+
|| content.includes('.mindos/bin')) continue;
|
|
109
|
+
} catch { continue; }
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
try {
|
|
113
|
+
appendFileSync(full, block, 'utf-8');
|
|
114
|
+
appended = true;
|
|
115
|
+
} catch { /* best effort */ }
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Fish shell support
|
|
119
|
+
try {
|
|
120
|
+
const fishConfD = resolve(home, '.config', 'fish', 'conf.d');
|
|
121
|
+
if (existsSync(fishConfD)) {
|
|
122
|
+
const fishFile = resolve(fishConfD, 'mindos.fish');
|
|
123
|
+
const fishBlock = `${SHELL_MARKER}\nif not contains "$HOME/.mindos/bin" $PATH\n set -gx PATH "$HOME/.mindos/bin" $PATH\nend\n`;
|
|
124
|
+
let needsWrite = !existsSync(fishFile);
|
|
125
|
+
if (!needsWrite) {
|
|
126
|
+
const content = readFileSync(fishFile, 'utf-8');
|
|
127
|
+
needsWrite = !content.includes(SHELL_MARKER)
|
|
128
|
+
&& !content.includes('# MindOS Desktop')
|
|
129
|
+
&& !content.includes('.mindos/bin');
|
|
130
|
+
}
|
|
131
|
+
if (needsWrite) {
|
|
132
|
+
writeFileSync(fishFile, fishBlock, 'utf-8');
|
|
133
|
+
appended = true;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
} catch { /* best effort */ }
|
|
137
|
+
|
|
138
|
+
return appended;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Ensure CLI shim exists and PATH is injected. Safe to call on every `mindos start`.
|
|
143
|
+
* Returns true if any changes were made.
|
|
144
|
+
*/
|
|
145
|
+
export function ensureCliShim() {
|
|
146
|
+
try {
|
|
147
|
+
writeUnixShim(CLI_PATH);
|
|
148
|
+
} catch (e) {
|
|
149
|
+
console.warn('[MindOS] Failed to write CLI shim:', e instanceof Error ? e.message : e);
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
try {
|
|
154
|
+
return appendPathToShellRc();
|
|
155
|
+
} catch (e) {
|
|
156
|
+
console.warn('[MindOS] Failed to append PATH to shell rc:', e instanceof Error ? e.message : e);
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** Check if ~/.mindos/bin is in the current PATH. */
|
|
162
|
+
export function isShimInPath() {
|
|
163
|
+
const dirs = (process.env.PATH || '').split(platform() === 'win32' ? ';' : ':');
|
|
164
|
+
const binDir = shimDir();
|
|
165
|
+
return dirs.some(d => d === binDir || d === '$HOME/.mindos/bin' || d === '~/.mindos/bin');
|
|
166
|
+
}
|
package/package.json
CHANGED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=273,exports.ids=[273],exports.modules={1160:(a,b,c)=>{c.d(b,{GL:()=>d,_l:()=>e,e1:()=>f}),c(29021),c(33873);let d=a=>`# ${a} Instruction Set
|
|
2
|
-
|
|
3
|
-
## Goal
|
|
4
|
-
|
|
5
|
-
- Define local execution rules for this directory.
|
|
6
|
-
|
|
7
|
-
## Local Rules
|
|
8
|
-
|
|
9
|
-
- Read root \`INSTRUCTION.md\` first.
|
|
10
|
-
- Then read this directory \`README.md\` for navigation.
|
|
11
|
-
- Keep edits minimal, structured, and traceable.
|
|
12
|
-
|
|
13
|
-
## Execution Order
|
|
14
|
-
|
|
15
|
-
1. Root \`INSTRUCTION.md\`
|
|
16
|
-
2. This directory \`INSTRUCTION.md\`
|
|
17
|
-
3. This directory \`README.md\` and target files
|
|
18
|
-
|
|
19
|
-
## Boundary
|
|
20
|
-
|
|
21
|
-
- Root rules win on conflict.
|
|
22
|
-
`,e=a=>`# ${a}
|
|
23
|
-
|
|
24
|
-
## π Structure
|
|
25
|
-
|
|
26
|
-
\`\`\`bash
|
|
27
|
-
${a}/
|
|
28
|
-
βββ INSTRUCTION.md
|
|
29
|
-
βββ README.md
|
|
30
|
-
βββ (your files here)
|
|
31
|
-
\`\`\`
|
|
32
|
-
|
|
33
|
-
## π‘ Usage
|
|
34
|
-
|
|
35
|
-
(Describe the purpose and usage of this space.)
|
|
36
|
-
`;function f(a){return a.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||a}},4120:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{kh:()=>o});var e=c(29021),f=c.n(e),g=c(33873),h=c.n(g),i=c(21820),j=c.n(i),k=c(61374),l=c(27313),m=a([l]);l=(m.then?(await m)():m)[0];let p=h().join(j().homedir(),".mindos","config.json"),q={ai:{provider:"anthropic",providers:{anthropic:{apiKey:"",model:"claude-sonnet-4-6"},openai:{apiKey:"",model:"gpt-5.4",baseUrl:""}}},mindRoot:""};function n(a,b,c){if(a&&"object"==typeof a){let c=a[b];if("string"==typeof c&&""!==c.trim())return c}return c}function o(){return function(){try{var a;let b=f().readFileSync(p,"utf-8"),c=JSON.parse(b);return{ai:function(a){let b=a.ai;if(!b)return{...q.ai};let c="string"==typeof b.provider?b.provider:"anthropic",d=(0,l.rl)(c)?c:"anthropic";if(b.providers&&"object"==typeof b.providers){let a=b.providers,c={};for(let b of Object.keys(a)){var e;if(!(0,l.rl)(b))continue;let d=l.T_[b],f=q.ai.providers[b]??{apiKey:"",model:d.defaultModel};c[b]=(e=a[b],{apiKey:n(e,"apiKey",f.apiKey),model:n(e,"model",f.model),...void 0!==f.baseUrl?{baseUrl:n(e,"baseUrl",f.baseUrl)}:{}})}return c.anthropic||(c.anthropic=q.ai.providers.anthropic),c.openai||(c.openai=q.ai.providers.openai),{provider:d,providers:c}}return{provider:d,providers:{anthropic:{apiKey:n(b,"anthropicApiKey",""),model:n(b,"anthropicModel","claude-sonnet-4-6")},openai:{apiKey:n(b,"openaiApiKey",""),model:n(b,"openaiModel","gpt-5.4"),baseUrl:n(b,"openaiBaseUrl","")}}}}(c),agent:function(a){if(!a||"object"!=typeof a)return;let b={};return"number"==typeof a.maxSteps&&(b.maxSteps=Math.min(30,Math.max(1,a.maxSteps))),"boolean"==typeof a.enableThinking&&(b.enableThinking=a.enableThinking),"number"==typeof a.thinkingBudget&&(b.thinkingBudget=Math.min(5e4,Math.max(1e3,a.thinkingBudget))),("auto"===a.contextStrategy||"off"===a.contextStrategy)&&(b.contextStrategy=a.contextStrategy),"number"==typeof a.reconnectRetries&&(b.reconnectRetries=Math.min(10,Math.max(0,a.reconnectRetries))),Object.keys(b).length>0?b:void 0}(c.agent),acpAgents:(a=c.acpAgents,(0,k.gG)(a)),mindRoot:c.mindRoot??q.mindRoot,webPassword:"string"==typeof c.webPassword?c.webPassword:void 0,authToken:"string"==typeof c.authToken?c.authToken:void 0,mcpPort:"number"==typeof c.mcpPort?c.mcpPort:void 0,port:"number"==typeof c.port?c.port:void 0,startMode:"string"==typeof c.startMode?c.startMode:void 0,setupPending:!0===c.setupPending||void 0,disabledSkills:Array.isArray(c.disabledSkills)?c.disabledSkills:void 0,guideState:function(a){if(!a||"object"!=typeof a||!0!==a.active)return;let b="en"===a.template||"zh"===a.template||"empty"===a.template?a.template:"en";return{active:!0,dismissed:!0===a.dismissed,template:b,step1Done:!0===a.step1Done,askedAI:!0===a.askedAI,nextStepIndex:"number"==typeof a.nextStepIndex?a.nextStepIndex:0,walkthroughStep:"number"==typeof a.walkthroughStep?a.walkthroughStep:void 0,walkthroughDismissed:"boolean"==typeof a.walkthroughDismissed?a.walkthroughDismissed:void 0}}(c.guideState)}}catch{return{...q,ai:{...q.ai,providers:{...q.ai.providers}},setupPending:!0}}}().mindRoot||process.env.MIND_ROOT||h().join(j().homedir(),"MindOS","mind")}d()}catch(a){d(a)}})},14432:(a,b,c)=>{c.d(b,{Xs:()=>z,As:()=>v,rt:()=>d.rt,x3:()=>d.x3,_E:()=>u,H5:()=>d.H5,OV:()=>d.OV}),c(99863);var d=c(18451),e=c(29021),f=c.n(e);c(79748);var g=c(33873),h=c.n(g);let i=new Set([".git","node_modules","app",".next",".DS_Store","mcp"]),j=new Set([".md",".csv"]),k=new Set(["INSTRUCTION.md","README.md","CONFIG.json","CHANGELOG.md"]);function l(a,b,c={}){let d,e=h().resolve(a),g=b??e,m=c.ignoredDirs??i,n=c.allowedExtensions??j;try{d=f().readdirSync(g,{withFileTypes:!0})}catch{return[]}let o=[];for(let b of d){let d=h().join(g,b.name);if(b.isDirectory()){if(m.has(b.name))continue;o.push(...l(a,d,c))}else if(b.isFile()){if(g===e&&k.has(b.name))continue;let a=h().extname(b.name).toLowerCase();n.has(a)&&o.push(h().relative(e,d))}}return o}var m=c(21820),n=c.n(m);let o=/[\u4e00-\u9fff\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/,p="u">typeof Intl&&Intl.Segmenter?new Intl.Segmenter("zh",{granularity:"word"}):null;function q(a){let b=new Set,c=a.toLowerCase(),d=c.match(/[a-z0-9_$@#]+/g);if(d)for(let a of d)a.length>=2&&b.add(a);if(o.test(c))if(p)for(let{segment:a,isWordLike:d}of p.segment(c)){if(!d)continue;let c=a.trim();if(c)for(let a of(b.add(c),c))o.test(a)&&b.add(a)}else{let a=[];for(let d of c)o.test(d)?a.push(d):a.length>0&&(r(a,b),a.length=0);a.length>0&&r(a,b)}return b}function r(a,b){for(let c=0;c<a.length;c++)b.add(a[c]),c+1<a.length&&b.add(a[c]+a[c+1])}class s{rebuild(a){let b=l(a),c=new Map,e=new Map,f=new Map,g=0;for(let h of b){let b;try{b=(0,d.TA)(a,h)}catch{continue}e.set(h,b.length),g+=b.length,b.length>5e4&&(b=b.slice(0,5e4));let i=q(h+"\n"+b);for(let a of(f.set(h,i),i)){let b=c.get(a);b||(b=new Set,c.set(a,b)),b.add(h)}}this.invertedIndex=c,this.builtForRoot=a,this.fileCount=b.length,this.docLengths=e,this.totalChars=g,this.fileTokens=f}invalidate(){this.invertedIndex=null,this.builtForRoot=null,this.fileCount=0,this.docLengths.clear(),this.totalChars=0,this.fileTokens.clear()}removeFile(a){if(!this.invertedIndex)return;let b=this.fileTokens.get(a);if(b){for(let c of b)this.invertedIndex.get(c)?.delete(a);this.fileTokens.delete(a)}let c=this.docLengths.get(a)??0;this.totalChars-=c,this.docLengths.delete(a),this.fileCount=Math.max(0,this.fileCount-1)}addFile(a,b){let c;if(!this.invertedIndex)return;try{c=(0,d.TA)(a,b)}catch{return}this.docLengths.set(b,c.length),this.totalChars+=c.length,this.fileCount++,c.length>5e4&&(c=c.slice(0,5e4));let e=q(b+"\n"+c);for(let a of(this.fileTokens.set(b,e),e)){let c=this.invertedIndex.get(a);c||(c=new Set,this.invertedIndex.set(a,c)),c.add(b)}}updateFile(a,b){this.invertedIndex&&(this.removeFile(b),this.addFile(a,b))}isBuiltFor(a){return null!==this.invertedIndex&&this.builtForRoot===a}isBuilt(){return null!==this.invertedIndex}getFileCount(){return this.fileCount}getAvgDocLength(){return this.fileCount>0?this.totalChars/this.fileCount:0}getDocLength(a){return this.docLengths.get(a)??0}getDocFrequency(a){return this.invertedIndex?this.invertedIndex.get(a)?.size??0:0}getCandidatesUnion(a){if(!a.trim()||!this.invertedIndex)return null;let b=q(a.toLowerCase().trim());if(0===b.size)return null;let c=new Map;for(let a of b){let b=this.invertedIndex.get(a);if(b)for(let a of b)c.set(a,(c.get(a)??0)+1)}if(0===c.size)return[];let d=b.size;if(d>=3){let a=Math.max(1,Math.floor(d/2)),b=[...c.entries()].filter(([,b])=>b>=a).map(([a])=>a);if(b.length>0)return b}return[...c.keys()]}getCandidates(a){if(!a.trim()||!this.invertedIndex)return null;let b=q(a.toLowerCase().trim());if(0===b.size)return null;let c=null;for(let a of b){let b=this.invertedIndex.get(a);if(!b)return[];if(null===c)c=new Set(b);else{for(let a of c)b.has(a)||c.delete(a);if(0===c.size)return[]}}return c?Array.from(c):[]}persist(a){if(!this.invertedIndex)return;let b={version:1,builtForRoot:this.builtForRoot??"",fileCount:this.fileCount,totalChars:this.totalChars,docLengths:Object.fromEntries(this.docLengths),invertedIndex:{},timestamp:Date.now()};for(let[a,c]of this.invertedIndex)b.invertedIndex[a]=[...c];let c=h().join(a,"search-index.json");try{f().mkdirSync(a,{recursive:!0}),f().writeFileSync(c,JSON.stringify(b),"utf-8")}catch{}}load(a,b){let c,d,e=h().join(a,"search-index.json");try{c=f().readFileSync(e,"utf-8")}catch{return!1}try{d=JSON.parse(c)}catch{return!1}if(1!==d.version||d.builtForRoot!==b||l(b).length!==d.fileCount)return!1;let g=Object.keys(d.docLengths);if(Math.min(50,g.length)===g.length)for(let a of g)try{if(f().statSync(h().join(b,a)).mtimeMs>d.timestamp)return!1}catch{return!1}else{let a=Math.max(1,Math.floor(g.length/40)),c=new Set;for(let b=0;b<g.length;b+=a)c.add(b);for(let a=Math.max(0,g.length-10);a<g.length;a++)c.add(a);for(let a of c)try{if(f().statSync(h().join(b,g[a])).mtimeMs>d.timestamp)return!1}catch{return!1}}this.builtForRoot=d.builtForRoot,this.fileCount=d.fileCount,this.totalChars=d.totalChars,this.docLengths=new Map(Object.entries(d.docLengths).map(([a,b])=>[a,b]));let i=new Map,j=new Map;for(let[a,b]of Object.entries(d.invertedIndex)){let c=new Set(b);for(let b of(i.set(a,c),c)){let c=j.get(b);c||(c=new Set,j.set(b,c)),c.add(a)}}return this.invertedIndex=i,this.fileTokens=j,!0}constructor(){this.invertedIndex=null,this.builtForRoot=null,this.fileCount=0,this.docLengths=new Map,this.totalChars=0,this.fileTokens=new Map}}let t=new s;function u(){t.invalidate()}function v(a,b){t.isBuilt()&&(t.addFile(a,b),x=!0,w&&clearTimeout(w),w=setTimeout(y,5e3))}let w=null,x=!1;function y(){if(w&&(clearTimeout(w),w=null),x){x=!1;try{t.persist(h().join(n().homedir(),".mindos"))}catch{}}}"u">typeof process&&(process.on("beforeExit",y),process.on("SIGTERM",()=>{y(),process.exit(0)}),process.on("SIGINT",()=>{y(),process.exit(0)}));class z{rebuild(a){let b=l(a).filter(a=>a.endsWith(".md")),c=new Set(b),e=function(a){let b=new Map;for(let c of a){let a=h().basename(c).toLowerCase();b.has(a)||b.set(a,[]),b.get(a).push(c)}return b}(b),f=new Map,g=new Map;for(let h of b){let b;try{b=(0,d.TA)(a,h)}catch{continue}let i=A(b,h,c,e),j=new Set;for(let a of i)a!==h&&j.add(a);for(let a of(f.set(h,j),j)){let b=g.get(a);b||(b=new Set,g.set(a,b)),b.add(h)}}this.forwardLinks=f,this.backwardLinks=g,this.builtForRoot=a,this.fileSet=c,this.basenameMap=e}invalidate(){this.forwardLinks.clear(),this.backwardLinks.clear(),this.builtForRoot=null,this.fileSet.clear(),this.basenameMap.clear()}isBuiltFor(a){return this.builtForRoot===a}isBuilt(){return null!==this.builtForRoot}getForwardLinks(a){return[...this.forwardLinks.get(a)??[]]}getBacklinks(a){return[...this.backwardLinks.get(a)??[]]}getAllEdges(){let a=[];for(let[b,c]of this.forwardLinks)for(let d of c)a.push({source:b,target:d});return a}removeFile(a){let b=this.forwardLinks.get(a);if(b){for(let c of b)this.backwardLinks.get(c)?.delete(a);this.forwardLinks.delete(a)}let c=this.backwardLinks.get(a);if(c){for(let b of c)this.forwardLinks.get(b)?.delete(a);this.backwardLinks.delete(a)}this.fileSet.delete(a);let d=h().basename(a).toLowerCase(),e=this.basenameMap.get(d);if(e){let b=e.indexOf(a);b>=0&&e.splice(b,1),0===e.length&&this.basenameMap.delete(d)}}updateFile(a,b){let c;if(!this.builtForRoot||!b.endsWith(".md"))return;let e=this.forwardLinks.get(b);if(e)for(let a of e)this.backwardLinks.get(a)?.delete(b);try{c=(0,d.TA)(a,b)}catch{return}if(!this.fileSet.has(b)){this.fileSet.add(b);let a=h().basename(b).toLowerCase();this.basenameMap.has(a)||this.basenameMap.set(a,[]),this.basenameMap.get(a).push(b)}let f=A(c,b,this.fileSet,this.basenameMap),g=new Set;for(let a of f)a!==b&&g.add(a);for(let a of(this.forwardLinks.set(b,g),g)){let c=this.backwardLinks.get(a);c||(c=new Set,this.backwardLinks.set(a,c)),c.add(b)}}constructor(){this.forwardLinks=new Map,this.backwardLinks=new Map,this.builtForRoot=null,this.fileSet=new Set,this.basenameMap=new Map}}function A(a,b,c,d){let e,f=[],g=h().dirname(b),i=/\[\[([^\]|#]+)(?:[|#][^\]]*)?/g;for(;null!==(e=i.exec(a));){let a=e[1].trim();if(!a)continue;if(c.has(a)){f.push(a);continue}let b=a.endsWith(".md")?a:a+".md";if(c.has(b)){f.push(b);continue}let g=h().basename(b).toLowerCase(),i=d.get(g);i&&1===i.length&&f.push(i[0])}let j=/\[[^\]]+\]\(([^)]+\.md)(?:#[^)]*)?\)/g;for(;null!==(e=j.exec(a));){let a=e[1].trim();if(!a||a.startsWith("http"))continue;let b=h().normalize(h().join(g,a));c.has(b)&&f.push(b)}return f}c(20018),c(79646),c(15872)},15872:(a,b,c)=>{c.d(b,{_:()=>l,c:()=>k});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(20018),i=c(18451),j=c(1160);function k(a,b,c){let d=b.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||b,e=c.trim()||"(Describe the purpose and usage of this space.)";return`# ${d}
|
|
37
|
-
|
|
38
|
-
${e}
|
|
39
|
-
|
|
40
|
-
## π Structure
|
|
41
|
-
|
|
42
|
-
\`\`\`bash
|
|
43
|
-
${a}/
|
|
44
|
-
βββ INSTRUCTION.md
|
|
45
|
-
βββ README.md
|
|
46
|
-
βββ (your files here)
|
|
47
|
-
\`\`\`
|
|
48
|
-
|
|
49
|
-
## π‘ Usage
|
|
50
|
-
|
|
51
|
-
(Add usage guidelines for this space.)
|
|
52
|
-
`}function l(a,b,c,d=""){let f=b.trim();if(!f)throw new h.Vt(h.tG.INVALID_REQUEST,"Space name is required",{name:b});if(f.includes("/")||f.includes("\\"))throw new h.Vt(h.tG.INVALID_PATH,"Space name must not contain path separators",{name:f});let m=d.replace(/\/+$/,"").trim();if(m.includes("..")||m.startsWith("/")||m.includes("\\"))throw new h.Vt(h.tG.INVALID_PATH,"Invalid parent path",{parentPath:d});let n=m?`${m}/`:"",o=`${n}${f}`,p=k(o,f,c);(0,i.x3)(a,`${o}/README.md`,p);let q=g().resolve(a,o),r=g().join(q,"INSTRUCTION.md");return e().existsSync(r)||e().writeFileSync(r,(0,j.GL)((0,j.e1)(f)),"utf-8"),{path:o}}},16081:(a,b,c)=>{c.d(b,{F0:()=>o,JI:()=>u,Lr:()=>p,YN:()=>t,hQ:()=>s,kz:()=>q,vn:()=>r});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f);function h(a,b){return g().join(g().dirname(a),b)}function i(a){return h(a,".trash")}function j(a){return h(a,".trash-meta")}function k(a){e().mkdirSync(i(a),{recursive:!0}),e().mkdirSync(j(a),{recursive:!0})}function l(a,b){let c=g().join(j(a),`${b}.json`);if(!e().existsSync(c))return null;try{return JSON.parse(e().readFileSync(c,"utf-8"))}catch{return null}}function m(a,b){let c=g().join(j(a),`${b}.json`);try{e().unlinkSync(c)}catch{}}function n(a,b,c){if(c)e().cpSync(a,b,{recursive:!0}),e().rmSync(a,{recursive:!0,force:!0});else try{e().renameSync(a,b)}catch(c){if("EXDEV"===c.code)e().copyFileSync(a,b),e().unlinkSync(a);else throw c}}function o(a,b){let c,d;k(a);let f=g().join(a,b);if(!e().existsSync(f))throw Error(`File not found: ${b}`);let h=e().statSync(f).isDirectory(),l=g().basename(b),m=(c=l.replace(/[^a-zA-Z0-9._\-\u4e00-\u9fff]/g,"_"),`${Date.now()}_${c}`),o=g().join(i(a),m);e().mkdirSync(g().dirname(o),{recursive:!0}),n(f,o,h);let p=new Date,q={id:m,originalPath:b,deletedAt:p.toISOString(),expiresAt:new Date(p.getTime()+2592e6).toISOString(),fileName:l,isDirectory:h};return d=g().join(j(a),`${q.id}.json`),e().writeFileSync(d,JSON.stringify(q,null,2),"utf-8"),q}function p(a,b,c=!1){let d=l(a,b);if(!d)throw Error("Item not found in trash");let f=g().join(i(a),b);if(!e().existsSync(f))throw Error("Trash file missing from disk");let h=g().join(a,d.originalPath);if(e().existsSync(h)&&!c)throw Object.assign(Error("Restore conflict: file exists at original location"),{code:"RESTORE_CONFLICT"});return e().mkdirSync(g().dirname(h),{recursive:!0}),d.isDirectory?c&&e().existsSync(h)&&e().rmSync(h,{recursive:!0,force:!0}):c&&e().existsSync(h)&&e().unlinkSync(h),n(f,h,d.isDirectory),m(a,b),{restoredPath:d.originalPath}}function q(a,b){let c=l(a,b);if(!c)throw Error("Item not found in trash");let d=g().join(i(a),b);if(!e().existsSync(d))throw Error("Trash file missing from disk");let f=g().dirname(c.originalPath),h=g().extname(c.fileName),j=g().basename(c.fileName,h),k=g().join(f,`${j} (copy)${h}`),o=2;for(;e().existsSync(g().join(a,k));)k=g().join(f,`${j} (copy ${o})${h}`),o++;let p=g().join(a,k);return e().mkdirSync(g().dirname(p),{recursive:!0}),n(d,p,c.isDirectory),m(a,b),{restoredPath:k}}function r(a,b){let c=g().join(i(a),b);try{e().existsSync(c)&&(e().statSync(c).isDirectory()?e().rmSync(c,{recursive:!0,force:!0}):e().unlinkSync(c))}catch{}m(a,b)}function s(a){let b;k(a);let c=j(a);try{b=e().readdirSync(c).filter(a=>a.endsWith(".json"))}catch{return[]}let d=[];for(let f of b)try{let b=JSON.parse(e().readFileSync(g().join(c,f),"utf-8")),h=g().join(i(a),b.id);if(e().existsSync(h))d.push(b);else try{e().unlinkSync(g().join(c,f))}catch{}}catch{}return d.sort((a,b)=>new Date(b.deletedAt).getTime()-new Date(a.deletedAt).getTime()),d}function t(a){let b=s(a);for(let c of b)r(a,c.id);return b.length}function u(a){let b=s(a),c=Date.now(),d=0;for(let e of b)new Date(e.expiresAt).getTime()<=c&&(r(a,e.id),d++);return d}},18451:(a,b,c)=>{c.d(b,{H5:()=>n,OV:()=>o,TA:()=>k,rt:()=>m,x3:()=>l});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(99863),i=c(20018),j=c(1160);function k(a,b){let c=(0,h.eX)(a,b);return e().readFileSync(c,"utf-8")}function l(a,b,c=""){let d=(0,h.eX)(a,b);e().mkdirSync(g().dirname(d),{recursive:!0});try{e().writeFileSync(d,c,{encoding:"utf-8",flag:"wx"})}catch(a){if(a instanceof Error&&"code"in a&&"EEXIST"===a.code)throw new i.Vt(i.tG.FILE_ALREADY_EXISTS,`File already exists: ${b}`,{filePath:b});throw a}}function m(a,b){let c=(0,h.eX)(a,b);if(!e().existsSync(c))throw new i.Vt(i.tG.FILE_NOT_FOUND,`Directory not found: ${b}`,{dirPath:b});if(!e().statSync(c).isDirectory())throw new i.Vt(i.tG.INVALID_PATH,`Not a directory: ${b}`,{dirPath:b});let d=g().basename(c),f=(0,j.e1)(d),k=g().join(c,"INSTRUCTION.md");e().existsSync(k)||e().writeFileSync(k,(0,j.GL)(f),"utf-8");let l=g().join(c,"README.md");e().existsSync(l)||e().writeFileSync(l,(0,j._l)(f),"utf-8")}function n(a,b,c){if(c.includes("/")||c.includes("\\"))throw new i.Vt(i.tG.INVALID_PATH,"Invalid filename: must not contain path separators",{newName:c});let d=g().resolve(a),f=g().resolve(g().join(d,b));(0,h.cP)(f,d);let j=g().dirname(f),k=g().join(j,c);if((0,h.cP)(k,d),e().existsSync(k))throw new i.Vt(i.tG.FILE_ALREADY_EXISTS,"A file with that name already exists",{newName:c});return e().renameSync(f,k),g().relative(d,k)}function o(a,b,c){let d=c.trim();if(!d||d.includes("/")||d.includes("\\"))throw new i.Vt(i.tG.INVALID_PATH,"Invalid space name: must not contain path separators",{newName:c});let f=b.replace(/\/+$/g,"").trim();if(!f)throw new i.Vt(i.tG.INVALID_PATH,"Space path is required",{spacePath:b});let j=g().resolve(a),k=(0,h.eX)(a,f);if(!e().existsSync(k))throw new i.Vt(i.tG.FILE_NOT_FOUND,`Space not found: ${f}`,{spacePath:f});if(!e().statSync(k).isDirectory())throw new i.Vt(i.tG.INVALID_PATH,`Not a directory: ${f}`,{spacePath:f});let l=g().dirname(k),m=g().join(l,d);if((0,h.cP)(m,j),e().existsSync(m))throw new i.Vt(i.tG.FILE_ALREADY_EXISTS,"A space with that name already exists",{newName:d});return e().renameSync(k,m),g().relative(j,m)}},20018:(a,b,c)=>{c.d(b,{Vt:()=>d,tG:()=>e}),c(20457);class d extends Error{constructor(a,b,c,d){super(b),this.code=a,this.context=c,this.userMessage=d,this.name="MindOSError"}}let e={FILE_NOT_FOUND:"FILE_NOT_FOUND",FILE_ALREADY_EXISTS:"FILE_ALREADY_EXISTS",PATH_OUTSIDE_ROOT:"PATH_OUTSIDE_ROOT",PROTECTED_FILE:"PROTECTED_FILE",INVALID_PATH:"INVALID_PATH",INVALID_RANGE:"INVALID_RANGE",HEADING_NOT_FOUND:"HEADING_NOT_FOUND",INVALID_FILE_TYPE:"INVALID_FILE_TYPE",INVALID_REQUEST:"INVALID_REQUEST",MODEL_INIT_FAILED:"MODEL_INIT_FAILED",INTERNAL_ERROR:"INTERNAL_ERROR",PERMISSION_DENIED:"PERMISSION_DENIED"}},27114:(a,b,c)=>{c.d(b,{A:()=>d});let d=new Set(["TODO.md"])},27313:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{T_:()=>h,rl:()=>g});var e=c(14270),f=a([e]);e=(f.then?(await f)():f)[0];let h={anthropic:{id:"anthropic",name:"Anthropic",nameZh:"Anthropic",defaultModel:"claude-sonnet-4-6",supportsBaseUrl:!0,supportsThinking:!0,supportsListModels:!0,signupUrl:"https://console.anthropic.com/settings/keys",category:"primary"},openai:{id:"openai",name:"OpenAI",nameZh:"OpenAI",defaultModel:"gpt-5.4",supportsBaseUrl:!0,supportsThinking:!0,supportsListModels:!0,signupUrl:"https://platform.openai.com/api-keys",category:"primary"},google:{id:"google",name:"Google Gemini",nameZh:"Google Gemini",defaultModel:"gemini-2.5-flash",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,signupUrl:"https://aistudio.google.com/apikey",category:"primary"},groq:{id:"groq",name:"Groq",nameZh:"Groq",defaultModel:"llama-3.3-70b-versatile",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://console.groq.com/keys",category:"more"},xai:{id:"xai",name:"xAI (Grok)",nameZh:"xAI (Grok)",defaultModel:"grok-3",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},openrouter:{id:"openrouter",name:"OpenRouter",nameZh:"OpenRouter",defaultModel:"anthropic/claude-sonnet-4",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},mistral:{id:"mistral",name:"Mistral",nameZh:"Mistral",defaultModel:"mistral-large-latest",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},deepseek:{id:"deepseek",name:"DeepSeek",nameZh:"DeepSeek",defaultModel:"deepseek-chat",piProviderOverride:"openai",fixedBaseUrl:"https://api.deepseek.com/v1",supportsBaseUrl:!0,supportsThinking:!0,supportsListModels:!0,signupUrl:"https://platform.deepseek.com/api_keys",category:"more"},zai:{id:"zai",name:"ZhipuAI (GLM)",nameZh:"ζΊθ°± AI (GLM)",defaultModel:"glm-4-plus",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},"kimi-coding":{id:"kimi-coding",name:"Kimi Coding",nameZh:"Kimi Coding (ζδΉζι’)",defaultModel:"kimi-k2-thinking",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},cerebras:{id:"cerebras",name:"Cerebras",nameZh:"Cerebras",defaultModel:"llama-4-scout-17b-16e",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},minimax:{id:"minimax",name:"MiniMax",nameZh:"MiniMax",defaultModel:"MiniMax-M1",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!1,category:"more"},huggingface:{id:"huggingface",name:"Hugging Face",nameZh:"Hugging Face",defaultModel:"Qwen/Qwen3-235B-A22B-Thinking-2507",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},ollama:{id:"ollama",name:"Ollama",nameZh:"Ollama (ζ¬ε°)",defaultModel:"llama3.2",piProviderOverride:"openai",fixedBaseUrl:"http://localhost:11434/v1",apiKeyFallback:"ollama",supportsBaseUrl:!0,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://ollama.com/download",category:"more"}};function g(a){return a in h}Object.keys(h),d()}catch(a){d(a)}})},53134:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{H5:()=>r,JX:()=>l,Jh:()=>s,f:()=>p,gm:()=>m,rt:()=>t,x3:()=>q});var e=c(29021),f=c.n(e),g=c(33873),h=c.n(g);c(20018);var i=c(14432),j=c(4120);c(16081);var k=a([j]);function l(){return(0,j.kh)()}j=(k.then?(await k)():k)[0];let u=new Set([".git","node_modules","app",".next",".DS_Store"]),v=new Set([".md",".csv",".json"]),w=null,x=0,y=new i.Xs;function m(){w=null,x++,(0,i._E)(),y.invalidate()}let z=null,A=null;function n(a,b){try{let c=f().readFileSync(a,"utf-8"),d=[];for(let a of c.split("\n")){let c=a.trim();if(!(!c||c.startsWith("#"))&&(d.push(c),d.length>=b))break}return d}catch{return[]}}let B=["Define local execution rules for this directory.","(your files here)","(Describe the purpose and usage of this space.)","(Add usage guidelines for this space.)"];function o(a){try{let b=f().readFileSync(a,"utf-8");return B.some(a=>b.includes(a))}catch{return!1}}function p(){var a;let b,c;return(null!==w&&Date.now()-w.timestamp<5e3?w:(a=l(),b=function a(b,c){let d,e=c??l();try{d=f().readdirSync(b,{withFileTypes:!0})}catch{return[]}let g=[];for(let c of d){let d=h().join(b,c.name),f=h().relative(e,d);if(c.isDirectory()){if(u.has(c.name))continue;let b=a(d,e);if(b.length>0){let a=b.some(a=>"file"===a.type&&"INSTRUCTION.md"===a.name),e={name:c.name,path:f,type:"directory",children:b};a&&(e.isSpace=!0,e.spacePreview=function(a){let b=h().join(a,"INSTRUCTION.md"),c=h().join(a,"README.md");return{instructionLines:n(b,3),readmeLines:n(c,3),isTemplate:o(b)&&o(c)}}(d)),g.push(e)}}else if(c.isFile()){let a=h().extname(c.name).toLowerCase();v.has(a)&&g.push({name:c.name,path:f,type:"file",extension:a})}}return g.sort((a,b)=>a.type!==b.type?"directory"===a.type?-1:1:a.name.localeCompare(b.name)),g}(a),c=[],function a(b){for(let d of b)"file"===d.type?c.push(d.path):d.children&&a(d.children)}(b),w={tree:b,allFiles:c,timestamp:Date.now()},z||function(){let a;if(!z){try{a=l()}catch{return}try{(z=f().watch(a,{recursive:!0},(a,b)=>{!b||b.startsWith(".git")||b.includes("node_modules")||b.includes(".next")||(A&&clearTimeout(A),A=setTimeout(()=>{w=null,A=null},500))})).on("error",()=>{A&&(clearTimeout(A),A=null),z&&(z.close(),z=null)})}catch{z=null}}}(),w)).allFiles}function q(a,b=""){(0,i.x3)(l(),a,b),w=null,x++,(0,i.As)(l(),a),y.isBuilt()&&y.updateFile(l(),a)}function r(a,b){let c=(0,i.H5)(l(),a,b);return m(),c}function s(a,b){let c=(0,i.OV)(l(),a,b);return m(),c}function t(a){(0,i.rt)(l(),a),m()}d()}catch(a){d(a)}})},61374:(a,b,c)=>{c.d(b,{gG:()=>d});function d(a){if(!a||"object"!=typeof a||Array.isArray(a))return;let b={},c=!1;for(let[d,e]of Object.entries(a)){if(!e||"object"!=typeof e||Array.isArray(e))continue;let a={};if("string"==typeof e.command&&e.command.trim()&&(a.command=e.command.trim()),Array.isArray(e.args)&&(a.args=e.args.filter(a=>"string"==typeof a)),e.env&&"object"==typeof e.env&&!Array.isArray(e.env)){let b={};for(let[a,c]of Object.entries(e.env))"string"==typeof c&&(b[a]=c);Object.keys(b).length>0&&(a.env=b)}"boolean"==typeof e.enabled&&(a.enabled=e.enabled),Object.keys(a).length>0&&(b[d]=a,c=!0)}return c?b:void 0}},70273:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{"007b570256fa6870396fa8337f73e8bbbdd3b278b2":()=>e.Dg,"00bcbd3dc575fdd4e4d286631045c0b51612926bbc":()=>e.GB,"00d25f4f1bd3a1e65fce3bdf79d38cf1f2197e755d":()=>e.EG,"00feb3e1967fd7db7a96c8890a918c9bfc3931cf37":()=>e.Bn,"4027c159f234c347654f7f6bdd55dc73ec74aca774":()=>e.VO,"402f7ce392474d4c4247ba0fa71393a6a1777ac68d":()=>e.jW,"403c4f9c089cd5fc4dadf175d6388d22c18b7c21bb":()=>e.bC,"40469e1a3f65754f08872955f4fa07f79cd904e53a":()=>e.Ye,"405a54a7c8d6011ad85002a50be12c1fb8f3aa2419":()=>e.iJ,"40644eb710d62bf567308d16e611d6b80f9d8f05a8":()=>e.Ar,"40b44893a01ca862cba8f62183dce2e428c2cff3b2":()=>e.ku,"601f45dc614facf01eed979138942934e3f2311741":()=>e.X3,"6091887a8aaecc4eb1bd162892fbc7bff446087b56":()=>e.NN,"60dc1ced67756a0567217fc70906cce7aff02e0060":()=>e.f,"60fba0025d97160bdef1ab06ef8a3443fe107a5527":()=>e.pG,"70312fa9a281c166e956f96c5d5ac7351e313270f3":()=>e.FZ,"708caf5155e4436405af2923d84d65cee054f7d243":()=>e.pX});var e=c(85224),f=a([e]);e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},85224:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Ar:()=>v,Bn:()=>E,Dg:()=>B,EG:()=>C,FZ:()=>A,GB:()=>H,NN:()=>F,VO:()=>D,X3:()=>r,Ye:()=>y,bC:()=>G,f:()=>t,iJ:()=>s,jW:()=>u,ku:()=>x,pG:()=>w,pX:()=>z});var e=c(95349),f=c(29021),g=c.n(f),h=c(33873),i=c.n(h),j=c(53134),k=c(16081),l=c(15872),m=c(1160),n=c(42650),o=c(27114),p=c(89337),q=a([j]);async function r(a,b){try{let c=b.trim();if(!c)return{success:!1,error:"File name is required"};let d=c.endsWith(".md")||c.endsWith(".csv")?c:`${c}.md`,e=a?`${a}/${d}`:d;return(0,j.x3)(e),(0,n.revalidatePath)("/","layout"),{success:!0,filePath:e}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Failed to create file"}}}async function s(a){try{let b=i().posix.basename(a);if(!a.includes("/")&&o.A.has(b))return{success:!1,error:`"${b}" is protected and cannot be deleted`};let c=(0,k.F0)((0,j.JX)(),a);return(0,j.gm)(),(0,n.revalidatePath)("/","layout"),{success:!0,trashId:c.id}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Failed to delete file"}}}async function t(a,b){try{let c=(0,j.H5)(a,b);return(0,n.revalidatePath)("/","layout"),{success:!0,newPath:c}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Failed to rename file"}}}async function u(a){try{return(0,j.rt)(a),(0,n.revalidatePath)("/","layout"),{success:!0}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Failed to convert to space"}}}async function v(a){try{let b=(0,k.F0)((0,j.JX)(),a);return(0,j.gm)(),(0,n.revalidatePath)("/","layout"),{success:!0,trashId:b.id}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Failed to delete folder"}}}async function w(a,b){try{let c=(0,j.Jh)(a,b);return(0,n.revalidatePath)("/","layout"),{success:!0,newPath:c}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Failed to rename space"}}}async function x(a){try{let b=(0,k.F0)((0,j.JX)(),a);return(0,j.gm)(),(0,n.revalidatePath)("/","layout"),{success:!0,trashId:b.id}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Failed to delete space"}}}async function y(a){try{return(0,k.Lr)((0,j.JX)(),a,!1),(0,j.gm)(),(0,n.revalidatePath)("/","layout"),{success:!0}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Undo failed"}}}async function z(a,b,c=""){try{let{path:d}=(0,l._)((0,j.JX)(),a,b,c);return(0,j.gm)(),(0,n.revalidatePath)("/","layout"),{success:!0,path:d}}catch(b){let a=b instanceof Error?b.message:"Failed to create space";if(a.includes("already exists"))return{success:!1,error:"A space with this name already exists"};return{success:!1,error:a}}}async function A(a,b,c){try{let d=(0,j.JX)(),e=i().resolve(d,a);if(!e.startsWith(d))return{success:!1,error:"Invalid path"};let f=i().join(e,"README.md"),h=i().join(e,"INSTRUCTION.md"),k=(0,l.c)(a,b,c);g().writeFileSync(f,k,"utf-8");let o=(0,m.e1)(b);return g().writeFileSync(h,(0,m.GL)(o),"utf-8"),(0,j.gm)(),(0,n.revalidatePath)("/","layout"),{success:!0}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Failed to revert"}}}async function B(){return{files:(0,j.f)().filter(a=>i().basename(a).startsWith("\uD83E\uDDEA_example_"))}}async function C(){try{let{files:a}=await B();if(0===a.length)return{success:!0,deleted:0};let b=(0,j.JX)();for(let c of a){let a=i().resolve(b,c);a.startsWith(b)&&g().existsSync(a)&&g().unlinkSync(a)}for(let c of[...new Set(a.map(a=>i().dirname(i().resolve(b,a))))].sort((a,b)=>b.length-a.length))try{if(c.startsWith(b)&&c!==b){let a=g().readdirSync(c);0===a.length&&g().rmdirSync(c)}}catch{}return(0,j.gm)(),(0,n.revalidatePath)("/","layout"),{success:!0,deleted:a.length}}catch(a){return{success:!1,deleted:0,error:a instanceof Error?a.message:"Failed to cleanup"}}}async function D(a){let b=(0,j.f)(),c=a.endsWith("/")?a:a+"/";return b.filter(a=>a.startsWith(c))}async function E(){return(0,k.JI)((0,j.JX)()),(0,k.hQ)((0,j.JX)())}async function F(a,b="restore"){try{let c,d=(0,j.JX)();return c="copy"===b?(0,k.kz)(d,a):(0,k.Lr)(d,a,"overwrite"===b),(0,j.gm)(),(0,n.revalidatePath)("/","layout"),{success:!0,restoredPath:c.restoredPath}}catch(a){if("RESTORE_CONFLICT"===a.code)return{success:!1,error:a.message,conflict:!0};return{success:!1,error:a.message??"Failed to restore"}}}async function G(a){try{return(0,k.vn)((0,j.JX)(),a),{success:!0}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Failed to delete"}}}async function H(){try{let a=(0,k.YN)((0,j.JX)());return{success:!0,count:a}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Failed to empty trash"}}}j=(q.then?(await q)():q)[0],(0,p.D)([r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H]),(0,e.A)(r,"601f45dc614facf01eed979138942934e3f2311741",null),(0,e.A)(s,"405a54a7c8d6011ad85002a50be12c1fb8f3aa2419",null),(0,e.A)(t,"60dc1ced67756a0567217fc70906cce7aff02e0060",null),(0,e.A)(u,"402f7ce392474d4c4247ba0fa71393a6a1777ac68d",null),(0,e.A)(v,"40644eb710d62bf567308d16e611d6b80f9d8f05a8",null),(0,e.A)(w,"60fba0025d97160bdef1ab06ef8a3443fe107a5527",null),(0,e.A)(x,"40b44893a01ca862cba8f62183dce2e428c2cff3b2",null),(0,e.A)(y,"40469e1a3f65754f08872955f4fa07f79cd904e53a",null),(0,e.A)(z,"708caf5155e4436405af2923d84d65cee054f7d243",null),(0,e.A)(A,"70312fa9a281c166e956f96c5d5ac7351e313270f3",null),(0,e.A)(B,"007b570256fa6870396fa8337f73e8bbbdd3b278b2",null),(0,e.A)(C,"00d25f4f1bd3a1e65fce3bdf79d38cf1f2197e755d",null),(0,e.A)(D,"4027c159f234c347654f7f6bdd55dc73ec74aca774",null),(0,e.A)(E,"00feb3e1967fd7db7a96c8890a918c9bfc3931cf37",null),(0,e.A)(F,"6091887a8aaecc4eb1bd162892fbc7bff446087b56",null),(0,e.A)(G,"403c4f9c089cd5fc4dadf175d6388d22c18b7c21bb",null),(0,e.A)(H,"00bcbd3dc575fdd4e4d286631045c0b51612926bbc",null),d()}catch(a){d(a)}})},99863:(a,b,c)=>{c.d(b,{cP:()=>g,eX:()=>h});var d=c(33873),e=c.n(d),f=c(20018);function g(a,b){if(!a.startsWith(b+e().sep)&&a!==b)throw new f.Vt(f.tG.PATH_OUTSIDE_ROOT,"Access denied: path outside MIND_ROOT",{resolved:a,root:b})}function h(a,b){let c=e().resolve(a),d=e().resolve(e().join(c,b));return g(d,c),d}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=6622,exports.ids=[6622],exports.modules={94241:(a,b,c)=>{function d(a){return Array.isArray?Array.isArray(a):"[object Array]"===k(a)}c.d(b,{A:()=>V});let e=1/0;function f(a){return"string"==typeof a}function g(a){return"number"==typeof a}function h(a){return"object"==typeof a}function i(a){return null!=a}function j(a){return!a.trim().length}function k(a){return null==a?void 0===a?"[object Undefined]":"[object Null]":Object.prototype.toString.call(a)}let l=Object.prototype.hasOwnProperty;class m{constructor(a){this._keys=[],this._keyMap={};let b=0;a.forEach(a=>{let c=n(a);this._keys.push(c),this._keyMap[c.id]=c,b+=c.weight}),this._keys.forEach(a=>{a.weight/=b})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function n(a){let b=null,c=null,e=null,g=1,h=null;if(f(a)||d(a))e=a,b=o(a),c=p(a);else{if(!l.call(a,"name"))throw Error("Missing name property in key");let d=a.name;if(e=d,l.call(a,"weight")&&(g=a.weight)<=0)throw Error(`Property 'weight' in key '${d}' must be a positive integer`);b=o(d),c=p(d),h=a.getFn}return{path:b,id:c,weight:g,src:e,getFn:h}}function o(a){return d(a)?a:a.split(".")}function p(a){return d(a)?a.join("."):a}var q={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(a,b)=>a.score===b.score?a.idx<b.idx?-1:1:a.score<b.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,getFn:function(a,b){let c=[],j=!1,l=(a,b,m)=>{if(i(a))if(b[m]){var n,o;let p=a[b[m]];if(!i(p))return;if(m===b.length-1&&(f(p)||g(p)||!0===(n=p)||!1===n||h(o=n)&&null!==o&&"[object Boolean]"==k(n)))c.push(null==p?"":function(a){if("string"==typeof a)return a;let b=a+"";return"0"==b&&1/a==-e?"-0":b}(p));else if(d(p)){j=!0;for(let a=0,c=p.length;a<c;a+=1)l(p[a],b,m+1)}else b.length&&l(p,b,m+1)}else c.push(a)};return l(a,f(b)?b.split("."):b,0),j?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};let r=/[^ ]+/g;class s{constructor({getFn:a=q.getFn,fieldNormWeight:b=q.fieldNormWeight}={}){this.norm=function(a=1,b=3){let c=new Map,d=Math.pow(10,b);return{get(b){let e=b.match(r).length;if(c.has(e))return c.get(e);let f=parseFloat(Math.round(1/Math.pow(e,.5*a)*d)/d);return c.set(e,f),f},clear(){c.clear()}}}(b,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}setSources(a=[]){this.docs=a}setIndexRecords(a=[]){this.records=a}setKeys(a=[]){this.keys=a,this._keysMap={},a.forEach((a,b)=>{this._keysMap[a.id]=b})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,f(this.docs[0])?this.docs.forEach((a,b)=>{this._addString(a,b)}):this.docs.forEach((a,b)=>{this._addObject(a,b)}),this.norm.clear())}add(a){let b=this.size();f(a)?this._addString(a,b):this._addObject(a,b)}removeAt(a){this.records.splice(a,1);for(let b=a,c=this.size();b<c;b+=1)this.records[b].i-=1}getValueForItemAtKeyId(a,b){return a[this._keysMap[b]]}size(){return this.records.length}_addString(a,b){if(!i(a)||j(a))return;let c={v:a,i:b,n:this.norm.get(a)};this.records.push(c)}_addObject(a,b){let c={i:b,$:{}};this.keys.forEach((b,e)=>{let g=b.getFn?b.getFn(a):this.getFn(a,b.path);if(i(g)){if(d(g)){let a=[],b=[{nestedArrIndex:-1,value:g}];for(;b.length;){let{nestedArrIndex:c,value:e}=b.pop();if(i(e))if(f(e)&&!j(e)){let b={v:e,i:c,n:this.norm.get(e)};a.push(b)}else d(e)&&e.forEach((a,c)=>{b.push({nestedArrIndex:c,value:a})})}c.$[e]=a}else if(f(g)&&!j(g)){let a={v:g,n:this.norm.get(g)};c.$[e]=a}}}),this.records.push(c)}toJSON(){return{keys:this.keys,records:this.records}}}function t(a,b,{getFn:c=q.getFn,fieldNormWeight:d=q.fieldNormWeight}={}){let e=new s({getFn:c,fieldNormWeight:d});return e.setKeys(a.map(n)),e.setSources(b),e.create(),e}function u(a,{errors:b=0,currentLocation:c=0,expectedLocation:d=0,distance:e=q.distance,ignoreLocation:f=q.ignoreLocation}={}){let g=b/a.length;if(f)return g;let h=Math.abs(d-c);return e?g+h/e:h?1:g}let v=String.prototype.normalize?a=>a.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):a=>a;class w{constructor(a,{location:b=q.location,threshold:c=q.threshold,distance:d=q.distance,includeMatches:e=q.includeMatches,findAllMatches:f=q.findAllMatches,minMatchCharLength:g=q.minMatchCharLength,isCaseSensitive:h=q.isCaseSensitive,ignoreDiacritics:i=q.ignoreDiacritics,ignoreLocation:j=q.ignoreLocation}={}){if(this.options={location:b,threshold:c,distance:d,includeMatches:e,findAllMatches:f,minMatchCharLength:g,isCaseSensitive:h,ignoreDiacritics:i,ignoreLocation:j},a=h?a:a.toLowerCase(),a=i?v(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;const k=(a,b)=>{this.chunks.push({pattern:a,alphabet:function(a){let b={};for(let c=0,d=a.length;c<d;c+=1){let e=a.charAt(c);b[e]=(b[e]||0)|1<<d-c-1}return b}(a),startIndex:b})},l=this.pattern.length;if(l>32){let a=0;const b=l%32,c=l-b;for(;a<c;)k(this.pattern.substr(a,32),a),a+=32;if(b){const a=l-32;k(this.pattern.substr(a),a)}}else k(this.pattern,0)}searchIn(a){let{isCaseSensitive:b,ignoreDiacritics:c,includeMatches:d}=this.options;if(a=b?a:a.toLowerCase(),a=c?v(a):a,this.pattern===a){let b={isMatch:!0,score:0};return d&&(b.indices=[[0,a.length-1]]),b}let{location:e,distance:f,threshold:g,findAllMatches:h,minMatchCharLength:i,ignoreLocation:j}=this.options,k=[],l=0,m=!1;this.chunks.forEach(({pattern:b,alphabet:c,startIndex:n})=>{let{isMatch:o,score:p,indices:r}=function(a,b,c,{location:d=q.location,distance:e=q.distance,threshold:f=q.threshold,findAllMatches:g=q.findAllMatches,minMatchCharLength:h=q.minMatchCharLength,includeMatches:i=q.includeMatches,ignoreLocation:j=q.ignoreLocation}={}){let k;if(b.length>32)throw Error("Pattern length exceeds max of 32.");let l=b.length,m=a.length,n=Math.max(0,Math.min(d,m)),o=f,p=n,r=h>1||i,s=r?Array(m):[];for(;(k=a.indexOf(b,p))>-1;)if(o=Math.min(u(b,{currentLocation:k,expectedLocation:n,distance:e,ignoreLocation:j}),o),p=k+l,r){let a=0;for(;a<l;)s[k+a]=1,a+=1}p=-1;let t=[],v=1,w=l+m,x=1<<l-1;for(let d=0;d<l;d+=1){let f=0,h=w;for(;f<h;)u(b,{errors:d,currentLocation:n+h,expectedLocation:n,distance:e,ignoreLocation:j})<=o?f=h:w=h,h=Math.floor((w-f)/2+f);w=h;let i=Math.max(1,n-h+1),k=g?m:Math.min(n+h,m)+l,q=Array(k+2);q[k+1]=(1<<d)-1;for(let f=k;f>=i;f-=1){let g=f-1,h=c[a.charAt(g)];if(r&&(s[g]=+!!h),q[f]=(q[f+1]<<1|1)&h,d&&(q[f]|=(t[f+1]|t[f])<<1|1|t[f+1]),q[f]&x&&(v=u(b,{errors:d,currentLocation:g,expectedLocation:n,distance:e,ignoreLocation:j}))<=o){if(o=v,(p=g)<=n)break;i=Math.max(1,2*n-p)}}if(u(b,{errors:d+1,currentLocation:n,expectedLocation:n,distance:e,ignoreLocation:j})>o)break;t=q}let y={isMatch:p>=0,score:Math.max(.001,v)};if(r){let a=function(a=[],b=q.minMatchCharLength){let c=[],d=-1,e=-1,f=0;for(let g=a.length;f<g;f+=1){let g=a[f];g&&-1===d?d=f:g||-1===d||((e=f-1)-d+1>=b&&c.push([d,e]),d=-1)}return a[f-1]&&f-d>=b&&c.push([d,f-1]),c}(s,h);a.length?i&&(y.indices=a):y.isMatch=!1}return y}(a,b,c,{location:e+n,distance:f,threshold:g,findAllMatches:h,minMatchCharLength:i,includeMatches:d,ignoreLocation:j});o&&(m=!0),l+=p,o&&r&&(k=[...k,...r])});let n={isMatch:m,score:m?l/this.chunks.length:1};return m&&d&&(n.indices=k),n}}class x{constructor(a){this.pattern=a}static isMultiMatch(a){return y(a,this.multiRegex)}static isSingleMatch(a){return y(a,this.singleRegex)}search(){}}function y(a,b){let c=a.match(b);return c?c[1]:null}class z extends x{constructor(a){super(a)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(a){let b=a===this.pattern;return{isMatch:b,score:+!b,indices:[0,this.pattern.length-1]}}}class A extends x{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){let b=-1===a.indexOf(this.pattern);return{isMatch:b,score:+!b,indices:[0,a.length-1]}}}class B extends x{constructor(a){super(a)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(a){let b=a.startsWith(this.pattern);return{isMatch:b,score:+!b,indices:[0,this.pattern.length-1]}}}class C extends x{constructor(a){super(a)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(a){let b=!a.startsWith(this.pattern);return{isMatch:b,score:+!b,indices:[0,a.length-1]}}}class D extends x{constructor(a){super(a)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(a){let b=a.endsWith(this.pattern);return{isMatch:b,score:+!b,indices:[a.length-this.pattern.length,a.length-1]}}}class E extends x{constructor(a){super(a)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(a){let b=!a.endsWith(this.pattern);return{isMatch:b,score:+!b,indices:[0,a.length-1]}}}class F extends x{constructor(a,{location:b=q.location,threshold:c=q.threshold,distance:d=q.distance,includeMatches:e=q.includeMatches,findAllMatches:f=q.findAllMatches,minMatchCharLength:g=q.minMatchCharLength,isCaseSensitive:h=q.isCaseSensitive,ignoreDiacritics:i=q.ignoreDiacritics,ignoreLocation:j=q.ignoreLocation}={}){super(a),this._bitapSearch=new w(a,{location:b,threshold:c,distance:d,includeMatches:e,findAllMatches:f,minMatchCharLength:g,isCaseSensitive:h,ignoreDiacritics:i,ignoreLocation:j})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class G extends x{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let b,c=0,d=[],e=this.pattern.length;for(;(b=a.indexOf(this.pattern,c))>-1;)c=b+e,d.push([b,c-1]);let f=!!d.length;return{isMatch:f,score:+!f,indices:d}}}let H=[z,G,B,C,E,D,A,F],I=H.length,J=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,K=new Set([F.type,G.type]);class L{constructor(a,{isCaseSensitive:b=q.isCaseSensitive,ignoreDiacritics:c=q.ignoreDiacritics,includeMatches:d=q.includeMatches,minMatchCharLength:e=q.minMatchCharLength,ignoreLocation:f=q.ignoreLocation,findAllMatches:g=q.findAllMatches,location:h=q.location,threshold:i=q.threshold,distance:j=q.distance}={}){this.query=null,this.options={isCaseSensitive:b,ignoreDiacritics:c,includeMatches:d,minMatchCharLength:e,findAllMatches:g,ignoreLocation:f,location:h,threshold:i,distance:j},a=b?a:a.toLowerCase(),a=c?v(a):a,this.pattern=a,this.query=function(a,b={}){return a.split("|").map(a=>{let c=a.trim().split(J).filter(a=>a&&!!a.trim()),d=[];for(let a=0,e=c.length;a<e;a+=1){let e=c[a],f=!1,g=-1;for(;!f&&++g<I;){let a=H[g],c=a.isMultiMatch(e);c&&(d.push(new a(c,b)),f=!0)}if(!f)for(g=-1;++g<I;){let a=H[g],c=a.isSingleMatch(e);if(c){d.push(new a(c,b));break}}}return d})}(this.pattern,this.options)}static condition(a,b){return b.useExtendedSearch}searchIn(a){let b=this.query;if(!b)return{isMatch:!1,score:1};let{includeMatches:c,isCaseSensitive:d,ignoreDiacritics:e}=this.options;a=d?a:a.toLowerCase(),a=e?v(a):a;let f=0,g=[],h=0;for(let d=0,e=b.length;d<e;d+=1){let e=b[d];g.length=0,f=0;for(let b=0,d=e.length;b<d;b+=1){let d=e[b],{isMatch:i,indices:j,score:k}=d.search(a);if(i){if(f+=1,h+=k,c){let a=d.constructor.type;K.has(a)?g=[...g,...j]:g.push(j)}}else{h=0,f=0,g.length=0;break}}if(f){let a={isMatch:!0,score:h/f};return c&&(a.indices=g),a}}return{isMatch:!1,score:1}}}let M=[];function N(a,b){for(let c=0,d=M.length;c<d;c+=1){let d=M[c];if(d.condition(a,b))return new d(a,b)}return new w(a,b)}let O="$and",P="$path",Q=a=>!!(a[O]||a.$or),R=a=>({[O]:Object.keys(a).map(b=>({[b]:a[b]}))});function S(a,b,{auto:c=!0}={}){let e=a=>{let g=Object.keys(a),i=!!a[P];if(!i&&g.length>1&&!Q(a))return e(R(a));if(!d(a)&&h(a)&&!Q(a)){let d=i?a[P]:g[0],e=i?a.$val:a[d];if(!f(e))throw Error(`Invalid value for key ${d}`);let h={keyId:p(d),pattern:e};return c&&(h.searcher=N(e,b)),h}let j={children:[],operator:g[0]};return g.forEach(b=>{let c=a[b];d(c)&&c.forEach(a=>{j.children.push(e(a))})}),j};return Q(a)||(a=R(a)),e(a)}function T(a,b){let c=a.matches;b.matches=[],i(c)&&c.forEach(a=>{if(!i(a.indices)||!a.indices.length)return;let{indices:c,value:d}=a,e={indices:c,value:d};a.key&&(e.key=a.key.src),a.idx>-1&&(e.refIndex=a.idx),b.matches.push(e)})}function U(a,b){b.score=a.score}class V{constructor(a,b={},c){this.options={...q,...b},this.options.useExtendedSearch,this._keyStore=new m(this.options.keys),this.setCollection(a,c)}setCollection(a,b){if(this._docs=a,b&&!(b instanceof s))throw Error("Incorrect 'index' type");this._myIndex=b||t(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){i(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){let b=[];for(let c=0,d=this._docs.length;c<d;c+=1){let e=this._docs[c];a(e,c)&&(this.removeAt(c),c-=1,d-=1,b.push(e))}return b}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:b=-1}={}){let{includeMatches:c,includeScore:d,shouldSort:e,sortFn:h,ignoreFieldNorm:i}=this.options,j=f(a)?f(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return!function(a,{ignoreFieldNorm:b=q.ignoreFieldNorm}){a.forEach(a=>{let c=1;a.matches.forEach(({key:a,norm:d,score:e})=>{let f=a?a.weight:null;c*=Math.pow(0===e&&f?Number.EPSILON:e,(f||1)*(b?1:d))}),a.score=c})}(j,{ignoreFieldNorm:i}),e&&j.sort(h),g(b)&&b>-1&&(j=j.slice(0,b)),function(a,b,{includeMatches:c=q.includeMatches,includeScore:d=q.includeScore}={}){let e=[];return c&&e.push(T),d&&e.push(U),a.map(a=>{let{idx:c}=a,d={item:b[c],refIndex:c};return e.length&&e.forEach(b=>{b(a,d)}),d})}(j,this._docs,{includeMatches:c,includeScore:d})}_searchStringList(a){let b=N(a,this.options),{records:c}=this._myIndex,d=[];return c.forEach(({v:a,i:c,n:e})=>{if(!i(a))return;let{isMatch:f,score:g,indices:h}=b.searchIn(a);f&&d.push({item:a,idx:c,matches:[{score:g,value:a,norm:e,indices:h}]})}),d}_searchLogical(a){let b=S(a,this.options),c=(a,b,d)=>{if(!a.children){let{keyId:c,searcher:e}=a,f=this._findMatches({key:this._keyStore.get(c),value:this._myIndex.getValueForItemAtKeyId(b,c),searcher:e});return f&&f.length?[{idx:d,item:b,matches:f}]:[]}let e=[];for(let f=0,g=a.children.length;f<g;f+=1){let g=c(a.children[f],b,d);if(g.length)e.push(...g);else if(a.operator===O)return[]}return e},d=this._myIndex.records,e={},f=[];return d.forEach(({$:a,i:d})=>{if(i(a)){let g=c(b,a,d);g.length&&(e[d]||(e[d]={idx:d,item:a,matches:[]},f.push(e[d])),g.forEach(({matches:a})=>{e[d].matches.push(...a)}))}}),f}_searchObjectList(a){let b=N(a,this.options),{keys:c,records:d}=this._myIndex,e=[];return d.forEach(({$:a,i:d})=>{if(!i(a))return;let f=[];c.forEach((c,d)=>{f.push(...this._findMatches({key:c,value:a[d],searcher:b}))}),f.length&&e.push({idx:d,item:a,matches:f})}),e}_findMatches({key:a,value:b,searcher:c}){if(!i(b))return[];let e=[];if(d(b))b.forEach(({v:b,i:d,n:f})=>{if(!i(b))return;let{isMatch:g,score:h,indices:j}=c.searchIn(b);g&&e.push({score:h,key:a,value:b,idx:d,norm:f,indices:j})});else{let{v:d,n:f}=b,{isMatch:g,score:h,indices:i}=c.searchIn(d);g&&e.push({score:h,key:a,value:d,norm:f,indices:i})}return e}}V.version="7.1.0",V.createIndex=t,V.parseIndex=function(a,{getFn:b=q.getFn,fieldNormWeight:c=q.fieldNormWeight}={}){let{keys:d,records:e}=a,f=new s({getFn:b,fieldNormWeight:c});return f.setKeys(d),f.setIndexRecords(e),f},V.config=q,V.parseQuery=S,function(...a){M.push(...a)}(L)}};
|