mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-09-01 02:56:14 +00:00
* feat(desktop): add kimi-code:// deep link to surface the app after OAuth login The OAuth device-flow completion page can now link to kimi-code://auth/success to bring the desktop window to the front once the user finishes authorizing in the browser. No credentials ride the URL: the daemon's device-flow poll completes the login on its own and the renderer converges through its existing daemon polling, so the only deep-link action is showing the main window. - main/deep-link.ts: scheme constant, a strict URL whitelist (any webpage can fire the scheme), dev-only setAsDefaultProtocolClient, and the showMainWindow handler - main/app.ts: macOS open-url listener registered before ready, queued until launch routing is up (same pattern as second-instance argv); Windows/Linux deliver the URL via argv and are covered by the existing second-instance / cold-start paths - electron-builder.config.cjs: top-level protocols so packaged builds register the scheme (macOS Info.plist, Windows registry, Linux x-scheme-handler in the desktop file) * fix(desktop): gate second-instance deep links through the URL whitelist Windows/Linux deliver deep links as plain argv, and the second-instance handler surfaced the window unconditionally — any webpage could fire kimi-code://anything to steal focus. Route those argv through handleDeepLink so only whitelisted URLs focus the window; plain relaunches (no URL in argv) keep the existing always-show behavior, including launches queued before the window is ready. Also redact rejected deep-link URLs with redactUrlForLog before they reach the persistent log, so a malformed auth link cannot persist codes or tokens from its query or fragment. * feat(desktop): unify the host identity and mark OAuth logins as desktop-originated Resolve the desktop host identity once (main/identity.ts) and pass it to the embedded server through kap-server's new typed hostIdentity option: the OAuth device flow, model, and WebSearch requests now all carry the desktop's User-Agent + X-Msh-* set (kimi_code_desktop) with headers derived downstream — the manual X-Msh-Platform override, the header-seed plumbing, and the device-id scraping are gone. The engine version keeps traveling as serverVersion. first_launch now means the desktop product's first launch: a marker in ui-state.json instead of the shared device_id file, whose existence only proves some kimi-code product ran before (the CLI could silently swallow the desktop's first launch). No migration for existing installs. The OAuth verification URL opened from the login dialog and onboarding wizard gains from=kimi_code_desktop, so the authorization page can offer an "open the desktop app" handoff only for desktop-originated flows; CLI and web URLs stay bare. Design doc: docs/plans/2026-07-29-host-identity-unification.md. Requires the kimi-code host-identity unification (submodule bump follows its merge). * chore: bump kimi-code submodule to the host-identity branch Point the submodule at feat/host-identity-unification HEAD (f2a293c02) so the desktop builds against the new kap-server hostIdentity API. Update to the main merge commit once MoonshotAI/kimi-code#2382 lands. * docs(desktop): trim the host-identity native-todos entry to the divergence essentials * docs(desktop): drop the native-todos entries for deep link and host identity * docs: drop the review-tool mention from the host-identity plan * chore: bump kimi-code submodule to the merged host-identity commit Point the submodule at the main merge commit of the host-identity unification (MoonshotAI/kimi-code#2382), replacing the temporary pointer at the feature branch head. * chore: sync the lockfile with long-declared workspace deps kap-server's minidb and node-sdk's agent-core-v2/klient links were declared in package.json by earlier PRs but never written into the lockfile; pnpm install registers them now. * chore: drop the desktop host-identity changeset |
||
|---|---|---|
| .. | ||
| designs | ||
| plans | ||
| prototypes | ||
| specs | ||
| code-highlight-streaming-race.md | ||
| verify-phase0.md | ||