Commit graph

569 commits

Author SHA1 Message Date
qer
e9f3b246e5 fix(web): stop yanking the view to bottom when scrolling up mid-thinking
onPanesScroll swallowed any scroll event within 100ms of a programmatic scroll
to dodge the smooth-scroll echo. But the streaming follow re-pins every ~120ms
during the thinking phase, so a user's upward scroll almost always landed inside
a fresh window and was ignored — following never flipped off and the view
snapped back to the bottom. The window is only needed for the async smooth path
(the pill); the synchronous streaming scroll updates lastScrollTop inline and
its echo event is a no-op. Scope the suppression window to smooth scrolls only.
2026-06-13 11:55:22 +08:00
qer
4154fc0ba9 fix(web): roll back model picker when a model switch fails
setModel optimistically shows the chosen model, but on failure it only pushed a
warning and left the picker on the new value — so a switch that never reached
the daemon (socket dropped / daemon unreachable) looked like it succeeded.
Capture the previous model and restore it when updateSession throws, keeping the
best-effort status refresh from rolling back a switch that did land.
2026-06-13 11:52:59 +08:00
qer
c6a4f264be fix(web): recover live streaming after a ws reconnect
A volatile assistant/thinking delta whose pre-append offset is 0 while the
projector still believes it is mid-stream means the daemon began a fresh
assistant stream (new turn / retry) whose durable turn.started raced past the
client's cursor on reconnect and was never re-delivered. Every such delta then
had offset < turnTextLen and hit the silent skip path (which, unlike gap, never
triggers a resync), so streaming stayed dead until a full page reload.

Reset the per-turn stream counter when a delta arrives at offset 0 mid-stream,
and clear both counters on turn.ended, so a missed turn boundary can no longer
wedge delta alignment. Adds reconnect-streaming regression tests.
2026-06-13 11:50:30 +08:00
haozhe.yang
c8b16e8eab feat(server): local-only foreground server with TUI ready banner
- remove --host option from server run/install/web commands (force 127.0.0.1)\n- default foreground logs to silent; add styled ready banner when logs off\n- change foreground stop suggestion from pkill to kill -TERM <pid>\n- update service install plans, tests, and bilingual docs accordingly
2026-06-12 16:09:21 +08:00
haozhe.yang
2711c36760 feat(server): expose openapi and asyncapi, gate swagger ui behind flag
- unconditionally expose /openapi.json and /asyncapi.json\n- add --swagger flag to kimi server run\n- mount Swagger UI at /documentation only when --swagger is passed\n- generate AsyncAPI document from ws-control schemas\n- update tests and docs
2026-06-12 15:42:45 +08:00
qer
8c8dc8c75b Merge remote-tracking branch 'origin/main' into feat/web
# Conflicts:
#	.gitignore
2026-06-12 13:40:12 +08:00
qer
a9ac723d80 fix(web): make model switching take effect in the new-session draft state
The onboarding composer (workspace draft) has no backend session yet, so
setModel() hit the early return and the pick was silently dropped. The
pick is now remembered as draftModel: the status line reflects it
immediately, and the first prompt passes it to createSession so the new
session starts on the chosen model.

