Commit graph

404 commits

Author SHA1 Message Date
qer
da18be330c feat(web): rework the todo / background-task panels
Four fixes folded together:
- The ~/todo TAB was still collapsible, so opening it could hide everything.
  Collapse now applies only to the floating card; the tab is always expanded.
- The floating background-task card had no collapse. Add a chevron toggle while
  keeping the header click as 'open the tasks tab'.
- The card truncated to 4 rows and showed '+N' even with room. Raise the cap to
  12 and let the list scroll (max-height) so it shows more before truncating.
- Bump the floating stack width 260→300 and card font so the panels aren't so
  cramped.
2026-06-13 13:52:26 +08:00
qer
0f33d72a3c test(web): verify Steer carries an image attachment
P2-15 verification: confirm steering a running turn with an image works
end-to-end — the image rides the steered prompt's content alongside the text and
the optimistic transcript echo shows it. No bug found; locks it as a regression.
2026-06-13 13:52:26 +08:00
qer
481bfa0dfc feat(web): capture front-end errors in the troubleshooting log export
The KAP debug panel already exported REST + WS traffic as JSONL, but a broken
page is usually explained by a JS error the network log doesn't show. Fold
window error/unhandledrejection and console.error/warn into the trace buffer
(opt-in, install-once, behavior-preserving) as a 'client' source, surface them
in the panel with an 'app errors' filter + APP badge, so 'export jsonl' yields a
complete troubleshooting log.
2026-06-13 13:52:26 +08:00
qer
4b0eae5ab3 feat(web): filter subfolders in the add-workspace browser
Browsing into a folder with many subdirectories meant scrolling a long flat
list. Add a live case-insensitive filter input above the folder list (shown
once a folder has entries), filtering the current folder's subfolders by name,
with a no-match hint and a reset on each navigation. Adds zh/en strings.
2026-06-13 13:52:26 +08:00
qer
76d12cf6d6 feat(web): list session skills in the composer slash menu
Typing / only offered the 17 built-in app commands; the daemon's session skills
(GET /sessions/{id}/skills) were unreachable from the web composer. Wire the
skills endpoints into the API client, load them per session, and append them to
the / menu as /<skill-name> with their description. Selecting one (or typing
/<skill> args) activates it via POST .../skills/{name}:activate — the web
analogue of /<skill> in the TUI. Built-in commands are unchanged.
2026-06-13 13:52:26 +08:00
qer
a195dff7b5 feat(web): unify approval and question prompts in the bottom dock
Questions replaced the composer in the pinned bottom dock; approvals rendered at
the end of the scrolling transcript — two different positions for the same
'agent is blocked on you' moment. Render the pending approval in the same dock
slot (question takes priority, then approval, then composer), cap its height so
a tall diff scrolls internally instead of pushing the dock off-screen, and match
the question card's margin. Remove the now-dead inline approval rendering and
its emit wiring from ChatPane.
2026-06-13 12:13:34 +08:00
qer
9414ba4e38 feat(web): tidy tool call rendering — dedupe command, merge adjacent
- The command/summary was printed twice when a tool card was expanded (header
  line + a repeated summary atop the body). Drop the body copy; the header
  already shows it.
- Consecutive tool calls rendered as N separate cards with gaps. Collapse a run
  of adjacent ToolCall .box cards into one continuous panel (shared borders,
  squared inner corners) via :has/+ sibling CSS; text/thinking between tools
  still breaks the group, and media cards (.media-tool) are untouched.
- Downward expansion already correct (body renders below the header).
2026-06-13 12:07:52 +08:00
qer
71f80cad1a fix(web): remove table row hover highlight in markdown
The existing override targeted a 'table-node' element, but markstream-vue uses
a .table-node CLASS, so the scoped '.table-node[data-v-…] tbody tr:hover'
background still showed on read-only conversation tables. Match the class and
use !important so the override wins regardless of style-injection order.
2026-06-13 12:04:49 +08:00
qer
980ff9d48a fix(web): hide the sending moon once the first reply token streams
sendingBySession only cleared on turn end / error, so the in-flight moon
lingered beside the streaming reply for the whole turn. Clear it on the first
assistantDelta (thinking/text token) or messageUpdated (a turn that opens with a
tool use), matching the moon's intended 'before the reply starts' semantics.
2026-06-13 12:03:24 +08:00
qer
176d3d874c feat(web): consistent feedback for manual agent interrupt
Manual interrupt already worked (Esc key + the composer's stop button, both
wired to abortCurrentPrompt), but only the Esc path showed the 'aborted' toast —
clicking stop aborted silently. Route both paths through a single handleInterrupt
so the stop button gives the same toast feedback as Esc.
2026-06-13 12:01:18 +08:00
qer
88ae65bbf3 fix(web): settle a dangling tool spinner once the session goes idle
messagesToTurns kept the final group's running tools spinning so live in-flight
tools show a spinner. But when a tool's result frame is dropped on a reconnect /
ordering race, the tool stayed 'running' forever after the turn finished —
the intermittent 'read file then spins forever' report. Thread whether the
session is still active into messagesToTurns and settle the final group's
dangling tools to ok when it is idle, keeping live spinners during a real turn.
2026-06-13 11:58:17 +08:00
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
_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
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
_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
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
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
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
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
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
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