Commit graph

284 commits

Author SHA1 Message Date
haozhe.yang
b614efd31e refactor(services,daemon,agent-core): align service registry bootstrap and expand DI lifecycle primitives
- remove defaultServicesModule() and services/src/module.ts; consume getSingletonServiceDescriptors() directly\n- update daemon service registrations and bootstrap to use registry descriptors\n- add DisposableMap, DisposableSet, disposable tracking, and disposeOnReturn to agent-core DI\n- update AGENTS.md with new registration patterns
2026-06-10 14:09:32 +08:00
haozhe.yang
025e49775d feat(prompt): add prompt queue and steer support
- add per-session prompt queue: concurrent submits return queued status\n- add list/steer REST endpoints and protocol schemas\n- synthesize prompt.steered lifecycle event\n- add debug endpoint to inject active prompts for e2e testing\n- add daemon-e2e queue + steer invariant test\n- fix WS ping frame handling in daemon-e2e client
2026-06-10 14:09:31 +08:00
haozhe.yang
1b00e1a33a fix(di): make ServiceCollection private and add startup service overrides
- make InstantiationService.services private to prevent external mutation\n- add serviceOverrides to DaemonStartOptions for test injection\n- refactor e2e tests to use startup overrides instead of post-boot container hacks
2026-06-10 14:09:14 +08:00
haozhe.yang
832dc5377d refactor(agent-core): align DI container with VS Code instantiation service
- move InstantiationType to extensions module; change SyncDescriptor0 to interface\n- add _strict mode and spread args to invokeFunction\n- construct parent-owned descriptors in parent scope\n- materialise delayed services in child scope with global graph tracking\n- update TestInstantiationService ctor and tests for new semantics
2026-06-10 14:09:14 +08:00
haozhe.yang
bd0d448ac2 test(daemon-e2e): split monolithic recent-daemon-apis scenario into focused scenarios
- replace scenario 06 with dedicated 06-09 files for model catalog, session children, pending recovery, and image file prompts\n- add prompt execution coverage for parent and child sessions\n- update README scenario index
2026-06-10 14:09:14 +08:00
haozhe.yang
4106c3216b feat(daemon): expose session undo action via daemon API
- Add POST /api/v1/sessions/{session_id}:undo endpoint\n- Add undo request/response schemas and SESSION_UNDO_UNAVAILABLE error code\n- Refactor OpenAPI transforms to support fork, compact, and undo actions\n- Implement SessionService.undo with history validation and compaction boundary guards\n- Add E2E and unit tests for undo endpoint and service logic
2026-06-10 14:09:12 +08:00
haozhe.yang
3a0b27d60c feat(daemon,web): expand daemon APIs and web client
- restructure daemon/services DI wiring and lifecycle events
- add session, workspace, model catalog, file, and reverse-RPC REST APIs
- add daemon e2e package with structured scenarios and HTML trace reports
- polish kimi-web rendering, mobile layout, diff view, and session UX
2026-06-10 14:08:59 +08:00
haozhe.yang
9d1f2f1c4e feat(daemon,services): default-wire Kimi-for-Coding identity headers via HarnessBridge
Add an optional `identity` field to HarnessBridgeOptions and default-wire
`kimiRequestHeaders` (User-Agent + X-Msh-Platform/Version/Device-Id) plus
`appVersion` from it. Without these the daemon-hosted KimiCore made
outbound fetches with the Node default User-Agent and the managed
Kimi-for-Coding endpoint rejected with 40340 ("only available for Coding
Agents such as Kimi CLI, …"). The in-process TUI path was unaffected
because SDKRpcClient already synthesised the same headers from its own
identity. Explicit `kimiRequestHeaders` / `appVersion` still win.

apps/kimi-code wires this through its `daemon` subcommand using the
existing `createKimiCodeHostIdentity(version)` helper, and ships a small
`dev:daemon:restart` press-Enter-to-respawn helper so the dev loop can
pick up a fresh build without manually killing the lock-holder.
2026-06-10 14:08:30 +08:00
qer
9e023b0e1a feat(web): add Kimi web client (apps/kimi-web)
A browser peer to the Kimi Code TUI that talks to the local daemon over
REST + WS (/api/v1, raw agent-core event stream).

Highlights:
- Workspace + session model: a workspace is a real folder; sessions are
  scoped to it. Dual sidebar — a workspace rail (collapsible icons ⇄ named
  rows) + a resizable, project-scoped session column. One-click new session,
  folder browser (fs:browse) to add workspaces, cross-session attention markers.
- Conversation: streaming thinking/text/tool calls, follow-to-bottom with a
  "new messages" pill, markdown with highlight.js syntax highlighting + diff
  coloring, per-tool header summaries, image attachments, @mention files,
  slash commands, editable message queue, max-width reading column with
  left/center alignment.
- Controls (StatusLine): model picker, context meter, thinking-level selector,
  plan-mode toggle, permission selector; /status panel; every prompt carries
  model + thinking + permission_mode + plan_mode per the daemon contract.
- Auth: OAuth device-code login/logout, managed-provider account menu.
- Tabs: ~/chat, ~/diff (git changes), ~/files (tree + preview), ~/tasks.
- i18n (vue-i18n): en/zh, browser detection + localStorage, EN/中文 switcher.
- Vue 3 + Vite + TS; 294 unit tests; typecheck + build green.
2026-06-10 14:08:30 +08:00
haozhe.yang
86e435e446 fix(services): wire default OAuth token resolver into HarnessBridge
- default-construct KimiAuthFacade in HarnessBridge when caller omits resolveOAuthTokenProvider\n- stop synthesized always-throw AUTH_LOGIN_REQUIRED closure after device-code login\n- remove tsx watch from dev:daemon to avoid restart loops\n- ignore Docker artifacts in .gitignore\n- add regression test for default resolver wiring
2026-06-10 14:08:29 +08:00
haozhe.yang
27e5c320e3 feat(auth): add readiness probe and OAuth device-code flow endpoints
- add GET /v1/auth readiness probe with authSummarySchema (P2.1)\n- add /v1/oauth/* device-code flow start/poll/cancel/logout routes (P2.7)\n- add IAuthSummaryService and IOAuthService implementations\n- gate prompt submission behind auth readiness (4011x error codes)\n- add e2e tests for auth and OAuth endpoints\n- add protocol schemas and rest-auth unit tests
2026-06-10 14:08:28 +08:00
haozhe.yang
94b2c73ff8 feat(daemon): add OpenAPI docs for REST routes
- add Swagger/OpenAPI generation and /documentation UI\n- move REST route registration under /api/v1\n- generate route schemas from Zod definitions\n- add daemon Swagger e2e coverage and dev daemon scripts
2026-06-10 14:08:12 +08:00
haozhe.yang
cc1ecf01ad feat: bootstrap local daemon with REST/WS gateway, DI, and protocol/services packages
Squash of 50 commits (9954d7f..c50167a) introducing the local daemon stack:

- @moonshot-ai/protocol: envelope, error codes, pagination/time/request_id helpers,
  ws-control schemas, re-export of event/display types from node-sdk.
- @moonshot-ai/services: broker interfaces, HarnessBridge core + BridgeClientAPI,
  defaultServicesModule shell.
- agent-core/di: vendored DI subsystem with createDecorator + serviceIds singleton,
  SyncDescriptor, InstantiationService (singleton-per-container, child scopes,
  IDisposable lifecycle), graph-based cycle detection, descriptor + @IFoo auto-injection,
  supportsDelayedInstantiation Proxy + GlobalIdleValue, TestInstantiationService,
  Trace, registerSingleton registry, README.
- @moonshot-ai/daemon: new package providing 'kimi daemon' command with
  - filesystem lock against concurrent instances,
  - REST gateway: /v1/meta, sessions CRUD, messages history, prompt submit,
    approval bridge (WS broadcast + 60s timeout), question bridge (5-kind normalization),
    tools list, MCP list/restart, background tasks, fs list/read/stat (+ batch),
    fs search/grep (rg fallback + timeout), fs git_status, fs download streaming,
    fs WS watch (chokidar, 100-path cap), Files store (multipart upload,
    streaming download, delete),
  - WS gateway: handshake, ping/pong heartbeat, subscribe/unsubscribe,
    DaemonEventBus with per-session seq, ring buffer with replay + resync_required,
    abort control message,
  - DI wiring of all services + brokers + HarnessBridge,
  - migration of all ctors to @IFoo decorator-based DI (P2.1–P2.6) with
    experimentalDecorators enabled.
2026-06-10 14:07:56 +08:00
Haozhe
4603d8ad6e
feat(protocol): extract shared protocol package from agent-core (#612)
* feat(protocol): extract shared protocol package from agent-core

- add `@moonshot-ai/protocol` package with REST/WS schemas, envelopes, error codes, event types, and display schemas\n- migrate agent-core `events.ts` and `display/schemas.ts` to re-export from protocol
- add centralized `onUnexpectedError` handler for safe emitter listener callbacks
- reject forkSession when source session has an active running turn
- add protocol schema tests and unexpectedError handler tests
2026-06-10 14:03:38 +08:00
7Sageer
95a124804e
chore: downgrade Fable 5 changeset to patch (#614) 2026-06-10 13:54:27 +08:00
7Sageer
b747c6a950
feat(kosong): support claude-fable-5 with adaptive thinking (#610)
* feat(kosong): support claude-fable-5 adaptive thinking

claude-fable-5 only accepts thinking: {type: "adaptive"} with
output_config.effort; the legacy enabled/budget_tokens config and an
explicit disabled config both return HTTP 400.

- Parse the fable family in Claude model ids (major-only version)
- Route fable >= 5 to adaptive thinking; allow xhigh effort
- Omit the thinking field entirely when thinking is off on fable
- Register the 128k output ceiling and thinking/vision capability

* update .changeset

Updated the configuration to use adaptive thinking for Claude Fable 5 support.

Signed-off-by: 7Sageer <12210216@mail.sustech.edu.cn>

---------

Signed-off-by: 7Sageer <12210216@mail.sustech.edu.cn>
2026-06-10 13:15:24 +08:00
liruifengv
32d7080837
fix(skill): clarify active skill prompts (#598)
* fix(skill): clarify active skill prompts

* fix(skill): preserve nested skill trigger
2026-06-10 12:46:23 +08:00
7Sageer
1580f35136
fix: align datasource plugin environment (#595)
* fix: align datasource plugin environment

* refactor: inject managed Kimi env into all stdio plugins

Pin the datasource credential-name test to the canonical
resolveKimiCodeOAuthKey so a digest drift in the standalone plugin
fails CI, and drop the hardcoded plugin-name special case so every
stdio plugin receives the active managed Kimi base URL / OAuth host
consistently (process.env and KIMI_CODE_HOME are already shared with
all plugins).
2026-06-10 12:42:27 +08:00
Luyu Cheng
2ebe38769f
feat(agent-core): strengthen Edit-over-Write preference in tool prompts (#540) 2026-06-10 12:22:25 +08:00
_Kerman
a1b419ab59
fix: stop asking for yolo external writes (#606) 2026-06-10 12:19:33 +08:00
liruifengv
99b3748dbe
docs(changelog): sync 0.12.1, 0.13.0 from apps/kimi-code/CHANGELOG.md (#605) 2026-06-10 11:09:20 +08:00
github-actions[bot]
25cf13ac97
ci: release packages (#588)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-10 10:47:32 +08:00
qer
40506f49d6
feat(tui): show available plugin updates in the marketplace (#593)
Installed plugins whose marketplace version is newer than the local
version now render an `update <local> → <latest>` badge and update in
place on Enter; up-to-date plugins show `installed · v<version>`.

Dev-server and CDN-build marketplace generation now stamp each entry's
version from the plugin manifest so the advertised "latest" stays accurate.
Adds a pure computeUpdateStatus() (semver, no spurious downgrades) with tests.

Co-authored-by: qer <Anna_Knapprfr@mail.com>
2026-06-09 21:28:36 +08:00
liruifengv
46f909d694
docs: add built-in skill commands section to slash-commands and skills pages (#596) 2026-06-09 20:39:33 +08:00
7Sageer
e48234af57
fix: avoid Windows command shim launches (#591) 2026-06-09 20:20:44 +08:00
liruifengv
f2863af267
fix: keep login fallback prompt visible (#594) 2026-06-09 20:06:07 +08:00
liruifengv
0abde8662a
fix(tui): clarify grouped subagent progress (#587) 2026-06-09 19:21:46 +08:00
liruifengv
f863127ab7
feat: custom color themes (#484)
* Refactor theme

* custom theme support

* docs: add custom themes guide

Document the custom theme file location, the color token reference, selecting a theme via /theme and tui.toml, and fallback behavior. Link it from the customization sidebar and the tui.toml theme field.

* feat(skill): add built-in custom-theme skill

Guides the model (or a manual /custom-theme run) to author a theme JSON in ~/.kimi-code/themes/: docs token reference, deliberate color choices, hex validation, and how to apply via /theme or /reload-tui. Note in the write-tui skill to keep the token set in sync across colors.ts, the schema, the docs, and this skill. Enrich the custom-theme changeset to cover all three usage paths.

* chore: remove theme research report

* fix(tui): resolve lint errors after main merge

Remove unused chalk/currentTheme/ResolvedTheme imports left by the theme refactor; break the theme <-> pi-tui-theme import cycle by dropping the markdown/editor theme getters from the Theme class (consumers call createMarkdownTheme directly); fix unused vars/params, a floating promise, and a redundant union type.

* fix(tui): address custom theme review feedback

- await applyTheme before refreshing terminal theme tracking, so
  switching to "auto" installs the watcher against the new state
- invalidate the transcript on automatic (terminal-driven) theme
  changes so already-rendered entries repaint
- rebuild UsagePanel bodies on invalidate (previously a no-op); /usage,
  /status, /mcp and /plugins now repaint on a theme switch
- repaint the compaction header on invalidate
- validate a custom theme before applying it from the /theme picker
- hide reserved dark/light/auto names from the custom theme list
- escape the theme name when writing tui.toml
- stop the custom theme loader writing warnings to the raw terminal
- remove a stray hello.ts

* refactor(tui): polish custom theme feature

- footer and todo-panel read the currentTheme singleton directly at
  render time instead of caching a palette copy; drop their setColors
  methods and the manual setColors calls on every theme change
- support "base": "dark" | "light" in custom theme files so a partial
  light theme inherits the light palette for unspecified tokens
- reconcile the docs and the custom-theme skill with the silent
  invalid-color fallback (no terminal warning)

* refactor(tui): live-repaint the agent swarm progress panel

Read the currentTheme palette through a getter instead of caching it at
construction time, so the swarm progress panel recolors on a theme switch
like the rest of the transcript. Drops the now-unused `colors` option.

* chore: remove plan.md

* docs: update custom theme guide

* docs: document custom theme skill command

* fix(skill): make custom theme user-triggered only
2026-06-09 18:55:15 +08:00
liruifengv
d85dc0b96a
feat: add Claude Codex import skill (#582) 2026-06-09 18:44:10 +08:00
liruifengv
7cb4a23e01
fix: truncate queued messages to a single line (#586) 2026-06-09 17:26:41 +08:00
github-actions[bot]
c79972c28c
ci: release packages (#585)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-09 17:02:42 +08:00
liruifengv
11bb62c12f
fix: allow obsolete experimental config entries (#584)
* fix: allow obsolete experimental config entries

* docs: remove config docs update from PR
2026-06-09 17:00:48 +08:00
7Sageer
aa3471f5d3
fix(kosong): pass through chat reasoning effort (#581) 2026-06-09 16:59:41 +08:00
liruifengv
75a894e9ad
docs(changelog): sync 0.12.0 from apps/kimi-code/CHANGELOG.md (#571) 2026-06-09 12:17:20 +08:00
github-actions[bot]
20f7aa337a
ci: release packages (#491)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-09 11:54:52 +08:00
qer
a175cd8f73
docs(guides): add Paseo ACP integration section (#542) 2026-06-09 11:53:25 +08:00
Luyu Cheng
41ebe9fb9f
fix: polish goal lifecycle messaging (#555) 2026-06-09 11:47:00 +08:00
liruifengv
d7407b0ecf
feat: release experimental features (#569)
* feat: release experimental features

* refactor: remove redundant goal runtime gate

* refactor: remove unused skill flag plumbing

* feat: keep micro compaction opt-out
2026-06-09 11:42:50 +08:00
_Kerman
db82e33a20
fix: restore goal resume state from agent records (#552) 2026-06-09 10:02:19 +08:00
qer
9ed6b8c350
docs: restore Kimi Datasource legacy pages (#557) 2026-06-08 22:33:18 +08:00
wenhua020201-arch
e5e9d28f7c
docs: merge Kimi Datasource into plugins page and add terminal tip (#551)
* docs: merge Kimi Datasource into plugins page and add terminal tip to getting started

- Merge datasource.md content into plugins.md as a dedicated section,
  placed between installation management and plugin manifest sections
- Replace verbose feature tables with scenario-driven use cases and a
  condensed coverage table
- Add /skill:kimi-datasource as an explicit invocation method alongside
  natural language; update /new references to /reload
- Promote GitHub URL formats and notes to named H3 subsections within
  installation management
- Add terminal recommendation tip (Kitty / Ghostty) in the Installation
  section of getting-started
- Remove standalone datasource.md sidebar entries from zh and en nav

* docs: remove stale datasource pages and add redirects to plugins

Delete zh/en datasource.md (content now merged into plugins.md) and
add VitePress redirects so existing bookmarks and search results for
/customization/datasource land on /customization/plugins instead.

* docs: restore datasource pages as forwarding stubs

Replace deleted files with minimal pages that link to the merged
section in plugins.md. VitePress redirects only fire in SSG builds;
dev-server visitors hitting the old URL would 404 without these stubs.

* docs: add dev-server redirect middleware for removed datasource pages

VitePress `redirects` config only fires during SSG build; the dev
server ignores it, causing 404s on the old /customization/datasource
URLs. Add a Vite `configureServer` middleware that handles the redirect
in dev mode, while the top-level `redirects` config continues to
generate meta-refresh HTML pages for the production build.

---------

Co-authored-by: qer <wbxl2000@outlook.com>
2026-06-08 22:13:54 +08:00
wenhua020201-arch
0e1665173d
docs: expand AGENTS.md with reader personas, format decisions, and checklist (#507)
* docs: expand AGENTS.md with reader personas, format decisions, and checklist

Add documentation writing principles that were missing from the existing guide:
- Readers: two audience types (technical vs non-technical) with writing targets
- Authoring workflow: think before rewriting (understand → structure → fill)
- Kimi platform rules: strict separation of api.kimi.com vs api.moonshot.cn URLs
- Typography: forbid four-colon callout syntax (::::), note no nesting
- Writing style: one-idea-per-paragraph, map-before-detail structure, clarify
  when to use lists vs prose (avoids confusion between 'no fragmentation'
  and 'parallel content needs formatting')
- Format decisions: explicit rules for ordered list / unordered list / table / prose
- Cross-references: when links are required, anchor precision, inline vs next-steps
- Page structure: standard template and banner placement rule
- Content completeness: default to keeping everything, omissions need stated reasons
- Checklist: format violation quick-reference and Kimi-specific consistency checks

All existing rules are preserved unchanged (0 lines removed).

* docs: address review comments on AGENTS.md

- Fix "next steps" rule contradiction: replace blanket ban with "no nav
  tip blocks"; `## Next steps` is allowed when related pages exist
- Fix checklist Base URL pointer: was pointing to locale index.md
  (which has no platform table); now links to Kimi platform rules above
- Fix callout syntax rule: `::::` is valid as an outer nested fence
  when correctly closed; ban only unclosed/mismatched fences
- Fix checklist code block rule: carry forward the existing exception
  that natural-language prompt examples may omit the language tag

---------

Co-authored-by: qer <wbxl2000@outlook.com>
2026-06-08 21:46:01 +08:00
liruifengv
3765a49163
feat: rework TUI file references (#547)
* feat: rework TUI file references

* fix: respect fd file reference filtering

* chore: adjust file reference changeset

* fix: harden fd helper downloads

* fix: avoid symlink recursion in file fallback
2026-06-08 20:48:56 +08:00
Haozhe
879a7eeb33
fix(acp): restore legacy permission compatibility and stabilize ACP (#395)
* feat(acp-adapter): support embedded resource prompts

- advertise embeddedContext support in ACP capabilities and docs
- convert file:// resource_link blocks into decoded paths with optional line ranges
- keep XML wrappers for non-file or unparseable resource_link URIs
- update adapter tests for the new resource link behavior

* feat(acp-adapter): add ACP built-in slash command routing and UNC path support

- add local execution for /compact, /status, /usage, /mcp, /tasks, /help in ACP sessions
- surface unknown slash commands as local errors instead of forwarding to model\n- export ACP_BUILTIN_SLASH_COMMANDS from acp-adapter for CLI reuse
- fix file:// URI conversion for Windows UNC paths
- rebuild agent builtin tools on session tool kaos rebind
2026-06-08 19:27:20 +08:00
liruifengv
5cff6d6027
fix: honor KIMI_CODE_HOME for global agent resources (#544) 2026-06-08 17:42:03 +08:00
MicroGrey
3787c3016a
fix(tui): support exit shortcuts in startup session picker (#473)
* fix(tui): support exit shortcuts in startup session picker

* fix(tui): clear picker exit confirmation on close

---------

Co-authored-by: liruifengv <liruifeng1024@gmail.com>
2026-06-08 17:02:16 +08:00
liruifengv
0c3d556778
chore: add changeset for PR #486 (#543) 2026-06-08 16:35:10 +08:00
liruifengv
2db1bd9675
fix(tui): subagent thinking text and tool output display (#541) 2026-06-08 16:19:15 +08:00
Davy
b47734ca0b
docs: add Homebrew installation (#531)
* docs: add Homebrew installation instructions

Add Homebrew as an installation option for macOS/Linux users in both
English and Chinese READMEs.

Closes #130

* feat(cli): detect Homebrew installs and use brew upgrade for updates

When kimi-code is installed via Homebrew, the update system now detects
the installation source and uses 'brew upgrade kimi-code' instead of
falling back to 'npm install -g'. This prevents duplicate installations
when Homebrew users receive update prompts.

* chore: add changeset for Homebrew update detection

* fix(cli): tighten Homebrew detection and disable auto-update

- Only match /cellar/ path segment (not /homebrew/) to avoid false
  positives on Apple Silicon where npm global installs live under
  /opt/homebrew/lib/node_modules/
- Disable background auto-update for Homebrew: brew upgrade may mutate
  dependents silently and the formula can lag behind CDN releases

* fix(cli): add homebrew to InstallSource Zod schema

Keeps the persistence schema in sync with the TypeScript type. Currently
harmless since Homebrew auto-install is disabled, but prevents a silent
state reset if it is ever enabled later.

---------

Co-authored-by: liruifengv <liruifeng1024@gmail.com>
2026-06-08 16:11:31 +08:00
liruifengv
b785e2698a
feat: show full plan cards (#536)
* feat: show full plan cards

* chore: patch plan card changeset
2026-06-08 15:35:49 +08:00