@sifxprime/krouter 0.5.8 → 0.5.10
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/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +2 -2
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/environment/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/environment/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/environment.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/environment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/environment.segments/!KGRhc2hib2FyZCk/dashboard/environment/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/environment.segments/!KGRhc2hib2FyZCk/dashboard/environment.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/environment.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/environment.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/environment.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/environment.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/environment.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/environment.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing/page.js +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page.js +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +2 -2
- package/app/.next-cli-build/server/chunks/2722.js +5 -5
- package/app/.next-cli-build/server/chunks/4746.js +1 -1
- package/app/.next-cli-build/server/chunks/4884.js +1 -1
- package/app/.next-cli-build/server/chunks/6182.js +3 -3
- package/app/.next-cli-build/server/chunks/706.js +1 -1
- package/app/.next-cli-build/server/chunks/7153.js +1 -1
- package/app/.next-cli-build/server/chunks/7540.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/static/chunks/{1321-54b4a8da412f1ce5.js → 1321-d9e7dc08ac9b4899.js} +1 -1
- package/app/.next-cli-build/static/chunks/6069-a53e9fa5fee7d1c5.js +53 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-17dc1f57bf70c74c.js → page-493e738174ef8e56.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/{page-e2ad254d0354082d.js → page-c50244ab3401e007.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/landing/page-15b3f417802222cf.js +1 -0
- package/app/.next-cli-build/static/chunks/app/login/{page-ad3d88f7bdc056d8.js → page-a85af94847098e15.js} +1 -1
- package/app/cli/.build-home/.krouter/db/backups/{upgrade-0.5.3-to-0.5.4-0.5.4-20260618-020746 → upgrade-0.5.7-to-0.5.8-0.5.8-20260619-175641}/data.sqlite +0 -0
- package/app/cli/.build-home/.krouter/db/backups/{upgrade-0.5.4-to-0.5.5-0.5.5-20260618-022155 → upgrade-0.5.8-to-0.5.9-0.5.9-20260619-224700}/data.sqlite +0 -0
- package/app/cli/.build-home/.krouter/db/backups/upgrade-0.5.9-to-0.5.10-0.5.10-20260620-113606/data.sqlite +0 -0
- package/app/cli/.build-home/.krouter/db/data.sqlite +0 -0
- package/app/package.json +1 -1
- package/app/src/lib/updater/updater.js +5 -15
- package/app/src/mitm/server.js +30 -30
- package/cli.js +90 -59
- package/package.json +2 -3
- package/src/cli/tray/autostart.js +71 -166
- package/app/.next-cli-build/static/chunks/6069-16dfda64c3d754de.js +0 -53
- package/app/.next-cli-build/static/chunks/app/landing/page-6ea4d0e0696afdaf.js +0 -1
- /package/app/.next-cli-build/static/{cs-JIRZTHi1El1lFpGPT- → GDGTg2e2DDKb0eXW5xNDe}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{cs-JIRZTHi1El1lFpGPT- → GDGTg2e2DDKb0eXW5xNDe}/_ssgManifest.js +0 -0
package/cli.js
CHANGED
|
@@ -55,10 +55,9 @@ try { ensureSqliteRuntime({ silent: true }); } catch {}
|
|
|
55
55
|
// Self-heal tray runtime (systray for macOS/Linux only). Windows skipped.
|
|
56
56
|
try { ensureTrayRuntime({ silent: true }); } catch {}
|
|
57
57
|
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
// doesn't error every boot — user re-enables from the new tray when ready.
|
|
58
|
+
// Sweep autostart entries whose binary path no longer exists on disk (e.g. the
|
|
59
|
+
// user uninstalled the global kRouter then reinstalled to a different path).
|
|
60
|
+
// Cheap startup check; no-op when nothing's wrong.
|
|
62
61
|
try {
|
|
63
62
|
const { sweepDanglingAutostartEntries } = require("./src/cli/tray/autostart");
|
|
64
63
|
sweepDanglingAutostartEntries();
|
|
@@ -71,11 +70,7 @@ const INSTALL_CMD_LATEST = `npm i -g ${APP_NAME}@latest --prefer-online`;
|
|
|
71
70
|
const DEFAULT_PORT = 20128;
|
|
72
71
|
const DEFAULT_HOST = "0.0.0.0";
|
|
73
72
|
const MAX_PORT_ATTEMPTS = 10;
|
|
74
|
-
|
|
75
|
-
const PROCESS_IDENTIFIERS = [
|
|
76
|
-
'krouter',
|
|
77
|
-
'9router' // legacy — kept so an existing install still cleans up properly
|
|
78
|
-
];
|
|
73
|
+
const PROCESS_IDENTIFIERS = ['krouter'];
|
|
79
74
|
|
|
80
75
|
// Parse arguments
|
|
81
76
|
let port = DEFAULT_PORT;
|
|
@@ -142,36 +137,12 @@ function compareVersions(a, b) {
|
|
|
142
137
|
return 0;
|
|
143
138
|
}
|
|
144
139
|
|
|
145
|
-
// Get app data dir
|
|
140
|
+
// Get app data dir — kept in sync with src/mitm/paths.js
|
|
146
141
|
const DATA_DIR_NAME = "krouter";
|
|
147
|
-
const LEGACY_DATA_DIR_NAME = "9router";
|
|
148
|
-
function dataDirByName(name) {
|
|
149
|
-
return process.platform === "win32"
|
|
150
|
-
? path.join(process.env.APPDATA || "", name)
|
|
151
|
-
: path.join(os.homedir(), `.${name}`);
|
|
152
|
-
}
|
|
153
|
-
let legacyCoexistWarned = false;
|
|
154
142
|
function getAppDataDir() {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
if (!fs.existsSync(target) && fs.existsSync(legacy)) {
|
|
159
|
-
fs.renameSync(legacy, target);
|
|
160
|
-
console.log(`[cli] Migrated data dir: ${legacy} → ${target}`);
|
|
161
|
-
} else if (fs.existsSync(target) && fs.existsSync(legacy) && !legacyCoexistWarned) {
|
|
162
|
-
// Both dirs exist — auto-migration won't fire. Surface so user can reconcile.
|
|
163
|
-
// Don't auto-delete (user data); they decide how to merge / remove the legacy.
|
|
164
|
-
legacyCoexistWarned = true;
|
|
165
|
-
console.warn(
|
|
166
|
-
`[cli] Legacy ${legacy} still exists alongside ${target}. ` +
|
|
167
|
-
`New writes go to ${target}; the legacy is not read. ` +
|
|
168
|
-
`If unmerged settings exist there, back it up, merge manually, then: rm -rf ${legacy}`
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
} catch (e) {
|
|
172
|
-
console.warn(`[cli] Data-dir auto-migration failed (${e.code || e.message}); continuing with ${target}`);
|
|
173
|
-
}
|
|
174
|
-
return target;
|
|
143
|
+
return process.platform === "win32"
|
|
144
|
+
? path.join(process.env.APPDATA || "", DATA_DIR_NAME)
|
|
145
|
+
: path.join(os.homedir(), `.${DATA_DIR_NAME}`);
|
|
175
146
|
}
|
|
176
147
|
|
|
177
148
|
// Kill PID from file (best-effort, removes file after)
|
|
@@ -228,7 +199,7 @@ function killCloudflaredByAppPort(appPort) {
|
|
|
228
199
|
return pids;
|
|
229
200
|
}
|
|
230
201
|
|
|
231
|
-
// Kill all
|
|
202
|
+
// Kill all kRouter processes
|
|
232
203
|
function killAllAppProcesses(appPort) {
|
|
233
204
|
return new Promise((resolve) => {
|
|
234
205
|
try {
|
|
@@ -254,11 +225,11 @@ function killAllAppProcesses(appPort) {
|
|
|
254
225
|
});
|
|
255
226
|
const lines = output.split("\n").slice(1).filter(l => l.trim());
|
|
256
227
|
lines.forEach(line => {
|
|
257
|
-
// Whitelist: real node process running krouter
|
|
228
|
+
// Whitelist: real node process running krouter cli.js, or next-server.
|
|
258
229
|
// Avoids killing editors/grep/strace/cursor that just incidentally match the name.
|
|
259
230
|
const cmd = line.toLowerCase();
|
|
260
|
-
const hasAppName = cmd.includes("krouter")
|
|
261
|
-
const hasAppPath = cmd.includes("cli.js") || cmd.includes("\\krouter") || cmd.includes("/krouter")
|
|
231
|
+
const hasAppName = cmd.includes("krouter");
|
|
232
|
+
const hasAppPath = cmd.includes("cli.js") || cmd.includes("\\krouter") || cmd.includes("/krouter");
|
|
262
233
|
const isAppProcess =
|
|
263
234
|
(cmd.includes("node") && hasAppName && hasAppPath)
|
|
264
235
|
|| cmd.includes("next-server");
|
|
@@ -282,11 +253,11 @@ function killAllAppProcesses(appPort) {
|
|
|
282
253
|
const lines = output.split('\n');
|
|
283
254
|
|
|
284
255
|
lines.forEach(line => {
|
|
285
|
-
// Whitelist: real node process running krouter
|
|
256
|
+
// Whitelist: real node process running krouter cli.js, or next-server.
|
|
286
257
|
// Avoids killing grep/strace/editors/cursor that incidentally match the name.
|
|
287
258
|
const cmd = line.toLowerCase();
|
|
288
|
-
const hasAppName = cmd.includes("krouter")
|
|
289
|
-
const hasAppPath = cmd.includes("cli.js") || cmd.includes("/krouter")
|
|
259
|
+
const hasAppName = cmd.includes("krouter");
|
|
260
|
+
const hasAppPath = cmd.includes("cli.js") || cmd.includes("/krouter");
|
|
290
261
|
const isAppProcess =
|
|
291
262
|
(cmd.includes("node") && hasAppName && hasAppPath)
|
|
292
263
|
|| cmd.includes("next-server");
|
|
@@ -376,12 +347,15 @@ function killProxyByPidFile() {
|
|
|
376
347
|
} catch { }
|
|
377
348
|
}
|
|
378
349
|
|
|
379
|
-
// Kill
|
|
350
|
+
// Kill ALL processes listening on the given port. Returns true if any were killed.
|
|
351
|
+
// Previous version: on Windows only killed the first PID from netstat, missing
|
|
352
|
+
// parent/child pairs (next-server has a watcher + worker). Now sweeps all PIDs.
|
|
380
353
|
function killProcessOnPort(port) {
|
|
381
354
|
return new Promise((resolve) => {
|
|
355
|
+
let killedAny = false;
|
|
382
356
|
try {
|
|
383
357
|
const platform = process.platform;
|
|
384
|
-
|
|
358
|
+
const pidsToKill = new Set();
|
|
385
359
|
|
|
386
360
|
if (platform === "win32") {
|
|
387
361
|
try {
|
|
@@ -391,35 +365,47 @@ function killProcessOnPort(port) {
|
|
|
391
365
|
windowsHide: true,
|
|
392
366
|
timeout: 5000
|
|
393
367
|
}).trim();
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
pid
|
|
397
|
-
|
|
368
|
+
output.split('\n').filter(l => l.includes('LISTENING')).forEach(line => {
|
|
369
|
+
const pid = line.trim().split(/\s+/).pop();
|
|
370
|
+
if (pid && /^\d+$/.test(pid) && pid !== String(process.pid)) pidsToKill.add(pid);
|
|
371
|
+
});
|
|
372
|
+
for (const pid of pidsToKill) {
|
|
373
|
+
try {
|
|
374
|
+
execSync(`taskkill /F /T /PID ${pid} 2>nul`, { stdio: 'ignore', shell: true, windowsHide: true, timeout: 3000 });
|
|
375
|
+
killedAny = true;
|
|
376
|
+
} catch { /* PID may have already exited */ }
|
|
398
377
|
}
|
|
399
378
|
} catch (e) {
|
|
400
|
-
// Port is free or
|
|
379
|
+
// Port is free or netstat failed
|
|
401
380
|
}
|
|
402
381
|
} else {
|
|
403
|
-
// macOS/Linux
|
|
382
|
+
// macOS/Linux — lsof returns all PIDs holding the port (TCP, both IPv4 + IPv6)
|
|
404
383
|
try {
|
|
405
384
|
const pidOutput = execSync(`lsof -ti:${port}`, {
|
|
406
385
|
encoding: 'utf8',
|
|
407
386
|
stdio: ['pipe', 'pipe', 'ignore']
|
|
408
387
|
}).trim();
|
|
409
|
-
|
|
410
|
-
pid
|
|
411
|
-
|
|
388
|
+
pidOutput.split('\n').filter(Boolean).forEach(pid => {
|
|
389
|
+
if (pid !== String(process.pid)) pidsToKill.add(pid);
|
|
390
|
+
});
|
|
391
|
+
for (const pid of pidsToKill) {
|
|
392
|
+
try {
|
|
393
|
+
execSync(`kill -9 ${pid} 2>/dev/null`, { stdio: 'ignore', timeout: 3000 });
|
|
394
|
+
killedAny = true;
|
|
395
|
+
} catch { /* PID may have already exited */ }
|
|
412
396
|
}
|
|
413
397
|
} catch (e) {
|
|
414
|
-
// Port is free or
|
|
398
|
+
// Port is free or lsof errored
|
|
415
399
|
}
|
|
416
400
|
}
|
|
417
401
|
|
|
418
|
-
// Wait for
|
|
419
|
-
|
|
402
|
+
// Wait for kernel to release the socket (Windows is slow here, give it 1s).
|
|
403
|
+
// Then verify the port is actually free — if not, surface the result so
|
|
404
|
+
// the caller can decide whether to retry or fail-fast.
|
|
405
|
+
setTimeout(() => resolve(killedAny), platform === "win32" ? 1000 : 500);
|
|
420
406
|
} catch (err) {
|
|
421
407
|
// Silent fail - continue anyway
|
|
422
|
-
resolve();
|
|
408
|
+
resolve(false);
|
|
423
409
|
}
|
|
424
410
|
});
|
|
425
411
|
}
|
|
@@ -829,11 +815,56 @@ function startServer(latestVersion) {
|
|
|
829
815
|
});
|
|
830
816
|
}
|
|
831
817
|
|
|
818
|
+
// Detect "address already in use" in the captured crash log so we can take
|
|
819
|
+
// the correct recovery path (re-kill the port-holder) instead of the generic
|
|
820
|
+
// crash path (disable MITM — which is unrelated to a port conflict and only
|
|
821
|
+
// wastes the user's time).
|
|
822
|
+
function crashIsAddressInUse() {
|
|
823
|
+
return crashLog.some(l => /EADDRINUSE|address already in use|port.*in use/i.test(l));
|
|
824
|
+
}
|
|
825
|
+
|
|
832
826
|
function tryRestart(code) {
|
|
833
827
|
const aliveMs = Date.now() - serverStartTime;
|
|
834
828
|
// Reset counter if last run was stable
|
|
835
829
|
if (aliveMs >= RESTART_RESET_MS) restartCount = 0;
|
|
836
830
|
|
|
831
|
+
// EADDRINUSE recovery path: another process is holding the port. Most
|
|
832
|
+
// commonly a stale next-server from a previous run that didn't exit
|
|
833
|
+
// cleanly. Sweep all
|
|
834
|
+
// PIDs on the port (including parent+child pairs); if even after that the
|
|
835
|
+
// port is still occupied, exit with a clear actionable error instead of
|
|
836
|
+
// looping forever (which is what 0.5.7 did).
|
|
837
|
+
if (crashIsAddressInUse()) {
|
|
838
|
+
console.error(`\n⚠️ Port ${port} is in use by another process. Trying to free it...`);
|
|
839
|
+
Promise.all([killAllAppProcesses(port), killProcessOnPort(port)]).then(() => {
|
|
840
|
+
// Give the kernel one more breath, then probe.
|
|
841
|
+
setTimeout(() => {
|
|
842
|
+
const net = require("net");
|
|
843
|
+
const probe = net.createServer();
|
|
844
|
+
probe.once("error", (e) => {
|
|
845
|
+
if (e.code === "EADDRINUSE") {
|
|
846
|
+
console.error(`\n❌ Port ${port} is still occupied after attempted cleanup.`);
|
|
847
|
+
console.error(` Identify the holder (Windows: netstat -ano | findstr :${port}; macOS/Linux: lsof -i:${port}).`);
|
|
848
|
+
console.error(` Either stop that process, or run kRouter on a different port: krouter --port <N>`);
|
|
849
|
+
process.exit(1);
|
|
850
|
+
}
|
|
851
|
+
// Other error — try anyway
|
|
852
|
+
server = spawnServer();
|
|
853
|
+
attachServerEvents();
|
|
854
|
+
});
|
|
855
|
+
probe.once("listening", () => {
|
|
856
|
+
probe.close(() => {
|
|
857
|
+
restartCount = 0;
|
|
858
|
+
server = spawnServer();
|
|
859
|
+
attachServerEvents();
|
|
860
|
+
});
|
|
861
|
+
});
|
|
862
|
+
probe.listen(port, host);
|
|
863
|
+
}, 800);
|
|
864
|
+
});
|
|
865
|
+
return;
|
|
866
|
+
}
|
|
867
|
+
|
|
837
868
|
if (restartCount >= MAX_RESTARTS) {
|
|
838
869
|
console.error(`\n⚠️ Server crashed ${MAX_RESTARTS} times. Disabling MIT and restarting...`);
|
|
839
870
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sifxprime/krouter",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.10",
|
|
4
4
|
"description": "kRouter (Kodelyth Router) CLI — Kodelyth AI Infrastructure",
|
|
5
5
|
"homepage": "https://github.com/sifxprime/krouter",
|
|
6
6
|
"repository": {
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"bugs": "https://github.com/sifxprime/krouter/issues",
|
|
11
11
|
"bin": {
|
|
12
|
-
"krouter": "./cli.js"
|
|
13
|
-
"9router": "./cli.js"
|
|
12
|
+
"krouter": "./cli.js"
|
|
14
13
|
},
|
|
15
14
|
"files": [
|
|
16
15
|
"cli.js",
|
|
@@ -4,9 +4,7 @@ const os = require("os");
|
|
|
4
4
|
const { execSync } = require("child_process");
|
|
5
5
|
|
|
6
6
|
const APP_NAME = "krouter";
|
|
7
|
-
const LEGACY_APP_NAME = "9router";
|
|
8
7
|
const APP_LABEL = "com.krouter.autostart";
|
|
9
|
-
const LEGACY_APP_LABEL = "com.9router.autostart";
|
|
10
8
|
|
|
11
9
|
/**
|
|
12
10
|
* Resolve the absolute path to this package's cli.js.
|
|
@@ -14,7 +12,7 @@ const LEGACY_APP_LABEL = "com.9router.autostart";
|
|
|
14
12
|
* Order of preference:
|
|
15
13
|
* 1. Explicit `cliPath` argument — cleanest, used when called from running
|
|
16
14
|
* cli.js with `__filename`.
|
|
17
|
-
* 2. `process.argv[1]` if it's our cli.js — true when
|
|
15
|
+
* 2. `process.argv[1]` if it's our cli.js — true when kRouter is currently
|
|
18
16
|
* running and the tray menu fires this code path.
|
|
19
17
|
* 3. Compute relative to this file's own location. autostart.js lives at
|
|
20
18
|
* `<pkg>/src/cli/tray/autostart.js`, so cli.js is three levels up.
|
|
@@ -80,40 +78,29 @@ function disableAutoStart() {
|
|
|
80
78
|
* Check if autostart is enabled.
|
|
81
79
|
*
|
|
82
80
|
* On macOS, both the plist file and the launchd registration must be present —
|
|
83
|
-
* otherwise the tray menu would lie about the state (showing "
|
|
81
|
+
* otherwise the tray menu would lie about the state (showing "Enabled" even
|
|
84
82
|
* when launchd has the agent in a failed state or hasn't loaded it).
|
|
85
|
-
*
|
|
86
|
-
* Both the new label (com.krouter.autostart) and the legacy label
|
|
87
|
-
* (com.9router.autostart) count as enabled, so a pre-rename install still
|
|
88
|
-
* reads as enabled until the next enable/disable cleans up the legacy plist.
|
|
89
83
|
*/
|
|
90
84
|
function isAutoStartEnabled() {
|
|
91
85
|
const platform = process.platform;
|
|
92
86
|
|
|
93
87
|
try {
|
|
94
88
|
if (platform === "darwin") {
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
} catch { return false; }
|
|
105
|
-
};
|
|
106
|
-
if (fs.existsSync(newPlist) && checkLabel(APP_LABEL)) return true;
|
|
107
|
-
if (fs.existsSync(legacyPlist) && checkLabel(LEGACY_APP_LABEL)) return true;
|
|
108
|
-
return false;
|
|
89
|
+
const plistPath = path.join(os.homedir(), "Library", "LaunchAgents", `${APP_LABEL}.plist`);
|
|
90
|
+
if (!fs.existsSync(plistPath)) return false;
|
|
91
|
+
try {
|
|
92
|
+
execSync(`launchctl list ${APP_LABEL}`, {
|
|
93
|
+
stdio: ["ignore", "ignore", "ignore"],
|
|
94
|
+
timeout: 3000
|
|
95
|
+
});
|
|
96
|
+
return true;
|
|
97
|
+
} catch { return false; }
|
|
109
98
|
} else if (platform === "win32") {
|
|
110
99
|
const startupDir = path.join(process.env.APPDATA || "", "Microsoft", "Windows", "Start Menu", "Programs", "Startup");
|
|
111
|
-
return fs.existsSync(path.join(startupDir, `${APP_NAME}.vbs`))
|
|
112
|
-
|| fs.existsSync(path.join(startupDir, `${LEGACY_APP_NAME}.vbs`));
|
|
100
|
+
return fs.existsSync(path.join(startupDir, `${APP_NAME}.vbs`));
|
|
113
101
|
} else if (platform === "linux") {
|
|
114
102
|
const autostartDir = path.join(os.homedir(), ".config", "autostart");
|
|
115
|
-
return fs.existsSync(path.join(autostartDir, `${APP_NAME}.desktop`))
|
|
116
|
-
|| fs.existsSync(path.join(autostartDir, `${LEGACY_APP_NAME}.desktop`));
|
|
103
|
+
return fs.existsSync(path.join(autostartDir, `${APP_NAME}.desktop`));
|
|
117
104
|
}
|
|
118
105
|
} catch (e) {}
|
|
119
106
|
return false;
|
|
@@ -125,15 +112,14 @@ function isAutoStartEnabled() {
|
|
|
125
112
|
* Returns true when the current Node process IS the running instance that
|
|
126
113
|
* launchd is managing under our agent label.
|
|
127
114
|
*
|
|
128
|
-
* `launchctl unload <plist>`
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* be killing ourselves.
|
|
115
|
+
* `launchctl unload <plist>` for an Aqua user-domain agent sends SIGTERM to
|
|
116
|
+
* the running process. When the running kRouter cli.js was itself spawned by
|
|
117
|
+
* the autostart launchd agent (i.e. user enabled autostart, then rebooted,
|
|
118
|
+
* then clicked the tray icon's "Disable Auto-start" menu item), an unload
|
|
119
|
+
* would kill the very process executing the click handler — and the tray
|
|
120
|
+
* icon would disappear instead of the menu label flipping back to "Enable
|
|
121
|
+
* Auto-start". This helper lets the enable and disable paths sidestep that
|
|
122
|
+
* by skipping launchctl when we'd otherwise be killing ourselves.
|
|
137
123
|
*/
|
|
138
124
|
function isAgentSelfMacOS(label = APP_LABEL) {
|
|
139
125
|
try {
|
|
@@ -150,101 +136,55 @@ function isAgentSelfMacOS(label = APP_LABEL) {
|
|
|
150
136
|
}
|
|
151
137
|
|
|
152
138
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
* upgraded and clicked "Enable autostart" again), unloading the legacy plist
|
|
160
|
-
* would SIGTERM us mid-execution. Skip the unload in that case — just delete
|
|
161
|
-
* the plist file. launchd will release the agent on next login or quit, and
|
|
162
|
-
* the new agent we're about to write takes over from then on.
|
|
163
|
-
*/
|
|
164
|
-
function cleanupLegacyMacOSAutostart() {
|
|
165
|
-
const legacyPlist = path.join(os.homedir(), "Library", "LaunchAgents", `${LEGACY_APP_LABEL}.plist`);
|
|
166
|
-
if (!fs.existsSync(legacyPlist)) return;
|
|
167
|
-
|
|
168
|
-
if (!isAgentSelfMacOS(LEGACY_APP_LABEL)) {
|
|
169
|
-
try {
|
|
170
|
-
execSync(`launchctl unload "${legacyPlist}"`, { stdio: "ignore" });
|
|
171
|
-
} catch (e) { /* best effort — the file removal below is what actually matters */ }
|
|
172
|
-
}
|
|
173
|
-
try {
|
|
174
|
-
fs.unlinkSync(legacyPlist);
|
|
175
|
-
} catch (e) { /* leave it alone if we can't write */ }
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* One-time best-effort sweep run at every kRouter startup: detect autostart
|
|
180
|
-
* entries (LaunchAgent / Startup .vbs / .desktop) that point at an executable
|
|
181
|
-
* which no longer exists on disk, and remove them. Catches the upgrade case
|
|
182
|
-
* where a v0.5.6 user:
|
|
183
|
-
* 1. had autostart enabled (entry points at npm-global path of the old
|
|
184
|
-
* `9router` package)
|
|
185
|
-
* 2. ran `npm uninstall -g 9router` then `npm i -g @sifxprime/krouter`
|
|
186
|
-
* 3. the entry now references a binary that no longer exists, so launchd
|
|
187
|
-
* logs an error every boot and no tray appears.
|
|
188
|
-
*
|
|
189
|
-
* After cleanup the user can re-enable autostart from the new tray menu and
|
|
190
|
-
* the cleanup helpers above write a fresh entry pointing at the new install.
|
|
139
|
+
* Startup sweep: detect autostart entries pointing at a binary or script that
|
|
140
|
+
* no longer exists on disk and remove them. Catches the case where a user
|
|
141
|
+
* reinstalls kRouter to a different global path (nvm switch, Homebrew → npm,
|
|
142
|
+
* etc.) — the old entry references a missing binary and launchd logs an
|
|
143
|
+
* error every boot with no tray icon. After cleanup the user re-enables from
|
|
144
|
+
* the new tray menu and a fresh entry is written.
|
|
191
145
|
*/
|
|
192
146
|
function sweepDanglingAutostartEntries() {
|
|
193
147
|
if (process.platform === "darwin") {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
// is the npm-global lib path for the old "9router" package).
|
|
204
|
-
const scriptArg = argMatches.find((a) => /cli\.js$/.test(a) || a.includes("9router"));
|
|
205
|
-
if (scriptArg && !fs.existsSync(scriptArg)) {
|
|
206
|
-
if (!isAgentSelfMacOS(label)) {
|
|
207
|
-
try { execSync(`launchctl unload "${plistPath}"`, { stdio: "ignore" }); } catch { /* ignore */ }
|
|
208
|
-
}
|
|
209
|
-
fs.unlinkSync(plistPath);
|
|
148
|
+
const plistPath = path.join(os.homedir(), "Library", "LaunchAgents", `${APP_LABEL}.plist`);
|
|
149
|
+
if (!fs.existsSync(plistPath)) return;
|
|
150
|
+
try {
|
|
151
|
+
const content = fs.readFileSync(plistPath, "utf-8");
|
|
152
|
+
const argMatches = [...content.matchAll(/<string>([^<]+)<\/string>/g)].map((m) => m[1]);
|
|
153
|
+
const scriptArg = argMatches.find((a) => /cli\.js$/.test(a));
|
|
154
|
+
if (scriptArg && !fs.existsSync(scriptArg)) {
|
|
155
|
+
if (!isAgentSelfMacOS(APP_LABEL)) {
|
|
156
|
+
try { execSync(`launchctl unload "${plistPath}"`, { stdio: "ignore" }); } catch { /* ignore */ }
|
|
210
157
|
}
|
|
211
|
-
|
|
212
|
-
|
|
158
|
+
fs.unlinkSync(plistPath);
|
|
159
|
+
}
|
|
160
|
+
} catch { /* unreadable plist — skip */ }
|
|
213
161
|
} else if (process.platform === "win32") {
|
|
214
162
|
const startupDir = path.join(process.env.APPDATA || "", "Microsoft", "Windows", "Start Menu", "Programs", "Startup");
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
} catch { /* unreadable vbs — skip */ }
|
|
226
|
-
}
|
|
163
|
+
const vbsPath = path.join(startupDir, `${APP_NAME}.vbs`);
|
|
164
|
+
if (!fs.existsSync(vbsPath)) return;
|
|
165
|
+
try {
|
|
166
|
+
const content = fs.readFileSync(vbsPath, "utf-8");
|
|
167
|
+
// VBS shape: WshShell.Run """{nodePath}"" ""{cliJsPath}"" --tray --skip-update", 0, False
|
|
168
|
+
const m = content.match(/WshShell\.Run\s+"""([^"]+)""\s+""([^"]+)""/);
|
|
169
|
+
if (m && (!fs.existsSync(m[1]) || !fs.existsSync(m[2]))) {
|
|
170
|
+
fs.unlinkSync(vbsPath);
|
|
171
|
+
}
|
|
172
|
+
} catch { /* unreadable vbs — skip */ }
|
|
227
173
|
} else if (process.platform === "linux") {
|
|
228
174
|
const autostartDir = path.join(os.homedir(), ".config", "autostart");
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
} catch { /* unreadable desktop — skip */ }
|
|
239
|
-
}
|
|
175
|
+
const desktopPath = path.join(autostartDir, `${APP_NAME}.desktop`);
|
|
176
|
+
if (!fs.existsSync(desktopPath)) return;
|
|
177
|
+
try {
|
|
178
|
+
const content = fs.readFileSync(desktopPath, "utf-8");
|
|
179
|
+
const m = content.match(/^Exec=(\S+)\s+(\S+)/m);
|
|
180
|
+
if (m && (!fs.existsSync(m[1]) || !fs.existsSync(m[2]))) {
|
|
181
|
+
fs.unlinkSync(desktopPath);
|
|
182
|
+
}
|
|
183
|
+
} catch { /* unreadable desktop — skip */ }
|
|
240
184
|
}
|
|
241
185
|
}
|
|
242
186
|
|
|
243
187
|
function enableMacOS(cliPath) {
|
|
244
|
-
// Migrate away from the pre-rename plist BEFORE writing the new one so the
|
|
245
|
-
// user doesn't end up with two LaunchAgents both firing on next login.
|
|
246
|
-
cleanupLegacyMacOSAutostart();
|
|
247
|
-
|
|
248
188
|
const launchAgentsDir = path.join(os.homedir(), "Library", "LaunchAgents");
|
|
249
189
|
const plistPath = path.join(launchAgentsDir, `${APP_LABEL}.plist`);
|
|
250
190
|
|
|
@@ -258,9 +198,6 @@ function enableMacOS(cliPath) {
|
|
|
258
198
|
if (!routerScript) return false;
|
|
259
199
|
|
|
260
200
|
// Invoke node + cli.js directly with absolute paths — no shell wrapper.
|
|
261
|
-
// The previous design ran `zsh -l -c "..."` so a login shell would source
|
|
262
|
-
// nvm/.zshrc and set PATH; that's fragile (nvm.sh sourcing varies by user,
|
|
263
|
-
// some setups don't put node on PATH from a non-interactive login shell).
|
|
264
201
|
// EnvironmentVariables.PATH explicitly includes node's bin dir so child
|
|
265
202
|
// processes spawned by cli.js (npm install at runtime, etc.) resolve.
|
|
266
203
|
const launchPath = `${path.dirname(nodePath)}:/usr/local/bin:/usr/bin:/bin`;
|
|
@@ -304,37 +241,22 @@ function enableMacOS(cliPath) {
|
|
|
304
241
|
return true;
|
|
305
242
|
}
|
|
306
243
|
|
|
307
|
-
// Register with launchd in the current session.
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
try {
|
|
312
|
-
execSync(`launchctl unload "${plistPath}"`, { stdio: "ignore" });
|
|
313
|
-
} catch (e) {}
|
|
314
|
-
try {
|
|
315
|
-
execSync(`launchctl load -w "${plistPath}"`, { stdio: "ignore" });
|
|
316
|
-
} catch (e) {
|
|
317
|
-
// Even if load fails, the plist is on disk and will be picked up at next
|
|
318
|
-
// login; report success based on the file write.
|
|
244
|
+
// Register with launchd in the current session.
|
|
245
|
+
try { execSync(`launchctl unload "${plistPath}"`, { stdio: "ignore" }); } catch (e) {}
|
|
246
|
+
try { execSync(`launchctl load -w "${plistPath}"`, { stdio: "ignore" }); } catch (e) {
|
|
247
|
+
// Even if load fails, the plist is on disk and will be picked up at next login.
|
|
319
248
|
}
|
|
320
249
|
return true;
|
|
321
250
|
}
|
|
322
251
|
|
|
323
252
|
function disableMacOS() {
|
|
324
|
-
// Also clear any legacy plist still on disk — see cleanupLegacyMacOSAutostart.
|
|
325
|
-
cleanupLegacyMacOSAutostart();
|
|
326
|
-
|
|
327
253
|
const plistPath = path.join(os.homedir(), "Library", "LaunchAgents", `${APP_LABEL}.plist`);
|
|
328
254
|
|
|
329
255
|
// Don't kill ourselves: when the current process is the running agent,
|
|
330
256
|
// `launchctl unload` would send SIGTERM and the user clicking
|
|
331
|
-
// "Disable Auto-start" from the tray menu would lose their tray icon
|
|
332
|
-
// instead of just flipping the menu label. Skip the unload — removing the
|
|
333
|
-
// plist file is enough to prevent the agent from starting on next login.
|
|
257
|
+
// "Disable Auto-start" from the tray menu would lose their tray icon.
|
|
334
258
|
if (!isAgentSelfMacOS()) {
|
|
335
|
-
try {
|
|
336
|
-
execSync(`launchctl unload "${plistPath}"`, { stdio: "ignore" });
|
|
337
|
-
} catch (e) {}
|
|
259
|
+
try { execSync(`launchctl unload "${plistPath}"`, { stdio: "ignore" }); } catch (e) {}
|
|
338
260
|
}
|
|
339
261
|
|
|
340
262
|
if (fs.existsSync(plistPath)) {
|
|
@@ -348,21 +270,14 @@ function disableMacOS() {
|
|
|
348
270
|
function enableWindows(cliPath) {
|
|
349
271
|
const startupDir = path.join(process.env.APPDATA || "", "Microsoft", "Windows", "Start Menu", "Programs", "Startup");
|
|
350
272
|
const vbsPath = path.join(startupDir, `${APP_NAME}.vbs`);
|
|
351
|
-
const legacyVbsPath = path.join(startupDir, `${LEGACY_APP_NAME}.vbs`);
|
|
352
273
|
|
|
353
274
|
if (!fs.existsSync(startupDir)) return false;
|
|
354
275
|
|
|
355
|
-
// Migrate away from the pre-rename startup entry so we don't double-launch.
|
|
356
|
-
if (fs.existsSync(legacyVbsPath)) {
|
|
357
|
-
try { fs.unlinkSync(legacyVbsPath); } catch { /* best effort */ }
|
|
358
|
-
}
|
|
359
|
-
|
|
360
276
|
const nodePath = process.execPath;
|
|
361
277
|
const routerScript = getCliJsPath(cliPath);
|
|
362
278
|
if (!routerScript) return false;
|
|
363
279
|
|
|
364
|
-
// Run node + cli.js directly, hidden window.
|
|
365
|
-
// `9router.cmd` lookup that depended on the npm prefix path.
|
|
280
|
+
// Run node + cli.js directly, hidden window.
|
|
366
281
|
const vbsContent = `Set WshShell = CreateObject("WScript.Shell")
|
|
367
282
|
WshShell.Run """${nodePath}"" ""${routerScript}"" --tray --skip-update", 0, False
|
|
368
283
|
`;
|
|
@@ -372,11 +287,9 @@ WshShell.Run """${nodePath}"" ""${routerScript}"" --tray --skip-update", 0, Fals
|
|
|
372
287
|
|
|
373
288
|
function disableWindows() {
|
|
374
289
|
const startupDir = path.join(process.env.APPDATA || "", "Microsoft", "Windows", "Start Menu", "Programs", "Startup");
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
try { fs.unlinkSync(p); } catch { /* best effort */ }
|
|
379
|
-
}
|
|
290
|
+
const vbsPath = path.join(startupDir, `${APP_NAME}.vbs`);
|
|
291
|
+
if (fs.existsSync(vbsPath)) {
|
|
292
|
+
try { fs.unlinkSync(vbsPath); } catch { /* best effort */ }
|
|
380
293
|
}
|
|
381
294
|
return true;
|
|
382
295
|
}
|
|
@@ -386,18 +299,12 @@ function disableWindows() {
|
|
|
386
299
|
function enableLinux(cliPath) {
|
|
387
300
|
const autostartDir = path.join(os.homedir(), ".config", "autostart");
|
|
388
301
|
const desktopPath = path.join(autostartDir, `${APP_NAME}.desktop`);
|
|
389
|
-
const legacyDesktopPath = path.join(autostartDir, `${LEGACY_APP_NAME}.desktop`);
|
|
390
302
|
|
|
391
303
|
if (!fs.existsSync(autostartDir)) {
|
|
392
304
|
try { fs.mkdirSync(autostartDir, { recursive: true }); }
|
|
393
305
|
catch (e) { return false; }
|
|
394
306
|
}
|
|
395
307
|
|
|
396
|
-
// Migrate away from the pre-rename autostart entry so we don't double-launch.
|
|
397
|
-
if (fs.existsSync(legacyDesktopPath)) {
|
|
398
|
-
try { fs.unlinkSync(legacyDesktopPath); } catch { /* best effort */ }
|
|
399
|
-
}
|
|
400
|
-
|
|
401
308
|
const nodePath = process.execPath;
|
|
402
309
|
const routerScript = getCliJsPath(cliPath);
|
|
403
310
|
if (!routerScript) return false;
|
|
@@ -417,11 +324,9 @@ X-GNOME-Autostart-enabled=true
|
|
|
417
324
|
|
|
418
325
|
function disableLinux() {
|
|
419
326
|
const autostartDir = path.join(os.homedir(), ".config", "autostart");
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
try { fs.unlinkSync(p); } catch { /* best effort */ }
|
|
424
|
-
}
|
|
327
|
+
const desktopPath = path.join(autostartDir, `${APP_NAME}.desktop`);
|
|
328
|
+
if (fs.existsSync(desktopPath)) {
|
|
329
|
+
try { fs.unlinkSync(desktopPath); } catch { /* best effort */ }
|
|
425
330
|
}
|
|
426
331
|
return true;
|
|
427
332
|
}
|