Also keep the user's model when the daemon echoes model as '' — both in
/status refreshes and in snapshot syncs racing an optimistic setModel —
and guard the createSession echo the same way.
2026-06-12 13:11:50 +08:00
qer
890db95567 feat(web): render slash-command skill activations as a labeled chip
A user turn whose origin metadata marks it as a skill_activation
(trigger user-slash) no longer dumps the raw XML block into the chat:
the turn shows only the user-provided args plus an "activated skill"
label with the skill name.
2026-06-12 12:55:23 +08:00
qer
719ee4ac76 feat(web): add opt-in KAP debug panel tracing REST and WS traffic
Enable with ?debug=1 or localStorage kimi-web.debug=1. A ring buffer
(1000 entries, redacted secrets, truncated payloads) records every REST
call (method/path/requestId/status/envelope code/duration) and WS frame
(lifecycle, outbound control frames, inbound events with session/seq/
offset) as a side channel — request ordering and error handling are
unchanged. The panel offers a filterable timeline, per-entry JSON with
copy, JSONL export, and per-session/event-type aggregation.
2026-06-12 12:55:23 +08:00
haozhe.yang
f71ef6d466 feat(server): add session skill list and activation endpoints
- add GET /sessions/{session_id}/skills and POST .../{skill_name}:activate routes\n- add skill protocol schemas (SkillDescriptor, list/activate DTOs) and error codes\n- add ISkillService/SkillService to list and activate skills via core RPC\n- map skill errors to protocol envelopes (40415, 40912)\n- add end-to-end tests covering list, activate, unknown session/skill, and unsupported action
2026-06-12 12:34:14 +08:00
_Kerman
dff9fd4e32
chore: use raw query imports for prompt sources (#682) 2026-06-12 11:47:44 +08:00
_Kerman
2f7218cba4
test: fix resume test assertions for compaction replay records (#681) 2026-06-12 11:32:30 +08:00
liruifengv
e900854be8
docs(changelog): sync 0.14.1 from apps/kimi-code/CHANGELOG.md (#680) 2026-06-12 11:27:49 +08:00
Haozhe
c39c62590d
feat(skill): qualify sub-skill names with parent prefix (#651)
* feat(skill): qualify sub-skill names with parent prefix

- qualify sub-skill names with parent prefix and set isSubSkill metadata\n- hide sub-skills from the model skill listing
- expose sub-skills as dotted slash commands in TUI
- update slash command docs for English and Chinese
- align built-in sub-skill local names with their directories
2026-06-12 11:12:52 +08:00
_Kerman
911e7c3fcf
fix: replay compaction records on resume (#617) 2026-06-12 11:10:52 +08:00
haozhe.yang
03e994257c feat(services): restore full message history from wire log for compacted sessions
- add wire.jsonl transcript reader (readWireRecords, readWireTranscript, reduceWireRecords)\n- rewrite MessageService to use wire log instead of live context history\n- add createdAtMsOverride to toProtocolMessage for wire-derived timestamps\n- add transcript cache with LRU eviction and mtime-based invalidation\n- append unflushed live tail when memory is ahead of the wire file\n- degrade to live context view on wire read/parse failures\n- add comprehensive tests for compaction, undo, clear, blob rehydration
2026-06-12 11:10:22 +08:00
_Kerman
dcf30754d0
feat: stream shell tool output (#676) 2026-06-12 11:10:20 +08:00
github-actions[bot]
0a3e87f05a
ci: release packages (#629)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-12 10:54:44 +08:00
qer
2e5a9e9512 chore(deps): drop markstream-vue patch, archive the fix recipe
The pnpm patch for list-nested code blocks hanging in production builds
is reverted in favor of an upstream fix; the verified recipe is archived
in reports/markstream-nested-codeblock-fix.md.

Upstream report: https://github.com/Simon-He95/markstream-vue/issues/498
2026-06-12 03:58:56 +08:00
qer
cbd9796dfb fix(web): merge assistant snapshot turns without prompt ids 2026-06-12 03:50:39 +08:00
qer
478ba49b3c style(web): hide session time on hover and move kebab to rightmost 2026-06-12 03:33:03 +08:00
qer
5725a75187 style: composer spacing and toolbar radius fix 2026-06-12 03:14:53 +08:00
qer
3f48bd5070 style: add margin-bottom to composer textarea 2026-06-12 03:12:25 +08:00
qer
46ba3a0f11 refactor: simplify session truncation to strict top-N with slot replacement 2026-06-12 03:10:51 +08:00
qer
affc69a0d3 feat(web): session list, chat pane, and daemon client updates 2026-06-12 03:08:12 +08:00
qer
a660aff5a5 fix: align show-more and group-empty with session row text 2026-06-12 03:07:55 +08:00
qer
5317f28d4d style: remove hover background from markdown-rendered tables 2026-06-12 03:06:47 +08:00
liruifengv
596cadd465
feat: support always-thinking models via supports_thinking_type (#662)
Some checks are pending
CI / build (push) Waiting to run
CI / test (push) Waiting to run
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
Nix Build / Check flake.nix workspace sync (push) Waiting to run
Nix Build / nix build .#kimi-code (push) Blocked by required conditions
Release / Release (push) Waiting to run
Release / Deploy docs (push) Blocked by required conditions
Release / Native release artifact (push) Blocked by required conditions
Release / Publish native release assets (push) Blocked by required conditions
Map the /models three-state supports_thinking_type field ('only' /
'no' / 'both', taking precedence over the legacy supports_reasoning
boolean) onto the existing always_thinking capability:

- oauth: parse the field in both /models parsers; 'only' emits
  always_thinking alongside thinking, 'no' suppresses thinking even
  when supports_reasoning is set, absent falls back to the legacy
  boolean. Default thinking selection is forced on for 'only' (and
  off for 'no') models during login and provider refresh
- TUI: render the thinking control with a fixed On/Off layout — locked
  models show a greyed-out "Off (Unsupported)" segment, and
  non-thinking models mirror the style with "On (Unsupported)"
- agent-core: clamp thinkingLevel at the getter so a stale
  thinking-off config can never reach the request builder, status
  events, or subagent inheritance
- acp-adapter: derive alwaysThinking from capabilities, collapse the
  thinking select to a single locked "on" entry, and ignore off
  requests for locked models while re-emitting the snapshot
2026-06-11 23:16:02 +08:00
liruifengv
1e2e679693
feat: add tips banner below welcome panel on startup (#655)
Some checks are pending
CI / build (push) Waiting to run
CI / test (push) Waiting to run
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
Nix Build / Check flake.nix workspace sync (push) Waiting to run
Nix Build / nix build .#kimi-code (push) Blocked by required conditions
Release / Release (push) Waiting to run
Release / Deploy docs (push) Blocked by required conditions
Release / Native release artifact (push) Blocked by required conditions
Release / Publish native release assets (push) Blocked by required conditions
* chore: ignore .worktrees directory

* feat: add tips banner below welcome panel on startup

- Fetch active/fallback tips from the configured CDN with a 3s timeout.

- Filter tips by semver, client version, and date range.

- Render the banner directly below the welcome panel on startup/resume.

- Support tag, multi-line text, subtext, automatic wrapping, and narrow-terminal safety.

* refactor(tui): use theme color methods in banner component

Replace raw chalk calls with currentTheme helpers: tag uses
boldFg('primary'), main text uses boldFg('textStrong'), and subtext
uses fg('textDim') without stacking the dim modifier on the already
dim shade. Strengthen tests to assert the exact themed ANSI output.
2026-06-11 22:20:31 +08:00
haozhe.yang
4c43950dc2 feat(server): open existing server URL with stop guidance on conflict
- Open the active server URL when `kimi server run` finds an existing local server\n- Distinguish background vs foreground server mode in conflict message\n- Show mode-appropriate stop command (`kimi server stop` or `pkill`)\n- Always include host in lock file contents\n- Add tests for already-running server handling
2026-06-11 20:59:23 +08:00
haozhe.yang
27ce0fde8b feat(server): add host to lock contents and remove svc JSDoc comments
- add host field to LockContents and acquireLock options\n- record bind host in lock file during server startup\n- remove JSDoc block comments across service manager modules\n- update start.test.ts to assert host is persisted in lock
2026-06-11 20:59:23 +08:00
haozhe.yang
5629f91dca feat(native,server): embed web assets and enrich lifecycle output
- collect and embed server web assets into the native SEA binary\n- add web-assets manifest and collection scripts for native builds\n- make swagger/swagger-ui registration conditional in server start\n- enrich lifecycle commands with service URL, running state, log path, and notes\n- add --no-open flag to control auto-opening web UI after install\n- introduce ServiceUnavailableError and ProgramServiceManager\n- update service managers (launchd, systemd, schtasks) with new status fields
2026-06-11 20:59:22 +08:00
7Sageer
0927f79883
fix: cancel active turns during session shutdown (#661)
* fix: cancel active turns during session shutdown

* fix: preserve background agents during session close
2026-06-11 20:52:50 +08:00
haozhe.yang
657430f721 feat(server): add server-managed PTY terminal APIs and WebSocket controls
- add terminal protocol schemas (REST and WebSocket controls)\n- add TerminalService with node-pty backend and frame buffering\n- add REST routes for terminal CRUD operations\n- add WebSocket terminal attach, input, resize, and close handlers\n- add e2e and unit tests for terminal lifecycle and I/O
2026-06-11 20:07:44 +08:00
7Sageer
0381329570
fix: send responses system prompts as instructions (#658) 2026-06-11 19:32:26 +08:00
haozhe.yang
37d415d081 fix(server): use in-process pino-pretty stream to avoid worker transport startup failure
- switch createServerLogger from pino transport target to in-process pretty stream\n- update changeset to cover @moonshot-ai/server\n- add test asserting pretty logger does not use ThreadStream\n- rename cli server test description
2026-06-11 19:04:51 +08:00
haozhe.yang
59b5e69308 fix(kimi-code): add pino-pretty as runtime dependency
add pino-pretty to apps/kimi-code dependencies to fix server startup when pretty logging is enabled\nadd regression test verifying the dependency is declared\ninclude changeset for patch release
2026-06-11 18:38:41 +08:00
qer
334e143057 feat(web): add Kimi design-language theme, drop Terminal from pickers
Add a third UI theme "kimi" implementing the official Kimi design
language (Quiet Utility) with token-exact values from kimi-design-skill
tokens.json v0.2.0:

- Interaction accent = kimiDark (black in light / white in dark);
  kimiBlue stays reserved for brand/data-viz (::selection only)
- Gray user bubbles (bubbleGrayPc), flat tool cards and dialogs; shadows
  only on the composer (shadow.inputDefault) and floating menus
  (shadow.small); dark elevated surfaces use background.tertiary
- PingFang SC for UI, Geist Mono for code (bundled JetBrains fallback)
- Modern's de-terminalization rules are shared via
  :is(html[data-theme="modern"], html[data-theme="kimi"]) — identical
  specificity, so Modern renders exactly as before; kimi token blocks
  sit after the data-accent rules and pin the accent (the accent picker
  is hidden while kimi is active)

Theme pickers (sidebar popover, mobile sheet) and onboarding now offer
Modern/Kimi only. Terminal remains the CSS baseline and a persisted
'terminal' choice still loads; it's just no longer offered in the UI.

Also: file-preview pane default width now follows half the window.
2026-06-11 18:25:53 +08:00
haozhe.yang
19c1d2a64c chore(changeset): rename daemon references to server in changesets and docs
- update existing changeset names and contents from daemon to server\n- rename changeset files to replace daemon with server\n- update services AGENTS.md and DI README references
2026-06-11 18:14:56 +08:00
qer
943955223c feat(web): add copy conversation feedback 2026-06-11 17:40:31 +08:00
haozhe.yang
6a6a4ba9ed build(kimi-code): sort deps and add fast-json-stringify subpaths
- sort apps/kimi-code devDependencies alphabetically
- add fast-json-stringify/lib/serializer and fast-json-stringify/lib/validator to optional runtime requires
- add package.json placeholders for packages/daemon and packages/kimi-migration-legacy
2026-06-11 17:34:13 +08:00
_Kerman
588cdaa152
chore: remove pnpm catalog usage (#653) 2026-06-11 17:21:42 +08:00
_Kerman
ff80327344
fix: propagate kaos env overlays (#654) 2026-06-11 17:21:32 +08:00
haozhe.yang
95db7ee983 fix: correct type checks, test mocks, and package resolution
- fix swagger-ui resolution path to packages/server\n- add agent-core ./session/store package export\n- handle non-string action/message in lifecycle formatHuman\n- improve exec error message serialization\n- fix test error objects and mock return values\n- include missing event types in SDK type tests\n- update flake.nix dependency hash
2026-06-11 17:17:51 +08:00
qer
c48e46e85c Merge remote-tracking branch 'origin/feat/web' into feat/web 2026-06-11 17:14:15 +08:00
qer
b992196c29 fix: prevent IME enter from submitting composer 2026-06-11 17:09:00 +08:00
qer
7e9606a0b2 docs: archive verified research on showing manual-abort in chat flow 2026-06-11 16:52:33 +08:00
haozhe.yang
3cc8cd5cf1 Merge remote-tracking branch 'origin/main' into feat/web 2026-06-11 16:47:42 +08:00
haozhe.yang
9770f22c93 feat(server)!: rename daemon to server with service management
- rename workspace package `@moonshot-ai/daemon` to `@moonshot-ai/server`\n- rename `@moonshot-ai/daemon-e2e` to `@moonshot-ai/server-e2e`\n- replace `kimi daemon` and `kimi web` with `kimi server run`\n- keep `kimi web` as alias for `kimi server run --open`\n- add `kimi server install/uninstall/start/stop/restart/status`\n  for launchd (darwin), systemd (linux), and schtasks (win32)\n- update dev scripts, kimi-web stub, documentation, and service naming checks\n\nBREAKING CHANGE: the `kimi daemon` command and `@moonshot-ai/daemon`\npackage are removed; use `kimi server` and `@moonshot-ai/server`.
2026-06-11 16:44:41 +08:00
qer
35dbd29528 feat(kimi-web): esc interrupt, abort toast, and filepath link fixes 2026-06-11 16:31:39 +08:00