Commit graph

559 commits

Author SHA1 Message Date
liruifengv
39df1a4dd3 add refactor pi-tui docs 2026-07-01 12:27:58 +08:00
liruifengv
a5614cd680 fix(kimi-code): avoid double-counting steps in append-only step summary 2026-07-01 12:20:57 +08:00
liruifengv
fe16e74e99 refactor(kimi-code): make step summary append-only under ledger renderer 2026-07-01 12:09:50 +08:00
liruifengv
2d1cad5676 docs(kimi-code): correct transcript-window trim comment about metadata retention 2026-07-01 11:56:15 +08:00
liruifengv
db719a8832 refactor(kimi-code): stop destroying rendered transcript rows; let them commit to scrollback 2026-07-01 11:49:15 +08:00
liruifengv
9c166d8d58 feat(kimi-code): report native scrollback seam from transcript container 2026-07-01 11:33:12 +08:00
liruifengv
7a2a7e5560 test(pi-tui): widen stdin-buffer timeout-flush wait margins 2026-06-30 22:41:49 +08:00
liruifengv
d83afaf11e test(pi-tui): cover probe-driven sync-output reframing 2026-06-30 22:36:17 +08:00
liruifengv
8262da57be fix(pi-tui): drop capability-probe replies before they reach the editor 2026-06-30 22:36:13 +08:00
liruifengv
d7c822f707 fix(pi-tui): flush stale partial before fresh escape in stdin buffer 2026-06-30 22:04:07 +08:00
liruifengv
c04635dac5 fix(pi-tui): recognize coalesced meta-CSI escape in matchesKey 2026-06-30 21:37:34 +08:00
liruifengv
539d639668 fix(pi-tui): harden stdin buffering against split mouse/escape and paste stalls 2026-06-30 20:40:00 +08:00
liruifengv
c037f1bcb0 refactor(pi-tui): drop unused resize viewport paint counter 2026-06-30 20:13:52 +08:00
liruifengv
fc310cc24b refactor(pi-tui): harden resize-defer test env and reuse alt-screen constants 2026-06-30 20:08:43 +08:00
liruifengv
437492ebfe feat(pi-tui): defer authoritative repaint during resize drags 2026-06-30 19:50:21 +08:00
liruifengv
90a9da7c91 fix(pi-tui): harden headless mode against stray timers and teardown 2026-06-30 19:29:57 +08:00
liruifengv
273fd0ad9c feat(pi-tui): add headless terminal mode to keep tests from painting 2026-06-30 19:16:00 +08:00
liruifengv
a077db2057 refactor(pi-tui): tighten capability probe wiring and remove dead code 2026-06-30 19:08:46 +08:00
liruifengv
62b414a21b feat(pi-tui): probe terminal capabilities via DA1 sentinel FIFO 2026-06-30 18:44:34 +08:00
liruifengv
c41edab45d test(pi-tui): cover static capabilities assembly and env override ordering 2026-06-30 18:05:28 +08:00
liruifengv
8ff1ced5d1 feat(pi-tui): add terminal capability table and inject into ledger engine 2026-06-30 17:55:59 +08:00
liruifengv
7418b03506 fix(pi-tui): park cursor on exit under ledger renderer 2026-06-30 17:36:48 +08:00
liruifengv
ade7c0ef94 test(pi-tui): add golden and seeded stress harness for ledger engine 2026-06-30 16:43:28 +08:00
liruifengv
924bd62579 feat(pi-tui): wire ledger engine behind PI_TUI_ENGINE flag 2026-06-30 15:56:03 +08:00
liruifengv
2bc5c4c684 feat(pi-tui): implement ledger doRender classifier and window math 2026-06-30 15:38:02 +08:00
liruifengv
f751a17707 feat(pi-tui): implement ledger emitters (fullPaint + update tri-shape) 2026-06-30 15:25:04 +08:00
liruifengv
0e8ff7fae4 feat(pi-tui): add committed-prefix audit and mark updates to ledger engine 2026-06-30 15:14:41 +08:00
liruifengv
3e4f00d53e feat(pi-tui): implement ledger frame preparation and per-line finalization 2026-06-30 15:05:32 +08:00
liruifengv
d73968bb55 feat(pi-tui): implement ledger frame composition with seam capture 2026-06-30 14:55:35 +08:00
liruifengv
d7a5dfbb4c feat(pi-tui): add LedgerTuiEngine skeleton with ledger state and cursor control 2026-06-30 14:45:17 +08:00
liruifengv
7c70df7c9d feat(pi-tui): add committed-prefix resync audit 2026-06-30 14:33:00 +08:00
liruifengv
8d837399ce feat(pi-tui): scaffold ledger engine types, seam, SGR coalescing 2026-06-30 14:15:52 +08:00
liruifengv
86540ca2d7 feat(kimi-code): integrate vendored @moonshot-ai/pi-tui
Replace the npm @earendil-works/pi-tui dependency with the vendored @moonshot-ai/pi-tui workspace package so the fork can be modified locally.

