* feat: polish vis
* feat: add 'kimi vis' command for session visualization
* fix(vis): drop metadata app_version/resumed removed upstream
#786 stopped recording resume version metadata, so those fields no
longer exist on the metadata wire record. The vis-into-typecheck wiring
caught the stale field reads after merging main; drop them from the
metadata headline.
* fix(vis): drop unnecessary return-await in startVisServer
oxlint typescript-eslint(return-await) flags returning an awaited
promise outside try/catch; return the promise directly.
* fix(vis): green CI — tolerate unbuilt embedded asset + bump nix pnpmDeps hash
- handleVis: wrap the embedded-SPA dynamic import in try/catch. The value
module is generated at build time (prebuild); in contexts without a build
(tests run pnpm test, not build) only the .d.ts type stub exists, so the
runtime import throws. Tolerate it and fall back to filesystem serving.
- flake.nix: update the fetchPnpmDeps hash after adding the vis-web /
vis-server / vite-plugin-singlefile dependencies.
* refactor(vis): drop redundant alwaysBundle in tsdown config
#775's single-entry build (codeSplitting: false) already bundles
everything not declared in dependencies/peerDependencies. hono /
@hono/node-server (transitive via vis-server) and @moonshot-ai/vis-server
(a devDependency) are all undeclared there, so they bundle by default —
the explicit alwaysBundle was redundant. Verified the emitted main.mjs is
still fully self-contained and 'kimi vis' serves.
* fix(vis): address review — context-token resets, IPv6 url, marker-safe indexing
- contextTokens now mirrors agent-core on lifecycle records: 0 on
context.clear, tokensAfter on context.apply_compaction (was only
updated from step.end.usage, leaving a stale live fill after a
clear/compaction).
- start.ts brackets IPv6 hosts in the returned url (http://[::1]:port/);
hostForUrl moved to config.ts and shared with the startup banner.
- compaction slice + micro-compaction blanking now index over real
history entries only, so synthetic undo/clear UI markers no longer
offset agent-core's compactedCount / cutoff.
* chore: add changeset for kimi vis command
* fix(vis): cross-platform single-file build + history-count micro clamp
- build-vis-asset.mjs sets VIS_SINGLEFILE via the spawn env and runs
'vite build' directly (cross-platform), instead of the POSIX-inline-env
'build:single' script that broke on Windows cmd; removed the now-unused
build:single script. Fixes the win32 build path (the asset generator
runs in the kimi-code prebuild + native bundle).
- context.undo now clamps the micro-compaction cutoff by history-entry
count (excluding synthetic undo/clear markers) instead of messages.length,
mirroring agent-core undo() -> microCompaction.reset(_history.length); a
surviving marker no longer leaves the cutoff one too high and wrongly
blanks a later-appended tool result.
* fix(vis): run the single-file build through a shell for Windows pnpm
The win32 native binary is built on Windows runners
(.github/workflows/_native-build.yml), which run this generator. pnpm's
launcher there is pnpm.cmd, which a bare argv exec can't resolve without
a shell. Use execSync with a single command string so the platform shell
(cmd on Windows) resolves the shim; a command string (not an args array)
avoids the args+shell deprecation. Args are static.
* fix(vis): show model-facing tool result content in the context view
agent-core normalizes tool results via toolResultOutputForModel before
they enter history (error -> '<system>ERROR: ...' prefix, empty ->
'<system>Tool output is empty.' sentinel). The projector was using the
raw ev.result.output, so the Context tab's model view showed content the
model never saw for failed/empty tool calls. Replicate that normalization
(the upstream helper is module-private) so the projected tool message
matches what the model received.
* feat(agent-core): re-export wire record types for in-monorepo consumers
* chore(vis): purge legacy wire protocol code
* feat(vis): introduce single-source agent-record types
* test(vis): add fixture session and builder helper
* feat(vis): implement new session store reader
* feat(vis): wire new session list/detail routes
* refactor(vis): drop legacy path config
* feat(vis): adapt session list page to new DTO
* feat(vis): implement per-agent wire reader
* feat(vis): rewrite wire route for new protocol
* feat(vis): rewrite wire type metadata for new protocol
* feat(vis): rewrite wire row + headline for new record union
* feat(vis): wire tab detail panel + multi-agent selector
* feat(vis): rebuild wire issues detection for new protocol
* feat(vis): implement context projector
* feat(vis): rewrite context route on projector
* feat(vis): rebuild context tab for new ContextMessage shape
* feat(vis): implement agent tree builder
* feat(vis): rewrite agents route
* feat(vis): rebuild subagents tab around state.json.agents
* feat(vis): rebuild state tab on raw state.json
* chore(vis): purge residual legacy field references
* vis: rewrite complete on new agent-core protocol
* fix(vis): adapt to wire protocol 1.1 with flattened tool calls
* fix(vis): populate workDir from session index
* fix(vis): return broken-state sessions from detail lookup
* fix(vis): tolerate per-session wire read failures during listing
* fix(vis): read wire files from canonical session path
* feat(vis): restore session detail page with full tab layout
* feat(vis): wire subagent context tab to real ContextTab
* fix(vis): sync wire and context tab agentId with prop changes
* feat(vis): auto-pick a free dev port when 3001 is busy
* feat(vis): accept v1.0 wire files via agent-core migration chain
* refactor(vis): default API to 5174 and pick a non-colliding vite port
* feat(vis): make long strings expandable with copy in JsonViewer
* fix(vis): stop gating session health on protocol version
* refactor(vis): split wire records into raw + projected; best-effort unknown protocol
* feat(vis): pair tool.call with tool.result via inline cross-reference and hover highlight
* feat(vis): open session folder and copy its path from the detail header
* fix(vis): reconstruct assistant and tool messages from loop events
* fix(vis): keep system prompt bubble within the message column width
* feat(vis): collapse tool result bubble by default in context view
* feat(vis): expose broken_main_wire in the session health filter
* fix(vis): reset wire and context tab agent when navigating sessions
* fix(vis): fall back to a generic headline for unknown wire record types
* fix(vis): emit compaction summary as an assistant message with origin
* fix(vis): harden session-store reads for broken wires, broken state, and path-traversal agent ids
* feat(vis): inline image previews for image_url content parts