@geminilight/mindos-windows-arm64 1.0.5 → 1.0.7
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 +26 -26
- package/_standalone/__next/build-manifest.json +4 -4
- package/_standalone/__next/prerender-manifest.json +3 -3
- package/_standalone/__next/react-loadable-manifest.json +4 -4
- package/_standalone/__next/required-server-files.json +4 -4
- package/_standalone/__next/server/app/.well-known/agent-card.json/route.js +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 +3 -3
- 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 +3 -3
- package/_standalone/__next/server/app/_global-error.segments/_full.segment.rsc +3 -3
- 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 +2 -2
- 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 +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.js +1 -1
- package/_standalone/__next/server/app/api/a2a/agents/route.js.nft.json +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.js +1 -1
- package/_standalone/__next/server/app/api/a2a/delegations/route.js.nft.json +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.js +1 -1
- package/_standalone/__next/server/app/api/a2a/discover/route.js.nft.json +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.js +1 -1
- package/_standalone/__next/server/app/api/a2a/route.js.nft.json +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.js +1 -1
- package/_standalone/__next/server/app/api/acp/config/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/acp/config/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/acp/detect/route.js +1 -1
- package/_standalone/__next/server/app/api/acp/detect/route.js.nft.json +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.js +1 -1
- package/_standalone/__next/server/app/api/acp/install/route.js.nft.json +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.js +1 -1
- package/_standalone/__next/server/app/api/acp/registry/route.js.nft.json +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.js +1 -1
- package/_standalone/__next/server/app/api/acp/session/route.js.nft.json +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.js +1 -1
- package/_standalone/__next/server/app/api/agent-activity/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/agent-activity/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/agents/copy-skill/route.js +1 -1
- package/_standalone/__next/server/app/api/agents/copy-skill/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/agents/copy-skill/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/agents/custom/detect/route.js +1 -1
- package/_standalone/__next/server/app/api/agents/custom/detect/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/agents/custom/detect/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/agents/custom/route.js +1 -1
- package/_standalone/__next/server/app/api/agents/custom/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/agents/custom/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/ask/route.js +2 -2
- package/_standalone/__next/server/app/api/ask/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/ask/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/ask-sessions/route.js +1 -1
- package/_standalone/__next/server/app/api/ask-sessions/route.js.nft.json +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.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/channels/verify/route.js +1 -1
- package/_standalone/__next/server/app/api/channels/verify/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/channels/verify/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/connect/route.js +1 -1
- package/_standalone/__next/server/app/api/connect/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/connect/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/embedding/route.js +1 -1
- package/_standalone/__next/server/app/api/embedding/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/embedding/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/export/route.js +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-docx/route.js +1 -1
- package/_standalone/__next/server/app/api/extract-docx/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/extract-pdf/route.js +2 -2
- 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/raw/route.js +1 -1
- package/_standalone/__next/server/app/api/file/raw/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/file/raw/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/file/route.js +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.js +1 -1
- package/_standalone/__next/server/app/api/health/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/health/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/im/activity/route.js +1 -1
- package/_standalone/__next/server/app/api/im/activity/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/im/activity/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/im/config/route.js +1 -1
- package/_standalone/__next/server/app/api/im/config/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/im/config/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/im/feishu/long-connection/event/route.js +1 -1
- package/_standalone/__next/server/app/api/im/feishu/long-connection/event/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/im/feishu/long-connection/event/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/im/feishu/long-connection/route.js +1 -1
- package/_standalone/__next/server/app/api/im/feishu/long-connection/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/im/feishu/long-connection/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/im/status/route.js +1 -1
- package/_standalone/__next/server/app/api/im/status/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/im/status/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/im/test/route.js +1 -1
- package/_standalone/__next/server/app/api/im/test/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/im/test/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/im/webhook/feishu/route.js +1 -1
- package/_standalone/__next/server/app/api/im/webhook/feishu/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/im/webhook/feishu/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/im/webhook-status/route.js +1 -1
- package/_standalone/__next/server/app/api/im/webhook-status/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/im/webhook-status/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/inbox/clip/route.js +2 -2
- package/_standalone/__next/server/app/api/inbox/clip/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/inbox/clip/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/inbox/route.js +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/lint/route.js +1 -1
- package/_standalone/__next/server/app/api/lint/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/lint/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/mcp/agents/route.js +1 -1
- package/_standalone/__next/server/app/api/mcp/agents/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/mcp/agents/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/mcp/direct-tools/route.js +1 -1
- package/_standalone/__next/server/app/api/mcp/direct-tools/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/mcp/direct-tools/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/mcp/install/route.js +1 -1
- package/_standalone/__next/server/app/api/mcp/install/route.js.nft.json +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 +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.js +1 -1
- package/_standalone/__next/server/app/api/mcp/restart/route.js.nft.json +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.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/mcp/tools/route.js +1 -1
- package/_standalone/__next/server/app/api/mcp/tools/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/mcp/tools/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/mcp/uninstall/route.js +1 -1
- package/_standalone/__next/server/app/api/mcp/uninstall/route.js.nft.json +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/obsidian/compat-report/route.js +1 -1
- package/_standalone/__next/server/app/api/obsidian/compat-report/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/obsidian/compat-report/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/obsidian/import/route.js +1 -1
- package/_standalone/__next/server/app/api/obsidian/import/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/obsidian/import/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/obsidian-plugins/settings/route.js +2 -2
- package/_standalone/__next/server/app/api/obsidian-plugins/settings/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/obsidian-plugins/settings/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.js +1 -1
- package/_standalone/__next/server/app/api/restart/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/restart/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/search/prewarm/route.js +1 -1
- package/_standalone/__next/server/app/api/search/prewarm/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/search/prewarm/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.js +1 -1
- package/_standalone/__next/server/app/api/settings/list-models/route.js.nft.json +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.js +1 -1
- package/_standalone/__next/server/app/api/settings/reset-token/route.js.nft.json +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.js +1 -1
- package/_standalone/__next/server/app/api/settings/test-key/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/settings/test-key/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/setup/check-path/route.js +1 -1
- package/_standalone/__next/server/app/api/setup/check-path/route.js.nft.json +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.js +1 -1
- package/_standalone/__next/server/app/api/setup/check-port/route.js.nft.json +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.js +1 -1
- package/_standalone/__next/server/app/api/setup/generate-token/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/setup/generate-token/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/setup/ls/route.js +1 -1
- package/_standalone/__next/server/app/api/setup/ls/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/setup/ls/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/setup/route.js +1 -1
- package/_standalone/__next/server/app/api/setup/route.js.nft.json +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 +1 -1
- package/_standalone/__next/server/app/api/skills/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/space-overview/route.js +1 -1
- package/_standalone/__next/server/app/api/space-overview/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/space-overview/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/sync/route.js +1 -1
- package/_standalone/__next/server/app/api/sync/route.js.nft.json +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.js +1 -1
- package/_standalone/__next/server/app/api/uninstall/route.js.nft.json +1 -1
- package/_standalone/__next/server/app/api/uninstall/route_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/api/update/route.js +1 -1
- package/_standalone/__next/server/app/api/update/route.js.nft.json +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.js +1 -1
- package/_standalone/__next/server/app/api/update-check/route.js.nft.json +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.js +1 -1
- package/_standalone/__next/server/app/api/update-status/route.js.nft.json +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/capture/history/page.js +2 -2
- package/_standalone/__next/server/app/capture/history/page.js.nft.json +1 -1
- package/_standalone/__next/server/app/capture/history/page_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/capture/page.js +2 -2
- package/_standalone/__next/server/app/capture/page.js.nft.json +1 -1
- package/_standalone/__next/server/app/capture/page_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/changelog/page.js +2 -2
- package/_standalone/__next/server/app/changelog/page.js.nft.json +1 -1
- package/_standalone/__next/server/app/changelog/page_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/changes/page.js +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 +4 -4
- 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 +3 -3
- 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/icon.svg/route.js +1 -1
- package/_standalone/__next/server/app/inbox/history/page.js +2 -2
- package/_standalone/__next/server/app/inbox/history/page.js.nft.json +1 -1
- package/_standalone/__next/server/app/inbox/history/page_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app/login/page.js +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/settings/page.js +2 -2
- package/_standalone/__next/server/app/settings/page.js.nft.json +1 -1
- package/_standalone/__next/server/app/settings/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/todo/page.js +2 -2
- package/_standalone/__next/server/app/todo/page.js.nft.json +1 -1
- package/_standalone/__next/server/app/todo/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/wiki/page.js +2 -2
- package/_standalone/__next/server/app/wiki/page.js.nft.json +1 -1
- package/_standalone/__next/server/app/wiki/page_client-reference-manifest.js +1 -1
- package/_standalone/__next/server/app-paths-manifest.json +26 -26
- package/_standalone/__next/server/chunks/{6602.js → 1834.js} +32 -32
- package/_standalone/__next/server/chunks/1976.js +3 -3
- package/_standalone/__next/server/chunks/3466.js +1 -1
- package/_standalone/__next/server/chunks/3566.js +1 -1
- package/_standalone/__next/server/chunks/3727.js +1 -1
- package/_standalone/__next/server/chunks/4793.js +1 -1
- package/_standalone/__next/server/chunks/6377.js +3 -3
- package/_standalone/__next/server/chunks/6754.js +1 -1
- package/_standalone/__next/server/chunks/7765.js +1 -1
- package/_standalone/__next/server/chunks/8028.js +1 -1
- package/_standalone/__next/server/chunks/{7295.js → 8461.js} +19 -19
- package/_standalone/__next/server/chunks/9350.js +2 -2
- package/_standalone/__next/server/chunks/{5225.js → 9773.js} +4 -4
- 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/middleware.js +2 -2
- 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/{1430-a3447cf370715cad.js → 1430-c4ffa328888515c1.js} +1 -1
- package/{static-web/_next/static/chunks/7166-d6d8489fdf67d180.js → _standalone/__next/static/chunks/1957-723ac4eb5200214c.js} +3 -3
- package/_standalone/__next/static/chunks/{2280-2277c97eae59ded9.js → 2737-f4970f0684c334d6.js} +2 -2
- package/{static-web/_next/static/chunks/5200-2447cea5eb41a922.js → _standalone/__next/static/chunks/5200-6c82e5ce54a95b4b.js} +2 -2
- package/_standalone/__next/static/chunks/{1998.c8edc5601fa7362f.js → 6728.e1841cddb63308b0.js} +1 -1
- package/_standalone/__next/static/chunks/{6947.51e37852cef26113.js → 6947.fb89346ef2f6be17.js} +1 -1
- package/_standalone/__next/static/chunks/app/_not-found/{page-ec6fa498a07e6fd9.js → page-eaedcec1b693c03c.js} +1 -1
- package/{static-web/_next/static/chunks/app/agents/[agentKey]/page-44c493b744d18249.js → _standalone/__next/static/chunks/app/agents/[agentKey]/page-1dac12945bfbaf35.js} +1 -1
- package/{static-web/_next/static/chunks/app/agents/page-6591b482a193e657.js → _standalone/__next/static/chunks/app/agents/page-7ff2e39ca12eb20a.js} +1 -1
- package/_standalone/__next/static/chunks/app/capture/history/page-51db96203209a441.js +1 -0
- package/_standalone/__next/static/chunks/app/capture/page-3bf09d1f5e1c379c.js +1 -0
- package/_standalone/__next/static/chunks/app/changelog/page-01dc22b6d2230c7f.js +1 -0
- package/_standalone/__next/static/chunks/app/changes/page-c9f8d5632a001849.js +1 -0
- package/{static-web/_next/static/chunks/app/echo/[segment]/page-c5ea40ac04f2dc29.js → _standalone/__next/static/chunks/app/echo/[segment]/page-44b6b8e7fd0bbe31.js} +2 -2
- package/_standalone/__next/static/chunks/app/echo/page-c9f8d5632a001849.js +1 -0
- package/_standalone/__next/static/chunks/app/{error-c46d1b03d5e3289c.js → error-1cfcd6abd93c3837.js} +1 -1
- package/_standalone/__next/static/chunks/app/explore/{page-5d6dd4af8d1bb468.js → page-117fcf54b8b9765c.js} +1 -1
- package/_standalone/__next/static/chunks/app/global-error-11b333dcf222bc09.js +1 -0
- package/{static-web/_next/static/chunks/app/help/page-3f0a1a8e51249cb2.js → _standalone/__next/static/chunks/app/help/page-6efb8aa3a3c169fa.js} +1 -1
- package/_standalone/__next/static/chunks/app/inbox/history/page-913645bbd6161116.js +1 -0
- package/_standalone/__next/static/chunks/app/{layout-7aa371fe2615cd3e.js → layout-24a31ea28c556e82.js} +38 -38
- package/_standalone/__next/static/chunks/app/login/page-7f9aca3d51266bec.js +1 -0
- package/{static-web/_next/static/chunks/app/page-5c9489e28657376e.js → _standalone/__next/static/chunks/app/page-35662964020c0ea9.js} +1 -1
- package/_standalone/__next/static/chunks/app/settings/{page-4b75d6c17f42d565.js → page-f816f13a34613538.js} +1 -1
- package/{static-web/_next/static/chunks/app/setup/page-f5de08d0d588c778.js → _standalone/__next/static/chunks/app/setup/page-a1027871dc33ffbd.js} +1 -1
- package/_standalone/__next/static/chunks/app/todo/page-54c3ec77f662ff73.js +1 -0
- package/_standalone/__next/static/chunks/app/trash/page-50622e3df2047204.js +1 -0
- package/_standalone/__next/static/chunks/app/view/[...path]/{error-f73092e638a4e999.js → error-c9a3f6de7c963c74.js} +1 -1
- package/_standalone/__next/static/chunks/app/view/[...path]/{not-found-80e5f4054819b372.js → not-found-5a4f2b4fbe28d617.js} +1 -1
- package/{static-web/_next/static/chunks/app/view/[...path]/page-ffe3c61100e25591.js → _standalone/__next/static/chunks/app/view/[...path]/page-b10d3819827da1c2.js} +2 -2
- package/{static-web/_next/static/chunks/app/wiki/page-4c9bc816069b6f2a.js → _standalone/__next/static/chunks/app/wiki/page-7afd3b97c1ea1b8c.js} +2 -2
- package/_standalone/__next/static/chunks/{main-app-23adfdc06470abb6.js → main-app-8a6081b103b8f494.js} +1 -1
- package/_standalone/__next/static/chunks/webpack-7d8c24c6af17dd51.js +1 -0
- package/_standalone/__node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/LICENSE +201 -0
- package/_standalone/__node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +20 -0
- package/_standalone/__node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-es/index.js +14 -0
- package/_standalone/__node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/LICENSE +201 -0
- package/_standalone/__node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +6 -0
- package/_standalone/__node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-es/index.js +2 -0
- package/_standalone/__node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/package.json +61 -0
- package/_standalone/__node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/package.json +62 -0
- package/_standalone/__node_modules/@aws-sdk/core/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/LICENSE +201 -0
- package/_standalone/__node_modules/@aws-sdk/core/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +20 -0
- package/_standalone/__node_modules/@aws-sdk/core/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-es/index.js +14 -0
- package/_standalone/__node_modules/@aws-sdk/core/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/LICENSE +201 -0
- package/_standalone/__node_modules/@aws-sdk/core/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +6 -0
- package/_standalone/__node_modules/@aws-sdk/core/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-es/index.js +2 -0
- package/_standalone/__node_modules/@aws-sdk/core/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/package.json +61 -0
- package/_standalone/__node_modules/@aws-sdk/core/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/package.json +62 -0
- package/_standalone/__node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/LICENSE +201 -0
- package/_standalone/__node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +20 -0
- package/_standalone/__node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-es/index.js +14 -0
- package/_standalone/__node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/LICENSE +201 -0
- package/_standalone/__node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +6 -0
- package/_standalone/__node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-es/index.js +2 -0
- package/_standalone/__node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/package.json +61 -0
- package/_standalone/__node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/package.json +62 -0
- package/_standalone/__node_modules/@aws-sdk/middleware-websocket/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/LICENSE +201 -0
- package/_standalone/__node_modules/@aws-sdk/middleware-websocket/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +20 -0
- package/_standalone/__node_modules/@aws-sdk/middleware-websocket/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-es/index.js +14 -0
- package/_standalone/__node_modules/@aws-sdk/middleware-websocket/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/LICENSE +201 -0
- package/_standalone/__node_modules/@aws-sdk/middleware-websocket/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +6 -0
- package/_standalone/__node_modules/@aws-sdk/middleware-websocket/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-es/index.js +2 -0
- package/_standalone/__node_modules/@aws-sdk/middleware-websocket/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/package.json +61 -0
- package/_standalone/__node_modules/@aws-sdk/middleware-websocket/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/package.json +62 -0
- package/_standalone/__node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/LICENSE +201 -0
- package/_standalone/__node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +20 -0
- package/_standalone/__node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-es/index.js +14 -0
- package/_standalone/__node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/LICENSE +201 -0
- package/_standalone/__node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +6 -0
- package/_standalone/__node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-es/index.js +2 -0
- package/_standalone/__node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/package.json +61 -0
- package/_standalone/__node_modules/@aws-sdk/nested-clients/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/package.json +62 -0
- package/_standalone/__node_modules/@aws-sdk/xml-builder/node_modules/.bin/fxparser +2 -2
- package/_standalone/__node_modules/@mariozechner/pi-agent-core/node_modules/.bin/pi-ai +2 -2
- package/_standalone/__node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/node_modules/.bin/anthropic-ai-sdk +2 -2
- package/_standalone/__node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/node_modules/.bin/openai +2 -2
- package/_standalone/__node_modules/@mariozechner/pi-ai/node_modules/.bin/anthropic-ai-sdk +2 -2
- package/_standalone/__node_modules/@mariozechner/pi-ai/node_modules/.bin/openai +2 -2
- package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/extract-zip +2 -2
- package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/highlight +2 -2
- package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/jiti +2 -2
- package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/marked +2 -2
- package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/pi-ai +2 -2
- package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/yaml +2 -2
- package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-ai/node_modules/.bin/anthropic-ai-sdk +2 -2
- package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-ai/node_modules/.bin/openai +2 -2
- package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/strip-ansi/node_modules/ansi-regex/index.js +14 -0
- package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/strip-ansi/node_modules/ansi-regex/license +9 -0
- package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/strip-ansi/node_modules/ansi-regex/package.json +61 -0
- package/_standalone/__node_modules/@mariozechner/pi-tui/node_modules/.bin/marked +2 -2
- package/_standalone/__node_modules/@smithy/core/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/LICENSE +201 -0
- package/_standalone/__node_modules/@smithy/core/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +20 -0
- package/_standalone/__node_modules/@smithy/core/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-es/index.js +14 -0
- package/_standalone/__node_modules/@smithy/core/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/LICENSE +201 -0
- package/_standalone/__node_modules/@smithy/core/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +6 -0
- package/_standalone/__node_modules/@smithy/core/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-es/index.js +2 -0
- package/_standalone/__node_modules/@smithy/core/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/package.json +61 -0
- package/_standalone/__node_modules/@smithy/core/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/package.json +62 -0
- package/_standalone/__node_modules/@smithy/hash-node/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/LICENSE +201 -0
- package/_standalone/__node_modules/@smithy/hash-node/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +6 -0
- package/_standalone/__node_modules/@smithy/hash-node/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-es/index.js +2 -0
- package/_standalone/__node_modules/@smithy/hash-node/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/package.json +61 -0
- package/_standalone/__node_modules/@smithy/hash-node/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/LICENSE +201 -0
- package/_standalone/__node_modules/@smithy/hash-node/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +20 -0
- package/_standalone/__node_modules/@smithy/hash-node/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-es/index.js +14 -0
- package/_standalone/__node_modules/@smithy/hash-node/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/LICENSE +201 -0
- package/_standalone/__node_modules/@smithy/hash-node/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +6 -0
- package/_standalone/__node_modules/@smithy/hash-node/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-es/index.js +2 -0
- package/_standalone/__node_modules/@smithy/hash-node/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/package.json +61 -0
- package/_standalone/__node_modules/@smithy/hash-node/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/package.json +62 -0
- package/_standalone/__node_modules/@smithy/signature-v4/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/LICENSE +201 -0
- package/_standalone/__node_modules/@smithy/signature-v4/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +20 -0
- package/_standalone/__node_modules/@smithy/signature-v4/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-es/index.js +14 -0
- package/_standalone/__node_modules/@smithy/signature-v4/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/LICENSE +201 -0
- package/_standalone/__node_modules/@smithy/signature-v4/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +6 -0
- package/_standalone/__node_modules/@smithy/signature-v4/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-es/index.js +2 -0
- package/_standalone/__node_modules/@smithy/signature-v4/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/package.json +61 -0
- package/_standalone/__node_modules/@smithy/signature-v4/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/package.json +62 -0
- package/_standalone/__node_modules/@smithy/util-base64/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/LICENSE +201 -0
- package/_standalone/__node_modules/@smithy/util-base64/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +6 -0
- package/_standalone/__node_modules/@smithy/util-base64/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-es/index.js +2 -0
- package/_standalone/__node_modules/@smithy/util-base64/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/package.json +61 -0
- package/_standalone/__node_modules/@smithy/util-base64/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/LICENSE +201 -0
- package/_standalone/__node_modules/@smithy/util-base64/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +20 -0
- package/_standalone/__node_modules/@smithy/util-base64/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-es/index.js +14 -0
- package/_standalone/__node_modules/@smithy/util-base64/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/LICENSE +201 -0
- package/_standalone/__node_modules/@smithy/util-base64/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +6 -0
- package/_standalone/__node_modules/@smithy/util-base64/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-es/index.js +2 -0
- package/_standalone/__node_modules/@smithy/util-base64/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/package.json +61 -0
- package/_standalone/__node_modules/@smithy/util-base64/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/package.json +62 -0
- package/_standalone/__node_modules/@smithy/util-stream/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/LICENSE +201 -0
- package/_standalone/__node_modules/@smithy/util-stream/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +6 -0
- package/_standalone/__node_modules/@smithy/util-stream/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-es/index.js +2 -0
- package/_standalone/__node_modules/@smithy/util-stream/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/package.json +61 -0
- package/_standalone/__node_modules/@smithy/util-stream/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/LICENSE +201 -0
- package/_standalone/__node_modules/@smithy/util-stream/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +20 -0
- package/_standalone/__node_modules/@smithy/util-stream/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/dist-es/index.js +14 -0
- package/_standalone/__node_modules/@smithy/util-stream/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/LICENSE +201 -0
- package/_standalone/__node_modules/@smithy/util-stream/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +6 -0
- package/_standalone/__node_modules/@smithy/util-stream/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/dist-es/index.js +2 -0
- package/_standalone/__node_modules/@smithy/util-stream/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer/package.json +61 -0
- package/_standalone/__node_modules/@smithy/util-stream/node_modules/@smithy/util-utf8/node_modules/@smithy/util-buffer-from/package.json +62 -0
- package/_standalone/__node_modules/bignumber.js/doc/API.html +2249 -0
- package/_standalone/__node_modules/degenerator/node_modules/.bin/escodegen +2 -2
- package/_standalone/__node_modules/degenerator/node_modules/.bin/esgenerate +2 -2
- package/_standalone/__node_modules/degenerator/node_modules/.bin/esparse +2 -2
- package/_standalone/__node_modules/degenerator/node_modules/.bin/esvalidate +2 -2
- package/_standalone/__node_modules/entities/LICENSE +11 -0
- package/_standalone/__node_modules/entities/dist/decode-codepoint.js +46 -0
- package/_standalone/__node_modules/entities/dist/decode.js +544 -0
- package/_standalone/__node_modules/entities/dist/encode.js +90 -0
- package/_standalone/__node_modules/entities/dist/escape.js +132 -0
- package/_standalone/__node_modules/entities/dist/generated/decode-data-html.js +5 -0
- package/_standalone/__node_modules/entities/dist/generated/decode-data-xml.js +5 -0
- package/_standalone/__node_modules/entities/dist/generated/encode-html.js +12 -0
- package/_standalone/__node_modules/entities/dist/index.js +91 -0
- package/_standalone/__node_modules/entities/dist/internal/bin-trie-flags.js +18 -0
- package/_standalone/__node_modules/entities/dist/internal/decode-shared.js +17 -0
- package/_standalone/__node_modules/entities/dist/internal/encode-shared.js +93 -0
- package/_standalone/__node_modules/entities/package.json +83 -0
- package/_standalone/__node_modules/entities/src/decode-codepoint.ts +50 -0
- package/_standalone/__node_modules/entities/src/decode.ts +671 -0
- package/_standalone/__node_modules/entities/src/encode.ts +95 -0
- package/_standalone/__node_modules/entities/src/escape.ts +160 -0
- package/_standalone/__node_modules/entities/src/generated/decode-data-html.ts +7 -0
- package/_standalone/__node_modules/entities/src/generated/decode-data-xml.ts +7 -0
- package/_standalone/__node_modules/entities/src/generated/encode-html.ts +18 -0
- package/_standalone/__node_modules/entities/src/index.ts +162 -0
- package/_standalone/__node_modules/entities/src/internal/bin-trie-flags.ts +16 -0
- package/_standalone/__node_modules/entities/src/internal/decode-shared.ts +18 -0
- package/_standalone/__node_modules/entities/src/internal/encode-shared.ts +123 -0
- package/_standalone/__node_modules/escodegen/node_modules/.bin/esparse +2 -2
- package/_standalone/__node_modules/escodegen/node_modules/.bin/esvalidate +2 -2
- package/_standalone/__node_modules/global-agent/node_modules/.bin/semver +2 -2
- package/_standalone/__node_modules/has-flag/index.js +8 -0
- package/_standalone/__node_modules/has-flag/license +9 -0
- package/_standalone/__node_modules/has-flag/package.json +46 -0
- package/_standalone/__node_modules/jsdom/node_modules/.bin/specificity +2 -2
- package/_standalone/__node_modules/koffi/doc/benchmarks.md +126 -0
- package/_standalone/__node_modules/koffi/doc/callbacks.md +210 -0
- package/_standalone/__node_modules/koffi/doc/contribute.md +148 -0
- package/_standalone/__node_modules/koffi/doc/functions.md +250 -0
- package/_standalone/__node_modules/koffi/doc/index.md +61 -0
- package/_standalone/__node_modules/koffi/doc/input.md +471 -0
- package/_standalone/__node_modules/koffi/doc/migration.md +159 -0
- package/_standalone/__node_modules/koffi/doc/misc.md +180 -0
- package/_standalone/__node_modules/koffi/doc/output.md +305 -0
- package/_standalone/__node_modules/koffi/doc/packaging.md +88 -0
- package/_standalone/__node_modules/koffi/doc/platforms.md +36 -0
- package/_standalone/__node_modules/koffi/doc/pointers.md +328 -0
- package/_standalone/__node_modules/koffi/doc/start.md +118 -0
- package/_standalone/__node_modules/koffi/doc/unions.md +186 -0
- package/_standalone/__node_modules/koffi/doc/variables.md +102 -0
- package/_standalone/__node_modules/postcss/node_modules/.bin/nanoid +2 -2
- package/_standalone/__node_modules/supports-color/browser.js +5 -0
- package/_standalone/__node_modules/supports-color/index.js +135 -0
- package/_standalone/__node_modules/supports-color/license +9 -0
- package/_standalone/__node_modules/supports-color/package.json +53 -0
- package/_standalone/__node_modules/tough-cookie/node_modules/.bin/tldts +2 -2
- package/_standalone/__node_modules/yaml/browser/dist/doc/Document.js +335 -0
- package/_standalone/__node_modules/yaml/browser/dist/doc/anchors.js +71 -0
- package/_standalone/__node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
- package/_standalone/__node_modules/yaml/browser/dist/doc/createNode.js +88 -0
- package/_standalone/__node_modules/yaml/browser/dist/doc/directives.js +176 -0
- package/_standalone/__node_modules/yaml/dist/doc/Document.js +337 -0
- package/_standalone/__node_modules/yaml/dist/doc/anchors.js +76 -0
- package/_standalone/__node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/_standalone/__node_modules/yaml/dist/doc/createNode.js +90 -0
- package/_standalone/__node_modules/yaml/dist/doc/directives.js +178 -0
- package/_standalone/server.js +1 -1
- package/dist/server/handlers/mcp-agents.d.ts +1 -0
- package/dist/server/handlers/mcp-agents.d.ts.map +1 -1
- package/dist/server/handlers/mcp-agents.js +230 -7
- package/dist/server/handlers/mcp-agents.js.map +1 -1
- package/dist/server/http.d.ts +7 -4
- package/dist/server/http.d.ts.map +1 -1
- package/dist/server/http.js +2 -0
- package/dist/server/http.js.map +1 -1
- package/dist/server/mcp-agent-registry.d.ts +4 -0
- package/dist/server/mcp-agent-registry.d.ts.map +1 -0
- package/dist/server/mcp-agent-registry.js +266 -0
- package/dist/server/mcp-agent-registry.js.map +1 -0
- package/package.json +1 -1
- package/runtime-manifest.json +1 -1
- package/scripts/prepare-standalone.mjs +0 -1
- package/scripts/smoke-desktop-app.mjs +82 -8
- package/scripts/verify-desktop-runtime.mjs +2 -1
- package/scripts/verify-standalone.mjs +12 -0
- package/static-web/.mindos-build-version +1 -1
- package/static-web/_next/static/chunks/{1430-a3447cf370715cad.js → 1430-c4ffa328888515c1.js} +1 -1
- package/{_standalone/__next/static/chunks/7166-d6d8489fdf67d180.js → static-web/_next/static/chunks/1957-723ac4eb5200214c.js} +3 -3
- package/static-web/_next/static/chunks/{2280-2277c97eae59ded9.js → 2737-f4970f0684c334d6.js} +2 -2
- package/{_standalone/__next/static/chunks/5200-2447cea5eb41a922.js → static-web/_next/static/chunks/5200-6c82e5ce54a95b4b.js} +2 -2
- package/static-web/_next/static/chunks/{1998.c8edc5601fa7362f.js → 6728.e1841cddb63308b0.js} +1 -1
- package/static-web/_next/static/chunks/{6947.51e37852cef26113.js → 6947.fb89346ef2f6be17.js} +1 -1
- package/static-web/_next/static/chunks/app/_not-found/{page-ec6fa498a07e6fd9.js → page-eaedcec1b693c03c.js} +1 -1
- package/{_standalone/__next/static/chunks/app/agents/[agentKey]/page-44c493b744d18249.js → static-web/_next/static/chunks/app/agents/[agentKey]/page-1dac12945bfbaf35.js} +1 -1
- package/{_standalone/__next/static/chunks/app/agents/page-6591b482a193e657.js → static-web/_next/static/chunks/app/agents/page-7ff2e39ca12eb20a.js} +1 -1
- package/static-web/_next/static/chunks/app/capture/history/page-51db96203209a441.js +1 -0
- package/static-web/_next/static/chunks/app/capture/page-3bf09d1f5e1c379c.js +1 -0
- package/static-web/_next/static/chunks/app/changelog/page-01dc22b6d2230c7f.js +1 -0
- package/static-web/_next/static/chunks/app/changes/page-c9f8d5632a001849.js +1 -0
- package/{_standalone/__next/static/chunks/app/echo/[segment]/page-c5ea40ac04f2dc29.js → static-web/_next/static/chunks/app/echo/[segment]/page-44b6b8e7fd0bbe31.js} +2 -2
- package/static-web/_next/static/chunks/app/echo/page-c9f8d5632a001849.js +1 -0
- package/static-web/_next/static/chunks/app/{error-c46d1b03d5e3289c.js → error-1cfcd6abd93c3837.js} +1 -1
- package/static-web/_next/static/chunks/app/explore/{page-5d6dd4af8d1bb468.js → page-117fcf54b8b9765c.js} +1 -1
- package/static-web/_next/static/chunks/app/global-error-11b333dcf222bc09.js +1 -0
- package/{_standalone/__next/static/chunks/app/help/page-3f0a1a8e51249cb2.js → static-web/_next/static/chunks/app/help/page-6efb8aa3a3c169fa.js} +1 -1
- package/static-web/_next/static/chunks/app/inbox/history/page-913645bbd6161116.js +1 -0
- package/static-web/_next/static/chunks/app/{layout-7aa371fe2615cd3e.js → layout-24a31ea28c556e82.js} +38 -38
- package/static-web/_next/static/chunks/app/login/page-7f9aca3d51266bec.js +1 -0
- package/{_standalone/__next/static/chunks/app/page-5c9489e28657376e.js → static-web/_next/static/chunks/app/page-35662964020c0ea9.js} +1 -1
- package/static-web/_next/static/chunks/app/settings/{page-4b75d6c17f42d565.js → page-f816f13a34613538.js} +1 -1
- package/{_standalone/__next/static/chunks/app/setup/page-f5de08d0d588c778.js → static-web/_next/static/chunks/app/setup/page-a1027871dc33ffbd.js} +1 -1
- package/static-web/_next/static/chunks/app/todo/page-54c3ec77f662ff73.js +1 -0
- package/static-web/_next/static/chunks/app/trash/page-50622e3df2047204.js +1 -0
- package/static-web/_next/static/chunks/app/view/[...path]/{error-f73092e638a4e999.js → error-c9a3f6de7c963c74.js} +1 -1
- package/static-web/_next/static/chunks/app/view/[...path]/{not-found-80e5f4054819b372.js → not-found-5a4f2b4fbe28d617.js} +1 -1
- package/{_standalone/__next/static/chunks/app/view/[...path]/page-ffe3c61100e25591.js → static-web/_next/static/chunks/app/view/[...path]/page-b10d3819827da1c2.js} +2 -2
- package/{_standalone/__next/static/chunks/app/wiki/page-4c9bc816069b6f2a.js → static-web/_next/static/chunks/app/wiki/page-7afd3b97c1ea1b8c.js} +2 -2
- package/static-web/_next/static/chunks/{main-app-23adfdc06470abb6.js → main-app-8a6081b103b8f494.js} +1 -1
- package/static-web/_next/static/chunks/webpack-7d8c24c6af17dd51.js +1 -0
- package/static-web/help/index.html +3 -3
- package/static-web/index.html +3 -3
- package/static-web/setup/index.html +3 -3
- package/static-web/static-web-manifest.json +1 -1
- package/static-web/wiki/index.html +3 -3
- package/_standalone/__next/static/chunks/app/capture/history/page-d157ce945ad84c23.js +0 -1
- package/_standalone/__next/static/chunks/app/capture/page-ae4d683afdc7a7b2.js +0 -1
- package/_standalone/__next/static/chunks/app/changelog/page-5a39d8fe531f4d45.js +0 -1
- package/_standalone/__next/static/chunks/app/changes/page-64cf8d751245eee9.js +0 -1
- package/_standalone/__next/static/chunks/app/echo/page-64cf8d751245eee9.js +0 -1
- package/_standalone/__next/static/chunks/app/global-error-d42727c6c6c48879.js +0 -1
- package/_standalone/__next/static/chunks/app/inbox/history/page-b2930c2ef04e00b0.js +0 -1
- package/_standalone/__next/static/chunks/app/login/page-a4f9f9053c75ae8d.js +0 -1
- package/_standalone/__next/static/chunks/app/todo/page-c7629a0c102c634f.js +0 -1
- package/_standalone/__next/static/chunks/app/trash/page-e1bfaeeca2de6ab4.js +0 -1
- package/_standalone/__next/static/chunks/webpack-e39fda9494843875.js +0 -1
- package/static-web/_next/static/chunks/app/capture/history/page-d157ce945ad84c23.js +0 -1
- package/static-web/_next/static/chunks/app/capture/page-ae4d683afdc7a7b2.js +0 -1
- package/static-web/_next/static/chunks/app/changelog/page-5a39d8fe531f4d45.js +0 -1
- package/static-web/_next/static/chunks/app/changes/page-64cf8d751245eee9.js +0 -1
- package/static-web/_next/static/chunks/app/echo/page-64cf8d751245eee9.js +0 -1
- package/static-web/_next/static/chunks/app/global-error-d42727c6c6c48879.js +0 -1
- package/static-web/_next/static/chunks/app/inbox/history/page-b2930c2ef04e00b0.js +0 -1
- package/static-web/_next/static/chunks/app/login/page-a4f9f9053c75ae8d.js +0 -1
- package/static-web/_next/static/chunks/app/todo/page-c7629a0c102c634f.js +0 -1
- package/static-web/_next/static/chunks/app/trash/page-e1bfaeeca2de6ab4.js +0 -1
- package/static-web/_next/static/chunks/webpack-e39fda9494843875.js +0 -1
- /package/_standalone/__next/static/{DFngZEGZSufSm5RuKPkYN → 3FkuJxcda957EywJ5ZWWG}/_buildManifest.js +0 -0
- /package/_standalone/__next/static/{DFngZEGZSufSm5RuKPkYN → 3FkuJxcda957EywJ5ZWWG}/_ssgManifest.js +0 -0
- /package/static-web/_next/static/{DFngZEGZSufSm5RuKPkYN → 3FkuJxcda957EywJ5ZWWG}/_buildManifest.js +0 -0
- /package/static-web/_next/static/{DFngZEGZSufSm5RuKPkYN → 3FkuJxcda957EywJ5ZWWG}/_ssgManifest.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";exports.id=1976,exports.ids=[1976],exports.modules={2506:(a,b,c)=>{c.d(b,{cP:()=>z,n2:()=>A});var d=c(33873),e=c.n(d),f=c(29021),g=c.n(f);class h extends Error{constructor(a,b,c,d){super(a),this.name=this.constructor.name,this.code=b,this.statusCode=c,this.context=d?.context,this.cause=d?.cause,this.metadata={timestamp:Date.now(),...d?.metadata},Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,message:this.message,code:this.code,statusCode:this.statusCode,context:this.context,metadata:this.metadata,stack:this.stack}}toUserMessage(){return this.message}}let i={VALIDATION_ERROR:400,NOT_FOUND:404,UNAUTHORIZED:401,FORBIDDEN:403,CONFLICT:409,INTERNAL_ERROR:500,SERVICE_UNAVAILABLE:503,TIMEOUT:408,RATE_LIMIT_EXCEEDED:429,FILE_SYSTEM_ERROR:500,FILE_READ_ERROR:500,FILE_WRITE_ERROR:500,FILE_STAT_ERROR:500,FILE_REMOVE_ERROR:500,FILE_COPY_ERROR:500,FILE_MOVE_ERROR:500,FILE_WATCH_ERROR:500,DIRECTORY_READ_ERROR:500,DIRECTORY_CREATE_ERROR:500,DATABASE_ERROR:500,NETWORK_ERROR:500,CONFIGURATION_ERROR:500,SEARCH_ERROR:500,VECTOR_ERROR:500,MCP_ERROR:500},j={VALIDATION_ERROR:"Validation failed",NOT_FOUND:"Resource not found",UNAUTHORIZED:"Unauthorized access",FORBIDDEN:"Access forbidden",CONFLICT:"Resource conflict",INTERNAL_ERROR:"Internal server error",SERVICE_UNAVAILABLE:"Service unavailable",TIMEOUT:"Operation timed out",RATE_LIMIT_EXCEEDED:"Rate limit exceeded",FILE_SYSTEM_ERROR:"File system operation failed",FILE_READ_ERROR:"Failed to read file",FILE_WRITE_ERROR:"Failed to write file",FILE_STAT_ERROR:"Failed to get file stats",FILE_REMOVE_ERROR:"Failed to remove file",FILE_COPY_ERROR:"Failed to copy file",FILE_MOVE_ERROR:"Failed to move file",FILE_WATCH_ERROR:"Failed to watch file",DIRECTORY_READ_ERROR:"Failed to read directory",DIRECTORY_CREATE_ERROR:"Failed to create directory",DATABASE_ERROR:"Database operation failed",NETWORK_ERROR:"Network operation failed",CONFIGURATION_ERROR:"Configuration error",SEARCH_ERROR:"Search operation failed",VECTOR_ERROR:"Vector operation failed",MCP_ERROR:"MCP operation failed"};function k(a,b,c){let d=i[a],e=j[a];return new h(b??e,a,d,{...c,metadata:{...c?.metadata,retryable:["SERVICE_UNAVAILABLE","TIMEOUT","NETWORK_ERROR"].includes(a),retryAfter:function(a){switch(a){case"RATE_LIMIT_EXCEEDED":return 6e4;case"SERVICE_UNAVAILABLE":return 5e3;case"TIMEOUT":return 1e3;case"NETWORK_ERROR":return 2e3;default:return 0}}(a)}})}let l=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i,m=/[<>:"|?*\x00-\x1f]/;function n(a){return/^[A-Za-z]:/.test(a)}function o(a,b){let c,e,f;if(c=d.resolve(b),e=d.resolve(a),""!==(f=d.relative(c,e))&&(".."===f||f.startsWith(`..${d.sep}`)||d.isAbsolute(f)))throw k("VALIDATION_ERROR","Access denied: path outside root",{context:{resolved:a,root:b}})}function p(a,b,c,d,e,f){return{path:a,webRouteFile:`packages/web/app${a}/route.ts`,owner:b,adapter:c,phase:d,risk:e,residualRisk:f}}let q=(a,b="low")=>p(a,"product-owned","next-response","Phase 1: migrated Product Server adapter",b,"No residual product ownership expected; this route should remain a thin Next adapter."),r=(a,b,c,d)=>p(a,"optional-capability","optional-capability",b,c,d),s=(a,b,c="medium")=>p(a,"host-owned","host","Host-owned",c,b);[q("/api/a2a/agents","medium"),q("/api/a2a/delegations","medium"),q("/api/a2a/discover","medium"),q("/api/a2a","medium"),q("/api/acp/config","high"),q("/api/acp/detect","medium"),q("/api/acp/install","high"),q("/api/acp/registry","medium"),q("/api/acp/session","high"),q("/api/agent-activity"),q("/api/agents/copy-skill","high"),q("/api/agents/custom/detect","medium"),q("/api/agents/custom","high"),q("/api/ask-sessions"),p("/api/ask","product-owned","stream","Phase 6: generated client and stream adapter","high","Ask is mostly Product runtime-owned through session and agent modules, but the streaming Web route still owns host assembly and should become a generated stream adapter."),s("/api/auth","Auth cookie/session handling is host-specific today; Product Server will need an auth context adapter before direct HTTP exposure.","high"),q("/api/backlinks"),q("/api/bootstrap"),q("/api/changes"),q("/api/channels/verify","medium"),q("/api/connect"),q("/api/embedding","medium"),r("/api/export","Phase 5: content ingestion optional capabilities","high","Export/archive logic carries heavy dependencies and filesystem writes that need optional capability packaging."),r("/api/extract-docx","Phase 5: content ingestion optional capabilities","high","DOCX extraction should be Product-owned but lazy-loaded so parser dependencies do not inflate the default package."),r("/api/extract-pdf","Phase 5: content ingestion optional capabilities","high","PDF extraction should be Product-owned but lazy-loaded so parser dependencies do not inflate the default package."),r("/api/file/import","Phase 5: content ingestion optional capabilities","high","File import is a content-ingestion write path and needs capability-level size limits, conflict checks, and rollback."),q("/api/file/raw"),q("/api/file","high"),q("/api/files"),q("/api/git"),q("/api/graph"),q("/api/health"),q("/api/im/activity","medium"),q("/api/im/config","high"),s("/api/im/feishu/long-connection/event","Raw long-connection event delivery is host-specific, but event parsing and state updates should stay behind Product protocol handlers.","medium"),q("/api/im/feishu/long-connection","high"),q("/api/im/status","medium"),q("/api/im/test","medium"),q("/api/im/webhook-status","medium"),s("/api/im/webhook/feishu","Raw inbound Feishu webhook receipt is host-owned, while signature verification and state writes should move to Product protocol handlers.","high"),r("/api/inbox/clip","Phase 5: content ingestion optional capabilities","high","Inbox clipping is still Web-owned ingestion and needs optional capability packaging plus fetch timeout and content limits."),q("/api/inbox","medium"),q("/api/init","high"),r("/api/lint","Phase 5: content ingestion optional capabilities","medium","Knowledge linting remains Web-owned and should become an optional Product capability with bounded filesystem traversal."),q("/api/mcp/agents","high"),q("/api/mcp/direct-tools","medium"),q("/api/mcp/install-skill","high"),q("/api/mcp/install","high"),q("/api/mcp/restart","high"),q("/api/mcp/status"),q("/api/mcp/tools","medium"),q("/api/mcp/uninstall","high"),q("/api/monitoring","medium"),r("/api/obsidian-plugins/settings","Phase 5: content ingestion optional capabilities","medium","Obsidian plugin settings remain Web-owned and should be modeled as an optional Product compatibility capability."),r("/api/obsidian/compat-report","Phase 5: content ingestion optional capabilities","medium","Obsidian compatibility reporting remains Web-owned and should use optional capability diagnostics."),r("/api/obsidian/import","Phase 5: content ingestion optional capabilities","high","Obsidian import remains a Web-owned bulk write path and needs optional capability size limits and rollback."),q("/api/recent-files"),q("/api/restart","high"),q("/api/search/prewarm"),q("/api/search"),q("/api/settings/list-models","medium"),q("/api/settings/reset-token","high"),q("/api/settings","medium"),q("/api/settings/test-key","medium"),q("/api/setup/check-path","medium"),q("/api/setup/check-port","medium"),q("/api/setup/generate-token","medium"),q("/api/setup/ls","medium"),q("/api/setup","high"),q("/api/skills","high"),q("/api/space-overview"),q("/api/sync","high"),q("/api/tree-version"),q("/api/uninstall","high"),q("/api/update-check"),q("/api/update-status"),q("/api/update","high"),q("/api/workflows","medium")].map(a=>[a.path,a]),c(51455),c(73024);var t=c(76760);c(77598);var u=c(48161);c(37067),c(73136),c(31421),c(50294);var v=c(79646);(0,c(28354).promisify)(v.execFile),(0,t.join)((0,u.homedir)(),".mindos","im-activity.json"),(0,t.join)((0,u.homedir)(),".mindos","im.json"),(0,t.join)((0,u.homedir)(),".mindos","im.json"),(0,t.join)((0,u.homedir)(),".mindos","im.json"),c(21820),c(77030),c(38264);let w=(0,t.join)((0,u.homedir)(),".mindos");(0,t.join)(w,"config.json"),(0,t.join)(w,"sync-state.json"),[{id:"health",method:"GET",path:"/api/health",auth:"public"},{id:"files",method:"GET",path:"/api/files",auth:"required"},{id:"recent-files",method:"GET",path:"/api/recent-files",auth:"required"},{id:"tree-version",method:"GET",path:"/api/tree-version",auth:"required"},{id:"file.read",method:"GET",path:"/api/file",auth:"required"},{id:"file.write",method:"POST",path:"/api/file",auth:"required"},{id:"file.raw",method:"GET",path:"/api/file/raw",auth:"required"},{id:"search",method:"GET",path:"/api/search",auth:"required"},{id:"search.prewarm",method:"GET",path:"/api/search/prewarm",auth:"required"},{id:"a2a",method:"POST",path:"/api/a2a",auth:"required"},{id:"a2a.options",method:"OPTIONS",path:"/api/a2a",auth:"public"},{id:"a2a.agents",method:"GET",path:"/api/a2a/agents",auth:"required"},{id:"a2a.delegations",method:"GET",path:"/api/a2a/delegations",auth:"required"},{id:"a2a.discover",method:"POST",path:"/api/a2a/discover",auth:"required"},{id:"acp.config",method:"GET",path:"/api/acp/config",auth:"required"},{id:"acp.config.update",method:"POST",path:"/api/acp/config",auth:"required"},{id:"acp.config.delete",method:"DELETE",path:"/api/acp/config",auth:"required"},{id:"acp.detect",method:"GET",path:"/api/acp/detect",auth:"required"},{id:"acp.install",method:"POST",path:"/api/acp/install",auth:"required"},{id:"acp.registry",method:"GET",path:"/api/acp/registry",auth:"required"},{id:"acp.session",method:"GET",path:"/api/acp/session",auth:"required"},{id:"acp.session.action",method:"POST",path:"/api/acp/session",auth:"required"},{id:"acp.session.close",method:"DELETE",path:"/api/acp/session",auth:"required"},{id:"backlinks",method:"GET",path:"/api/backlinks",auth:"required"},{id:"graph",method:"GET",path:"/api/graph",auth:"required"},{id:"agent-activity",method:"GET",path:"/api/agent-activity",auth:"required"},{id:"bootstrap",method:"GET",path:"/api/bootstrap",auth:"required"},{id:"connect",method:"GET",path:"/api/connect",auth:"required"},{id:"embedding",method:"GET",path:"/api/embedding",auth:"required"},{id:"embedding.action",method:"POST",path:"/api/embedding",auth:"required"},{id:"channels.verify",method:"POST",path:"/api/channels/verify",auth:"required"},{id:"im.activity",method:"GET",path:"/api/im/activity",auth:"required"},{id:"im.config",method:"GET",path:"/api/im/config",auth:"required"},{id:"im.config.update",method:"PUT",path:"/api/im/config",auth:"required"},{id:"im.config.delete",method:"DELETE",path:"/api/im/config",auth:"required"},{id:"im.status",method:"GET",path:"/api/im/status",auth:"required"},{id:"im.test",method:"POST",path:"/api/im/test",auth:"required"},{id:"im.webhook-status",method:"GET",path:"/api/im/webhook-status",auth:"required"},{id:"im.feishu.long-connection",method:"GET",path:"/api/im/feishu/long-connection",auth:"required"},{id:"im.feishu.long-connection.start",method:"POST",path:"/api/im/feishu/long-connection",auth:"required"},{id:"im.feishu.long-connection.stop",method:"DELETE",path:"/api/im/feishu/long-connection",auth:"required"},{id:"monitoring",method:"GET",path:"/api/monitoring",auth:"required"},{id:"update-status",method:"GET",path:"/api/update-status",auth:"required"},{id:"update-check",method:"GET",path:"/api/update-check",auth:"required"},{id:"restart",method:"POST",path:"/api/restart",auth:"required"},{id:"update",method:"POST",path:"/api/update",auth:"required"},{id:"uninstall",method:"POST",path:"/api/uninstall",auth:"required"},{id:"init",method:"POST",path:"/api/init",auth:"required"},{id:"sync",method:"GET",path:"/api/sync",auth:"required"},{id:"sync.action",method:"POST",path:"/api/sync",auth:"required"},{id:"inbox",method:"GET",path:"/api/inbox",auth:"required"},{id:"inbox.save",method:"POST",path:"/api/inbox",auth:"required"},{id:"inbox.archive",method:"DELETE",path:"/api/inbox",auth:"required"},{id:"setup.check-path",method:"POST",path:"/api/setup/check-path",auth:"required"},{id:"setup.check-port",method:"POST",path:"/api/setup/check-port",auth:"required"},{id:"setup.generate-token",method:"POST",path:"/api/setup/generate-token",auth:"required"},{id:"setup.ls",method:"POST",path:"/api/setup/ls",auth:"required"},{id:"setup",method:"GET",path:"/api/setup",auth:"required"},{id:"setup.apply",method:"POST",path:"/api/setup",auth:"required"},{id:"setup.guide-state",method:"PATCH",path:"/api/setup",auth:"required"},{id:"workflows",method:"GET",path:"/api/workflows",auth:"required"},{id:"workflows.create",method:"POST",path:"/api/workflows",auth:"required"},{id:"ask.stream",method:"POST",path:"/api/ask",auth:"required"},{id:"ask-sessions",method:"GET",path:"/api/ask-sessions",auth:"required"},{id:"ask-sessions.save",method:"POST",path:"/api/ask-sessions",auth:"required"},{id:"ask-sessions.delete",method:"DELETE",path:"/api/ask-sessions",auth:"required"},{id:"space-overview",method:"GET",path:"/api/space-overview",auth:"required"},{id:"git",method:"GET",path:"/api/git",auth:"required"},{id:"settings",method:"GET",path:"/api/settings",auth:"required"},{id:"settings.update",method:"POST",path:"/api/settings",auth:"required"},{id:"settings.reset-token",method:"POST",path:"/api/settings/reset-token",auth:"required"},{id:"settings.test-key",method:"POST",path:"/api/settings/test-key",auth:"required"},{id:"settings.list-models",method:"POST",path:"/api/settings/list-models",auth:"required"},{id:"mcp.status",method:"GET",path:"/api/mcp/status",auth:"required"},{id:"mcp.agents",method:"GET",path:"/api/mcp/agents",auth:"required"},{id:"mcp.tools",method:"GET",path:"/api/mcp/tools",auth:"required"},{id:"mcp.direct-tools",method:"POST",path:"/api/mcp/direct-tools",auth:"required"},{id:"mcp.install",method:"POST",path:"/api/mcp/install",auth:"required"},{id:"mcp.install-skill",method:"POST",path:"/api/mcp/install-skill",auth:"required"},{id:"mcp.restart",method:"POST",path:"/api/mcp/restart",auth:"required"},{id:"mcp.uninstall",method:"POST",path:"/api/mcp/uninstall",auth:"required"},{id:"skills",method:"GET",path:"/api/skills",auth:"required"},{id:"skills.action",method:"POST",path:"/api/skills",auth:"required"},{id:"changes",method:"GET",path:"/api/changes",auth:"required"},{id:"changes.mark-seen",method:"POST",path:"/api/changes",auth:"required"},{id:"agents.custom.create",method:"POST",path:"/api/agents/custom",auth:"required"},{id:"agents.custom.update",method:"PUT",path:"/api/agents/custom",auth:"required"},{id:"agents.custom.delete",method:"DELETE",path:"/api/agents/custom",auth:"required"},{id:"agents.custom.detect",method:"POST",path:"/api/agents/custom/detect",auth:"required"},{id:"agents.copy-skill",method:"POST",path:"/api/agents/copy-skill",auth:"required"}].map(a=>[`${a.method} ${a.path}`,a.auth]),c(84389);var x=c(39852);function y(a,b){return a instanceof x.Vt?a:new x.Vt(x.tG.PATH_OUTSIDE_ROOT,a?.message||"Access denied: path outside MIND_ROOT",a?.context??b)}function z(a,b){try{o(a,b)}catch(c){throw y(c,{resolved:a,root:b})}}function A(a,b){var c,f;let h,i,j,p,q,r=function(a,b){try{let g=b.replace(/\\/g,"/");if(d.isAbsolute(g)||d.win32.isAbsolute(b)||d.win32.isAbsolute(g)||n(b)||n(g))throw k("VALIDATION_ERROR","Access denied: absolute paths are not allowed",{context:{root:a,filePath:b}});var c=a,e=b,f=g;for(let a of f.split("/"))if(a&&"."!==a&&(a.endsWith(".")||a.endsWith(" ")||l.test(a)||m.test(a)))throw k("VALIDATION_ERROR","Access denied: path contains a Windows-invalid file name segment",{context:{root:c,filePath:e,segment:a}});let h=d.resolve(a),i=d.resolve(d.join(h,g));return o(i,h),i}catch(c){throw y(c,{mindRoot:a,filePath:b})}}(a,b),s=function(a){let b=a;for(;!g().existsSync(b);){let a=e().dirname(b);if(a===b)break;b=a}return b}(r);try{h=g().realpathSync(e().resolve(a)),i=g().realpathSync(s)}catch(c){throw y(c,{mindRoot:a,filePath:b,resolved:r,existing:s})}if(c=i,f=h,j=e().resolve(f),p=e().resolve(c),""!==(q=e().relative(j,p))&&(".."===q||q.startsWith(`..${e().sep}`)||e().isAbsolute(q)))throw new x.Vt(x.tG.PATH_OUTSIDE_ROOT,"Access denied: symlink resolves outside MIND_ROOT",{mindRoot:a,filePath:b,resolved:r,existing:s,targetReal:i});return r}},7017:(a,b,c)=>{c.d(b,{G:()=>h});var d=c(33873),e=c.n(d),f=c(31751),g=c(59349);function h(a,b,c,d){let h=[],i=e().basename(b,".md"),j=b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),k=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=[RegExp(`\\[\\[${k}(?:[|#][^\\]]*)?\\]\\]`,"i"),RegExp(`\\[\\[${j}(?:[|#][^\\]]*)?\\]\\]`,"i"),RegExp(`\\[[^\\]]+\\]\\(${j}(?:#[^)]*)?\\)`,"i"),RegExp(`\\[[^\\]]+\\]\\([^)]*${k}\\.md(?:#[^)]*)?\\)`,"i"),RegExp("`"+j.replace(/\//g,"\\/")+"`")];for(let e of c||(d?d.filter(a=>a.endsWith(".md")&&a!==b):(0,f.f)(a).filter(a=>a.endsWith(".md")&&a!==b))){let c;if(e===b)continue;try{c=(0,g.TA)(a,e)}catch{continue}let d=c.split("\n");for(let a=0;a<d.length;a++)if(l.some(b=>b.test(d[a]))){let b=a;for(;b>0&&b>a-3&&""!==d[b].trim();)b--;let c=a;for(;c<d.length-1&&c<a+3&&""!==d[c].trim();)c++;let f=d.slice(b,c+1).join("\n").trim();f=f.replace(/\n{2,}/g," ↵ "),h.push({source:e,line:a+1,context:f});break}}return h}},11976:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{El:()=>y,F2:()=>G,FR:()=>I,G1:()=>L,H5:()=>C,JX:()=>p,WZ:()=>D,_P:()=>z,f:()=>x,fu:()=>A,g7:()=>J,getFileTree:()=>w,gm:()=>q,mV:()=>H,startFileWatcher:()=>t,vg:()=>F,wf:()=>E,x3:()=>B,zK:()=>K});var e=c(29021),f=c.n(e),g=c(33873),h=c.n(g),i=c(39852),j=c(72385),k=c(23414),l=c(28647),m=c(82614),n=c(28287),o=a([j,k]);function p(){return(0,k.kh)()}[j,k]=o.then?(await o)():o;let M=new Set([".git","node_modules","app",".next",".DS_Store",".media","mcp"]),N=new Set([".md",".csv",".json",".pdf",".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".mp3",".wav",".m4a",".ogg",".flac",".aac",".mp4",".webm",".mov",".mkv"]),O=null,P=0,Q=new j.Xs;function q(){O=null,P++,(0,j._E)(),Q.invalidate()}function r(a){O=null,P++,(0,j.KZ)(p(),a),Q.isBuilt()&&Q.updateFile(p(),a)}function s(){var a;let b,c,d,e;return null!==O&&Date.now()-O.timestamp<3e4?O:(a=p(),b=m.Y.startTimer("tree.cache.build"),c=function a(b,c){let d,e=c??p();try{d=f().readdirSync(b,{withFileTypes:!0})}catch{return[]}let g=[];for(let c of d){let d=h().join(b,c.name),i=h().relative(e,d);if(c.isDirectory()){if(M.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:i,type:"directory",children:b};a&&(e.isSpace=!0,e.spacePreview=function(a){let b,c=h().join(a,"INSTRUCTION.md"),d=h().join(a,"README.md"),e=v(d);try{let a=f().readFileSync(d,"utf-8").match(/<!-- mindos:compiled (\S+) files:\d+ -->/);a&&(b=a[1])}catch{}return{instructionLines:u(c,3),readmeLines:u(d,3),isTemplate:v(c)&&e,readmeIsTemplate:e,lastCompiled:b}}(d)),g.push(e)}}else if(c.isFile()){let a=h().extname(c.name).toLowerCase();N.has(a)&&g.push({name:c.name,path:i,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),d=[],e=0,function a(b){for(let c of b)"file"===c.type?d.push(c.path):c.children&&(e++,a(c.children))}(c),b({fileCount:d.length,directoryCount:e}),O={tree:c,allFiles:d,timestamp:Date.now()},R||t(),O)}let R=null,S=null;function t(){let a;if(!R){try{a=p()}catch{return}try{(R=f().watch(a,{recursive:!0},(a,b)=>{!b||b.startsWith(".git")||b.includes("node_modules")||b.includes(".next")||(S&&clearTimeout(S),S=setTimeout(()=>{O=null,P++,S=null},500))})).on("error",()=>{S&&(clearTimeout(S),S=null),R&&(R.close(),R=null)})}catch{R=null}}}function u(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 T=["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 v(a){try{let b=f().readFileSync(a,"utf-8");return T.some(a=>b.includes(a))}catch{return!1}}function w(){return s().tree}function x(){return s().allFiles}function y(a=10){let b=p(),c=x().map(a=>{try{let c=(0,j.n2)(b,a),d=f().statSync(c);return{path:a,mtime:d.mtimeMs}}catch{return null}}).filter(Boolean);return c.sort((a,b)=>b.mtime-a.mtime),c.slice(0,a)}function z(a){let b=p();if(".pdf"===h().extname(a).toLowerCase()){let c=(0,j.n2)(b,a);if(!f().existsSync(c))throw new i.Vt(i.tG.FILE_NOT_FOUND,`File not found: ${a}`,{filePath:a});let d=(0,l.b)(c);if(!d)throw new i.Vt(i.tG.INTERNAL_ERROR,`Could not extract text from PDF: ${a}`,{filePath:a});return d}return(0,j.TA)(b,a)}function A(a,b){(0,j._h)(p(),a,b),r(a)}function B(a,b=""){(0,j.x3)(p(),a,b),O=null,P++,(0,j.As)(p(),a),Q.isBuilt()&&Q.updateFile(p(),a)}function C(a,b){let c=(0,j.H5)(p(),a,b);return q(),c}function D(a,b){(0,j.WZ)(p(),a,b),r(a)}function E(a,b,c){(0,j.wf)(p(),a,b,c),r(a)}function F(a,b,c){(0,j.vg)(p(),a,b,c),r(a)}function G(a,b){let c=(0,j.F2)(p(),a,b);return r(a),c}function H(a,b){let c=(0,j.mV)(p(),a,b,j.G1);return q(),c}function I(a,b=10){return(0,j.FR)(p(),a,b)}function J(a,b){return(0,j.g7)(p(),a,b)}function K(a){let b=(0,n.F0)(p(),a);return q(),b}function L(a){let b,c=p(),d=(b=p(),!Q.isBuiltFor(b)&&Q.rebuild(b),Q).getBacklinks(a);return(0,j.G1)(c,a,d)}d()}catch(a){d(a)}})},12169:(a,b,c)=>{c.d(b,{FR:()=>f,g7:()=>g});var d=c(79646),e=c(2506);function f(a,b,c){let f=(0,e.n2)(a,b),g=(0,d.execFileSync)("git",["log","--follow","--format=%H%x00%aI%x00%s%x00%an","-n",String(c),"--",f],{cwd:a,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();return g?g.split("\n").map(a=>{let[b,c,d,e]=a.split("\0");return{hash:b,date:c,message:d,author:e}}):[]}function g(a,b,c){let f=(0,e.n2)(a,b),g=(0,d.execFileSync)("git",["ls-files","--full-name",f],{cwd:a,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();return g?(0,d.execFileSync)("git",["show",`${c}:${g}`],{cwd:a,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}):(0,d.execFileSync)("git",["show",`${c}:${b}`],{cwd:a,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}},14360:(a,b,c)=>{c.d(b,{P2:()=>j,WZ:()=>k,vg:()=>m,wf:()=>l});var d=c(29021),e=c.n(d),f=c(59349),g=c(39852),h=c(2506);function i(a,b){return(0,f.TA)(a,b).split("\n")}function j(a,b,c,d,e){let h=i(a,b);var j=h.length;if(c<0||d<0)throw new g.Vt(g.tG.INVALID_RANGE,"Invalid line index: indices must be >= 0",{start:c,end:d});if(c>d)throw new g.Vt(g.tG.INVALID_RANGE,`Invalid range: start (${c}) > end (${d})`,{start:c,end:d});if(c>=j)throw new g.Vt(g.tG.INVALID_RANGE,`Invalid line index: start (${c}) >= total lines (${j})`,{start:c,totalLines:j});h.splice(c,d-c+1,...e),(0,f._h)(a,b,h.join("\n"))}function k(a,b,c){let d=(0,h.n2)(a,b);try{let a=e().statSync(d);if(0===a.size)return void e().appendFileSync(d,c,"utf-8");let b=Math.min(8,a.size),f=e().openSync(d,"r");try{let g=Buffer.alloc(b);e().readSync(f,g,0,b,Math.max(0,a.size-b));let h=g.toString("utf-8").endsWith("\n\n")?"":"\n";e().appendFileSync(d,h+c,"utf-8")}finally{e().closeSync(f)}}catch(g){let d=(0,f.TA)(a,b),e=d.length>0&&!d.endsWith("\n\n")?"\n":"";(0,f._h)(a,b,d+e+c)}}function l(a,b,c,d){let e=i(a,b),h=e.findIndex(a=>{let b=a.trim();return b===c||b.replace(/^#+\s*/,"")===c.replace(/^#+\s*/,"")});if(-1===h)throw new g.Vt(g.tG.HEADING_NOT_FOUND,`Heading not found: "${c}"`,{heading:c});let j=h+1;for(;j<e.length&&""===e[j].trim();)j++;!function(a,b,c,d){let e=i(a,b);if(c>=e.length)throw new g.Vt(g.tG.INVALID_RANGE,`Invalid after_index: ${c} >= total lines (${e.length})`,{afterIndex:c,totalLines:e.length});e.splice(c<0?0:c+1,0,...d),(0,f._h)(a,b,e.join("\n"))}(a,b,j-1,["",d])}function m(a,b,c,d){let e=i(a,b),f=e.findIndex(a=>{let b=a.trim();return b===c||b.replace(/^#+\s*/,"")===c.replace(/^#+\s*/,"")});if(-1===f)throw new g.Vt(g.tG.HEADING_NOT_FOUND,`Heading not found: "${c}"`,{heading:c});let h=(e[f].match(/^#+/)??[""])[0].length,k=e.length-1;for(let a=f+1;a<e.length;a++){let b=e[a].match(/^(#+)\s/);if(b&&b[1].length<=h){k=a-1;break}}for(;k>f&&""===e[k].trim();)k--;j(a,b,f+1,k,["",d])}},22288:(a,b,c)=>{var d=c(73566),e=c(31751),f=c(59349),g=c(2506),h=c(28647),i=c(87155),j=c(33873),k=c.n(j);let l="u">typeof Intl&&Intl.Segmenter?new Intl.Segmenter("zh",{granularity:"word"}):null;function m(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])}if(d.parentPort&&d.workerData?.mindRoot)try{let a=function(a){let b=(0,e.f)(a),c={},d={},j=0;for(let e of b){let b;if(".pdf"===k().extname(e).toLowerCase())try{let c=(0,g.n2)(a,e);if(!(b=(0,h.b)(c)))continue}catch{continue}else try{b=(0,f.TA)(a,e)}catch{continue}for(let a of(d[e]=b.length,j+=b.length,b.length>5e4&&(b=b.slice(0,5e4)),function(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(i.y.test(c))if(l)for(let{segment:a,isWordLike:d}of l.segment(c)){if(!d)continue;let c=a.trim();if(c)for(let a of(b.add(c),c))i.y.test(a)&&b.add(a)}else{let a=[];for(let d of c)i.y.test(d)?a.push(d):a.length>0&&(m(a,b),a.length=0);a.length>0&&m(a,b)}return b}(e+"\n"+b)))c[a]||(c[a]=[]),c[a].push(e)}return{version:1,builtForRoot:a,fileCount:b.length,totalChars:j,docLengths:d,invertedIndex:c,timestamp:Date.now()}}(d.workerData.mindRoot);d.parentPort.postMessage({ok:!0,data:a})}catch(a){d.parentPort.postMessage({ok:!1,error:a instanceof Error?a.message:String(a)})}},23414:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Sf:()=>p,kh:()=>q,sb:()=>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(28696),l=c(31756),m=c(62697),n=a([l,m]);[l,m]=n.then?(await n)():n;let r=h().join(j().homedir(),".mindos","config.json"),s={ai:{activeProvider:"",providers:[]},mindRoot:""},t=new Set(["free","tavily","brave","serper","bing-api"]);function o(){try{var a;let c=f().readFileSync(r,"utf-8"),d=JSON.parse(c),e=d.ai,g=e&&!Array.isArray(e.providers),i={ai:function(a){let b=a.ai;if(!b)return{...s.ai};if(Array.isArray(b.providers)){let a=(0,m.S9)(b.providers),c="string"==typeof b.activeProvider?b.activeProvider:"";return{activeProvider:function(a,b){if(a&&(0,m.Ny)(a)&&(0,m.lh)(b,a))return a;if(a&&(0,l.rl)(a)){let c=b.find(b=>b.protocol===a);if(c)return c.id}return b[0]?.id??""}(c,a),providers:a}}let c=(0,m.Ko)(a);return c?{activeProvider:c.activeProvider,providers:c.providers}:{...s.ai}}(d),agent:function(a){if(!a||"object"!=typeof a)return;let b={};return"number"==typeof a.maxSteps&&(b.maxSteps=Math.min(999,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}(d.agent),embedding:function(a){if(!a||"object"!=typeof a||"boolean"!=typeof a.enabled)return;let b="local"===a.provider||"api"===a.provider?a.provider:"api";return{enabled:a.enabled,provider:b,baseUrl:"string"==typeof a.baseUrl?a.baseUrl:"",apiKey:"string"==typeof a.apiKey?a.apiKey:"",model:"string"==typeof a.model?a.model:""}}(d.embedding),webSearch:function(a){if(a&&"object"==typeof a)return{provider:"string"==typeof a.provider&&t.has(a.provider)?a.provider:"free",apiKey:"string"==typeof a.apiKey?a.apiKey:""}}(d.webSearch),acpAgents:(a=d.acpAgents,(0,k.gG)(a)),mindRoot:d.mindRoot??s.mindRoot,webPassword:"string"==typeof d.webPassword?d.webPassword:void 0,authToken:"string"==typeof d.authToken?d.authToken:void 0,allowNetworkAccess:!0===d.allowNetworkAccess,mcpPort:"number"==typeof d.mcpPort?d.mcpPort:void 0,port:"number"==typeof d.port?d.port:void 0,startMode:"string"==typeof d.startMode?d.startMode:void 0,setupPending:!0===d.setupPending||void 0,disabledSkills:Array.isArray(d.disabledSkills)?d.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}}(d.guideState),baseUrlCompat:(()=>{let a=d.baseUrlCompat;if(!a||"object"!=typeof a)return;let b={};for(let[c,d]of Object.entries(a))("streaming"===d||"non-streaming"===d)&&(b[c]=d);return Object.keys(b).length>0?b:void 0})(),connectionMode:function(a){if(a.connectionMode&&"object"==typeof a.connectionMode){let b=a.connectionMode;if("boolean"==typeof b.cli&&"boolean"==typeof b.mcp)return{cli:b.cli,mcp:b.mcp}}let b=!0===a.setupPending||!a.mindRoot;return{cli:!0,mcp:!b}}(d),customAgents:Array.isArray(d.customAgents)?d.customAgents:void 0};if(g)try{var b=i;let a=h().dirname(r);f().existsSync(a)||f().mkdirSync(a,{recursive:!0});let c={};try{c=JSON.parse(f().readFileSync(r,"utf-8"))}catch{}let d={...c,ai:b.ai,mindRoot:b.mindRoot};void 0!==b.agent&&(d.agent=b.agent),void 0!==b.embedding&&(d.embedding=b.embedding),void 0!==b.webSearch&&(d.webSearch=b.webSearch),void 0!==b.webPassword&&(d.webPassword=b.webPassword),void 0!==b.authToken&&(d.authToken=b.authToken),"boolean"==typeof b.allowNetworkAccess&&(d.allowNetworkAccess=b.allowNetworkAccess),void 0!==b.port&&(d.port=b.port),void 0!==b.mcpPort&&(d.mcpPort=b.mcpPort),void 0!==b.startMode&&(d.startMode=b.startMode),void 0!==b.disabledSkills&&(d.disabledSkills=b.disabledSkills),void 0!==b.guideState&&(d.guideState=b.guideState),void 0!==b.acpAgents&&(d.acpAgents=b.acpAgents),void 0!==b.baseUrlCompat&&(d.baseUrlCompat=b.baseUrlCompat),void 0!==b.connectionMode&&(d.connectionMode=b.connectionMode),void 0!==b.customAgents&&(d.customAgents=b.customAgents),void 0!==b.skillPaths&&(d.skillPaths=b.skillPaths),delete d.customProviders,"setupPending"in b&&(b.setupPending?d.setupPending=!0:delete d.setupPending),"setupPort"in b&&(b.setupPort?d.setupPort=b.setupPort:delete d.setupPort),f().writeFileSync(r,JSON.stringify(d,null,2)+"\n","utf-8")}catch{}return i}catch{return{...s,ai:{...s.ai,providers:[]},setupPending:!0,connectionMode:{cli:!0,mcp:!1},allowNetworkAccess:!1}}}function p(a){let b=o(),c=a||b.ai.activeProvider,d=c?(0,m.lh)(b.ai.providers,c):void 0;if(!d&&a&&(0,l.rl)(a)){let c=b.ai.activeProvider?(0,m.lh)(b.ai.providers,b.ai.activeProvider):void 0;d=c?.protocol===a?c:b.ai.providers.find(b=>b.protocol===a)}if(d){let a=l.T_[d.protocol],b=d.apiKey||(0,l.lr)(d.protocol)||a?.apiKeyFallback||"",c=d.model||a?.defaultModel||"",e=d.baseUrl||a?.fixedBaseUrl||"";return{provider:d.protocol,apiKey:b,model:c,baseUrl:e}}let e=a&&(0,l.rl)(a)?a:process.env.AI_PROVIDER,f=e&&(0,l.rl)(e)?e:"anthropic",g=l.T_[f]??l.T_.anthropic;return{provider:f,apiKey:(0,l.lr)(f)||g.apiKeyFallback||"",model:g.defaultModel,baseUrl:g.fixedBaseUrl||""}}function q(){return o().mindRoot||process.env.MIND_ROOT||h().join(j().homedir(),"MindOS","mind")}d()}catch(a){d(a)}})},27152:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Bk:()=>p,II:()=>o,s7:()=>q});var e=c(23414),f=c(79646),g=c(29021),h=c.n(g),i=c(21820),j=c.n(i),k=c(33873),l=c.n(k),m=c(79551),n=a([e]);function o(){try{let a=(0,e.sb)().embedding;if(!a||!a.enabled||"api"===a.provider&&(!a.baseUrl||!a.model)||"local"===a.provider&&!a.model)return null;return{enabled:!0,provider:a.provider||"api",baseUrl:(a.baseUrl||"").replace(/\/+$/,""),apiKey:a.apiKey||"",model:a.model}}catch{return null}}async function p(a){let b=o();if(!b||0===a.length)return[];try{if("local"===b.provider)return await x(b.model,a);return await y(b,a)}catch(a){return console.error("[embedding] Failed to get embeddings:",a instanceof Error?a.message:a),[]}}async function q(a){let b=await p([a]);return b.length>0?b[0]:null}e=(n.then?(await n)():n)[0];let B=["@huggingface/transformers@4.2.0","onnxruntime-node@1.24.3","onnxruntime-web@1.26.0-dev.20260416-b7804b056c"],C=Function("specifier","return import(specifier)");class D extends Error{constructor(a="Local embedding runtime is not installed. Install it from Settings > AI > Embedding Search, or use API mode."){super(a),this.name="LocalEmbeddingRuntimeMissingError"}}function r(){return process.env.MINDOS_LOCAL_EMBEDDING_RUNTIME_DIR||l().join(j().homedir(),".mindos","local-embedding-runtime")}let E=null,F=null,G=null;async function s(){let a=r();h().mkdirSync(a,{recursive:!0});let b=l().join(a,"package.json");h().existsSync(b)||h().writeFileSync(b,JSON.stringify({private:!0,name:"mindos-local-embedding-runtime",description:"Optional MindOS local embedding runtime installed on user request."},null,2)+"\n");let c=function(){if(process.env.MINDOS_NPM_BIN)return{command:process.env.MINDOS_NPM_BIN,args:[]};let a=process.env.MINDOS_PROJECT_ROOT;if(a){let b=l().join(a,"node","lib","node_modules","npm","bin","npm-cli.js");if(h().existsSync(b))return{command:process.env.MINDOS_NODE_BIN||process.execPath,args:[b]}}return{command:"win32"===process.platform?"npm.cmd":"npm",args:[]}}(),d=[...c.args,"install","--prefix",a,"--omit=dev","--no-audit","--no-fund","--ignore-scripts",...B];await t(c.command,d,6e5)}async function t(a,b,c){await new Promise((d,e)=>{let g=(0,f.spawn)(a,b,{stdio:["ignore","pipe","pipe"],env:process.env}),h="",i=setTimeout(()=>{g.kill("SIGTERM"),e(Error("Local embedding runtime install timed out. Check your network and try again, or use API mode."))},c);g.stdout.on("data",a=>{(h+=a.toString()).length>8e3&&(h=h.slice(-8e3))}),g.stderr.on("data",a=>{(h+=a.toString()).length>8e3&&(h=h.slice(-8e3))}),g.on("error",a=>{clearTimeout(i),"ENOENT"===a.code?e(Error("npm is required to install the optional local embedding runtime. Install Node.js/npm, or use API embedding mode.")):e(a)}),g.on("exit",a=>{clearTimeout(i),0===a?d():e(Error(`Local embedding runtime install failed with exit code ${a}. ${h.trim().slice(-1e3)}`))})})}async function u(a){return E&&F===a?E:G&&F===a?G:(F=a,G=(async()=>{for(let b=0;b<=2;b++){let c=null,d=!1,e=null;try{let{pipeline:e,env:f}=await v({installIfMissing:!1});process.env.HF_ENDPOINT||f.remoteHost||(console.log("[embedding] Configuring hf-mirror.com for better connectivity in China"),f.remoteHost="https://hf-mirror.com",f.remotePathTemplate="{model}/resolve/{revision}/{fileName}"),c=setTimeout(()=>{d=!0},3e5),console.log(`[embedding] Attempt ${b+1}/3: Loading pipeline for ${a}...`);let g=e("feature-extraction",a,{dtype:"fp32"});return E=await g,c&&clearTimeout(c),console.log(`[embedding] Successfully loaded pipeline for ${a}`),E}catch(f){e=f instanceof Error?f:Error(String(f)),c&&clearTimeout(c),d&&(e=Error("Request timeout (>300s)"));let a=function(a){if(!(a instanceof Error))return!1;let b=a.message.toLowerCase();return b.includes("enotfound")||b.includes("econnrefused")||b.includes("econnreset")||b.includes("etimedout")||b.includes("timeout")||b.includes("temporarily unavailable")||b.includes("connect econnrefused")||b.includes("net::err_internet_disconnected")||b.includes("eaddrnotavail")||b.includes("enetunreach")||b.includes("socket hang up")}(e)&&b<2;if(console.error(`[embedding] Download attempt ${b+1}/3 failed: ${e.message}`+(a?` — retrying...`:" — giving up")),a){let a=1e3*Math.pow(2,b);console.log(`[embedding] Waiting ${a}ms before retry...`),await new Promise(b=>setTimeout(b,a));continue}throw E=null,F=null,G=null,e}}})())}async function v({installIfMissing:a}){try{return await Promise.resolve().then(c.bind(c,99253))}catch(c){let b=w();if(b)return await C((0,m.pathToFileURL)(b).href);if(a){await s();let a=w();if(a)return await C((0,m.pathToFileURL)(a).href)}throw new D(c instanceof Error&&c.message.includes("@huggingface/transformers")?void 0:`Local embedding runtime is unavailable: ${c instanceof Error?c.message:String(c)}`)}}function w(){let a=l().join(r(),"node_modules","@huggingface","transformers"),b=l().join(a,"package.json");if(!h().existsSync(b))return null;try{let c=JSON.parse(h().readFileSync(b,"utf-8")),d=c.exports?.node?.import?.default,e="string"==typeof d?d:"string"==typeof c.module?c.module:c.main;if("string"!=typeof e)return null;let f=l().resolve(a,e);return h().existsSync(f)?f:null}catch{return null}}async function x(a,b){let c=await u(a);if(!c)return[];let d=[];for(let a=0;a<b.length;a+=32)for(let e of b.slice(a,a+32)){let a=(await c(e,{pooling:"mean",normalize:!0})).data;d.push(new Float32Array(a))}return d}async function y(a,b){let c=[];for(let d=0;d<b.length;d+=100){let e=b.slice(d,d+100),f=await z(a,e);if(0===f.length)return[];c.push(...f)}return c}async function z(a,b){let c=`${a.baseUrl}/embeddings`,d=JSON.stringify({model:a.model,input:b}),e={"Content-Type":"application/json"};a.apiKey&&(e.Authorization=`Bearer ${a.apiKey}`);for(let a=0;a<=2;a++)try{let b=new AbortController,f=setTimeout(()=>b.abort(),3e4),g=await fetch(c,{method:"POST",headers:e,body:d,signal:b.signal});if(clearTimeout(f),!g.ok){let b=g.status;if((429===b||b>=500)&&a<2){let a=parseInt(g.headers.get("retry-after")||"1",10);await A(Math.min(1e3*a,5e3));continue}let c=await g.text().catch(()=>"");return console.error(`[embedding] API error ${b}: ${c.slice(0,200)}`),[]}let h=await g.json();if(!h.data||!Array.isArray(h.data))return console.error("[embedding] Unexpected response shape"),[];return h.data.sort((a,b)=>a.index-b.index),h.data.map(a=>new Float32Array(a.embedding))}catch(b){if(a<2){await A(1e3*(a+1));continue}console.error("[embedding] Request failed:",b instanceof Error?b.message:b);break}return[]}function A(a){return new Promise(b=>setTimeout(b,a))}d()}catch(a){d(a)}})},28287:(a,b,c)=>{c.d(b,{F0:()=>m});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(2506);function i(a){return k(a,".trash")}function j(a){return k(a,".trash-meta")}function k(a,b){l(b);let c=g().resolve(g().dirname(a)),d=g().resolve(c,b),f=g().relative(c,d);if(".."===f||f.startsWith(`..${g().sep}`)||g().isAbsolute(f))throw Error("Access denied: trash directory outside root parent");if(e().existsSync(d)){if(e().lstatSync(d).isSymbolicLink())throw Error("Access denied: trash directory must not be a symlink");let a=e().realpathSync(c),b=e().realpathSync(d),f=g().relative(a,b);if(".."===f||f.startsWith(`..${g().sep}`)||g().isAbsolute(f))throw Error("Access denied: trash directory outside root parent")}return d}function l(a){if(!a||a.includes("/")||a.includes("\\")||g().basename(a)!==a)throw Error("Invalid trash id")}function m(a,b){let c,d;e().mkdirSync(i(a),{recursive:!0}),e().mkdirSync(j(a),{recursive:!0});let f=(0,h.n2)(a,b);if(!e().existsSync(f))throw Error(`File not found: ${b}`);let k=e().statSync(f).isDirectory(),m=g().basename(b),n=(c=m.replace(/[^a-zA-Z0-9._\-\u4e00-\u9fff]/g,"_"),`${Date.now()}_${c}`),o=g().join(i(a),n);if(e().mkdirSync(g().dirname(o),{recursive:!0}),k)e().cpSync(f,o,{recursive:!0}),e().rmSync(f,{recursive:!0,force:!0});else try{e().renameSync(f,o)}catch(a){if("EXDEV"===a.code)e().copyFileSync(f,o),e().unlinkSync(f);else throw a}let p=new Date,q={id:n,originalPath:b,deletedAt:p.toISOString(),expiresAt:new Date(p.getTime()+2592e6).toISOString(),fileName:m,isDirectory:k};return l(q.id),d=g().join(j(a),`${q.id}.json`),e().writeFileSync(d,JSON.stringify(q,null,2),"utf-8"),q}},28647:(a,b,c)=>{c.d(b,{b:()=>i});var d=c(79646),e=c(29021),f=c.n(e),g=c(33873),h=c.n(g);function i(a){try{let b=function(a){let b=[],c=process.env.MINDOS_PROJECT_ROOT;c&&b.push(h().join(c,"packages","web","scripts",a));let d=process.cwd();for(let c of(b.push(h().join(d,"scripts",a)),b.push(h().resolve(d,"..","..","scripts",a)),b.push(h().join(d,".next","standalone","scripts",a)),b))if(f().existsSync(c))return c;return null}("extract-pdf.cjs");if(!b)return"";let c=(0,d.execFileSync)(function(a=process.env){return a.MINDOS_NODE_BIN?.trim()||process.execPath}(),[b,a],{encoding:"utf-8",timeout:15e3,maxBuffer:5242880});return JSON.parse(c).text||""}catch{return""}}},28696:(a,b,c)=>{c.d(b,{gG:()=>d.gG});var d=c(50294)},30281:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{O:()=>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(31751),l=c(59349),m=c(27152),n=a([m]);m=(n.then?(await n)():n)[0];class o{isReady(){return this._ready}isBuilding(){return this._building}getDocCount(){return this.vectors.size}getDimensions(){return this.dimensions}async rebuild(a){if(!this._building){this._building=!0;try{if(!(0,m.II)()){this._building=!1;return}let b=(0,k.f)(a),c=[],d=[];for(let e of b){let b,f=h().extname(e).toLowerCase();if(".md"!==f&&".csv"!==f)continue;try{b=(0,l.TA)(a,e)}catch{continue}let g=`${e}
|
|
1
|
+
"use strict";exports.id=1976,exports.ids=[1976],exports.modules={7017:(a,b,c)=>{c.d(b,{G:()=>h});var d=c(33873),e=c.n(d),f=c(31751),g=c(59349);function h(a,b,c,d){let h=[],i=e().basename(b,".md"),j=b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),k=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=[RegExp(`\\[\\[${k}(?:[|#][^\\]]*)?\\]\\]`,"i"),RegExp(`\\[\\[${j}(?:[|#][^\\]]*)?\\]\\]`,"i"),RegExp(`\\[[^\\]]+\\]\\(${j}(?:#[^)]*)?\\)`,"i"),RegExp(`\\[[^\\]]+\\]\\([^)]*${k}\\.md(?:#[^)]*)?\\)`,"i"),RegExp("`"+j.replace(/\//g,"\\/")+"`")];for(let e of c||(d?d.filter(a=>a.endsWith(".md")&&a!==b):(0,f.f)(a).filter(a=>a.endsWith(".md")&&a!==b))){let c;if(e===b)continue;try{c=(0,g.TA)(a,e)}catch{continue}let d=c.split("\n");for(let a=0;a<d.length;a++)if(l.some(b=>b.test(d[a]))){let b=a;for(;b>0&&b>a-3&&""!==d[b].trim();)b--;let c=a;for(;c<d.length-1&&c<a+3&&""!==d[c].trim();)c++;let f=d.slice(b,c+1).join("\n").trim();f=f.replace(/\n{2,}/g," ↵ "),h.push({source:e,line:a+1,context:f});break}}return h}},11976:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{El:()=>y,F2:()=>G,FR:()=>I,G1:()=>L,H5:()=>C,JX:()=>p,WZ:()=>D,_P:()=>z,f:()=>x,fu:()=>A,g7:()=>J,getFileTree:()=>w,gm:()=>q,mV:()=>H,startFileWatcher:()=>t,vg:()=>F,wf:()=>E,x3:()=>B,zK:()=>K});var e=c(29021),f=c.n(e),g=c(33873),h=c.n(g),i=c(39852),j=c(72385),k=c(23414),l=c(28647),m=c(82614),n=c(28287),o=a([j,k]);function p(){return(0,k.kh)()}[j,k]=o.then?(await o)():o;let M=new Set([".git","node_modules","app",".next",".DS_Store",".media","mcp"]),N=new Set([".md",".csv",".json",".pdf",".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".mp3",".wav",".m4a",".ogg",".flac",".aac",".mp4",".webm",".mov",".mkv"]),O=null,P=0,Q=new j.Xs;function q(){O=null,P++,(0,j._E)(),Q.invalidate()}function r(a){O=null,P++,(0,j.KZ)(p(),a),Q.isBuilt()&&Q.updateFile(p(),a)}function s(){var a;let b,c,d,e;return null!==O&&Date.now()-O.timestamp<3e4?O:(a=p(),b=m.Y.startTimer("tree.cache.build"),c=function a(b,c){let d,e=c??p();try{d=f().readdirSync(b,{withFileTypes:!0})}catch{return[]}let g=[];for(let c of d){let d=h().join(b,c.name),i=h().relative(e,d);if(c.isDirectory()){if(M.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:i,type:"directory",children:b};a&&(e.isSpace=!0,e.spacePreview=function(a){let b,c=h().join(a,"INSTRUCTION.md"),d=h().join(a,"README.md"),e=v(d);try{let a=f().readFileSync(d,"utf-8").match(/<!-- mindos:compiled (\S+) files:\d+ -->/);a&&(b=a[1])}catch{}return{instructionLines:u(c,3),readmeLines:u(d,3),isTemplate:v(c)&&e,readmeIsTemplate:e,lastCompiled:b}}(d)),g.push(e)}}else if(c.isFile()){let a=h().extname(c.name).toLowerCase();N.has(a)&&g.push({name:c.name,path:i,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),d=[],e=0,function a(b){for(let c of b)"file"===c.type?d.push(c.path):c.children&&(e++,a(c.children))}(c),b({fileCount:d.length,directoryCount:e}),O={tree:c,allFiles:d,timestamp:Date.now()},R||t(),O)}let R=null,S=null;function t(){let a;if(!R){try{a=p()}catch{return}try{(R=f().watch(a,{recursive:!0},(a,b)=>{!b||b.startsWith(".git")||b.includes("node_modules")||b.includes(".next")||(S&&clearTimeout(S),S=setTimeout(()=>{O=null,P++,S=null},500))})).on("error",()=>{S&&(clearTimeout(S),S=null),R&&(R.close(),R=null)})}catch{R=null}}}function u(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 T=["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 v(a){try{let b=f().readFileSync(a,"utf-8");return T.some(a=>b.includes(a))}catch{return!1}}function w(){return s().tree}function x(){return s().allFiles}function y(a=10){let b=p(),c=x().map(a=>{try{let c=(0,j.n2)(b,a),d=f().statSync(c);return{path:a,mtime:d.mtimeMs}}catch{return null}}).filter(Boolean);return c.sort((a,b)=>b.mtime-a.mtime),c.slice(0,a)}function z(a){let b=p();if(".pdf"===h().extname(a).toLowerCase()){let c=(0,j.n2)(b,a);if(!f().existsSync(c))throw new i.Vt(i.tG.FILE_NOT_FOUND,`File not found: ${a}`,{filePath:a});let d=(0,l.b)(c);if(!d)throw new i.Vt(i.tG.INTERNAL_ERROR,`Could not extract text from PDF: ${a}`,{filePath:a});return d}return(0,j.TA)(b,a)}function A(a,b){(0,j._h)(p(),a,b),r(a)}function B(a,b=""){(0,j.x3)(p(),a,b),O=null,P++,(0,j.As)(p(),a),Q.isBuilt()&&Q.updateFile(p(),a)}function C(a,b){let c=(0,j.H5)(p(),a,b);return q(),c}function D(a,b){(0,j.WZ)(p(),a,b),r(a)}function E(a,b,c){(0,j.wf)(p(),a,b,c),r(a)}function F(a,b,c){(0,j.vg)(p(),a,b,c),r(a)}function G(a,b){let c=(0,j.F2)(p(),a,b);return r(a),c}function H(a,b){let c=(0,j.mV)(p(),a,b,j.G1);return q(),c}function I(a,b=10){return(0,j.FR)(p(),a,b)}function J(a,b){return(0,j.g7)(p(),a,b)}function K(a){let b=(0,n.F0)(p(),a);return q(),b}function L(a){let b,c=p(),d=(b=p(),!Q.isBuiltFor(b)&&Q.rebuild(b),Q).getBacklinks(a);return(0,j.G1)(c,a,d)}d()}catch(a){d(a)}})},12169:(a,b,c)=>{c.d(b,{FR:()=>f,g7:()=>g});var d=c(79646),e=c(13308);function f(a,b,c){let f=(0,e.n2)(a,b),g=(0,d.execFileSync)("git",["log","--follow","--format=%H%x00%aI%x00%s%x00%an","-n",String(c),"--",f],{cwd:a,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();return g?g.split("\n").map(a=>{let[b,c,d,e]=a.split("\0");return{hash:b,date:c,message:d,author:e}}):[]}function g(a,b,c){let f=(0,e.n2)(a,b),g=(0,d.execFileSync)("git",["ls-files","--full-name",f],{cwd:a,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();return g?(0,d.execFileSync)("git",["show",`${c}:${g}`],{cwd:a,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}):(0,d.execFileSync)("git",["show",`${c}:${b}`],{cwd:a,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}},13308:(a,b,c)=>{c.d(b,{cP:()=>A,n2:()=>B});var d=c(33873),e=c.n(d),f=c(29021),g=c.n(f);class h extends Error{constructor(a,b,c,d){super(a),this.name=this.constructor.name,this.code=b,this.statusCode=c,this.context=d?.context,this.cause=d?.cause,this.metadata={timestamp:Date.now(),...d?.metadata},Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,message:this.message,code:this.code,statusCode:this.statusCode,context:this.context,metadata:this.metadata,stack:this.stack}}toUserMessage(){return this.message}}let i={VALIDATION_ERROR:400,NOT_FOUND:404,UNAUTHORIZED:401,FORBIDDEN:403,CONFLICT:409,INTERNAL_ERROR:500,SERVICE_UNAVAILABLE:503,TIMEOUT:408,RATE_LIMIT_EXCEEDED:429,FILE_SYSTEM_ERROR:500,FILE_READ_ERROR:500,FILE_WRITE_ERROR:500,FILE_STAT_ERROR:500,FILE_REMOVE_ERROR:500,FILE_COPY_ERROR:500,FILE_MOVE_ERROR:500,FILE_WATCH_ERROR:500,DIRECTORY_READ_ERROR:500,DIRECTORY_CREATE_ERROR:500,DATABASE_ERROR:500,NETWORK_ERROR:500,CONFIGURATION_ERROR:500,SEARCH_ERROR:500,VECTOR_ERROR:500,MCP_ERROR:500},j={VALIDATION_ERROR:"Validation failed",NOT_FOUND:"Resource not found",UNAUTHORIZED:"Unauthorized access",FORBIDDEN:"Access forbidden",CONFLICT:"Resource conflict",INTERNAL_ERROR:"Internal server error",SERVICE_UNAVAILABLE:"Service unavailable",TIMEOUT:"Operation timed out",RATE_LIMIT_EXCEEDED:"Rate limit exceeded",FILE_SYSTEM_ERROR:"File system operation failed",FILE_READ_ERROR:"Failed to read file",FILE_WRITE_ERROR:"Failed to write file",FILE_STAT_ERROR:"Failed to get file stats",FILE_REMOVE_ERROR:"Failed to remove file",FILE_COPY_ERROR:"Failed to copy file",FILE_MOVE_ERROR:"Failed to move file",FILE_WATCH_ERROR:"Failed to watch file",DIRECTORY_READ_ERROR:"Failed to read directory",DIRECTORY_CREATE_ERROR:"Failed to create directory",DATABASE_ERROR:"Database operation failed",NETWORK_ERROR:"Network operation failed",CONFIGURATION_ERROR:"Configuration error",SEARCH_ERROR:"Search operation failed",VECTOR_ERROR:"Vector operation failed",MCP_ERROR:"MCP operation failed"};function k(a,b,c){let d=i[a],e=j[a];return new h(b??e,a,d,{...c,metadata:{...c?.metadata,retryable:["SERVICE_UNAVAILABLE","TIMEOUT","NETWORK_ERROR"].includes(a),retryAfter:function(a){switch(a){case"RATE_LIMIT_EXCEEDED":return 6e4;case"SERVICE_UNAVAILABLE":return 5e3;case"TIMEOUT":return 1e3;case"NETWORK_ERROR":return 2e3;default:return 0}}(a)}})}let l=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i,m=/[<>:"|?*\x00-\x1f]/;function n(a){return/^[A-Za-z]:/.test(a)}function o(a,b){let c,e,f;if(c=d.resolve(b),e=d.resolve(a),""!==(f=d.relative(c,e))&&(".."===f||f.startsWith(`..${d.sep}`)||d.isAbsolute(f)))throw k("VALIDATION_ERROR","Access denied: path outside root",{context:{resolved:a,root:b}})}function p(a,b,c,d,e,f){return{path:a,webRouteFile:`packages/web/app${a}/route.ts`,owner:b,adapter:c,phase:d,risk:e,residualRisk:f}}let q=(a,b="low")=>p(a,"product-owned","next-response","Phase 1: migrated Product Server adapter",b,"No residual product ownership expected; this route should remain a thin Next adapter."),r=(a,b,c,d)=>p(a,"optional-capability","optional-capability",b,c,d),s=(a,b,c="medium")=>p(a,"host-owned","host","Host-owned",c,b);[q("/api/a2a/agents","medium"),q("/api/a2a/delegations","medium"),q("/api/a2a/discover","medium"),q("/api/a2a","medium"),q("/api/acp/config","high"),q("/api/acp/detect","medium"),q("/api/acp/install","high"),q("/api/acp/registry","medium"),q("/api/acp/session","high"),q("/api/agent-activity"),q("/api/agents/copy-skill","high"),q("/api/agents/custom/detect","medium"),q("/api/agents/custom","high"),q("/api/ask-sessions"),p("/api/ask","product-owned","stream","Phase 6: generated client and stream adapter","high","Ask is mostly Product runtime-owned through session and agent modules, but the streaming Web route still owns host assembly and should become a generated stream adapter."),s("/api/auth","Auth cookie/session handling is host-specific today; Product Server will need an auth context adapter before direct HTTP exposure.","high"),q("/api/backlinks"),q("/api/bootstrap"),q("/api/changes"),q("/api/channels/verify","medium"),q("/api/connect"),q("/api/embedding","medium"),r("/api/export","Phase 5: content ingestion optional capabilities","high","Export/archive logic carries heavy dependencies and filesystem writes that need optional capability packaging."),r("/api/extract-docx","Phase 5: content ingestion optional capabilities","high","DOCX extraction should be Product-owned but lazy-loaded so parser dependencies do not inflate the default package."),r("/api/extract-pdf","Phase 5: content ingestion optional capabilities","high","PDF extraction should be Product-owned but lazy-loaded so parser dependencies do not inflate the default package."),r("/api/file/import","Phase 5: content ingestion optional capabilities","high","File import is a content-ingestion write path and needs capability-level size limits, conflict checks, and rollback."),q("/api/file/raw"),q("/api/file","high"),q("/api/files"),q("/api/git"),q("/api/graph"),q("/api/health"),q("/api/im/activity","medium"),q("/api/im/config","high"),s("/api/im/feishu/long-connection/event","Raw long-connection event delivery is host-specific, but event parsing and state updates should stay behind Product protocol handlers.","medium"),q("/api/im/feishu/long-connection","high"),q("/api/im/status","medium"),q("/api/im/test","medium"),q("/api/im/webhook-status","medium"),s("/api/im/webhook/feishu","Raw inbound Feishu webhook receipt is host-owned, while signature verification and state writes should move to Product protocol handlers.","high"),r("/api/inbox/clip","Phase 5: content ingestion optional capabilities","high","Inbox clipping is still Web-owned ingestion and needs optional capability packaging plus fetch timeout and content limits."),q("/api/inbox","medium"),q("/api/init","high"),r("/api/lint","Phase 5: content ingestion optional capabilities","medium","Knowledge linting remains Web-owned and should become an optional Product capability with bounded filesystem traversal."),q("/api/mcp/agents","high"),q("/api/mcp/direct-tools","medium"),q("/api/mcp/install-skill","high"),q("/api/mcp/install","high"),q("/api/mcp/restart","high"),q("/api/mcp/status"),q("/api/mcp/tools","medium"),q("/api/mcp/uninstall","high"),q("/api/monitoring","medium"),r("/api/obsidian-plugins/settings","Phase 5: content ingestion optional capabilities","medium","Obsidian plugin settings remain Web-owned and should be modeled as an optional Product compatibility capability."),r("/api/obsidian/compat-report","Phase 5: content ingestion optional capabilities","medium","Obsidian compatibility reporting remains Web-owned and should use optional capability diagnostics."),r("/api/obsidian/import","Phase 5: content ingestion optional capabilities","high","Obsidian import remains a Web-owned bulk write path and needs optional capability size limits and rollback."),q("/api/recent-files"),q("/api/restart","high"),q("/api/search/prewarm"),q("/api/search"),q("/api/settings/list-models","medium"),q("/api/settings/reset-token","high"),q("/api/settings","medium"),q("/api/settings/test-key","medium"),q("/api/setup/check-path","medium"),q("/api/setup/check-port","medium"),q("/api/setup/generate-token","medium"),q("/api/setup/ls","medium"),q("/api/setup","high"),q("/api/skills","high"),q("/api/space-overview"),q("/api/sync","high"),q("/api/tree-version"),q("/api/uninstall","high"),q("/api/update-check"),q("/api/update-status"),q("/api/update","high"),q("/api/workflows","medium")].map(a=>[a.path,a]),c(51455),c(73024);var t=c(76760);c(77598);var u=c(48161);function v(a){return"darwin"===process.platform?a.darwin:"win32"===process.platform?`${(process.env.APPDATA||(0,t.join)((0,u.homedir)(),"AppData","Roaming")).replace(/\\/g,"/").replace(/\/+$/,"")}/${a.win32}`:a.linux}c(37067),c(73136),v({darwin:"~/Library/Application Support/Code/User",linux:"~/.config/Code/User",win32:"Code/User"}),v({darwin:"~/Library/Application Support/Code",linux:"~/.config/Code",win32:"Code"}),v({darwin:"~/Library/Application Support/Trae CN",linux:"~/.config/Trae CN",win32:"Trae CN"}),c(31421),c(50294);var w=c(79646);(0,c(28354).promisify)(w.execFile),(0,t.join)((0,u.homedir)(),".mindos","im-activity.json"),(0,t.join)((0,u.homedir)(),".mindos","im.json"),(0,t.join)((0,u.homedir)(),".mindos","im.json"),(0,t.join)((0,u.homedir)(),".mindos","im.json"),c(21820),c(77030),c(38264);let x=(0,t.join)((0,u.homedir)(),".mindos");(0,t.join)(x,"config.json"),(0,t.join)(x,"sync-state.json"),[{id:"health",method:"GET",path:"/api/health",auth:"public"},{id:"files",method:"GET",path:"/api/files",auth:"required"},{id:"recent-files",method:"GET",path:"/api/recent-files",auth:"required"},{id:"tree-version",method:"GET",path:"/api/tree-version",auth:"required"},{id:"file.read",method:"GET",path:"/api/file",auth:"required"},{id:"file.write",method:"POST",path:"/api/file",auth:"required"},{id:"file.raw",method:"GET",path:"/api/file/raw",auth:"required"},{id:"search",method:"GET",path:"/api/search",auth:"required"},{id:"search.prewarm",method:"GET",path:"/api/search/prewarm",auth:"required"},{id:"a2a",method:"POST",path:"/api/a2a",auth:"required"},{id:"a2a.options",method:"OPTIONS",path:"/api/a2a",auth:"public"},{id:"a2a.agents",method:"GET",path:"/api/a2a/agents",auth:"required"},{id:"a2a.delegations",method:"GET",path:"/api/a2a/delegations",auth:"required"},{id:"a2a.discover",method:"POST",path:"/api/a2a/discover",auth:"required"},{id:"acp.config",method:"GET",path:"/api/acp/config",auth:"required"},{id:"acp.config.update",method:"POST",path:"/api/acp/config",auth:"required"},{id:"acp.config.delete",method:"DELETE",path:"/api/acp/config",auth:"required"},{id:"acp.detect",method:"GET",path:"/api/acp/detect",auth:"required"},{id:"acp.install",method:"POST",path:"/api/acp/install",auth:"required"},{id:"acp.registry",method:"GET",path:"/api/acp/registry",auth:"required"},{id:"acp.session",method:"GET",path:"/api/acp/session",auth:"required"},{id:"acp.session.action",method:"POST",path:"/api/acp/session",auth:"required"},{id:"acp.session.close",method:"DELETE",path:"/api/acp/session",auth:"required"},{id:"backlinks",method:"GET",path:"/api/backlinks",auth:"required"},{id:"graph",method:"GET",path:"/api/graph",auth:"required"},{id:"agent-activity",method:"GET",path:"/api/agent-activity",auth:"required"},{id:"bootstrap",method:"GET",path:"/api/bootstrap",auth:"required"},{id:"connect",method:"GET",path:"/api/connect",auth:"required"},{id:"embedding",method:"GET",path:"/api/embedding",auth:"required"},{id:"embedding.action",method:"POST",path:"/api/embedding",auth:"required"},{id:"channels.verify",method:"POST",path:"/api/channels/verify",auth:"required"},{id:"im.activity",method:"GET",path:"/api/im/activity",auth:"required"},{id:"im.config",method:"GET",path:"/api/im/config",auth:"required"},{id:"im.config.update",method:"PUT",path:"/api/im/config",auth:"required"},{id:"im.config.delete",method:"DELETE",path:"/api/im/config",auth:"required"},{id:"im.status",method:"GET",path:"/api/im/status",auth:"required"},{id:"im.test",method:"POST",path:"/api/im/test",auth:"required"},{id:"im.webhook-status",method:"GET",path:"/api/im/webhook-status",auth:"required"},{id:"im.feishu.long-connection",method:"GET",path:"/api/im/feishu/long-connection",auth:"required"},{id:"im.feishu.long-connection.start",method:"POST",path:"/api/im/feishu/long-connection",auth:"required"},{id:"im.feishu.long-connection.stop",method:"DELETE",path:"/api/im/feishu/long-connection",auth:"required"},{id:"monitoring",method:"GET",path:"/api/monitoring",auth:"required"},{id:"update-status",method:"GET",path:"/api/update-status",auth:"required"},{id:"update-check",method:"GET",path:"/api/update-check",auth:"required"},{id:"restart",method:"POST",path:"/api/restart",auth:"required"},{id:"update",method:"POST",path:"/api/update",auth:"required"},{id:"uninstall",method:"POST",path:"/api/uninstall",auth:"required"},{id:"init",method:"POST",path:"/api/init",auth:"required"},{id:"sync",method:"GET",path:"/api/sync",auth:"required"},{id:"sync.action",method:"POST",path:"/api/sync",auth:"required"},{id:"inbox",method:"GET",path:"/api/inbox",auth:"required"},{id:"inbox.save",method:"POST",path:"/api/inbox",auth:"required"},{id:"inbox.archive",method:"DELETE",path:"/api/inbox",auth:"required"},{id:"setup.check-path",method:"POST",path:"/api/setup/check-path",auth:"required"},{id:"setup.check-port",method:"POST",path:"/api/setup/check-port",auth:"required"},{id:"setup.generate-token",method:"POST",path:"/api/setup/generate-token",auth:"required"},{id:"setup.ls",method:"POST",path:"/api/setup/ls",auth:"required"},{id:"setup",method:"GET",path:"/api/setup",auth:"required"},{id:"setup.apply",method:"POST",path:"/api/setup",auth:"required"},{id:"setup.guide-state",method:"PATCH",path:"/api/setup",auth:"required"},{id:"workflows",method:"GET",path:"/api/workflows",auth:"required"},{id:"workflows.create",method:"POST",path:"/api/workflows",auth:"required"},{id:"ask.stream",method:"POST",path:"/api/ask",auth:"required"},{id:"ask-sessions",method:"GET",path:"/api/ask-sessions",auth:"required"},{id:"ask-sessions.save",method:"POST",path:"/api/ask-sessions",auth:"required"},{id:"ask-sessions.delete",method:"DELETE",path:"/api/ask-sessions",auth:"required"},{id:"space-overview",method:"GET",path:"/api/space-overview",auth:"required"},{id:"git",method:"GET",path:"/api/git",auth:"required"},{id:"settings",method:"GET",path:"/api/settings",auth:"required"},{id:"settings.update",method:"POST",path:"/api/settings",auth:"required"},{id:"settings.reset-token",method:"POST",path:"/api/settings/reset-token",auth:"required"},{id:"settings.test-key",method:"POST",path:"/api/settings/test-key",auth:"required"},{id:"settings.list-models",method:"POST",path:"/api/settings/list-models",auth:"required"},{id:"mcp.status",method:"GET",path:"/api/mcp/status",auth:"required"},{id:"mcp.agents",method:"GET",path:"/api/mcp/agents",auth:"required"},{id:"mcp.tools",method:"GET",path:"/api/mcp/tools",auth:"required"},{id:"mcp.direct-tools",method:"POST",path:"/api/mcp/direct-tools",auth:"required"},{id:"mcp.install",method:"POST",path:"/api/mcp/install",auth:"required"},{id:"mcp.install-skill",method:"POST",path:"/api/mcp/install-skill",auth:"required"},{id:"mcp.restart",method:"POST",path:"/api/mcp/restart",auth:"required"},{id:"mcp.uninstall",method:"POST",path:"/api/mcp/uninstall",auth:"required"},{id:"skills",method:"GET",path:"/api/skills",auth:"required"},{id:"skills.action",method:"POST",path:"/api/skills",auth:"required"},{id:"changes",method:"GET",path:"/api/changes",auth:"required"},{id:"changes.mark-seen",method:"POST",path:"/api/changes",auth:"required"},{id:"agents.custom.create",method:"POST",path:"/api/agents/custom",auth:"required"},{id:"agents.custom.update",method:"PUT",path:"/api/agents/custom",auth:"required"},{id:"agents.custom.delete",method:"DELETE",path:"/api/agents/custom",auth:"required"},{id:"agents.custom.detect",method:"POST",path:"/api/agents/custom/detect",auth:"required"},{id:"agents.copy-skill",method:"POST",path:"/api/agents/copy-skill",auth:"required"}].map(a=>[`${a.method} ${a.path}`,a.auth]),c(84389);var y=c(39852);function z(a,b){return a instanceof y.Vt?a:new y.Vt(y.tG.PATH_OUTSIDE_ROOT,a?.message||"Access denied: path outside MIND_ROOT",a?.context??b)}function A(a,b){try{o(a,b)}catch(c){throw z(c,{resolved:a,root:b})}}function B(a,b){var c,f;let h,i,j,p,q,r=function(a,b){try{let g=b.replace(/\\/g,"/");if(d.isAbsolute(g)||d.win32.isAbsolute(b)||d.win32.isAbsolute(g)||n(b)||n(g))throw k("VALIDATION_ERROR","Access denied: absolute paths are not allowed",{context:{root:a,filePath:b}});var c=a,e=b,f=g;for(let a of f.split("/"))if(a&&"."!==a&&(a.endsWith(".")||a.endsWith(" ")||l.test(a)||m.test(a)))throw k("VALIDATION_ERROR","Access denied: path contains a Windows-invalid file name segment",{context:{root:c,filePath:e,segment:a}});let h=d.resolve(a),i=d.resolve(d.join(h,g));return o(i,h),i}catch(c){throw z(c,{mindRoot:a,filePath:b})}}(a,b),s=function(a){let b=a;for(;!g().existsSync(b);){let a=e().dirname(b);if(a===b)break;b=a}return b}(r);try{h=g().realpathSync(e().resolve(a)),i=g().realpathSync(s)}catch(c){throw z(c,{mindRoot:a,filePath:b,resolved:r,existing:s})}if(c=i,f=h,j=e().resolve(f),p=e().resolve(c),""!==(q=e().relative(j,p))&&(".."===q||q.startsWith(`..${e().sep}`)||e().isAbsolute(q)))throw new y.Vt(y.tG.PATH_OUTSIDE_ROOT,"Access denied: symlink resolves outside MIND_ROOT",{mindRoot:a,filePath:b,resolved:r,existing:s,targetReal:i});return r}},14360:(a,b,c)=>{c.d(b,{P2:()=>j,WZ:()=>k,vg:()=>m,wf:()=>l});var d=c(29021),e=c.n(d),f=c(59349),g=c(39852),h=c(13308);function i(a,b){return(0,f.TA)(a,b).split("\n")}function j(a,b,c,d,e){let h=i(a,b);var j=h.length;if(c<0||d<0)throw new g.Vt(g.tG.INVALID_RANGE,"Invalid line index: indices must be >= 0",{start:c,end:d});if(c>d)throw new g.Vt(g.tG.INVALID_RANGE,`Invalid range: start (${c}) > end (${d})`,{start:c,end:d});if(c>=j)throw new g.Vt(g.tG.INVALID_RANGE,`Invalid line index: start (${c}) >= total lines (${j})`,{start:c,totalLines:j});h.splice(c,d-c+1,...e),(0,f._h)(a,b,h.join("\n"))}function k(a,b,c){let d=(0,h.n2)(a,b);try{let a=e().statSync(d);if(0===a.size)return void e().appendFileSync(d,c,"utf-8");let b=Math.min(8,a.size),f=e().openSync(d,"r");try{let g=Buffer.alloc(b);e().readSync(f,g,0,b,Math.max(0,a.size-b));let h=g.toString("utf-8").endsWith("\n\n")?"":"\n";e().appendFileSync(d,h+c,"utf-8")}finally{e().closeSync(f)}}catch(g){let d=(0,f.TA)(a,b),e=d.length>0&&!d.endsWith("\n\n")?"\n":"";(0,f._h)(a,b,d+e+c)}}function l(a,b,c,d){let e=i(a,b),h=e.findIndex(a=>{let b=a.trim();return b===c||b.replace(/^#+\s*/,"")===c.replace(/^#+\s*/,"")});if(-1===h)throw new g.Vt(g.tG.HEADING_NOT_FOUND,`Heading not found: "${c}"`,{heading:c});let j=h+1;for(;j<e.length&&""===e[j].trim();)j++;!function(a,b,c,d){let e=i(a,b);if(c>=e.length)throw new g.Vt(g.tG.INVALID_RANGE,`Invalid after_index: ${c} >= total lines (${e.length})`,{afterIndex:c,totalLines:e.length});e.splice(c<0?0:c+1,0,...d),(0,f._h)(a,b,e.join("\n"))}(a,b,j-1,["",d])}function m(a,b,c,d){let e=i(a,b),f=e.findIndex(a=>{let b=a.trim();return b===c||b.replace(/^#+\s*/,"")===c.replace(/^#+\s*/,"")});if(-1===f)throw new g.Vt(g.tG.HEADING_NOT_FOUND,`Heading not found: "${c}"`,{heading:c});let h=(e[f].match(/^#+/)??[""])[0].length,k=e.length-1;for(let a=f+1;a<e.length;a++){let b=e[a].match(/^(#+)\s/);if(b&&b[1].length<=h){k=a-1;break}}for(;k>f&&""===e[k].trim();)k--;j(a,b,f+1,k,["",d])}},22288:(a,b,c)=>{var d=c(73566),e=c(31751),f=c(59349),g=c(13308),h=c(28647),i=c(87155),j=c(33873),k=c.n(j);let l="u">typeof Intl&&Intl.Segmenter?new Intl.Segmenter("zh",{granularity:"word"}):null;function m(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])}if(d.parentPort&&d.workerData?.mindRoot)try{let a=function(a){let b=(0,e.f)(a),c={},d={},j=0;for(let e of b){let b;if(".pdf"===k().extname(e).toLowerCase())try{let c=(0,g.n2)(a,e);if(!(b=(0,h.b)(c)))continue}catch{continue}else try{b=(0,f.TA)(a,e)}catch{continue}for(let a of(d[e]=b.length,j+=b.length,b.length>5e4&&(b=b.slice(0,5e4)),function(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(i.y.test(c))if(l)for(let{segment:a,isWordLike:d}of l.segment(c)){if(!d)continue;let c=a.trim();if(c)for(let a of(b.add(c),c))i.y.test(a)&&b.add(a)}else{let a=[];for(let d of c)i.y.test(d)?a.push(d):a.length>0&&(m(a,b),a.length=0);a.length>0&&m(a,b)}return b}(e+"\n"+b)))c[a]||(c[a]=[]),c[a].push(e)}return{version:1,builtForRoot:a,fileCount:b.length,totalChars:j,docLengths:d,invertedIndex:c,timestamp:Date.now()}}(d.workerData.mindRoot);d.parentPort.postMessage({ok:!0,data:a})}catch(a){d.parentPort.postMessage({ok:!1,error:a instanceof Error?a.message:String(a)})}},23414:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Sf:()=>p,kh:()=>q,sb:()=>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(28696),l=c(31756),m=c(62697),n=a([l,m]);[l,m]=n.then?(await n)():n;let r=h().join(j().homedir(),".mindos","config.json"),s={ai:{activeProvider:"",providers:[]},mindRoot:""},t=new Set(["free","tavily","brave","serper","bing-api"]);function o(){try{var a;let c=f().readFileSync(r,"utf-8"),d=JSON.parse(c),e=d.ai,g=e&&!Array.isArray(e.providers),i={ai:function(a){let b=a.ai;if(!b)return{...s.ai};if(Array.isArray(b.providers)){let a=(0,m.S9)(b.providers),c="string"==typeof b.activeProvider?b.activeProvider:"";return{activeProvider:function(a,b){if(a&&(0,m.Ny)(a)&&(0,m.lh)(b,a))return a;if(a&&(0,l.rl)(a)){let c=b.find(b=>b.protocol===a);if(c)return c.id}return b[0]?.id??""}(c,a),providers:a}}let c=(0,m.Ko)(a);return c?{activeProvider:c.activeProvider,providers:c.providers}:{...s.ai}}(d),agent:function(a){if(!a||"object"!=typeof a)return;let b={};return"number"==typeof a.maxSteps&&(b.maxSteps=Math.min(999,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}(d.agent),embedding:function(a){if(!a||"object"!=typeof a||"boolean"!=typeof a.enabled)return;let b="local"===a.provider||"api"===a.provider?a.provider:"api";return{enabled:a.enabled,provider:b,baseUrl:"string"==typeof a.baseUrl?a.baseUrl:"",apiKey:"string"==typeof a.apiKey?a.apiKey:"",model:"string"==typeof a.model?a.model:""}}(d.embedding),webSearch:function(a){if(a&&"object"==typeof a)return{provider:"string"==typeof a.provider&&t.has(a.provider)?a.provider:"free",apiKey:"string"==typeof a.apiKey?a.apiKey:""}}(d.webSearch),acpAgents:(a=d.acpAgents,(0,k.gG)(a)),mindRoot:d.mindRoot??s.mindRoot,webPassword:"string"==typeof d.webPassword?d.webPassword:void 0,authToken:"string"==typeof d.authToken?d.authToken:void 0,allowNetworkAccess:!0===d.allowNetworkAccess,mcpPort:"number"==typeof d.mcpPort?d.mcpPort:void 0,port:"number"==typeof d.port?d.port:void 0,startMode:"string"==typeof d.startMode?d.startMode:void 0,setupPending:!0===d.setupPending||void 0,disabledSkills:Array.isArray(d.disabledSkills)?d.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}}(d.guideState),baseUrlCompat:(()=>{let a=d.baseUrlCompat;if(!a||"object"!=typeof a)return;let b={};for(let[c,d]of Object.entries(a))("streaming"===d||"non-streaming"===d)&&(b[c]=d);return Object.keys(b).length>0?b:void 0})(),connectionMode:function(a){if(a.connectionMode&&"object"==typeof a.connectionMode){let b=a.connectionMode;if("boolean"==typeof b.cli&&"boolean"==typeof b.mcp)return{cli:b.cli,mcp:b.mcp}}let b=!0===a.setupPending||!a.mindRoot;return{cli:!0,mcp:!b}}(d),customAgents:Array.isArray(d.customAgents)?d.customAgents:void 0};if(g)try{var b=i;let a=h().dirname(r);f().existsSync(a)||f().mkdirSync(a,{recursive:!0});let c={};try{c=JSON.parse(f().readFileSync(r,"utf-8"))}catch{}let d={...c,ai:b.ai,mindRoot:b.mindRoot};void 0!==b.agent&&(d.agent=b.agent),void 0!==b.embedding&&(d.embedding=b.embedding),void 0!==b.webSearch&&(d.webSearch=b.webSearch),void 0!==b.webPassword&&(d.webPassword=b.webPassword),void 0!==b.authToken&&(d.authToken=b.authToken),"boolean"==typeof b.allowNetworkAccess&&(d.allowNetworkAccess=b.allowNetworkAccess),void 0!==b.port&&(d.port=b.port),void 0!==b.mcpPort&&(d.mcpPort=b.mcpPort),void 0!==b.startMode&&(d.startMode=b.startMode),void 0!==b.disabledSkills&&(d.disabledSkills=b.disabledSkills),void 0!==b.guideState&&(d.guideState=b.guideState),void 0!==b.acpAgents&&(d.acpAgents=b.acpAgents),void 0!==b.baseUrlCompat&&(d.baseUrlCompat=b.baseUrlCompat),void 0!==b.connectionMode&&(d.connectionMode=b.connectionMode),void 0!==b.customAgents&&(d.customAgents=b.customAgents),void 0!==b.skillPaths&&(d.skillPaths=b.skillPaths),delete d.customProviders,"setupPending"in b&&(b.setupPending?d.setupPending=!0:delete d.setupPending),"setupPort"in b&&(b.setupPort?d.setupPort=b.setupPort:delete d.setupPort),f().writeFileSync(r,JSON.stringify(d,null,2)+"\n","utf-8")}catch{}return i}catch{return{...s,ai:{...s.ai,providers:[]},setupPending:!0,connectionMode:{cli:!0,mcp:!1},allowNetworkAccess:!1}}}function p(a){let b=o(),c=a||b.ai.activeProvider,d=c?(0,m.lh)(b.ai.providers,c):void 0;if(!d&&a&&(0,l.rl)(a)){let c=b.ai.activeProvider?(0,m.lh)(b.ai.providers,b.ai.activeProvider):void 0;d=c?.protocol===a?c:b.ai.providers.find(b=>b.protocol===a)}if(d){let a=l.T_[d.protocol],b=d.apiKey||(0,l.lr)(d.protocol)||a?.apiKeyFallback||"",c=d.model||a?.defaultModel||"",e=d.baseUrl||a?.fixedBaseUrl||"";return{provider:d.protocol,apiKey:b,model:c,baseUrl:e}}let e=a&&(0,l.rl)(a)?a:process.env.AI_PROVIDER,f=e&&(0,l.rl)(e)?e:"anthropic",g=l.T_[f]??l.T_.anthropic;return{provider:f,apiKey:(0,l.lr)(f)||g.apiKeyFallback||"",model:g.defaultModel,baseUrl:g.fixedBaseUrl||""}}function q(){return o().mindRoot||process.env.MIND_ROOT||h().join(j().homedir(),"MindOS","mind")}d()}catch(a){d(a)}})},27152:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Bk:()=>p,II:()=>o,s7:()=>q});var e=c(23414),f=c(79646),g=c(29021),h=c.n(g),i=c(21820),j=c.n(i),k=c(33873),l=c.n(k),m=c(79551),n=a([e]);function o(){try{let a=(0,e.sb)().embedding;if(!a||!a.enabled||"api"===a.provider&&(!a.baseUrl||!a.model)||"local"===a.provider&&!a.model)return null;return{enabled:!0,provider:a.provider||"api",baseUrl:(a.baseUrl||"").replace(/\/+$/,""),apiKey:a.apiKey||"",model:a.model}}catch{return null}}async function p(a){let b=o();if(!b||0===a.length)return[];try{if("local"===b.provider)return await x(b.model,a);return await y(b,a)}catch(a){return console.error("[embedding] Failed to get embeddings:",a instanceof Error?a.message:a),[]}}async function q(a){let b=await p([a]);return b.length>0?b[0]:null}e=(n.then?(await n)():n)[0];let B=["@huggingface/transformers@4.2.0","onnxruntime-node@1.24.3","onnxruntime-web@1.26.0-dev.20260416-b7804b056c"],C=Function("specifier","return import(specifier)");class D extends Error{constructor(a="Local embedding runtime is not installed. Install it from Settings > AI > Embedding Search, or use API mode."){super(a),this.name="LocalEmbeddingRuntimeMissingError"}}function r(){return process.env.MINDOS_LOCAL_EMBEDDING_RUNTIME_DIR||l().join(j().homedir(),".mindos","local-embedding-runtime")}let E=null,F=null,G=null;async function s(){let a=r();h().mkdirSync(a,{recursive:!0});let b=l().join(a,"package.json");h().existsSync(b)||h().writeFileSync(b,JSON.stringify({private:!0,name:"mindos-local-embedding-runtime",description:"Optional MindOS local embedding runtime installed on user request."},null,2)+"\n");let c=function(){if(process.env.MINDOS_NPM_BIN)return{command:process.env.MINDOS_NPM_BIN,args:[]};let a=process.env.MINDOS_PROJECT_ROOT;if(a){let b=l().join(a,"node","lib","node_modules","npm","bin","npm-cli.js");if(h().existsSync(b))return{command:process.env.MINDOS_NODE_BIN||process.execPath,args:[b]}}return{command:"win32"===process.platform?"npm.cmd":"npm",args:[]}}(),d=[...c.args,"install","--prefix",a,"--omit=dev","--no-audit","--no-fund","--ignore-scripts",...B];await t(c.command,d,6e5)}async function t(a,b,c){await new Promise((d,e)=>{let g=(0,f.spawn)(a,b,{stdio:["ignore","pipe","pipe"],env:process.env}),h="",i=setTimeout(()=>{g.kill("SIGTERM"),e(Error("Local embedding runtime install timed out. Check your network and try again, or use API mode."))},c);g.stdout.on("data",a=>{(h+=a.toString()).length>8e3&&(h=h.slice(-8e3))}),g.stderr.on("data",a=>{(h+=a.toString()).length>8e3&&(h=h.slice(-8e3))}),g.on("error",a=>{clearTimeout(i),"ENOENT"===a.code?e(Error("npm is required to install the optional local embedding runtime. Install Node.js/npm, or use API embedding mode.")):e(a)}),g.on("exit",a=>{clearTimeout(i),0===a?d():e(Error(`Local embedding runtime install failed with exit code ${a}. ${h.trim().slice(-1e3)}`))})})}async function u(a){return E&&F===a?E:G&&F===a?G:(F=a,G=(async()=>{for(let b=0;b<=2;b++){let c=null,d=!1,e=null;try{let{pipeline:e,env:f}=await v({installIfMissing:!1});process.env.HF_ENDPOINT||f.remoteHost||(console.log("[embedding] Configuring hf-mirror.com for better connectivity in China"),f.remoteHost="https://hf-mirror.com",f.remotePathTemplate="{model}/resolve/{revision}/{fileName}"),c=setTimeout(()=>{d=!0},3e5),console.log(`[embedding] Attempt ${b+1}/3: Loading pipeline for ${a}...`);let g=e("feature-extraction",a,{dtype:"fp32"});return E=await g,c&&clearTimeout(c),console.log(`[embedding] Successfully loaded pipeline for ${a}`),E}catch(f){e=f instanceof Error?f:Error(String(f)),c&&clearTimeout(c),d&&(e=Error("Request timeout (>300s)"));let a=function(a){if(!(a instanceof Error))return!1;let b=a.message.toLowerCase();return b.includes("enotfound")||b.includes("econnrefused")||b.includes("econnreset")||b.includes("etimedout")||b.includes("timeout")||b.includes("temporarily unavailable")||b.includes("connect econnrefused")||b.includes("net::err_internet_disconnected")||b.includes("eaddrnotavail")||b.includes("enetunreach")||b.includes("socket hang up")}(e)&&b<2;if(console.error(`[embedding] Download attempt ${b+1}/3 failed: ${e.message}`+(a?` — retrying...`:" — giving up")),a){let a=1e3*Math.pow(2,b);console.log(`[embedding] Waiting ${a}ms before retry...`),await new Promise(b=>setTimeout(b,a));continue}throw E=null,F=null,G=null,e}}})())}async function v({installIfMissing:a}){try{return await Promise.resolve().then(c.bind(c,99253))}catch(c){let b=w();if(b)return await C((0,m.pathToFileURL)(b).href);if(a){await s();let a=w();if(a)return await C((0,m.pathToFileURL)(a).href)}throw new D(c instanceof Error&&c.message.includes("@huggingface/transformers")?void 0:`Local embedding runtime is unavailable: ${c instanceof Error?c.message:String(c)}`)}}function w(){let a=l().join(r(),"node_modules","@huggingface","transformers"),b=l().join(a,"package.json");if(!h().existsSync(b))return null;try{let c=JSON.parse(h().readFileSync(b,"utf-8")),d=c.exports?.node?.import?.default,e="string"==typeof d?d:"string"==typeof c.module?c.module:c.main;if("string"!=typeof e)return null;let f=l().resolve(a,e);return h().existsSync(f)?f:null}catch{return null}}async function x(a,b){let c=await u(a);if(!c)return[];let d=[];for(let a=0;a<b.length;a+=32)for(let e of b.slice(a,a+32)){let a=(await c(e,{pooling:"mean",normalize:!0})).data;d.push(new Float32Array(a))}return d}async function y(a,b){let c=[];for(let d=0;d<b.length;d+=100){let e=b.slice(d,d+100),f=await z(a,e);if(0===f.length)return[];c.push(...f)}return c}async function z(a,b){let c=`${a.baseUrl}/embeddings`,d=JSON.stringify({model:a.model,input:b}),e={"Content-Type":"application/json"};a.apiKey&&(e.Authorization=`Bearer ${a.apiKey}`);for(let a=0;a<=2;a++)try{let b=new AbortController,f=setTimeout(()=>b.abort(),3e4),g=await fetch(c,{method:"POST",headers:e,body:d,signal:b.signal});if(clearTimeout(f),!g.ok){let b=g.status;if((429===b||b>=500)&&a<2){let a=parseInt(g.headers.get("retry-after")||"1",10);await A(Math.min(1e3*a,5e3));continue}let c=await g.text().catch(()=>"");return console.error(`[embedding] API error ${b}: ${c.slice(0,200)}`),[]}let h=await g.json();if(!h.data||!Array.isArray(h.data))return console.error("[embedding] Unexpected response shape"),[];return h.data.sort((a,b)=>a.index-b.index),h.data.map(a=>new Float32Array(a.embedding))}catch(b){if(a<2){await A(1e3*(a+1));continue}console.error("[embedding] Request failed:",b instanceof Error?b.message:b);break}return[]}function A(a){return new Promise(b=>setTimeout(b,a))}d()}catch(a){d(a)}})},28287:(a,b,c)=>{c.d(b,{F0:()=>m});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(13308);function i(a){return k(a,".trash")}function j(a){return k(a,".trash-meta")}function k(a,b){l(b);let c=g().resolve(g().dirname(a)),d=g().resolve(c,b),f=g().relative(c,d);if(".."===f||f.startsWith(`..${g().sep}`)||g().isAbsolute(f))throw Error("Access denied: trash directory outside root parent");if(e().existsSync(d)){if(e().lstatSync(d).isSymbolicLink())throw Error("Access denied: trash directory must not be a symlink");let a=e().realpathSync(c),b=e().realpathSync(d),f=g().relative(a,b);if(".."===f||f.startsWith(`..${g().sep}`)||g().isAbsolute(f))throw Error("Access denied: trash directory outside root parent")}return d}function l(a){if(!a||a.includes("/")||a.includes("\\")||g().basename(a)!==a)throw Error("Invalid trash id")}function m(a,b){let c,d;e().mkdirSync(i(a),{recursive:!0}),e().mkdirSync(j(a),{recursive:!0});let f=(0,h.n2)(a,b);if(!e().existsSync(f))throw Error(`File not found: ${b}`);let k=e().statSync(f).isDirectory(),m=g().basename(b),n=(c=m.replace(/[^a-zA-Z0-9._\-\u4e00-\u9fff]/g,"_"),`${Date.now()}_${c}`),o=g().join(i(a),n);if(e().mkdirSync(g().dirname(o),{recursive:!0}),k)e().cpSync(f,o,{recursive:!0}),e().rmSync(f,{recursive:!0,force:!0});else try{e().renameSync(f,o)}catch(a){if("EXDEV"===a.code)e().copyFileSync(f,o),e().unlinkSync(f);else throw a}let p=new Date,q={id:n,originalPath:b,deletedAt:p.toISOString(),expiresAt:new Date(p.getTime()+2592e6).toISOString(),fileName:m,isDirectory:k};return l(q.id),d=g().join(j(a),`${q.id}.json`),e().writeFileSync(d,JSON.stringify(q,null,2),"utf-8"),q}},28647:(a,b,c)=>{c.d(b,{b:()=>i});var d=c(79646),e=c(29021),f=c.n(e),g=c(33873),h=c.n(g);function i(a){try{let b=function(a){let b=[],c=process.env.MINDOS_PROJECT_ROOT;c&&b.push(h().join(c,"packages","web","scripts",a));let d=process.cwd();for(let c of(b.push(h().join(d,"scripts",a)),b.push(h().resolve(d,"..","..","scripts",a)),b.push(h().join(d,".next","standalone","scripts",a)),b))if(f().existsSync(c))return c;return null}("extract-pdf.cjs");if(!b)return"";let c=(0,d.execFileSync)(function(a=process.env){return a.MINDOS_NODE_BIN?.trim()||process.execPath}(),[b,a],{encoding:"utf-8",timeout:15e3,maxBuffer:5242880});return JSON.parse(c).text||""}catch{return""}}},28696:(a,b,c)=>{c.d(b,{gG:()=>d.gG});var d=c(50294)},30281:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{O:()=>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(31751),l=c(59349),m=c(27152),n=a([m]);m=(n.then?(await n)():n)[0];class o{isReady(){return this._ready}isBuilding(){return this._building}getDocCount(){return this.vectors.size}getDimensions(){return this.dimensions}async rebuild(a){if(!this._building){this._building=!0;try{if(!(0,m.II)()){this._building=!1;return}let b=(0,k.f)(a),c=[],d=[];for(let e of b){let b,f=h().extname(e).toLowerCase();if(".md"!==f&&".csv"!==f)continue;try{b=(0,l.TA)(a,e)}catch{continue}let g=`${e}
|
|
2
2
|
${b}`.slice(0,8e3);c.push(g),d.push(e)}if(0===c.length){this._building=!1,this._ready=!0,this.builtForRoot=a;return}let e=await (0,m.Bk)(c);if(e.length!==c.length){console.error(`[embedding-index] Expected ${c.length} vectors, got ${e.length}`),this._building=!1;return}this.vectors.clear(),this.dimensions=e[0].length;for(let a=0;a<d.length;a++)this.vectors.set(d[a],e[a]);this.builtForRoot=a,this._ready=!0;try{this.persist()}catch{}}catch(a){console.error("[embedding-index] Rebuild failed:",a instanceof Error?a.message:a)}finally{this._building=!1}}}async updateFile(a,b){let c;if(!this._ready)return;let d=h().extname(b).toLowerCase();if(".md"!==d&&".csv"!==d)return;try{c=(0,l.TA)(a,b)}catch{return}let e=`${b}
|
|
3
|
-
${c}`.slice(0,8e3),f=await (0,m.s7)(e);f&&(this.vectors.set(b,f),0===this.dimensions&&(this.dimensions=f.length))}removeFile(a){this.vectors.delete(a)}searchByVector(a,b=20){if(!this._ready||0===this.vectors.size)return[];if(this.dimensions>0&&a.length!==this.dimensions)return console.warn(`[embedding-index] Dimension mismatch: query has ${a.length} dimensions, index has ${this.dimensions}. Returning empty results.`),[];let c=[];for(let[b,d]of this.vectors){let e=function(a,b){if(a.length!==b.length||0===a.length)return 0;let c=0,d=0,e=0;for(let f=0;f<a.length;f++)c+=a[f]*b[f],d+=a[f]*a[f],e+=b[f]*b[f];let f=Math.sqrt(d)*Math.sqrt(e);return 0===f?0:Math.max(0,Math.min(1,c/f))}(a,d);c.push({path:b,similarity:e})}return c.sort((a,b)=>b.similarity-a.similarity),c.slice(0,b)}async search(a,b=20){if(!this._ready)return[];let c=await (0,m.s7)(a);return c?this.searchByVector(c,b):[]}get persistPath(){return h().join(j().homedir(),".mindos","embedding-index.json")}persist(){if(0===this.vectors.size)return;let a={version:1,builtForRoot:this.builtForRoot??"",dimensions:this.dimensions,docCount:this.vectors.size,timestamp:Date.now(),vectors:{}};for(let[b,c]of this.vectors)a.vectors[b]=Array.from(c);let b=h().dirname(this.persistPath);try{f().mkdirSync(b,{recursive:!0}),f().writeFileSync(this.persistPath,JSON.stringify(a),"utf-8")}catch{}}load(a){try{let b=f().readFileSync(this.persistPath,"utf-8"),c=JSON.parse(b);if(1!==c.version||c.builtForRoot!==a)return!1;let d=(0,k.f)(a).filter(a=>{let b=h().extname(a).toLowerCase();return".md"===b||".csv"===b}).length;if(Math.abs(d-c.docCount)>Math.max(5,.1*d))return!1;for(let[a,b]of(this.vectors.clear(),this.dimensions=c.dimensions,Object.entries(c.vectors)))this.vectors.set(a,new Float32Array(b));return this.builtForRoot=c.builtForRoot,this._ready=!0,!0}catch{return!1}}invalidate(){this.vectors.clear(),this.dimensions=0,this.builtForRoot=null,this._ready=!1}isBuiltFor(a){return this._ready&&this.builtForRoot===a}constructor(){this.vectors=new Map,this.dimensions=0,this.builtForRoot=null,this._ready=!1,this._building=!1}}d()}catch(a){d(a)}})},31751:(a,b,c)=>{c.d(b,{f:()=>function a(b,c,d={}){let f,k=function(a,b){let c=g().resolve(a),d=b?g().resolve(b):c;try{var f;let a,b=e().realpathSync(c);if(f=e().realpathSync(d),a=g().relative(b,f),""!==a&&(".."===a||a.startsWith(`..${g().sep}`)||g().isAbsolute(a)))return null}catch{return null}return{root:c,dir:d}}(b,c);if(!k)return[];let{root:l,dir:m}=k,n=d.ignoredDirs??h,o=d.allowedExtensions??i;try{f=e().readdirSync(m,{withFileTypes:!0})}catch{return[]}let p=[];for(let c of f){let e=g().join(m,c.name);if(c.isDirectory()){if(n.has(c.name))continue;p.push(...a(b,e,d))}else if(c.isFile()){var q;if(m===l&&j.has(c.name))continue;let a=g().extname(c.name).toLowerCase();o.has(a)&&p.push((q=g().relative(l,e),"win32"===process.platform?q.replace(/\\/g,"/"):q))}}return p}});var d=c(29021),e=c.n(d);c(79748);var f=c(33873),g=c.n(f);let h=new Set([".git","node_modules","app",".next",".DS_Store","mcp",".media"]),i=new Set([".md",".csv",".pdf",".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".mp3",".wav",".m4a",".ogg",".flac",".aac",".mp4",".webm",".mov",".mkv"]),j=new Set(["INSTRUCTION.md","README.md","CONFIG.json","CHANGELOG.md"])},31756:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{KP:()=>i,Ot:()=>k,T_:()=>m,im:()=>h,lr:()=>j,rl:()=>g,us:()=>l});var e=c(14270);c(84389);var f=a([e]);e=(f.then?(await f)():f)[0];let m={anthropic:{id:"anthropic",name:"Anthropic",nameZh:"Anthropic",shortLabel:"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",shortLabel:"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",shortLabel:"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",shortLabel:"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)",shortLabel:"xAI",defaultModel:"grok-3",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},openrouter:{id:"openrouter",name:"OpenRouter",nameZh:"OpenRouter",shortLabel:"OpenRouter",defaultModel:"anthropic/claude-sonnet-4",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},mistral:{id:"mistral",name:"Mistral",nameZh:"Mistral",shortLabel:"Mistral",defaultModel:"mistral-large-latest",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},deepseek:{id:"deepseek",name:"DeepSeek",nameZh:"DeepSeek",shortLabel:"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 国际版)",shortLabel:"智谱GLM",defaultModel:"glm-4-plus",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},"zai-cn":{id:"zai-cn",name:"ZhipuAI (GLM China)",nameZh:"智谱 AI (GLM 国内版)",shortLabel:"智谱GLM-CN",description:"China region version",descriptionZh:"中国区版本",defaultModel:"glm-4-plus",piProviderOverride:"zai",fixedBaseUrl:"https://open.bigmodel.cn/api/coding/paas/v4",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,signupUrl:"https://open.bigmodel.cn/",category:"more"},"kimi-coding":{id:"kimi-coding",name:"Kimi Coding",nameZh:"Kimi Coding (月之暗面)",shortLabel:"Kimi Coding",defaultModel:"kimi-k2-thinking",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},cerebras:{id:"cerebras",name:"Cerebras",nameZh:"Cerebras",shortLabel:"Cerebras",defaultModel:"llama-4-scout-17b-16e",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},minimax:{id:"minimax",name:"MiniMax",nameZh:"MiniMax (国际版)",shortLabel:"MiniMax",defaultModel:"MiniMax-M2.5",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},"minimax-cn":{id:"minimax-cn",name:"MiniMax (China)",nameZh:"MiniMax (国内版)",shortLabel:"MiniMax-CN",description:"China region version",descriptionZh:"中国区版本",defaultModel:"MiniMax-M2.5",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},huggingface:{id:"huggingface",name:"Hugging Face",nameZh:"Hugging Face",shortLabel:"HuggingFace",defaultModel:"Qwen/Qwen3-235B-A22B-Thinking-2507",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},ollama:{id:"ollama",name:"Ollama",nameZh:"Ollama (本地)",shortLabel:"Ollama",description:"Local server (requires setup)",descriptionZh:"本地服务器 (需要本地部署)",defaultModel:"llama3.2",piProviderOverride:"openai",fixedBaseUrl:"http://localhost:11434/v1",apiKeyFallback:"ollama",supportsBaseUrl:!0,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://ollama.com/download",category:"local"},"lm-studio":{id:"lm-studio",name:"LM Studio",nameZh:"LM Studio (本地)",shortLabel:"LM Studio",description:"Local OpenAI-compatible server",descriptionZh:"本地 OpenAI 兼容服务",defaultModel:"local-model",piProviderOverride:"openai",fixedBaseUrl:"http://localhost:1234/v1",apiKeyFallback:"lm-studio",supportsBaseUrl:!0,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://lmstudio.ai/",category:"local"},vllm:{id:"vllm",name:"vLLM",nameZh:"vLLM (本地)",shortLabel:"vLLM",description:"Local OpenAI-compatible server",descriptionZh:"本地 OpenAI 兼容服务",defaultModel:"local-model",piProviderOverride:"openai",fixedBaseUrl:"http://localhost:8000/v1",apiKeyFallback:"vllm",supportsBaseUrl:!0,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://docs.vllm.ai/",category:"local"}};function g(a){return a in m}function h(a){return m[a]??m.anthropic}function i(a){return m[a].piProviderOverride??a}function j(a){return"deepseek"===a?process.env.DEEPSEEK_API_KEY:(0,e.getEnvApiKey)(i(a))}function k(a){let b=m[a];if(b.fixedBaseUrl)return b.fixedBaseUrl;try{let b=(0,e.getModels)(i(a));return b[0]?.baseUrl??""}catch{return""}}function l(a){try{let b=(0,e.getModels)(i(a));return b[0]?.api??"openai-completions"}catch{return"openai-completions"}}Object.keys(m),d()}catch(a){d(a)}})},36057:(a,b,c)=>{c(33873),c(59349)},37700:(a,b,c)=>{c.d(b,{d:()=>q});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(31751),i=c(59349),j=c(2506),k=c(28647),l=c(87155),m=c(82614);let n="u">typeof Intl&&Intl.Segmenter?new Intl.Segmenter("zh",{granularity:"word"}):null;function o(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(l.y.test(c))if(n)for(let{segment:a,isWordLike:d}of n.segment(c)){if(!d)continue;let c=a.trim();if(c)for(let a of(b.add(c),c))l.y.test(a)&&b.add(a)}else{let a=[];for(let d of c)l.y.test(d)?a.push(d):a.length>0&&(p(a,b),a.length=0);a.length>0&&p(a,b)}return b}function p(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 q{async rebuildAsync(a){let b=m.Y.startTimer("search.index.rebuild.async");try{let d,{Worker:e}=await Promise.resolve().then(c.t.bind(c,73566,23)),{existsSync:f}=await Promise.resolve().then(c.t.bind(c,29021,23));try{if(d=22288,!f(d))throw Error("Worker file not found")}catch{this.rebuild(a),b({fileCount:this.fileCount,tokenCount:this.invertedIndex?.size??0,method:"sync_no_worker"});return}let g=await new Promise((b,c)=>{let f=new e(d,{workerData:{mindRoot:a},execArgv:process.execArgv.filter(a=>a.startsWith("--require")||a.startsWith("--loader"))}),g=setTimeout(()=>{f.terminate(),c(Error("Search rebuild worker timed out"))},3e4);f.on("message",a=>{clearTimeout(g),f.terminate(),a.ok&&a.data?b(a.data):c(Error(a.error||"Worker failed"))}),f.on("error",a=>{clearTimeout(g),f.terminate(),c(a)})});this.restoreFromPersisted(g),b({fileCount:this.fileCount,tokenCount:this.invertedIndex?.size??0,method:"worker"})}catch{this.rebuild(a),b({fileCount:this.fileCount,tokenCount:this.invertedIndex?.size??0,method:"sync_fallback"})}}restoreFromPersisted(a){this.builtForRoot=a.builtForRoot,this.fileCount=a.fileCount,this.totalChars=a.totalChars,this.docLengths=new Map(Object.entries(a.docLengths).map(([a,b])=>[a,b]));let b=new Map,c=new Map;for(let[d,e]of Object.entries(a.invertedIndex)){let a=new Set(e);for(let e of(b.set(d,a),a)){let a=c.get(e);a||(a=new Set,c.set(e,a)),a.add(d)}}this.invertedIndex=b,this.fileTokens=c}rebuild(a){let b=m.Y.startTimer("search.index.rebuild"),c=(0,h.f)(a),d=new Map,e=new Map,f=new Map,l=0,n=0;for(let b of c){let c;if(".pdf"===g().extname(b).toLowerCase())try{let d=(0,j.n2)(a,b);if(!(c=(0,k.b)(d)))continue}catch{continue}else try{c=(0,i.TA)(a,b)}catch{continue}e.set(b,c.length),l+=c.length,c.length>5e4&&(c=c.slice(0,5e4));let h=o(b+"\n"+c);for(let a of(n+=h.size,f.set(b,h),h)){let c=d.get(a);c||(c=new Set,d.set(a,c)),c.add(b)}}this.invertedIndex=d,this.builtForRoot=a,this.fileCount=c.length,this.docLengths=e,this.totalChars=l,this.fileTokens=f,b({fileCount:c.length,tokenCount:n})}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;if(".pdf"===g().extname(b).toLowerCase())try{let d=(0,j.n2)(a,b);if(!(c=(0,k.b)(d)))return}catch{return}else try{c=(0,i.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 d=o(b+"\n"+c);for(let a of(this.fileTokens.set(b,d),d)){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=o(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=o(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=g().join(a,"search-index.json");try{e().mkdirSync(a,{recursive:!0}),e().writeFileSync(c,JSON.stringify(b),"utf-8")}catch{}}load(a,b){let c,d,f=g().join(a,"search-index.json");try{c=e().readFileSync(f,"utf-8")}catch{return!1}try{d=JSON.parse(c)}catch{return!1}if(1!==d.version||d.builtForRoot!==b||(0,h.f)(b).length!==d.fileCount)return!1;let i=Object.keys(d.docLengths);if(Math.min(50,i.length)===i.length)for(let a of i)try{if(e().statSync((0,j.n2)(b,a)).mtimeMs>d.timestamp)return!1}catch{return!1}else{let a=Math.max(1,Math.floor(i.length/40)),c=new Set;for(let b=0;b<i.length;b+=a)c.add(b);for(let a=Math.max(0,i.length-10);a<i.length;a++)c.add(a);for(let a of c)try{if(e().statSync((0,j.n2)(b,i[a])).mtimeMs>d.timestamp)return!1}catch{return!1}}return this.restoreFromPersisted(d),!0}constructor(){this.invertedIndex=null,this.builtForRoot=null,this.fileCount=0,this.docLengths=new Map,this.totalChars=0,this.fileTokens=new Map}}},38264:(a,b,c)=>{function d(a){return!!a&&"object"==typeof a}function e(a,b){let c=a[b];return d(c)?c:void 0}function f(a){return!!d(a)&&"message_update"===a.type&&e(a,"assistantMessageEvent")?.type==="text_delta"}function g(a){if(!d(a))return"";let b=e(a,"assistantMessageEvent");return"string"==typeof b?.delta?b.delta:""}function h(a){return!!d(a)&&"message_update"===a.type&&e(a,"assistantMessageEvent")?.type==="thinking_delta"}function i(a){return g(a)}function j(a){return d(a)&&"tool_execution_start"===a.type}function k(a){return d(a)?{toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"",toolName:"string"==typeof a.toolName?a.toolName:"unknown",args:a.args??{}}:{toolCallId:"",toolName:"unknown",args:{}}}function l(a){return d(a)&&"tool_execution_end"===a.type}function m(a){if(!d(a))return{toolCallId:"",output:"",isError:!1};let b=e(a,"result"),c=(Array.isArray(b?.content)?b.content:[]).filter(a=>d(a)&&"text"===a.type).map(a=>a.text??"").join("");return{toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"",output:c,isError:!0===a.isError}}function n(a){return"organize"===a?"organize":"chat"===a?"chat":"agent"}function o(a){return Math.min(1e3*2**a,1e4)}function p(a,b){return new Promise((c,d)=>{let e=()=>b?.reason??new DOMException("The operation was aborted.","AbortError");if(b?.aborted)return void d(e());let f=setTimeout(c,a);b?.addEventListener("abort",()=>{clearTimeout(f),d(e())},{once:!0})})}async function q(a){let b=a.messages.length>0?a.messages[a.messages.length-1]:void 0,c=b?.role==="user"?b.content:"",d=b?.role==="user"&&"string"==typeof b.skillName?b.skillName:void 0,e=r(b),f=a.services.resolveModelConfig({providerOverride:a.providerOverride,modelOverride:a.modelOverride,messages:a.messages,hasImages:a.messages.some(a=>(r(a)?.length??0)>0)}),g=a.systemPrompt;if("ollama"===f.provider&&a.services.getOllamaContextWindow&&a.services.estimateTokens&&a.services.compactPrompt){let b=f.baseUrl||"http://localhost:11434/v1",c=await a.services.getOllamaContextWindow(b,f.modelName),d=a.services.estimateTokens(g),e=c?Math.floor(.7*c):void 0;a.services.onOllamaContext?.({modelName:f.modelName,contextWindow:c,promptTokens:d,maxPromptTokens:e}),e&&d>e&&(g=a.services.compactPrompt(g,{maxPromptTokens:e,estimateTokens:a.services.estimateTokens,onStrip:a.services.onOllamaCompactStrip}),a.services.onOllamaCompacted?.({beforeTokens:d,afterTokens:a.services.estimateTokens(g)}))}let h=(function(a){let b=[];for(let c of a){let a=c.timestamp??Date.now();if("user"===c.role){b.push({role:"user",content:function(a,b){let c=b?.filter(a=>a.data);if(!c||0===c.length)return a;let d=c.map(a=>({type:"image",data:a.data,mimeType:a.mimeType}));return a&&d.push({type:"text",text:a}),d}(c.content,c.images),timestamp:a});continue}if(c.content.startsWith("__error__"))continue;if(!c.parts||0===c.parts.length){c.content&&b.push(s({content:[{type:"text",text:c.content}],stopReason:"stop",timestamp:a}));continue}let d=[],e=[];for(let a of c.parts)"text"===a.type?a.text&&d.push({type:"text",text:a.text}):"tool-call"===a.type&&(d.push({type:"toolCall",id:a.toolCallId,name:a.toolName,arguments:a.input??{}}),e.push(a));for(let c of(d.length>0&&b.push(s({content:d,stopReason:e.length>0?"toolUse":"stop",timestamp:a})),e))b.push({role:"toolResult",toolCallId:c.toolCallId,toolName:c.toolName,content:[{type:"text",text:c.output??""}],isError:"error"===c.state,timestamp:a})}return b})(a.messages).slice(0,-1),i=a.services.convertToLlm(h);a.services.setKbMode(a.mode);let j=a.services.createAuthStorage();j.setRuntimeApiKey(a.services.toRuntimeProvider(f.provider),f.apiKey);let k=a.services.createModelRegistry(j),l=a.services.createSettingsManager(function(a={},b){return{enableSkillCommands:!0,...a.enableThinking&&"anthropic"===b?{thinkingBudgets:{medium:a.thinkingBudget??5e3}}:{},..."off"===a.contextStrategy?{compaction:{enabled:!1}}:{}}}(a.agentConfig,f.provider)),m=new Set(["mindos","mindos-zh","mindos-max","mindos-max-zh"]),n=a.services.createResourceLoader({cwd:a.projectRoot,settingsManager:l,systemPromptOverride:()=>g,appendSystemPromptOverride:()=>[],agentsFilesOverride:()=>({agentsFiles:[]}),skillsOverride:a=>({...a,skills:a.skills.filter(a=>!m.has(a.name))}),additionalSkillPaths:a.additionalSkillPaths??[],additionalExtensionPaths:a.additionalExtensionPaths??[]});if(await n.reload(),"agent"===a.mode){let b=new Set(a.serverSettings?.disabledSkills??[]),c=(n.getSkills?.().skills??[]).filter(a=>!m.has(a.name)&&!a.disableModelInvocation&&!b.has(a.name));c.length>0&&a.services.generateSkillsXml&&(g+=`
|
|
3
|
+
${c}`.slice(0,8e3),f=await (0,m.s7)(e);f&&(this.vectors.set(b,f),0===this.dimensions&&(this.dimensions=f.length))}removeFile(a){this.vectors.delete(a)}searchByVector(a,b=20){if(!this._ready||0===this.vectors.size)return[];if(this.dimensions>0&&a.length!==this.dimensions)return console.warn(`[embedding-index] Dimension mismatch: query has ${a.length} dimensions, index has ${this.dimensions}. Returning empty results.`),[];let c=[];for(let[b,d]of this.vectors){let e=function(a,b){if(a.length!==b.length||0===a.length)return 0;let c=0,d=0,e=0;for(let f=0;f<a.length;f++)c+=a[f]*b[f],d+=a[f]*a[f],e+=b[f]*b[f];let f=Math.sqrt(d)*Math.sqrt(e);return 0===f?0:Math.max(0,Math.min(1,c/f))}(a,d);c.push({path:b,similarity:e})}return c.sort((a,b)=>b.similarity-a.similarity),c.slice(0,b)}async search(a,b=20){if(!this._ready)return[];let c=await (0,m.s7)(a);return c?this.searchByVector(c,b):[]}get persistPath(){return h().join(j().homedir(),".mindos","embedding-index.json")}persist(){if(0===this.vectors.size)return;let a={version:1,builtForRoot:this.builtForRoot??"",dimensions:this.dimensions,docCount:this.vectors.size,timestamp:Date.now(),vectors:{}};for(let[b,c]of this.vectors)a.vectors[b]=Array.from(c);let b=h().dirname(this.persistPath);try{f().mkdirSync(b,{recursive:!0}),f().writeFileSync(this.persistPath,JSON.stringify(a),"utf-8")}catch{}}load(a){try{let b=f().readFileSync(this.persistPath,"utf-8"),c=JSON.parse(b);if(1!==c.version||c.builtForRoot!==a)return!1;let d=(0,k.f)(a).filter(a=>{let b=h().extname(a).toLowerCase();return".md"===b||".csv"===b}).length;if(Math.abs(d-c.docCount)>Math.max(5,.1*d))return!1;for(let[a,b]of(this.vectors.clear(),this.dimensions=c.dimensions,Object.entries(c.vectors)))this.vectors.set(a,new Float32Array(b));return this.builtForRoot=c.builtForRoot,this._ready=!0,!0}catch{return!1}}invalidate(){this.vectors.clear(),this.dimensions=0,this.builtForRoot=null,this._ready=!1}isBuiltFor(a){return this._ready&&this.builtForRoot===a}constructor(){this.vectors=new Map,this.dimensions=0,this.builtForRoot=null,this._ready=!1,this._building=!1}}d()}catch(a){d(a)}})},31751:(a,b,c)=>{c.d(b,{f:()=>function a(b,c,d={}){let f,k=function(a,b){let c=g().resolve(a),d=b?g().resolve(b):c;try{var f;let a,b=e().realpathSync(c);if(f=e().realpathSync(d),a=g().relative(b,f),""!==a&&(".."===a||a.startsWith(`..${g().sep}`)||g().isAbsolute(a)))return null}catch{return null}return{root:c,dir:d}}(b,c);if(!k)return[];let{root:l,dir:m}=k,n=d.ignoredDirs??h,o=d.allowedExtensions??i;try{f=e().readdirSync(m,{withFileTypes:!0})}catch{return[]}let p=[];for(let c of f){let e=g().join(m,c.name);if(c.isDirectory()){if(n.has(c.name))continue;p.push(...a(b,e,d))}else if(c.isFile()){var q;if(m===l&&j.has(c.name))continue;let a=g().extname(c.name).toLowerCase();o.has(a)&&p.push((q=g().relative(l,e),"win32"===process.platform?q.replace(/\\/g,"/"):q))}}return p}});var d=c(29021),e=c.n(d);c(79748);var f=c(33873),g=c.n(f);let h=new Set([".git","node_modules","app",".next",".DS_Store","mcp",".media"]),i=new Set([".md",".csv",".pdf",".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".mp3",".wav",".m4a",".ogg",".flac",".aac",".mp4",".webm",".mov",".mkv"]),j=new Set(["INSTRUCTION.md","README.md","CONFIG.json","CHANGELOG.md"])},31756:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{KP:()=>i,Ot:()=>k,T_:()=>m,im:()=>h,lr:()=>j,rl:()=>g,us:()=>l});var e=c(14270);c(84389);var f=a([e]);e=(f.then?(await f)():f)[0];let m={anthropic:{id:"anthropic",name:"Anthropic",nameZh:"Anthropic",shortLabel:"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",shortLabel:"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",shortLabel:"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",shortLabel:"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)",shortLabel:"xAI",defaultModel:"grok-3",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},openrouter:{id:"openrouter",name:"OpenRouter",nameZh:"OpenRouter",shortLabel:"OpenRouter",defaultModel:"anthropic/claude-sonnet-4",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},mistral:{id:"mistral",name:"Mistral",nameZh:"Mistral",shortLabel:"Mistral",defaultModel:"mistral-large-latest",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},deepseek:{id:"deepseek",name:"DeepSeek",nameZh:"DeepSeek",shortLabel:"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 国际版)",shortLabel:"智谱GLM",defaultModel:"glm-4-plus",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},"zai-cn":{id:"zai-cn",name:"ZhipuAI (GLM China)",nameZh:"智谱 AI (GLM 国内版)",shortLabel:"智谱GLM-CN",description:"China region version",descriptionZh:"中国区版本",defaultModel:"glm-4-plus",piProviderOverride:"zai",fixedBaseUrl:"https://open.bigmodel.cn/api/coding/paas/v4",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,signupUrl:"https://open.bigmodel.cn/",category:"more"},"kimi-coding":{id:"kimi-coding",name:"Kimi Coding",nameZh:"Kimi Coding (月之暗面)",shortLabel:"Kimi Coding",defaultModel:"kimi-k2-thinking",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},cerebras:{id:"cerebras",name:"Cerebras",nameZh:"Cerebras",shortLabel:"Cerebras",defaultModel:"llama-4-scout-17b-16e",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},minimax:{id:"minimax",name:"MiniMax",nameZh:"MiniMax (国际版)",shortLabel:"MiniMax",defaultModel:"MiniMax-M2.5",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},"minimax-cn":{id:"minimax-cn",name:"MiniMax (China)",nameZh:"MiniMax (国内版)",shortLabel:"MiniMax-CN",description:"China region version",descriptionZh:"中国区版本",defaultModel:"MiniMax-M2.5",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},huggingface:{id:"huggingface",name:"Hugging Face",nameZh:"Hugging Face",shortLabel:"HuggingFace",defaultModel:"Qwen/Qwen3-235B-A22B-Thinking-2507",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},ollama:{id:"ollama",name:"Ollama",nameZh:"Ollama (本地)",shortLabel:"Ollama",description:"Local server (requires setup)",descriptionZh:"本地服务器 (需要本地部署)",defaultModel:"llama3.2",piProviderOverride:"openai",fixedBaseUrl:"http://localhost:11434/v1",apiKeyFallback:"ollama",supportsBaseUrl:!0,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://ollama.com/download",category:"local"},"lm-studio":{id:"lm-studio",name:"LM Studio",nameZh:"LM Studio (本地)",shortLabel:"LM Studio",description:"Local OpenAI-compatible server",descriptionZh:"本地 OpenAI 兼容服务",defaultModel:"local-model",piProviderOverride:"openai",fixedBaseUrl:"http://localhost:1234/v1",apiKeyFallback:"lm-studio",supportsBaseUrl:!0,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://lmstudio.ai/",category:"local"},vllm:{id:"vllm",name:"vLLM",nameZh:"vLLM (本地)",shortLabel:"vLLM",description:"Local OpenAI-compatible server",descriptionZh:"本地 OpenAI 兼容服务",defaultModel:"local-model",piProviderOverride:"openai",fixedBaseUrl:"http://localhost:8000/v1",apiKeyFallback:"vllm",supportsBaseUrl:!0,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://docs.vllm.ai/",category:"local"}};function g(a){return a in m}function h(a){return m[a]??m.anthropic}function i(a){return m[a].piProviderOverride??a}function j(a){return"deepseek"===a?process.env.DEEPSEEK_API_KEY:(0,e.getEnvApiKey)(i(a))}function k(a){let b=m[a];if(b.fixedBaseUrl)return b.fixedBaseUrl;try{let b=(0,e.getModels)(i(a));return b[0]?.baseUrl??""}catch{return""}}function l(a){try{let b=(0,e.getModels)(i(a));return b[0]?.api??"openai-completions"}catch{return"openai-completions"}}Object.keys(m),d()}catch(a){d(a)}})},36057:(a,b,c)=>{c(33873),c(59349)},37700:(a,b,c)=>{c.d(b,{d:()=>q});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(31751),i=c(59349),j=c(13308),k=c(28647),l=c(87155),m=c(82614);let n="u">typeof Intl&&Intl.Segmenter?new Intl.Segmenter("zh",{granularity:"word"}):null;function o(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(l.y.test(c))if(n)for(let{segment:a,isWordLike:d}of n.segment(c)){if(!d)continue;let c=a.trim();if(c)for(let a of(b.add(c),c))l.y.test(a)&&b.add(a)}else{let a=[];for(let d of c)l.y.test(d)?a.push(d):a.length>0&&(p(a,b),a.length=0);a.length>0&&p(a,b)}return b}function p(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 q{async rebuildAsync(a){let b=m.Y.startTimer("search.index.rebuild.async");try{let d,{Worker:e}=await Promise.resolve().then(c.t.bind(c,73566,23)),{existsSync:f}=await Promise.resolve().then(c.t.bind(c,29021,23));try{if(d=22288,!f(d))throw Error("Worker file not found")}catch{this.rebuild(a),b({fileCount:this.fileCount,tokenCount:this.invertedIndex?.size??0,method:"sync_no_worker"});return}let g=await new Promise((b,c)=>{let f=new e(d,{workerData:{mindRoot:a},execArgv:process.execArgv.filter(a=>a.startsWith("--require")||a.startsWith("--loader"))}),g=setTimeout(()=>{f.terminate(),c(Error("Search rebuild worker timed out"))},3e4);f.on("message",a=>{clearTimeout(g),f.terminate(),a.ok&&a.data?b(a.data):c(Error(a.error||"Worker failed"))}),f.on("error",a=>{clearTimeout(g),f.terminate(),c(a)})});this.restoreFromPersisted(g),b({fileCount:this.fileCount,tokenCount:this.invertedIndex?.size??0,method:"worker"})}catch{this.rebuild(a),b({fileCount:this.fileCount,tokenCount:this.invertedIndex?.size??0,method:"sync_fallback"})}}restoreFromPersisted(a){this.builtForRoot=a.builtForRoot,this.fileCount=a.fileCount,this.totalChars=a.totalChars,this.docLengths=new Map(Object.entries(a.docLengths).map(([a,b])=>[a,b]));let b=new Map,c=new Map;for(let[d,e]of Object.entries(a.invertedIndex)){let a=new Set(e);for(let e of(b.set(d,a),a)){let a=c.get(e);a||(a=new Set,c.set(e,a)),a.add(d)}}this.invertedIndex=b,this.fileTokens=c}rebuild(a){let b=m.Y.startTimer("search.index.rebuild"),c=(0,h.f)(a),d=new Map,e=new Map,f=new Map,l=0,n=0;for(let b of c){let c;if(".pdf"===g().extname(b).toLowerCase())try{let d=(0,j.n2)(a,b);if(!(c=(0,k.b)(d)))continue}catch{continue}else try{c=(0,i.TA)(a,b)}catch{continue}e.set(b,c.length),l+=c.length,c.length>5e4&&(c=c.slice(0,5e4));let h=o(b+"\n"+c);for(let a of(n+=h.size,f.set(b,h),h)){let c=d.get(a);c||(c=new Set,d.set(a,c)),c.add(b)}}this.invertedIndex=d,this.builtForRoot=a,this.fileCount=c.length,this.docLengths=e,this.totalChars=l,this.fileTokens=f,b({fileCount:c.length,tokenCount:n})}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;if(".pdf"===g().extname(b).toLowerCase())try{let d=(0,j.n2)(a,b);if(!(c=(0,k.b)(d)))return}catch{return}else try{c=(0,i.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 d=o(b+"\n"+c);for(let a of(this.fileTokens.set(b,d),d)){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=o(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=o(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=g().join(a,"search-index.json");try{e().mkdirSync(a,{recursive:!0}),e().writeFileSync(c,JSON.stringify(b),"utf-8")}catch{}}load(a,b){let c,d,f=g().join(a,"search-index.json");try{c=e().readFileSync(f,"utf-8")}catch{return!1}try{d=JSON.parse(c)}catch{return!1}if(1!==d.version||d.builtForRoot!==b||(0,h.f)(b).length!==d.fileCount)return!1;let i=Object.keys(d.docLengths);if(Math.min(50,i.length)===i.length)for(let a of i)try{if(e().statSync((0,j.n2)(b,a)).mtimeMs>d.timestamp)return!1}catch{return!1}else{let a=Math.max(1,Math.floor(i.length/40)),c=new Set;for(let b=0;b<i.length;b+=a)c.add(b);for(let a=Math.max(0,i.length-10);a<i.length;a++)c.add(a);for(let a of c)try{if(e().statSync((0,j.n2)(b,i[a])).mtimeMs>d.timestamp)return!1}catch{return!1}}return this.restoreFromPersisted(d),!0}constructor(){this.invertedIndex=null,this.builtForRoot=null,this.fileCount=0,this.docLengths=new Map,this.totalChars=0,this.fileTokens=new Map}}},38264:(a,b,c)=>{function d(a){return!!a&&"object"==typeof a}function e(a,b){let c=a[b];return d(c)?c:void 0}function f(a){return!!d(a)&&"message_update"===a.type&&e(a,"assistantMessageEvent")?.type==="text_delta"}function g(a){if(!d(a))return"";let b=e(a,"assistantMessageEvent");return"string"==typeof b?.delta?b.delta:""}function h(a){return!!d(a)&&"message_update"===a.type&&e(a,"assistantMessageEvent")?.type==="thinking_delta"}function i(a){return g(a)}function j(a){return d(a)&&"tool_execution_start"===a.type}function k(a){return d(a)?{toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"",toolName:"string"==typeof a.toolName?a.toolName:"unknown",args:a.args??{}}:{toolCallId:"",toolName:"unknown",args:{}}}function l(a){return d(a)&&"tool_execution_end"===a.type}function m(a){if(!d(a))return{toolCallId:"",output:"",isError:!1};let b=e(a,"result"),c=(Array.isArray(b?.content)?b.content:[]).filter(a=>d(a)&&"text"===a.type).map(a=>a.text??"").join("");return{toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"",output:c,isError:!0===a.isError}}function n(a){return"organize"===a?"organize":"chat"===a?"chat":"agent"}function o(a){return Math.min(1e3*2**a,1e4)}function p(a,b){return new Promise((c,d)=>{let e=()=>b?.reason??new DOMException("The operation was aborted.","AbortError");if(b?.aborted)return void d(e());let f=setTimeout(c,a);b?.addEventListener("abort",()=>{clearTimeout(f),d(e())},{once:!0})})}async function q(a){let b=a.messages.length>0?a.messages[a.messages.length-1]:void 0,c=b?.role==="user"?b.content:"",d=b?.role==="user"&&"string"==typeof b.skillName?b.skillName:void 0,e=r(b),f=a.services.resolveModelConfig({providerOverride:a.providerOverride,modelOverride:a.modelOverride,messages:a.messages,hasImages:a.messages.some(a=>(r(a)?.length??0)>0)}),g=a.systemPrompt;if("ollama"===f.provider&&a.services.getOllamaContextWindow&&a.services.estimateTokens&&a.services.compactPrompt){let b=f.baseUrl||"http://localhost:11434/v1",c=await a.services.getOllamaContextWindow(b,f.modelName),d=a.services.estimateTokens(g),e=c?Math.floor(.7*c):void 0;a.services.onOllamaContext?.({modelName:f.modelName,contextWindow:c,promptTokens:d,maxPromptTokens:e}),e&&d>e&&(g=a.services.compactPrompt(g,{maxPromptTokens:e,estimateTokens:a.services.estimateTokens,onStrip:a.services.onOllamaCompactStrip}),a.services.onOllamaCompacted?.({beforeTokens:d,afterTokens:a.services.estimateTokens(g)}))}let h=(function(a){let b=[];for(let c of a){let a=c.timestamp??Date.now();if("user"===c.role){b.push({role:"user",content:function(a,b){let c=b?.filter(a=>a.data);if(!c||0===c.length)return a;let d=c.map(a=>({type:"image",data:a.data,mimeType:a.mimeType}));return a&&d.push({type:"text",text:a}),d}(c.content,c.images),timestamp:a});continue}if(c.content.startsWith("__error__"))continue;if(!c.parts||0===c.parts.length){c.content&&b.push(s({content:[{type:"text",text:c.content}],stopReason:"stop",timestamp:a}));continue}let d=[],e=[];for(let a of c.parts)"text"===a.type?a.text&&d.push({type:"text",text:a.text}):"tool-call"===a.type&&(d.push({type:"toolCall",id:a.toolCallId,name:a.toolName,arguments:a.input??{}}),e.push(a));for(let c of(d.length>0&&b.push(s({content:d,stopReason:e.length>0?"toolUse":"stop",timestamp:a})),e))b.push({role:"toolResult",toolCallId:c.toolCallId,toolName:c.toolName,content:[{type:"text",text:c.output??""}],isError:"error"===c.state,timestamp:a})}return b})(a.messages).slice(0,-1),i=a.services.convertToLlm(h);a.services.setKbMode(a.mode);let j=a.services.createAuthStorage();j.setRuntimeApiKey(a.services.toRuntimeProvider(f.provider),f.apiKey);let k=a.services.createModelRegistry(j),l=a.services.createSettingsManager(function(a={},b){return{enableSkillCommands:!0,...a.enableThinking&&"anthropic"===b?{thinkingBudgets:{medium:a.thinkingBudget??5e3}}:{},..."off"===a.contextStrategy?{compaction:{enabled:!1}}:{}}}(a.agentConfig,f.provider)),m=new Set(["mindos","mindos-zh","mindos-max","mindos-max-zh"]),n=a.services.createResourceLoader({cwd:a.projectRoot,settingsManager:l,systemPromptOverride:()=>g,appendSystemPromptOverride:()=>[],agentsFilesOverride:()=>({agentsFiles:[]}),skillsOverride:a=>({...a,skills:a.skills.filter(a=>!m.has(a.name))}),additionalSkillPaths:a.additionalSkillPaths??[],additionalExtensionPaths:a.additionalExtensionPaths??[]});if(await n.reload(),"agent"===a.mode){let b=new Set(a.serverSettings?.disabledSkills??[]),c=(n.getSkills?.().skills??[]).filter(a=>!m.has(a.name)&&!a.disableModelInvocation&&!b.has(a.name));c.length>0&&a.services.generateSkillsXml&&(g+=`
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -45,4 +45,4 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
45
45
|
`),d=(a.line??1)-1,e=null!=a.limit?d+a.limit:c.length;b=c.slice(Math.max(0,d),e).join(`
|
|
46
46
|
`)}return{content:b}}catch(d){let b=a=>"object"==typeof a&&null!==a&&"code"in a;if(b(d)&&"ENOENT"===d.code)throw l$.resourceNotFound(a.path);if(b(d)&&("EACCES"===d.code||"EPERM"===d.code))throw new l$(-32001,`Permission denied: ${a.path}`);let c=d instanceof Error?d.message:String(d);throw new l$(-32603,`Failed to read ${a.path}: ${c}`)}},async writeTextFile(a){if(!a.path)throw l$.invalidParams(void 0,"path is required");if(!l4(a.path,x))throw new l$(-32001,`Write denied: ${a.path} is outside the working directory`);try{let b=f.dirname(a.path);return d.existsSync(b)||d.mkdirSync(b,{recursive:!0}),d.writeFileSync(a.path,a.content,"utf-8"),{}}catch(d){let b=a=>"object"==typeof a&&null!==a&&"code"in a;if(b(d)&&("EACCES"===d.code||"EPERM"===d.code))throw new l$(-32001,`Write permission denied: ${a.path}`);if(b(d)&&"ENOSPC"===d.code)throw new l$(-32603,`Disk full: cannot write ${a.path}`);let c=d instanceof Error?d.message:String(d);throw l$.internalError(void 0,c)}},async createTerminal(a){if(!a.command)throw l$.invalidParams(void 0,"command is required");let b=a.cwd??void 0,c=b&&l4(b,x)?b:x,d={};if(a.env)for(let b of a.env)d[b.name]=b.value;console.log(`[ACP] terminal/create: agent=${w.agentId} cmd="${a.command} ${(a.args??[]).join(" ")}" cwd=${c}`);let e=`term-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,f=a.outputByteLimit??1e6;try{var h,i;let b,j,k,l=(h=a.command,j=A(h)??h,k="win32"===process.platform&&/\.(?:cmd|bat)$/i.test(j),{command:j,shell:k}),m=(0,g.spawn)(l.command,a.args??[],{cwd:c,env:{...process.env,...d},shell:l.shell,stdio:["pipe","pipe","pipe"]}),n="",o=!1,p=a=>{(n+=a.toString()).length>f&&(n=n.slice(-f),o=!0)};return m.stdout?.on("data",p),m.stderr?.on("data",p),(i=w.id,(b=l5.get(i))||(b=new Map,l5.set(i,b)),b).set(e,{child:m,output:()=>n,truncated:()=>o}),{terminalId:e}}catch(a){throw l$.internalError(void 0,a.message)}},async terminalOutput(a){let b=l6(w.id,a.terminalId);if(!b)throw new l$(-32002,`Terminal not found: ${a.terminalId}`);let c=null!==b.child.exitCode?{exitCode:b.child.exitCode,signal:b.child.signalCode}:void 0;return{output:b.output(),truncated:b.truncated(),exitStatus:c}},async killTerminal(a){let b=l6(w.id,a.terminalId);if(!b)throw new l$(-32002,`Terminal not found: ${a.terminalId}`);return b.child.kill("SIGTERM"),{}},async waitForTerminalExit(a){let b=l6(w.id,a.terminalId);if(!b)throw new l$(-32002,`Terminal not found: ${a.terminalId}`);return null!==b.child.exitCode?{exitCode:b.child.exitCode,signal:b.child.signalCode}:new Promise(a=>{b.child.on("exit",(b,c)=>{a({exitCode:b,signal:c})}),null!==b.child.exitCode&&a({exitCode:b.child.exitCode,signal:b.child.signalCode})})},async releaseTerminal(a){var b,c;let d=l6(w.id,a.terminalId);if(!d)throw new l$(-32002,`Terminal not found: ${a.terminalId}`);return null===d.child.exitCode&&d.child.kill("SIGTERM"),b=w.id,c=a.terminalId,l5.get(b)?.delete(c),{}},extMethod:async(a,b)=>(console.log(`[ACP] Auto-approve ext method: agent=${w.agentId} method=${a}`),{}),async extNotification(a,b){}},s=h.Writable.toWeb(o.proc.stdin),(u=new lY(()=>r,(t=h.Readable.toWeb(o.proc.stdout),j=new TextEncoder,n=new TextDecoder,{readable:new ReadableStream({async start(a){let b="",c=t.getReader();try{for(;;){let{value:d,done:e}=await c.read();if(e)break;if(!d)continue;let f=(b+=n.decode(d,{stream:!0})).split(`
|
|
47
47
|
`);for(let c of(b=f.pop()||"",f)){let b=c.trim();if(b)try{let c=JSON.parse(b);a.enqueue(c)}catch(a){console.error("Failed to parse JSON message:",b,a)}}}}catch(b){a.error(b);return}finally{c.releaseLock()}a.close()}}),writable:new WritableStream({async write(a){let b=JSON.stringify(a)+`
|
|
48
|
-
`,c=s.getWriter();try{await c.write(j.encode(b))}finally{c.releaseLock()}}})}))).signal.addEventListener("abort",()=>{o.alive&&(o.alive=!1)}),{connection:u,callbacks:q,process:o}),D,E;try{let a=await C.connection.initialize({protocolVersion:1,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0},terminal:!0},clientInfo:{name:"mindos",version:b?.clientVersion??process.env.npm_package_version??"1.0.0"}});D=function(a){if(a&&"object"==typeof a)return{loadSession:!0===a.loadSession,mcpCapabilities:"object"==typeof a.mcpCapabilities?a.mcpCapabilities:void 0,promptCapabilities:"object"==typeof a.promptCapabilities?a.promptCapabilities:void 0,sessionCapabilities:"object"==typeof a.sessionCapabilities?a.sessionCapabilities:void 0}}(a.agentCapabilities),E=function(a){if(!(!Array.isArray(a)||0===a.length))return a.filter(a=>!!a&&"object"==typeof a).map(a=>({id:String(a.id??""),name:String(a.name??""),description:"string"==typeof a.description?a.description:void 0})).filter(a=>a.id&&a.name)}(a.authMethods)}catch(d){let a,b;await new Promise(a=>setTimeout(a,200));let c=(v=C.process,a=d.message??"",b=v.spawnError??"",a.includes("ENOENT")||b.includes("ENOENT")?`Command not found: "${v.agentId}". Verify it is installed and on your PATH, or set an absolute path in Agent settings.`:b.includes("npm ERR!")||b.includes("ERR_SOCKET_TIMEOUT")||b.includes("ETIMEDOUT")||b.includes("ECONNREFUSED")||b.includes("Could not resolve host")||b.includes("FETCH_ERROR")?`Agent "${v.agentId}" failed to download its ACP wrapper package. This usually means the npm registry is unreachable. Check your network connection and npm proxy settings. Stderr: ${b.slice(0,300)}`:a.includes("EPIPE")?b?`Agent "${v.agentId}" exited immediately: ${b}`:`Agent "${v.agentId}" exited before initialization. Common causes: command not found in this environment (desktop apps often have a shorter PATH than your terminal), the agent does not support ACP mode, or authentication is required. Try running the agent command manually in a terminal to diagnose.`:b?`Agent "${v.agentId}" failed to start: ${b}`:`initialize failed: ${a}`);throw l1(C.process),Error(c)}let F=E?.[0];if(F)try{await C.connection.authenticate({methodId:F.id})}catch{}try{let a=await C.connection.newSession({cwd:B,mcpServers:[]});"string"==typeof a.sessionId&&(i=a.sessionId),c=function a(b){return b&&"object"==typeof b&&!Array.isArray(b)&&Array.isArray(b.availableModes)?a(b.availableModes):!Array.isArray(b)||0===b.length?void 0:b.filter(a=>!!a&&"object"==typeof a).map(a=>({id:String(a.id??""),name:String(a.name??""),description:"string"==typeof a.description?a.description:void 0})).filter(a=>a.id&&a.name)}(a.modes),e=md(a.configOptions)}catch(c){let b=c.message??"";if(/auth/i.test(b))throw l1(C.process),Error(`${a.id}: ${b}`);console.warn(`ACP session/new warning for ${a.id}: ${b}`)}let G=Date.now(),H=[];for(let[a,b]of l7)G-new Date(b.lastActivityAt).getTime()>18e5&&"active"!==b.state&&H.push(a);for(let a of H)mb(a).catch(()=>{});let I=`ses-${a.id}-${Date.now()}`,J={id:I,agentId:a.id,agentSessionId:i,state:"idle",cwd:b?.cwd,createdAt:new Date().toISOString(),lastActivityAt:new Date().toISOString(),agentCapabilities:D,modes:c,configOptions:e,authMethods:E};return l7.set(I,J),l8.set(I,C),J}async function ma(a,b){let{session:c,conn:d}=function(a){let b=l7.get(a);if(!b)throw Error(`Session not found: ${a}`);let c=l8.get(a);if(!c?.process.alive)throw mc(b,"error"),Error(`Session process is dead: ${a}`);return{session:b,conn:c}}(a);if("active"===c.state)throw Error(`Session ${a} is busy processing another prompt`);mc(c,"active");let e=c.agentSessionId??a,f="";d.callbacks.onSessionUpdate=b=>{let c=function(a,b){let c=b.update,d=c.sessionUpdate,e={sessionId:a,type:d};switch(d){case"agent_message_chunk":case"user_message_chunk":case"agent_thought_chunk":{let a=c.content;(a?.type==="text"&&"string"==typeof a.text||a?.type==="thinking"&&"string"==typeof a.text)&&(e.text=a.text);break}case"tool_call":case"tool_call_update":e.toolCall={toolCallId:String(c.toolCallId??""),title:"string"==typeof c.title?c.title:void 0,status:c.status??"pending",kind:c.kind,rawInput:"string"==typeof c.rawInput?c.rawInput:void 0,rawOutput:"string"==typeof c.rawOutput?c.rawOutput:void 0};break;case"plan":Array.isArray(c.entries)&&(e.plan={entries:c.entries});break;case"available_commands_update":e.availableCommands=Array.isArray(c.availableCommands)?c.availableCommands:void 0;break;case"current_mode_update":e.currentModeId="string"==typeof c.currentModeId?c.currentModeId:void 0;break;case"config_option_update":e.configOptions=md(c.configOptions);break;case"session_info_update":e.sessionInfo={title:"string"==typeof c.title?c.title:void 0,updatedAt:"string"==typeof c.updatedAt?c.updatedAt:void 0}}return e}(a,b);("agent_message_chunk"===c.type||"text"===c.type)&&c.text&&(f+=c.text)};try{var g,h;let i=await (g=d.connection.prompt({sessionId:e,prompt:[{type:"text",text:b}]}),h="Prompt timed out after 300s",new Promise((a,b)=>{let c=setTimeout(()=>b(Error(h)),3e5);g.then(b=>{clearTimeout(c),a(b)},a=>{clearTimeout(c),b(a)})}));return mc(c,"idle"),{sessionId:a,text:f||"",done:!0,stopReason:i.stopReason}}catch(a){throw mc(c,"error"),a}finally{d.callbacks.onSessionUpdate=void 0}}async function mb(a){let b=l7.get(a),c=l8.get(a);if(c?.process.alive){let d=b?.agentSessionId??a;try{await c.connection.unstable_closeSession({sessionId:d})}catch{}l1(c.process)}l7.delete(a),l8.delete(a)}function mc(a,b){a.state=b,a.lastActivityAt=new Date().toISOString()}function md(a){if(!(!Array.isArray(a)||0===a.length))return a.filter(a=>!!a&&"object"==typeof a).map(a=>({type:"select",configId:String(a.configId??a.id??""),category:String(a.category??"other"),label:"string"==typeof a.label?a.label:void 0,currentValue:String(a.currentValue??""),options:Array.isArray(a.options)?a.options.map(a=>({id:String(a.id??""),label:String(a.label??"")})):[]})).filter(a=>a.configId)}},59349:(a,b,c)=>{c.d(b,{H5:()=>m,TA:()=>j,_h:()=>k,mV:()=>n,x3:()=>l});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(2506),i=c(39852);function j(a,b){let c=(0,h.n2)(a,b);return e().readFileSync(c,"utf-8")}function k(a,b,c){let d=(0,h.n2)(a,b),f=g().dirname(d),i=g().join(f,`.tmp-${Date.now()}-${g().basename(d)}`);try{e().mkdirSync(f,{recursive:!0}),e().writeFileSync(i,c,"utf-8"),e().renameSync(i,d)}catch(a){try{e().unlinkSync(i)}catch{}throw a}}function l(a,b,c=""){let d=(0,h.n2)(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,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=(0,h.n2)(a,b),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).replace(/\\/g,"/")}function n(a,b,c,d){let f=(0,h.n2)(a,b),j=(0,h.n2)(a,c);if(!e().existsSync(f))throw new i.Vt(i.tG.FILE_NOT_FOUND,`Source not found: ${b}`,{fromPath:b});if(e().existsSync(j))throw new i.Vt(i.tG.FILE_ALREADY_EXISTS,`Destination already exists: ${c}`,{toPath:c});return e().mkdirSync(g().dirname(j),{recursive:!0}),e().renameSync(f,j),{newPath:c,affectedFiles:d(a,b).map(a=>a.source)}}c(62022)},62022:(a,b,c)=>{c(29021),c(33873),c(2506)},62697:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{CY:()=>n,Ko:()=>l,Ny:()=>h,S9:()=>j,lh:()=>k,yx:()=>m});var e=c(31756),f=a([e]);function g(){return"p_"+Math.random().toString(36).slice(2,10)}function h(a){return"string"==typeof a&&a.startsWith("p_")}function i(a){return!!a&&"object"==typeof a&&"string"==typeof a.id&&a.id.startsWith("p_")&&"string"==typeof a.name&&a.name.trim().length>0&&"string"==typeof a.protocol&&(0,e.rl)(a.protocol)&&"string"==typeof a.apiKey&&"string"==typeof a.model&&"string"==typeof a.baseUrl}function j(a){return Array.isArray(a)?a.filter(i):[]}function k(a,b){return a.find(a=>a.id===b)}function l(a){let b=a.ai;if(!b||Array.isArray(b.providers))return null;let c=b.providers??{},d=b.provider??"openai",f=a.customProviders??[],h=[],i="";for(let[a,b]of Object.entries(c)){if(!b||!(0,e.rl)(a)||!b.apiKey&&!b.model&&!b.baseUrl)continue;let c=e.T_[a],f=g();h.push({id:f,name:c?.name??a,protocol:a,apiKey:b.apiKey??"",model:b.model??"",baseUrl:b.baseUrl??""}),a===d&&(i=f)}for(let a of f){if(!a.name||!a.baseProviderId)continue;let b=g();h.push({id:b,name:a.name,protocol:(0,e.rl)(a.baseProviderId)?a.baseProviderId:"openai",apiKey:a.apiKey??"",model:a.model??"",baseUrl:a.baseUrl??""}),a.id===d&&(i=b)}if(!i)if(h.length>0)i=h[0].id;else{let a=g();h.push({id:a,name:"OpenAI",protocol:"openai",apiKey:"",model:e.T_.openai?.defaultModel??"",baseUrl:""}),i=a}return{activeProvider:i,providers:h}}function m(a){return h(a)||"string"==typeof a&&a.startsWith("cp_")}e=(f.then?(await f)():f)[0];let n=k;d()}catch(a){d(a)}})},65102:(a,b,c)=>{c(29021),c(33873),c(39852),c(59349),c(2506),c(62022)},71859:(a,b,c)=>{c(29021),c(33873),c(2506)},72385:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{As:()=>g.As,F2:()=>j.F,FR:()=>l.FR,G1:()=>k.G,H5:()=>f.H5,KZ:()=>g.KZ,TA:()=>f.TA,WZ:()=>i.WZ,Xs:()=>h.X,_E:()=>g._E,_h:()=>f._h,g7:()=>l.g7,mV:()=>f.mV,n2:()=>e.n2,updateLines:()=>i.P2,vg:()=>i.vg,wf:()=>i.wf,x3:()=>f.x3});var e=c(2506),f=c(59349);c(31751);var g=c(88787),h=c(73612),i=c(14360),j=c(77421),k=c(7017),l=c(12169);c(65102),c(36057),c(71859),c(83234),c(80185);var m=a([g]);g=(m.then?(await m)():m)[0],d()}catch(a){d(a)}})},73612:(a,b,c)=>{c.d(b,{X:()=>h});var d=c(33873),e=c.n(d),f=c(31751),g=c(59349);class h{rebuild(a){let b=(0,f.f)(a).filter(a=>a.endsWith(".md")),c=new Set(b),d=function(a){let b=new Map;for(let c of a){let a=e().basename(c).toLowerCase();b.has(a)||b.set(a,[]),b.get(a).push(c)}return b}(b),h=new Map,j=new Map;for(let e of b){let b;try{b=(0,g.TA)(a,e)}catch{continue}let f=i(b,e,c,d),k=new Set;for(let a of f)a!==e&&k.add(a);for(let a of(h.set(e,k),k)){let b=j.get(a);b||(b=new Set,j.set(a,b)),b.add(e)}}this.forwardLinks=h,this.backwardLinks=j,this.builtForRoot=a,this.fileSet=c,this.basenameMap=d}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=e().basename(a).toLowerCase(),f=this.basenameMap.get(d);if(f){let b=f.indexOf(a);b>=0&&f.splice(b,1),0===f.length&&this.basenameMap.delete(d)}}updateFile(a,b){let c;if(!this.builtForRoot||!b.endsWith(".md"))return;let d=this.forwardLinks.get(b);if(d)for(let a of d)this.backwardLinks.get(a)?.delete(b);try{c=(0,g.TA)(a,b)}catch{return}if(!this.fileSet.has(b)){this.fileSet.add(b);let a=e().basename(b).toLowerCase();this.basenameMap.has(a)||this.basenameMap.set(a,[]),this.basenameMap.get(a).push(b)}let f=i(c,b,this.fileSet,this.basenameMap),h=new Set;for(let a of f)a!==b&&h.add(a);for(let a of(this.forwardLinks.set(b,h),h)){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 i(a,b,c,d){let f,g=[],h=e().dirname(b),i=/\[\[([^\]|#]+)(?:[|#][^\]]*)?/g;for(;null!==(f=i.exec(a));){let a=f[1].trim();if(!a)continue;if(c.has(a)){g.push(a);continue}let b=a.endsWith(".md")?a:a+".md";if(c.has(b)){g.push(b);continue}let h=e().basename(b).toLowerCase(),i=d.get(h);i&&1===i.length&&g.push(i[0])}let j=/\[[^\]]+\]\(([^)]+\.md)(?:#[^)]*)?\)/g;for(;null!==(f=j.exec(a));){let a=f[1].trim();if(!a||a.startsWith("http"))continue;let b=e().normalize(e().join(h,a));c.has(b)&&g.push(b)}return g}},77421:(a,b,c)=>{c.d(b,{F:()=>j});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(2506),i=c(39852);function j(a,b,c){if(!b.endsWith(".csv"))throw new i.Vt(i.tG.INVALID_FILE_TYPE,"Only .csv files support row append",{filePath:b});let d=(0,h.n2)(a,b),f=c.map(a=>a.includes(",")||a.includes('"')||a.includes("\n")?`"${a.replace(/"/g,'""')}"`:a).join(",")+"\n";return e().mkdirSync(g().dirname(d),{recursive:!0}),e().appendFileSync(d,f,"utf-8"),{newRowCount:e().readFileSync(d,"utf-8").trim().split("\n").length}}},80185:(a,b,c)=>{c(29021),c(33873),c(2506)},82614:(a,b,c)=>{c.d(b,{Y:()=>e});class d{track(a,b){this.record({name:a,ts:Date.now(),props:b})}startTimer(a,b){let c=Date.now();return d=>{this.record({name:a,ts:c,durationMs:Date.now()-c,props:{...b??{},...d??{}}})}}getEvents(){return this.history.map(a=>({...a,props:a.props?{...a.props}:void 0}))}reset(){this.history=[],this.pending=[]}async flush(){if(0===this.pending.length)return 0;let a=this.pending.splice(0),b=process.env.MINDOS_TELEMETRY_ENDPOINT?.trim();if(!b)return a.length;try{return await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),a.length}catch{return this.pending.unshift(...a),0}}record(a){this.history.push(a),this.history.length>200&&this.history.splice(0,this.history.length-200),this.pending.push(a),this.log(a)}log(a){}constructor(){this.history=[],this.pending=[]}}let e=new d},83234:(a,b,c)=>{c(29021),c(33873),c(2506)},84389:(a,b,c)=>{c.d(b,{Bl:()=>d.Bl,Cu:()=>d.Cu,JR:()=>d.JR,KQ:()=>d.KQ,Qy:()=>d.Qy,a2:()=>d.a2,cy:()=>d.cy,io:()=>d.io,pB:()=>d.pB,ph:()=>d.ph,yy:()=>d.yy});var d=c(38264)},87155:(a,b,c)=>{c.d(b,{H:()=>e,y:()=>d});let d=/[\u4e00-\u9fff\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/;function e(a){let b=a.match(/[\u4e00-\u9fff\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/g);return b?b.length:0}},88787:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{As:()=>u,KZ:()=>t,_E:()=>s,_K:()=>y});var e=c(29021),f=c.n(e),g=c(33873),h=c.n(g),i=c(21820),j=c.n(i),k=c(31751),l=c(59349),m=c(2506),n=c(37700),o=c(49882),p=c(82614),q=a([o]);o=(q.then?(await q)():q)[0];let z=new n.d;function r(){return h().join(j().homedir(),".mindos")}function s(){z.invalidate(),(0,o.R9)()}function t(a,b){z.isBuilt()&&(z.updateFile(a,b),v(),(0,o.X_)(a,b))}function u(a,b){z.isBuilt()&&(z.addFile(a,b),v(),(0,o.X_)(a,b))}let A=null,B=!1;function v(){B=!0,A&&clearTimeout(A),A=setTimeout(w,5e3)}function w(){if(A&&(clearTimeout(A),A=null),B){B=!1;try{z.persist(r())}catch{}}}"u">typeof process&&(process.on("beforeExit",w),process.on("SIGTERM",()=>{w(),process.exit(0)}),process.on("SIGINT",()=>{w(),process.exit(0)}));let C=new Map;function x(a,b){let c=function(a){let b=C.get(a);if(b)return b;let c=/[\u4e00-\u9fff\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/.test(a),d=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return b=c?RegExp(d,"g"):RegExp(`\\b${d}\\b`,"g"),C.size>500&&C.clear(),C.set(a,b),b}(a);c.lastIndex=0;let d=b.match(c);return d?d.length:0}function y(a,b,c={}){let d;if(!b.trim())return[];let{limit:e=20,scope:g,file_type:h="all",modified_after:i}=c;if(!z.isBuiltFor(a)){let b=p.Y.startTimer("search.core.index.load"),c=z.load(r(),a);if(b({loaded:c,fileCount:c?z.getFileCount():0}),!c){z.rebuild(a);try{z.persist(r())}catch{}}}let j=z.getFileCount(),n=z.getAvgDocLength(),o=(d=b.toLowerCase().trim().split(/\s+/).filter(a=>a.length>0),[...new Set(d)]),q=p.Y.startTimer("search.core.query",{queryLen:b.length,queryTermCount:o.length,totalDocs:j}),s=z.getCandidatesUnion(b),t=s?new Set(s):null,u=(0,k.f)(a);if(g){let a=g.endsWith("/")?g:g+"/";u=u.filter(b=>b.startsWith(a)||b===g)}if("all"!==h){let a=`.${h}`;u=u.filter(b=>b.endsWith(a))}t&&(u=u.filter(a=>t.has(a)));let v=0;i&&(v=new Date(i).getTime(),isNaN(v)&&(v=0));let w=[],A=b.toLowerCase(),B=new Map,C=new Map;for(let b of u){let c;if(v>0)try{let c=(0,m.n2)(a,b);if(f().statSync(c).mtimeMs<v)continue}catch{continue}try{c=(0,l.TA)(a,b)}catch{continue}let d=c.toLowerCase();for(let a of(C.set(b,c),o))x(a,d)>0&&B.set(a,(B.get(a)??0)+1)}for(let[a,c]of C){let d=c.toLowerCase(),e=!1,f=-1,g=0,h=0,i=c.length;for(let a of o){let b=x(a,d);if(0===b)continue;e=!0,h+=b,-1===f&&(f=d.indexOf(a));let c=B.get(a)??0;g+=function(a,b,c,d,e){if(0===a||0===e||0===d)return 0;let f=Math.log((e-b+.5)/(b+.5)+1),g=2.2*a/(a+1.2*(.25+.75*c/d));return f*g}(b,c,i,n,j)}if(!e)continue;let k=f>=0?f:d.indexOf(A),l=k>=0?k:0,m=c.lastIndexOf("\n\n",l);-1===m?m=Math.max(0,l-200):m+=2;let p=c.indexOf("\n\n",l);-1===p&&(p=Math.min(c.length,l+b.length+200)),l-m>200&&(m=l-200),p-l>200&&(p=l+b.length+200);let q=c.slice(m,p).trim();q=q.replace(/\n{3,}/g,"\n\n"),m>0&&(q="..."+q),p<c.length&&(q+="..."),w.push({path:a,snippet:q,score:g,occurrences:h})}w.sort((a,b)=>b.score-a.score);let D=w.slice(0,e);return q({candidateCount:t?t.size:u.length,resultCount:D.length}),D}d()}catch(a){d(a)}})}};
|
|
48
|
+
`,c=s.getWriter();try{await c.write(j.encode(b))}finally{c.releaseLock()}}})}))).signal.addEventListener("abort",()=>{o.alive&&(o.alive=!1)}),{connection:u,callbacks:q,process:o}),D,E;try{let a=await C.connection.initialize({protocolVersion:1,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0},terminal:!0},clientInfo:{name:"mindos",version:b?.clientVersion??process.env.npm_package_version??"1.0.0"}});D=function(a){if(a&&"object"==typeof a)return{loadSession:!0===a.loadSession,mcpCapabilities:"object"==typeof a.mcpCapabilities?a.mcpCapabilities:void 0,promptCapabilities:"object"==typeof a.promptCapabilities?a.promptCapabilities:void 0,sessionCapabilities:"object"==typeof a.sessionCapabilities?a.sessionCapabilities:void 0}}(a.agentCapabilities),E=function(a){if(!(!Array.isArray(a)||0===a.length))return a.filter(a=>!!a&&"object"==typeof a).map(a=>({id:String(a.id??""),name:String(a.name??""),description:"string"==typeof a.description?a.description:void 0})).filter(a=>a.id&&a.name)}(a.authMethods)}catch(d){let a,b;await new Promise(a=>setTimeout(a,200));let c=(v=C.process,a=d.message??"",b=v.spawnError??"",a.includes("ENOENT")||b.includes("ENOENT")?`Command not found: "${v.agentId}". Verify it is installed and on your PATH, or set an absolute path in Agent settings.`:b.includes("npm ERR!")||b.includes("ERR_SOCKET_TIMEOUT")||b.includes("ETIMEDOUT")||b.includes("ECONNREFUSED")||b.includes("Could not resolve host")||b.includes("FETCH_ERROR")?`Agent "${v.agentId}" failed to download its ACP wrapper package. This usually means the npm registry is unreachable. Check your network connection and npm proxy settings. Stderr: ${b.slice(0,300)}`:a.includes("EPIPE")?b?`Agent "${v.agentId}" exited immediately: ${b}`:`Agent "${v.agentId}" exited before initialization. Common causes: command not found in this environment (desktop apps often have a shorter PATH than your terminal), the agent does not support ACP mode, or authentication is required. Try running the agent command manually in a terminal to diagnose.`:b?`Agent "${v.agentId}" failed to start: ${b}`:`initialize failed: ${a}`);throw l1(C.process),Error(c)}let F=E?.[0];if(F)try{await C.connection.authenticate({methodId:F.id})}catch{}try{let a=await C.connection.newSession({cwd:B,mcpServers:[]});"string"==typeof a.sessionId&&(i=a.sessionId),c=function a(b){return b&&"object"==typeof b&&!Array.isArray(b)&&Array.isArray(b.availableModes)?a(b.availableModes):!Array.isArray(b)||0===b.length?void 0:b.filter(a=>!!a&&"object"==typeof a).map(a=>({id:String(a.id??""),name:String(a.name??""),description:"string"==typeof a.description?a.description:void 0})).filter(a=>a.id&&a.name)}(a.modes),e=md(a.configOptions)}catch(c){let b=c.message??"";if(/auth/i.test(b))throw l1(C.process),Error(`${a.id}: ${b}`);console.warn(`ACP session/new warning for ${a.id}: ${b}`)}let G=Date.now(),H=[];for(let[a,b]of l7)G-new Date(b.lastActivityAt).getTime()>18e5&&"active"!==b.state&&H.push(a);for(let a of H)mb(a).catch(()=>{});let I=`ses-${a.id}-${Date.now()}`,J={id:I,agentId:a.id,agentSessionId:i,state:"idle",cwd:b?.cwd,createdAt:new Date().toISOString(),lastActivityAt:new Date().toISOString(),agentCapabilities:D,modes:c,configOptions:e,authMethods:E};return l7.set(I,J),l8.set(I,C),J}async function ma(a,b){let{session:c,conn:d}=function(a){let b=l7.get(a);if(!b)throw Error(`Session not found: ${a}`);let c=l8.get(a);if(!c?.process.alive)throw mc(b,"error"),Error(`Session process is dead: ${a}`);return{session:b,conn:c}}(a);if("active"===c.state)throw Error(`Session ${a} is busy processing another prompt`);mc(c,"active");let e=c.agentSessionId??a,f="";d.callbacks.onSessionUpdate=b=>{let c=function(a,b){let c=b.update,d=c.sessionUpdate,e={sessionId:a,type:d};switch(d){case"agent_message_chunk":case"user_message_chunk":case"agent_thought_chunk":{let a=c.content;(a?.type==="text"&&"string"==typeof a.text||a?.type==="thinking"&&"string"==typeof a.text)&&(e.text=a.text);break}case"tool_call":case"tool_call_update":e.toolCall={toolCallId:String(c.toolCallId??""),title:"string"==typeof c.title?c.title:void 0,status:c.status??"pending",kind:c.kind,rawInput:"string"==typeof c.rawInput?c.rawInput:void 0,rawOutput:"string"==typeof c.rawOutput?c.rawOutput:void 0};break;case"plan":Array.isArray(c.entries)&&(e.plan={entries:c.entries});break;case"available_commands_update":e.availableCommands=Array.isArray(c.availableCommands)?c.availableCommands:void 0;break;case"current_mode_update":e.currentModeId="string"==typeof c.currentModeId?c.currentModeId:void 0;break;case"config_option_update":e.configOptions=md(c.configOptions);break;case"session_info_update":e.sessionInfo={title:"string"==typeof c.title?c.title:void 0,updatedAt:"string"==typeof c.updatedAt?c.updatedAt:void 0}}return e}(a,b);("agent_message_chunk"===c.type||"text"===c.type)&&c.text&&(f+=c.text)};try{var g,h;let i=await (g=d.connection.prompt({sessionId:e,prompt:[{type:"text",text:b}]}),h="Prompt timed out after 300s",new Promise((a,b)=>{let c=setTimeout(()=>b(Error(h)),3e5);g.then(b=>{clearTimeout(c),a(b)},a=>{clearTimeout(c),b(a)})}));return mc(c,"idle"),{sessionId:a,text:f||"",done:!0,stopReason:i.stopReason}}catch(a){throw mc(c,"error"),a}finally{d.callbacks.onSessionUpdate=void 0}}async function mb(a){let b=l7.get(a),c=l8.get(a);if(c?.process.alive){let d=b?.agentSessionId??a;try{await c.connection.unstable_closeSession({sessionId:d})}catch{}l1(c.process)}l7.delete(a),l8.delete(a)}function mc(a,b){a.state=b,a.lastActivityAt=new Date().toISOString()}function md(a){if(!(!Array.isArray(a)||0===a.length))return a.filter(a=>!!a&&"object"==typeof a).map(a=>({type:"select",configId:String(a.configId??a.id??""),category:String(a.category??"other"),label:"string"==typeof a.label?a.label:void 0,currentValue:String(a.currentValue??""),options:Array.isArray(a.options)?a.options.map(a=>({id:String(a.id??""),label:String(a.label??"")})):[]})).filter(a=>a.configId)}},59349:(a,b,c)=>{c.d(b,{H5:()=>m,TA:()=>j,_h:()=>k,mV:()=>n,x3:()=>l});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(13308),i=c(39852);function j(a,b){let c=(0,h.n2)(a,b);return e().readFileSync(c,"utf-8")}function k(a,b,c){let d=(0,h.n2)(a,b),f=g().dirname(d),i=g().join(f,`.tmp-${Date.now()}-${g().basename(d)}`);try{e().mkdirSync(f,{recursive:!0}),e().writeFileSync(i,c,"utf-8"),e().renameSync(i,d)}catch(a){try{e().unlinkSync(i)}catch{}throw a}}function l(a,b,c=""){let d=(0,h.n2)(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,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=(0,h.n2)(a,b),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).replace(/\\/g,"/")}function n(a,b,c,d){let f=(0,h.n2)(a,b),j=(0,h.n2)(a,c);if(!e().existsSync(f))throw new i.Vt(i.tG.FILE_NOT_FOUND,`Source not found: ${b}`,{fromPath:b});if(e().existsSync(j))throw new i.Vt(i.tG.FILE_ALREADY_EXISTS,`Destination already exists: ${c}`,{toPath:c});return e().mkdirSync(g().dirname(j),{recursive:!0}),e().renameSync(f,j),{newPath:c,affectedFiles:d(a,b).map(a=>a.source)}}c(62022)},62022:(a,b,c)=>{c(29021),c(33873),c(13308)},62697:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{CY:()=>n,Ko:()=>l,Ny:()=>h,S9:()=>j,lh:()=>k,yx:()=>m});var e=c(31756),f=a([e]);function g(){return"p_"+Math.random().toString(36).slice(2,10)}function h(a){return"string"==typeof a&&a.startsWith("p_")}function i(a){return!!a&&"object"==typeof a&&"string"==typeof a.id&&a.id.startsWith("p_")&&"string"==typeof a.name&&a.name.trim().length>0&&"string"==typeof a.protocol&&(0,e.rl)(a.protocol)&&"string"==typeof a.apiKey&&"string"==typeof a.model&&"string"==typeof a.baseUrl}function j(a){return Array.isArray(a)?a.filter(i):[]}function k(a,b){return a.find(a=>a.id===b)}function l(a){let b=a.ai;if(!b||Array.isArray(b.providers))return null;let c=b.providers??{},d=b.provider??"openai",f=a.customProviders??[],h=[],i="";for(let[a,b]of Object.entries(c)){if(!b||!(0,e.rl)(a)||!b.apiKey&&!b.model&&!b.baseUrl)continue;let c=e.T_[a],f=g();h.push({id:f,name:c?.name??a,protocol:a,apiKey:b.apiKey??"",model:b.model??"",baseUrl:b.baseUrl??""}),a===d&&(i=f)}for(let a of f){if(!a.name||!a.baseProviderId)continue;let b=g();h.push({id:b,name:a.name,protocol:(0,e.rl)(a.baseProviderId)?a.baseProviderId:"openai",apiKey:a.apiKey??"",model:a.model??"",baseUrl:a.baseUrl??""}),a.id===d&&(i=b)}if(!i)if(h.length>0)i=h[0].id;else{let a=g();h.push({id:a,name:"OpenAI",protocol:"openai",apiKey:"",model:e.T_.openai?.defaultModel??"",baseUrl:""}),i=a}return{activeProvider:i,providers:h}}function m(a){return h(a)||"string"==typeof a&&a.startsWith("cp_")}e=(f.then?(await f)():f)[0];let n=k;d()}catch(a){d(a)}})},65102:(a,b,c)=>{c(29021),c(33873),c(39852),c(59349),c(13308),c(62022)},71859:(a,b,c)=>{c(29021),c(33873),c(13308)},72385:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{As:()=>g.As,F2:()=>j.F,FR:()=>l.FR,G1:()=>k.G,H5:()=>f.H5,KZ:()=>g.KZ,TA:()=>f.TA,WZ:()=>i.WZ,Xs:()=>h.X,_E:()=>g._E,_h:()=>f._h,g7:()=>l.g7,mV:()=>f.mV,n2:()=>e.n2,updateLines:()=>i.P2,vg:()=>i.vg,wf:()=>i.wf,x3:()=>f.x3});var e=c(13308),f=c(59349);c(31751);var g=c(88787),h=c(73612),i=c(14360),j=c(77421),k=c(7017),l=c(12169);c(65102),c(36057),c(71859),c(83234),c(80185);var m=a([g]);g=(m.then?(await m)():m)[0],d()}catch(a){d(a)}})},73612:(a,b,c)=>{c.d(b,{X:()=>h});var d=c(33873),e=c.n(d),f=c(31751),g=c(59349);class h{rebuild(a){let b=(0,f.f)(a).filter(a=>a.endsWith(".md")),c=new Set(b),d=function(a){let b=new Map;for(let c of a){let a=e().basename(c).toLowerCase();b.has(a)||b.set(a,[]),b.get(a).push(c)}return b}(b),h=new Map,j=new Map;for(let e of b){let b;try{b=(0,g.TA)(a,e)}catch{continue}let f=i(b,e,c,d),k=new Set;for(let a of f)a!==e&&k.add(a);for(let a of(h.set(e,k),k)){let b=j.get(a);b||(b=new Set,j.set(a,b)),b.add(e)}}this.forwardLinks=h,this.backwardLinks=j,this.builtForRoot=a,this.fileSet=c,this.basenameMap=d}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=e().basename(a).toLowerCase(),f=this.basenameMap.get(d);if(f){let b=f.indexOf(a);b>=0&&f.splice(b,1),0===f.length&&this.basenameMap.delete(d)}}updateFile(a,b){let c;if(!this.builtForRoot||!b.endsWith(".md"))return;let d=this.forwardLinks.get(b);if(d)for(let a of d)this.backwardLinks.get(a)?.delete(b);try{c=(0,g.TA)(a,b)}catch{return}if(!this.fileSet.has(b)){this.fileSet.add(b);let a=e().basename(b).toLowerCase();this.basenameMap.has(a)||this.basenameMap.set(a,[]),this.basenameMap.get(a).push(b)}let f=i(c,b,this.fileSet,this.basenameMap),h=new Set;for(let a of f)a!==b&&h.add(a);for(let a of(this.forwardLinks.set(b,h),h)){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 i(a,b,c,d){let f,g=[],h=e().dirname(b),i=/\[\[([^\]|#]+)(?:[|#][^\]]*)?/g;for(;null!==(f=i.exec(a));){let a=f[1].trim();if(!a)continue;if(c.has(a)){g.push(a);continue}let b=a.endsWith(".md")?a:a+".md";if(c.has(b)){g.push(b);continue}let h=e().basename(b).toLowerCase(),i=d.get(h);i&&1===i.length&&g.push(i[0])}let j=/\[[^\]]+\]\(([^)]+\.md)(?:#[^)]*)?\)/g;for(;null!==(f=j.exec(a));){let a=f[1].trim();if(!a||a.startsWith("http"))continue;let b=e().normalize(e().join(h,a));c.has(b)&&g.push(b)}return g}},77421:(a,b,c)=>{c.d(b,{F:()=>j});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(13308),i=c(39852);function j(a,b,c){if(!b.endsWith(".csv"))throw new i.Vt(i.tG.INVALID_FILE_TYPE,"Only .csv files support row append",{filePath:b});let d=(0,h.n2)(a,b),f=c.map(a=>a.includes(",")||a.includes('"')||a.includes("\n")?`"${a.replace(/"/g,'""')}"`:a).join(",")+"\n";return e().mkdirSync(g().dirname(d),{recursive:!0}),e().appendFileSync(d,f,"utf-8"),{newRowCount:e().readFileSync(d,"utf-8").trim().split("\n").length}}},80185:(a,b,c)=>{c(29021),c(33873),c(13308)},82614:(a,b,c)=>{c.d(b,{Y:()=>e});class d{track(a,b){this.record({name:a,ts:Date.now(),props:b})}startTimer(a,b){let c=Date.now();return d=>{this.record({name:a,ts:c,durationMs:Date.now()-c,props:{...b??{},...d??{}}})}}getEvents(){return this.history.map(a=>({...a,props:a.props?{...a.props}:void 0}))}reset(){this.history=[],this.pending=[]}async flush(){if(0===this.pending.length)return 0;let a=this.pending.splice(0),b=process.env.MINDOS_TELEMETRY_ENDPOINT?.trim();if(!b)return a.length;try{return await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),a.length}catch{return this.pending.unshift(...a),0}}record(a){this.history.push(a),this.history.length>200&&this.history.splice(0,this.history.length-200),this.pending.push(a),this.log(a)}log(a){}constructor(){this.history=[],this.pending=[]}}let e=new d},83234:(a,b,c)=>{c(29021),c(33873),c(13308)},84389:(a,b,c)=>{c.d(b,{Bl:()=>d.Bl,Cu:()=>d.Cu,JR:()=>d.JR,KQ:()=>d.KQ,Qy:()=>d.Qy,a2:()=>d.a2,cy:()=>d.cy,io:()=>d.io,pB:()=>d.pB,ph:()=>d.ph,yy:()=>d.yy});var d=c(38264)},87155:(a,b,c)=>{c.d(b,{H:()=>e,y:()=>d});let d=/[\u4e00-\u9fff\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/;function e(a){let b=a.match(/[\u4e00-\u9fff\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/g);return b?b.length:0}},88787:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{As:()=>u,KZ:()=>t,_E:()=>s,_K:()=>y});var e=c(29021),f=c.n(e),g=c(33873),h=c.n(g),i=c(21820),j=c.n(i),k=c(31751),l=c(59349),m=c(13308),n=c(37700),o=c(49882),p=c(82614),q=a([o]);o=(q.then?(await q)():q)[0];let z=new n.d;function r(){return h().join(j().homedir(),".mindos")}function s(){z.invalidate(),(0,o.R9)()}function t(a,b){z.isBuilt()&&(z.updateFile(a,b),v(),(0,o.X_)(a,b))}function u(a,b){z.isBuilt()&&(z.addFile(a,b),v(),(0,o.X_)(a,b))}let A=null,B=!1;function v(){B=!0,A&&clearTimeout(A),A=setTimeout(w,5e3)}function w(){if(A&&(clearTimeout(A),A=null),B){B=!1;try{z.persist(r())}catch{}}}"u">typeof process&&(process.on("beforeExit",w),process.on("SIGTERM",()=>{w(),process.exit(0)}),process.on("SIGINT",()=>{w(),process.exit(0)}));let C=new Map;function x(a,b){let c=function(a){let b=C.get(a);if(b)return b;let c=/[\u4e00-\u9fff\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/.test(a),d=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return b=c?RegExp(d,"g"):RegExp(`\\b${d}\\b`,"g"),C.size>500&&C.clear(),C.set(a,b),b}(a);c.lastIndex=0;let d=b.match(c);return d?d.length:0}function y(a,b,c={}){let d;if(!b.trim())return[];let{limit:e=20,scope:g,file_type:h="all",modified_after:i}=c;if(!z.isBuiltFor(a)){let b=p.Y.startTimer("search.core.index.load"),c=z.load(r(),a);if(b({loaded:c,fileCount:c?z.getFileCount():0}),!c){z.rebuild(a);try{z.persist(r())}catch{}}}let j=z.getFileCount(),n=z.getAvgDocLength(),o=(d=b.toLowerCase().trim().split(/\s+/).filter(a=>a.length>0),[...new Set(d)]),q=p.Y.startTimer("search.core.query",{queryLen:b.length,queryTermCount:o.length,totalDocs:j}),s=z.getCandidatesUnion(b),t=s?new Set(s):null,u=(0,k.f)(a);if(g){let a=g.endsWith("/")?g:g+"/";u=u.filter(b=>b.startsWith(a)||b===g)}if("all"!==h){let a=`.${h}`;u=u.filter(b=>b.endsWith(a))}t&&(u=u.filter(a=>t.has(a)));let v=0;i&&(v=new Date(i).getTime(),isNaN(v)&&(v=0));let w=[],A=b.toLowerCase(),B=new Map,C=new Map;for(let b of u){let c;if(v>0)try{let c=(0,m.n2)(a,b);if(f().statSync(c).mtimeMs<v)continue}catch{continue}try{c=(0,l.TA)(a,b)}catch{continue}let d=c.toLowerCase();for(let a of(C.set(b,c),o))x(a,d)>0&&B.set(a,(B.get(a)??0)+1)}for(let[a,c]of C){let d=c.toLowerCase(),e=!1,f=-1,g=0,h=0,i=c.length;for(let a of o){let b=x(a,d);if(0===b)continue;e=!0,h+=b,-1===f&&(f=d.indexOf(a));let c=B.get(a)??0;g+=function(a,b,c,d,e){if(0===a||0===e||0===d)return 0;let f=Math.log((e-b+.5)/(b+.5)+1),g=2.2*a/(a+1.2*(.25+.75*c/d));return f*g}(b,c,i,n,j)}if(!e)continue;let k=f>=0?f:d.indexOf(A),l=k>=0?k:0,m=c.lastIndexOf("\n\n",l);-1===m?m=Math.max(0,l-200):m+=2;let p=c.indexOf("\n\n",l);-1===p&&(p=Math.min(c.length,l+b.length+200)),l-m>200&&(m=l-200),p-l>200&&(p=l+b.length+200);let q=c.slice(m,p).trim();q=q.replace(/\n{3,}/g,"\n\n"),m>0&&(q="..."+q),p<c.length&&(q+="..."),w.push({path:a,snippet:q,score:g,occurrences:h})}w.sort((a,b)=>b.score-a.score);let D=w.slice(0,e);return q({candidateCount:t?t.size:u.length,resultCount:D.length}),D}d()}catch(a){d(a)}})}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=3466,exports.ids=[3466],exports.modules={9100:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(55168).A)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},14016:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A:()=>n});var e=c(72269),f=c(78520),g=c(65836),h=c(63353),i=c(55231),j=c(10270),k=c(22222),l=c(33659),m=a([k]);function n({value:a,onChange:b,showSkip:c=!1,compact:d=!1,configuredProviders:m,customProviders:n,onAdd:o}){let{locale:p}=(0,l.Y)(),[q,r]=(0,f.useState)(!1),s=(0,k.bf)(),t=m&&m.size>0,u=n&&n.length>0,v=d&&(t||u)&&!c,w=t?k.jt.filter(a=>m.has(a)):[],{primary:x,local:y,more:z}=s,A=[...y,...z],B=c=>{let d=k.T_[c],f="zh"===p?d.nameZh:d.name,h=a===c,i=m?.has(c);return(0,e.jsxs)("button",{type:"button",onClick:()=>b(c),className:`flex items-center gap-2 px-3 py-2 rounded-lg border text-left transition-all text-sm ${h?"border-[var(--amber)] bg-[var(--amber-subtle)] shadow-sm":"border-border/50 hover:border-border hover:bg-muted/30"}`,children:[(0,e.jsx)("span",{className:`font-medium ${h?"text-foreground":"text-muted-foreground"}`,children:f}),i&&!h&&(0,e.jsx)(g.A,{size:12,className:"text-success ml-auto shrink-0"}),h&&(0,e.jsx)(g.A,{size:14,className:"ml-auto shrink-0",style:{color:"var(--amber)"}})]},c)},C=c=>{let d=k.T_[c],f="zh"===p?d.nameZh:d.name,h="zh"===p?d.descriptionZh:d.description,i=a===c,j=m?.has(c);return(0,e.jsxs)("button",{type:"button",onClick:()=>b(c),className:"flex items-start gap-3 p-4 rounded-xl border text-left transition-all duration-150",style:{background:i?"var(--amber-dim)":"var(--card)",borderColor:i?"var(--amber)":"var(--border)"},children:[(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("p",{className:"text-sm font-medium",style:{color:"var(--foreground)"},children:f}),h&&(0,e.jsx)("p",{className:"text-xs mt-0.5",style:{color:"var(--muted-foreground)"},children:h}),(0,e.jsx)("p",{className:`text-xs ${h?"mt-1":"mt-0.5"}`,style:{color:"var(--muted-foreground)"},children:d.defaultModel})]}),j&&!i&&(0,e.jsx)(g.A,{size:14,className:"text-success shrink-0 mt-0.5"}),i&&(0,e.jsx)(g.A,{size:16,className:"shrink-0 mt-0.5",style:{color:"var(--amber)"}})]},c)};return v?(0,e.jsx)("div",{className:"space-y-2",children:(0,e.jsxs)("div",{className:"flex flex-wrap gap-2",children:[w.map(a=>B(a)),n?.map(c=>{let d=a===c.id;return(0,e.jsxs)("button",{type:"button",onClick:()=>b(c.id),className:`flex items-center gap-2 px-3 py-2 rounded-lg border text-left transition-all text-sm ${d?"border-[var(--amber)] bg-[var(--amber-subtle)] shadow-sm":"border-border/50 hover:border-border hover:bg-muted/30"}`,children:[(0,e.jsx)("span",{className:`font-medium ${d?"text-foreground":"text-muted-foreground"}`,children:c.name}),d&&(0,e.jsx)(g.A,{size:14,className:"ml-auto shrink-0",style:{color:"var(--amber)"}})]},c.id)}),o&&(0,e.jsxs)("button",{type:"button",onClick:o,className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-border/50 text-sm text-muted-foreground hover:border-border hover:text-foreground transition-all",children:[(0,e.jsx)(h.A,{size:14}),(0,e.jsx)("span",{children:"zh"===p?"添加":"Add"})]})]})}):(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("div",{className:d?"flex flex-wrap gap-2":"grid grid-cols-1 gap-2",children:x.map(a=>d?B(a):C(a))}),A.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{type:"button",onClick:()=>r(!q),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",children:[(0,e.jsx)(i.A,{size:12,className:`transition-transform ${q?"rotate-180":""}`}),q?"zh"===p?"收起":"Show less":"zh"===p?`更多 (${A.length})`:`More (${A.length})`]}),q&&(0,e.jsx)("div",{className:d?"flex flex-wrap gap-2":"grid grid-cols-1 gap-2",children:A.map(a=>d?B(a):C(a))})]}),c&&(0,e.jsxs)("button",{type:"button",onClick:()=>b("skip"),className:"flex items-center gap-2 px-3 py-2 rounded-lg border text-left transition-all text-sm w-full mt-1",style:{background:"skip"===a?"var(--amber-dim)":"var(--card)",borderColor:"skip"===a?"var(--amber)":"var(--border)"},children:[(0,e.jsx)(j.A,{size:14,className:"shrink-0",style:{color:"skip"===a?"var(--amber)":"var(--muted-foreground)"}}),(0,e.jsx)("span",{className:`font-medium ${"skip"===a?"text-foreground":"text-muted-foreground"}`,children:"zh"===p?"暂时跳过":"Skip for now"}),"skip"===a&&(0,e.jsx)(g.A,{size:14,className:"ml-auto shrink-0",style:{color:"var(--amber)"}})]})]})}k=(m.then?(await m)():m)[0],d()}catch(a){d(a)}})},26093:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(55168).A)("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]])},36326:(a,b,c)=>{c.d(b,{default:()=>d});let d=(0,c(52707).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/
|
|
1
|
+
"use strict";exports.id=3466,exports.ids=[3466],exports.modules={9100:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(55168).A)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},14016:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A:()=>n});var e=c(72269),f=c(78520),g=c(65836),h=c(63353),i=c(55231),j=c(10270),k=c(22222),l=c(33659),m=a([k]);function n({value:a,onChange:b,showSkip:c=!1,compact:d=!1,configuredProviders:m,customProviders:n,onAdd:o}){let{locale:p}=(0,l.Y)(),[q,r]=(0,f.useState)(!1),s=(0,k.bf)(),t=m&&m.size>0,u=n&&n.length>0,v=d&&(t||u)&&!c,w=t?k.jt.filter(a=>m.has(a)):[],{primary:x,local:y,more:z}=s,A=[...y,...z],B=c=>{let d=k.T_[c],f="zh"===p?d.nameZh:d.name,h=a===c,i=m?.has(c);return(0,e.jsxs)("button",{type:"button",onClick:()=>b(c),className:`flex items-center gap-2 px-3 py-2 rounded-lg border text-left transition-all text-sm ${h?"border-[var(--amber)] bg-[var(--amber-subtle)] shadow-sm":"border-border/50 hover:border-border hover:bg-muted/30"}`,children:[(0,e.jsx)("span",{className:`font-medium ${h?"text-foreground":"text-muted-foreground"}`,children:f}),i&&!h&&(0,e.jsx)(g.A,{size:12,className:"text-success ml-auto shrink-0"}),h&&(0,e.jsx)(g.A,{size:14,className:"ml-auto shrink-0",style:{color:"var(--amber)"}})]},c)},C=c=>{let d=k.T_[c],f="zh"===p?d.nameZh:d.name,h="zh"===p?d.descriptionZh:d.description,i=a===c,j=m?.has(c);return(0,e.jsxs)("button",{type:"button",onClick:()=>b(c),className:"flex items-start gap-3 p-4 rounded-xl border text-left transition-all duration-150",style:{background:i?"var(--amber-dim)":"var(--card)",borderColor:i?"var(--amber)":"var(--border)"},children:[(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("p",{className:"text-sm font-medium",style:{color:"var(--foreground)"},children:f}),h&&(0,e.jsx)("p",{className:"text-xs mt-0.5",style:{color:"var(--muted-foreground)"},children:h}),(0,e.jsx)("p",{className:`text-xs ${h?"mt-1":"mt-0.5"}`,style:{color:"var(--muted-foreground)"},children:d.defaultModel})]}),j&&!i&&(0,e.jsx)(g.A,{size:14,className:"text-success shrink-0 mt-0.5"}),i&&(0,e.jsx)(g.A,{size:16,className:"shrink-0 mt-0.5",style:{color:"var(--amber)"}})]},c)};return v?(0,e.jsx)("div",{className:"space-y-2",children:(0,e.jsxs)("div",{className:"flex flex-wrap gap-2",children:[w.map(a=>B(a)),n?.map(c=>{let d=a===c.id;return(0,e.jsxs)("button",{type:"button",onClick:()=>b(c.id),className:`flex items-center gap-2 px-3 py-2 rounded-lg border text-left transition-all text-sm ${d?"border-[var(--amber)] bg-[var(--amber-subtle)] shadow-sm":"border-border/50 hover:border-border hover:bg-muted/30"}`,children:[(0,e.jsx)("span",{className:`font-medium ${d?"text-foreground":"text-muted-foreground"}`,children:c.name}),d&&(0,e.jsx)(g.A,{size:14,className:"ml-auto shrink-0",style:{color:"var(--amber)"}})]},c.id)}),o&&(0,e.jsxs)("button",{type:"button",onClick:o,className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-border/50 text-sm text-muted-foreground hover:border-border hover:text-foreground transition-all",children:[(0,e.jsx)(h.A,{size:14}),(0,e.jsx)("span",{children:"zh"===p?"添加":"Add"})]})]})}):(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("div",{className:d?"flex flex-wrap gap-2":"grid grid-cols-1 gap-2",children:x.map(a=>d?B(a):C(a))}),A.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{type:"button",onClick:()=>r(!q),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",children:[(0,e.jsx)(i.A,{size:12,className:`transition-transform ${q?"rotate-180":""}`}),q?"zh"===p?"收起":"Show less":"zh"===p?`更多 (${A.length})`:`More (${A.length})`]}),q&&(0,e.jsx)("div",{className:d?"flex flex-wrap gap-2":"grid grid-cols-1 gap-2",children:A.map(a=>d?B(a):C(a))})]}),c&&(0,e.jsxs)("button",{type:"button",onClick:()=>b("skip"),className:"flex items-center gap-2 px-3 py-2 rounded-lg border text-left transition-all text-sm w-full mt-1",style:{background:"skip"===a?"var(--amber-dim)":"var(--card)",borderColor:"skip"===a?"var(--amber)":"var(--border)"},children:[(0,e.jsx)(j.A,{size:14,className:"shrink-0",style:{color:"skip"===a?"var(--amber)":"var(--muted-foreground)"}}),(0,e.jsx)("span",{className:`font-medium ${"skip"===a?"text-foreground":"text-muted-foreground"}`,children:"zh"===p?"暂时跳过":"Skip for now"}),"skip"===a&&(0,e.jsx)(g.A,{size:14,className:"ml-auto shrink-0",style:{color:"var(--amber)"}})]})]})}k=(m.then?(await m)():m)[0],d()}catch(a){d(a)}})},26093:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(55168).A)("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]])},36326:(a,b,c)=>{c.d(b,{default:()=>d});let d=(0,c(52707).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/mindos-dev/mindos-dev/packages/web/components/ClientRedirect.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/mindos-dev/mindos-dev/packages/web/components/ClientRedirect.tsx","default")},51670:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A:()=>l});var e=c(72269),f=c(78520),g=c(53679),h=c(55231),i=c(71977),j=c(22222),k=a([j]);function l({value:a,onChange:b,placeholder:c,provider:d,apiKey:k,envKey:l,baseUrl:m,supportsListModels:n,allowNoKey:o,browseLabel:p="Browse",noModelsLabel:q="No models found"}){let[r,s]=(0,f.useState)(null),[t,u]=(0,f.useState)(!1),[v,w]=(0,f.useState)(!1),[x,y]=(0,f.useState)(""),[z,A]=(0,f.useState)(!1),[B,C]=(0,f.useState)(-1),D=(0,f.useRef)(null),E=(0,f.useRef)(null),F=(0,f.useRef)(null),[G,H]=(0,f.useState)({}),I=(0,f.useRef)(!1),J=(0,f.useRef)(0),K=(0,f.useRef)(!1),L=o||!!k||!!l||!!j.T_[d]?.apiKeyFallback,M=(0,f.useCallback)(async(a=!1)=>{if(K.current)return;K.current=!0,u(!0),a||y("");let b=J.current;try{let c={provider:d};k&&(c.apiKey=k),m&&(c.baseUrl=m);let e=await fetch("/api/settings/list-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(b!==J.current)return;let f=await e.json();if(b!==J.current)return;f.ok&&Array.isArray(f.models)?(s(f.models),I.current=!0,a||w(!0)):a||y(f.error||"Failed to fetch models")}catch{if(b!==J.current)return;a||y("Network error")}finally{K.current=!1,u(!1)}},[d,k,m]),N=(0,f.useCallback)(()=>{A(!0),!I.current&&n&&L&&!K.current&&M(!0)},[n,L,M]),O=(0,f.useMemo)(()=>{if(!r)return[];if(!a.trim())return r;let b=a.toLowerCase();return[...r].sort((a,c)=>{let d=a.toLowerCase(),e=c.toLowerCase(),f=d.includes(b),g=e.includes(b);if(f!==g)return f?-1:1;if(f&&g){let a=d.startsWith(b),c=e.startsWith(b);if(a!==c)return a?-1:1;let f=d===b,g=e===b;if(f!==g)return f?-1:1}return a.localeCompare(c)})},[r,a]),P=v||z&&null!==r&&a.trim().length>0&&O.length>0,Q=(0,f.useCallback)(a=>{let c=P?O:[];c.length&&("ArrowDown"===a.key?(a.preventDefault(),C(a=>(a+1)%c.length)):"ArrowUp"===a.key?(a.preventDefault(),C(a=>(a-1+c.length)%c.length)):"Enter"===a.key&&B>=0&&B<c.length?(a.preventDefault(),b(c[B]),w(!1),A(!1)):"Escape"===a.key&&(w(!1),A(!1)))},[P,O,B,b]);return(0,e.jsxs)("div",{ref:D,className:"relative",children:[(0,e.jsxs)("div",{ref:E,className:"flex gap-1.5",children:[(0,e.jsx)(i.pd,{value:a,onChange:a=>{b(a.target.value),v||A(!0)},onFocus:N,onKeyDown:Q,placeholder:c,className:"flex-1",autoComplete:"off"}),n&&(0,e.jsxs)("button",{type:"button",disabled:!L||t,onClick:()=>M(!1),title:p,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:border-foreground/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:[t?(0,e.jsx)(g.A,{size:12,className:"animate-spin"}):(0,e.jsx)(h.A,{size:12}),p]})]}),x&&(0,e.jsx)("p",{className:"text-xs text-error mt-1",children:x}),P&&O.length>0&&(0,e.jsx)("div",{ref:F,style:G,className:"fixed z-50 max-h-48 overflow-y-auto rounded-lg border border-border bg-popover shadow-lg",children:O.map((c,d)=>{let f=!a.trim()||c.toLowerCase().includes(a.toLowerCase());return(0,e.jsx)("button",{type:"button","data-model-item":!0,className:`w-full text-left px-3 py-1.5 text-sm transition-colors ${c===a?"bg-accent/60 font-medium":d===B?"bg-accent":"hover:bg-accent"} ${!f?"opacity-50":""}`,onClick:()=>{b(c),w(!1),A(!1)},children:c},c)})}),v&&0===O.length&&(0,e.jsx)("div",{style:G,className:"fixed z-50 rounded-lg border border-border bg-popover shadow-lg px-3 py-2 text-xs text-muted-foreground",children:q})]})}j=(k.then?(await k)():k)[0],d()}catch(a){d(a)}})},96832:(a,b,c)=>{c.d(b,{default:()=>e});var d=c(72269);function e({href:a,label:b="Redirecting..."}){return(0,d.jsx)("main",{className:"min-h-screen flex items-center justify-center px-6",children:(0,d.jsx)("a",{href:a,className:"text-sm underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-ring rounded-sm",style:{color:"var(--muted-foreground)"},children:b})})}c(78520)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=3566,exports.ids=[3566],exports.modules={83566:(a,b,c)=>{c.d(b,{runLint:()=>p});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(31751),i=c(59349),j=c(
|
|
1
|
+
"use strict";exports.id=3566,exports.ids=[3566],exports.modules={83566:(a,b,c)=>{c.d(b,{runLint:()=>p});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(31751),i=c(59349),j=c(13308),k=c(73612);let l=new Set(["INSTRUCTION.md","README.md","CONFIG.json","_overview.md","CHANGELOG.md","TODO.md"]),m=new Set([".md",".csv"]),n=/\[\[([^\]|#]+)(?:[|#][^\]]*)?/g,o=/\[[^\]]+\]\(([^)]+\.md)(?:#[^)]*)?\)/g;function p(a,b){let c,d,e=q(a,b),f=function(a,b){var c;let d,e=q(a,b).filter(a=>a.endsWith(".md"));if(0===e.length)return[];let f=(c=a,(d=new k.X).rebuild(c),d),h=[];for(let b of e)if(!function(a){let b=g().basename(a);return l.has(b)}(b)&&0===f.getBacklinks(b).length){let c=r(a,b);h.push({path:b,lastModified:c?c.mtime.toISOString():new Date().toISOString()})}return h}(a,b),j=function(a,b,c){let d=q(a,c).filter(a=>m.has(g().extname(a).toLowerCase())),e=Date.now(),f=[];for(let b of d){let c=r(a,b);if(!c)continue;let d=e-c.mtimeMs;d>7776e6&&f.push({path:b,lastModified:c.mtime.toISOString(),daysSinceUpdate:Math.floor(d/864e5)})}return f}(a,0,b),p=function(a,b){let c=(0,h.f)(a).filter(a=>a.endsWith(".md")),d=new Set(c),e=b?c.filter(a=>a.startsWith(b+"/")||a.startsWith(b+g().sep)):c,f=[];for(let b of e){let c;try{c=(0,i.TA)(a,b)}catch{continue}if(function(a){if(0===a.length)return!1;let b=Math.min(a.length,32768),c=0;for(let d=0;d<b;d++){let b=a.charCodeAt(d);if(0===b)return!0;b<32&&9!==b&&10!==b&&13!==b&&c++}return c/b>.1}(c))continue;let e=c.split("\n"),h=g().dirname(b);for(let a=0;a<e.length;a++){let c,i=e[a];for(n.lastIndex=0;null!==(c=n.exec(i));){let e=c[1].trim();e&&!function(a,b){if(b.has(a))return!0;let c=a.endsWith(".md")?a:a+".md";if(b.has(c))return!0;try{let a=decodeURIComponent(c);if(a!==c&&b.has(a))return!0}catch{}let d=g().basename(c).toLowerCase();for(let a of b)if(g().basename(a).toLowerCase()===d)return!0;return!1}(e,d)&&f.push({source:b,target:e,line:a+1})}for(o.lastIndex=0;null!==(c=o.exec(i));){let e=c[1].trim();if(!e||e.startsWith("http"))continue;let i=g().normalize(g().join(h,e));if(!d.has(i)){try{let a=g().normalize(g().join(h,decodeURIComponent(e)));if(d.has(a))continue}catch{}f.push({source:b,target:e,line:a+1})}}}}return f}(a,b),s=function(a,b){let c=q(a,b).filter(a=>m.has(g().extname(a).toLowerCase())),d=[];for(let b of c)try{(0,i.TA)(a,b).trim().length<50&&d.push(b)}catch{continue}return d}(a,b),t={totalFiles:e.length,orphanFiles:f.length,staleFiles:j.length,emptyFiles:s.length,brokenLinks:p.length};return{timestamp:new Date().toISOString(),scope:b??"all",stats:t,healthScore:(c=Math.min(2*t.orphanFiles,30),d=Math.min(+t.staleFiles,20),Math.max(0,100-c-d-Math.min(3*t.brokenLinks,30)-Math.min(+t.emptyFiles,20))),orphans:f,stale:j,brokenLinks:p,empty:s}}function q(a,b){let c=(0,h.f)(a);return b?c.filter(a=>a.startsWith(b+"/")||a.startsWith(b+g().sep)):c}function r(a,b){try{return e().statSync((0,j.n2)(a,b))}catch{return null}}}};
|