Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/agents-md-documentation.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/append-system-prompt-cli.md

This file was deleted.

9 changes: 9 additions & 0 deletions .changeset/cmdv-image-paste-macos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"kilo-code": patch
---

Support Cmd+V for pasting images on macOS in VSCode terminal

- Detect empty bracketed paste (when clipboard contains image instead of text)
- Trigger clipboard image check on empty paste or paste timeout
- Add Cmd+V (meta key) support alongside Ctrl+V for image paste
5 changes: 5 additions & 0 deletions .changeset/enable-jetbrains-autocomplete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Enable autocomplete by default in the JetBrains extension
9 changes: 9 additions & 0 deletions .changeset/fix-vscode-paste-truncation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"kilo-code": patch
---

Fix paste truncation in VSCode terminal

- Prevent React StrictMode cleanup from interrupting paste operations
- Remove `completePaste()` and `clearBuffers()` from useEffect cleanup
- Paste buffer refs now persist across React re-mounts and flush properly when paste end marker is received
5 changes: 0 additions & 5 deletions .changeset/stupid-mayflies-pay.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/worktree-migration.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# AGENTS.md

This file provides guidance to agents when working with code in this repository in Translate mode.

## Workflow

This workflow requires Orchestrator mode.
---
name: translation
description: Guidelines for translating and localizing the Kilo Code extension, including language-specific rules for German, Simplified Chinese, and Traditional Chinese.
---

Execute `node scripts/find-missing-translations.js` in Code mode to find all missing translations.
# Translation Guidelines

For each language that is missing translations:
This file provides guidance to agents when working with translations in this repository.

- For each JSON file that is missing translations:
- Start a separate subtask in Translate mode for this language and JSON file to add the missing translations. Do not try to process mutliple languages or JSON files in one subtask.
For the translation workflow, use the `/add-missing-translations` command or see `.kilocode/workflows/add-missing-translations.md`.

---

Expand Down Expand Up @@ -311,42 +307,13 @@ For each language that is missing translations:

### Common Patterns

```markdown
<<<<<<< BEFORE
"dragFiles": "按住shift拖动文件"
=======
"dragFiles": "Shift+拖拽文件"

> > > > > > > AFTER

<<<<<<< BEFORE
"description": "启用后,Kilo Code 将能够与 MCP 服务器交互以获取高级功能。"
=======
"description": "启用后 Kilo Code 可与 MCP 服务交互获取高级功能。"

> > > > > > > AFTER

<<<<<<< BEFORE
"cannotUndo": "此操作无法撤消。"
=======
"cannotUndo": "此操作不可逆。"

> > > > > > > AFTER

<<<<<<< BEFORE
"hold shift to drag in files" → "按住shift拖动文件"
=======
"hold shift to drag in files" → "Shift+拖拽文件"

> > > > > > > AFTER

<<<<<<< BEFORE
"Double click to edit" → "双击进行编辑"
=======
"Double click to edit" → "双击编辑"

> > > > > > > AFTER
```
| Original | Avoid | Preferred |
| ------------------------------- | ------------------------------------------------------------- | ---------------------------------------------------- |
| `"dragFiles"` | `"按住shift拖动文件"` | `"Shift+拖拽文件"` |
| `"description"` | `"启用后,Kilo Code 将能够与 MCP 服务器交互以获取高级功能。"` | `"启用后 Kilo Code 可与 MCP 服务交互获取高级功能。"` |
| `"cannotUndo"` | `"此操作无法撤消。"` | `"此操作不可逆。"` |
| `"hold shift to drag in files"` | `"按住shift拖动文件"` | `"Shift+拖拽文件"` |
| `"Double click to edit"` | `"双击进行编辑"` | `"双击编辑"` |

### Common Pitfalls

Expand Down
22 changes: 22 additions & 0 deletions .kilocode/workflows/add-missing-translations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Add missing translations

This workflow requires Orchestrator mode.

Execute `node scripts/find-missing-translations.js` in Code mode to find all missing translations.

For each language that is missing translations:

- For each JSON file that is missing translations:
- Start a separate subtask in Translate mode for this language and JSON file to add the missing translations. Do not try to process multiple languages or JSON files in one subtask.

## Translation Guidelines

When translating, follow these key rules:

1. **Supported Languages**: ar, ca, cs, de, en, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, th, tr, uk, vi, zh-CN, zh-TW
2. **Voice**: Always use informal speech (e.g., "du" not "Sie" in German)
3. **Technical Terms**: Don't translate "token", "API", "prompt" and domain-specific technical terms
4. **Placeholders**: Keep `{{variable}}` placeholders exactly as in the English source
5. **Validation**: Run `node scripts/find-missing-translations.js` to validate changes

For comprehensive translation guidelines including language-specific rules, see `.kilocode/skills/translation/SKILL.md`.
8 changes: 5 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

Kilo Code is an open source AI coding agent for VS Code that generates code from natural language, automates tasks, and supports 500+ AI models.

## Mode-Specific Rules
## Skills

