Add syntax highlighting to shell command output using Shiki with labeled "Command" and "Output" sections, per-section copy buttons, and an "Open in Editor" action. The feature supports opening full untruncated output in VS Code editor tabs and includes i18n translations for 18 languages.
Changes include:
- BashHighlightedOutput component with shellscript grammar for commands and log grammar for output
- Section labels and dividers matching MCP tool styling patterns
- Copy buttons for both command and output sections with visual feedback
- OpenContent message type and handler for opening arbitrary text in untitled editor tabs
- Support for outputPath metadata to open full files when output is truncated
- CSS styling for section layout, scrolling, and hover-revealed actions
- i18n dictionary updates across all 18 supported languages (ar, br, bs, da, de, en, es, fr, ja, ko, nl, no, pl, ru, th, tr, uk, zh, zht)
- Changeset entry documenting the feature as a minor version bump
DOMPurify 3.1.7+ removed foreignObject from default HTML integration
points, so the inner <div>/<span>/<p> Mermaid renders inside foreignObject
were stripped, leaving every shape with empty text. Restore it via
HTML_INTEGRATION_POINTS.
* fix(ui): correct diff line numbers by padding hunks to their real file positions
When reconstructing before/after content from patches, hunks starting
at lines other than 1 were rendered starting at line 1. Pad blank lines
before each hunk so content aligns with actual file line numbers. Also
add hunkSeparators="simple" prop across all diff viewer instances and
guard against undefined patch parse results.
* refactor(diff): replace content reconstruction with Pierre's native FileDiffMetadata rendering
Migrate all diff viewers from manually reconstructing before/after strings
to passing FileDiffMetadata directly to Pierre's renderer. This ensures
hunk headers are the source of truth for line numbers without requiring
blank-line padding.
Key changes:
- Rename `contents()` to `normalize()` and return FileDiffMetadata
alongside before/after text for legacy consumers
- Introduce discriminated union DiffProps (DiffPair | DiffPatch) so
components accept either before/after or a pre-parsed fileDiff
- Thread `patch` field through openDiff payloads and DiffVirtualProvider
- Update DiffVirtualApp, PermissionDiff, and message-part to use the
new `normalize()` API and render via fileDiff prop
- Add test coverage verifying hunk start lines are preserved without
padding
BREAKING CHANGE: `contents()` export from session-diff is removed; consumers must migrate to `normalize()`
* fix(diff): normalize trailing newline in text() helper output
* refactor(ui): remove before/after fields from diff payload interfaces
The diff pipeline now relies exclusively on patch strings for rendering
and opening diffs. This eliminates the redundant before/after content
fields from DiffVirtualFile, PermissionFileDiff, OpenDiffFn, and
ApplyPatchFile interfaces across all packages.
- Drop before/after from all diff-related type definitions
- Simplify normalize() call sites to require only patch presence
- Make DiffText type private (no longer exported from session-diff)
- Update edit tool to render from tool input during pending state
- Fix DiffVirtualApp to nest markdown view inside patch guard
- Adjust contract tests to match new fallback behavior
* fix(kilo-ui): Move session-diff normalization logic into kilo-ui package
* refactor(ui): decouple DiffProps type hierarchy between shared and kilo-ui packages
Simplify the shared ui package's DiffProps back to a single concrete
type requiring before/after contents, and relocate the discriminated
union (DiffPair | DiffPatch with optional FileDiffMetadata) into the
kilo-ui package where patch-based rendering is actually needed.
- Revert shared DiffProps to a flat type without fileDiff variant
- Define extended DiffProps union in kilo-ui/src/pierre/index.ts
- Update kilo-ui diff components to import from local pierre module
- Expand OpenDiffFn signature with optional before/after fields
* fix(vscode): restore inline tool diffs
* fix(vscode): render tool patches in kilo ui
* style: format long regex assignments and add change marker comment
Reformat multi-line regex match assignments in kilo-ui-contract test
to satisfy line length limits, and annotate the `contents(diff)` call
in session-diff with a kilocode_change tracking comment.
* fix(kilo-vscode): append trailing newlines to expected diff content assertions
Update test expectations in diff-session-source to include trailing
newlines in before/after content, matching actual file content behavior.
* fix(vscode): guard empty-patch diffs in session turn accordion
Match diff-session-source.ts:99 behavior by short-circuiting contents()
when the patch is empty (binary or summarized files), so the accordion
content stays empty instead of rendering a confusing whitespace-only
diff.
---------
Co-authored-by: Imanol Maiztegui <imanol.mzd@gmail.com>