- Point apps/kimi-code imports and native-deps at @moonshot-ai/pi-tui.

- Make pi-tui source-first (exports -> src, publishConfig.exports -> dist, mirroring node-sdk) and strict-clean: bracket access for process.env / named capture groups, an override modifier, and non-null assertions for noUncheckedIndexedAccess.

- Bump the root tsconfig target to ES2024 and enable allowImportingTsExtensions (needed for pi-tui's /v regex and .ts imports, which node --test requires).

- Add packages/pi-tui to flake.nix workspaces and exclude the vendored source from oxlint.
2026-06-29 21:21:36 +08:00
liruifengv
63e7b988f0 chore: vendor @earendil-works/pi-tui 0.80.2
Fork the upstream pi-tui source into packages/pi-tui for local modification. Pristine snapshot of @earendil-works/pi-tui@0.80.2; the apps/kimi-code dependency on ^0.78.1 from npm is left unchanged.
2026-06-29 19:56:28 +08:00
liruifengv
42a5aff720 chore: add changeset for pi-tui upgrade 2026-06-29 19:42:56 +08:00
liruifengv
0ec5bd62c0 chore(kimi-code): upgrade pi-tui to 0.78.1 and adapt native helpers
Bump @earendil-works/pi-tui from ^0.74.0 to ^0.78.1. pi-tui 0.75.5 replaced its koffi-based Windows VT input with a bundled native helper, and 0.76.0 added a darwin native helper for Terminal.app Shift+Enter.

- SEA build: teach native-deps to collect pi-tui's per-target .node files, drop the koffi registry, and add a native-file-only collect mode so only package.json + the target .node ship (28 -> 2 files).

- Redirect pi-tui's absolute-path native require() into the native-asset cache through the Module._load hook, and extend the native smoke test to actually load the helper.

- npm package: ship pi-tui's native/ directory so macOS Terminal.app Shift+Enter and Windows Shift+Tab keep working for npm installs.
2026-06-29 19:38:00 +08:00
Haozhe
3e98e709b3
docs(changelog): sync 0.20.2 from apps/kimi-code/CHANGELOG.md (#1198) 2026-06-29 16:51:23 +08:00
liruifengv
0df1812502
fix: render provider HTML error messages instead of blank lines (#1191)
When a provider returns an HTML error page (e.g. nginx 413 Request Entity Too Large), the error message carried CRLF line endings and raw HTML. The trailing carriage returns made the TUI render the error line as blank. Extract the page title for the wire message and strip carriage returns before rendering.
2026-06-29 15:49:48 +08:00
github-actions[bot]
52e2719d17
ci: release packages (#1154)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-29 14:49:34 +08:00
Haozhe
c8d1d76de5
test(agent-core): align turn telemetry expectations with provider_type (#1194)
Update the turn_started/turn_ended and api_error telemetry assertions to
expect provider_type, matching the telemetry property rename in #1184.
2026-06-29 14:44:26 +08:00
Kai
821847cb4b
feat(managed-kimi-code): route anthropic protocol via beta api (#1186)
* feat(managed-kimi-code): route anthropic protocol via beta api

- kosong: add betaApi option to use client.beta.messages.create
- agent-core: thread alias betaApi into the anthropic provider config
- oauth: route managed models on the anthropic protocol through the beta Messages API

* feat(providers): add KIMI_CODE_CUSTOM_HEADERS support

- Add KIMI_CODE_CUSTOM_HEADERS env var for custom outbound LLM headers
- Send User-Agent to non-Kimi providers
- Forward Kimi identity headers to model catalog fetches
- Support defaultHeaders in Google GenAI provider

* feat(agent-core): add protocol attrs to turn and api error telemetry

- Add type/protocol/alias to api_error for per-protocol error attribution

- Add turn_ended event with reason/duration/mode/type/protocol

- Add type/protocol to turn_interrupted

* chore(oauth): remove hardcoded internal dev endpoint from shared OAuth base URLs

---------

Co-authored-by: haozhe.yang <yanghaozhe@moonshot.ai>
2026-06-29 14:24:01 +08:00
liruifengv
04b3492e74
fix(tui): keep working tips out of the agent swarm progress line (#1189)
* fix(tui): keep working tips out of the agent swarm progress line

The activity loader is shared between the activity pane and the agent swarm progress status line. Tips were written into the loader, so they leaked into the swarm progress line and got squeezed against the bar. Keep the inline spinner text used by the swarm progress line free of tips, while the loader's own row in the activity pane still shows them.

* test(tui): stop moon loader timers in tests

MoonLoader starts a real setInterval in its constructor. Stop every loader created in the tests via afterEach so no live timer leaks past the file.
2026-06-29 14:21:16 +08:00
Haozhe
c99bd1c10e
chore(changeset): downgrade web-completion-sound changeset to patch (#1190) 2026-06-29 14:03:29 +08:00
liruifengv
db5fbc53c0
fix(tui): stop full-screen redraw on input and slash panel toggle (#1188)
Remove the global clear-on-shrink setting so typing in the input box and opening or closing the slash panel no longer trigger a full-screen redraw.
2026-06-29 13:51:31 +08:00
liruifengv
97f9263c6f
fix(tui): clear debug timing status on undo (#1187) 2026-06-29 13:31:08 +08:00
7Sageer
49e93893a6
refactor: standardize telemetry property names (#1184)
Align outlier telemetry events with the conventions already used by
tool_call, api_error, permission_approval_result, and the plan events:

- duration / latency_ms / duration_s -> duration_ms
- success boolean -> outcome enum ('success' | 'error')
- bare type -> provider_type

The exit event switches from seconds to milliseconds to match the
duration_ms convention, so its numeric scale changes accordingly.
2026-06-29 12:34:38 +08:00
qer
1dab2c2268
feat(web): preserve side panel and scope input history per session (#1181)
Some checks are pending
CI / test-windows (push) Waiting to run
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
CI / build (push) Waiting to run
CI / test (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
* feat(web): preserve open side panel across session switches

* feat(web): scope composer input history to current session

* fix(web): suppress side panel open animation on session switch

* fix(web): preserve per-session scroll position on session switch

* chore: add changeset for per-session scroll position

* fix(web): preserve follow-bottom state per session

* fix(web): scope composer attachments to their session

* fix(web): restore saved scroll position on session switch
2026-06-29 01:52:08 +08:00
qer
fc3d69dbdc
feat(web): add completion sound and question notifications (#1179)
* feat(web): play a sound when a turn completes

Synthesize a short chime when a session finishes a turn. Opt-in via Settings -> Notifications (off by default); the audio context is unlocked on the first user gesture so it also plays while the tab is backgrounded.

* feat(web): notify and play a sound when a question needs an answer

Reuse the existing notification/sound toggles so they also fire when the agent asks a question (the awaiting-answer state). Generalize the Settings labels to cover both cases.

* fix(web): don't queue the chime on a suspended audio context

A suspended AudioContext has a frozen clock, so tones scheduled on it would play stale when the context later resumes (e.g. on the next click). Only schedule the chime when the context is actually running; if it is still suspended, try to unlock it for next time and skip this one.

* fix(web): gate question notifications behind explicit opt-in

Question notifications surface question text, so they must not fire for users who only opted into turn-completion alerts (which default on). Split question notifications into their own persisted preference that defaults off, with a separate Settings toggle. Completion notifications keep their existing default-on behavior.

* fix(web): show the question text in question notifications

Lead with the actionable question text in the desktop notification body, keeping the short header as context (e.g. 'Storage: Which database?'). Previously the header alone was shown, so users had to open the tab to learn what was being asked.
2026-06-28 21:02:00 +08:00
qer
c63edd5bf6
refactor(web): unify new-session creation behind the first message (#1167)
Some checks are pending
CI / test-windows (push) Waiting to run
CI / lint (push) Waiting to run
CI / build (push) Waiting to run
CI / test (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
Remove the NewSessionDialog path so every new-session entry in the web UI enters the onboarding composer, creating the session only when the first message is sent. This removes the last web flow that produced an empty session.
2026-06-28 17:01:26 +08:00
qer
dfcfdfd9dd
feat(web): hide empty sessions from the session list (#1166)
* chore(web): remove the /sessions slash command

* feat(web): hide empty sessions from the session list

Add an optional exclude_empty parameter to the session list API; the web client passes it so unused "New Session" entries are hidden by default, with pagination and has_more computed on the filtered set.

* fix(protocol): add exclude_empty to the session list query schema

Keep the shared protocol schema in sync with the server route so clients using the protocol type see the new parameter.

* fix(protocol): keep exclude_empty off the child session list schema

listSessionChildrenQuerySchema aliased the main list schema, so it inherited exclude_empty even though the /sessions/{id}/children route does not filter by it. Split it so generated clients are not misled.
2026-06-28 13:38:46 +08:00