For mode-specific guidance, see the following files:
- **Translation**: `.kilocode/skills/translation/SKILL.md` - Translation and localization guidelines

- **Translate mode**: `.roo/rules-translate/AGENTS.md` - Translation and localization guidelines
## Workflows

- **Add Missing Translations**: `.kilocode/workflows/add-missing-translations.md` - Run `/add-missing-translations` to find and fix missing translations

## Changesets

Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# kilo-code

## 4.143.0

### Minor Changes

- [#4643](https://github.com/Kilo-Org/kilocode/pull/4643) [`bf89c48`](https://github.com/Kilo-Org/kilocode/commit/bf89c4849342d9c0f3cfa335d65e98980d869e36) Thanks [@marius-kilocode](https://github.com/marius-kilocode)! - Migrate worktree creation from CLI to extension for parallel mode sessions

### Patch Changes

- [#4804](https://github.com/Kilo-Org/kilocode/pull/4804) [`e83c30a`](https://github.com/Kilo-Org/kilocode/commit/e83c30a4160309c45bcfedf60faad3eedff0549e) Thanks [@kiloconnect](https://github.com/apps/kiloconnect)! - Add comprehensive AGENTS.md documentation page to Agent Behavior section

- [#4810](https://github.com/Kilo-Org/kilocode/pull/4810) [`2d8f5b4`](https://github.com/Kilo-Org/kilocode/commit/2d8f5b4f823750d22701d962ba27885b01f78acb) Thanks [@kiloconnect](https://github.com/apps/kiloconnect)! - Add `--append-system-prompt` CLI option to append custom instructions to the system prompt

- [#4808](https://github.com/Kilo-Org/kilocode/pull/4808) [`3253a5f`](https://github.com/Kilo-Org/kilocode/commit/3253a5f0a9ef3db176b0cc027a9a0f246faa27e6) Thanks [@markijbema](https://github.com/markijbema)! - Rename and reorganize autocomplete settings to use more familiar terminology

- [#4815](https://github.com/Kilo-Org/kilocode/pull/4815) [`1530050`](https://github.com/Kilo-Org/kilocode/commit/15300507c8febd2096282e97148e39a0bfda9e23) Thanks [@chrarnoldus](https://github.com/chrarnoldus)! - Allow null for tool arguments

## 4.142.0

### Minor Changes
Expand Down
6 changes: 6 additions & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @kilocode/cli

## 0.19.1

### Patch Changes

- [#4810](https://github.com/Kilo-Org/kilocode/pull/4810) [`2d8f5b4`](https://github.com/Kilo-Org/kilocode/commit/2d8f5b4f823750d22701d962ba27885b01f78acb) Thanks [@kiloconnect](https://github.com/apps/kiloconnect)! - Add `--append-system-prompt` CLI option to append custom instructions to the system prompt

## 0.19.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion cli/package.dist.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kilocode/cli",
"version": "0.19.0",
"version": "0.19.1",
"description": "Terminal User Interface for Kilo Code",
"type": "module",
"main": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kilocode/cli",
"version": "0.19.0",
"version": "0.19.1",
"description": "Terminal User Interface for Kilo Code",
"type": "module",
"main": "dist/index.js",
Expand Down
38 changes: 29 additions & 9 deletions cli/src/state/atoms/keyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -889,10 +889,10 @@ function handleTextInputKeys(get: Getter, set: Setter, key: Key) {
}

function handleGlobalHotkeys(get: Getter, set: Setter, key: Key): boolean {
// Debug logging for key detection
if (key.ctrl || key.sequence === "\x16") {
// Debug logging for key detection (Ctrl or Meta/Cmd keys)
if (key.ctrl || key.meta || key.sequence === "\x16") {
logs.debug(
`Key detected: name=${key.name}, ctrl=${key.ctrl}, meta=${key.meta}, sequence=${JSON.stringify(key.sequence)}`,
`Key detected: name=${key.name}, ctrl=${key.ctrl}, meta=${key.meta}, shift=${key.shift}, paste=${key.paste}, sequence=${JSON.stringify(key.sequence)}`,
"clipboard",
)
}
Expand All @@ -916,9 +916,9 @@ function handleGlobalHotkeys(get: Getter, set: Setter, key: Key): boolean {
}
break
case "v":
// Ctrl+V - check for clipboard image
if (key.ctrl) {
logs.debug("Detected Ctrl+V via key.name", "clipboard")
// Ctrl+V or Cmd+V (macOS) - check for clipboard image
if (key.ctrl || key.meta) {
logs.debug(`Detected ${key.meta ? "Cmd" : "Ctrl"}+V via key.name`, "clipboard")
// Handle clipboard image paste asynchronously
handleClipboardImagePaste(get, set).catch((err) =>
logs.error("Unhandled clipboard paste error", "clipboard", { error: err }),
Expand Down Expand Up @@ -977,19 +977,39 @@ function handleGlobalHotkeys(get: Getter, set: Setter, key: Key): boolean {
}

/**
* Handle clipboard image paste (Ctrl+V)
* Atom to trigger clipboard image paste from external components (e.g., KeyboardProvider)
* This is used when a paste timeout occurs (e.g., Cmd+V with image in clipboard)
*/
export const triggerClipboardImagePasteAtom = atom(null, async (get, set, fallbackText?: string) => {
await handleClipboardImagePaste(get, set, fallbackText)
})

/**
* Handle clipboard image paste (Ctrl+V or Cmd+V on macOS)
* Saves clipboard image to a temp file and inserts @path reference into text buffer
* If fallbackText is provided and no image is found, broadcasts the fallback text as a paste event
*/
async function handleClipboardImagePaste(get: Getter, set: Setter): Promise<void> {
async function handleClipboardImagePaste(get: Getter, set: Setter, fallbackText?: string): Promise<void> {
logs.debug("handleClipboardImagePaste called", "clipboard")
try {
// Check if clipboard has an image
logs.debug("Checking clipboard for image...", "clipboard")
const hasImage = await clipboardHasImage()
logs.debug(`clipboardHasImage returned: ${hasImage}`, "clipboard")
if (!hasImage) {
setClipboardStatusWithTimeout(set, "No image in clipboard", 2000)
logs.debug("No image in clipboard", "clipboard")
// If fallback text provided, broadcast it as paste event
if (fallbackText) {
logs.debug("Using fallback text for paste", "clipboard")
set(broadcastKeyEventAtom, {
name: "",
ctrl: false,
meta: false,
shift: false,
paste: true,
sequence: fallbackText,
})
}
return
}

Expand Down
33 changes: 21 additions & 12 deletions cli/src/ui/providers/KeyboardProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import {
setDebugLoggingAtom,
clearBuffersAtom,
setupKeyboardAtom,
triggerClipboardImagePasteAtom,
} from "../../state/atoms/keyboard.js"
import {
parseKittySequence,
isPasteModeBoundary,
isFocusEvent,
mapAltKeyCharacter,
parseReadlineKey,
createPasteKey,
createSpecialKey,
} from "../utils/keyParsing.js"
import { autoEnableKittyProtocol } from "../utils/terminalCapabilities.js"
Expand Down Expand Up @@ -68,6 +68,7 @@ export function KeyboardProvider({ children, config = {} }: KeyboardProviderProp
const setDebugLogging = useSetAtom(setDebugLoggingAtom)
const clearBuffers = useSetAtom(clearBuffersAtom)
const setupKeyboard = useSetAtom(setupKeyboardAtom)
const triggerClipboardImagePaste = useSetAtom(triggerClipboardImagePasteAtom)

// Jotai getters (for reading current state)
const pasteBuffer = useAtomValue(pasteBufferAtom)
Expand Down Expand Up @@ -97,17 +98,23 @@ export function KeyboardProvider({ children, config = {} }: KeyboardProviderProp
// Handle paste completion
const completePaste = useCallback(() => {
const currentBuffer = pasteBufferRef.current
if (isPasteRef.current && currentBuffer) {
const wasPasting = isPasteRef.current

// Reset paste state
setPasteMode(false)
isPasteRef.current = false
pasteBufferRef.current = ""

if (wasPasting) {
// Normalize line endings: convert \r\n and \r to \n
// This handles different line ending formats from various terminals/platforms
const normalizedBuffer = currentBuffer.replace(/\r\n/g, "\n").replace(/\r/g, "\n")

broadcastKey(createPasteKey(normalizedBuffer))
setPasteMode(false)
isPasteRef.current = false
pasteBufferRef.current = ""
const normalizedBuffer = currentBuffer ? currentBuffer.replace(/\r\n/g, "\n").replace(/\r/g, "\n") : ""
// Always check clipboard for image first (prioritize image over text)
// If no image found, the fallback text will be used
// This handles: Cmd+V with image file copied from Finder (terminal sends filename as text)
triggerClipboardImagePaste(normalizedBuffer || undefined)
}
}, [broadcastKey, setPasteMode])
}, [setPasteMode, triggerClipboardImagePaste])

useEffect(() => {
// Save original raw mode state
Expand Down Expand Up @@ -414,9 +421,10 @@ export function KeyboardProvider({ children, config = {} }: KeyboardProviderProp
// Clear timers
clearBackslashTimer()

// Flush any pending buffers
completePaste()
clearBuffers()
// DON'T flush paste buffers here - React StrictMode causes re-mounts
// that would interrupt an in-progress paste operation.
// The paste buffer refs persist across re-mounts and will be
// properly flushed when the paste end marker is received.
}
}, [
stdin,
Expand All @@ -431,6 +439,7 @@ export function KeyboardProvider({ children, config = {} }: KeyboardProviderProp
setKittyProtocol,
pasteBuffer,
kittyBuffer,
triggerClipboardImagePaste,
isKittyEnabled,
isDebugEnabled,
completePaste,
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "%extension.displayName%",
"description": "%extension.description%",
"publisher": "kilocode",
"version": "4.142.0",
"version": "4.143.0",
"icon": "assets/icons/logo-outline-black.png",
"galleryBanner": {
"color": "#FFFFFF",
Expand Down
Loading