@sifxprime/krouter 0.5.6 → 0.5.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/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +3 -3
- 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.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.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/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.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 +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
- 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 +4 -4
- 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 +2 -2
- 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/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-mcp-registry/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +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.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.nft.json +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.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 +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
- 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 +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
- 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 +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- 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 +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
- 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 +7 -7
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- 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 +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +4 -4
- 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 +4 -4
- 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 +4 -4
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
- 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 +5 -5
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
- 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 +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
- 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_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 +5 -5
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
- 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 +4 -4
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
- 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 +3 -3
- package/app/.next-cli-build/server/chunks/2722.js +11 -11
- package/app/.next-cli-build/server/chunks/3529.js +1 -1
- package/app/.next-cli-build/server/chunks/412.js +1 -1
- 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/6811.js +1 -1
- package/app/.next-cli-build/server/chunks/7540.js +1 -1
- package/app/.next-cli-build/server/chunks/915.js +4 -4
- 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-af234bd85e3c185f.js → 1321-2fe31feb90864869.js} +1 -1
- package/app/.next-cli-build/static/chunks/{5497-203788669b701ef3.js → 5497-d86d12834588384d.js} +1 -1
- package/app/.next-cli-build/static/chunks/6069-16dfda64c3d754de.js +53 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/{page-442131997a40d2c6.js → page-e2ad254d0354082d.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-62a53f4e6cbff359.js → page-bff87b71ed7474bb.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/landing/{page-fcd19da612ef903f.js → page-63d88cc264ec2d94.js} +1 -1
- package/app/.next-cli-build/static/css/{9116556a04eab3b0.css → 259541b6d56c514e.css} +1 -1
- package/app/cli/.build-home/{.9router/db/backups/upgrade-0.5.1-to-0.5.2-0.5.2-20260617-190156 → .krouter/db}/data.sqlite +0 -0
- package/app/package.json +1 -1
- package/app/src/lib/updater/updater.js +16 -6
- package/app/src/mitm/server.js +32 -32
- package/cli.js +37 -17
- package/hooks/postinstall.js +5 -5
- package/hooks/sqliteRuntime.js +17 -5
- package/hooks/trayRuntime.js +6 -6
- package/package.json +1 -1
- package/src/cli/api/client.js +19 -5
- package/src/cli/menus/cliTools.js +10 -6
- package/src/cli/terminalUI.js +2 -2
- package/src/cli/tray/autostart.js +91 -29
- package/src/cli/tray/tray.js +5 -5
- package/app/.next-cli-build/static/chunks/6069-6837f0e0d8eeeb28.js +0 -53
- /package/app/.next-cli-build/static/{GetUlhAf36B8GeUeChMFM → SKcn2meuXc0Y31b-S6TXM}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{GetUlhAf36B8GeUeChMFM → SKcn2meuXc0Y31b-S6TXM}/_ssgManifest.js +0 -0
- /package/app/cli/.build-home/{.9router → .krouter}/db/backups/upgrade-0.5.2-to-0.5.3-0.5.3-20260617-190532/data.sqlite +0 -0
- /package/app/cli/.build-home/{.9router → .krouter}/db/backups/upgrade-0.5.3-to-0.5.4-0.5.4-20260618-020746/data.sqlite +0 -0
- /package/app/cli/.build-home/{.9router → .krouter}/db/backups/upgrade-0.5.4-to-0.5.5-0.5.5-20260618-022155/data.sqlite +0 -0
- /package/app/cli/.build-home/{.9router → .krouter}/db/backups/upgrade-0.5.5-to-0.5.6-0.5.6-20260618-023500/data.sqlite +0 -0
- /package/app/cli/.build-home/{.9router/db → .krouter/db/backups/upgrade-0.5.6-to-0.5.7-0.5.7-20260618-205427}/data.sqlite +0 -0
- /package/app/cli/.build-home/{.9router → .krouter}/jwt-secret +0 -0
- /package/app/cli/.build-home/{.9router → .krouter}/machine-id +0 -0
package/cli.js
CHANGED
|
@@ -47,7 +47,7 @@ const { ensureSqliteRuntime, buildEnvWithRuntime } = require("./hooks/sqliteRunt
|
|
|
47
47
|
const { ensureTrayRuntime } = require("./hooks/trayRuntime");
|
|
48
48
|
const args = process.argv.slice(2);
|
|
49
49
|
|
|
50
|
-
// Self-heal SQLite runtime deps (sql.js + better-sqlite3) into ~/.
|
|
50
|
+
// Self-heal SQLite runtime deps (sql.js + better-sqlite3) into ~/.krouter/runtime
|
|
51
51
|
// so the server can resolve them via NODE_PATH. Best-effort — sql.js is required,
|
|
52
52
|
// better-sqlite3 is optional. Logs to stderr only on failure.
|
|
53
53
|
try { ensureSqliteRuntime({ silent: true }); } catch {}
|
|
@@ -62,9 +62,10 @@ const INSTALL_CMD_LATEST = `npm i -g ${APP_NAME}@latest --prefer-online`;
|
|
|
62
62
|
const DEFAULT_PORT = 20128;
|
|
63
63
|
const DEFAULT_HOST = "0.0.0.0";
|
|
64
64
|
const MAX_PORT_ATTEMPTS = 10;
|
|
65
|
-
// Identifiers for killAllAppProcesses - only kill
|
|
65
|
+
// Identifiers for killAllAppProcesses - only kill our own app specifically (new + legacy names)
|
|
66
66
|
const PROCESS_IDENTIFIERS = [
|
|
67
|
-
'
|
|
67
|
+
'krouter',
|
|
68
|
+
'9router' // legacy — kept so an existing install still cleans up properly
|
|
68
69
|
];
|
|
69
70
|
|
|
70
71
|
// Parse arguments
|
|
@@ -132,11 +133,26 @@ function compareVersions(a, b) {
|
|
|
132
133
|
return 0;
|
|
133
134
|
}
|
|
134
135
|
|
|
135
|
-
// Get app data dir (
|
|
136
|
-
|
|
136
|
+
// Get app data dir (must match src/mitm/paths.js — same one-time auto-migration).
|
|
137
|
+
const DATA_DIR_NAME = "krouter";
|
|
138
|
+
const LEGACY_DATA_DIR_NAME = "9router";
|
|
139
|
+
function dataDirByName(name) {
|
|
137
140
|
return process.platform === "win32"
|
|
138
|
-
? path.join(process.env.APPDATA || "",
|
|
139
|
-
: path.join(os.homedir(),
|
|
141
|
+
? path.join(process.env.APPDATA || "", name)
|
|
142
|
+
: path.join(os.homedir(), `.${name}`);
|
|
143
|
+
}
|
|
144
|
+
function getAppDataDir() {
|
|
145
|
+
const target = dataDirByName(DATA_DIR_NAME);
|
|
146
|
+
const legacy = dataDirByName(LEGACY_DATA_DIR_NAME);
|
|
147
|
+
try {
|
|
148
|
+
if (!fs.existsSync(target) && fs.existsSync(legacy)) {
|
|
149
|
+
fs.renameSync(legacy, target);
|
|
150
|
+
console.log(`[cli] Migrated data dir: ${legacy} → ${target}`);
|
|
151
|
+
}
|
|
152
|
+
} catch (e) {
|
|
153
|
+
console.warn(`[cli] Data-dir auto-migration failed (${e.code || e.message}); continuing with ${target}`);
|
|
154
|
+
}
|
|
155
|
+
return target;
|
|
140
156
|
}
|
|
141
157
|
|
|
142
158
|
// Kill PID from file (best-effort, removes file after)
|
|
@@ -193,7 +209,7 @@ function killCloudflaredByAppPort(appPort) {
|
|
|
193
209
|
return pids;
|
|
194
210
|
}
|
|
195
211
|
|
|
196
|
-
// Kill all 9router processes
|
|
212
|
+
// Kill all krouter (or legacy 9router) processes
|
|
197
213
|
function killAllAppProcesses(appPort) {
|
|
198
214
|
return new Promise((resolve) => {
|
|
199
215
|
try {
|
|
@@ -219,11 +235,13 @@ function killAllAppProcesses(appPort) {
|
|
|
219
235
|
});
|
|
220
236
|
const lines = output.split("\n").slice(1).filter(l => l.trim());
|
|
221
237
|
lines.forEach(line => {
|
|
222
|
-
// Whitelist: real node process running 9router
|
|
223
|
-
// Avoids killing editors/grep/strace/cursor that just
|
|
238
|
+
// Whitelist: real node process running krouter (or legacy 9router) cli.js, or next-server.
|
|
239
|
+
// Avoids killing editors/grep/strace/cursor that just incidentally match the name.
|
|
224
240
|
const cmd = line.toLowerCase();
|
|
241
|
+
const hasAppName = cmd.includes("krouter") || cmd.includes("9router");
|
|
242
|
+
const hasAppPath = cmd.includes("cli.js") || cmd.includes("\\krouter") || cmd.includes("/krouter") || cmd.includes("\\9router") || cmd.includes("/9router");
|
|
225
243
|
const isAppProcess =
|
|
226
|
-
(cmd.includes("node") &&
|
|
244
|
+
(cmd.includes("node") && hasAppName && hasAppPath)
|
|
227
245
|
|| cmd.includes("next-server");
|
|
228
246
|
if (isAppProcess) {
|
|
229
247
|
const match = line.match(/^"(\d+)"/);
|
|
@@ -245,11 +263,13 @@ function killAllAppProcesses(appPort) {
|
|
|
245
263
|
const lines = output.split('\n');
|
|
246
264
|
|
|
247
265
|
lines.forEach(line => {
|
|
248
|
-
// Whitelist: real node process running 9router
|
|
249
|
-
// Avoids killing grep/strace/editors/cursor that incidentally match
|
|
266
|
+
// Whitelist: real node process running krouter (or legacy 9router) cli.js, or next-server.
|
|
267
|
+
// Avoids killing grep/strace/editors/cursor that incidentally match the name.
|
|
250
268
|
const cmd = line.toLowerCase();
|
|
269
|
+
const hasAppName = cmd.includes("krouter") || cmd.includes("9router");
|
|
270
|
+
const hasAppPath = cmd.includes("cli.js") || cmd.includes("/krouter") || cmd.includes("/9router");
|
|
251
271
|
const isAppProcess =
|
|
252
|
-
(cmd.includes("node") &&
|
|
272
|
+
(cmd.includes("node") && hasAppName && hasAppPath)
|
|
253
273
|
|| cmd.includes("next-server");
|
|
254
274
|
if (isAppProcess) {
|
|
255
275
|
const parts = line.trim().split(/\s+/);
|
|
@@ -714,7 +734,7 @@ function startServer(latestVersion) {
|
|
|
714
734
|
process.on("SIGHUP", () => {});
|
|
715
735
|
|
|
716
736
|
console.log(`\n⏳ Switching to tray mode... (icon already visible in menu bar)`);
|
|
717
|
-
console.log(`🔔
|
|
737
|
+
console.log(`🔔 kRouter is running in tray (PID: ${process.pid})`);
|
|
718
738
|
console.log(` Server: http://${displayHost}:${port}`);
|
|
719
739
|
console.log(`\n💡 You can close this terminal. Right-click tray icon to quit.\n`);
|
|
720
740
|
|
|
@@ -733,7 +753,7 @@ function startServer(latestVersion) {
|
|
|
733
753
|
});
|
|
734
754
|
bgProcess.unref();
|
|
735
755
|
|
|
736
|
-
console.log(`🔔
|
|
756
|
+
console.log(`🔔 kRouter is now running in background (PID: ${bgProcess.pid})`);
|
|
737
757
|
console.log(` Server: http://${displayHost}:${port}`);
|
|
738
758
|
console.log(`\n💡 You can close this terminal. Right-click tray icon to quit.\n`);
|
|
739
759
|
|
|
@@ -778,7 +798,7 @@ function startServer(latestVersion) {
|
|
|
778
798
|
if (restartCount >= MAX_RESTARTS) {
|
|
779
799
|
console.error(`\n⚠️ Server crashed ${MAX_RESTARTS} times. Disabling MIT and restarting...`);
|
|
780
800
|
try {
|
|
781
|
-
const dbPath = path.join(
|
|
801
|
+
const dbPath = path.join(getAppDataDir(), "db.json");
|
|
782
802
|
if (fs.existsSync(dbPath)) {
|
|
783
803
|
const db = JSON.parse(fs.readFileSync(dbPath, "utf-8"));
|
|
784
804
|
if (db.settings) db.settings.mitmEnabled = false;
|
package/hooks/postinstall.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// Postinstall: warm-up SQLite deps into ~/.
|
|
4
|
-
// `
|
|
3
|
+
// Postinstall: warm-up SQLite deps into ~/.krouter/runtime so the first
|
|
4
|
+
// `krouter` start doesn't need network. Failure here is non-fatal —
|
|
5
5
|
// cli.js will retry at runtime if anything is missing.
|
|
6
6
|
const { ensureSqliteRuntime } = require("./sqliteRuntime");
|
|
7
7
|
const { ensureTrayRuntime } = require("./trayRuntime");
|
|
8
8
|
|
|
9
9
|
try {
|
|
10
10
|
ensureSqliteRuntime({ silent: false });
|
|
11
|
-
console.log("[
|
|
11
|
+
console.log("[krouter] runtime SQLite deps ready");
|
|
12
12
|
} catch (e) {
|
|
13
|
-
console.warn(`[
|
|
13
|
+
console.warn(`[krouter] runtime warm-up skipped: ${e.message}`);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
try {
|
|
17
17
|
ensureTrayRuntime({ silent: false });
|
|
18
18
|
} catch (e) {
|
|
19
|
-
console.warn(`[
|
|
19
|
+
console.warn(`[krouter] tray runtime skipped: ${e.message}`);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
process.exit(0);
|
package/hooks/sqliteRuntime.js
CHANGED
|
@@ -8,11 +8,23 @@ const path = require("path");
|
|
|
8
8
|
|
|
9
9
|
const BETTER_SQLITE3_VERSION = "12.6.2";
|
|
10
10
|
|
|
11
|
+
// Must match src/mitm/paths.js / src/lib/dataDir.js — one-time auto-migration
|
|
12
|
+
// of ~/.9router → ~/.krouter. Idempotent.
|
|
13
|
+
function appNameDir(name) {
|
|
14
|
+
return process.platform === "win32"
|
|
15
|
+
? path.join(process.env.APPDATA || os.homedir(), name)
|
|
16
|
+
: path.join(os.homedir(), `.${name}`);
|
|
17
|
+
}
|
|
11
18
|
function getDataDir() {
|
|
12
19
|
if (process.env.DATA_DIR) return process.env.DATA_DIR;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
const target = appNameDir("krouter");
|
|
21
|
+
const legacy = appNameDir("9router");
|
|
22
|
+
try {
|
|
23
|
+
if (!fs.existsSync(target) && fs.existsSync(legacy)) {
|
|
24
|
+
fs.renameSync(legacy, target);
|
|
25
|
+
}
|
|
26
|
+
} catch { /* best effort */ }
|
|
27
|
+
return target;
|
|
16
28
|
}
|
|
17
29
|
|
|
18
30
|
function getRuntimeDir() {
|
|
@@ -31,10 +43,10 @@ function ensureRuntimeDir() {
|
|
|
31
43
|
const pkgPath = path.join(dir, "package.json");
|
|
32
44
|
if (!fs.existsSync(pkgPath)) {
|
|
33
45
|
fs.writeFileSync(pkgPath, JSON.stringify({
|
|
34
|
-
name: "
|
|
46
|
+
name: "krouter-runtime",
|
|
35
47
|
version: "1.0.0",
|
|
36
48
|
private: true,
|
|
37
|
-
description: "User-writable runtime deps for
|
|
49
|
+
description: "User-writable runtime deps for krouter (better-sqlite3 native binary)",
|
|
38
50
|
}, null, 2));
|
|
39
51
|
}
|
|
40
52
|
return dir;
|
package/hooks/trayRuntime.js
CHANGED
|
@@ -23,8 +23,8 @@ function hasSystray() {
|
|
|
23
23
|
// On Windows it was an AV false-positive risk; on macOS/Linux its bundled
|
|
24
24
|
// binary is broken on modern OS versions.
|
|
25
25
|
function cleanupLegacySystray({ silent = false } = {}) {
|
|
26
|
-
// 1) Runtime dir: ~/.
|
|
27
|
-
// 2) npm global nested: <npm_prefix>/node_modules/
|
|
26
|
+
// 1) Runtime dir: ~/.krouter/runtime/node_modules/systray (or %APPDATA% on Win)
|
|
27
|
+
// 2) npm global nested: <npm_prefix>/node_modules/krouter/node_modules/systray
|
|
28
28
|
// __dirname here = <pkg root>/hooks → up 1 = pkg root
|
|
29
29
|
const targets = [
|
|
30
30
|
path.join(getRuntimeNodeModules(), LEGACY_SYSTRAY_PKG),
|
|
@@ -34,9 +34,9 @@ function cleanupLegacySystray({ silent = false } = {}) {
|
|
|
34
34
|
if (fs.existsSync(dir)) {
|
|
35
35
|
try {
|
|
36
36
|
fs.rmSync(dir, { recursive: true, force: true });
|
|
37
|
-
if (!silent) console.log(`[
|
|
37
|
+
if (!silent) console.log(`[krouter][runtime] removed legacy systray: ${dir}`);
|
|
38
38
|
} catch (e) {
|
|
39
|
-
if (!silent) console.warn(`[
|
|
39
|
+
if (!silent) console.warn(`[krouter][runtime] failed to remove ${dir}: ${e.message}`);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -53,7 +53,7 @@ function chmodSystrayBin({ silent = false } = {}) {
|
|
|
53
53
|
try {
|
|
54
54
|
fs.chmodSync(binPath, 0o755);
|
|
55
55
|
} catch (e) {
|
|
56
|
-
if (!silent) console.warn(`[
|
|
56
|
+
if (!silent) console.warn(`[krouter][runtime] chmod tray bin failed: ${e.message}`);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -63,7 +63,7 @@ function ensureRuntimeDir() {
|
|
|
63
63
|
const pkgPath = path.join(dir, "package.json");
|
|
64
64
|
if (!fs.existsSync(pkgPath)) {
|
|
65
65
|
fs.writeFileSync(pkgPath, JSON.stringify({
|
|
66
|
-
name: "
|
|
66
|
+
name: "krouter-runtime",
|
|
67
67
|
version: "1.0.0",
|
|
68
68
|
private: true
|
|
69
69
|
}, null, 2));
|
package/package.json
CHANGED
package/src/cli/api/client.js
CHANGED
|
@@ -15,14 +15,28 @@ const DEFAULT_CONFIG = {
|
|
|
15
15
|
|
|
16
16
|
const CLI_TOKEN_HEADER = "x-9r-cli-token";
|
|
17
17
|
const CLI_TOKEN_SALT = "9r-cli-auth";
|
|
18
|
-
|
|
18
|
+
// Must match src/mitm/paths.js / src/lib/dataDir.js — one-time auto-migration
|
|
19
|
+
// of ~/.9router → ~/.krouter. Idempotent.
|
|
20
|
+
const APP_NAME = "krouter";
|
|
21
|
+
const LEGACY_APP_NAME = "9router";
|
|
19
22
|
|
|
20
|
-
function
|
|
21
|
-
if (process.env.DATA_DIR) return process.env.DATA_DIR;
|
|
23
|
+
function appNameDir(name) {
|
|
22
24
|
if (process.platform === "win32") {
|
|
23
|
-
return path.join(process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming"),
|
|
25
|
+
return path.join(process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming"), name);
|
|
24
26
|
}
|
|
25
|
-
return path.join(os.homedir(), `.${
|
|
27
|
+
return path.join(os.homedir(), `.${name}`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function getDataDir() {
|
|
31
|
+
if (process.env.DATA_DIR) return process.env.DATA_DIR;
|
|
32
|
+
const target = appNameDir(APP_NAME);
|
|
33
|
+
const legacy = appNameDir(LEGACY_APP_NAME);
|
|
34
|
+
try {
|
|
35
|
+
if (!fs.existsSync(target) && fs.existsSync(legacy)) {
|
|
36
|
+
fs.renameSync(legacy, target);
|
|
37
|
+
}
|
|
38
|
+
} catch { /* best effort */ }
|
|
39
|
+
return target;
|
|
26
40
|
}
|
|
27
41
|
|
|
28
42
|
const MACHINE_ID_FILE = path.join(getDataDir(), "machine-id");
|
|
@@ -277,8 +277,10 @@ async function buildDroidHeader() {
|
|
|
277
277
|
].join("\n");
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
// Extract
|
|
281
|
-
const custom = settings?.customModels?.find(
|
|
280
|
+
// Extract kRouter custom model config (read either new or legacy id for compat)
|
|
281
|
+
const custom = settings?.customModels?.find(
|
|
282
|
+
m => m.id === "custom:kRouter-0" || m.id === "custom:9Router-0"
|
|
283
|
+
);
|
|
282
284
|
const lines = [`Status: ${COLORS.green}✓ Configured${COLORS.reset}`];
|
|
283
285
|
if (custom?.baseUrl) lines.push(`Endpoint: ${COLORS.cyan}${custom.baseUrl}${COLORS.reset}`);
|
|
284
286
|
if (custom?.model) lines.push(`Model: ${COLORS.dim}${custom.model}${COLORS.reset}`);
|
|
@@ -360,10 +362,12 @@ async function buildOpenClawHeader() {
|
|
|
360
362
|
].join("\n");
|
|
361
363
|
}
|
|
362
364
|
|
|
363
|
-
// Extract
|
|
364
|
-
const provider = settings?.models?.providers?.["9router"];
|
|
365
|
+
// Extract kRouter provider config (read either new or legacy key for compat)
|
|
366
|
+
const provider = settings?.models?.providers?.["krouter"] ?? settings?.models?.providers?.["9router"];
|
|
365
367
|
const primary = settings?.agents?.defaults?.model?.primary || "";
|
|
366
|
-
const model =
|
|
368
|
+
const model = /^(?:krouter|9router)\//.test(primary)
|
|
369
|
+
? primary.replace(/^(?:krouter|9router)\//, "")
|
|
370
|
+
: (provider?.models?.[0]?.id || "");
|
|
367
371
|
const lines = [`Status: ${COLORS.green}✓ Configured${COLORS.reset}`];
|
|
368
372
|
if (provider?.baseUrl) lines.push(`Endpoint: ${COLORS.cyan}${provider.baseUrl}${COLORS.reset}`);
|
|
369
373
|
if (model) lines.push(`Model: ${COLORS.dim}${model}${COLORS.reset}`);
|
|
@@ -585,7 +589,7 @@ async function showCliToolsMenu(port, breadcrumb = []) {
|
|
|
585
589
|
await showMenuWithBack({
|
|
586
590
|
title: "🔧 CLI Tools",
|
|
587
591
|
breadcrumb,
|
|
588
|
-
headerContent: `Configure CLI tools to use
|
|
592
|
+
headerContent: `Configure CLI tools to use kRouter\nEndpoint: ${endpoint}`,
|
|
589
593
|
items: [
|
|
590
594
|
{
|
|
591
595
|
label: "Claude Code",
|
package/src/cli/terminalUI.js
CHANGED
|
@@ -67,14 +67,14 @@ async function startTerminalUI(port) {
|
|
|
67
67
|
// Configure API client
|
|
68
68
|
api.configure({ port });
|
|
69
69
|
|
|
70
|
-
const basePath = ["
|
|
70
|
+
const basePath = ["kRouter"];
|
|
71
71
|
|
|
72
72
|
// Prime header cache before first render
|
|
73
73
|
await refreshHeaderBg(port);
|
|
74
74
|
|
|
75
75
|
// Main menu
|
|
76
76
|
await showMenuWithBack({
|
|
77
|
-
title: "📡
|
|
77
|
+
title: "📡 kRouter Terminal UI",
|
|
78
78
|
breadcrumb: basePath,
|
|
79
79
|
headerContent: () => getHeader(port),
|
|
80
80
|
items: [
|
|
@@ -3,8 +3,10 @@ const path = require("path");
|
|
|
3
3
|
const os = require("os");
|
|
4
4
|
const { execSync } = require("child_process");
|
|
5
5
|
|
|
6
|
-
const APP_NAME = "
|
|
7
|
-
const
|
|
6
|
+
const APP_NAME = "krouter";
|
|
7
|
+
const LEGACY_APP_NAME = "9router";
|
|
8
|
+
const APP_LABEL = "com.krouter.autostart";
|
|
9
|
+
const LEGACY_APP_LABEL = "com.9router.autostart";
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* Resolve the absolute path to this package's cli.js.
|
|
@@ -80,29 +82,38 @@ function disableAutoStart() {
|
|
|
80
82
|
* On macOS, both the plist file and the launchd registration must be present —
|
|
81
83
|
* otherwise the tray menu would lie about the state (showing "✓ Enabled" even
|
|
82
84
|
* 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.
|
|
83
89
|
*/
|
|
84
90
|
function isAutoStartEnabled() {
|
|
85
91
|
const platform = process.platform;
|
|
86
92
|
|
|
87
93
|
try {
|
|
88
94
|
if (platform === "darwin") {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
95
|
+
const newPlist = path.join(os.homedir(), "Library", "LaunchAgents", `${APP_LABEL}.plist`);
|
|
96
|
+
const legacyPlist = path.join(os.homedir(), "Library", "LaunchAgents", `${LEGACY_APP_LABEL}.plist`);
|
|
97
|
+
const checkLabel = (label) => {
|
|
98
|
+
try {
|
|
99
|
+
execSync(`launchctl list ${label}`, {
|
|
100
|
+
stdio: ["ignore", "ignore", "ignore"],
|
|
101
|
+
timeout: 3000
|
|
102
|
+
});
|
|
103
|
+
return true;
|
|
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;
|
|
100
109
|
} else if (platform === "win32") {
|
|
101
|
-
const
|
|
102
|
-
return fs.existsSync(
|
|
110
|
+
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`));
|
|
103
113
|
} else if (platform === "linux") {
|
|
104
|
-
const
|
|
105
|
-
return fs.existsSync(
|
|
114
|
+
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`));
|
|
106
117
|
}
|
|
107
118
|
} catch (e) {}
|
|
108
119
|
return false;
|
|
@@ -124,9 +135,9 @@ function isAutoStartEnabled() {
|
|
|
124
135
|
* and disable paths sidestep that by skipping launchctl when we'd otherwise
|
|
125
136
|
* be killing ourselves.
|
|
126
137
|
*/
|
|
127
|
-
function isAgentSelfMacOS() {
|
|
138
|
+
function isAgentSelfMacOS(label = APP_LABEL) {
|
|
128
139
|
try {
|
|
129
|
-
const output = execSync(`launchctl list ${
|
|
140
|
+
const output = execSync(`launchctl list ${label}`, {
|
|
130
141
|
encoding: "utf8",
|
|
131
142
|
stdio: ["ignore", "pipe", "ignore"],
|
|
132
143
|
timeout: 3000
|
|
@@ -138,7 +149,37 @@ function isAgentSelfMacOS() {
|
|
|
138
149
|
}
|
|
139
150
|
}
|
|
140
151
|
|
|
152
|
+
/**
|
|
153
|
+
* One-time migration: remove the legacy `com.9router.autostart` LaunchAgent so
|
|
154
|
+
* upgrading installs don't end up with TWO kRouter processes firing on every
|
|
155
|
+
* login (legacy + new agent both registered with launchd).
|
|
156
|
+
*
|
|
157
|
+
* Self-kill protection: if the current process IS the running legacy agent
|
|
158
|
+
* (i.e. user enabled autostart under the old version, then rebooted, then
|
|
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
|
+
|
|
141
178
|
function enableMacOS(cliPath) {
|
|
179
|
+
// Migrate away from the pre-rename plist BEFORE writing the new one so the
|
|
180
|
+
// user doesn't end up with two LaunchAgents both firing on next login.
|
|
181
|
+
cleanupLegacyMacOSAutostart();
|
|
182
|
+
|
|
142
183
|
const launchAgentsDir = path.join(os.homedir(), "Library", "LaunchAgents");
|
|
143
184
|
const plistPath = path.join(launchAgentsDir, `${APP_LABEL}.plist`);
|
|
144
185
|
|
|
@@ -182,9 +223,9 @@ function enableMacOS(cliPath) {
|
|
|
182
223
|
<key>KeepAlive</key>
|
|
183
224
|
<false/>
|
|
184
225
|
<key>StandardOutPath</key>
|
|
185
|
-
<string>/tmp/
|
|
226
|
+
<string>/tmp/krouter.log</string>
|
|
186
227
|
<key>StandardErrorPath</key>
|
|
187
|
-
<string>/tmp/
|
|
228
|
+
<string>/tmp/krouter.error.log</string>
|
|
188
229
|
</dict>
|
|
189
230
|
</plist>`;
|
|
190
231
|
|
|
@@ -215,6 +256,9 @@ function enableMacOS(cliPath) {
|
|
|
215
256
|
}
|
|
216
257
|
|
|
217
258
|
function disableMacOS() {
|
|
259
|
+
// Also clear any legacy plist still on disk — see cleanupLegacyMacOSAutostart.
|
|
260
|
+
cleanupLegacyMacOSAutostart();
|
|
261
|
+
|
|
218
262
|
const plistPath = path.join(os.homedir(), "Library", "LaunchAgents", `${APP_LABEL}.plist`);
|
|
219
263
|
|
|
220
264
|
// Don't kill ourselves: when the current process is the running agent,
|
|
@@ -239,9 +283,15 @@ function disableMacOS() {
|
|
|
239
283
|
function enableWindows(cliPath) {
|
|
240
284
|
const startupDir = path.join(process.env.APPDATA || "", "Microsoft", "Windows", "Start Menu", "Programs", "Startup");
|
|
241
285
|
const vbsPath = path.join(startupDir, `${APP_NAME}.vbs`);
|
|
286
|
+
const legacyVbsPath = path.join(startupDir, `${LEGACY_APP_NAME}.vbs`);
|
|
242
287
|
|
|
243
288
|
if (!fs.existsSync(startupDir)) return false;
|
|
244
289
|
|
|
290
|
+
// Migrate away from the pre-rename startup entry so we don't double-launch.
|
|
291
|
+
if (fs.existsSync(legacyVbsPath)) {
|
|
292
|
+
try { fs.unlinkSync(legacyVbsPath); } catch { /* best effort */ }
|
|
293
|
+
}
|
|
294
|
+
|
|
245
295
|
const nodePath = process.execPath;
|
|
246
296
|
const routerScript = getCliJsPath(cliPath);
|
|
247
297
|
if (!routerScript) return false;
|
|
@@ -256,9 +306,12 @@ WshShell.Run """${nodePath}"" ""${routerScript}"" --tray --skip-update", 0, Fals
|
|
|
256
306
|
}
|
|
257
307
|
|
|
258
308
|
function disableWindows() {
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
|
|
309
|
+
const startupDir = path.join(process.env.APPDATA || "", "Microsoft", "Windows", "Start Menu", "Programs", "Startup");
|
|
310
|
+
for (const name of [`${APP_NAME}.vbs`, `${LEGACY_APP_NAME}.vbs`]) {
|
|
311
|
+
const p = path.join(startupDir, name);
|
|
312
|
+
if (fs.existsSync(p)) {
|
|
313
|
+
try { fs.unlinkSync(p); } catch { /* best effort */ }
|
|
314
|
+
}
|
|
262
315
|
}
|
|
263
316
|
return true;
|
|
264
317
|
}
|
|
@@ -268,20 +321,26 @@ function disableWindows() {
|
|
|
268
321
|
function enableLinux(cliPath) {
|
|
269
322
|
const autostartDir = path.join(os.homedir(), ".config", "autostart");
|
|
270
323
|
const desktopPath = path.join(autostartDir, `${APP_NAME}.desktop`);
|
|
324
|
+
const legacyDesktopPath = path.join(autostartDir, `${LEGACY_APP_NAME}.desktop`);
|
|
271
325
|
|
|
272
326
|
if (!fs.existsSync(autostartDir)) {
|
|
273
327
|
try { fs.mkdirSync(autostartDir, { recursive: true }); }
|
|
274
328
|
catch (e) { return false; }
|
|
275
329
|
}
|
|
276
330
|
|
|
331
|
+
// Migrate away from the pre-rename autostart entry so we don't double-launch.
|
|
332
|
+
if (fs.existsSync(legacyDesktopPath)) {
|
|
333
|
+
try { fs.unlinkSync(legacyDesktopPath); } catch { /* best effort */ }
|
|
334
|
+
}
|
|
335
|
+
|
|
277
336
|
const nodePath = process.execPath;
|
|
278
337
|
const routerScript = getCliJsPath(cliPath);
|
|
279
338
|
if (!routerScript) return false;
|
|
280
339
|
|
|
281
340
|
const desktopContent = `[Desktop Entry]
|
|
282
341
|
Type=Application
|
|
283
|
-
Name=
|
|
284
|
-
Comment=
|
|
342
|
+
Name=kRouter
|
|
343
|
+
Comment=kRouter API Proxy
|
|
285
344
|
Exec=${nodePath} ${routerScript} --tray --skip-update
|
|
286
345
|
Hidden=false
|
|
287
346
|
NoDisplay=false
|
|
@@ -292,9 +351,12 @@ X-GNOME-Autostart-enabled=true
|
|
|
292
351
|
}
|
|
293
352
|
|
|
294
353
|
function disableLinux() {
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
|
|
354
|
+
const autostartDir = path.join(os.homedir(), ".config", "autostart");
|
|
355
|
+
for (const name of [`${APP_NAME}.desktop`, `${LEGACY_APP_NAME}.desktop`]) {
|
|
356
|
+
const p = path.join(autostartDir, name);
|
|
357
|
+
if (fs.existsSync(p)) {
|
|
358
|
+
try { fs.unlinkSync(p); } catch { /* best effort */ }
|
|
359
|
+
}
|
|
298
360
|
}
|
|
299
361
|
return true;
|
|
300
362
|
}
|
package/src/cli/tray/tray.js
CHANGED
|
@@ -58,7 +58,7 @@ function initTray(options) {
|
|
|
58
58
|
*/
|
|
59
59
|
function buildMenuItems(port, autostartEnabled) {
|
|
60
60
|
return [
|
|
61
|
-
{ title: `
|
|
61
|
+
{ title: `kRouter (Port ${port})`, tooltip: "Server is running", enabled: false },
|
|
62
62
|
{ title: "Open Dashboard", tooltip: "Open in browser", enabled: true },
|
|
63
63
|
{
|
|
64
64
|
title: autostartEnabled ? "✓ Auto-start Enabled" : "Enable Auto-start",
|
|
@@ -121,7 +121,7 @@ function initWindowsTray(options) {
|
|
|
121
121
|
|
|
122
122
|
trayInstance = initWinTray({
|
|
123
123
|
iconPath,
|
|
124
|
-
tooltip: `
|
|
124
|
+
tooltip: `kRouter - Port ${port}`,
|
|
125
125
|
items,
|
|
126
126
|
onClick: (index) => {
|
|
127
127
|
handleClick(index, options, (newEnabled) => {
|
|
@@ -204,7 +204,7 @@ function initUnixTray(options) {
|
|
|
204
204
|
// because template mode only uses the alpha channel.
|
|
205
205
|
isTemplateIcon: false,
|
|
206
206
|
title: "",
|
|
207
|
-
tooltip: `
|
|
207
|
+
tooltip: `kRouter - Port ${port}`,
|
|
208
208
|
items
|
|
209
209
|
};
|
|
210
210
|
|
|
@@ -230,7 +230,7 @@ function initUnixTray(options) {
|
|
|
230
230
|
// failures (binary crash, EACCES, etc.) so users can see why the icon
|
|
231
231
|
// didn't appear instead of getting a misleading "running in tray" log.
|
|
232
232
|
trayInstance.ready().catch((err) => {
|
|
233
|
-
process.stderr.write(`[
|
|
233
|
+
process.stderr.write(`[krouter] tray failed to start: ${err && err.message ? err.message : err}\n`);
|
|
234
234
|
});
|
|
235
235
|
} else {
|
|
236
236
|
trayInstance.onReady(() => {});
|
|
@@ -239,7 +239,7 @@ function initUnixTray(options) {
|
|
|
239
239
|
|
|
240
240
|
return trayInstance;
|
|
241
241
|
} catch (err) {
|
|
242
|
-
process.stderr.write(`[
|
|
242
|
+
process.stderr.write(`[krouter] tray init error: ${err.message}\n`);
|
|
243
243
|
return null;
|
|
244
244
|
}
|
|
245
245
|
}
|