@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
1
|
#!/usr/bin/env node
|
|
2
|
-
import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
|
-
import { tmpdir } from 'node:os';
|
|
2
|
+
import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { homedir, tmpdir } from 'node:os';
|
|
4
4
|
import { dirname, join, resolve } from 'node:path';
|
|
5
5
|
import { spawn } from 'node:child_process';
|
|
6
6
|
|
|
@@ -11,6 +11,7 @@ const webPort = Number(args.webPort ?? 3456);
|
|
|
11
11
|
const home = mkdtempSync(join(tmpdir(), 'mindos-desktop-smoke-home-'));
|
|
12
12
|
const mindRoot = mkdtempSync(join(tmpdir(), 'mindos-desktop-smoke-mind-'));
|
|
13
13
|
const logPath = join(tmpdir(), `mindos-desktop-smoke-${Date.now()}.log`);
|
|
14
|
+
const seededConfigs = [];
|
|
14
15
|
const fatalPatterns = [
|
|
15
16
|
/MCP bundle not found/i,
|
|
16
17
|
/ERR_MODULE_NOT_FOUND/i,
|
|
@@ -33,17 +34,21 @@ if (args.skipIfArchMismatch && isArchMismatch(appPath)) {
|
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
writeFileSync(join(mindRoot, 'README.md'), '# MindOS smoke\n', 'utf-8');
|
|
37
|
+
seedDesktopConfig();
|
|
36
38
|
|
|
37
39
|
const executable = resolveExecutable(appPath);
|
|
38
40
|
console.log(`[smoke-desktop-app] Launching ${executable}`);
|
|
39
41
|
console.log(`[smoke-desktop-app] Log: ${logPath}`);
|
|
40
42
|
|
|
41
|
-
const
|
|
43
|
+
const launchArgs = process.platform === 'linux' ? ['--no-sandbox'] : [];
|
|
44
|
+
const child = spawn(executable, launchArgs, {
|
|
42
45
|
cwd: dirname(executable),
|
|
46
|
+
detached: process.platform !== 'win32',
|
|
43
47
|
env: {
|
|
44
48
|
...process.env,
|
|
45
49
|
HOME: home,
|
|
46
50
|
USERPROFILE: home,
|
|
51
|
+
APPIMAGE_EXTRACT_AND_RUN: process.platform === 'linux' ? '1' : process.env.APPIMAGE_EXTRACT_AND_RUN,
|
|
47
52
|
MIND_ROOT: mindRoot,
|
|
48
53
|
MINDOS_WEB_PORT: String(webPort),
|
|
49
54
|
MINDOS_MCP_PORT: String(args.mcpPort ?? 8781),
|
|
@@ -69,10 +74,11 @@ try {
|
|
|
69
74
|
console.error(log.split('\n').slice(-120).join('\n'));
|
|
70
75
|
process.exitCode = 1;
|
|
71
76
|
} finally {
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
terminateChild();
|
|
78
|
+
restoreSeededConfigs();
|
|
74
79
|
rmSync(home, { recursive: true, force: true });
|
|
75
80
|
rmSync(mindRoot, { recursive: true, force: true });
|
|
81
|
+
process.exit(process.exitCode ?? 0);
|
|
76
82
|
}
|
|
77
83
|
|
|
78
84
|
async function waitForApp(timeout) {
|
|
@@ -119,6 +125,42 @@ function appendLog(chunk) {
|
|
|
119
125
|
writeFileSync(logPath, log);
|
|
120
126
|
}
|
|
121
127
|
|
|
128
|
+
function seedDesktopConfig() {
|
|
129
|
+
const config = JSON.stringify({
|
|
130
|
+
desktopMode: 'local',
|
|
131
|
+
mindRoot,
|
|
132
|
+
setupPending: false,
|
|
133
|
+
port: webPort,
|
|
134
|
+
mcpPort: Number(args.mcpPort ?? 8781),
|
|
135
|
+
}, null, 2);
|
|
136
|
+
|
|
137
|
+
seedConfigPath(join(home, '.mindos', 'config.json'), config);
|
|
138
|
+
// Electron's app.getPath('home') can resolve to the OS account home instead
|
|
139
|
+
// of the HOME env passed to child_process.spawn, especially on macOS runners.
|
|
140
|
+
seedConfigPath(join(homedir(), '.mindos', 'config.json'), config);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function seedConfigPath(configPath, contents) {
|
|
144
|
+
if (seededConfigs.some((entry) => entry.configPath === configPath)) return;
|
|
145
|
+
const configDir = dirname(configPath);
|
|
146
|
+
const previous = existsSync(configPath) ? readFileSync(configPath, 'utf-8') : null;
|
|
147
|
+
seededConfigs.push({ configPath, previous });
|
|
148
|
+
mkdirSync(configDir, { recursive: true });
|
|
149
|
+
writeFileSync(configPath, contents, 'utf-8');
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function restoreSeededConfigs() {
|
|
153
|
+
for (const { configPath, previous } of seededConfigs.reverse()) {
|
|
154
|
+
try {
|
|
155
|
+
if (previous === null) rmSync(configPath, { force: true });
|
|
156
|
+
else writeFileSync(configPath, previous, 'utf-8');
|
|
157
|
+
} catch {
|
|
158
|
+
// Best effort only: CI homes are disposable, and local runs should not fail
|
|
159
|
+
// after the app itself has already been validated.
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
122
164
|
function scanFatalLog(throwOnMatch = true) {
|
|
123
165
|
for (const pattern of fatalPatterns) {
|
|
124
166
|
if (pattern.test(log)) {
|
|
@@ -136,18 +178,50 @@ function resolveExecutable(app) {
|
|
|
136
178
|
return app;
|
|
137
179
|
}
|
|
138
180
|
|
|
181
|
+
function terminateChild() {
|
|
182
|
+
const pid = child.pid;
|
|
183
|
+
try {
|
|
184
|
+
child.stdout?.destroy();
|
|
185
|
+
child.stderr?.destroy();
|
|
186
|
+
} catch {
|
|
187
|
+
// ignore cleanup errors
|
|
188
|
+
}
|
|
189
|
+
try {
|
|
190
|
+
if (pid && process.platform !== 'win32') process.kill(-pid, 'SIGTERM');
|
|
191
|
+
else child.kill('SIGTERM');
|
|
192
|
+
} catch {
|
|
193
|
+
// already exited
|
|
194
|
+
}
|
|
195
|
+
try {
|
|
196
|
+
if (pid && process.platform !== 'win32') process.kill(-pid, 'SIGKILL');
|
|
197
|
+
else child.kill('SIGKILL');
|
|
198
|
+
} catch {
|
|
199
|
+
// already exited
|
|
200
|
+
}
|
|
201
|
+
child.unref();
|
|
202
|
+
}
|
|
203
|
+
|
|
139
204
|
function findPackagedApp() {
|
|
140
|
-
const
|
|
141
|
-
const candidates = [
|
|
205
|
+
const distRoots = [resolve('packages/desktop/dist'), resolve('dist')];
|
|
206
|
+
const candidates = distRoots.flatMap((desktopDist) => [
|
|
142
207
|
join(desktopDist, 'mac-arm64', 'MindOS.app'),
|
|
143
208
|
join(desktopDist, 'mac', 'MindOS.app'),
|
|
209
|
+
join(desktopDist, 'linux-unpacked', 'MindOS'),
|
|
144
210
|
join(desktopDist, 'linux-unpacked', 'mindos'),
|
|
145
211
|
join(desktopDist, 'win-unpacked', 'MindOS.exe'),
|
|
146
212
|
join(desktopDist, 'win-arm64-unpacked', 'MindOS.exe'),
|
|
147
|
-
|
|
213
|
+
...findDistFiles(desktopDist, /\.AppImage$/),
|
|
214
|
+
]);
|
|
148
215
|
return candidates.find((candidate) => existsSync(candidate));
|
|
149
216
|
}
|
|
150
217
|
|
|
218
|
+
function findDistFiles(dir, pattern) {
|
|
219
|
+
if (!existsSync(dir)) return [];
|
|
220
|
+
return readdirSync(dir)
|
|
221
|
+
.filter((entry) => pattern.test(entry))
|
|
222
|
+
.map((entry) => join(dir, entry));
|
|
223
|
+
}
|
|
224
|
+
|
|
151
225
|
function isArchMismatch(app) {
|
|
152
226
|
if (process.platform === 'darwin') {
|
|
153
227
|
const wantsArm = app.includes('mac-arm64');
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
3
3
|
import { join, resolve } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
4
5
|
|
|
5
|
-
const root = resolve(new URL('..', import.meta.url)
|
|
6
|
+
const root = resolve(fileURLToPath(new URL('..', import.meta.url)));
|
|
6
7
|
const args = parseArgs(process.argv.slice(2));
|
|
7
8
|
const runtimeRoot = resolve(root, args.runtimeRoot ?? 'packages/desktop/resources/mindos-runtime');
|
|
8
9
|
const mainBundle = resolve(root, args.mainBundle ?? 'packages/desktop/dist-electron/main/main.js');
|
|
@@ -85,6 +85,17 @@ function waitHealth(timeoutMs) {
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
function waitMcpAgents(timeoutMs) {
|
|
89
|
+
return waitHttpOk('/api/mcp/agents', timeoutMs, (body) => {
|
|
90
|
+
try {
|
|
91
|
+
const j = JSON.parse(body);
|
|
92
|
+
return Array.isArray(j.agents) && j.agents.length > 0;
|
|
93
|
+
} catch {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
88
99
|
let stderr = '';
|
|
89
100
|
const child = spawn(nodeBin, [serverJs], {
|
|
90
101
|
cwd: appDir,
|
|
@@ -113,6 +124,7 @@ function killChild() {
|
|
|
113
124
|
async function main() {
|
|
114
125
|
try {
|
|
115
126
|
await waitHealth(90_000);
|
|
127
|
+
await waitMcpAgents(30_000);
|
|
116
128
|
await waitHttpOk('/', 30_000, (body) => body.includes('MindOS') || body.includes('__next'));
|
|
117
129
|
console.log(`[verify-standalone] OK (port ${port})`);
|
|
118
130
|
return 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.7
|
package/static-web/_next/static/chunks/{1430-a3447cf370715cad.js → 1430-c4ffa328888515c1.js}
RENAMED
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
prose-pre:bg-muted/30 prose-pre:border prose-pre:border-border/50 prose-pre:rounded-lg prose-pre:p-3 prose-pre:text-2xs prose-pre:overflow-x-auto
|
|
9
9
|
prose-ul:my-1 prose-ol:my-1
|
|
10
10
|
prose-hr:border-border/30 prose-hr:my-3
|
|
11
|
-
${t}`,dangerouslySetInnerHTML:{__html:r}})}function S({open:e,skillName:t,skill:r,agentNames:i=[],allAgentNames:a=[],isNative:l=!1,nativeSourcePath:o,copy:d,onClose:N,onToggle:S,onDelete:T,onRefresh:z,onAddAgent:L,onRemoveAgent:E}){let K,P,[F,M]=(0,n.useState)(null),[O,W]=(0,n.useState)(""),[R,q]=(0,n.useState)(!1),[J,H]=(0,n.useState)(!1),[_,B]=(0,n.useState)(!1),[I,U]=(0,n.useState)(!1),[G,Q]=(0,n.useState)(null),[V,Z]=(0,n.useState)(!1),[Y,X]=(0,n.useState)(!1),[ee,et]=(0,n.useState)(!1),er=(0,n.useCallback)(async()=>{if(t){q(!0),H(!1);try{if(l&&o){let e=await (0,h.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"read-native",name:t,sourcePath:o})});M(e.content),W(e.description||"")}else if(!l){let e=await (0,h.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"read",name:t})});M(e.content)}}catch{H(!0)}finally{q(!1)}}},[t,l,o]);(0,n.useEffect)(()=>{e&&t&&(M(null),W(""),H(!1),Q(null),U(!1),Z(!1),X(!1),et(!1),er())},[e,t,er]),(0,n.useEffect)(()=>{if(e)return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&N()}},[e,N]);let es=(0,n.useCallback)(async()=>{!F||await (0,v.l)(F)&&j.oR.copy()},[F]),en=(0,n.useCallback)(async e=>{if(t&&S){Z(!0);try{await S(t,e)}finally{Z(!1)}}},[t,S]),ei=(0,n.useCallback)(async()=>{if(t&&T){B(!1),U(!0);try{await T(t),Q(d.deleted),await z?.(),setTimeout(()=>N(),800)}catch{Q(d.deleteFailed),U(!1)}}},[t,T,z,N,d.deleted,d.deleteFailed]);if(!e||!t)return null;let ea=r?(0,C.yQ)(`${r.name} ${r.description}`):(0,C.yQ)(t),el=A[ea]??c.A,eo=r?.source==="user",ed=l?d.sourceNative:r?.source==="builtin"?d.sourceBuiltin:d.sourceUser,ec=r?.description||O||"",eu=r?.path||(l&&o?`${o}/${t}/SKILL.md`:""),em=F?(K=F,(P=F.match(/^---\n[\s\S]*?\n---\n?/))&&(K=F.slice(P[0].length).trim()),{triggerConditions:ec||"",instructions:K}):null,ep=a.filter(e=>!i.includes(e));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 z-40 overlay-backdrop",onClick:N,"aria-hidden":"true"}),(0,s.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":t,className:"fixed right-0 top-0 z-50 h-full w-full max-w-md border-l border-border bg-card shadow-2xl flex flex-col animate-in slide-in-from-right duration-200",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border/60 bg-gradient-to-r from-card to-card/80 shrink-0",children:[(0,s.jsx)("div",{className:"w-9 h-9 rounded-xl bg-[var(--amber)]/[0.08] flex items-center justify-center text-[var(--amber)] shrink-0",children:(0,s.jsx)(el,{size:18})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-foreground truncate",children:t}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,s.jsx)("span",{className:`text-2xs px-2 py-0.5 rounded-full font-medium select-none ${l||r?.source==="builtin"?"bg-muted text-muted-foreground":"bg-[var(--amber-dim)] text-[var(--amber-text)]"}`,children:ed}),(0,s.jsx)("span",{className:"text-2xs text-muted-foreground/60 capitalize",children:ea})]})]}),(0,s.jsx)("button",{type:"button",onClick:N,className:"shrink-0 p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted cursor-pointer transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":d.close,children:(0,s.jsx)(u.A,{size:16})})]}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5",children:[ec&&(0,s.jsxs)("section",{children:[(0,s.jsx)(D,{label:"Trigger Conditions"}),(0,s.jsx)("div",{className:"rounded-lg border border-border/40 bg-muted/[0.03] p-3.5",children:(0,s.jsx)("p",{className:"text-xs text-foreground/80 leading-relaxed whitespace-pre-wrap",children:ec})})]}),!ec&&!l&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground italic",children:d.noDescription}),(0,s.jsx)("section",{children:(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[!l&&r&&(0,s.jsx)($,{label:d.enabled,value:r.enabled?"✓":"—",tone:r.enabled?"ok":"muted"}),(0,s.jsx)($,{label:d.capability,value:ea}),(0,s.jsx)($,{label:d.source,value:ed}),(0,s.jsx)($,{label:d.agents,value:String(i.length)})]})}),(0,s.jsxs)("section",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)(D,{label:d.agents,noMargin:!0}),L&&ep.length>0&&(0,s.jsxs)("button",{type:"button",onClick:()=>X(!Y),className:"inline-flex items-center gap-1 text-2xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity cursor-pointer",children:[(0,s.jsx)(m.A,{size:12}),(0,s.jsx)("span",{children:"Add"})]})]}),Y&&ep.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-2 p-2 rounded-lg border border-dashed border-[var(--amber)]/30 bg-[var(--amber)]/[0.03]",children:ep.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>{L?.(t,e),X(!1)},className:"inline-flex items-center gap-1 px-2 py-1 text-2xs rounded-md border border-border bg-card hover:bg-muted cursor-pointer transition-colors",children:[(0,s.jsx)(m.A,{size:10,className:"text-[var(--amber)]"}),(0,s.jsx)("span",{className:"text-foreground/80",children:e})]},e))}),i.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(e=>(0,s.jsx)(k.lx,{name:e,size:"sm",onRemove:E?()=>E(t,e):void 0},e))}):(0,s.jsx)("div",{className:"rounded-lg border border-border/40 bg-card/30 p-3 text-center",children:(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:d.noAgents})})]}),(null!==F||R||J)&&(0,s.jsxs)("section",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)(D,{label:"Instructions",noMargin:!0}),(0,s.jsx)("div",{className:"flex items-center gap-2",children:F&&(0,s.jsxs)("button",{type:"button",onClick:es,className:"inline-flex items-center gap-1 text-2xs text-muted-foreground hover:text-foreground cursor-pointer transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded px-1.5 py-0.5","aria-label":d.copyContent,children:[(0,s.jsx)(p.A,{size:11}),d.copyContent]})})]}),R&&(0,s.jsxs)("div",{className:"rounded-lg border border-border bg-background p-6 flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[(0,s.jsx)(x.A,{size:14,className:"animate-spin"}),d.loading]}),J&&(0,s.jsxs)("div",{className:"rounded-lg border border-destructive/20 bg-destructive/[0.03] p-4 text-center space-y-2",children:[(0,s.jsx)("p",{className:"text-sm text-destructive",children:d.loadFailed}),(0,s.jsx)("button",{type:"button",onClick:er,className:"text-xs text-foreground underline hover:no-underline cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",children:d.retry})]}),em&&!R&&!J&&(0,s.jsx)("div",{className:`rounded-lg border border-border/50 bg-muted/[0.02] p-4 overflow-hidden transition-all duration-200 ${!ee?"max-h-60":""}`,children:(0,s.jsx)(w,{text:em.instructions})}),em&&!R&&!J&&em.instructions.split("\n").length>15&&(0,s.jsxs)("button",{type:"button",onClick:()=>et(!ee),className:"inline-flex items-center gap-1 mt-2 text-2xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity cursor-pointer",children:[(0,s.jsx)(g.A,{size:12,className:`transition-transform duration-200 ${ee?"rotate-180":""}`}),(0,s.jsx)("span",{children:ee?"Collapse":"View All"})]})]}),eu&&(0,s.jsxs)("section",{children:[(0,s.jsx)(D,{label:d.path}),(0,s.jsx)("div",{className:"rounded-lg border border-border/50 bg-muted/[0.03] p-3",children:(0,s.jsx)("code",{className:"text-2xs text-foreground/60 font-mono break-all leading-relaxed",children:eu})})]}),G&&(0,s.jsx)("div",{role:"status","aria-live":"polite",className:"rounded-md border border-border bg-muted/50 px-3 py-2 text-xs text-muted-foreground animate-in fade-in duration-200",children:G})]}),!l&&r&&(0,s.jsxs)("div",{className:"shrink-0 border-t border-border px-5 py-3 flex items-center gap-2",children:[S&&(0,s.jsxs)("div",{className:"flex items-center gap-2 mr-auto",children:[(0,s.jsx)(f.A,{size:14,className:"text-muted-foreground","aria-hidden":"true"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:r.enabled?d.enabled:d.disabled}),(0,s.jsx)(y.lM,{size:"sm",checked:r.enabled,onChange:e=>void en(e),disabled:V})]}),eo&&T&&(0,s.jsxs)("button",{type:"button",onClick:()=>B(!0),disabled:I,className:"inline-flex items-center gap-1.5 px-2.5 min-h-[32px] text-xs rounded-md border border-destructive/30 text-destructive hover:bg-destructive/10 cursor-pointer disabled:opacity-50 transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[I?(0,s.jsx)(x.A,{size:12,className:"animate-spin"}):(0,s.jsx)(b.A,{size:12}),d.deleteSkill]})]})]}),(0,s.jsx)(k.TM,{open:_,title:d.confirmDeleteTitle,message:t?d.confirmDeleteMessage(t):"",confirmLabel:d.confirmDeleteAction,cancelLabel:d.cancelAction,onConfirm:()=>void ei(),onCancel:()=>B(!1),variant:"destructive"})]})}function D({label:e,noMargin:t}){return(0,s.jsx)("h3",{className:`text-xs font-semibold text-muted-foreground uppercase tracking-wider ${t?"":"mb-2"}`,children:e})}function $({label:e,value:t,tone:r="default"}){return(0,s.jsxs)("div",{className:"rounded-xl border border-border/50 bg-muted/[0.03] px-3.5 py-3 hover:bg-muted/[0.06] transition-colors duration-100",children:[(0,s.jsx)("span",{className:"text-2xs text-muted-foreground/60 block mb-1 uppercase tracking-wider",children:e}),(0,s.jsx)("span",{className:`text-sm font-semibold capitalize ${"ok"===r?"text-[var(--success)]":"muted"===r?"text-muted-foreground":"text-foreground"}`,children:t})]})}},51117:(e,t,r)=>{r.d(t,{V:()=>n});var s=r(44223);function n(){let[e,t]=(0,s.useState)([]),[r,n]=(0,s.useState)(!1),[i,a]=(0,s.useState)(null),l=(0,s.useCallback)(async e=>{n(!0),a(null);try{let r=await fetch("/api/a2a/discover",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})}),s=await r.json();if(s.agent)return t(e=>e.some(e=>e.id===s.agent.id)?e.map(e=>e.id===s.agent.id?s.agent:e):[...e,s.agent]),s.agent;return a(s.error||"Discovery failed"),null}catch(e){return a(e.message),null}finally{n(!1)}},[]);return{agents:e,discovering:r,error:i,discover:l,remove:(0,s.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),refresh:(0,s.useCallback)(()=>{t([]),a(null)},[])}}},82829:(e,t,r)=>{r.d(t,{A:()=>h});var s=r(66839),n=r(44223),i=r(72799),a=r(21082),l=r(38688),o=r(53097),d=r(30626),c=r(29696),u=r(72615),m=r(98327),p=r(44361),x=r(2073),g=r(84747),f=r(79455),b=r(69527);function h({open:e,onClose:t,onSuccess:r,existingAgents:h,editAgent:j}){let{t:y}=(0,x.Y)(),N=y.agentsContent.overview,k=(0,n.useRef)(null),C=(0,n.useRef)(null),A=!!j,[w,S]=(0,n.useState)("input"),[D,$]=(0,n.useState)(!1),[T,z]=(0,n.useState)(!1),[L,E]=(0,n.useState)(null),[K,P]=(0,n.useState)(null),[F,M]=(0,n.useState)(!1),[O,W]=(0,n.useState)(!1),[R,q]=(0,n.useState)({name:"",baseDir:"",global:"",configKey:"mcpServers",format:"json",preferredTransport:"stdio",project:"",presenceCli:"",skillDir:""});(0,n.useEffect)(()=>{e&&(j?(q({name:j.name,baseDir:j.customBaseDir||"",global:j.globalPath||"",configKey:j.configKey||"mcpServers",format:j.format||"json",preferredTransport:j.preferredTransport||"stdio",project:j.projectPath||"",presenceCli:"",skillDir:j.skillWorkspacePath||""}),S("result"),W(!0),P(null),E(null)):(q({name:"",baseDir:"",global:"",configKey:"mcpServers",format:"json",preferredTransport:"stdio",project:"",presenceCli:"",skillDir:""}),S("input"),W(!1),P(null),E(null),M(!1)))},[e,j]),(0,n.useEffect)(()=>{e&&"input"===w&&setTimeout(()=>C.current?.focus(),100)},[e,w]),(0,g.r)(k,e),(0,n.useEffect)(()=>{if(!e)return;let r=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t]);let J=(0,n.useMemo)(()=>{let e=new Set(h.map(e=>e.key));return A&&j&&e.delete(j.key),e},[h,A,j]),H=(0,n.useMemo)(()=>R.name.toLowerCase().replace(/[^\x20-\x7E]/g,"").replace(/[_\s]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-{2,}/g,"-").replace(/^-|-$/g,""),[R.name]),_=(0,n.useMemo)(()=>{if(A||!R.name.trim())return null;let e=H||"";if(!e)return null;if(J.has(e)){let t=h.find(t=>t.key===e);return t?.isCustom?N.customAgentKeyConflict?.(e)??`An agent with key "${e}" already exists`:N.customAgentBuiltinConflict?.(t?.name||e)??`Conflicts with built-in agent "${t?.name||e}"`}return null},[A,H,J,h,R.name,N]),B=R.name.trim()&&R.baseDir.trim()&&!_,I=(0,n.useCallback)((e,t)=>{q(r=>({...r,[e]:t}))},[]),U=(0,n.useCallback)(async()=>{if(!B)return;E(null),$(!0);let e=R.baseDir.trim();if(!e.startsWith("~/")){let t=e.endsWith("/")?e:e+"/";I("global",t+"mcp.json"),I("skillDir",t+"skills/"),P({exists:!1,hasSkillsDir:!1}),S("result"),$(!1);return}let t=new AbortController,r=setTimeout(()=>t.abort(),3e3);try{let s=await fetch("/api/agents/custom/detect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseDir:e}),signal:t.signal});clearTimeout(r);let n=await s.json();if(!s.ok)return void E(n.error||N.customAgentFailedSave);P(n),n.detectedConfig?I("global",n.detectedConfig):I("global",(e.endsWith("/")?e:e+"/")+"mcp.json"),n.detectedFormat&&I("format",n.detectedFormat),n.detectedConfigKey&&I("configKey",n.detectedConfigKey),I("skillDir",n.detectedSkillDir||(e.endsWith("/")?e:e+"/")+"skills/"),S("result")}catch{clearTimeout(r);let t=e.endsWith("/")?e:e+"/";I("global",t+"mcp.json"),I("skillDir",t+"skills/"),P({exists:!1,hasSkillsDir:!1}),M(!0),S("result")}finally{$(!1)}},[B,R.baseDir,I,N]),G=(0,n.useCallback)(async()=>{z(!0),E(null);let e=A?{key:j.key,name:R.name.trim(),baseDir:R.baseDir.trim(),global:R.global.trim()||void 0,configKey:R.configKey.trim()||void 0,format:R.format,preferredTransport:R.preferredTransport,project:R.project.trim()||null,presenceCli:R.presenceCli.trim()||void 0,skillDir:R.skillDir.trim()||void 0}:{name:R.name.trim(),baseDir:R.baseDir.trim(),global:R.global.trim()||void 0,configKey:R.configKey.trim()||void 0,format:R.format,preferredTransport:R.preferredTransport,project:R.project.trim()||null,presenceCli:R.presenceCli.trim()||void 0,skillDir:R.skillDir.trim()||void 0};try{let s=await fetch("/api/agents/custom",{method:A?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await s.json();if(!s.ok){E(n.error||N.customAgentFailedSave),z(!1);return}let i=A?N.customAgentUpdated(R.name.trim()):N.customAgentAdded(R.name.trim());f.oR.success(i),r(),t()}catch{E(N.customAgentNetworkError)}finally{z(!1)}},[A,j,R,r,t,N]),Q=(0,n.useCallback)(e=>{"Enter"===e.key&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)&&(e.preventDefault(),"input"===w&&B&&!D?U():"result"!==w||T||G())},[w,B,D,T,U,G]);if(!e)return null;let V=A?N.editCustomAgentTitle(j.name):N.addCustomAgentTitle;return(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",role:"dialog","aria-modal":"true","aria-labelledby":"custom-agent-modal-title",children:[(0,s.jsx)("div",{className:"absolute inset-0 modal-backdrop",onClick:t,"aria-hidden":"true"}),(0,s.jsxs)("div",{ref:k,className:"relative bg-card border border-border rounded-xl shadow-2xl max-w-md w-full mx-4 animate-in fade-in zoom-in-95 duration-200 max-h-[85vh] overflow-y-auto",onKeyDown:Q,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-5 pt-5 pb-1",children:[(0,s.jsx)("h2",{id:"custom-agent-modal-title",className:"text-base font-semibold text-foreground",children:V}),(0,s.jsx)("button",{type:"button",onClick:t,className:"w-7 h-7 rounded-md flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted transition-colors duration-150 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Close",children:(0,s.jsx)(i.A,{size:16})})]}),(0,s.jsxs)("div",{className:"px-5 py-4 space-y-4",children:[(0,s.jsxs)(b.D0,{label:N.customAgentName,children:[(0,s.jsx)("input",{ref:C,value:R.name,onChange:e=>I("name",e.target.value),placeholder:N.customAgentNamePlaceholder,"aria-invalid":!!_,className:`w-full px-3 py-2 text-sm bg-background border rounded-lg text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 ${_?"border-[var(--error)] focus-visible:ring-[var(--error)]":"border-border"}`,autoComplete:"off"}),_?(0,s.jsxs)("p",{className:"text-xs text-[var(--error)] mt-1 flex items-center gap-1",children:[(0,s.jsx)(a.A,{size:12}),_]}):R.name.trim()&&H?(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:N.customAgentKeyPreview(H)}):null]}),(0,s.jsxs)(b.D0,{label:N.customAgentDir,hint:"input"===w?N.customAgentDirHint:void 0,children:[(0,s.jsx)(b.pd,{value:R.baseDir,onChange:e=>{I("baseDir",e.target.value),"result"===w&&(S("input"),P(null))},placeholder:N.customAgentDirPlaceholder,autoComplete:"off"}),"result"===w&&K?.exists&&(0,s.jsxs)("p",{className:"text-xs text-[var(--success)] mt-1 flex items-center gap-1",children:[(0,s.jsx)(l.A,{size:12}),N.customAgentDirFound]}),"result"===w&&K&&!K.exists&&!F&&(0,s.jsxs)("p",{className:"text-xs text-[var(--info,var(--muted-foreground))] mt-1 flex items-center gap-1",children:[(0,s.jsx)(o.A,{size:12}),N.customAgentDirNotFound]}),"result"===w&&F&&(0,s.jsxs)("p",{className:"text-xs text-[var(--amber)] mt-1 flex items-center gap-1",children:[(0,s.jsx)(a.A,{size:12}),N.customAgentDetectTimeout]})]}),"result"===w&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:`rounded-lg p-4 space-y-3 ${K?.exists?"border border-[var(--success)]/20 bg-[var(--success)]/5":"border border-border bg-muted/30"}`,children:[(0,s.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:K?.exists?N.customAgentDetectedTitle:N.customAgentDefaultTitle}),(0,s.jsxs)("div",{className:"space-y-2.5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground mb-1",children:N.customAgentConfigLabel}),(0,s.jsx)("span",{className:"text-sm text-foreground font-mono truncate block",children:R.global}),K?.mcpParseError&&(0,s.jsxs)("p",{className:"text-xs text-[var(--error)] mt-1 flex items-center gap-1",children:[(0,s.jsx)(a.A,{size:12,className:"shrink-0"}),K.mcpParseError]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground mb-1",children:N.customAgentFormatLabel}),(0,s.jsx)("span",{className:"text-sm text-foreground",children:R.format.toUpperCase()})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground mb-1",children:"Config Key"}),(0,s.jsx)("span",{className:"text-sm text-foreground font-mono",children:R.configKey})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground mb-1",children:N.customAgentTransportLabel}),(0,s.jsx)("span",{className:"text-sm text-foreground",children:R.preferredTransport})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-xs text-muted-foreground mb-1 flex items-center gap-1",children:[(0,s.jsx)(d.A,{size:11,className:"shrink-0","aria-hidden":"true"}),"MCP Servers"]}),K?.mcpServers&&K.mcpServers.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:K.mcpServers.map(e=>(0,s.jsx)("span",{className:"text-xs bg-muted/60 text-foreground px-2 py-0.5 rounded font-mono",children:e},e))}):(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:"—"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-xs text-muted-foreground mb-1 flex items-center gap-1",children:[(0,s.jsx)(c.A,{size:11,className:"shrink-0","aria-hidden":"true"}),N.customAgentSkillsLabel]}),K?.skillNames&&K.skillNames.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:K.skillNames.map(e=>(0,s.jsx)("span",{className:"text-xs bg-[var(--amber-dim)] text-[var(--amber-text,var(--foreground))] px-2 py-0.5 rounded font-mono",children:e},e))}):(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:"—"})]})]})]}),(0,s.jsxs)("button",{type:"button",onClick:()=>W(e=>!e),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors duration-150 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",children:[O?(0,s.jsx)(u.A,{size:14}):(0,s.jsx)(m.A,{size:14}),N.customAgentCustomize]}),(0,s.jsx)("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:O?"1fr":"0fr"},children:(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsxs)("div",{className:"rounded-xl border border-border/50 bg-card/50 p-5 space-y-4",children:[(0,s.jsx)(b.D0,{label:N.customAgentConfigPath,children:(0,s.jsx)(b.pd,{value:R.global,onChange:e=>I("global",e.target.value),autoComplete:"off"})}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsx)(b.D0,{label:N.customAgentConfigKey,children:(0,s.jsx)(b.pd,{value:R.configKey,onChange:e=>I("configKey",e.target.value),autoComplete:"off"})}),(0,s.jsx)(b.D0,{label:N.customAgentFormat,children:(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)(v,{label:"JSON",checked:"json"===R.format,onChange:()=>I("format","json"),name:"format"}),(0,s.jsx)(v,{label:"TOML",checked:"toml"===R.format,onChange:()=>I("format","toml"),name:"format"})]})})]}),(0,s.jsx)(b.D0,{label:N.customAgentTransport,children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(v,{label:"stdio",checked:"stdio"===R.preferredTransport,onChange:()=>I("preferredTransport","stdio"),name:"transport"}),(0,s.jsx)(v,{label:"http",checked:"http"===R.preferredTransport,onChange:()=>I("preferredTransport","http"),name:"transport"})]})}),(0,s.jsx)(b.D0,{label:N.customAgentSkillDir,hint:N.customAgentSkillDirHint,children:(0,s.jsx)(b.pd,{value:R.skillDir,onChange:e=>I("skillDir",e.target.value),placeholder:N.customAgentSkillDirPlaceholder,autoComplete:"off"})}),(0,s.jsx)(b.D0,{label:N.customAgentProjectConfig,children:(0,s.jsx)(b.pd,{value:R.project,onChange:e=>I("project",e.target.value),autoComplete:"off"})}),(0,s.jsx)(b.D0,{label:N.customAgentCliBinary,children:(0,s.jsx)(b.pd,{value:R.presenceCli,onChange:e=>I("presenceCli",e.target.value),placeholder:N.customAgentCliBinaryPlaceholder,autoComplete:"off"})})]})})})]}),L&&(0,s.jsxs)("div",{className:"rounded-lg border border-[var(--error)]/30 bg-[var(--error)]/5 p-3 flex items-start gap-2",children:[(0,s.jsx)(a.A,{size:14,className:"text-[var(--error)] mt-0.5 shrink-0"}),(0,s.jsx)("p",{className:"text-sm text-[var(--error)]",children:L})]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 px-5 pb-5 pt-1",children:[(0,s.jsx)("button",{type:"button",onClick:t,className:"px-4 min-h-[36px] text-sm rounded-lg border border-border hover:bg-muted cursor-pointer transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:N.customAgentCancel}),"input"===w?(0,s.jsx)("button",{type:"button",onClick:U,disabled:!B||D,className:"px-4 min-h-[36px] text-sm rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] hover:bg-[var(--amber)]/90 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring flex items-center gap-2",children:D?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p.A,{size:14,className:"animate-spin"}),N.customAgentDetecting]}):(0,s.jsxs)(s.Fragment,{children:[N.customAgentContinue,(0,s.jsx)(m.A,{size:14})]})}):(0,s.jsx)("button",{type:"button",onClick:G,disabled:T,className:"px-4 min-h-[36px] text-sm rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] hover:bg-[var(--amber)]/90 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring flex items-center gap-2",children:T?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p.A,{size:14,className:"animate-spin"}),A?N.customAgentSaving:N.customAgentAdding]}):L?N.customAgentRetry:A?N.customAgentSave:N.customAgentAdd})]})]})]})}function v({label:e,checked:t,onChange:r,name:n}){return(0,s.jsxs)("label",{className:`px-3 py-1.5 text-sm rounded-md border cursor-pointer transition-all duration-150 select-none ${t?"border-[var(--amber)]/40 bg-[var(--amber-dim)] text-foreground font-medium":"border-border bg-background text-muted-foreground hover:bg-muted"}`,children:[(0,s.jsx)("input",{type:"radio",name:n,checked:t,onChange:r,className:"sr-only"}),e]})}},82977:(e,t,r)=>{r.d(t,{Gj:()=>i,ZD:()=>n,v7:()=>a});let s={"&":"&","<":"<",">":">",'"':""","'":"'"};function n(e){return e.replace(/[&<>"']/g,e=>s[e])}function i(e){return n(e).replace(/`/g,"`")}function a(e){let t=e.replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").trim(),r=t.replace(/[\u0000-\u001f\u007f\s]+/g,"").toLowerCase();return r.startsWith("http://")||r.startsWith("https://")||r.startsWith("mailto:")||t.startsWith("/")&&!t.startsWith("//")||t.startsWith("#")?i(t):"#"}}}]);
|
|
11
|
+
${t}`,dangerouslySetInnerHTML:{__html:r}})}function S({open:e,skillName:t,skill:r,agentNames:i=[],allAgentNames:a=[],isNative:l=!1,nativeSourcePath:o,copy:d,onClose:N,onToggle:S,onDelete:T,onRefresh:z,onAddAgent:L,onRemoveAgent:E}){let K,P,[F,M]=(0,n.useState)(null),[O,W]=(0,n.useState)(""),[R,q]=(0,n.useState)(!1),[J,H]=(0,n.useState)(!1),[_,B]=(0,n.useState)(!1),[I,U]=(0,n.useState)(!1),[G,Q]=(0,n.useState)(null),[V,Z]=(0,n.useState)(!1),[Y,X]=(0,n.useState)(!1),[ee,et]=(0,n.useState)(!1),er=(0,n.useCallback)(async()=>{if(t){q(!0),H(!1);try{if(l&&o){let e=await (0,h.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"read-native",name:t,sourcePath:o})});M(e.content),W(e.description||"")}else if(!l){let e=await (0,h.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"read",name:t})});M(e.content)}}catch{H(!0)}finally{q(!1)}}},[t,l,o]);(0,n.useEffect)(()=>{e&&t&&(M(null),W(""),H(!1),Q(null),U(!1),Z(!1),X(!1),et(!1),er())},[e,t,er]),(0,n.useEffect)(()=>{if(e)return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&N()}},[e,N]);let es=(0,n.useCallback)(async()=>{!F||await (0,v.l)(F)&&j.oR.copy()},[F]),en=(0,n.useCallback)(async e=>{if(t&&S){Z(!0);try{await S(t,e)}finally{Z(!1)}}},[t,S]),ei=(0,n.useCallback)(async()=>{if(t&&T){B(!1),U(!0);try{await T(t),Q(d.deleted),await z?.(),setTimeout(()=>N(),800)}catch{Q(d.deleteFailed),U(!1)}}},[t,T,z,N,d.deleted,d.deleteFailed]);if(!e||!t)return null;let ea=r?(0,C.yQ)(`${r.name} ${r.description}`):(0,C.yQ)(t),el=A[ea]??c.A,eo=r?.source==="user",ed=l?d.sourceNative:r?.source==="builtin"?d.sourceBuiltin:d.sourceUser,ec=r?.description||O||"",eu=r?.path||(l&&o?`${o}/${t}/SKILL.md`:""),em=F?(K=F,(P=F.match(/^---\n[\s\S]*?\n---\n?/))&&(K=F.slice(P[0].length).trim()),{triggerConditions:ec||"",instructions:K}):null,ep=a.filter(e=>!i.includes(e));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 z-40 overlay-backdrop",onClick:N,"aria-hidden":"true"}),(0,s.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":t,className:"fixed right-0 top-0 z-50 h-full w-full max-w-md border-l border-border bg-card shadow-2xl flex flex-col animate-in slide-in-from-right duration-200",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border/60 bg-gradient-to-r from-card to-card/80 shrink-0",children:[(0,s.jsx)("div",{className:"w-9 h-9 rounded-xl bg-[var(--amber)]/[0.08] flex items-center justify-center text-[var(--amber)] shrink-0",children:(0,s.jsx)(el,{size:18})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-foreground truncate",children:t}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,s.jsx)("span",{className:`text-2xs px-2 py-0.5 rounded-full font-medium select-none ${l||r?.source==="builtin"?"bg-muted text-muted-foreground":"bg-[var(--amber-dim)] text-[var(--amber-text)]"}`,children:ed}),(0,s.jsx)("span",{className:"text-2xs text-muted-foreground/60 capitalize",children:ea})]})]}),(0,s.jsx)("button",{type:"button",onClick:N,className:"shrink-0 p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted cursor-pointer transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":d.close,children:(0,s.jsx)(u.A,{size:16})})]}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5",children:[ec&&(0,s.jsxs)("section",{children:[(0,s.jsx)(D,{label:"Trigger Conditions"}),(0,s.jsx)("div",{className:"rounded-lg border border-border/40 bg-muted/[0.03] p-3.5",children:(0,s.jsx)("p",{className:"text-xs text-foreground/80 leading-relaxed whitespace-pre-wrap",children:ec})})]}),!ec&&!l&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground italic",children:d.noDescription}),(0,s.jsx)("section",{children:(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[!l&&r&&(0,s.jsx)($,{label:d.enabled,value:r.enabled?"✓":"—",tone:r.enabled?"ok":"muted"}),(0,s.jsx)($,{label:d.capability,value:ea}),(0,s.jsx)($,{label:d.source,value:ed}),(0,s.jsx)($,{label:d.agents,value:String(i.length)})]})}),(0,s.jsxs)("section",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)(D,{label:d.agents,noMargin:!0}),L&&ep.length>0&&(0,s.jsxs)("button",{type:"button",onClick:()=>X(!Y),className:"inline-flex items-center gap-1 text-2xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity cursor-pointer",children:[(0,s.jsx)(m.A,{size:12}),(0,s.jsx)("span",{children:"Add"})]})]}),Y&&ep.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-2 p-2 rounded-lg border border-dashed border-[var(--amber)]/30 bg-[var(--amber)]/[0.03]",children:ep.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>{L?.(t,e),X(!1)},className:"inline-flex items-center gap-1 px-2 py-1 text-2xs rounded-md border border-border bg-card hover:bg-muted cursor-pointer transition-colors",children:[(0,s.jsx)(m.A,{size:10,className:"text-[var(--amber)]"}),(0,s.jsx)("span",{className:"text-foreground/80",children:e})]},e))}),i.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(e=>(0,s.jsx)(k.lx,{name:e,size:"sm",onRemove:E?()=>E(t,e):void 0},e))}):(0,s.jsx)("div",{className:"rounded-lg border border-border/40 bg-card/30 p-3 text-center",children:(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:d.noAgents})})]}),(null!==F||R||J)&&(0,s.jsxs)("section",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)(D,{label:"Instructions",noMargin:!0}),(0,s.jsx)("div",{className:"flex items-center gap-2",children:F&&(0,s.jsxs)("button",{type:"button",onClick:es,className:"inline-flex items-center gap-1 text-2xs text-muted-foreground hover:text-foreground cursor-pointer transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded px-1.5 py-0.5","aria-label":d.copyContent,children:[(0,s.jsx)(p.A,{size:11}),d.copyContent]})})]}),R&&(0,s.jsxs)("div",{className:"rounded-lg border border-border bg-background p-6 flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[(0,s.jsx)(x.A,{size:14,className:"animate-spin"}),d.loading]}),J&&(0,s.jsxs)("div",{className:"rounded-lg border border-destructive/20 bg-destructive/[0.03] p-4 text-center space-y-2",children:[(0,s.jsx)("p",{className:"text-sm text-destructive",children:d.loadFailed}),(0,s.jsx)("button",{type:"button",onClick:er,className:"text-xs text-foreground underline hover:no-underline cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",children:d.retry})]}),em&&!R&&!J&&(0,s.jsx)("div",{className:`rounded-lg border border-border/50 bg-muted/[0.02] p-4 overflow-hidden transition-all duration-200 ${!ee?"max-h-60":""}`,children:(0,s.jsx)(w,{text:em.instructions})}),em&&!R&&!J&&em.instructions.split("\n").length>15&&(0,s.jsxs)("button",{type:"button",onClick:()=>et(!ee),className:"inline-flex items-center gap-1 mt-2 text-2xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity cursor-pointer",children:[(0,s.jsx)(g.A,{size:12,className:`transition-transform duration-200 ${ee?"rotate-180":""}`}),(0,s.jsx)("span",{children:ee?"Collapse":"View All"})]})]}),eu&&(0,s.jsxs)("section",{children:[(0,s.jsx)(D,{label:d.path}),(0,s.jsx)("div",{className:"rounded-lg border border-border/50 bg-muted/[0.03] p-3",children:(0,s.jsx)("code",{className:"text-2xs text-foreground/60 font-mono break-all leading-relaxed",children:eu})})]}),G&&(0,s.jsx)("div",{role:"status","aria-live":"polite",className:"rounded-md border border-border bg-muted/50 px-3 py-2 text-xs text-muted-foreground animate-in fade-in duration-200",children:G})]}),!l&&r&&(0,s.jsxs)("div",{className:"shrink-0 border-t border-border px-5 py-3 flex items-center gap-2",children:[S&&(0,s.jsxs)("div",{className:"flex items-center gap-2 mr-auto",children:[(0,s.jsx)(f.A,{size:14,className:"text-muted-foreground","aria-hidden":"true"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:r.enabled?d.enabled:d.disabled}),(0,s.jsx)(y.lM,{size:"sm",checked:r.enabled,onChange:e=>void en(e),disabled:V})]}),eo&&T&&(0,s.jsxs)("button",{type:"button",onClick:()=>B(!0),disabled:I,className:"inline-flex items-center gap-1.5 px-2.5 min-h-[32px] text-xs rounded-md border border-destructive/30 text-destructive hover:bg-destructive/10 cursor-pointer disabled:opacity-50 transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[I?(0,s.jsx)(x.A,{size:12,className:"animate-spin"}):(0,s.jsx)(b.A,{size:12}),d.deleteSkill]})]})]}),(0,s.jsx)(k.TM,{open:_,title:d.confirmDeleteTitle,message:t?d.confirmDeleteMessage(t):"",confirmLabel:d.confirmDeleteAction,cancelLabel:d.cancelAction,onConfirm:()=>void ei(),onCancel:()=>B(!1),variant:"destructive"})]})}function D({label:e,noMargin:t}){return(0,s.jsx)("h3",{className:`text-xs font-semibold text-muted-foreground uppercase tracking-wider ${t?"":"mb-2"}`,children:e})}function $({label:e,value:t,tone:r="default"}){return(0,s.jsxs)("div",{className:"rounded-xl border border-border/50 bg-muted/[0.03] px-3.5 py-3 hover:bg-muted/[0.06] transition-colors duration-100",children:[(0,s.jsx)("span",{className:"text-2xs text-muted-foreground/60 block mb-1 uppercase tracking-wider",children:e}),(0,s.jsx)("span",{className:`text-sm font-semibold capitalize ${"ok"===r?"text-[var(--success)]":"muted"===r?"text-muted-foreground":"text-foreground"}`,children:t})]})}},51117:(e,t,r)=>{r.d(t,{V:()=>n});var s=r(44223);function n(){let[e,t]=(0,s.useState)([]),[r,n]=(0,s.useState)(!1),[i,a]=(0,s.useState)(null),l=(0,s.useCallback)(async e=>{n(!0),a(null);try{let r=await fetch("/api/a2a/discover",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})}),s=await r.json();if(s.agent)return t(e=>e.some(e=>e.id===s.agent.id)?e.map(e=>e.id===s.agent.id?s.agent:e):[...e,s.agent]),s.agent;return a(s.error||"Discovery failed"),null}catch(e){return a(e.message),null}finally{n(!1)}},[]);return{agents:e,discovering:r,error:i,discover:l,remove:(0,s.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),refresh:(0,s.useCallback)(()=>{t([]),a(null)},[])}}},82829:(e,t,r)=>{r.d(t,{A:()=>h});var s=r(66839),n=r(44223),i=r(72799),a=r(21082),l=r(38688),o=r(53097),d=r(30626),c=r(29696),u=r(72615),m=r(98327),p=r(44361),x=r(2073),g=r(84747),f=r(79455),b=r(69527);function h({open:e,onClose:t,onSuccess:r,existingAgents:h,editAgent:j}){let{t:y}=(0,x.Y)(),N=y.agentsContent.overview,k=(0,n.useRef)(null),C=(0,n.useRef)(null),A=!!j,[w,S]=(0,n.useState)("input"),[D,$]=(0,n.useState)(!1),[T,z]=(0,n.useState)(!1),[L,E]=(0,n.useState)(null),[K,P]=(0,n.useState)(null),[F,M]=(0,n.useState)(!1),[O,W]=(0,n.useState)(!1),[R,q]=(0,n.useState)({name:"",baseDir:"",global:"",configKey:"mcpServers",format:"json",preferredTransport:"stdio",project:"",presenceCli:"",skillDir:""});(0,n.useEffect)(()=>{e&&(j?(q({name:j.name,baseDir:j.customBaseDir||"",global:j.globalPath||"",configKey:j.configKey||"mcpServers",format:"toml"===j.format?"toml":"json",preferredTransport:j.preferredTransport||"stdio",project:j.projectPath||"",presenceCli:"",skillDir:j.skillWorkspacePath||""}),S("result"),W(!0),P(null),E(null)):(q({name:"",baseDir:"",global:"",configKey:"mcpServers",format:"json",preferredTransport:"stdio",project:"",presenceCli:"",skillDir:""}),S("input"),W(!1),P(null),E(null),M(!1)))},[e,j]),(0,n.useEffect)(()=>{e&&"input"===w&&setTimeout(()=>C.current?.focus(),100)},[e,w]),(0,g.r)(k,e),(0,n.useEffect)(()=>{if(!e)return;let r=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t]);let J=(0,n.useMemo)(()=>{let e=new Set(h.map(e=>e.key));return A&&j&&e.delete(j.key),e},[h,A,j]),H=(0,n.useMemo)(()=>R.name.toLowerCase().replace(/[^\x20-\x7E]/g,"").replace(/[_\s]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-{2,}/g,"-").replace(/^-|-$/g,""),[R.name]),_=(0,n.useMemo)(()=>{if(A||!R.name.trim())return null;let e=H||"";if(!e)return null;if(J.has(e)){let t=h.find(t=>t.key===e);return t?.isCustom?N.customAgentKeyConflict?.(e)??`An agent with key "${e}" already exists`:N.customAgentBuiltinConflict?.(t?.name||e)??`Conflicts with built-in agent "${t?.name||e}"`}return null},[A,H,J,h,R.name,N]),B=R.name.trim()&&R.baseDir.trim()&&!_,I=(0,n.useCallback)((e,t)=>{q(r=>({...r,[e]:t}))},[]),U=(0,n.useCallback)(async()=>{if(!B)return;E(null),$(!0);let e=R.baseDir.trim();if(!e.startsWith("~/")){let t=e.endsWith("/")?e:e+"/";I("global",t+"mcp.json"),I("skillDir",t+"skills/"),P({exists:!1,hasSkillsDir:!1}),S("result"),$(!1);return}let t=new AbortController,r=setTimeout(()=>t.abort(),3e3);try{let s=await fetch("/api/agents/custom/detect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseDir:e}),signal:t.signal});clearTimeout(r);let n=await s.json();if(!s.ok)return void E(n.error||N.customAgentFailedSave);P(n),n.detectedConfig?I("global",n.detectedConfig):I("global",(e.endsWith("/")?e:e+"/")+"mcp.json"),n.detectedFormat&&I("format",n.detectedFormat),n.detectedConfigKey&&I("configKey",n.detectedConfigKey),I("skillDir",n.detectedSkillDir||(e.endsWith("/")?e:e+"/")+"skills/"),S("result")}catch{clearTimeout(r);let t=e.endsWith("/")?e:e+"/";I("global",t+"mcp.json"),I("skillDir",t+"skills/"),P({exists:!1,hasSkillsDir:!1}),M(!0),S("result")}finally{$(!1)}},[B,R.baseDir,I,N]),G=(0,n.useCallback)(async()=>{z(!0),E(null);let e=A?{key:j.key,name:R.name.trim(),baseDir:R.baseDir.trim(),global:R.global.trim()||void 0,configKey:R.configKey.trim()||void 0,format:R.format,preferredTransport:R.preferredTransport,project:R.project.trim()||null,presenceCli:R.presenceCli.trim()||void 0,skillDir:R.skillDir.trim()||void 0}:{name:R.name.trim(),baseDir:R.baseDir.trim(),global:R.global.trim()||void 0,configKey:R.configKey.trim()||void 0,format:R.format,preferredTransport:R.preferredTransport,project:R.project.trim()||null,presenceCli:R.presenceCli.trim()||void 0,skillDir:R.skillDir.trim()||void 0};try{let s=await fetch("/api/agents/custom",{method:A?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await s.json();if(!s.ok){E(n.error||N.customAgentFailedSave),z(!1);return}let i=A?N.customAgentUpdated(R.name.trim()):N.customAgentAdded(R.name.trim());f.oR.success(i),r(),t()}catch{E(N.customAgentNetworkError)}finally{z(!1)}},[A,j,R,r,t,N]),Q=(0,n.useCallback)(e=>{"Enter"===e.key&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)&&(e.preventDefault(),"input"===w&&B&&!D?U():"result"!==w||T||G())},[w,B,D,T,U,G]);if(!e)return null;let V=A?N.editCustomAgentTitle(j.name):N.addCustomAgentTitle;return(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",role:"dialog","aria-modal":"true","aria-labelledby":"custom-agent-modal-title",children:[(0,s.jsx)("div",{className:"absolute inset-0 modal-backdrop",onClick:t,"aria-hidden":"true"}),(0,s.jsxs)("div",{ref:k,className:"relative bg-card border border-border rounded-xl shadow-2xl max-w-md w-full mx-4 animate-in fade-in zoom-in-95 duration-200 max-h-[85vh] overflow-y-auto",onKeyDown:Q,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-5 pt-5 pb-1",children:[(0,s.jsx)("h2",{id:"custom-agent-modal-title",className:"text-base font-semibold text-foreground",children:V}),(0,s.jsx)("button",{type:"button",onClick:t,className:"w-7 h-7 rounded-md flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted transition-colors duration-150 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Close",children:(0,s.jsx)(i.A,{size:16})})]}),(0,s.jsxs)("div",{className:"px-5 py-4 space-y-4",children:[(0,s.jsxs)(b.D0,{label:N.customAgentName,children:[(0,s.jsx)("input",{ref:C,value:R.name,onChange:e=>I("name",e.target.value),placeholder:N.customAgentNamePlaceholder,"aria-invalid":!!_,className:`w-full px-3 py-2 text-sm bg-background border rounded-lg text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 ${_?"border-[var(--error)] focus-visible:ring-[var(--error)]":"border-border"}`,autoComplete:"off"}),_?(0,s.jsxs)("p",{className:"text-xs text-[var(--error)] mt-1 flex items-center gap-1",children:[(0,s.jsx)(a.A,{size:12}),_]}):R.name.trim()&&H?(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:N.customAgentKeyPreview(H)}):null]}),(0,s.jsxs)(b.D0,{label:N.customAgentDir,hint:"input"===w?N.customAgentDirHint:void 0,children:[(0,s.jsx)(b.pd,{value:R.baseDir,onChange:e=>{I("baseDir",e.target.value),"result"===w&&(S("input"),P(null))},placeholder:N.customAgentDirPlaceholder,autoComplete:"off"}),"result"===w&&K?.exists&&(0,s.jsxs)("p",{className:"text-xs text-[var(--success)] mt-1 flex items-center gap-1",children:[(0,s.jsx)(l.A,{size:12}),N.customAgentDirFound]}),"result"===w&&K&&!K.exists&&!F&&(0,s.jsxs)("p",{className:"text-xs text-[var(--info,var(--muted-foreground))] mt-1 flex items-center gap-1",children:[(0,s.jsx)(o.A,{size:12}),N.customAgentDirNotFound]}),"result"===w&&F&&(0,s.jsxs)("p",{className:"text-xs text-[var(--amber)] mt-1 flex items-center gap-1",children:[(0,s.jsx)(a.A,{size:12}),N.customAgentDetectTimeout]})]}),"result"===w&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:`rounded-lg p-4 space-y-3 ${K?.exists?"border border-[var(--success)]/20 bg-[var(--success)]/5":"border border-border bg-muted/30"}`,children:[(0,s.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:K?.exists?N.customAgentDetectedTitle:N.customAgentDefaultTitle}),(0,s.jsxs)("div",{className:"space-y-2.5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground mb-1",children:N.customAgentConfigLabel}),(0,s.jsx)("span",{className:"text-sm text-foreground font-mono truncate block",children:R.global}),K?.mcpParseError&&(0,s.jsxs)("p",{className:"text-xs text-[var(--error)] mt-1 flex items-center gap-1",children:[(0,s.jsx)(a.A,{size:12,className:"shrink-0"}),K.mcpParseError]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground mb-1",children:N.customAgentFormatLabel}),(0,s.jsx)("span",{className:"text-sm text-foreground",children:R.format.toUpperCase()})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground mb-1",children:"Config Key"}),(0,s.jsx)("span",{className:"text-sm text-foreground font-mono",children:R.configKey})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground mb-1",children:N.customAgentTransportLabel}),(0,s.jsx)("span",{className:"text-sm text-foreground",children:R.preferredTransport})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-xs text-muted-foreground mb-1 flex items-center gap-1",children:[(0,s.jsx)(d.A,{size:11,className:"shrink-0","aria-hidden":"true"}),"MCP Servers"]}),K?.mcpServers&&K.mcpServers.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:K.mcpServers.map(e=>(0,s.jsx)("span",{className:"text-xs bg-muted/60 text-foreground px-2 py-0.5 rounded font-mono",children:e},e))}):(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:"—"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-xs text-muted-foreground mb-1 flex items-center gap-1",children:[(0,s.jsx)(c.A,{size:11,className:"shrink-0","aria-hidden":"true"}),N.customAgentSkillsLabel]}),K?.skillNames&&K.skillNames.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:K.skillNames.map(e=>(0,s.jsx)("span",{className:"text-xs bg-[var(--amber-dim)] text-[var(--amber-text,var(--foreground))] px-2 py-0.5 rounded font-mono",children:e},e))}):(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:"—"})]})]})]}),(0,s.jsxs)("button",{type:"button",onClick:()=>W(e=>!e),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors duration-150 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",children:[O?(0,s.jsx)(u.A,{size:14}):(0,s.jsx)(m.A,{size:14}),N.customAgentCustomize]}),(0,s.jsx)("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:O?"1fr":"0fr"},children:(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsxs)("div",{className:"rounded-xl border border-border/50 bg-card/50 p-5 space-y-4",children:[(0,s.jsx)(b.D0,{label:N.customAgentConfigPath,children:(0,s.jsx)(b.pd,{value:R.global,onChange:e=>I("global",e.target.value),autoComplete:"off"})}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsx)(b.D0,{label:N.customAgentConfigKey,children:(0,s.jsx)(b.pd,{value:R.configKey,onChange:e=>I("configKey",e.target.value),autoComplete:"off"})}),(0,s.jsx)(b.D0,{label:N.customAgentFormat,children:(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)(v,{label:"JSON",checked:"json"===R.format,onChange:()=>I("format","json"),name:"format"}),(0,s.jsx)(v,{label:"TOML",checked:"toml"===R.format,onChange:()=>I("format","toml"),name:"format"})]})})]}),(0,s.jsx)(b.D0,{label:N.customAgentTransport,children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(v,{label:"stdio",checked:"stdio"===R.preferredTransport,onChange:()=>I("preferredTransport","stdio"),name:"transport"}),(0,s.jsx)(v,{label:"http",checked:"http"===R.preferredTransport,onChange:()=>I("preferredTransport","http"),name:"transport"})]})}),(0,s.jsx)(b.D0,{label:N.customAgentSkillDir,hint:N.customAgentSkillDirHint,children:(0,s.jsx)(b.pd,{value:R.skillDir,onChange:e=>I("skillDir",e.target.value),placeholder:N.customAgentSkillDirPlaceholder,autoComplete:"off"})}),(0,s.jsx)(b.D0,{label:N.customAgentProjectConfig,children:(0,s.jsx)(b.pd,{value:R.project,onChange:e=>I("project",e.target.value),autoComplete:"off"})}),(0,s.jsx)(b.D0,{label:N.customAgentCliBinary,children:(0,s.jsx)(b.pd,{value:R.presenceCli,onChange:e=>I("presenceCli",e.target.value),placeholder:N.customAgentCliBinaryPlaceholder,autoComplete:"off"})})]})})})]}),L&&(0,s.jsxs)("div",{className:"rounded-lg border border-[var(--error)]/30 bg-[var(--error)]/5 p-3 flex items-start gap-2",children:[(0,s.jsx)(a.A,{size:14,className:"text-[var(--error)] mt-0.5 shrink-0"}),(0,s.jsx)("p",{className:"text-sm text-[var(--error)]",children:L})]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 px-5 pb-5 pt-1",children:[(0,s.jsx)("button",{type:"button",onClick:t,className:"px-4 min-h-[36px] text-sm rounded-lg border border-border hover:bg-muted cursor-pointer transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:N.customAgentCancel}),"input"===w?(0,s.jsx)("button",{type:"button",onClick:U,disabled:!B||D,className:"px-4 min-h-[36px] text-sm rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] hover:bg-[var(--amber)]/90 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring flex items-center gap-2",children:D?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p.A,{size:14,className:"animate-spin"}),N.customAgentDetecting]}):(0,s.jsxs)(s.Fragment,{children:[N.customAgentContinue,(0,s.jsx)(m.A,{size:14})]})}):(0,s.jsx)("button",{type:"button",onClick:G,disabled:T,className:"px-4 min-h-[36px] text-sm rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] hover:bg-[var(--amber)]/90 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring flex items-center gap-2",children:T?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p.A,{size:14,className:"animate-spin"}),A?N.customAgentSaving:N.customAgentAdding]}):L?N.customAgentRetry:A?N.customAgentSave:N.customAgentAdd})]})]})]})}function v({label:e,checked:t,onChange:r,name:n}){return(0,s.jsxs)("label",{className:`px-3 py-1.5 text-sm rounded-md border cursor-pointer transition-all duration-150 select-none ${t?"border-[var(--amber)]/40 bg-[var(--amber-dim)] text-foreground font-medium":"border-border bg-background text-muted-foreground hover:bg-muted"}`,children:[(0,s.jsx)("input",{type:"radio",name:n,checked:t,onChange:r,className:"sr-only"}),e]})}},82977:(e,t,r)=>{r.d(t,{Gj:()=>i,ZD:()=>n,v7:()=>a});let s={"&":"&","<":"<",">":">",'"':""","'":"'"};function n(e){return e.replace(/[&<>"']/g,e=>s[e])}function i(e){return n(e).replace(/`/g,"`")}function a(e){let t=e.replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").trim(),r=t.replace(/[\u0000-\u001f\u007f\s]+/g,"").toLowerCase();return r.startsWith("http://")||r.startsWith("https://")||r.startsWith("mailto:")||t.startsWith("/")&&!t.startsWith("//")||t.startsWith("#")?i(t):"#"}}}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7166],{3824:(e,t,n)=>{n.d(t,{A:()=>c});var s=n(66839),r=n(44223),a=n(53454),i=n(76723),o=n(72615);function l(e){return"options"in e}function c({value:e,onChange:t,options:n,className:c="",size:d="md",placeholder:u}){let[m,p]=(0,r.useState)(!1),[f,h]=(0,r.useState)(-1),[x,g]=(0,r.useState)(null),v=(0,r.useRef)(null),b=(0,r.useRef)(null),y=(0,r.useMemo)(()=>(function(e){let t=[];for(let n of e)l(n)?t.push(...n.options):t.push(n);return t})(n),[n]),j=(0,r.useMemo)(()=>y.find(t=>t.value===e)??null,[y,e]),w=(0,r.useCallback)(()=>{p(!1),h(-1)},[]),N=(0,r.useCallback)(e=>{t(e),w()},[t,w]);(0,r.useEffect)(()=>{if(!m)return;let e=e=>{v.current&&!v.current.contains(e.target)&&b.current&&!b.current.contains(e.target)&&w()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[m,w]),(0,r.useEffect)(()=>{if(!m)return;let e=e=>{switch(e.key){case"Escape":e.preventDefault(),w(),v.current?.focus();break;case"ArrowDown":e.preventDefault(),h(e=>Math.min(e+1,y.length-1));break;case"ArrowUp":e.preventDefault(),h(e=>Math.max(e-1,0));break;case"Enter":e.preventDefault(),f>=0&&f<y.length&&(N(y[f].value),v.current?.focus())}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[m,w,f,y,N]),(0,r.useEffect)(()=>{if(!m||!b.current||f<0)return;let e=b.current.querySelector(`[data-idx="${f}"]`);e&&e.scrollIntoView({block:"nearest"})},[m,f]);let k=(0,r.useCallback)(()=>{if(!v.current)return;let e=v.current.getBoundingClientRect(),t="sm"===d?200:260,n=window.innerHeight-e.bottom,s=e.top;g({top:n<t+8&&s>n?e.top:e.bottom,left:e.left,width:e.width,flipUp:n<t+8&&s>n})},[d]);(0,r.useEffect)(()=>{if(!m)return void g(null);let t=y.findIndex(t=>t.value===e);return h(t>=0?t:0),k(),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[m,y,e,k]);let S="sm"===d,T=S?`inline-flex items-center gap-1 appearance-none rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-2xs px-1.5 py-0.5 pr-5 ${c}`:`w-full flex items-center gap-2 appearance-none rounded-lg border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-sm px-3 py-2 pr-8 ${c}`,C=S?"w-full flex items-center gap-1.5 px-2 py-1 text-2xs text-left transition-colors cursor-pointer":"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left transition-colors cursor-pointer",A=-1;function E(t){let n=++A,r=t.value===e,a=n===f;return(0,s.jsxs)("button",{type:"button",role:"option","aria-selected":r,"data-idx":n,onClick:()=>N(t.value),onMouseEnter:()=>h(n),className:`${C} ${a?"bg-muted text-foreground":"text-foreground"}`,children:[t.icon,(0,s.jsx)("span",{className:"flex-1 truncate",children:t.label}),t.suffix,r&&(0,s.jsx)(i.A,{size:S?10:12,className:"shrink-0 text-[var(--amber)]"})]},t.value)}let R=m&&x&&(0,a.createPortal)((0,s.jsx)("div",{ref:b,className:S?"fixed z-50 overflow-y-auto rounded-md border border-border bg-card shadow-lg py-0.5":"fixed z-50 overflow-y-auto rounded-lg border border-border bg-card shadow-lg py-1",role:"listbox",style:{left:x.left,minWidth:x.width,maxHeight:S?200:260,...x.flipUp?{bottom:window.innerHeight-x.top+4}:{top:x.top+4}},children:n.map((e,t)=>l(e)?(0,s.jsxs)("div",{children:[t>0&&(0,s.jsx)("div",{className:"my-0.5 border-t border-border/50"}),(0,s.jsx)("div",{className:`py-1 text-2xs font-medium text-muted-foreground uppercase tracking-wider ${S?"px-2":"px-3"}`,children:e.label}),e.options.map(E)]},e.label):E(e))}),document.body);return(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)("button",{ref:v,type:"button",onClick:()=>p(e=>!e),"aria-haspopup":"listbox","aria-expanded":m,className:T,children:[j?.icon,(0,s.jsx)("span",{className:"flex-1 truncate text-left",children:j?.label??u??"—"}),j?.suffix,(0,s.jsx)(o.A,{size:S?12:14,className:`${S?"absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none":"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"} transition-transform duration-150 ${m?"rotate-180":""}`})]}),R]})}},7380:(e,t,n)=>{n.d(t,{i:()=>r});var s=n(65799);let r=(0,s.createServerReference)("400ebcf1e8d43496a5778ff1afe5c194bc247d9ba0",s.callServer,void 0,s.findSourceMapURL,"deleteFileAction")},27069:(e,t,n)=>{n.d(t,{Z:()=>h});var s=n(44223);let r="mindos-pinned-files",a="mindos:pins-changed";function i(){try{let e=localStorage.getItem(r);return e?JSON.parse(e):[]}catch{return[]}}function o(){return d}let l=[];function c(){return l}let d=[],u=!1;function m(){u||(d=i(),u=!0)}function p(e){m();let t=t=>{t.key===r&&(d=i(),e())},n=()=>{d=i(),e()};return window.addEventListener("storage",t),window.addEventListener(a,n),()=>{window.removeEventListener("storage",t),window.removeEventListener(a,n)}}function f(e){d=e;try{localStorage.setItem(r,JSON.stringify(e))}catch{}window.dispatchEvent(new Event(a))}function h(){m();let e=(0,s.useSyncExternalStore)(p,o,c),t=(0,s.useCallback)(t=>e.includes(t),[e]),n=(0,s.useCallback)(e=>{let t=i(),n=t.indexOf(e);n>=0?t.splice(n,1):t.unshift(e),f(t)},[]);return{pinnedFiles:e,isPinned:t,togglePin:n,reorderPins:(0,s.useCallback)(e=>{f(e)},[]),removePin:(0,s.useCallback)(e=>{f(i().filter(t=>t!==e))},[])}}},34018:(e,t,n)=>{n.d(t,{Ay:()=>en,Fo:()=>O,gL:()=>P});var s=n(66839),r=n(44223),a=n(56261),i=n(62329),o=n(58221),l=n(18659),c=n(30401),d=n(44361),u=n(72615),m=n(95991),p=n(14987),f=n(27636),h=n(61017),x=n(52954),g=n(82417),v=n(24336),b=n(2408),y=n(31606),j=n(65799);let w=(0,j.createServerReference)("60e5699b5cd0f8f2a4a05630976a3ede4aa9d2ab4d",j.callServer,void 0,j.findSourceMapURL,"createFileAction"),N=(0,j.createServerReference)("60a11cf9a8e8f10619c0c8005ca86d9cd70830bf2d",j.callServer,void 0,j.findSourceMapURL,"renameSpaceAction");var k=n(84387);let S=(0,j.createServerReference)("404763ea7f1ddd0f904df938ca14643d4829a33381",j.callServer,void 0,j.findSourceMapURL,"deleteSpaceAction"),T=(0,j.createServerReference)("40859914f34fd046848c974a131dacb25ab21892d5",j.callServer,void 0,j.findSourceMapURL,"deleteFolderAction");var C=n(55873),A=n(7380),E=n(79455),R=n(2073),z=n(84734),L=n(27069);let $="show-hidden-files";function D(e){let t=t=>{t.key===$&&e()},n=()=>e();return window.addEventListener("storage",t),window.addEventListener("mindos:hidden-files-changed",n),()=>{window.removeEventListener("storage",t),window.removeEventListener("mindos:hidden-files-changed",n)}}function F(){return"true"===localStorage.getItem($)}function O(e){localStorage.setItem($,String(e)),window.dispatchEvent(new Event("mindos:hidden-files-changed"))}function P(){return(0,r.useSyncExternalStore)(D,F,()=>!1)}var I=n(73601),M=n(85764),U=n(10952);let W=(0,j.createServerReference)("400f0c1508e53e896444a6f7ef4132583484d1f0df",j.callServer,void 0,j.findSourceMapURL,"convertToSpaceAction");var H=n(62800);async function J(e){try{await navigator.clipboard.writeText(e)}catch{}}let B="w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",_="w-full flex items-center gap-2 px-3 py-2 text-sm text-error hover:bg-error/10 transition-colors text-left",Y="my-1 border-t border-border/50";function G({x:e,y:t,onClose:n,menuHeight:a,children:i}){let o=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=e=>{o.current&&!o.current.contains(e.target)&&n()},t=e=>{"Escape"===e.key&&n()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[n]);let l=Math.min(t,window.innerHeight-(a??160)),c=Math.min(e,window.innerWidth-200);return(0,s.jsx)("div",{ref:o,className:"fixed z-50 min-w-[180px] bg-card border border-border rounded-lg shadow-lg py-1",style:{top:l,left:c},children:i})}function K({x:e,y:t,node:n,onClose:r,onRename:i,onNewFile:l,onImport:c,onDelete:d}){let u=(0,a.useRouter)(),{t:m}=(0,R.Y)(),{isPinned:p,togglePin:f}=(0,L.Z)(),h=p(n.path);return(0,s.jsxs)(G,{x:e,y:t,onClose:r,children:[(0,s.jsxs)("button",{className:B,onClick:()=>{l(),r()},children:[(0,s.jsx)(I.A,{size:14,className:"shrink-0"})," ",m.fileTree.newFile]}),(0,s.jsxs)("button",{className:B,onClick:()=>{u.push(`/view/${(0,o.O0)(`${n.path}/INSTRUCTION.md`)}`),r()},children:[(0,s.jsx)(M.A,{size:14,className:"shrink-0"})," ",m.fileTree.viewRules]}),c&&(0,s.jsxs)("button",{className:B,onClick:()=>{c(n.path),r()},children:[(0,s.jsx)(U.A,{size:14,className:"shrink-0"})," ",m.fileTree.importFile]}),(0,s.jsx)("div",{className:Y}),(0,s.jsxs)("button",{className:B,onClick:()=>{f(n.path),r()},children:[(0,s.jsx)(g.A,{size:14,className:`shrink-0 ${h?"fill-[var(--amber)] text-[var(--amber)]":""}`}),h?m.fileTree.removeFromFavorites:m.fileTree.pinToFavorites]}),(0,s.jsxs)("button",{className:B,onClick:()=>{J(n.path),r()},children:[(0,s.jsx)(v.A,{size:14,className:"shrink-0"})," ",m.fileTree.copyPath]}),(0,s.jsxs)("button",{className:B,onClick:()=>{i(),r()},children:[(0,s.jsx)(b.A,{size:14,className:"shrink-0"})," ",m.fileTree.renameSpace]}),(0,s.jsx)("div",{className:Y}),(0,s.jsxs)("button",{className:_,onClick:()=>{r(),d()},children:[(0,s.jsx)(y.A,{size:14,className:"shrink-0"}),m.fileTree.deleteSpace]})]})}function V({x:e,y:t,node:n,onClose:i,onRename:o,onNewFile:l,onDelete:c}){let d=(0,a.useRouter)(),{t:u}=(0,R.Y)(),[m,f]=(0,r.useTransition)(),{isPinned:h,togglePin:x}=(0,L.Z)(),j=h(n.path);return(0,s.jsxs)(G,{x:e,y:t,onClose:i,menuHeight:220,children:[(0,s.jsxs)("button",{className:B,onClick:()=>{l(),i()},children:[(0,s.jsx)(I.A,{size:14,className:"shrink-0"})," ",u.fileTree.newFile]}),(0,s.jsx)("div",{className:Y}),(0,s.jsxs)("button",{className:B,onClick:()=>{x(n.path),i()},children:[(0,s.jsx)(g.A,{size:14,className:`shrink-0 ${j?"fill-[var(--amber)] text-[var(--amber)]":""}`}),j?u.fileTree.removeFromFavorites:u.fileTree.pinToFavorites]}),(0,s.jsxs)("button",{className:B,disabled:m,onClick:()=>{f(async()=>{if((await W(n.path)).success){d.refresh(),window.dispatchEvent(new Event("mindos:files-changed"));let e=n.name.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||n.name;(0,H.wD)().then(t=>{t&&(0,H.Vz)(e,n.path)})}i()})},children:[(0,s.jsx)(p.A,{size:14,className:"shrink-0 text-[var(--amber)]"})," ",u.fileTree.convertToSpace]}),(0,s.jsxs)("button",{className:B,onClick:()=>{J(n.path),i()},children:[(0,s.jsx)(v.A,{size:14,className:"shrink-0"})," ",u.fileTree.copyPath]}),(0,s.jsxs)("button",{className:B,onClick:()=>{o(),i()},children:[(0,s.jsx)(b.A,{size:14,className:"shrink-0"})," ",u.fileTree.rename]}),(0,s.jsx)("div",{className:Y}),(0,s.jsxs)("button",{className:_,onClick:()=>{i(),c()},children:[(0,s.jsx)(y.A,{size:14,className:"shrink-0"}),u.fileTree.deleteFolder]})]})}var Z=n(72466);function q(){window.dispatchEvent(new Event("mindos:files-changed"))}async function Q(e){try{await navigator.clipboard.writeText(e)}catch{}}function X({dirPath:e,depth:t,onDone:n}){let[i,l]=(0,r.useState)(""),[c,u]=(0,r.useTransition)(),[m,p]=(0,r.useState)(""),f=(0,a.useRouter)(),{t:h}=(0,R.Y)(),x=(0,r.useRef)(null),g=(0,r.useCallback)(()=>{let t=i.trim();t?u(async()=>{let s=await w(e,t);s.success&&s.filePath?(n(),f.push(`/view/${(0,o.O0)(s.filePath)}`),f.refresh(),q()):p(s.error||h.fileTree.failed)}):p(h.fileTree.enterFileName)},[i,e,n,f,h]);return(0,r.useEffect)(()=>{let e=e=>{x.current&&!x.current.contains(e.target)&&n()},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[n]),(0,s.jsxs)("div",{ref:x,className:"px-2 pb-1",style:{paddingLeft:`${12*t+20}px`},children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("input",{autoFocus:!0,type:"text",value:i,onChange:e=>{l(e.target.value),p("")},onKeyDown:e=>{"Enter"===e.key&&g(),"Escape"===e.key&&n()},placeholder:"filename.md",className:" flex-1 bg-muted border border-border rounded px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring "}),c?(0,s.jsx)(d.A,{size:13,className:"text-muted-foreground animate-spin shrink-0"}):(0,s.jsx)("button",{onClick:g,className:"text-xs text-[var(--amber)] hover:text-foreground shrink-0 px-1",children:h.fileTree.create})]}),m&&(0,s.jsx)("p",{className:"text-xs text-error mt-0.5 px-1",children:m})]})}let ee=(0,r.memo)(function({node:e,depth:t,currentPath:n,onNavigate:l,maxOpenDepth:c,onImport:g}){let v=(0,a.useRouter)(),b=n.startsWith(e.path+"/")||n===e.path,y=!!e.isSpace,[j,w]=(0,r.useState)(0===t||b),[A,L]=(0,r.useState)(0===t||b),[$,D]=(0,r.useState)(!1),[F,O]=(0,r.useState)(!1),[P,I]=(0,r.useState)(e.name),[M,U]=(0,r.useTransition)(),W=(0,r.useRef)(null),H=(0,r.useRef)(null),[J,B]=(0,r.useState)(null),{t:_}=(0,R.Y)(),[Y,G]=(0,r.useState)(null),[Q,ee]=(0,r.useTransition)(),{isDragTarget:et,handleRowDragOver:es,handleRowDragEnter:er,handleRowDragLeave:ea,handleRowDrop:ei}=function(e,t,n,s){let[a,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),l=(0,r.useRef)(null),c=(0,r.useCallback)(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]),d=(0,r.useCallback)(e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy",l.current&&(clearTimeout(l.current),l.current=null),a||i(!0))},[a]),u=(0,r.useCallback)(e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.stopPropagation(),i(!0),c(),t||(o.current=setTimeout(()=>{n(!0),o.current=null},500)))},[t,c,n]),m=(0,r.useCallback)(e=>{e.dataTransfer.types.includes("Files")&&(e.stopPropagation(),l.current=setTimeout(()=>{i(!1),c(),l.current=null},50))},[c]),p=(0,r.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),i(!1),c(),l.current&&(clearTimeout(l.current),l.current=null);let n=t.dataTransfer.files;n.length>0&&(0,Z.Nh)(Array.from(n),e.path,s)},[e.path,s,c]);return(0,r.useEffect)(()=>()=>{o.current&&clearTimeout(o.current),l.current&&clearTimeout(l.current)},[]),{isDragTarget:a,handleRowDragOver:d,handleRowDragEnter:u,handleRowDragLeave:m,handleRowDrop:p}}(e,j,(0,r.useCallback)(e=>{w(e),e&&L(!0)},[]),_),eo=(0,r.useCallback)(()=>{w(e=>(e||L(!0),!e))},[]),el=(0,r.useRef)(void 0);(0,r.useEffect)(()=>{if(null==c){el.current=c;return}if(el.current!==c){if(null===el.current||void 0===el.current)t>c?w(!1):L(!0);else{let e=t<=c;w(e),e&&L(!0)}el.current=c}},[c,t]),(0,r.useEffect)(()=>()=>{H.current&&clearTimeout(H.current)},[]);let ec=(0,r.useCallback)(t=>{t?.preventDefault(),t?.stopPropagation(),H.current&&(clearTimeout(H.current),H.current=null),I(e.name),O(!0),setTimeout(()=>W.current?.select(),0)},[e.name]),ed=(0,r.useCallback)(()=>{let t=P.trim();t&&t!==e.name?U(async()=>{let n=y?N:k.f,s=await n(e.path,t);s.success&&s.newPath?(O(!1),v.push(`/view/${(0,o.O0)(s.newPath)}`),v.refresh(),q()):O(!1)}):O(!1)},[P,e.name,e.path,v,y]),eu=(0,r.useCallback)(()=>{F||(H.current&&clearTimeout(H.current),H.current=setTimeout(()=>{v.push(`/view/${(0,o.O0)(e.path)}`),l?.(),H.current=null},180))},[F,v,e.path,l]);(0,r.useCallback)(e=>{e.stopPropagation(),eo()},[eo]);let em=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),B({x:e.clientX,y:e.clientY})},[]),ep=y?function e(t){return"file"===t.type?+!i.C.has(t.name):(t.children??[]).reduce((t,n)=>t+e(n),0)}(e):0;if(F)return(0,s.jsxs)("div",{className:"relative px-2 py-0.5",style:{paddingLeft:`${12*t+8}px`},children:[(0,s.jsx)("input",{ref:W,autoFocus:!0,value:P,onChange:e=>I(e.target.value),onKeyDown:e=>{"Enter"===e.key&&ed(),"Escape"===e.key&&O(!1)},onBlur:ed,className:"w-full bg-muted border border-border rounded px-2 py-0.5 text-xs text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),M&&(0,s.jsx)(d.A,{size:12,className:"absolute right-3 top-1/2 -translate-y-1/2 animate-spin text-muted-foreground"})]});let ef=y&&0===t;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:`relative group/dir flex items-center transition-colors duration-100 ${et?"bg-[var(--amber)]/10 rounded-md":""}`,onContextMenu:em,onDragEnter:er,onDragOver:es,onDragLeave:ea,onDrop:ei,children:[(0,s.jsx)("button",{onClick:eo,className:"shrink-0 p-1 rounded hover:bg-muted text-muted-foreground transition-colors",style:{marginLeft:`${12*t+4}px`},"aria-label":j?`Collapse ${e.name}`:`Expand ${e.name}`,"aria-expanded":j,children:(0,s.jsx)("span",{className:"block transition-transform duration-150",style:{transform:j?"rotate(0deg)":"rotate(-90deg)"},children:(0,s.jsx)(u.A,{size:10})})}),(0,s.jsxs)("button",{type:"button",onClick:eu,draggable:!0,onDragStart:t=>{t.dataTransfer.setData("text/mindos-path",e.path),t.dataTransfer.setData("text/mindos-type","directory"),t.dataTransfer.effectAllowed="copy"},className:`
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1957],{1519:(e,t,n)=>{n.d(t,{i:()=>r});var s=n(65799);let r=(0,s.createServerReference)("40e2ca9d2648e651a5c54e347a9b0492a18ff76848",s.callServer,void 0,s.findSourceMapURL,"deleteFileAction")},3824:(e,t,n)=>{n.d(t,{A:()=>c});var s=n(66839),r=n(44223),a=n(53454),i=n(76723),o=n(72615);function l(e){return"options"in e}function c({value:e,onChange:t,options:n,className:c="",size:d="md",placeholder:u}){let[m,p]=(0,r.useState)(!1),[f,h]=(0,r.useState)(-1),[x,g]=(0,r.useState)(null),v=(0,r.useRef)(null),b=(0,r.useRef)(null),y=(0,r.useMemo)(()=>(function(e){let t=[];for(let n of e)l(n)?t.push(...n.options):t.push(n);return t})(n),[n]),j=(0,r.useMemo)(()=>y.find(t=>t.value===e)??null,[y,e]),w=(0,r.useCallback)(()=>{p(!1),h(-1)},[]),N=(0,r.useCallback)(e=>{t(e),w()},[t,w]);(0,r.useEffect)(()=>{if(!m)return;let e=e=>{v.current&&!v.current.contains(e.target)&&b.current&&!b.current.contains(e.target)&&w()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[m,w]),(0,r.useEffect)(()=>{if(!m)return;let e=e=>{switch(e.key){case"Escape":e.preventDefault(),w(),v.current?.focus();break;case"ArrowDown":e.preventDefault(),h(e=>Math.min(e+1,y.length-1));break;case"ArrowUp":e.preventDefault(),h(e=>Math.max(e-1,0));break;case"Enter":e.preventDefault(),f>=0&&f<y.length&&(N(y[f].value),v.current?.focus())}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[m,w,f,y,N]),(0,r.useEffect)(()=>{if(!m||!b.current||f<0)return;let e=b.current.querySelector(`[data-idx="${f}"]`);e&&e.scrollIntoView({block:"nearest"})},[m,f]);let k=(0,r.useCallback)(()=>{if(!v.current)return;let e=v.current.getBoundingClientRect(),t="sm"===d?200:260,n=window.innerHeight-e.bottom,s=e.top;g({top:n<t+8&&s>n?e.top:e.bottom,left:e.left,width:e.width,flipUp:n<t+8&&s>n})},[d]);(0,r.useEffect)(()=>{if(!m)return void g(null);let t=y.findIndex(t=>t.value===e);return h(t>=0?t:0),k(),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[m,y,e,k]);let S="sm"===d,T=S?`inline-flex items-center gap-1 appearance-none rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-2xs px-1.5 py-0.5 pr-5 ${c}`:`w-full flex items-center gap-2 appearance-none rounded-lg border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-sm px-3 py-2 pr-8 ${c}`,C=S?"w-full flex items-center gap-1.5 px-2 py-1 text-2xs text-left transition-colors cursor-pointer":"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left transition-colors cursor-pointer",A=-1;function E(t){let n=++A,r=t.value===e,a=n===f;return(0,s.jsxs)("button",{type:"button",role:"option","aria-selected":r,"data-idx":n,onClick:()=>N(t.value),onMouseEnter:()=>h(n),className:`${C} ${a?"bg-muted text-foreground":"text-foreground"}`,children:[t.icon,(0,s.jsx)("span",{className:"flex-1 truncate",children:t.label}),t.suffix,r&&(0,s.jsx)(i.A,{size:S?10:12,className:"shrink-0 text-[var(--amber)]"})]},t.value)}let R=m&&x&&(0,a.createPortal)((0,s.jsx)("div",{ref:b,className:S?"fixed z-50 overflow-y-auto rounded-md border border-border bg-card shadow-lg py-0.5":"fixed z-50 overflow-y-auto rounded-lg border border-border bg-card shadow-lg py-1",role:"listbox",style:{left:x.left,minWidth:x.width,maxHeight:S?200:260,...x.flipUp?{bottom:window.innerHeight-x.top+4}:{top:x.top+4}},children:n.map((e,t)=>l(e)?(0,s.jsxs)("div",{children:[t>0&&(0,s.jsx)("div",{className:"my-0.5 border-t border-border/50"}),(0,s.jsx)("div",{className:`py-1 text-2xs font-medium text-muted-foreground uppercase tracking-wider ${S?"px-2":"px-3"}`,children:e.label}),e.options.map(E)]},e.label):E(e))}),document.body);return(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)("button",{ref:v,type:"button",onClick:()=>p(e=>!e),"aria-haspopup":"listbox","aria-expanded":m,className:T,children:[j?.icon,(0,s.jsx)("span",{className:"flex-1 truncate text-left",children:j?.label??u??"—"}),j?.suffix,(0,s.jsx)(o.A,{size:S?12:14,className:`${S?"absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none":"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"} transition-transform duration-150 ${m?"rotate-180":""}`})]}),R]})}},10195:(e,t,n)=>{n.d(t,{Ay:()=>en,Fo:()=>O,gL:()=>P});var s=n(66839),r=n(44223),a=n(56261),i=n(62329),o=n(58221),l=n(18659),c=n(30401),d=n(44361),u=n(72615),m=n(95991),p=n(14987),f=n(27636),h=n(61017),x=n(52954),g=n(82417),v=n(24336),b=n(2408),y=n(31606),j=n(65799);let w=(0,j.createServerReference)("608fd4980cd7f4298a3e76fd2c5586fce30fa289ca",j.callServer,void 0,j.findSourceMapURL,"createFileAction"),N=(0,j.createServerReference)("60e4c68abffc34821afce94791c1ab1ee4f4a20180",j.callServer,void 0,j.findSourceMapURL,"renameSpaceAction");var k=n(21526);let S=(0,j.createServerReference)("404d62a282c94db4374b900d9955a5ad7686f4e72c",j.callServer,void 0,j.findSourceMapURL,"deleteSpaceAction"),T=(0,j.createServerReference)("40b9ad72b574386dd21cb39afe3882c0ce0f4b7360",j.callServer,void 0,j.findSourceMapURL,"deleteFolderAction");var C=n(82676),A=n(1519),E=n(79455),R=n(2073),z=n(84734),L=n(27069);let $="show-hidden-files";function D(e){let t=t=>{t.key===$&&e()},n=()=>e();return window.addEventListener("storage",t),window.addEventListener("mindos:hidden-files-changed",n),()=>{window.removeEventListener("storage",t),window.removeEventListener("mindos:hidden-files-changed",n)}}function F(){return"true"===localStorage.getItem($)}function O(e){localStorage.setItem($,String(e)),window.dispatchEvent(new Event("mindos:hidden-files-changed"))}function P(){return(0,r.useSyncExternalStore)(D,F,()=>!1)}var I=n(73601),M=n(85764),U=n(10952);let W=(0,j.createServerReference)("40e1e7e736101a574891edc51dc455461b895c8bba",j.callServer,void 0,j.findSourceMapURL,"convertToSpaceAction");var H=n(62800);async function J(e){try{await navigator.clipboard.writeText(e)}catch{}}let B="w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",_="w-full flex items-center gap-2 px-3 py-2 text-sm text-error hover:bg-error/10 transition-colors text-left",Y="my-1 border-t border-border/50";function G({x:e,y:t,onClose:n,menuHeight:a,children:i}){let o=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=e=>{o.current&&!o.current.contains(e.target)&&n()},t=e=>{"Escape"===e.key&&n()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[n]);let l=Math.min(t,window.innerHeight-(a??160)),c=Math.min(e,window.innerWidth-200);return(0,s.jsx)("div",{ref:o,className:"fixed z-50 min-w-[180px] bg-card border border-border rounded-lg shadow-lg py-1",style:{top:l,left:c},children:i})}function K({x:e,y:t,node:n,onClose:r,onRename:i,onNewFile:l,onImport:c,onDelete:d}){let u=(0,a.useRouter)(),{t:m}=(0,R.Y)(),{isPinned:p,togglePin:f}=(0,L.Z)(),h=p(n.path);return(0,s.jsxs)(G,{x:e,y:t,onClose:r,children:[(0,s.jsxs)("button",{className:B,onClick:()=>{l(),r()},children:[(0,s.jsx)(I.A,{size:14,className:"shrink-0"})," ",m.fileTree.newFile]}),(0,s.jsxs)("button",{className:B,onClick:()=>{u.push(`/view/${(0,o.O0)(`${n.path}/INSTRUCTION.md`)}`),r()},children:[(0,s.jsx)(M.A,{size:14,className:"shrink-0"})," ",m.fileTree.viewRules]}),c&&(0,s.jsxs)("button",{className:B,onClick:()=>{c(n.path),r()},children:[(0,s.jsx)(U.A,{size:14,className:"shrink-0"})," ",m.fileTree.importFile]}),(0,s.jsx)("div",{className:Y}),(0,s.jsxs)("button",{className:B,onClick:()=>{f(n.path),r()},children:[(0,s.jsx)(g.A,{size:14,className:`shrink-0 ${h?"fill-[var(--amber)] text-[var(--amber)]":""}`}),h?m.fileTree.removeFromFavorites:m.fileTree.pinToFavorites]}),(0,s.jsxs)("button",{className:B,onClick:()=>{J(n.path),r()},children:[(0,s.jsx)(v.A,{size:14,className:"shrink-0"})," ",m.fileTree.copyPath]}),(0,s.jsxs)("button",{className:B,onClick:()=>{i(),r()},children:[(0,s.jsx)(b.A,{size:14,className:"shrink-0"})," ",m.fileTree.renameSpace]}),(0,s.jsx)("div",{className:Y}),(0,s.jsxs)("button",{className:_,onClick:()=>{r(),d()},children:[(0,s.jsx)(y.A,{size:14,className:"shrink-0"}),m.fileTree.deleteSpace]})]})}function V({x:e,y:t,node:n,onClose:i,onRename:o,onNewFile:l,onDelete:c}){let d=(0,a.useRouter)(),{t:u}=(0,R.Y)(),[m,f]=(0,r.useTransition)(),{isPinned:h,togglePin:x}=(0,L.Z)(),j=h(n.path);return(0,s.jsxs)(G,{x:e,y:t,onClose:i,menuHeight:220,children:[(0,s.jsxs)("button",{className:B,onClick:()=>{l(),i()},children:[(0,s.jsx)(I.A,{size:14,className:"shrink-0"})," ",u.fileTree.newFile]}),(0,s.jsx)("div",{className:Y}),(0,s.jsxs)("button",{className:B,onClick:()=>{x(n.path),i()},children:[(0,s.jsx)(g.A,{size:14,className:`shrink-0 ${j?"fill-[var(--amber)] text-[var(--amber)]":""}`}),j?u.fileTree.removeFromFavorites:u.fileTree.pinToFavorites]}),(0,s.jsxs)("button",{className:B,disabled:m,onClick:()=>{f(async()=>{if((await W(n.path)).success){d.refresh(),window.dispatchEvent(new Event("mindos:files-changed"));let e=n.name.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||n.name;(0,H.wD)().then(t=>{t&&(0,H.Vz)(e,n.path)})}i()})},children:[(0,s.jsx)(p.A,{size:14,className:"shrink-0 text-[var(--amber)]"})," ",u.fileTree.convertToSpace]}),(0,s.jsxs)("button",{className:B,onClick:()=>{J(n.path),i()},children:[(0,s.jsx)(v.A,{size:14,className:"shrink-0"})," ",u.fileTree.copyPath]}),(0,s.jsxs)("button",{className:B,onClick:()=>{o(),i()},children:[(0,s.jsx)(b.A,{size:14,className:"shrink-0"})," ",u.fileTree.rename]}),(0,s.jsx)("div",{className:Y}),(0,s.jsxs)("button",{className:_,onClick:()=>{i(),c()},children:[(0,s.jsx)(y.A,{size:14,className:"shrink-0"}),u.fileTree.deleteFolder]})]})}var Z=n(72466);function q(){window.dispatchEvent(new Event("mindos:files-changed"))}async function Q(e){try{await navigator.clipboard.writeText(e)}catch{}}function X({dirPath:e,depth:t,onDone:n}){let[i,l]=(0,r.useState)(""),[c,u]=(0,r.useTransition)(),[m,p]=(0,r.useState)(""),f=(0,a.useRouter)(),{t:h}=(0,R.Y)(),x=(0,r.useRef)(null),g=(0,r.useCallback)(()=>{let t=i.trim();t?u(async()=>{let s=await w(e,t);s.success&&s.filePath?(n(),f.push(`/view/${(0,o.O0)(s.filePath)}`),f.refresh(),q()):p(s.error||h.fileTree.failed)}):p(h.fileTree.enterFileName)},[i,e,n,f,h]);return(0,r.useEffect)(()=>{let e=e=>{x.current&&!x.current.contains(e.target)&&n()},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[n]),(0,s.jsxs)("div",{ref:x,className:"px-2 pb-1",style:{paddingLeft:`${12*t+20}px`},children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("input",{autoFocus:!0,type:"text",value:i,onChange:e=>{l(e.target.value),p("")},onKeyDown:e=>{"Enter"===e.key&&g(),"Escape"===e.key&&n()},placeholder:"filename.md",className:" flex-1 bg-muted border border-border rounded px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring "}),c?(0,s.jsx)(d.A,{size:13,className:"text-muted-foreground animate-spin shrink-0"}):(0,s.jsx)("button",{onClick:g,className:"text-xs text-[var(--amber)] hover:text-foreground shrink-0 px-1",children:h.fileTree.create})]}),m&&(0,s.jsx)("p",{className:"text-xs text-error mt-0.5 px-1",children:m})]})}let ee=(0,r.memo)(function({node:e,depth:t,currentPath:n,onNavigate:l,maxOpenDepth:c,onImport:g}){let v=(0,a.useRouter)(),b=n.startsWith(e.path+"/")||n===e.path,y=!!e.isSpace,[j,w]=(0,r.useState)(0===t||b),[A,L]=(0,r.useState)(0===t||b),[$,D]=(0,r.useState)(!1),[F,O]=(0,r.useState)(!1),[P,I]=(0,r.useState)(e.name),[M,U]=(0,r.useTransition)(),W=(0,r.useRef)(null),H=(0,r.useRef)(null),[J,B]=(0,r.useState)(null),{t:_}=(0,R.Y)(),[Y,G]=(0,r.useState)(null),[Q,ee]=(0,r.useTransition)(),{isDragTarget:et,handleRowDragOver:es,handleRowDragEnter:er,handleRowDragLeave:ea,handleRowDrop:ei}=function(e,t,n,s){let[a,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),l=(0,r.useRef)(null),c=(0,r.useCallback)(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]),d=(0,r.useCallback)(e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy",l.current&&(clearTimeout(l.current),l.current=null),a||i(!0))},[a]),u=(0,r.useCallback)(e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.stopPropagation(),i(!0),c(),t||(o.current=setTimeout(()=>{n(!0),o.current=null},500)))},[t,c,n]),m=(0,r.useCallback)(e=>{e.dataTransfer.types.includes("Files")&&(e.stopPropagation(),l.current=setTimeout(()=>{i(!1),c(),l.current=null},50))},[c]),p=(0,r.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),i(!1),c(),l.current&&(clearTimeout(l.current),l.current=null);let n=t.dataTransfer.files;n.length>0&&(0,Z.Nh)(Array.from(n),e.path,s)},[e.path,s,c]);return(0,r.useEffect)(()=>()=>{o.current&&clearTimeout(o.current),l.current&&clearTimeout(l.current)},[]),{isDragTarget:a,handleRowDragOver:d,handleRowDragEnter:u,handleRowDragLeave:m,handleRowDrop:p}}(e,j,(0,r.useCallback)(e=>{w(e),e&&L(!0)},[]),_),eo=(0,r.useCallback)(()=>{w(e=>(e||L(!0),!e))},[]),el=(0,r.useRef)(void 0);(0,r.useEffect)(()=>{if(null==c){el.current=c;return}if(el.current!==c){if(null===el.current||void 0===el.current)t>c?w(!1):L(!0);else{let e=t<=c;w(e),e&&L(!0)}el.current=c}},[c,t]),(0,r.useEffect)(()=>()=>{H.current&&clearTimeout(H.current)},[]);let ec=(0,r.useCallback)(t=>{t?.preventDefault(),t?.stopPropagation(),H.current&&(clearTimeout(H.current),H.current=null),I(e.name),O(!0),setTimeout(()=>W.current?.select(),0)},[e.name]),ed=(0,r.useCallback)(()=>{let t=P.trim();t&&t!==e.name?U(async()=>{let n=y?N:k.f,s=await n(e.path,t);s.success&&s.newPath?(O(!1),v.push(`/view/${(0,o.O0)(s.newPath)}`),v.refresh(),q()):O(!1)}):O(!1)},[P,e.name,e.path,v,y]),eu=(0,r.useCallback)(()=>{F||(H.current&&clearTimeout(H.current),H.current=setTimeout(()=>{v.push(`/view/${(0,o.O0)(e.path)}`),l?.(),H.current=null},180))},[F,v,e.path,l]);(0,r.useCallback)(e=>{e.stopPropagation(),eo()},[eo]);let em=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),B({x:e.clientX,y:e.clientY})},[]),ep=y?function e(t){return"file"===t.type?+!i.C.has(t.name):(t.children??[]).reduce((t,n)=>t+e(n),0)}(e):0;if(F)return(0,s.jsxs)("div",{className:"relative px-2 py-0.5",style:{paddingLeft:`${12*t+8}px`},children:[(0,s.jsx)("input",{ref:W,autoFocus:!0,value:P,onChange:e=>I(e.target.value),onKeyDown:e=>{"Enter"===e.key&&ed(),"Escape"===e.key&&O(!1)},onBlur:ed,className:"w-full bg-muted border border-border rounded px-2 py-0.5 text-xs text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),M&&(0,s.jsx)(d.A,{size:12,className:"absolute right-3 top-1/2 -translate-y-1/2 animate-spin text-muted-foreground"})]});let ef=y&&0===t;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:`relative group/dir flex items-center transition-colors duration-100 ${et?"bg-[var(--amber)]/10 rounded-md":""}`,onContextMenu:em,onDragEnter:er,onDragOver:es,onDragLeave:ea,onDrop:ei,children:[(0,s.jsx)("button",{onClick:eo,className:"shrink-0 p-1 rounded hover:bg-muted text-muted-foreground transition-colors",style:{marginLeft:`${12*t+4}px`},"aria-label":j?`Collapse ${e.name}`:`Expand ${e.name}`,"aria-expanded":j,children:(0,s.jsx)("span",{className:"block transition-transform duration-150",style:{transform:j?"rotate(0deg)":"rotate(-90deg)"},children:(0,s.jsx)(u.A,{size:10})})}),(0,s.jsxs)("button",{type:"button",onClick:eu,draggable:!0,onDragStart:t=>{t.dataTransfer.setData("text/mindos-path",e.path),t.dataTransfer.setData("text/mindos-type","directory"),t.dataTransfer.effectAllowed="copy"},className:`
|
|
2
2
|
flex-1 flex items-center gap-1.5 px-1 py-1 rounded text-left min-w-0 pr-16
|
|
3
3
|
text-sm transition-colors duration-100
|
|
4
4
|
hover:bg-muted cursor-default
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
w-full flex items-center gap-1.5 px-2 py-1 rounded text-left
|
|
8
8
|
text-sm transition-colors duration-100 cursor-default pr-16
|
|
9
9
|
${p?"bg-accent text-foreground":"hover:bg-muted text-muted-foreground hover:text-foreground"}
|
|
10
|
-
`,style:{paddingLeft:`${12*t+8}px`},children:["directory"===e.type?null:".csv"===e.extension?(0,s.jsx)(l.A,{size:14,className:"text-success shrink-0"}):(0,s.jsx)(c.A,{size:14,className:"text-muted-foreground shrink-0"}),(0,s.jsx)("span",{className:"truncate leading-5",suppressHydrationWarning:!0,children:e.name}),P&&(0,s.jsx)(g.A,{size:10,className:"shrink-0 fill-[var(--amber)] text-[var(--amber)] opacity-60"})]}),(0,s.jsx)("div",{className:"absolute right-1 top-1/2 -translate-y-1/2 hidden group-hover/file:flex items-center gap-0.5",children:(0,s.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation();let t=e.currentTarget.getBoundingClientRect();H({x:t.left,y:t.bottom+4})},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:"More",children:(0,s.jsx)(x.A,{size:14})})}),W&&(0,s.jsxs)(G,{x:W.x,y:W.y,onClose:()=>H(null),menuHeight:140,children:[(0,s.jsxs)("button",{className:B,onClick:()=>{Q(e.path),H(null)},children:[(0,s.jsx)(v.A,{size:14,className:"shrink-0"})," ",D.fileTree.copyPath]}),(0,s.jsxs)("button",{className:B,onClick:()=>{O(e.path),H(null)},children:[(0,s.jsx)(g.A,{size:14,className:`shrink-0 ${P?"fill-[var(--amber)] text-[var(--amber)]":""}`}),P?D.fileTree.removeFromFavorites:D.fileTree.pinToFavorites]}),!I&&(0,s.jsxs)("button",{className:B,onClick:e=>{H(null),K(e)},children:[(0,s.jsx)(b.A,{size:14,className:"shrink-0"})," ",D.fileTree.rename]}),!I&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:Y}),(0,s.jsxs)("button",{className:_,onClick:e=>{H(null),Z(e)},children:[(0,s.jsx)(y.A,{size:14,className:"shrink-0"})," ",D.fileTree.delete]})]})]}),(0,s.jsx)(z.TM,{open:M,title:D.fileTree.delete,message:D.fileTree.confirmDelete(e.name),confirmLabel:D.fileTree.delete,cancelLabel:D.view?.cancel??"Cancel",variant:"destructive",onCancel:()=>U(!1),onConfirm:()=>{U(!1),T(async()=>{let t=await (0,A.i)(e.path);if(t.success){if(t.trashId){let n=t.trashId,s=e.path.split("/").pop()??e.path;E.oR.undo(`${D.trash?.movedToTrash??"Deleted"} ${s}`,async()=>{let e=await (0,C.Y)(n);e.success?(m.refresh(),q()):E.oR.error(e.error??"Undo failed")},{label:D.trash?.undo??"Undo"})}m.refresh(),q()}})}})]})});function en({nodes:e,depth:t=0,onNavigate:n,maxOpenDepth:o,parentIsSpace:l,onImport:c}){var d;let u,m=(u="/view/",(d=(0,a.usePathname)()).startsWith(u)?d.slice(u.length).split("/").map(decodeURIComponent).join("/"):""),p=P(),f=0===t,h=(0,r.useMemo)(()=>{let t=p?e:e.filter(e=>!(f&&e.name.startsWith(".")||"file"===e.type&&i.C.has(e.name)||"directory"===e.type&&e.name.startsWith(".")));return f?t.filter(e=>"directory"!==e.type||"Inbox"!==e.name):t},[e,p,f]);return(0,r.useEffect)(()=>{if(!m||0!==t)return;let e=setTimeout(()=>{let e=document.querySelector(`[data-filepath="${CSS.escape(m)}"]`);e?.scrollIntoView({block:"nearest",behavior:"smooth"})},120);return()=>clearTimeout(e)},[m,t]),(0,s.jsx)("div",{className:"flex flex-col gap-0.5",children:h.map(e=>"directory"===e.type?(0,s.jsx)(ee,{node:e,depth:t,currentPath:m,onNavigate:n,maxOpenDepth:o,onImport:c},e.path):(0,s.jsx)(et,{node:e,depth:t,currentPath:m,onNavigate:n},e.path))})}},46354:(e,t,n)=>{n.d(t,{$7:()=>i,MZ:()=>d,TS:()=>l,UG:()=>a,YB:()=>c,pl:()=>o});let s=[],r=new Set;function a(){try{let e=localStorage.getItem("mindos-disabled-renderers");r=function(e){if(!e)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(e=>"string"==typeof e&&e.length>0)):new Set}(e)}catch{r=new Set}}function i(e,t){let n=s.find(t=>t.id===e);if(!n?.core){t?r.delete(e):r.add(e);try{localStorage.setItem("mindos-disabled-renderers",JSON.stringify([...r]))}catch{}}}function o(e){let t=s.find(t=>t.id===e);return!!t?.core||!r.has(e)}function l(e){s.find(t=>t.id===e.id)||s.push(e)}function c(e,t,n){if(n){let e=s.find(e=>e.id===n);return e&&o(e.id)?e:void 0}return s.find(n=>o(n.id)&&n.match({filePath:e,extension:t}))}function d(){return s.filter(e=>!e.appBuiltinFeature)}},
|
|
10
|
+
`,style:{paddingLeft:`${12*t+8}px`},children:["directory"===e.type?null:".csv"===e.extension?(0,s.jsx)(l.A,{size:14,className:"text-success shrink-0"}):(0,s.jsx)(c.A,{size:14,className:"text-muted-foreground shrink-0"}),(0,s.jsx)("span",{className:"truncate leading-5",suppressHydrationWarning:!0,children:e.name}),P&&(0,s.jsx)(g.A,{size:10,className:"shrink-0 fill-[var(--amber)] text-[var(--amber)] opacity-60"})]}),(0,s.jsx)("div",{className:"absolute right-1 top-1/2 -translate-y-1/2 hidden group-hover/file:flex items-center gap-0.5",children:(0,s.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation();let t=e.currentTarget.getBoundingClientRect();H({x:t.left,y:t.bottom+4})},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:"More",children:(0,s.jsx)(x.A,{size:14})})}),W&&(0,s.jsxs)(G,{x:W.x,y:W.y,onClose:()=>H(null),menuHeight:140,children:[(0,s.jsxs)("button",{className:B,onClick:()=>{Q(e.path),H(null)},children:[(0,s.jsx)(v.A,{size:14,className:"shrink-0"})," ",D.fileTree.copyPath]}),(0,s.jsxs)("button",{className:B,onClick:()=>{O(e.path),H(null)},children:[(0,s.jsx)(g.A,{size:14,className:`shrink-0 ${P?"fill-[var(--amber)] text-[var(--amber)]":""}`}),P?D.fileTree.removeFromFavorites:D.fileTree.pinToFavorites]}),!I&&(0,s.jsxs)("button",{className:B,onClick:e=>{H(null),K(e)},children:[(0,s.jsx)(b.A,{size:14,className:"shrink-0"})," ",D.fileTree.rename]}),!I&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:Y}),(0,s.jsxs)("button",{className:_,onClick:e=>{H(null),Z(e)},children:[(0,s.jsx)(y.A,{size:14,className:"shrink-0"})," ",D.fileTree.delete]})]})]}),(0,s.jsx)(z.TM,{open:M,title:D.fileTree.delete,message:D.fileTree.confirmDelete(e.name),confirmLabel:D.fileTree.delete,cancelLabel:D.view?.cancel??"Cancel",variant:"destructive",onCancel:()=>U(!1),onConfirm:()=>{U(!1),T(async()=>{let t=await (0,A.i)(e.path);if(t.success){if(t.trashId){let n=t.trashId,s=e.path.split("/").pop()??e.path;E.oR.undo(`${D.trash?.movedToTrash??"Deleted"} ${s}`,async()=>{let e=await (0,C.Y)(n);e.success?(m.refresh(),q()):E.oR.error(e.error??"Undo failed")},{label:D.trash?.undo??"Undo"})}m.refresh(),q()}})}})]})});function en({nodes:e,depth:t=0,onNavigate:n,maxOpenDepth:o,parentIsSpace:l,onImport:c}){var d;let u,m=(u="/view/",(d=(0,a.usePathname)()).startsWith(u)?d.slice(u.length).split("/").map(decodeURIComponent).join("/"):""),p=P(),f=0===t,h=(0,r.useMemo)(()=>{let t=p?e:e.filter(e=>!(f&&e.name.startsWith(".")||"file"===e.type&&i.C.has(e.name)||"directory"===e.type&&e.name.startsWith(".")));return f?t.filter(e=>"directory"!==e.type||"Inbox"!==e.name):t},[e,p,f]);return(0,r.useEffect)(()=>{if(!m||0!==t)return;let e=setTimeout(()=>{let e=document.querySelector(`[data-filepath="${CSS.escape(m)}"]`);e?.scrollIntoView({block:"nearest",behavior:"smooth"})},120);return()=>clearTimeout(e)},[m,t]),(0,s.jsx)("div",{className:"flex flex-col gap-0.5",children:h.map(e=>"directory"===e.type?(0,s.jsx)(ee,{node:e,depth:t,currentPath:m,onNavigate:n,maxOpenDepth:o,onImport:c},e.path):(0,s.jsx)(et,{node:e,depth:t,currentPath:m,onNavigate:n},e.path))})}},21526:(e,t,n)=>{n.d(t,{f:()=>r});var s=n(65799);let r=(0,s.createServerReference)("602646d7d86990047761a82da253002836a8400f1e",s.callServer,void 0,s.findSourceMapURL,"renameFileAction")},27069:(e,t,n)=>{n.d(t,{Z:()=>h});var s=n(44223);let r="mindos-pinned-files",a="mindos:pins-changed";function i(){try{let e=localStorage.getItem(r);return e?JSON.parse(e):[]}catch{return[]}}function o(){return d}let l=[];function c(){return l}let d=[],u=!1;function m(){u||(d=i(),u=!0)}function p(e){m();let t=t=>{t.key===r&&(d=i(),e())},n=()=>{d=i(),e()};return window.addEventListener("storage",t),window.addEventListener(a,n),()=>{window.removeEventListener("storage",t),window.removeEventListener(a,n)}}function f(e){d=e;try{localStorage.setItem(r,JSON.stringify(e))}catch{}window.dispatchEvent(new Event(a))}function h(){m();let e=(0,s.useSyncExternalStore)(p,o,c),t=(0,s.useCallback)(t=>e.includes(t),[e]),n=(0,s.useCallback)(e=>{let t=i(),n=t.indexOf(e);n>=0?t.splice(n,1):t.unshift(e),f(t)},[]);return{pinnedFiles:e,isPinned:t,togglePin:n,reorderPins:(0,s.useCallback)(e=>{f(e)},[]),removePin:(0,s.useCallback)(e=>{f(i().filter(t=>t!==e))},[])}}},46354:(e,t,n)=>{n.d(t,{$7:()=>i,MZ:()=>d,TS:()=>l,UG:()=>a,YB:()=>c,pl:()=>o});let s=[],r=new Set;function a(){try{let e=localStorage.getItem("mindos-disabled-renderers");r=function(e){if(!e)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(e=>"string"==typeof e&&e.length>0)):new Set}(e)}catch{r=new Set}}function i(e,t){let n=s.find(t=>t.id===e);if(!n?.core){t?r.delete(e):r.add(e);try{localStorage.setItem("mindos-disabled-renderers",JSON.stringify([...r]))}catch{}}}function o(e){let t=s.find(t=>t.id===e);return!!t?.core||!r.has(e)}function l(e){s.find(t=>t.id===e.id)||s.push(e)}function c(e,t,n){if(n){let e=s.find(e=>e.id===n);return e&&o(e.id)?e:void 0}return s.find(n=>o(n.id)&&n.match({filePath:e,extension:t}))}function d(){return s.filter(e=>!e.appBuiltinFeature)}},62329:(e,t,n)=>{n.d(t,{A:()=>r,C:()=>s});let s=new Set(["INSTRUCTION.md","README.md","CONFIG.json","CHANGELOG.md"]),r=new Set(["TODO.md"])},62800:(e,t,n)=>{n.d(t,{Vz:()=>o,wD:()=>r});var s=n(65264);async function r(){try{let e=await (0,s.n)("/api/settings"),t=e.ai?.provider??"",n=(e.ai?.providers??{})[t];return!!n?.apiKey}catch{return!1}}function a(e){for(let t of e.split("\n")){let e=t.trim();if(!e.startsWith("data:"))continue;let n=e.slice(5).trim();if(n)try{let e=JSON.parse(n);if("error"===e.type)return String(e.message||"AI initialization failed")}catch{}}return null}async function i(e){let t=e.getReader(),n=new TextDecoder,s="";try{for(;;){let{done:e,value:r}=await t.read();if(e)break;let i=(s+=n.decode(r,{stream:!0})).split("\n");s=i.pop()??"";let o=a(i.join("\n"));if(o)throw Error(o)}if(s){let e=a(s);if(e)throw Error(e)}}finally{t.releaseLock()}}function o(e,t,n=""){let s="u">typeof document&&"zh"===document.documentElement.lang?`初始化新建的心智空间「${e}」,路径为「${t}/」。${n?`描述:「${n}」。`:""}两个文件均已存在模板,用 write_file 覆盖:
|
|
11
11
|
1. 「${t}/README.md」— 写入空间用途、结构概览、使用指南
|
|
12
12
|
2. 「${t}/INSTRUCTION.md」— 写入 AI Agent 在此空间中的行为规则和操作约定
|
|
13
13
|
|
|
@@ -30,4 +30,4 @@ Keep content concise and actionable. Write files directly using tools.`;window.d
|
|
|
30
30
|
};
|
|
31
31
|
`],{type:"application/javascript"}),a=URL.createObjectURL(s),i=new Worker(a),o=()=>{i.terminate(),URL.revokeObjectURL(a)},l=setTimeout(()=>{o(),n(r(t))},1e4);i.onmessage=e=>{clearTimeout(l),o(),"string"==typeof e.data?n(e.data):n(r(t))},i.onerror=()=>{clearTimeout(l),o(),n(r(t))},i.postMessage(e,[e])})}async function i(e,t){let n=[],r=0;for(let t of e){if(t.size>0xa00000){r++;continue}try{let e=t.name.toLowerCase(),s=e.endsWith(".doc")||e.endsWith(".docx")||e.endsWith(".docm");if(e.endsWith(".pdf")||s){let e=await t.arrayBuffer();n.push({name:t.name,content:await a(e),encoding:"base64"})}else{let e=await t.text();n.push({name:t.name,content:e})}}catch{}}if(0===n.length)return void(r>0?s.oR.error(t.inbox.tooLarge(r),4e3):e.length>0&&s.oR.error(t.inbox.saveFailed,4e3));try{var i;let e=await fetch("/api/inbox",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:n})});if(!e.ok){let n=await e.json().catch(()=>({}));console.error("[QuickDrop] Save failed:",n.error),s.oR.error(t.inbox.saveFailed,4e3);return}let a=await e.json(),o=a.saved?.length??0,l=a.skipped?.length??0;i=r,o>0&&i>0&&0===l?s.oR.success(t.inbox.savedWithOversized(o,i),4e3):o>0&&l+i>0?s.oR.success(t.inbox.savedWithSkipped(o,l+i),4e3):o>0?s.oR.success(t.inbox.savedToast(o),3e3):(i>0&&s.oR.error(t.inbox.tooLarge(i),4e3),l>0&&s.oR.error(t.inbox.savedWithSkipped(0,l),4e3),0===i&&0===l&&s.oR.error(t.inbox.saveFailed,4e3)),window.dispatchEvent(new Event("mindos:files-changed")),window.dispatchEvent(new Event("mindos:inbox-updated"))}catch(e){console.error("[QuickDrop] Network error:",e),s.oR.error(t.inbox.saveFailed,4e3)}}async function o(e,t){try{let n=await fetch("/api/inbox/clip",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})}),r=await n.json();if(!n.ok){let e=r.error||t.inbox.clipFailed;return s.oR.error(e,4e3),{ok:!1}}return s.oR.success(t.inbox.clipSuccess(r.title||e),3e3),window.dispatchEvent(new Event("mindos:files-changed")),window.dispatchEvent(new Event("mindos:inbox-updated")),{ok:!0,title:r.title}}catch(e){return console.error("[ClipURL] Network error:",e),s.oR.error(t.inbox.clipFailed,4e3),{ok:!1}}}function l(e){let t=e.trim();if(!t.startsWith("http://")&&!t.startsWith("https://"))return!1;try{return new URL(t),!0}catch{return!1}}function c(e){if(e.dataTransfer?.files&&e.dataTransfer.files.length>0)return null;let t=e.dataTransfer?.getData("text/uri-list");if(t){let e=t.split(/[\r\n]+/).find(e=>!e.startsWith("#")&&e.trim().length>0);if(e&&l(e))return e.trim()}let n=e.dataTransfer?.getData("text/plain");return n&&l(n)?n.trim():null}function d(e){let t=e.dataTransfer?.types??[];return!t.includes("Files")&&(t.includes("text/uri-list")||t.includes("text/plain"))}async function u(e,t,n){let r=[],i=0,o=new Set(["pdf","png","jpg","jpeg","gif","webp","bmp","ico","mp3","wav","m4a","ogg","flac","aac","mp4","webm","mov","mkv","doc","docx","docm"]);for(let t of e){if(t.size>0xa00000){i++;continue}try{let e=(t.name.split(".").pop()??"").toLowerCase();if(o.has(e)){let e=await t.arrayBuffer();r.push({name:t.name,content:await a(e),encoding:"base64"})}else{let e=await t.text();r.push({name:t.name,content:e})}}catch{}}if(0===r.length)return void(i>0?s.oR.error(n.inbox.tooLarge(i),4e3):e.length>0&&s.oR.error(n.inbox.saveFailed,4e3));let l=t.split("/").pop()||t;try{let e=await fetch("/api/file/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:r,targetSpace:t,organize:!1,conflict:"rename"})});if(!e.ok){let t=await e.json().catch(()=>({}));console.error("[TreeDrop] Save failed:",t.error),s.oR.error(n.inbox.saveFailed,4e3);return}let a=await e.json(),o=a.created?.length??0,c=a.skipped?.length??0;o>0&&c+i>0?s.oR.success(n.inbox.savedWithSkipped(o,c+i),4e3):o>0?s.oR.success(n.inbox.savedToDir(o,l),3e3):(i>0&&s.oR.error(n.inbox.tooLarge(i),4e3),c>0&&s.oR.error(n.inbox.savedWithSkipped(0,c),4e3)),window.dispatchEvent(new Event("mindos:files-changed"))}catch(e){console.error("[TreeDrop] Network error:",e),s.oR.error(n.inbox.saveFailed,4e3)}}},75579:(e,t,n)=>{n.d(t,{vP:()=>w,$_:()=>b,fF:()=>v});var s=n(66839),r=n(44223),a=n(21082),i=n(98327),o=n(44361),l=n(3972),c=n(76723),d=n(44910),u=n(67885),m=n(38688),p=n(69527),f=n(65264),h=n(9986),x=n(55798);function g({t:e,onInitComplete:t}){var n;let i=e.settings?.sync,[l,u]=(0,r.useState)(""),[g,v]=(0,r.useState)(""),[y,j]=(0,r.useState)("main"),[w,N]=(0,r.useState)(!1),[k,S]=(0,r.useState)(-1),[T,C]=(0,r.useState)(""),A=(0,r.useRef)(null),E=k>=0&&k<4,R=l.trim()?(n=l.trim(),/^https:\/\/.+/.test(n)?"https":!!/^git@[\w.-]+:.+/.test(n)&&"ssh"):null,z="https"===R||"ssh"===R,L=async()=>{S(0),C("");let e=(e,t)=>setTimeout(()=>S(t=>t>=0&&t<4?e:t),t);A.current=e(1,2e3);let n=e(2,5e3);try{await (0,f.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"init",remote:l.trim(),token:g.trim()||void 0,branch:y.trim()||"main"}),timeout:12e4}),S(4),setTimeout(()=>t(),600)}catch(n){let e=n instanceof Error?n.message:"Connection failed";e.includes("timed out")&&(e=i?.timeoutError??"Connection timed out. The remote repository may be large or the network is slow. Please try again.");let t=b(e,l,i);C(t?`${e}
|
|
32
32
|
${t}`:e),S(-1)}finally{A.current&&clearTimeout(A.current),clearTimeout(n)}},$=[i?.stepConnecting??"Connecting to remote...",i?.stepAuthenticating??"Authenticating...",i?.stepSyncing??"Syncing data...",i?.stepAlmostDone??"Almost done..."];return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)(p.L7,{icon:(0,s.jsx)(d.A,{size:15}),title:i?.emptyTitle??"Cross-device Sync",description:i?.emptyDesc??"Automatically sync your knowledge base across devices via Git.",children:[(0,s.jsxs)(p.D0,{label:i?.remoteUrl??"Git Remote URL",hint:"ssh"===R?i?.sshHint??"Requires SSH key on this machine. Verify with: ssh -T git@github.com":void 0,children:[(0,s.jsx)(p.pd,{type:"text",value:l,onChange:e=>{u(e.target.value),C("")},placeholder:"git@github.com:user/repo.git",className:`font-mono ${l.trim()&&!z?"border-destructive":""}`}),!l.trim()&&(0,s.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground mt-1.5",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("code",{className:"text-foreground/60 bg-muted/60 px-1 py-0.5 rounded text-2xs",children:"SSH"})," ",i?.sshBrief??"one-time key setup, no token needed"]}),(0,s.jsxs)("span",{children:[(0,s.jsx)("code",{className:"text-foreground/60 bg-muted/60 px-1 py-0.5 rounded text-2xs",children:"HTTPS"})," ",i?.httpsBrief??"works anywhere, token recommended"]})]}),l.trim()&&!z&&(0,s.jsx)("p",{className:"text-xs text-destructive mt-1",children:i?.invalidUrl??"Invalid Git URL — use HTTPS (https://...) or SSH (git@...)"})]}),"https"===R&&(0,s.jsxs)(p.D0,{label:(0,s.jsxs)(s.Fragment,{children:[i?.accessToken??"Access Token"," ",(0,s.jsx)("span",{className:"text-muted-foreground font-normal",children:i?.optional??"(optional, for private repos)"})]}),hint:void 0,children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(p.pd,{type:w?"text":"password",value:g,onChange:e=>v(e.target.value),placeholder:"ghp_xxxxxxxxxxxx",className:"pr-9 font-mono"}),(0,s.jsx)("button",{type:"button",onClick:()=>N(!w),className:"absolute right-2 top-1/2 -translate-y-1/2 p-0.5 rounded hover:bg-muted text-muted-foreground transition-colors",children:w?(0,s.jsx)(h.A,{size:14}):(0,s.jsx)(x.A,{size:14})})]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:[i?.tokenHint??"GitHub:"," ",(0,s.jsx)("a",{href:"https://github.com/settings/tokens/new?scopes=repo&description=MindOS+Sync",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground transition-colors",children:i?.tokenLink??"Create a token (repo scope)"})]})]}),(0,s.jsx)(p.D0,{label:i?.branchLabel??"Branch",children:(0,s.jsx)(p.pd,{type:"text",value:y,onChange:e=>j(e.target.value),placeholder:"main",className:"max-w-[200px] font-mono"})}),!E&&4!==k&&(0,s.jsx)(p.jn,{onClick:L,disabled:!z,className:"flex items-center gap-2",children:i?.connectButton??"Connect & Start Sync"}),(E||4===k)&&(0,s.jsxs)("div",{className:"space-y-2 py-1",children:[$.map((e,t)=>{let n=k>t||4===k,r=k===t&&k<4;return k<t&&k<4?null:(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[n?(0,s.jsx)(c.A,{size:13,className:"text-success shrink-0"}):(0,s.jsx)(o.A,{size:13,className:"animate-spin text-muted-foreground shrink-0"}),(0,s.jsx)("span",{className:n?"text-success":r?"text-foreground":"text-muted-foreground",children:e})]},t)}),4===k&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,s.jsx)(m.A,{size:13,className:"text-success shrink-0"}),(0,s.jsx)("span",{className:"text-success font-medium",children:i?.stepDone??"Sync configured successfully!"})]})]}),T&&(0,s.jsxs)("div",{className:"flex items-start gap-2 text-xs p-3 rounded-lg bg-destructive/10 text-destructive",role:"alert","aria-live":"polite",children:[(0,s.jsx)(a.A,{size:13,className:"shrink-0 mt-0.5"}),(0,s.jsx)("div",{className:"space-y-1",children:T.split("\n").map((e,t)=>(0,s.jsx)("span",{className:`block ${t>0?"text-destructive/70":""}`,children:e},t))})]})]}),(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2 text-xs text-muted-foreground px-5",children:[i?.featureAutoCommit??"Auto-commit on save",i?.featureAutoPull??"Auto-pull from remote",i?.featureConflict??"Conflict detection",i?.featureMultiDevice??"Works across devices"].map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(m.A,{size:11,className:"text-success/60 shrink-0"}),(0,s.jsx)("span",{children:e})]},t))})]})}function v(e,t){if(!e)return t?.timeNever??"never";let n=Date.now()-new Date(e).getTime();if(n<6e4)return t?.timeJustNow??"just now";let s=Math.floor(n/6e4);if(n<36e5)return t?.timeMinAgo?.(s)??`${s}m ago`;let r=Math.floor(n/36e5);if(n<864e5)return t?.timeHourAgo?.(r)??`${r}h ago`;let a=Math.floor(n/864e5);return t?.timeDayAgo?.(a)??`${a}d ago`}function b(e,t,n){let s=e.toLowerCase();return s.includes("permission denied")||s.includes("publickey")?n?.hintSshAuth??"SSH key may not be configured. Run: ssh-keygen -t ed25519 && ssh -T git@github.com":s.includes("host key")||s.includes("known_hosts")||s.includes("fingerprint")?n?.hintSshHost??"Run: ssh-keyscan github.com >> ~/.ssh/known_hosts":s.includes("authentication failed")||s.includes("invalid credentials")||s.includes("401")||s.includes("403")?n?.hintHttpsAuth??"Access token may be expired or missing. Check Settings → Developer settings → Personal access tokens.":s.includes("timed out")||s.includes("timeout")||s.includes("could not resolve")?n?.hintNetwork??"Check your network connection and try again.":s.includes("not found")||s.includes("does not exist")||s.includes("repository not found")?n?.hintNotFound??"Repository not found. Check the URL and ensure the repo exists.":s.includes("non-fast-forward")||s.includes("rejected")||s.includes("fetch first")?n?.hintPushRejected??'Remote has changes. Click "Sync Now" to pull and retry.':s.includes("conflict")||s.includes("merge")?n?.hintConflict??"Merge conflict detected. Check the Conflicts section below.":""}function y({file:e,time:t,syncT:n,onResolved:l}){let[c,d]=(0,r.useState)(null),[u,m]=(0,r.useState)(!1),[p,h]=(0,r.useState)(null),[x,g]=(0,r.useState)(!1),b=async()=>{if(u)return void m(!1);if(!p){g(!0);try{let t=await (0,f.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"conflict-preview",remote:e})});h(t)}catch{}g(!1)}m(!0)},y=async t=>{d("keep-local"===t?"local":"remote");try{await (0,f.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"resolve-conflict",remote:e,branch:t})}),l()}catch{d(null)}};return(0,s.jsxs)("div",{className:"rounded-lg border border-border/50 overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 p-2 text-xs bg-muted/20",children:[(0,s.jsx)(a.A,{size:12,className:"text-error shrink-0"}),(0,s.jsxs)("button",{type:"button",onClick:b,className:"font-mono truncate hover:text-foreground hover:underline transition-colors flex-1 min-w-0 text-left",title:n?.viewDiff??"View differences",children:[(0,s.jsx)(i.A,{size:11,className:`inline mr-1 transition-transform ${u?"rotate-90":""}`}),e]}),(0,s.jsx)("span",{className:"text-muted-foreground shrink-0",children:v(t,n)}),(0,s.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,s.jsx)("button",{type:"button",onClick:()=>y("keep-local"),disabled:!!c,className:"px-2 py-0.5 rounded border border-border text-2xs hover:bg-muted transition-colors disabled:opacity-40",title:n?.keepLocalHint??"Keep this device's version",children:"local"===c?(0,s.jsx)(o.A,{size:10,className:"animate-spin"}):n?.keepLocal??"Keep local"}),(0,s.jsx)("button",{type:"button",onClick:()=>y("keep-remote"),disabled:!!c,className:"px-2 py-0.5 rounded border border-border text-2xs hover:bg-muted transition-colors disabled:opacity-40",title:n?.keepRemoteHint??"Replace with remote version",children:"remote"===c?(0,s.jsx)(o.A,{size:10,className:"animate-spin"}):n?.keepRemote??"Keep remote"})]})]}),u&&(0,s.jsx)("div",{className:"border-t border-border/50",children:x?(0,s.jsx)("div",{className:"flex justify-center py-3",children:(0,s.jsx)(o.A,{size:13,className:"animate-spin text-muted-foreground"})}):p?(0,s.jsxs)("div",{className:"grid grid-cols-2 divide-x divide-border/50 text-2xs font-mono max-h-60 overflow-auto",children:[(0,s.jsxs)("div",{className:"p-2",children:[(0,s.jsx)("div",{className:"text-muted-foreground mb-1 font-sans text-xs font-medium",children:n?.localVersion??"Local (this device)"}),(0,s.jsx)("pre",{className:"whitespace-pre-wrap text-foreground/80 leading-relaxed",children:p.local||(n?.emptyFile??"(empty)")})]}),(0,s.jsxs)("div",{className:"p-2",children:[(0,s.jsx)("div",{className:"text-muted-foreground mb-1 font-sans text-xs font-medium",children:n?.remoteVersion??"Remote"}),(0,s.jsx)("pre",{className:"whitespace-pre-wrap text-foreground/80 leading-relaxed",children:p.remote||(n?.emptyFile??"(empty)")})]})]}):null})]})}function j({syncT:e}){let[t,n]=(0,r.useState)(!1),[a,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[p,h]=(0,r.useState)(!1),[x,g]=(0,r.useState)(!1),v=(0,r.useRef)(!1),b=a!==u;(0,r.useEffect)(()=>{t&&!v.current&&(v.current=!0,h(!0),(0,f.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"gitignore-get"})}).then(e=>{d(e.content),m(e.content)}).catch(()=>{}).finally(()=>h(!1)))},[t]);let y=async()=>{try{await (0,f.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"gitignore-save",content:a})}),m(a),g(!0),setTimeout(()=>g(!1),2e3)}catch{}};return(0,s.jsxs)("div",{className:"pt-2 border-t border-border/50",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>n(!t),className:"flex items-center gap-2 w-full text-left text-sm text-muted-foreground hover:text-foreground transition-colors py-1",children:[(0,s.jsx)(i.A,{size:14,className:`shrink-0 transition-transform ${t?"rotate-90":""}`}),(0,s.jsx)(l.A,{size:13,className:"shrink-0"}),(0,s.jsx)("span",{children:e?.gitignoreTitle??"Excluded files"}),(0,s.jsx)("span",{className:"text-2xs opacity-50",children:".gitignore"})]}),t&&(0,s.jsx)("div",{className:"mt-2 space-y-2",children:p?(0,s.jsx)("div",{className:"flex justify-center py-4",children:(0,s.jsx)(o.A,{size:14,className:"animate-spin text-muted-foreground"})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("textarea",{value:a,onChange:e=>d(e.target.value),rows:8,className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-xs font-mono leading-relaxed text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring resize-y",placeholder:e?.gitignorePlaceholder??"# Files to exclude from sync\n*.tmp\nsecret/",spellCheck:!1}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[b&&(0,s.jsx)("button",{type:"button",onClick:y,className:"flex items-center gap-1.5 px-3 py-1 text-xs rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-opacity",children:e?.gitignoreSave??"Save"}),x&&(0,s.jsxs)("span",{className:"flex items-center gap-1 text-xs text-success",children:[(0,s.jsx)(c.A,{size:12})," ",e?.gitignoreSaved??"Saved"]})]})]})})]})}function w({t:e,visible:t}){let n=e.settings?.sync,[i,l]=(0,r.useState)(null),[c,h]=(0,r.useState)(!0),[x,w]=(0,r.useState)(!1),[N,k]=(0,r.useState)(!1),[S,T]=(0,r.useState)(null),C=(0,r.useCallback)(async()=>{try{let e=await (0,f.n)("/api/sync",{timeout:1e4});l(e)}catch{l(e=>e??null)}finally{h(!1)}},[]);(0,r.useEffect)(()=>{C()},[C]);let A=(0,r.useRef)(t);(0,r.useEffect)(()=>{t&&!A.current&&null!==i&&C(),A.current=t},[t,i,C]);let E=async()=>{w(!0),T(null);try{await (0,f.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"now"}),timeout:12e4}),T({type:"success",text:n?.syncComplete??"Sync complete"}),await C()}catch(s){var e;let t;T({type:"error",text:(t=b(e=s instanceof Error?s.message:"Sync failed",void 0,n))?`${e}
|
|
33
|
-
${t}`:e})}finally{w(!1),setTimeout(()=>T(null),3e3)}},R=async()=>{if(!i)return;k(!0),T(null);let e=i.enabled?"off":"on";try{await (0,f.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e})}),await C(),T({type:"success",text:i.enabled?n?.autoSyncDisabled??"Auto-sync disabled":n?.autoSyncEnabled??"Auto-sync enabled"})}catch{T({type:"error",text:n?.toggleFailed??"Failed to toggle sync"})}finally{k(!1),setTimeout(()=>T(null),3e3)}},z=async()=>{k(!0);try{await (0,f.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"reset"})}),await C()}catch{T({type:"error",text:n?.resetFailed??"Failed to reset sync configuration"})}finally{k(!1),setTimeout(()=>T(null),3e3)}};if(c)return(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)(o.A,{size:18,className:"animate-spin text-muted-foreground"})});if(!i||!i.enabled)return(0,s.jsx)(g,{t:e,onInitComplete:C});if(i.needsSetup)return(0,s.jsx)("div",{className:"space-y-6",children:(0,s.jsxs)("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-destructive/10",children:[(0,s.jsx)(a.A,{size:18,className:"text-destructive shrink-0 mt-0.5"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-destructive",children:n?.brokenTitle??"Sync configuration is broken"}),(0,s.jsx)("p",{className:"text-xs text-destructive/80",children:i.lastError||(n?.brokenDesc??"The git repository or remote is missing. Reset to re-configure.")}),(0,s.jsxs)(p.jn,{onClick:z,disabled:N,className:"flex items-center gap-2 mt-2",children:[N&&(0,s.jsx)(o.A,{size:14,className:"animate-spin"}),n?.resetButton??"Reset & Re-configure"]})]})]})});let L=i.conflicts||[];return(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsxs)(p.L7,{icon:(0,s.jsx)(d.A,{size:15}),title:n?.sectionTitle??"Sync",description:i.remote,badge:(0,s.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded bg-success/15 text-success font-medium",children:n?.labelEnabled??"Active"}),children:[(0,s.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:n?.labelBranch??"Branch"}),(0,s.jsx)("span",{className:"font-mono text-xs",children:i.branch})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:n?.labelLastSync??"Last sync"}),(0,s.jsx)("span",{className:"text-xs",children:v(i.lastSync,n)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:n?.labelUnpushed??"Unpushed"}),(0,s.jsx)("span",{className:"text-xs",children:"string"==typeof i.unpushed&&/^\d+$/.test(i.unpushed)?n?.unpushedCommits?.(parseInt(i.unpushed,10))??`${i.unpushed} commits`:`${i.unpushed??"?"} commits`})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:n?.labelAutoSync??"Auto-sync"}),(0,s.jsxs)("span",{className:"flex items-center gap-1 text-xs",children:["commit"," ",(0,s.jsxs)(p.l6,{size:"sm",value:String(i.autoCommitInterval),onChange:async e=>{let t=parseInt(e.target.value,10);try{(await fetch("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update-intervals",autoCommitInterval:t})})).ok&&C()}catch{}},children:[(0,s.jsx)("option",{value:"10",children:"10s"}),(0,s.jsx)("option",{value:"15",children:"15s"}),(0,s.jsx)("option",{value:"30",children:"30s"}),(0,s.jsx)("option",{value:"60",children:"60s"}),(0,s.jsx)("option",{value:"120",children:"120s"})]})," \xb7 pull ",(0,s.jsxs)(p.l6,{size:"sm",value:String(i.autoPullInterval),onChange:async e=>{let t=parseInt(e.target.value,10);try{(await fetch("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update-intervals",autoPullInterval:t})})).ok&&C()}catch{}},children:[(0,s.jsx)("option",{value:"60",children:"1min"}),(0,s.jsx)("option",{value:"120",children:"2min"}),(0,s.jsx)("option",{value:"300",children:"5min"}),(0,s.jsx)("option",{value:"600",children:"10min"}),(0,s.jsx)("option",{value:"1800",children:"30min"}),(0,s.jsx)("option",{value:"3600",children:"60min"})]})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,s.jsxs)("button",{type:"button",onClick:E,disabled:x,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[(0,s.jsx)(u.A,{size:12,className:x?"animate-spin":""}),n?.syncNow??"Sync Now"]}),(0,s.jsx)("button",{type:"button",onClick:R,disabled:N,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-destructive hover:border-destructive/50 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:n?.disableAutoSync??"Disable Auto-sync"})]}),S&&(0,s.jsx)("div",{className:"flex items-start gap-1.5 text-xs",role:"status","aria-live":"polite",children:"success"===S.type?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.A,{size:13,className:"text-success shrink-0 mt-0.5"}),(0,s.jsx)("span",{className:"text-success",children:S.text})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.A,{size:13,className:"text-destructive shrink-0 mt-0.5"}),(0,s.jsx)("div",{className:"space-y-0.5",children:S.text.split("\n").map((e,t)=>(0,s.jsx)("span",{className:`block ${t>0?"text-destructive/70":"text-destructive"}`,children:e},t))})]})}),L.length>0&&(0,s.jsxs)("div",{className:"pt-2 border-t border-border/50 space-y-3",children:[(0,s.jsx)("p",{className:"text-xs font-medium text-foreground",children:n?.conflictsTitle?.(L.length)??`Conflicts (${L.length})`}),(0,s.jsx)("p",{className:"text-2xs text-muted-foreground",children:n?.conflictExplain??"These files were changed on both this device and the remote. Choose which version to keep for each file."}),(0,s.jsx)("div",{className:"space-y-2",children:L.map((e,t)=>(0,s.jsx)(y,{file:e.file,time:e.time,syncT:n,onResolved:C},t))})]}),i.lastError&&0===L.length&&(0,s.jsxs)("div",{className:"flex items-start gap-2 text-xs p-2.5 rounded-lg bg-destructive/10 text-destructive",children:[(0,s.jsx)(a.A,{size:12,className:"shrink-0 mt-0.5"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"block",children:i.lastError}),b(i.lastError,i.remote,n)&&(0,s.jsx)("span",{className:"block text-destructive/70",children:b(i.lastError,i.remote,n)})]})]}),(0,s.jsx)(j,{syncT:n})]})})}},
|
|
33
|
+
${t}`:e})}finally{w(!1),setTimeout(()=>T(null),3e3)}},R=async()=>{if(!i)return;k(!0),T(null);let e=i.enabled?"off":"on";try{await (0,f.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e})}),await C(),T({type:"success",text:i.enabled?n?.autoSyncDisabled??"Auto-sync disabled":n?.autoSyncEnabled??"Auto-sync enabled"})}catch{T({type:"error",text:n?.toggleFailed??"Failed to toggle sync"})}finally{k(!1),setTimeout(()=>T(null),3e3)}},z=async()=>{k(!0);try{await (0,f.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"reset"})}),await C()}catch{T({type:"error",text:n?.resetFailed??"Failed to reset sync configuration"})}finally{k(!1),setTimeout(()=>T(null),3e3)}};if(c)return(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)(o.A,{size:18,className:"animate-spin text-muted-foreground"})});if(!i||!i.enabled)return(0,s.jsx)(g,{t:e,onInitComplete:C});if(i.needsSetup)return(0,s.jsx)("div",{className:"space-y-6",children:(0,s.jsxs)("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-destructive/10",children:[(0,s.jsx)(a.A,{size:18,className:"text-destructive shrink-0 mt-0.5"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-destructive",children:n?.brokenTitle??"Sync configuration is broken"}),(0,s.jsx)("p",{className:"text-xs text-destructive/80",children:i.lastError||(n?.brokenDesc??"The git repository or remote is missing. Reset to re-configure.")}),(0,s.jsxs)(p.jn,{onClick:z,disabled:N,className:"flex items-center gap-2 mt-2",children:[N&&(0,s.jsx)(o.A,{size:14,className:"animate-spin"}),n?.resetButton??"Reset & Re-configure"]})]})]})});let L=i.conflicts||[];return(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsxs)(p.L7,{icon:(0,s.jsx)(d.A,{size:15}),title:n?.sectionTitle??"Sync",description:i.remote,badge:(0,s.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded bg-success/15 text-success font-medium",children:n?.labelEnabled??"Active"}),children:[(0,s.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:n?.labelBranch??"Branch"}),(0,s.jsx)("span",{className:"font-mono text-xs",children:i.branch})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:n?.labelLastSync??"Last sync"}),(0,s.jsx)("span",{className:"text-xs",children:v(i.lastSync,n)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:n?.labelUnpushed??"Unpushed"}),(0,s.jsx)("span",{className:"text-xs",children:"string"==typeof i.unpushed&&/^\d+$/.test(i.unpushed)?n?.unpushedCommits?.(parseInt(i.unpushed,10))??`${i.unpushed} commits`:`${i.unpushed??"?"} commits`})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:n?.labelAutoSync??"Auto-sync"}),(0,s.jsxs)("span",{className:"flex items-center gap-1 text-xs",children:["commit"," ",(0,s.jsxs)(p.l6,{size:"sm",value:String(i.autoCommitInterval),onChange:async e=>{let t=parseInt(e.target.value,10);try{(await fetch("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update-intervals",autoCommitInterval:t})})).ok&&C()}catch{}},children:[(0,s.jsx)("option",{value:"10",children:"10s"}),(0,s.jsx)("option",{value:"15",children:"15s"}),(0,s.jsx)("option",{value:"30",children:"30s"}),(0,s.jsx)("option",{value:"60",children:"60s"}),(0,s.jsx)("option",{value:"120",children:"120s"})]})," \xb7 pull ",(0,s.jsxs)(p.l6,{size:"sm",value:String(i.autoPullInterval),onChange:async e=>{let t=parseInt(e.target.value,10);try{(await fetch("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update-intervals",autoPullInterval:t})})).ok&&C()}catch{}},children:[(0,s.jsx)("option",{value:"60",children:"1min"}),(0,s.jsx)("option",{value:"120",children:"2min"}),(0,s.jsx)("option",{value:"300",children:"5min"}),(0,s.jsx)("option",{value:"600",children:"10min"}),(0,s.jsx)("option",{value:"1800",children:"30min"}),(0,s.jsx)("option",{value:"3600",children:"60min"})]})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,s.jsxs)("button",{type:"button",onClick:E,disabled:x,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[(0,s.jsx)(u.A,{size:12,className:x?"animate-spin":""}),n?.syncNow??"Sync Now"]}),(0,s.jsx)("button",{type:"button",onClick:R,disabled:N,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-destructive hover:border-destructive/50 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:n?.disableAutoSync??"Disable Auto-sync"})]}),S&&(0,s.jsx)("div",{className:"flex items-start gap-1.5 text-xs",role:"status","aria-live":"polite",children:"success"===S.type?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.A,{size:13,className:"text-success shrink-0 mt-0.5"}),(0,s.jsx)("span",{className:"text-success",children:S.text})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.A,{size:13,className:"text-destructive shrink-0 mt-0.5"}),(0,s.jsx)("div",{className:"space-y-0.5",children:S.text.split("\n").map((e,t)=>(0,s.jsx)("span",{className:`block ${t>0?"text-destructive/70":"text-destructive"}`,children:e},t))})]})}),L.length>0&&(0,s.jsxs)("div",{className:"pt-2 border-t border-border/50 space-y-3",children:[(0,s.jsx)("p",{className:"text-xs font-medium text-foreground",children:n?.conflictsTitle?.(L.length)??`Conflicts (${L.length})`}),(0,s.jsx)("p",{className:"text-2xs text-muted-foreground",children:n?.conflictExplain??"These files were changed on both this device and the remote. Choose which version to keep for each file."}),(0,s.jsx)("div",{className:"space-y-2",children:L.map((e,t)=>(0,s.jsx)(y,{file:e.file,time:e.time,syncT:n,onResolved:C},t))})]}),i.lastError&&0===L.length&&(0,s.jsxs)("div",{className:"flex items-start gap-2 text-xs p-2.5 rounded-lg bg-destructive/10 text-destructive",children:[(0,s.jsx)(a.A,{size:12,className:"shrink-0 mt-0.5"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"block",children:i.lastError}),b(i.lastError,i.remote,n)&&(0,s.jsx)("span",{className:"block text-destructive/70",children:b(i.lastError,i.remote,n)})]})]}),(0,s.jsx)(j,{syncT:n})]})})}},82676:(e,t,n)=>{n.d(t,{Y:()=>r});var s=n(65799);let r=(0,s.createServerReference)("403f309b0b9064daf90abb3c0d53b71af57e105875",s.callServer,void 0,s.findSourceMapURL,"undoDeleteAction")}}]);
|