@geminilight/mindos 0.6.40 → 0.6.42
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 +17 -16
- 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 +5 -1
- package/_standalone/.next/routes-manifest.json +6 -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 +2 -2
- 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 +1 -1
- 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/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/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/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/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.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.js.nft.json +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.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.js +1 -0
- package/_standalone/.next/server/app/api/mcp/uninstall/route.js.nft.json +1 -0
- package/_standalone/.next/server/app/api/mcp/uninstall/route_client-reference-manifest.js +1 -0
- 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.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_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.js +4 -4
- 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.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/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 +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 +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 +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 +3 -3
- 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 +17 -16
- package/_standalone/.next/server/chunks/1550.js +1 -1
- package/_standalone/.next/server/chunks/2190.js +11 -0
- package/_standalone/.next/server/chunks/{6365.js → 3262.js} +2 -2
- package/_standalone/.next/server/chunks/5648.js +2 -0
- package/_standalone/.next/server/chunks/6539.js +1 -1
- package/_standalone/.next/server/chunks/8388.js +1 -1
- package/_standalone/.next/server/chunks/953.js +1 -1
- package/_standalone/.next/server/chunks/9539.js +219 -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/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/GB-YReQ58tsvCuwlzrkMZ/_buildManifest.js +1 -0
- package/_standalone/.next/static/chunks/1053-67f0ce444d1227e2.js +29 -0
- package/_standalone/.next/static/chunks/{8663-de911d2d395622be.js → 1880-c2a9e76201841c86.js} +1 -1
- package/_standalone/.next/static/chunks/3637.0541ac2d0ea7de1f.js +1 -0
- package/_standalone/.next/static/chunks/4563-b2a2ce80aff845af.js +6 -0
- package/_standalone/.next/static/chunks/6981-3d7dcac2d12a5670.js +1 -0
- package/_standalone/.next/static/chunks/7144-5febf62f1a79fe64.js +1 -0
- package/_standalone/.next/static/chunks/app/.well-known/agent-card.json/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/_global-error/page-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/agents/[agentKey]/page-773071a99c4daac2.js +1 -0
- package/_standalone/.next/static/chunks/app/agents/page-eac6c5f6650dbf62.js +5 -0
- package/_standalone/.next/static/chunks/app/api/a2a/agents/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/a2a/delegations/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/a2a/discover/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/a2a/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/acp/config/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/acp/detect/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/acp/install/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/acp/registry/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/acp/session/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/agent-activity/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/ask/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/ask-sessions/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/auth/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/backlinks/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/bootstrap/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/changes/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/export/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/extract-pdf/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/file/import/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/file/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/files/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/git/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/graph/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/health/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/inbox/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/init/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/agents/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/install/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/install-skill/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/restart/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/status/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/mcp/uninstall/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/monitoring/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/recent-files/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/restart/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/search/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/settings/list-models/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/settings/reset-token/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/settings/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/settings/test-key/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/setup/check-path/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/setup/check-port/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/setup/generate-token/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/setup/ls/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/setup/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/skills/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/sync/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/tree-version/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/uninstall/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/update/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/update-check/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/update-status/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/api/workflows/route-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/echo/page-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/help/page-2325d25b6846ca07.js +1 -0
- package/_standalone/.next/static/chunks/app/{layout-9378c1c8d3e5761b.js → layout-7cb442df92212140.js} +55 -55
- package/_standalone/.next/static/chunks/app/{page-9bae420fbbdc5fff.js → page-aaee2d9bd3d3eabb.js} +1 -1
- package/_standalone/.next/static/chunks/app/setup/page-6132ea7632e08a9b.js +1 -0
- package/_standalone/.next/static/chunks/app/trash/{page-b61ef2d5cd4f8d73.js → page-7b5cbf541c315db2.js} +1 -1
- package/_standalone/.next/static/chunks/app/view/[...path]/loading-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/app/view/[...path]/page-b72e4f88c8c48181.js +12 -0
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-84943536516b00b2.js +1 -0
- package/_standalone/.next/static/chunks/{webpack-c28c55d0a6021a6b.js → webpack-7b276daaa930d480.js} +1 -1
- package/_standalone/.next/static/css/bc9179074eaf65ae.css +1 -0
- package/_standalone/.next/trace +63 -63
- package/_standalone/.next/types/routes.d.ts +2 -1
- package/_standalone/.next/types/validator.ts +9 -0
- package/_standalone/__tests__/api/mcp-install.test.ts +23 -0
- package/_standalone/__tests__/cli/agent-routing.test.ts +232 -0
- package/_standalone/__tests__/cli/file-subcommands.test.ts +379 -0
- package/_standalone/__tests__/core/tools.test.ts +3 -6
- package/_standalone/components/FileTree.tsx +3 -2
- package/_standalone/components/MarkdownView.tsx +30 -15
- package/_standalone/components/RightAskPanel.tsx +36 -6
- package/_standalone/components/Sidebar.tsx +3 -3
- package/_standalone/components/agents/AgentsMcpSection.tsx +27 -5
- package/_standalone/components/settings/McpAgentInstall.tsx +94 -27
- package/_standalone/components/settings/McpSkillsSection.tsx +1 -1
- package/_standalone/components/settings/McpTab.tsx +484 -340
- package/_standalone/components/settings/SettingsContent.tsx +12 -6
- package/_standalone/components/settings/types.ts +3 -0
- package/_standalone/components/setup/StepAgents.tsx +113 -47
- package/_standalone/components/setup/StepReview.tsx +14 -27
- package/_standalone/components/setup/types.ts +7 -0
- package/_standalone/data/skills/mindos/SKILL.md +92 -92
- package/_standalone/data/skills/mindos/references/write-supplement.md +119 -0
- package/_standalone/data/skills/mindos-zh/SKILL.md +100 -104
- package/_standalone/data/skills/mindos-zh/references/write-supplement.md +119 -0
- package/_standalone/lib/i18n/modules/features.ts +4 -4
- package/_standalone/lib/i18n/modules/knowledge.ts +4 -0
- package/_standalone/lib/i18n/modules/onboarding.ts +40 -30
- package/_standalone/lib/i18n/modules/panels.ts +6 -2
- package/_standalone/lib/i18n/modules/settings.ts +78 -6
- package/_standalone/lib/mcp-snippets.ts +5 -1
- package/_standalone/tsconfig.tsbuildinfo +1 -1
- package/app/app/api/ask/route.ts +3 -2
- package/app/app/api/mcp/install/route.ts +15 -3
- package/app/app/api/mcp/status/route.ts +14 -6
- package/app/app/api/mcp/uninstall/route.ts +130 -0
- package/app/app/api/skills/route.ts +14 -1
- package/app/app/view/[...path]/ViewPageClient.tsx +12 -27
- package/app/components/FileTree.tsx +3 -2
- package/app/components/MarkdownView.tsx +30 -15
- package/app/components/RightAskPanel.tsx +36 -6
- package/app/components/Sidebar.tsx +3 -3
- package/app/components/agents/AgentsMcpSection.tsx +27 -5
- package/app/components/help/HelpContent.tsx +1 -0
- package/app/components/settings/McpAgentInstall.tsx +94 -27
- package/app/components/settings/McpSkillsSection.tsx +1 -1
- package/app/components/settings/McpTab.tsx +484 -340
- package/app/components/settings/SettingsContent.tsx +12 -6
- package/app/components/settings/types.ts +3 -0
- package/app/components/setup/StepAgents.tsx +113 -47
- package/app/components/setup/StepReview.tsx +14 -27
- package/app/components/setup/index.tsx +16 -14
- package/app/components/setup/types.ts +7 -0
- package/app/data/skills/mindos/SKILL.md +92 -92
- package/app/data/skills/mindos/references/write-supplement.md +119 -0
- package/app/data/skills/mindos-zh/SKILL.md +100 -104
- package/app/data/skills/mindos-zh/references/write-supplement.md +119 -0
- package/app/lib/fs.ts +0 -6
- package/app/lib/i18n/modules/features.ts +4 -4
- package/app/lib/i18n/modules/knowledge.ts +4 -0
- package/app/lib/i18n/modules/onboarding.ts +40 -30
- package/app/lib/i18n/modules/panels.ts +6 -2
- package/app/lib/i18n/modules/settings.ts +78 -6
- package/app/lib/mcp-agents.ts +1 -2
- package/app/lib/mcp-snippets.ts +5 -1
- package/app/lib/renderers/index.ts +2 -1
- package/app/lib/settings.ts +32 -0
- package/bin/cli.js +168 -1404
- package/bin/commands/agent.js +156 -20
- package/bin/commands/api.js +14 -11
- package/bin/commands/ask.js +79 -68
- package/bin/commands/build.js +26 -0
- package/bin/commands/config.js +170 -0
- package/bin/commands/dev.js +58 -0
- package/bin/commands/doctor.js +205 -0
- package/bin/commands/file.js +551 -36
- package/bin/commands/gateway.js +42 -0
- package/bin/commands/init-skills.js +56 -0
- package/bin/commands/logs.js +32 -0
- package/bin/commands/mcp-cmd.js +57 -0
- package/bin/commands/onboard.js +25 -0
- package/bin/commands/open.js +41 -0
- package/bin/commands/restart.js +48 -0
- package/bin/commands/search.js +16 -14
- package/bin/commands/space.js +96 -25
- package/bin/commands/start.js +272 -0
- package/bin/commands/status.js +2 -2
- package/bin/commands/stop.js +14 -0
- package/bin/commands/sync-cmd.js +134 -0
- package/bin/commands/token.js +98 -0
- package/bin/commands/uninstall.js +154 -0
- package/bin/commands/update.js +286 -0
- package/bin/lib/build.js +1 -1
- package/bin/lib/colors.js +8 -7
- package/bin/lib/command.js +37 -96
- package/bin/lib/config.js +5 -0
- package/bin/lib/csv.js +19 -0
- package/bin/lib/jsonc.js +12 -0
- package/bin/lib/markdown.js +69 -0
- package/bin/lib/mcp-agents.js +1 -6
- package/bin/lib/mcp-build.js +1 -1
- package/bin/lib/mcp-install.js +2 -1
- package/bin/lib/one-shot.js +88 -0
- package/bin/lib/path-expand.js +9 -0
- package/bin/lib/remote.js +65 -0
- package/bin/lib/repl.js +167 -0
- package/bin/lib/{utils.js → shell.js} +10 -26
- package/bin/lib/skill-check.js +116 -21
- package/bin/lib/sse-stream.js +167 -0
- package/package.json +2 -2
- package/scripts/setup.js +210 -120
- package/skills/mindos/SKILL.md +94 -95
- package/skills/mindos-zh/SKILL.md +103 -106
- package/_standalone/.next/server/chunks/1955.js +0 -11
- package/_standalone/.next/server/chunks/3680.js +0 -1
- package/_standalone/.next/server/chunks/4497.js +0 -219
- package/_standalone/.next/server/chunks/5560.js +0 -2
- package/_standalone/.next/static/chunks/1053-0adaccc98a752a58.js +0 -29
- package/_standalone/.next/static/chunks/3637.f9a42cca59fd5bb5.js +0 -1
- package/_standalone/.next/static/chunks/4563-c2afaeacb241d1d0.js +0 -6
- package/_standalone/.next/static/chunks/6090-c98268ca726a68d3.js +0 -1
- package/_standalone/.next/static/chunks/9371-575600301da5d6bb.js +0 -1
- package/_standalone/.next/static/chunks/app/.well-known/agent-card.json/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/_global-error/page-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/agents/[agentKey]/page-3e08abb495ecd5fd.js +0 -1
- package/_standalone/.next/static/chunks/app/agents/page-e7e0f87ad3d765ac.js +0 -5
- package/_standalone/.next/static/chunks/app/api/a2a/agents/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/a2a/delegations/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/a2a/discover/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/a2a/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/acp/config/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/acp/detect/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/acp/install/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/acp/registry/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/acp/session/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/agent-activity/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/ask/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/ask-sessions/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/auth/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/backlinks/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/bootstrap/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/changes/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/export/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/extract-pdf/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/file/import/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/file/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/files/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/git/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/graph/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/health/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/inbox/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/init/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/agents/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/install/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/install-skill/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/restart/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/mcp/status/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/monitoring/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/recent-files/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/restart/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/search/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/settings/list-models/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/settings/reset-token/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/settings/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/settings/test-key/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/setup/check-path/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/setup/check-port/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/setup/generate-token/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/setup/ls/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/setup/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/skills/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/sync/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/tree-version/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/uninstall/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/update/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/update-check/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/update-status/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/api/workflows/route-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/echo/page-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/help/page-3d0e1ceaa4abc243.js +0 -1
- package/_standalone/.next/static/chunks/app/setup/page-99ed3d1bb6b8f4ef.js +0 -1
- package/_standalone/.next/static/chunks/app/view/[...path]/loading-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/app/view/[...path]/page-44fa78cbea613a78.js +0 -12
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-400c3c09b1540c14.js +0 -1
- package/_standalone/.next/static/css/d300701f384db50d.css +0 -1
- package/_standalone/.next/static/rZLs1krFuduixvcVNe6q3/_buildManifest.js +0 -1
- package/_standalone/components/renderers/agent-inspector/manifest.ts +0 -16
- /package/_standalone/.next/static/{rZLs1krFuduixvcVNe6q3 → GB-YReQ58tsvCuwlzrkMZ}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One-shot (non-interactive) execution for CLI agent/chat commands.
|
|
3
|
+
*
|
|
4
|
+
* Counterpart to lib/repl.js (interactive mode).
|
|
5
|
+
* Shared between `mindos agent -p` and `mindos ask -p`.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { dim, red } from './colors.js';
|
|
9
|
+
import { streamSSE, postAsk, checkHealth } from './sse-stream.js';
|
|
10
|
+
import { EXIT } from './command.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Execute a single AI request, stream the response, and exit.
|
|
14
|
+
*
|
|
15
|
+
* @param {object} opts
|
|
16
|
+
* @param {string} opts.baseUrl - e.g. http://localhost:3456
|
|
17
|
+
* @param {string} opts.token - auth token
|
|
18
|
+
* @param {string} opts.message - user message / task
|
|
19
|
+
* @param {'agent'|'chat'} opts.mode
|
|
20
|
+
* @param {boolean} [opts.showTools=false] - show tool calls in output
|
|
21
|
+
* @param {number} [opts.maxSteps] - max agent steps
|
|
22
|
+
* @param {string[]} [opts.attachedFiles] - file attachments
|
|
23
|
+
* @param {boolean} [opts.json=false] - output as JSON
|
|
24
|
+
*/
|
|
25
|
+
export async function executeOneShot(opts) {
|
|
26
|
+
const {
|
|
27
|
+
baseUrl, token, message, mode,
|
|
28
|
+
showTools = false,
|
|
29
|
+
maxSteps,
|
|
30
|
+
attachedFiles,
|
|
31
|
+
json = false,
|
|
32
|
+
} = opts;
|
|
33
|
+
|
|
34
|
+
const healthy = await checkHealth(baseUrl);
|
|
35
|
+
if (!healthy) {
|
|
36
|
+
console.error(red('MindOS is not running. Start it with: mindos start'));
|
|
37
|
+
process.exit(EXIT.CONNECT);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (!json) {
|
|
41
|
+
process.stdout.write(dim('Thinking...'));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const body = {
|
|
45
|
+
messages: [{ role: 'user', content: message, timestamp: Date.now() }],
|
|
46
|
+
mode,
|
|
47
|
+
};
|
|
48
|
+
if (attachedFiles) body.attachedFiles = attachedFiles;
|
|
49
|
+
if (maxSteps) body.maxSteps = maxSteps;
|
|
50
|
+
|
|
51
|
+
try {
|
|
52
|
+
const res = await postAsk(baseUrl, body, token);
|
|
53
|
+
|
|
54
|
+
if (!res.ok) {
|
|
55
|
+
const errText = await res.text();
|
|
56
|
+
if (!json) process.stdout.write('\r\x1b[K');
|
|
57
|
+
console.error(red(`API error (${res.status}): ${errText}`));
|
|
58
|
+
process.exit(EXIT.ERROR);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const contentType = res.headers.get('content-type') || '';
|
|
62
|
+
|
|
63
|
+
if (contentType.includes('text/event-stream')) {
|
|
64
|
+
const result = await streamSSE(res, { showTools, json });
|
|
65
|
+
|
|
66
|
+
if (json) {
|
|
67
|
+
const out = { answer: result.text, error: result.error || undefined };
|
|
68
|
+
if (showTools) out.toolCalls = result.toolCalls;
|
|
69
|
+
console.log(JSON.stringify(out, null, 2));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (result.error) process.exit(EXIT.ERROR);
|
|
73
|
+
} else {
|
|
74
|
+
const data = await res.json();
|
|
75
|
+
if (!json) process.stdout.write('\r\x1b[K');
|
|
76
|
+
|
|
77
|
+
if (json) {
|
|
78
|
+
console.log(JSON.stringify(data, null, 2));
|
|
79
|
+
} else {
|
|
80
|
+
console.log(data.answer || data.text || JSON.stringify(data, null, 2));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
} catch (err) {
|
|
84
|
+
if (!json) process.stdout.write('\r\x1b[K');
|
|
85
|
+
console.error(red(err.message));
|
|
86
|
+
process.exit(EXIT.ERROR);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remote-mode HTTP helpers for MindOS CLI.
|
|
3
|
+
*
|
|
4
|
+
* When MINDOS_URL is set to a non-localhost address, CLI commands should
|
|
5
|
+
* use these helpers to make HTTP API calls instead of direct fs operations.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Check if CLI is operating in remote mode.
|
|
10
|
+
* Remote = MINDOS_URL is set and not pointing to localhost/127.0.0.1.
|
|
11
|
+
*/
|
|
12
|
+
export function isRemoteMode() {
|
|
13
|
+
const url = process.env.MINDOS_URL;
|
|
14
|
+
if (!url) return false;
|
|
15
|
+
try {
|
|
16
|
+
const parsed = new URL(url);
|
|
17
|
+
const host = parsed.hostname;
|
|
18
|
+
return host !== 'localhost' && host !== '127.0.0.1' && host !== '::1' && host !== '0.0.0.0';
|
|
19
|
+
} catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get the base URL for API calls.
|
|
26
|
+
* In remote mode: MINDOS_URL
|
|
27
|
+
* In local mode: http://localhost:<MINDOS_WEB_PORT || 3456>
|
|
28
|
+
*/
|
|
29
|
+
export function getBaseUrl() {
|
|
30
|
+
if (process.env.MINDOS_URL) return process.env.MINDOS_URL.replace(/\/$/, '');
|
|
31
|
+
const port = process.env.MINDOS_WEB_PORT || '3456';
|
|
32
|
+
return `http://localhost:${port}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Build headers with auth token if available.
|
|
37
|
+
*/
|
|
38
|
+
export function getAuthHeaders() {
|
|
39
|
+
const headers = { 'Content-Type': 'application/json' };
|
|
40
|
+
const token = process.env.AUTH_TOKEN || process.env.MINDOS_AUTH_TOKEN;
|
|
41
|
+
if (token) headers['Authorization'] = `Bearer ${token}`;
|
|
42
|
+
return headers;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Make an authenticated API call to the MindOS backend.
|
|
47
|
+
* @param {string} path - API path (e.g. '/api/file')
|
|
48
|
+
* @param {object} [options] - fetch options (method, body, etc.)
|
|
49
|
+
* @returns {Promise<Response>}
|
|
50
|
+
*/
|
|
51
|
+
export async function apiCall(path, options = {}) {
|
|
52
|
+
const url = `${getBaseUrl()}${path}`;
|
|
53
|
+
const headers = { ...getAuthHeaders(), ...options.headers };
|
|
54
|
+
const res = await fetch(url, { ...options, headers });
|
|
55
|
+
if (!res.ok) {
|
|
56
|
+
const text = await res.text().catch(() => '');
|
|
57
|
+
const hint = res.status === 401
|
|
58
|
+
? ' (check AUTH_TOKEN — run `mindos token` on the server)'
|
|
59
|
+
: res.status === 404
|
|
60
|
+
? ' (is MindOS running? try `mindos start`)'
|
|
61
|
+
: '';
|
|
62
|
+
throw new Error(`API ${res.status}: ${text || res.statusText}${hint}`);
|
|
63
|
+
}
|
|
64
|
+
return res;
|
|
65
|
+
}
|
package/bin/lib/repl.js
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive REPL for CLI agent/chat sessions.
|
|
3
|
+
*
|
|
4
|
+
* Provides a multi-turn conversation loop with SSE streaming.
|
|
5
|
+
* Shared between `mindos agent` and `mindos ask` commands.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as readline from 'node:readline';
|
|
9
|
+
import { bold, dim, cyan, red } from './colors.js';
|
|
10
|
+
import { streamSSE, postAsk, checkHealth } from './sse-stream.js';
|
|
11
|
+
import { EXIT } from './command.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param {object} opts
|
|
15
|
+
* @param {string} opts.baseUrl - e.g. http://localhost:3456
|
|
16
|
+
* @param {string} opts.token - auth token
|
|
17
|
+
* @param {'agent'|'chat'} opts.mode
|
|
18
|
+
* @param {string} opts.prompt - readline prompt string (e.g. "agent> ")
|
|
19
|
+
* @param {string} opts.welcome - welcome message shown on start
|
|
20
|
+
* @param {boolean} opts.showTools - show tool calls in output
|
|
21
|
+
* @param {string[]} [opts.attachedFiles] - initial file attachments
|
|
22
|
+
* @param {number} [opts.maxSteps] - max agent steps per turn
|
|
23
|
+
*/
|
|
24
|
+
export async function startRepl(opts) {
|
|
25
|
+
const {
|
|
26
|
+
baseUrl, token, mode, prompt, welcome,
|
|
27
|
+
showTools = true,
|
|
28
|
+
attachedFiles,
|
|
29
|
+
maxSteps,
|
|
30
|
+
} = opts;
|
|
31
|
+
|
|
32
|
+
const healthy = await checkHealth(baseUrl);
|
|
33
|
+
if (!healthy) {
|
|
34
|
+
console.error(red('\n MindOS is not running. Start it with: mindos start\n'));
|
|
35
|
+
process.exit(EXIT.CONNECT);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
console.log(`\n ${welcome}`);
|
|
39
|
+
console.log(` ${dim('Type "exit" or press Ctrl+C to quit.')}\n`);
|
|
40
|
+
|
|
41
|
+
const messages = [];
|
|
42
|
+
let busy = false;
|
|
43
|
+
let exiting = false;
|
|
44
|
+
|
|
45
|
+
const rl = readline.createInterface({
|
|
46
|
+
input: process.stdin,
|
|
47
|
+
output: process.stdout,
|
|
48
|
+
prompt: cyan(prompt),
|
|
49
|
+
terminal: true,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
rl.prompt();
|
|
53
|
+
|
|
54
|
+
rl.on('line', async (line) => {
|
|
55
|
+
const input = line.trim();
|
|
56
|
+
|
|
57
|
+
if (!input) {
|
|
58
|
+
rl.prompt();
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (input === 'exit' || input === 'quit' || input === '/exit' || input === '/quit') {
|
|
63
|
+
exitGracefully();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (input === '/clear') {
|
|
68
|
+
messages.length = 0;
|
|
69
|
+
console.log(dim(' Conversation cleared.\n'));
|
|
70
|
+
rl.prompt();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Prevent concurrent requests — queue is dropped, user gets feedback
|
|
75
|
+
if (busy) {
|
|
76
|
+
console.log(dim(' Still processing previous message. Please wait.\n'));
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
busy = true;
|
|
81
|
+
messages.push({ role: 'user', content: input, timestamp: Date.now() });
|
|
82
|
+
|
|
83
|
+
// Keep last 40 messages to prevent unbounded payload growth
|
|
84
|
+
const MAX_CONTEXT = 40;
|
|
85
|
+
const contextMessages = messages.length > MAX_CONTEXT
|
|
86
|
+
? messages.slice(-MAX_CONTEXT)
|
|
87
|
+
: [...messages];
|
|
88
|
+
|
|
89
|
+
const body = { messages: contextMessages, mode };
|
|
90
|
+
if (attachedFiles) body.attachedFiles = attachedFiles;
|
|
91
|
+
if (maxSteps) body.maxSteps = maxSteps;
|
|
92
|
+
|
|
93
|
+
process.stdout.write('\n');
|
|
94
|
+
|
|
95
|
+
try {
|
|
96
|
+
const res = await postAsk(baseUrl, body, token);
|
|
97
|
+
|
|
98
|
+
if (!res.ok) {
|
|
99
|
+
const errText = await res.text();
|
|
100
|
+
console.error(red(` API error (${res.status}): ${errText}\n`));
|
|
101
|
+
messages.pop();
|
|
102
|
+
busy = false;
|
|
103
|
+
rl.prompt();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const contentType = res.headers.get('content-type') || '';
|
|
108
|
+
|
|
109
|
+
if (contentType.includes('text/event-stream')) {
|
|
110
|
+
const result = await streamSSE(res, { showTools, json: false });
|
|
111
|
+
|
|
112
|
+
if (result.error) {
|
|
113
|
+
console.error(red(' Error in this turn. You can retry.\n'));
|
|
114
|
+
messages.pop();
|
|
115
|
+
busy = false;
|
|
116
|
+
rl.prompt();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (result.text) {
|
|
121
|
+
messages.push({
|
|
122
|
+
role: 'assistant',
|
|
123
|
+
content: result.text,
|
|
124
|
+
timestamp: Date.now(),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
} else {
|
|
128
|
+
const data = await res.json();
|
|
129
|
+
const answer = data.answer || data.text || JSON.stringify(data, null, 2);
|
|
130
|
+
console.log(answer);
|
|
131
|
+
|
|
132
|
+
messages.push({
|
|
133
|
+
role: 'assistant',
|
|
134
|
+
content: answer,
|
|
135
|
+
timestamp: Date.now(),
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
} catch (err) {
|
|
139
|
+
console.error(red(` ${err.message}\n`));
|
|
140
|
+
messages.pop();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
busy = false;
|
|
144
|
+
console.log();
|
|
145
|
+
rl.prompt();
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
rl.on('close', () => {
|
|
149
|
+
exitGracefully();
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
rl.on('SIGINT', () => {
|
|
153
|
+
console.log(dim('\n (Press Ctrl+C again or type "exit" to quit)'));
|
|
154
|
+
rl.once('SIGINT', () => {
|
|
155
|
+
exitGracefully();
|
|
156
|
+
});
|
|
157
|
+
rl.prompt();
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
function exitGracefully() {
|
|
161
|
+
if (exiting) return;
|
|
162
|
+
exiting = true;
|
|
163
|
+
console.log(dim('\n Goodbye.\n'));
|
|
164
|
+
rl.close();
|
|
165
|
+
process.exit(0);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell execution helpers — inheriting stdio.
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
import { execSync } from 'node:child_process';
|
|
2
|
-
import { resolve } from 'node:path';
|
|
3
|
-
import { homedir } from 'node:os';
|
|
4
6
|
import { ROOT } from './constants.js';
|
|
5
7
|
|
|
6
8
|
/**
|
|
9
|
+
* @param {string} command
|
|
10
|
+
* @param {string} [cwd]
|
|
7
11
|
* @param {Record<string, string | undefined>} [envPatch] merged into process.env (for child only)
|
|
8
12
|
*/
|
|
9
|
-
export
|
|
13
|
+
export const execInherited = (command, cwd = ROOT, envPatch) => {
|
|
10
14
|
try {
|
|
11
15
|
const env = envPatch ? { ...process.env, ...envPatch } : process.env;
|
|
12
16
|
execSync(command, { cwd, stdio: 'inherit', env });
|
|
13
17
|
} catch (err) {
|
|
14
18
|
process.exit(err.status || 1);
|
|
15
19
|
}
|
|
16
|
-
}
|
|
20
|
+
};
|
|
17
21
|
|
|
18
22
|
/**
|
|
19
23
|
* Run `npm install` with --prefer-offline for speed, auto-fallback to online
|
|
20
24
|
* if the local cache is stale or missing a required package version.
|
|
21
|
-
*
|
|
22
|
-
* @param {string} cwd - Directory to run in
|
|
23
|
-
* @param {string} [extraFlags=''] - Additional npm flags (e.g. '--no-workspaces')
|
|
24
25
|
*/
|
|
25
|
-
export
|
|
26
|
+
export const npmInstall = (cwd, extraFlags = '') => {
|
|
26
27
|
const base = `npm install ${extraFlags}`.trim();
|
|
27
28
|
try {
|
|
28
29
|
execSync(`${base} --prefer-offline`, { cwd, stdio: 'inherit', env: process.env });
|
|
29
30
|
} catch {
|
|
30
|
-
// Cache miss or stale packument — retry online
|
|
31
31
|
try {
|
|
32
32
|
execSync(base, { cwd, stdio: 'inherit', env: process.env });
|
|
33
33
|
} catch (err) {
|
|
@@ -36,20 +36,4 @@ export function npmInstall(cwd, extraFlags = '') {
|
|
|
36
36
|
process.exit(err.status || 1);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function expandHome(p) {
|
|
42
|
-
return p.startsWith('~/') ? resolve(homedir(), p.slice(2)) : p;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Parse JSONC — strips single-line and block comments before JSON.parse.
|
|
47
|
-
* VS Code-based editors (Cursor, Windsurf, Cline) use JSONC for config files.
|
|
48
|
-
*/
|
|
49
|
-
export function parseJsonc(text) {
|
|
50
|
-
// Strip single-line comments (not inside quoted strings)
|
|
51
|
-
let stripped = text.replace(/\\"|"(?:\\"|[^"])*"|(\/\/.*$)/gm, (m, g) => g ? '' : m);
|
|
52
|
-
// Strip block comments
|
|
53
|
-
stripped = stripped.replace(/\/\*[\s\S]*?\*\//g, '');
|
|
54
|
-
return JSON.parse(stripped);
|
|
55
|
-
}
|
|
39
|
+
};
|
package/bin/lib/skill-check.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { existsSync, readFileSync, copyFileSync } from 'node:fs';
|
|
2
|
-
import { resolve } from 'node:path';
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync, copyFileSync, mkdirSync } from 'node:fs';
|
|
2
|
+
import { resolve, dirname } from 'node:path';
|
|
3
3
|
import { homedir } from 'node:os';
|
|
4
4
|
import { createInterface } from 'node:readline';
|
|
5
5
|
import { ROOT } from './constants.js';
|
|
@@ -7,11 +7,10 @@ import { bold, dim, cyan, green, yellow, isTTY } from './colors.js';
|
|
|
7
7
|
|
|
8
8
|
const SKILLS = ['mindos', 'mindos-zh'];
|
|
9
9
|
const INSTALLED_BASE = resolve(homedir(), '.agents', 'skills');
|
|
10
|
+
const CONFIG_PATH = resolve(homedir(), '.mindos', 'config.json');
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Simple semver "a > b" comparison (major.minor.patch only).
|
|
13
|
-
* Intentionally inlined (same as update-check.js) to keep this module
|
|
14
|
-
* self-contained — no cross-module dependency for a 10-line function.
|
|
15
14
|
*/
|
|
16
15
|
function semverGt(a, b) {
|
|
17
16
|
const pa = a.split('.').map(Number);
|
|
@@ -37,70 +36,165 @@ export function extractSkillVersion(filePath) {
|
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
|
|
39
|
+
/* ── Config helpers (read/write installedSkillAgents) ─────────── */
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Read config.json, best-effort.
|
|
43
|
+
*/
|
|
44
|
+
function readConfig() {
|
|
45
|
+
try {
|
|
46
|
+
return JSON.parse(readFileSync(CONFIG_PATH, 'utf-8'));
|
|
47
|
+
} catch {
|
|
48
|
+
return {};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Merge fields into config.json (preserves all existing fields).
|
|
54
|
+
*/
|
|
55
|
+
function mergeConfig(patch) {
|
|
56
|
+
const config = readConfig();
|
|
57
|
+
Object.assign(config, patch);
|
|
58
|
+
const dir = dirname(CONFIG_PATH);
|
|
59
|
+
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
60
|
+
writeFileSync(CONFIG_PATH, JSON.stringify(config, null, 2) + '\n', 'utf-8');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Read the installed-skill-agents list from config.
|
|
65
|
+
* @returns {Array<{ agent: string, skill: string, path: string }>}
|
|
66
|
+
*/
|
|
67
|
+
export function getInstalledSkillAgents() {
|
|
68
|
+
const config = readConfig();
|
|
69
|
+
return Array.isArray(config.installedSkillAgents) ? config.installedSkillAgents : [];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Record that a skill was installed to a specific agent.
|
|
74
|
+
* Idempotent — updates existing entry if agent+skill already recorded.
|
|
75
|
+
*/
|
|
76
|
+
export function recordSkillInstall(agentKey, skillName, installPath) {
|
|
77
|
+
const list = getInstalledSkillAgents();
|
|
78
|
+
const idx = list.findIndex(e => e.agent === agentKey && e.skill === skillName);
|
|
79
|
+
const entry = { agent: agentKey, skill: skillName, path: installPath };
|
|
80
|
+
if (idx >= 0) {
|
|
81
|
+
list[idx] = entry;
|
|
82
|
+
} else {
|
|
83
|
+
list.push(entry);
|
|
84
|
+
}
|
|
85
|
+
mergeConfig({ installedSkillAgents: list });
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Remove a skill record for an agent.
|
|
90
|
+
*/
|
|
91
|
+
export function removeSkillRecord(agentKey, skillName) {
|
|
92
|
+
const list = getInstalledSkillAgents();
|
|
93
|
+
const filtered = list.filter(e => !(e.agent === agentKey && e.skill === skillName));
|
|
94
|
+
if (filtered.length !== list.length) {
|
|
95
|
+
mergeConfig({ installedSkillAgents: filtered });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* ── Version checking ─────────────────────────────────────────── */
|
|
100
|
+
|
|
40
101
|
/**
|
|
41
102
|
* Compare installed vs bundled skill versions.
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
103
|
+
* Checks both the default ~/.agents/skills/ path AND all agent-specific
|
|
104
|
+
* paths recorded in config.installedSkillAgents.
|
|
105
|
+
*
|
|
106
|
+
* @param {string} [root] — package root (defaults to ROOT)
|
|
107
|
+
* @returns {Array<{ name, installed, bundled, installPath, bundledPath, agent? }>}
|
|
46
108
|
*/
|
|
47
109
|
export function checkSkillVersions(root) {
|
|
48
110
|
const base = root || ROOT;
|
|
49
111
|
const mismatches = [];
|
|
112
|
+
const seen = new Set(); // dedup by installPath
|
|
113
|
+
|
|
114
|
+
// 1. Check default ~/.agents/skills/ (legacy path)
|
|
50
115
|
for (const name of SKILLS) {
|
|
51
116
|
const installPath = resolve(INSTALLED_BASE, name, 'SKILL.md');
|
|
52
117
|
const bundledPath = resolve(base, 'skills', name, 'SKILL.md');
|
|
118
|
+
if (!existsSync(installPath) || !existsSync(bundledPath)) continue;
|
|
119
|
+
const installed = extractSkillVersion(installPath);
|
|
120
|
+
const bundled = extractSkillVersion(bundledPath);
|
|
121
|
+
if (!installed || !bundled) continue;
|
|
122
|
+
if (semverGt(bundled, installed)) {
|
|
123
|
+
mismatches.push({ name, installed, bundled, installPath, bundledPath });
|
|
124
|
+
}
|
|
125
|
+
seen.add(installPath);
|
|
126
|
+
}
|
|
53
127
|
|
|
54
|
-
|
|
128
|
+
// 2. Check agent-specific paths from config
|
|
129
|
+
const agentRecords = getInstalledSkillAgents();
|
|
130
|
+
for (const record of agentRecords) {
|
|
131
|
+
const installPath = record.path;
|
|
132
|
+
if (!installPath || seen.has(installPath)) continue;
|
|
133
|
+
seen.add(installPath);
|
|
134
|
+
|
|
135
|
+
const skillName = record.skill || 'mindos';
|
|
136
|
+
const bundledPath = resolve(base, 'skills', skillName, 'SKILL.md');
|
|
55
137
|
if (!existsSync(bundledPath)) continue;
|
|
56
138
|
|
|
139
|
+
if (!existsSync(installPath)) {
|
|
140
|
+
// Path no longer exists — clean up stale record silently
|
|
141
|
+
removeSkillRecord(record.agent, skillName);
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
|
|
57
145
|
const installed = extractSkillVersion(installPath);
|
|
58
146
|
const bundled = extractSkillVersion(bundledPath);
|
|
59
|
-
|
|
60
147
|
if (!installed || !bundled) continue;
|
|
61
148
|
if (semverGt(bundled, installed)) {
|
|
62
|
-
mismatches.push({
|
|
149
|
+
mismatches.push({
|
|
150
|
+
name: skillName,
|
|
151
|
+
installed,
|
|
152
|
+
bundled,
|
|
153
|
+
installPath,
|
|
154
|
+
bundledPath,
|
|
155
|
+
agent: record.agent,
|
|
156
|
+
});
|
|
63
157
|
}
|
|
64
158
|
}
|
|
159
|
+
|
|
65
160
|
return mismatches;
|
|
66
161
|
}
|
|
67
162
|
|
|
68
163
|
/**
|
|
69
164
|
* Copy bundled SKILL.md over the installed version.
|
|
165
|
+
* Creates parent directory if needed.
|
|
70
166
|
*/
|
|
71
167
|
export function updateSkill(bundledPath, installPath) {
|
|
168
|
+
const dir = dirname(installPath);
|
|
169
|
+
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
72
170
|
copyFileSync(bundledPath, installPath);
|
|
73
171
|
}
|
|
74
172
|
|
|
75
173
|
/**
|
|
76
174
|
* Print skill update hints and optionally prompt user to update.
|
|
77
|
-
*
|
|
78
|
-
* - TTY + not daemon: interactive readline prompt (default Y)
|
|
79
|
-
* - Non-TTY / daemon / MINDOS_NO_SKILL_CHECK=1: one-line hint, no block
|
|
80
175
|
*/
|
|
81
176
|
export async function promptSkillUpdate(mismatches) {
|
|
82
177
|
if (!mismatches || mismatches.length === 0) return;
|
|
83
178
|
|
|
84
|
-
// Print mismatch info
|
|
85
179
|
for (const m of mismatches) {
|
|
86
|
-
|
|
180
|
+
const agentLabel = m.agent ? ` (${m.agent})` : '';
|
|
181
|
+
console.log(`\n ${yellow('⬆')} Skill ${bold(m.name)}${agentLabel}: ${dim(`v${m.installed}`)} → ${cyan(`v${m.bundled}`)}`);
|
|
87
182
|
}
|
|
88
183
|
|
|
89
184
|
// Non-interactive mode: just print hint
|
|
90
|
-
if (!isTTY || process.env.LAUNCHED_BY_LAUNCHD === '1' || process.env.INVOCATION_ID) {
|
|
185
|
+
if (!isTTY() || process.env.LAUNCHED_BY_LAUNCHD === '1' || process.env.INVOCATION_ID) {
|
|
91
186
|
console.log(` ${dim('Run `mindos start` in a terminal to update interactively.')}`);
|
|
92
187
|
return;
|
|
93
188
|
}
|
|
94
189
|
|
|
95
|
-
// Interactive prompt (10s timeout
|
|
190
|
+
// Interactive prompt (10s timeout)
|
|
96
191
|
return new Promise((res) => {
|
|
97
192
|
let done = false;
|
|
98
193
|
const finish = () => { if (!done) { done = true; res(); } };
|
|
99
194
|
|
|
100
195
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
101
196
|
const timer = setTimeout(() => { rl.close(); finish(); }, 10_000);
|
|
102
|
-
|
|
103
|
-
rl.on('close', finish); // handles broken pipe / EOF
|
|
197
|
+
rl.on('close', finish);
|
|
104
198
|
|
|
105
199
|
rl.question(` Update skill${mismatches.length > 1 ? 's' : ''}? ${dim('(Y/n)')} `, (answer) => {
|
|
106
200
|
clearTimeout(timer);
|
|
@@ -110,7 +204,8 @@ export async function promptSkillUpdate(mismatches) {
|
|
|
110
204
|
for (const m of mismatches) {
|
|
111
205
|
try {
|
|
112
206
|
updateSkill(m.bundledPath, m.installPath);
|
|
113
|
-
|
|
207
|
+
const agentLabel = m.agent ? ` (${m.agent})` : '';
|
|
208
|
+
console.log(` ${green('✓')} ${dim(`Updated ${m.name}${agentLabel} → v${m.bundled}`)}`);
|
|
114
209
|
} catch (err) {
|
|
115
210
|
console.log(` ${yellow('!')} ${dim(`Failed to update ${m.name}: ${err.message}`)}`);
|
|
116
211
|
}
|