diff --git a/.gitattributes b/.gitattributes index 453ae820fe8..d351e0fc83e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,6 @@ +# Enforce LF line endings for all text files +* text=auto eol=lf + # Git LFS tracking for binary/media files *.gif filter=lfs diff=lfs merge=lfs -text *.mp4 filter=lfs diff=lfs merge=lfs -text @@ -5,3 +8,13 @@ # Visual regression baseline snapshots packages/kilo-ui/tests/**/*.png filter=lfs diff=lfs merge=lfs -text packages/kilo-vscode/tests/**/*.png filter=lfs diff=lfs merge=lfs -text + +# Hide non-English localization files by default in GitHub PR diffs. +**/i18n/*.ts linguist-generated=true +**/i18n/en.ts linguist-generated=false +**/i18n/en*.ts linguist-generated=false +**/i18n/package-nls-en.ts linguist-generated=false +**/i18n/index.ts linguist-generated=false +**/i18n/parity.test.ts linguist-generated=false +packages/kilo-i18n/src/*.ts linguist-generated=true +packages/kilo-i18n/src/en.ts linguist-generated=false diff --git a/.kilocode/skills/vscode-visual-regression/SKILL.md b/.kilocode/skills/vscode-visual-regression/SKILL.md index 7b2f3bc0460..35b9eda9659 100644 --- a/.kilocode/skills/vscode-visual-regression/SKILL.md +++ b/.kilocode/skills/vscode-visual-regression/SKILL.md @@ -59,7 +59,7 @@ export const MyStoryName: Story = { name: "MyComponent — description of variant", render: () => ( -
+
@@ -71,7 +71,8 @@ export const MyStoryName: Story = { - **Always start with `/** @jsxImportSource solid-js \*/`\*\* — required for SolidJS JSX compilation. - **Always wrap in ``** — provides all required contexts (VSCode, Server, Config, Provider, Session, I18n, Dialog, Marked, Data, Diff, Code). Without it, components that call `useVSCode()`, `useSession()`, etc. will throw. -- **Set explicit dimensions** on a wrapper div so the screenshot has a deterministic size. Use `width: "420px"` for sidebar-width components (the standard VS Code sidebar). Use `width: "200px"` for narrow/collapsed states. +- **Do NOT set an explicit `width` on the wrapper div.** The Playwright viewport is already 420px wide (or 200px for narrow stories). Setting `width: "420px"` leaves no room for a vertical scrollbar and causes right-side cropping in screenshots. Let the viewport control the width. +- **Use `max-height` not `height` for the wrapper div** when you need to constrain vertical size. A fixed `height` forces a scrollbar even when content is short; `max-height` avoids unnecessary scrollbars that would eat into the available horizontal space. - **Meta `title`** determines the snapshot subdirectory. Use PascalCase or slash-notation (e.g., `"Composite/Webview"`). Playwright transforms it: `"Composite/Webview"` becomes `composite-webview/` in the snapshots folder. - **Export name** determines the story ID. The Storybook ID is `{lowercase-title}--{kebab-export-name}`. For example, `title: "Chat"` + `export const ChatViewIdle` produces ID `chat--chat-view-idle`. - **Snapshot path** is derived automatically: `tests/visual-regression.spec.ts-snapshots/{title-slug}/{variant-slug}.png`. Example: `chat/chat-view-idle-chromium-linux.png`. diff --git a/.opencode/command/issues.md b/.opencode/command/issues.md index d1e37d4a7df..224f22e3035 100644 --- a/.opencode/command/issues.md +++ b/.opencode/command/issues.md @@ -3,7 +3,7 @@ description: "find issue(s) on github" model: opencode/claude-haiku-4-5 --- -Search through existing issues in Kilo-Org/kilo using the gh cli to find issues matching this query: +Search through existing issues in Kilo-Org/kilocode using the gh cli to find issues matching this query: $ARGUMENTS diff --git a/README.md b/README.md index 31d9e5cf348..9aee29c4892 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@

- VS Code Marketplace - X (Twitter) - Substack Blog - Discord - Reddit + VS Code Marketplace + X (Twitter) + Substack Blog + Discord + Reddit

# 🚀 Kilo @@ -84,7 +84,7 @@ For most users: - **Windows (most PCs):** `kilo-windows-x64.zip` - **macOS Apple Silicon:** `kilo-darwin-arm64.zip` - **macOS Intel:** `kilo-darwin-x64.zip` -- **Linux x64:** `kilo-linux-x64.tar,gz` +- **Linux x64:** `kilo-linux-x64.tar.gz` - **Linux on ARM:** `kilo-linux-arm64.tar.gz` ### Autonomous Mode (CI/CD) diff --git a/bun.lock b/bun.lock index fd3e6acabc4..1a8872aaa24 100644 --- a/bun.lock +++ b/bun.lock @@ -27,7 +27,7 @@ }, "packages/app": { "name": "@opencode-ai/app", - "version": "7.1.5", + "version": "7.1.17", "dependencies": { "@kilocode/kilo-i18n": "workspace:*", "@kilocode/kilo-ui": "workspace:*", @@ -79,7 +79,7 @@ }, "packages/desktop": { "name": "@opencode-ai/desktop", - "version": "7.1.5", + "version": "7.1.17", "dependencies": { "@opencode-ai/app": "workspace:*", "@opencode-ai/ui": "workspace:*", @@ -112,7 +112,7 @@ }, "packages/desktop-electron": { "name": "@opencode-ai/desktop-electron", - "version": "7.1.5", + "version": "7.1.17", "dependencies": { "@opencode-ai/app": "workspace:*", "@opencode-ai/ui": "workspace:*", @@ -142,7 +142,7 @@ }, "packages/kilo-docs": { "name": "@kilocode/kilo-docs", - "version": "7.1.5", + "version": "7.1.17", "dependencies": { "@docsearch/css": "^4", "@docsearch/js": "^4", @@ -171,10 +171,10 @@ }, "packages/kilo-gateway": { "name": "@kilocode/kilo-gateway", - "version": "7.1.5", + "version": "7.1.17", "dependencies": { "@ai-sdk/anthropic": "2.0.65", - "@ai-sdk/openai": "2.0.89", + "@ai-sdk/openai": "2.0.101", "@ai-sdk/openai-compatible": "1.0.32", "@clack/prompts": "1.0.0-alpha.1", "@kilocode/plugin": "workspace:*", @@ -206,7 +206,7 @@ }, "packages/kilo-i18n": { "name": "@kilocode/kilo-i18n", - "version": "7.1.5", + "version": "7.1.17", "devDependencies": { "@tsconfig/node22": "catalog:", "@types/bun": "catalog:", @@ -216,7 +216,7 @@ }, "packages/kilo-telemetry": { "name": "@kilocode/kilo-telemetry", - "version": "7.1.5", + "version": "7.1.17", "dependencies": { "@kilocode/kilo-gateway": "workspace:*", "@opentelemetry/api": "1.9.0", @@ -236,7 +236,7 @@ }, "packages/kilo-ui": { "name": "@kilocode/kilo-ui", - "version": "7.1.5", + "version": "7.1.17", "dependencies": { "@kobalte/core": "0.13.11", "@opencode-ai/util": "workspace:*", @@ -271,7 +271,7 @@ }, "packages/kilo-vscode": { "name": "kilo-code", - "version": "7.1.5", + "version": "7.1.17", "dependencies": { "@anthropic-ai/sdk": "^0.39.0", "@kilocode/kilo-i18n": "workspace:*", @@ -324,7 +324,7 @@ }, "packages/opencode": { "name": "@kilocode/cli", - "version": "7.1.5", + "version": "7.1.17", "bin": { "kilo": "./bin/kilo", "kilocode": "./bin/kilo", @@ -344,7 +344,7 @@ "@ai-sdk/google-vertex": "3.0.106", "@ai-sdk/groq": "2.0.34", "@ai-sdk/mistral": "2.0.27", - "@ai-sdk/openai": "2.0.89", + "@ai-sdk/openai": "2.0.101", "@ai-sdk/openai-compatible": "1.0.32", "@ai-sdk/perplexity": "2.0.23", "@ai-sdk/provider": "2.0.1", @@ -447,7 +447,7 @@ }, "packages/plugin": { "name": "@kilocode/plugin", - "version": "7.1.5", + "version": "7.1.17", "dependencies": { "@kilocode/sdk": "workspace:*", "zod": "catalog:", @@ -461,14 +461,14 @@ }, "packages/script": { "name": "@opencode-ai/script", - "version": "7.1.5", + "version": "7.1.17", "devDependencies": { "@types/bun": "catalog:", }, }, "packages/sdk/js": { "name": "@kilocode/sdk", - "version": "7.1.5", + "version": "7.1.17", "devDependencies": { "@hey-api/openapi-ts": "0.90.10", "@tsconfig/node22": "catalog:", @@ -479,7 +479,7 @@ }, "packages/storybook": { "name": "@opencode-ai/storybook", - "version": "7.1.5", + "version": "7.1.17", "devDependencies": { "@opencode-ai/ui": "workspace:*", "@solidjs/meta": "catalog:", @@ -502,7 +502,7 @@ }, "packages/ui": { "name": "@opencode-ai/ui", - "version": "7.1.5", + "version": "7.1.17", "dependencies": { "@kilocode/sdk": "workspace:*", "@kobalte/core": "catalog:", @@ -549,7 +549,7 @@ }, "packages/util": { "name": "@opencode-ai/util", - "version": "7.1.5", + "version": "7.1.17", "dependencies": { "zod": "catalog:", }, @@ -666,7 +666,7 @@ "@ai-sdk/mistral": ["@ai-sdk/mistral@2.0.27", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-gaptHgaXjMw3+eA0Q4FABcsj5nQNP6EpFaGUR+Pj5WJy7Kn6mApl975/x57224MfeJIShNpt8wFKK3tvh5ewKg=="], - "@ai-sdk/openai": ["@ai-sdk/openai@2.0.89", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-4+qWkBCbL9HPKbgrUO/F2uXZ8GqrYxHa8SWEYIzxEJ9zvWw3ISr3t1/27O1i8MGSym+PzEyHBT48EV4LAwWaEw=="], + "@ai-sdk/openai": ["@ai-sdk/openai@2.0.101", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.22" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-kQ52HLV45T3bQbRzWExXW6+pkg3Nvq4dUnZHUPJXWgkUUsAhZjxHrXqPOc/0yfn/4+Dn2uLmIgAkP9IfzMMcNg=="], "@ai-sdk/openai-compatible": ["@ai-sdk/openai-compatible@1.0.32", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-YspqqyJPzHjqWrjt4y/Wgc2aJgCcQj5uIJgZpq2Ar/lH30cEVhgE+keePDbjKpetD9UwNggCj7u6kO3unS23OQ=="], @@ -4364,6 +4364,8 @@ "@ai-sdk/amazon-bedrock/aws4fetch": ["aws4fetch@1.0.20", "", {}, "sha512-/djoAN709iY65ETD6LKCtyyEI04XIBP5xVvfmNxsEP0uJB5tyaGBztSryRr4HqMStr9R06PisQE7m9zDTXKu6g=="], + "@ai-sdk/azure/@ai-sdk/openai": ["@ai-sdk/openai@2.0.89", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-4+qWkBCbL9HPKbgrUO/F2uXZ8GqrYxHa8SWEYIzxEJ9zvWw3ISr3t1/27O1i8MGSym+PzEyHBT48EV4LAwWaEw=="], + "@ai-sdk/azure/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.20", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-iXHVe0apM2zUEzauqJwqmpC37A5rihrStAih5Ks+JE32iTe4LZ58y17UGBjpQQTCRw9YxMeo2UFLxLpBluyvLQ=="], "@ai-sdk/cerebras/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.20", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-iXHVe0apM2zUEzauqJwqmpC37A5rihrStAih5Ks+JE32iTe4LZ58y17UGBjpQQTCRw9YxMeo2UFLxLpBluyvLQ=="], @@ -4388,7 +4390,7 @@ "@ai-sdk/mistral/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.20", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-iXHVe0apM2zUEzauqJwqmpC37A5rihrStAih5Ks+JE32iTe4LZ58y17UGBjpQQTCRw9YxMeo2UFLxLpBluyvLQ=="], - "@ai-sdk/openai/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.20", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-iXHVe0apM2zUEzauqJwqmpC37A5rihrStAih5Ks+JE32iTe4LZ58y17UGBjpQQTCRw9YxMeo2UFLxLpBluyvLQ=="], + "@ai-sdk/openai/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.22", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-fFT1KfUUKktfAFm5mClJhS1oux9tP2qgzmEZVl5UdwltQ1LO/s8hd7znVrgKzivwv1s1FIPza0s9OpJaNB/vHw=="], "@ai-sdk/openai-compatible/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.20", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-iXHVe0apM2zUEzauqJwqmpC37A5rihrStAih5Ks+JE32iTe4LZ58y17UGBjpQQTCRw9YxMeo2UFLxLpBluyvLQ=="], @@ -4842,6 +4844,8 @@ "ai-gateway-provider/@ai-sdk/google-vertex": ["@ai-sdk/google-vertex@3.0.90", "", { "dependencies": { "@ai-sdk/anthropic": "2.0.56", "@ai-sdk/google": "2.0.46", "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.19", "google-auth-library": "^10.5.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-C9MLe1KZGg1ZbupV2osygHtL5qngyCDA6ATatunyfTbIe8TXKG8HGni/3O6ifbnI5qxTidIn150Ox7eIFZVMYg=="], + "ai-gateway-provider/@ai-sdk/openai": ["@ai-sdk/openai@2.0.89", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-4+qWkBCbL9HPKbgrUO/F2uXZ8GqrYxHa8SWEYIzxEJ9zvWw3ISr3t1/27O1i8MGSym+PzEyHBT48EV4LAwWaEw=="], + "ajv-keywords/ajv": ["ajv@6.14.0", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw=="], "anymatch/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], @@ -5606,6 +5610,8 @@ "ai-gateway-provider/@ai-sdk/google-vertex/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.19", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-W41Wc9/jbUVXVwCN/7bWa4IKe8MtxO3EyA0Hfhx6grnmiYlCvpI8neSYWFE0zScXJkgA/YK3BRybzgyiXuu6JA=="], + "ai-gateway-provider/@ai-sdk/openai/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.20", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-iXHVe0apM2zUEzauqJwqmpC37A5rihrStAih5Ks+JE32iTe4LZ58y17UGBjpQQTCRw9YxMeo2UFLxLpBluyvLQ=="], + "ajv-keywords/ajv/json-schema-traverse": ["json-schema-traverse@0.4.1", "", {}, "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="], "app-builder-lib/@electron/get/fs-extra": ["fs-extra@8.1.0", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", "universalify": "^0.1.0" } }, "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g=="], diff --git a/nix/hashes.json b/nix/hashes.json index 8d54b85cb0c..80015c18486 100644 --- a/nix/hashes.json +++ b/nix/hashes.json @@ -1,8 +1,8 @@ { "nodeModules": { - "x86_64-linux": "sha256-85Pa4C5F3yqjMzIGBcWYGe+IitSg9nnTtixqZPRnFps=", - "aarch64-linux": "sha256-qeyu0LS1z8JXGa+2EVd/U94uQIV8zi53ZmymE9/trSU=", - "aarch64-darwin": "sha256-qwedJnAMcM/gTVSCTErsP++HM2lYQtLE+PM1QkT7fy8=", - "x86_64-darwin": "sha256-372zLuwN6TLhn4JIDorEc13mjMpC91UbukxE/Y14c/k=" + "x86_64-linux": "sha256-YjB3YfaA79nztpZoYEAlFBakS//G/Guprlqk4BYFgOA=", + "aarch64-linux": "sha256-ru470M8RVwyOPNGr6I4VfApQRHhYFFMPjOBneTRBJtc=", + "aarch64-darwin": "sha256-M6LIPBHnYH9AtIRAKyW44VN71Kb28nztzFteCkL0588=", + "x86_64-darwin": "sha256-HURoot79BFHYwoEp0XqVdI6cRdV7KGvmRRqOf+hUa9Q=" } } diff --git a/package.json b/package.json index b545f56fb6c..6d7a5456a88 100644 --- a/package.json +++ b/package.json @@ -112,6 +112,6 @@ "@openrouter/ai-sdk-provider@1.5.4": "patches/@openrouter%2Fai-sdk-provider@1.5.4.patch", "ghostty-web@0.3.0": "patches/ghostty-web@0.3.0.patch" }, - "version": "7.1.5", + "version": "7.1.17", "peerDependencies": {} } diff --git a/packages/app/package.json b/packages/app/package.json index 501bfb811e9..4db29fe66dd 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/app", - "version": "7.1.5", + "version": "7.1.17", "description": "", "type": "module", "exports": { diff --git a/packages/desktop-electron/package.json b/packages/desktop-electron/package.json index 19ee2f159b9..e470046d6c9 100644 --- a/packages/desktop-electron/package.json +++ b/packages/desktop-electron/package.json @@ -1,7 +1,7 @@ { "name": "@opencode-ai/desktop-electron", "private": true, - "version": "7.1.5", + "version": "7.1.17", "type": "module", "license": "MIT", "homepage": "https://opencode.ai", diff --git a/packages/desktop/package.json b/packages/desktop/package.json index 9233f3b0535..b48367a8c38 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -1,7 +1,7 @@ { "name": "@opencode-ai/desktop", "private": true, - "version": "7.1.5", + "version": "7.1.17", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/extensions/zed/extension.toml b/packages/extensions/zed/extension.toml index e377a5bb052..ad9a1bb894f 100644 --- a/packages/extensions/zed/extension.toml +++ b/packages/extensions/zed/extension.toml @@ -1,7 +1,7 @@ id = "kilo" name = "Kilo" description = "The open source coding agent." -version = "7.1.5" +version = "7.1.17" schema_version = 1 authors = ["Anomaly"] repository = "https://github.com/Kilo-Org/kilocode" @@ -11,26 +11,26 @@ name = "Kilo" icon = "./icons/opencode.svg" [agent_servers.opencode.targets.darwin-aarch64] -archive = "https://github.com/Kilo-Org/kilocode/releases/download/v7.1.5/opencode-darwin-arm64.zip" +archive = "https://github.com/Kilo-Org/kilocode/releases/download/v7.1.17/opencode-darwin-arm64.zip" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.darwin-x86_64] -archive = "https://github.com/Kilo-Org/kilocode/releases/download/v7.1.5/opencode-darwin-x64.zip" +archive = "https://github.com/Kilo-Org/kilocode/releases/download/v7.1.17/opencode-darwin-x64.zip" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.linux-aarch64] -archive = "https://github.com/Kilo-Org/kilocode/releases/download/v7.1.5/opencode-linux-arm64.tar.gz" +archive = "https://github.com/Kilo-Org/kilocode/releases/download/v7.1.17/opencode-linux-arm64.tar.gz" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.linux-x86_64] -archive = "https://github.com/Kilo-Org/kilocode/releases/download/v7.1.5/opencode-linux-x64.tar.gz" +archive = "https://github.com/Kilo-Org/kilocode/releases/download/v7.1.17/opencode-linux-x64.tar.gz" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.windows-x86_64] -archive = "https://github.com/Kilo-Org/kilocode/releases/download/v7.1.5/opencode-windows-x64.zip" +archive = "https://github.com/Kilo-Org/kilocode/releases/download/v7.1.17/opencode-windows-x64.zip" cmd = "./opencode.exe" args = ["acp"] diff --git a/packages/kilo-docs/lib/nav/automate.ts b/packages/kilo-docs/lib/nav/automate.ts index e8ae1c02a8d..d4d9bb487e8 100644 --- a/packages/kilo-docs/lib/nav/automate.ts +++ b/packages/kilo-docs/lib/nav/automate.ts @@ -29,6 +29,7 @@ export const AutomateNav: NavSection[] = [ { href: "/automate/extending/auto-launch", children: "Auto-launch Configuration", + platform: "legacy", }, { href: "/automate/mcp/overview", @@ -53,8 +54,8 @@ export const AutomateNav: NavSection[] = [ { title: "Tools", links: [ - { href: "/automate/how-tools-work", children: "How Tools Work" }, - { href: "/automate/tools", children: "Tools Details" }, + { href: "/automate/how-tools-work", children: "How Tools Work", platform: "legacy" }, + { href: "/automate/tools", children: "Tools Details", platform: "legacy" }, ], }, ] diff --git a/packages/kilo-docs/lib/nav/code-with-ai.ts b/packages/kilo-docs/lib/nav/code-with-ai.ts index 59eac752024..e5d621b250f 100644 --- a/packages/kilo-docs/lib/nav/code-with-ai.ts +++ b/packages/kilo-docs/lib/nav/code-with-ai.ts @@ -41,10 +41,10 @@ export const CodeWithAiNav: NavSection[] = [ children: "Free & Budget Models", }, { - href: "/code-with-ai/agents/using-modes", - children: "Modes", + href: "/code-with-ai/agents/using-agents", + children: "Agents", subLinks: [ - { href: "/code-with-ai/agents/using-modes", children: "Using Modes" }, + { href: "/code-with-ai/agents/using-agents", children: "Using Agents" }, { href: "/code-with-ai/agents/orchestrator-mode", children: "Orchestrator Mode", diff --git a/packages/kilo-docs/lib/nav/contributing.ts b/packages/kilo-docs/lib/nav/contributing.ts index e02eb80fdaa..34fb344f30f 100644 --- a/packages/kilo-docs/lib/nav/contributing.ts +++ b/packages/kilo-docs/lib/nav/contributing.ts @@ -13,10 +13,6 @@ export const ContributingNav: NavSection[] = [ href: "/contributing/ecosystem", children: "Ecosystem", }, - { - href: "/contributing/cline-to-kilo-migration", - children: "Cline to Kilo Migration", - }, ], }, { diff --git a/packages/kilo-docs/lib/nav/customize.ts b/packages/kilo-docs/lib/nav/customize.ts index ca3760e1b5f..7687bad119f 100644 --- a/packages/kilo-docs/lib/nav/customize.ts +++ b/packages/kilo-docs/lib/nav/customize.ts @@ -20,9 +20,10 @@ export const CustomizeNav: NavSection[] = [ { href: "/customize/custom-subagents", children: "Custom Subagents", + platform: "new", }, { href: "/customize/agents-md", children: "agents.md" }, - { href: "/customize/workflows", children: "Workflows" }, + { href: "/customize/workflows", children: "Workflows", platform: "new" }, { href: "/customize/skills", children: "Skills" }, { href: "/customize/prompt-engineering", @@ -36,6 +37,7 @@ export const CustomizeNav: NavSection[] = [ { href: "/customize/context/codebase-indexing", children: "Codebase Indexing", + platform: "legacy", }, { href: "/customize/context/context-condensing", @@ -48,6 +50,7 @@ export const CustomizeNav: NavSection[] = [ { href: "/customize/context/large-projects", children: "Large Projects", + platform: "legacy", }, ], }, diff --git a/packages/kilo-docs/lib/nav/kiloclaw.ts b/packages/kilo-docs/lib/nav/kiloclaw.ts index 50262d29f6f..695801fc49d 100644 --- a/packages/kilo-docs/lib/nav/kiloclaw.ts +++ b/packages/kilo-docs/lib/nav/kiloclaw.ts @@ -7,19 +7,71 @@ export const KiloClawNav: NavSection[] = [ { href: "/kiloclaw/overview", children: "Overview" }, { href: "/kiloclaw/dashboard", children: "Dashboard" }, { href: "/kiloclaw/pre-installed-software", children: "Pre-installed Software" }, - { href: "/kiloclaw/control-ui", children: "Control UI" }, - { href: "/kiloclaw/chat-platforms", children: "Chat Platforms" }, + { href: "/kiloclaw/end-to-end", children: "End to End Config" }, { - href: "/kiloclaw/development-tools/github", + href: "/kiloclaw/control-ui/overview", + children: "Control UI", + subLinks: [ + { href: "/kiloclaw/control-ui/overview", children: "Overview" }, + { href: "/kiloclaw/control-ui/changing-models", children: "Changing Models" }, + { href: "/kiloclaw/control-ui/exec-approvals", children: "Exec Approvals" }, + { href: "/kiloclaw/control-ui/version-pinning", children: "Version Pinning" }, + ], + }, + { + href: "/kiloclaw/chat-platforms", + children: "Chat Platforms", + subLinks: [ + { href: "/kiloclaw/chat-platforms", children: "Overview" }, + { href: "/kiloclaw/chat-platforms/telegram", children: "Telegram" }, + { href: "/kiloclaw/chat-platforms/discord", children: "Discord" }, + { href: "/kiloclaw/chat-platforms/slack", children: "Slack" }, + ], + }, + { + href: "/kiloclaw/development-tools", children: "Development Tools", subLinks: [ + { href: "/kiloclaw/development-tools", children: "Overview" }, { href: "/kiloclaw/development-tools/github", children: "GitHub" }, { href: "/kiloclaw/development-tools/google", children: "Google Workspace" }, ], }, - { href: "/kiloclaw/version-pinning", children: "Version Pinning" }, - { href: "/kiloclaw/troubleshooting", children: "Troubleshooting" }, - { href: "/kiloclaw/pricing", children: "Pricing" }, + { + href: "/kiloclaw/triggers", + children: "Triggers", + subLinks: [ + { href: "/kiloclaw/triggers", children: "Overview" }, + { href: "/kiloclaw/triggers/webhooks", children: "Webhooks" }, + ], + }, + { + href: "/kiloclaw/tools", + children: "Tools", + subLinks: [ + { href: "/kiloclaw/tools", children: "Overview" }, + { href: "/kiloclaw/tools/1password", children: "1Password" }, + { href: "/kiloclaw/tools/brave-search", children: "Brave Search" }, + { href: "/kiloclaw/tools/agentcard", children: "AgentCard" }, + ], + }, + { + href: "/kiloclaw/troubleshooting/common-questions", + children: "Troubleshooting", + subLinks: [ + { href: "/kiloclaw/troubleshooting/common-questions", children: "Common Questions" }, + { href: "/kiloclaw/troubleshooting/gateway-process", children: "Gateway Process States" }, + { href: "/kiloclaw/troubleshooting/architecture", children: "Architecture Notes" }, + ], + }, + { + href: "/kiloclaw/faq/general", + children: "FAQ", + subLinks: [ + { href: "/kiloclaw/faq/general", children: "General" }, + { href: "/kiloclaw/faq/pricing", children: "Pricing" }, + ], + }, ], }, ] diff --git a/packages/kilo-docs/lychee.toml b/packages/kilo-docs/lychee.toml index 627a395310a..9d082c95adb 100644 --- a/packages/kilo-docs/lychee.toml +++ b/packages/kilo-docs/lychee.toml @@ -32,4 +32,8 @@ exclude = [ '^https?://github\.com/', # Redirects to login page, blocked by bots '^https?://vercel\.link/', + # API base URL, returns 404 when fetched directly + '^https?://api\.apertis\.ai/v1/?$', + # Redirects to authenticated Google Cloud console + '^https?://console\.cloud\.google\.com', ] diff --git a/packages/kilo-docs/markdoc/partials/install-jetbrains.md b/packages/kilo-docs/markdoc/partials/install-jetbrains.md index 7dce539d9a8..a64c1c1974e 100644 --- a/packages/kilo-docs/markdoc/partials/install-jetbrains.md +++ b/packages/kilo-docs/markdoc/partials/install-jetbrains.md @@ -18,7 +18,7 @@ Before installing the Kilo Code plugin, ensure you have: 1. If you don't have a JetBrains IDE installed, download one from [jetbrains.com](https://www.jetbrains.com/) 2. Then, you can click the button below to install Kilo Code directly from the JetBrains Marketplace: -[![Install Kilo Code](https://img.shields.io/badge/Install%20Kilo%20Code-F8F674?style=for-the-badge)](https://plugins.jetbrains.com/plugin/28350-kilo-code) +[![Install Kilo Code](https://raster.shields.io/badge/Install%20Kilo%20Code-F8F674?style=for-the-badge)](https://plugins.jetbrains.com/plugin/28350-kilo-code) ### Install from JetBrains Marketplace diff --git a/packages/kilo-docs/markdoc/partials/install-vscode.md b/packages/kilo-docs/markdoc/partials/install-vscode.md index 54a22e5adbd..1edf8af2dc9 100644 --- a/packages/kilo-docs/markdoc/partials/install-vscode.md +++ b/packages/kilo-docs/markdoc/partials/install-vscode.md @@ -3,7 +3,7 @@ 1. If you don't have VS Code installed, download it from [code.visualstudio.com](https://code.visualstudio.com/) 2. Then, you can click the button below to install Kilo Code directly from the VS Code Marketplace: -[![Install Kilo Code](https://img.shields.io/badge/Install%20Kilo%20Code-F8F674?style=for-the-badge)](vscode:extension/kilocode.kilo-code) +[![Install Kilo Code](https://raster.shields.io/badge/Install%20Kilo%20Code-F8F674?style=for-the-badge)](vscode:extension/kilocode.kilo-code) ### Install from VS Code Marketplace diff --git a/packages/kilo-docs/package.json b/packages/kilo-docs/package.json index 07483afa7b0..be6ab93c9f4 100644 --- a/packages/kilo-docs/package.json +++ b/packages/kilo-docs/package.json @@ -1,6 +1,6 @@ { "name": "@kilocode/kilo-docs", - "version": "7.1.5", + "version": "7.1.17", "private": true, "scripts": { "dev": "next dev --webpack --port 3002", diff --git a/packages/kilo-docs/pages/ai-providers/anthropic.md b/packages/kilo-docs/pages/ai-providers/anthropic.md index 80897edd3cc..767aed584cb 100644 --- a/packages/kilo-docs/pages/ai-providers/anthropic.md +++ b/packages/kilo-docs/pages/ai-providers/anthropic.md @@ -17,12 +17,56 @@ Anthropic is an AI safety and research company that builds reliable, interpretab ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "Anthropic" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your Anthropic API key into the "Anthropic API Key" field. 4. **Select Model:** Choose your desired Claude model from the "Model" dropdown. 5. **(Optional) Custom Base URL:** If you need to use a custom base URL for the Anthropic API, check "Use custom base URL" and enter the URL. Most people won't need to adjust this. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add Anthropic and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export ANTHROPIC_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "anthropic": { + "env": ["ANTHROPIC_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "anthropic/claude-sonnet-4-20250514", +} +``` + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Prompt Caching:** Claude 3 models support [prompt caching](https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching), which can significantly reduce costs and latency for repeated prompts. diff --git a/packages/kilo-docs/pages/ai-providers/bedrock.md b/packages/kilo-docs/pages/ai-providers/bedrock.md index ecdb8a6c86d..64f4bb7aea2 100644 --- a/packages/kilo-docs/pages/ai-providers/bedrock.md +++ b/packages/kilo-docs/pages/ai-providers/bedrock.md @@ -34,6 +34,9 @@ You have three options for configuring AWS credentials: ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "Bedrock" from the "API Provider" dropdown. 3. **Select Authentication Method:** @@ -48,6 +51,53 @@ You have three options for configuring AWS credentials: 5. **(Optional) Cross-Region Inference:** Check "Use cross-region inference" if you want to access models in a region different from your configured AWS region. 6. **Select Model:** Choose your desired model from the "Model" dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add AWS Bedrock. The extension uses the AWS credentials chain for authentication — configure your AWS credentials using the AWS CLI or environment variables before adding the provider. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Bedrock uses the AWS credentials chain for authentication. Configure your AWS credentials using the AWS CLI or environment variables: + +**Environment variables:** + +```bash +export AWS_ACCESS_KEY_ID="your-access-key" +export AWS_SECRET_ACCESS_KEY="your-secret-key" +export AWS_REGION="us-east-1" +``` + +Or use an AWS profile: + +```bash +aws configure --profile bedrock +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "amazon-bedrock": {}, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "amazon-bedrock/anthropic.claude-sonnet-4-20250514-v1:0", +} +``` + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Permissions:** Ensure your IAM user or role has the necessary permissions to invoke Bedrock models. The `bedrock:InvokeModel` permission is required. diff --git a/packages/kilo-docs/pages/ai-providers/cerebras.md b/packages/kilo-docs/pages/ai-providers/cerebras.md index 7f965ece593..24c19bdc421 100644 --- a/packages/kilo-docs/pages/ai-providers/cerebras.md +++ b/packages/kilo-docs/pages/ai-providers/cerebras.md @@ -17,11 +17,55 @@ Cerebras is known for their ultra-fast AI inference powered by the Cerebras CS-3 ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "Cerebras" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your Cerebras API key into the "Cerebras API Key" field. 4. **Select Model:** Choose your desired model from the "Model" dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add Cerebras and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export CEREBRAS_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "cerebras": { + "env": ["CEREBRAS_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "cerebras/llama-4-scout-17b-16e-instruct", +} +``` + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Inference Speed:** Cerebras models deliver some of the fastest inference speeds available, reducing wait times during development. diff --git a/packages/kilo-docs/pages/ai-providers/chutes-ai.md b/packages/kilo-docs/pages/ai-providers/chutes-ai.md index d0a4a14f62f..348b3b84feb 100644 --- a/packages/kilo-docs/pages/ai-providers/chutes-ai.md +++ b/packages/kilo-docs/pages/ai-providers/chutes-ai.md @@ -20,11 +20,55 @@ Always refer to the official Chutes AI documentation or your dashboard for the m ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "Chutes AI" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your Chutes AI API key into the "Chutes AI API Key" field. 4. **Select Model:** Choose your desired model from the "Model" dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add Chutes AI and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export CHUTES_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "chutes": { + "env": ["CHUTES_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "chutes/model-name", +} +``` + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Free Access:** Chutes AI provides free API access, making it an excellent option for experimentation and development without immediate costs. diff --git a/packages/kilo-docs/pages/ai-providers/claude-code.md b/packages/kilo-docs/pages/ai-providers/claude-code.md index 7cd5136a435..239e3d779ca 100644 --- a/packages/kilo-docs/pages/ai-providers/claude-code.md +++ b/packages/kilo-docs/pages/ai-providers/claude-code.md @@ -34,11 +34,60 @@ The specific models available depend on your Claude subscription and plan. See [ ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "Claude Code" from the "API Provider" dropdown. 3. **Select Model:** Choose your desired Claude model from the "Model" dropdown. 4. **(Optional) Custom CLI Path:** If you installed Claude Code to a location other than the default `claude` command, enter the full path to your Claude executable in the "Claude Code Path" field. Most users won't need to change this. +{% /tab %} +{% tab label="VSCode" %} + +{% callout type="warning" %} +Claude Code credentials no longer work in Kilo Code. Please use the [Anthropic provider](/docs/ai-providers/anthropic) with an API key instead. +{% /callout %} + +{% /tab %} +{% tab label="CLI" %} + +Claude Code uses your existing Anthropic credentials (from the `claude` CLI). Make sure the Claude Code CLI is installed and authenticated: + +```bash +claude --version +claude auth login +``` + +If you have an `ANTHROPIC_API_KEY` environment variable set, the Claude CLI will use it automatically: + +```bash +export ANTHROPIC_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "anthropic": { + "env": ["ANTHROPIC_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "anthropic/claude-sonnet-4-20250514", +} +``` + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **No API Keys Required:** Claude Code uses your existing CLI authentication, so you don't need to manage separate API keys. diff --git a/packages/kilo-docs/pages/ai-providers/deepseek.md b/packages/kilo-docs/pages/ai-providers/deepseek.md index dea4ad27bf8..d70c070f3e8 100644 --- a/packages/kilo-docs/pages/ai-providers/deepseek.md +++ b/packages/kilo-docs/pages/ai-providers/deepseek.md @@ -17,11 +17,55 @@ Kilo Code supports accessing models through the DeepSeek API, including `deepsee ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "DeepSeek" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your DeepSeek API key into the "DeepSeek API Key" field. 4. **Select Model:** Choose your desired model from the "Model" dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add DeepSeek and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export DEEPSEEK_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "deepseek": { + "env": ["DEEPSEEK_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "deepseek/deepseek-chat", +} +``` + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Pricing:** Refer to the [DeepSeek Pricing](https://api-docs.deepseek.com/quick_start/pricing/) page for details on model costs. diff --git a/packages/kilo-docs/pages/ai-providers/fireworks.md b/packages/kilo-docs/pages/ai-providers/fireworks.md index d89a0796df6..f354b533760 100644 --- a/packages/kilo-docs/pages/ai-providers/fireworks.md +++ b/packages/kilo-docs/pages/ai-providers/fireworks.md @@ -17,11 +17,55 @@ Fireworks AI is a high-performance platform for running AI models that offers fa ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "Fireworks AI" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your Fireworks AI API key into the "Fireworks AI API Key" field. 4. **Select Model:** Choose your desired model from the "Model" dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add Fireworks AI and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export FIREWORKS_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "fireworks-ai": { + "env": ["FIREWORKS_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "fireworks-ai/accounts/fireworks/models/llama4-scout-instruct-basic", +} +``` + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Performance:** Fireworks AI is optimized for speed and offers excellent performance for both chat and completion tasks. diff --git a/packages/kilo-docs/pages/ai-providers/gemini.md b/packages/kilo-docs/pages/ai-providers/gemini.md index 4914f9ea7b6..3a0ffe09eec 100644 --- a/packages/kilo-docs/pages/ai-providers/gemini.md +++ b/packages/kilo-docs/pages/ai-providers/gemini.md @@ -17,11 +17,55 @@ Kilo Code supports Google's Gemini family of models through the Google AI Gemini ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "Google Gemini" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your Gemini API key into the "Gemini API Key" field. 4. **Select Model:** Choose your desired Gemini model from the "Model" dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add Google Gemini and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export GOOGLE_GENERATIVE_AI_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "google": { + "env": ["GOOGLE_GENERATIVE_AI_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "google/gemini-2.5-pro", +} +``` + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Pricing:** Gemini API usage is priced based on input and output tokens. Refer to the [Gemini pricing page](https://ai.google.dev/pricing) for detailed information. diff --git a/packages/kilo-docs/pages/ai-providers/glama.md b/packages/kilo-docs/pages/ai-providers/glama.md index bc50910b431..fb000fc64bb 100644 --- a/packages/kilo-docs/pages/ai-providers/glama.md +++ b/packages/kilo-docs/pages/ai-providers/glama.md @@ -26,11 +26,31 @@ Refer to the [Glama documentation](https://glama.ai/models) for the most up-to-d ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "Glama" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your Glama API key into the "Glama API Key" field. 4. **Select Model:** Choose your desired model from the "Model" dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add Glama and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +{% callout type="warning" %} +Glama is not yet available as a CLI provider. Check the [Kilo Code releases](https://github.com/Kilo-Org/kilocode/releases) for updates on provider support. +{% /callout %} + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Pricing:** Glama operates on a pay-per-use basis. Pricing varies depending on the model you choose. diff --git a/packages/kilo-docs/pages/ai-providers/groq.md b/packages/kilo-docs/pages/ai-providers/groq.md index 77bb3efadbc..58fcf4f1657 100644 --- a/packages/kilo-docs/pages/ai-providers/groq.md +++ b/packages/kilo-docs/pages/ai-providers/groq.md @@ -20,17 +20,54 @@ Kilo Code will attempt to fetch the list of available models from the Groq API. ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "Groq" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your Groq API key into the "Groq API Key" field. 4. **Select Model:** Choose your desired model from the "Model" dropdown. -## Tips and Notes +{% /tab %} +{% tab label="VSCode" %} -- **High-Speed Inference:** Groq's LPUs provide exceptionally fast response times, making it ideal for interactive development workflows. -- **Token Limits:** Some models have specific `max_tokens` limits that are automatically handled by Kilo Code (e.g., the `moonshotai/kimi-k2-instruct` model). -- **Cost Efficiency:** Groq often provides competitive pricing for high-speed inference compared to other providers. -- **Model Selection:** Choose models based on your specific needs - larger models like `llama3-70b-8192` for complex reasoning tasks, or smaller models like `llama3-8b-8192` for faster, simpler operations. +Open **Settings** (gear icon) and go to the **Providers** tab to add Groq and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export GROQ_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "groq": { + "env": ["GROQ_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "groq/llama-3.3-70b-versatile", +} +``` + +{% /tab %} +{% /tabs %} ## Supported Models @@ -46,13 +83,6 @@ Kilo Code supports the following models through Groq: **Note:** Model availability may change. Refer to the [Groq documentation](https://console.groq.com/docs/models) for the latest model list and specifications. -## Configuration in Kilo Code - -1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. -2. **Select Provider:** Choose "Groq" from the "API Provider" dropdown. -3. **Enter API Key:** Paste your Groq API key into the "Groq API Key" field. -4. **Select Model:** Choose your desired model from the "Model" dropdown. - ## Model-Specific Features ### Kimi K2 Model diff --git a/packages/kilo-docs/pages/ai-providers/inception.md b/packages/kilo-docs/pages/ai-providers/inception.md index 6a8f302e391..8431a37fc6f 100644 --- a/packages/kilo-docs/pages/ai-providers/inception.md +++ b/packages/kilo-docs/pages/ai-providers/inception.md @@ -23,11 +23,55 @@ Refer to Inception's current website and developer documentation for the most up ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "Inception" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your Inception API key into the "Inception API Key" field. 4. **Select Model:** Choose your desired model from the "Model" dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add Inception and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export INCEPTION_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "inception": { + "env": ["INCEPTION_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "inception/mercury-coder-small-beta", +} +``` + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Enterprise Focus:** Inception is designed for production-grade AI applications with emphasis on reliability and consistency. diff --git a/packages/kilo-docs/pages/ai-providers/index.md b/packages/kilo-docs/pages/ai-providers/index.md index 4f75c4e985a..6981043e579 100644 --- a/packages/kilo-docs/pages/ai-providers/index.md +++ b/packages/kilo-docs/pages/ai-providers/index.md @@ -58,11 +58,7 @@ Route requests through unified APIs with additional features: - **Regional** - Better latency in certain locations {% callout type="note" %} -All API keys use VS Code's Secret Storage—never stored in plain text. -{% /callout %} - -{% callout type="warning" title="Time-to-first-byte timeout" %} -For all providers, there is a **five-minute timeout** on time to first token. This means if a provider does not begin streaming a response within five minutes of the request being sent, the request will be cancelled. This is a constraint of the Bun runtime and cannot be easily configured. +In the **VSCode (Legacy)** version, API keys use VS Code's Secret Storage. In the current **VSCode & CLI** version, keys are set via environment variables or referenced in `kilo.json` config files. See individual provider pages for setup instructions for each platform. {% /callout %} ## Next Steps diff --git a/packages/kilo-docs/pages/ai-providers/lmstudio.md b/packages/kilo-docs/pages/ai-providers/lmstudio.md index 13efa7b8361..e22058308b2 100644 --- a/packages/kilo-docs/pages/ai-providers/lmstudio.md +++ b/packages/kilo-docs/pages/ai-providers/lmstudio.md @@ -27,12 +27,50 @@ Kilo Code supports running models locally using LM Studio. LM Studio provides a ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "LM Studio" from the "API Provider" dropdown. 3. **Enter Model ID:** Enter the _file name_ of the model you loaded in LM Studio (e.g., `codellama-7b.Q4_0.gguf`). You can find this in the LM Studio "Local Server" tab. 4. **(Optional) Base URL:** By default, Kilo Code will connect to LM Studio at `http://localhost:1234`. If you've configured LM Studio to use a different address or port, enter the full URL here. 5. **(Optional) Timeout:** By default, API requests time out after 10 minutes. Local models can be slow, if you hit this timeout you can consider increasing it here: VS Code Extensions panel > Kilo Code gear menu > Settings > API Request Timeout. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add LM Studio. No API key is needed since LM Studio runs locally. You can configure the base URL if LM Studio is running on a different host or port. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +LM Studio runs locally, so no API key is needed. Configure the base URL if LM Studio is running on a different host or port: + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "lmstudio": { + "baseURL": "http://localhost:1234/v1", + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "lmstudio/codellama-7b", +} +``` + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Resource Requirements:** Running large language models locally can be resource-intensive. Make sure your computer meets the minimum requirements for the model you choose. diff --git a/packages/kilo-docs/pages/ai-providers/minimax.md b/packages/kilo-docs/pages/ai-providers/minimax.md index 4c6fd6adc5b..4f36072519f 100644 --- a/packages/kilo-docs/pages/ai-providers/minimax.md +++ b/packages/kilo-docs/pages/ai-providers/minimax.md @@ -17,11 +17,55 @@ MiniMax is a global AI foundation model company focused on fast, cost-efficient ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Navigate to **Providers**. Choose **MiniMax** from the API Provider dropdown. 3. **Enter API Key:** Paste your MiniMax API key into the MiniMax API Key field. 4. **Select Model:** Choose your desired MiniMax model from the Model dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add MiniMax and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export MINIMAX_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "minimax": { + "env": ["MINIMAX_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "minimax/MiniMax-M1", +} +``` + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Performance:** MiniMax M2.1 emphasizes fast inference, strong coding ability, and exceptional tool-calling performance. diff --git a/packages/kilo-docs/pages/ai-providers/mistral.md b/packages/kilo-docs/pages/ai-providers/mistral.md index 8a902adb401..e1ce39948b2 100644 --- a/packages/kilo-docs/pages/ai-providers/mistral.md +++ b/packages/kilo-docs/pages/ai-providers/mistral.md @@ -17,11 +17,55 @@ Kilo Code supports accessing models through the Mistral AI API, including both s ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "Mistral" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your Mistral API key into the "Mistral API Key" field if you're using a `mistral` model. If you intend to use `codestral-latest`, see the "Codestral" section below. 4. **Select Model:** Choose your desired model from the "Model" dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add Mistral and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export MISTRAL_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "mistral": { + "env": ["MISTRAL_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "mistral/mistral-large-latest", +} +``` + +{% /tab %} +{% /tabs %} + ## Using Codestral [Codestral](https://docs.mistral.ai/capabilities/code_generation/) is a model specifically designed for code generation and interaction. diff --git a/packages/kilo-docs/pages/ai-providers/moonshot.md b/packages/kilo-docs/pages/ai-providers/moonshot.md index 44ee85619a1..7b92cf10287 100644 --- a/packages/kilo-docs/pages/ai-providers/moonshot.md +++ b/packages/kilo-docs/pages/ai-providers/moonshot.md @@ -17,11 +17,55 @@ Moonshot.ai is a Chinese AI company known for their **Kimi** models featuring ul ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "Moonshot.ai" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your Moonshot.ai API key into the "Moonshot.ai API Key" field. 4. **Select Model:** Choose your desired model from the "Model" dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add Moonshot.ai and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export MOONSHOT_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "moonshotai": { + "env": ["MOONSHOT_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "moonshotai/moonshot-v1-auto", +} +``` + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Ultra-Long Context:** Kimi models excel at handling large codebases and complex projects with their extended context windows. diff --git a/packages/kilo-docs/pages/ai-providers/ollama.md b/packages/kilo-docs/pages/ai-providers/ollama.md index d50417072ca..33f8199e24e 100644 --- a/packages/kilo-docs/pages/ai-providers/ollama.md +++ b/packages/kilo-docs/pages/ai-providers/ollama.md @@ -72,12 +72,50 @@ By default, API requests time out after 10 minutes. Local models can be slow, if ### Configure Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + - Open the Kilo Code panel ({% kiloCodeIcon size="1em" /%}). - Click the Settings gear icon ({% codicon name="gear" /%}). - Select "Ollama" as the API Provider. - Select the model configured in the previous step. - (Optional) You can configure the base URL if you're running Ollama on a different machine. The default is `http://localhost:11434`. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add Ollama. No API key is needed since Ollama runs locally. You can configure the base URL if Ollama is running on a different host. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Ollama runs locally, so no API key is needed. Configure the base URL if Ollama is running on a different host: + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "ollama": { + "baseURL": "http://localhost:11434/v1", + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "ollama/qwen3-coder:30b", +} +``` + +{% /tab %} +{% /tabs %} + ## Further Reading Refer to the [Ollama documentation](https://ollama.com/docs) for more information on installing, configuring and using Ollama. diff --git a/packages/kilo-docs/pages/ai-providers/openai-chatgpt-plus-pro.md b/packages/kilo-docs/pages/ai-providers/openai-chatgpt-plus-pro.md index 2e2105f8367..4f24ddc2908 100644 --- a/packages/kilo-docs/pages/ai-providers/openai-chatgpt-plus-pro.md +++ b/packages/kilo-docs/pages/ai-providers/openai-chatgpt-plus-pro.md @@ -4,6 +4,9 @@ sidebar_label: ChatGPT Plus/Pro # Using ChatGPT Subscriptions With Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. Open Kilo Code settings (click the gear icon {% codicon name="gear" /%} in the Kilo Code panel). 2. In **API Provider**, select **OpenAI – ChatGPT Plus/Pro**. 3. Click **Sign in to OpenAI Codex**. @@ -11,6 +14,43 @@ sidebar_label: ChatGPT Plus/Pro 5. Back in Kilo Code settings, pick a model from the dropdown. 6. Save. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab. ChatGPT Plus/Pro uses OAuth authentication — follow the sign-in flow to connect your ChatGPT subscription. + +{% /tab %} +{% tab label="CLI" %} + +ChatGPT Plus/Pro uses OAuth authentication, which is only available in the VS Code extension. For the CLI, use the [OpenAI API provider](/docs/ai-providers/openai) with an API key instead: + +```bash +export OPENAI_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "openai": { + "env": ["OPENAI_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "openai/gpt-4.1", +} +``` + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Subscription Required:** You need an active ChatGPT Plus or Pro subscription. This provider won't work with free ChatGPT accounts. See [OpenAI's ChatGPT plans](https://openai.com/chatgpt/pricing) for more information. diff --git a/packages/kilo-docs/pages/ai-providers/openai-compatible.md b/packages/kilo-docs/pages/ai-providers/openai-compatible.md index f550cbab7cb..5e373573752 100644 --- a/packages/kilo-docs/pages/ai-providers/openai-compatible.md +++ b/packages/kilo-docs/pages/ai-providers/openai-compatible.md @@ -14,6 +14,9 @@ This document focuses on setting up providers _other than_ the official OpenAI A ## General Configuration +{% tabs %} +{% tab label="VSCode (Legacy)" %} + The key to using an OpenAI-compatible provider is to configure two main settings: 1. **Base URL:** This is the API endpoint for the provider. It will _not_ be `https://api.openai.com/v1` (that's for the official OpenAI API). @@ -34,6 +37,48 @@ You'll find these settings in the Kilo Code settings panel (click the {% codicon - Input Price - Output Price +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add an OpenAI Compatible provider. Enter your API key and the provider's base URL. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key and base URL as environment variables or configure them in your `kilo.json` config file: + +**Environment variable:** + +```bash +export OPENAI_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "openai-compatible": { + "env": ["OPENAI_API_KEY"], + "baseURL": "https://api.your-provider.com/v1", + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "openai-compatible/model-name", +} +``` + +{% /tab %} +{% /tabs %} + ### Full Endpoint URL Support Kilo Code supports full endpoint URLs in the Base URL field, providing greater flexibility for provider configuration: diff --git a/packages/kilo-docs/pages/ai-providers/openai.md b/packages/kilo-docs/pages/ai-providers/openai.md index 73dbb8904c7..4c5a379b539 100644 --- a/packages/kilo-docs/pages/ai-providers/openai.md +++ b/packages/kilo-docs/pages/ai-providers/openai.md @@ -17,11 +17,55 @@ Kilo Code supports accessing models directly through the official OpenAI API. ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "OpenAI" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your OpenAI API key into the "OpenAI API Key" field. 4. **Select Model:** Choose your desired model from the "Model" dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add OpenAI and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export OPENAI_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "openai": { + "env": ["OPENAI_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "openai/gpt-4.1", +} +``` + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Pricing:** Refer to the [OpenAI Pricing](https://openai.com/pricing) page for details on model costs. diff --git a/packages/kilo-docs/pages/ai-providers/openrouter.md b/packages/kilo-docs/pages/ai-providers/openrouter.md index 84019fa69e9..bdcbbf1a528 100644 --- a/packages/kilo-docs/pages/ai-providers/openrouter.md +++ b/packages/kilo-docs/pages/ai-providers/openrouter.md @@ -16,12 +16,56 @@ OpenRouter is an AI platform that provides access to a wide variety of language ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "OpenRouter" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your OpenRouter API key into the "OpenRouter API Key" field. 4. **Select Model:** Choose your desired model from the "Model" dropdown. 5. **(Optional) Custom Base URL:** If you need to use a custom base URL for the OpenRouter API, check "Use custom base URL" and enter the URL. Leave this blank for most users. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add OpenRouter and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export OPENROUTER_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "openrouter": { + "env": ["OPENROUTER_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "openrouter/anthropic/claude-sonnet-4-20250514", +} +``` + +{% /tab %} +{% /tabs %} + ## Supported Transforms OpenRouter provides an [optional "middle-out" message transform](https://openrouter.ai/docs/features/message-transforms) to help with prompts that exceed the maximum context size of a model. You can enable it by checking the "Compress prompts and message chains to the context size" box. diff --git a/packages/kilo-docs/pages/ai-providers/ovhcloud.md b/packages/kilo-docs/pages/ai-providers/ovhcloud.md index 344cb130e9b..7b9890a2598 100644 --- a/packages/kilo-docs/pages/ai-providers/ovhcloud.md +++ b/packages/kilo-docs/pages/ai-providers/ovhcloud.md @@ -24,7 +24,51 @@ You can report any bugs or feedbacks by chatting with us in our [Discord server] ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "OVHcloud AI Endpoints" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your AI Endpoints API key into the "OVHcloud AI Endpoints API Key" field. 4. **Select Model:** Choose your desired model from the "Model" dropdown. + +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add OVHcloud AI Endpoints and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export OVHCLOUD_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "ovhcloud": { + "env": ["OVHCLOUD_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "ovhcloud/model-name", +} +``` + +{% /tab %} +{% /tabs %} diff --git a/packages/kilo-docs/pages/ai-providers/requesty.md b/packages/kilo-docs/pages/ai-providers/requesty.md index 6fc4a656d9a..fda3c5796e3 100644 --- a/packages/kilo-docs/pages/ai-providers/requesty.md +++ b/packages/kilo-docs/pages/ai-providers/requesty.md @@ -15,11 +15,55 @@ Kilo Code supports accessing models through the [Requesty](https://www.requesty. ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "Requesty" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your Requesty API key into the "Requesty API Key" field. 4. **Select Model:** Choose your desired model from the "Model" dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add Requesty and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export REQUESTY_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "requesty": { + "env": ["REQUESTY_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "requesty/anthropic/claude-sonnet-4-20250514", +} +``` + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Optimizations**: Requesty offers range of in-flight cost optimizations to lower your costs. diff --git a/packages/kilo-docs/pages/ai-providers/sap-ai-core.md b/packages/kilo-docs/pages/ai-providers/sap-ai-core.md index 6c110a58cc8..16dfec8bbdf 100644 --- a/packages/kilo-docs/pages/ai-providers/sap-ai-core.md +++ b/packages/kilo-docs/pages/ai-providers/sap-ai-core.md @@ -77,6 +77,9 @@ The exact list of available models depends on your SAP AI Core configuration and ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "SAP AI Core" from the "API Provider" dropdown. 3. **Enter Credentials:** @@ -91,6 +94,47 @@ The exact list of available models depends on your SAP AI Core configuration and 5. **Select Model:** Choose your desired model from the dropdown 6. **Select Deployment:** (Foundation Models Mode only) Choose an active deployment for your selected model +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add SAP AI Core. Enter your OAuth2 client credentials (Client ID, Client Secret, Base URL, and Auth URL) in the provider settings. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +SAP AI Core uses OAuth2 client credentials for authentication. Set the credentials as environment variables or in your config file: + +**Environment variables:** + +```bash +export AICORE_SERVICE_KEY='{"your": "service-key-json"}' +export AICORE_DEPLOYMENT_ID="your-deployment-id" +export AICORE_RESOURCE_GROUP="your-resource-group" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "sap-ai-core": {}, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "sap-ai-core/model-name", +} +``` + +{% /tab %} +{% /tabs %} + ## Deployments (Foundation Models Mode) When using Foundation Models mode: diff --git a/packages/kilo-docs/pages/ai-providers/unbound.md b/packages/kilo-docs/pages/ai-providers/unbound.md index 11e061a91ab..fd7f6fb6e27 100644 --- a/packages/kilo-docs/pages/ai-providers/unbound.md +++ b/packages/kilo-docs/pages/ai-providers/unbound.md @@ -20,11 +20,31 @@ Unbound allows you configure a list of supported models in your application, and ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "Unbound" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your Unbound API key into the "Unbound API Key" field. 4. **Select Model:** Choose your desired model from the "Model" dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add Unbound and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +{% callout type="warning" %} +Unbound is not yet available as a CLI provider. Check the [Kilo Code releases](https://github.com/Kilo-Org/kilocode/releases) for updates on provider support. +{% /callout %} + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Security Focus:** Unbound emphasizes security features for enterprise use. If your organization has strict security requirements for AI usage, Unbound might be a good option. diff --git a/packages/kilo-docs/pages/ai-providers/v0.md b/packages/kilo-docs/pages/ai-providers/v0.md index 5d8d0280bc3..2ba2ba4ac67 100644 --- a/packages/kilo-docs/pages/ai-providers/v0.md +++ b/packages/kilo-docs/pages/ai-providers/v0.md @@ -15,6 +15,9 @@ To use v0 with Kilo Code, you'll need: ## Configuration +{% tabs %} +{% tab label="VSCode (Legacy)" %} + Setting up v0 in Kilo Code is straightforward: 1. In Kilo Code settings (click the {% codicon name="gear" /%} icon): @@ -26,6 +29,48 @@ Setting up v0 in Kilo Code is straightforward: +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add an OpenAI Compatible provider. Set the base URL to `https://api.v0.dev/v1` and enter your v0 API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +v0 uses the OpenAI-compatible provider. Set the API key and base URL in your config: + +**Environment variable:** + +```bash +export OPENAI_API_KEY="your-v0-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "openai-compatible": { + "env": ["OPENAI_API_KEY"], + "baseURL": "https://api.v0.dev/v1", + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "openai-compatible/v0-1.0-md", +} +``` + +{% /tab %} +{% /tabs %} + ## Troubleshooting - **"Invalid API Key":** Double-check that you've entered the API key correctly. diff --git a/packages/kilo-docs/pages/ai-providers/vercel-ai-gateway.md b/packages/kilo-docs/pages/ai-providers/vercel-ai-gateway.md index 3147a1ac9a2..bbfd9ccf991 100644 --- a/packages/kilo-docs/pages/ai-providers/vercel-ai-gateway.md +++ b/packages/kilo-docs/pages/ai-providers/vercel-ai-gateway.md @@ -54,11 +54,55 @@ Check the model description in the dropdown for specific capabilities. ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "Vercel AI Gateway" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your Vercel AI Gateway API key into the "Vercel AI Gateway API Key" field. 4. **Select Model:** Choose your desired model from the "Model" dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add Vercel AI Gateway and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export AI_GATEWAY_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "vercel": { + "env": ["AI_GATEWAY_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "vercel/anthropic/claude-sonnet-4", +} +``` + +{% /tab %} +{% /tabs %} + --- ## Prompt Caching diff --git a/packages/kilo-docs/pages/ai-providers/vertex.md b/packages/kilo-docs/pages/ai-providers/vertex.md index 994a84b7b31..abbb56da3b8 100644 --- a/packages/kilo-docs/pages/ai-providers/vertex.md +++ b/packages/kilo-docs/pages/ai-providers/vertex.md @@ -20,6 +20,9 @@ Kilo Code supports accessing models through Google Cloud Platform's Vertex AI, a ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "GCP Vertex AI" from the "API Provider" dropdown. 3. **Configure Authentication:** @@ -31,6 +34,50 @@ Kilo Code supports accessing models through Google Cloud Platform's Vertex AI, a 5. **Select Region:** Choose the region where your Vertex AI resources are located (e.g., `us-east5`). 6. **Select Model:** Choose your desired model from the "Model" dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add GCP Vertex AI. The extension uses Google Application Default Credentials (ADC) for authentication — run `gcloud auth application-default login` before adding the provider. Set your project ID and region in the provider settings. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Vertex AI uses Google Application Default Credentials (ADC) for authentication. Set up ADC using the Google Cloud CLI: + +```bash +gcloud auth application-default login +``` + +Set your project and region as environment variables: + +```bash +export GOOGLE_CLOUD_PROJECT="your-project-id" +export GOOGLE_CLOUD_LOCATION="us-east5" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "google-vertex": {}, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "google-vertex/claude-sonnet-4@20250514", +} +``` + +{% /tab %} +{% /tabs %} + ## Tips and Notes - **Permissions:** Ensure your Google Cloud account has the necessary permissions to access Vertex AI and the specific models you want to use. diff --git a/packages/kilo-docs/pages/ai-providers/xai.md b/packages/kilo-docs/pages/ai-providers/xai.md index 309bd4f0c35..5435c6c7ecd 100644 --- a/packages/kilo-docs/pages/ai-providers/xai.md +++ b/packages/kilo-docs/pages/ai-providers/xai.md @@ -17,11 +17,55 @@ xAI is the company behind Grok, a large language model known for its conversatio ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon ({% codicon name="gear" /%}) in the Kilo Code panel. 2. **Select Provider:** Choose "xAI" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your xAI API key into the "xAI API Key" field. 4. **Select Model:** Choose your desired Grok model from the "Model" dropdown. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add xAI and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export XAI_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "xai": { + "env": ["XAI_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "xai/grok-3", +} +``` + +{% /tab %} +{% /tabs %} + ## Reasoning Capabilities Some models feature specialized reasoning capabilities, allowing them to "think before responding" - particularly useful for complex problem-solving tasks. diff --git a/packages/kilo-docs/pages/ai-providers/zenmux.md b/packages/kilo-docs/pages/ai-providers/zenmux.md index 1e646d1b258..de7985830eb 100644 --- a/packages/kilo-docs/pages/ai-providers/zenmux.md +++ b/packages/kilo-docs/pages/ai-providers/zenmux.md @@ -16,12 +16,56 @@ import Codicon from "@site/src/components/Codicon"; ## Configuration in Kilo Code +{% tabs %} +{% tab label="VSCode (Legacy)" %} + 1. **Open Kilo Code Settings:** Click the gear icon () in the Kilo Code panel. 2. **Select Provider:** Choose "ZenMux" from the "API Provider" dropdown. 3. **Enter API Key:** Paste your ZenMux API key into the "ZenMux API Key" field. 4. **Select Model:** Choose your desired model from the "Model" dropdown. 5. **(Optional) Custom Base URL:** If you need to use a custom base URL for the ZenMux API, check "Use custom base URL" and enter the URL. Leave this blank for most users. +{% /tab %} +{% tab label="VSCode" %} + +Open **Settings** (gear icon) and go to the **Providers** tab to add ZenMux and enter your API key. + +The extension stores this in your `kilo.json` config file. You can also edit the config file directly — see the **CLI** tab for the file format. + +{% /tab %} +{% tab label="CLI" %} + +Set the API key as an environment variable or configure it in your `kilo.json` config file: + +**Environment variable:** + +```bash +export ZENMUX_API_KEY="your-api-key" +``` + +**Config file** (`~/.config/kilo/kilo.json` or `./kilo.json`): + +```jsonc +{ + "provider": { + "zenmux": { + "env": ["ZENMUX_API_KEY"], + }, + }, +} +``` + +Then set your default model: + +```jsonc +{ + "model": "zenmux/openai/gpt-5", +} +``` + +{% /tab %} +{% /tabs %} + ## Supported Models ZenMux supports a wide range of models from various providers: diff --git a/packages/kilo-docs/pages/automate/agent-manager.md b/packages/kilo-docs/pages/automate/agent-manager.md index 5f47025343d..36f4d816539 100644 --- a/packages/kilo-docs/pages/automate/agent-manager.md +++ b/packages/kilo-docs/pages/automate/agent-manager.md @@ -5,6 +5,108 @@ description: "Manage and orchestrate multiple AI agents" # Agent Manager +The Agent Manager is a control panel for running and orchestrating multiple Kilo Code agents, with support for parallel worktree-isolated sessions. + +{% tabs %} +{% tab label="VSCode" %} + +The Agent Manager is a **full-panel editor tab** built directly into the extension. All sessions share the single `kilo serve` backend process. It supports: + +- Multiple parallel sessions, each in its own git worktree +- A diff/review panel showing changes vs. the parent branch +- Dedicated VS Code integrated terminals per session +- Setup scripts and `.env` auto-copy on worktree creation +- Session import from existing branches, external worktrees, or GitHub PR URLs +- "Continue in Worktree" to promote a sidebar session to the Agent Manager + +## Opening the Agent Manager + +- Keyboard shortcut: `Cmd+Shift+M` (macOS) / `Ctrl+Shift+M` (Windows/Linux) +- Command Palette: "Kilo Code: Open Agent Manager" +- Click the Agent Manager icon in the sidebar toolbar + +The panel opens as an editor tab and stays active across focus changes. + +## Working with Worktrees + +Each Agent Manager session runs in an isolated git worktree on a separate branch, keeping your main branch clean. + +### Creating a New Worktree Session + +1. Click **New Worktree** or press `Cmd+N` (macOS) / `Ctrl+N` (Windows/Linux) to create a new worktree +2. Enter a branch name (or let Kilo generate one) +3. Type your first message to start the agent + +A new git worktree is created from your current branch. The agent works in isolation — your main branch is unaffected. + +### Multi-Version Mode + +You can run up to 4 parallel implementations of the same prompt across separate worktrees: + +1. Click the multi-version button and enter a prompt +2. Optionally assign different models to each version +3. Kilo creates one worktree + session per version and runs them in parallel + +### Importing Existing Work + +- **From a branch:** Import an existing git branch as a worktree +- **From a GitHub PR URL:** Paste a PR URL to import it as a worktree +- **From an external worktree:** Import a worktree that already exists on disk +- **Continue in Worktree:** From the sidebar chat, promote the current session to a new Agent Manager worktree + +## Sending Messages, Approvals, and Control + +- **Continue the conversation:** Send a follow-up message to the running agent +- **Approvals:** The Permission Dock shows tool approval prompts — approve once, approve always, or deny +- **Cancel:** Sends a cooperative stop signal to the agent +- **Stop:** Force-terminates the session and marks it as stopped + +## Diff / Review Panel + +Press `Cmd+D` (macOS) / `Ctrl+D` (Windows/Linux) to toggle the diff panel. It shows a live-updating diff between the worktree and its parent branch. + +- Select files and click **Apply to Main Branch** to merge changes +- Conflicts are surfaced with a resolution dialog +- Supports unified and split diff views + +## Terminals + +Each session has a dedicated integrated terminal. Press `Cmd+/` (macOS) / `Ctrl+/` (Windows/Linux) to focus the terminal for the active session. + +## Setup Scripts + +Place an executable script at `.kilo/setup-script` in your project root. It runs automatically whenever a new worktree is created (useful for `npm install`, env setup, etc.). Root-level `.env` and `.env.*` files are also auto-copied from the main repo before the setup script runs. + +## Session State and Persistence + +Agent Manager state is persisted in `.kilo/agent-manager.json`. Sessions, worktrees, and their order are restored on reload. + +## Keyboard Shortcuts (Agent Manager Panel) + +| Shortcut (macOS) | Shortcut (Windows/Linux) | Action | +| ------------------------ | ------------------------- | --------------------------------- | +| `Cmd+Shift+M` | `Ctrl+Shift+M` | Open Agent Manager | +| `Cmd+N` | `Ctrl+N` | New worktree | +| `Cmd+Shift+N` | `Ctrl+Shift+N` | New worktree (advanced options) | +| `Cmd+Shift+O` | `Ctrl+Shift+O` | Import/open worktree | +| `Cmd+Shift+W` | `Ctrl+Shift+W` | Close current worktree | +| `Cmd+T` | `Ctrl+T` | New tab (session) in worktree | +| `Cmd+W` | `Ctrl+W` | Close current tab | +| `Cmd+Alt+Up` / `Down` | `Ctrl+Alt+Up` / `Down` | Previous / next worktree | +| `Cmd+Alt+Left` / `Right` | `Ctrl+Alt+Left` / `Right` | Previous / next tab in worktree | +| `Cmd+/` | `Ctrl+/` | Show terminal for current session | +| `Cmd+D` | `Ctrl+D` | Toggle diff panel | +| `Cmd+Shift+/` | `Ctrl+Shift+/` | Show keyboard shortcuts | +| `Cmd+1` … `Cmd+9` | `Ctrl+1` … `Ctrl+9` | Jump to worktree/session by index | + +## Troubleshooting + +- **"Please open a folder…" error** — the Agent Manager requires a VS Code workspace folder +- **Worktree creation fails** — ensure Git is installed and the workspace is a valid git repository. Open the main repository (where `.git` is a directory), not an existing worktree checkout. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + The Agent Manager is a dedicated control panel for running and supervising Kilo Code agents as interactive CLI processes. It supports: - Local sessions @@ -22,7 +124,7 @@ This page reflects the actual implementation in the extension. ## Opening the Agent Manager -- Command Palette: “Kilo Code: Open Agent Manager” +- Command Palette: "Kilo Code: Open Agent Manager" - Or use the title/menu entry if available in your Kilo Code UI The panel opens as a webview and stays active across focus changes. @@ -34,13 +136,13 @@ The panel opens as a webview and stays active across focus changes. - Approve or reject, optionally adding a short note - Cancel vs Stop - Cancel sends a structured cancel message to the running process (clean cooperative stop) - - Stop force-terminates the underlying CLI process, updating status to “stopped” + - Stop force-terminates the underlying CLI process, updating status to "stopped" ## Resuming an existing session You can continue a session later (local or remote): -- If a session is not currently running, the Agent Manager will spawn a new CLI process attached to that session’s ID +- If a session is not currently running, the Agent Manager will spawn a new CLI process attached to that session's ID - Labels from the original session are preserved whenever possible - Your first follow-up message becomes the continuation input @@ -144,6 +246,9 @@ Message transcripts are fetched from a signed blob and exclude internal checkpoi - Verify you're logged in via extension settings or using CLI with kilocode provider - BYOK configurations do not support Agent Manager authentication +{% /tab %} +{% /tabs %} + ## Related features - [Sessions](/docs/collaborate/sessions-sharing) diff --git a/packages/kilo-docs/pages/automate/extending/shell-integration.md b/packages/kilo-docs/pages/automate/extending/shell-integration.md index 5c7a88187ac..4f1e3312846 100644 --- a/packages/kilo-docs/pages/automate/extending/shell-integration.md +++ b/packages/kilo-docs/pages/automate/extending/shell-integration.md @@ -7,6 +7,9 @@ description: "Integrate Kilo Code with your shell environment" Terminal Shell Integration is a key feature that enables Kilo Code to execute commands in your terminal and intelligently process their output. This bidirectional communication between the AI and your development environment unlocks powerful automation capabilities. +{% tabs %} +{% tab label="VSCode (Legacy)" %} + ## What is Shell Integration? Shell integration is automatically enabled in Kilo Code and connects directly to your terminal's command execution lifecycle without requiring any setup from you. This built-in feature allows Kilo Code to: @@ -340,6 +343,80 @@ The [VS Code Terminal Integration Test Extension](https://github.com/KJ7LNW/vsce - Note your environment (OS, VS Code version, shell, and any shell prompt customization) - Open an issue with these details to help improve shell integration +{% /tab %} +{% tab label="VSCode & CLI" %} + +## How Shell Execution Works + +The new CLI and extension take a fundamentally different approach to shell execution. Instead of relying on VS Code's terminal shell integration, the CLI spawns and manages shell processes directly using the `bash` tool. + +This means: + +- **No VS Code shell integration required** — the CLI handles shell execution independently +- **No shell integration setup or troubleshooting** — it works out of the box +- **Consistent behavior** across environments — the same shell execution logic runs whether you use the CLI directly or through the VS Code extension + +## The `bash` Tool + +The `bash` tool is the primary way the agent executes shell commands. It spawns a persistent shell session and runs commands within it. + +### Key Features + +- **Working directory control**: Use the `workdir` parameter to run commands in a specific directory, instead of `cd && ` patterns +- **Configurable timeout**: Set a per-command timeout in milliseconds (defaults to 2 minutes) +- **Real-time output streaming**: Command output is streamed back as it's produced +- **Process tree management**: The tool manages the full process tree, ensuring child processes are properly cleaned up + +### Security Analysis + +Commands are parsed using **Tree-sitter** before execution, enabling: + +- Path resolution to detect file access patterns +- External directory detection to flag commands that reach outside the project +- Structured analysis of command intent for safer auto-approval decisions + +### Shell Detection + +The CLI automatically detects the appropriate shell for your platform using `Shell.acceptable()`. This selects a compatible shell (bash, zsh, etc.) without requiring manual configuration. + +## Agent Manager Terminals (VS Code Extension) + +When using the Kilo Code VS Code extension with the Agent Manager, each agent session gets its own dedicated VS Code terminal. + +### Per-Session Terminals + +- Each session creates a terminal named **`Agent: {branch}`**, where `{branch}` is the git branch or worktree the session is working in +- The terminal's working directory is automatically set to the session's worktree directory +- Terminals are standard VS Code integrated terminals — you can interact with them directly + +### Keyboard Shortcuts + +| Shortcut | Action | +| --------------------------- | ---------------------------- | +| Cmd+/ | Focus the session's terminal | +| Cmd+. | Cycle agent mode | + +### Terminal Context Menu Actions + +Right-click in an Agent Manager terminal to access these actions: + +- **Add Terminal Content to Context** — sends the terminal's visible output to the agent as context +- **Fix This Command** — asks the agent to diagnose and fix the last failed command +- **Explain This Command** — asks the agent to explain what a command does + +## Troubleshooting + +Shell execution in the new CLI is significantly simpler than the **VSCode** version's terminal integration. Most issues are resolved by ensuring: + +1. **A supported shell is installed**: bash or zsh on macOS/Linux, PowerShell on Windows +2. **The shell is on your PATH**: The CLI needs to find the shell binary +3. **File permissions are correct**: The CLI needs execute permission on the shell binary + +If commands fail to execute, check the CLI's log output for error details. The CLI logs the shell it detected and any errors during command execution. + +{% /tab %} +{% /tabs %} + ## Support If you've followed these steps and are still experiencing problems, please: diff --git a/packages/kilo-docs/pages/automate/how-tools-work.md b/packages/kilo-docs/pages/automate/how-tools-work.md index ea7d88abe47..5086fdb075d 100644 --- a/packages/kilo-docs/pages/automate/how-tools-work.md +++ b/packages/kilo-docs/pages/automate/how-tools-work.md @@ -18,6 +18,20 @@ Describe what you want to accomplish in natural language, and Kilo Code will: ## Tool Categories +{% tabs %} +{% tab label="VSCode" %} + +| Category | Purpose | Tool Names | +| :------- | :----------------------------------------- | :----------------------------------------------------------- | +| Read | Access file content and code structure | `read`, `glob`, `grep` | +| Edit | Create or modify files and code | `edit`, `multiedit`, `write`, `apply_patch` | +| Execute | Run commands and perform system operations | `bash` | +| Web | Fetch and search web content | `webfetch`, `websearch`, `codesearch` | +| Workflow | Manage task flow and sub-agents | `question`, `task`, `todowrite`, `todoread`, `plan`, `skill` | + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + | Category | Purpose | Tool Names | | :------- | :----------------------------------------- | :----------------------------------------------------------------------- | | Read | Access file content and code structure | `read_file`, `search_files`, `list_files`, `list_code_definition_names` | @@ -26,10 +40,29 @@ Describe what you want to accomplish in natural language, and Kilo Code will: | Browser | Interact with web content | `browser_action` | | Workflow | Manage task flow and context | `ask_followup_question`, `attempt_completion`, `switch_mode`, `new_task` | +{% /tab %} +{% /tabs %} + ## Example: Using Tools Here's how a typical tool interaction works: +{% tabs %} +{% tab label="VSCode" %} + +{% callout type="info" title="Tool Approval UI" %} +When a tool is proposed, you'll see an approval prompt in the **Permission Dock** at the bottom of the chat. You can approve once, approve always (saves to config), or deny. +{% /callout %} + +**User:** Create a file named `greeting.js` that logs a greeting message + +**Kilo Code:** (Proposes the `write` tool) + +The extension shows the file path and proposed content for review. Click **Approve** to execute or **Deny** to cancel. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + {% callout type="info" title="Tool Approval UI" %} When a tool is proposed, you'll see Save and Reject buttons along with an optional Auto-approve checkbox for trusted operations. {% /callout %} @@ -56,8 +89,55 @@ greet('World'); **Kilo Code:** (Confirms file creation) +{% /tab %} +{% /tabs %} + ## Tool Safety and Approval +{% tabs %} +{% tab label="VSCode" %} + +Every tool use is subject to a permission check. The default action for any tool with no matching rule in your config is **`ask`** — meaning Kilo will pause and prompt you before executing it. + +**Default permissions by tool:** + +| Tool(s) | Default | +| :------------------------------------------- | :----------------------------------------------- | +| `read`, `glob`, `grep`, `list` | `ask` | +| `edit`, `write`, `multiedit`, `apply_patch` | `ask` | +| `bash` | `ask` (per-command) | +| `external_directory` | `ask` (when accessing paths outside the project) | +| `task` | `ask` | +| `webfetch`, `websearch`, `codesearch` | `ask` | +| `todowrite`, `todoread`, `question`, `skill` | `ask` | + +No tools are auto-approved out of the box. You must explicitly grant `allow` in your config, or approve them at runtime. + +**At runtime**, the **Permission Dock** floating UI in the chat panel shows each pending approval. For each tool call you can: + +- **Approve once** — execute this call only +- **Approve always** — save an `allow` rule to your config so future matching calls are auto-approved +- **Deny** — cancel the tool call + +To pre-configure permissions in your config file: + +```json +{ + "permission": { + "read": "allow", + "glob": "allow", + "grep": "allow", + "edit": "ask", + "bash": "ask" + } +} +``` + +This safety mechanism ensures you maintain control over which files are modified, what commands are executed, and how your codebase is changed. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + Every tool use requires your explicit approval. When Kilo proposes a tool, you'll see: - A "Save" button to approve and execute the tool @@ -66,8 +146,37 @@ Every tool use requires your explicit approval. When Kilo proposes a tool, you'l This safety mechanism ensures you maintain control over which files are modified, what commands are executed, and how your codebase is changed. Always review tool proposals carefully before saving them. +{% /tab %} +{% /tabs %} + ## Core Tools Reference +{% tabs %} +{% tab label="VSCode" %} + +| Tool Name | Description | Category | +| :------------ | :----------------------------------------------------- | :------- | +| `read` | Reads file contents with line numbers | Read | +| `glob` | Finds files by glob pattern | Read | +| `grep` | Searches file contents with regex | Read | +| `edit` | Makes precise text replacements in a file | Edit | +| `multiedit` | Multiple edits in a single call | Edit | +| `write` | Creates new files or overwrites existing ones | Edit | +| `apply_patch` | Applies unified diffs (used with certain models) | Edit | +| `bash` | Runs shell commands | Execute | +| `webfetch` | Fetches a URL | Web | +| `websearch` | Searches the web (Kilo/OpenRouter users) | Web | +| `codesearch` | Semantic code search (Kilo/OpenRouter users) | Web | +| `question` | Asks you a clarifying question with selectable options | Workflow | +| `task` | Spawns a sub-agent session | Workflow | +| `todowrite` | Creates and updates a session TODO list | Workflow | +| `todoread` | Reads the current session TODO list | Workflow | +| `plan` | Enters structured planning mode | Workflow | +| `skill` | Invokes a reusable skill (Markdown instruction module) | Workflow | + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + | Tool Name | Description | Category | | :--------------------------- | :-------------------------------------------------- | :------- | | `read_file` | Reads the content of a file with line numbers | Read | @@ -84,6 +193,9 @@ This safety mechanism ensures you maintain control over which files are modified | `switch_mode` | Changes to a different operational mode | Workflow | | `new_task` | Creates a new subtask with a specific starting mode | Workflow | +{% /tab %} +{% /tabs %} + ## Learn More About Tools For more detailed information about each tool, including complete parameter references and advanced usage patterns, see the [Tool Use Overview](/docs/automate/tools) documentation. diff --git a/packages/kilo-docs/pages/automate/index.md b/packages/kilo-docs/pages/automate/index.md index 453f0163c50..d71a6dce541 100644 --- a/packages/kilo-docs/pages/automate/index.md +++ b/packages/kilo-docs/pages/automate/index.md @@ -36,7 +36,6 @@ Connect Kilo Code to external tools and services: - [**Using MCP in Kilo Code**](/docs/automate/mcp/using-in-kilo-code) — Configuration guide - [**STDIO & SSE Transports**](/docs/automate/mcp/server-transports) — Local and remote server options - [**MCP vs API**](/docs/automate/mcp/mcp-vs-api) — When to use MCP -- [**Using MCP in CLI**](/docs/automate/mcp/using-in-cli) — CLI-specific MCP setup ## Integrations diff --git a/packages/kilo-docs/pages/automate/mcp/using-in-kilo-code.md b/packages/kilo-docs/pages/automate/mcp/using-in-kilo-code.md index 43dd907c755..72f9994d1db 100644 --- a/packages/kilo-docs/pages/automate/mcp/using-in-kilo-code.md +++ b/packages/kilo-docs/pages/automate/mcp/using-in-kilo-code.md @@ -7,31 +7,103 @@ description: "How to use MCP servers in Kilo Code" Model Context Protocol (MCP) extends Kilo Code's capabilities by connecting to external tools and services. This guide covers everything you need to know about using MCP with Kilo Code. -{% youtube url="https://youtu.be/6O9RQoQRX8A" caption="Demostrating MCP installation in Kilo Code" /%} +{% youtube url="https://youtu.be/6O9RQoQRX8A" caption="Demonstrating MCP installation in Kilo Code" /%} ## Configuring MCP Servers -MCP server configurations can be managed at two levels: +{% tabs %} +{% tab label="VSCode" %} -1. **Global Configuration**: Stored in the `mcp_settings.json` file, accessible via VS Code settings (see below). These settings apply across all your workspaces unless overridden by a project-level configuration. -2. **Project-level Configuration**: Defined in a `.kilocode/mcp.json` file within your project's root directory. This allows you to set up project-specific servers and share configurations with your team by committing the file to version control. Kilo Code automatically detects and loads this file if it exists. +MCP server configurations are stored inside the main Kilo config file. There are two levels: -**Precedence**: If a server name exists in both global and project configurations, the **project-level configuration takes precedence**. +1. **Global Configuration**: `~/.config/kilo/kilo.jsonc` — applies to all projects. +2. **Project-level Configuration**: `kilo.jsonc` in your project root, or `.kilo/kilo.jsonc` for a cleaner setup. -### Editing MCP Settings Files +**Precedence**: Project-level configuration takes precedence over global configuration. -You can edit both global and project-level MCP configuration files directly from the Kilo Code settings. +### Editing MCP Settings -1. Click the {% codicon name="gear" /%} icon in the top navigation of the Kilo Code pane to open `Settings`. -2. Click the `Agent Behaviour` tab on the left side -3. Select the `MCP Servers` sub-tab -4. Click the appropriate button: - - **`Edit Global MCP`**: Opens the global `mcp_settings.json` file. - - **`Edit Project MCP`**: Opens the project-specific `.kilocode/mcp.json` file. If this file doesn't exist, Kilo Code will create it for you. +You can edit MCP settings from the Kilo Code settings UI: -{% image src="/docs/img/using-mcp-in-kilo-code/mcp-installed-config.png" alt="Edit Global MCP and Edit Project MCP buttons" width="600" caption="Edit Global MCP and Edit Project MCP buttons" /%} +1. Click the {% codicon name="gear" /%} icon in the sidebar toolbar to open Settings. +2. Click the `Agent Behaviour` tab on the left side. +3. Select the `MCP Servers` sub-tab. -Both files use a JSON format with a `mcpServers` object containing named server configurations: +From here you can add, edit, enable/disable, and delete MCP servers. Changes are written directly to the appropriate config file. + +### Config Format + +MCP servers are configured under the `mcp` key in `kilo.jsonc`: + +**Local (STDIO) server:** + +```json +{ + "mcp": { + "my-local-server": { + "type": "local", + "command": ["node", "/path/to/server.js"], + "environment": { + "API_KEY": "your_api_key" + }, + "enabled": true, + "timeout": 10000 + } + } +} +``` + +**Remote (HTTP/SSE) server:** + +```json +{ + "mcp": { + "my-remote-server": { + "type": "remote", + "url": "https://your-server-url.com/mcp", + "headers": { + "Authorization": "Bearer your-token" + }, + "enabled": true, + "timeout": 15000 + } + } +} +``` + +Remote servers support OAuth 2.0 authentication. If the server supports it, Kilo Code will automatically start the OAuth flow when you connect. You can also disable OAuth with `"oauth": false`. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + +MCP server configurations can be managed at two levels: **global** (applies across all workspaces) and **project-level** (specific to a single project). Project-level configuration takes precedence over global settings. + +| Scope | Path | Description | +| ----------- | -------------------- | --------------------------------------------------------------- | +| **Global** | `mcp_settings.json` | Accessible via VS Code settings. Applies across all workspaces. | +| **Project** | `.kilocode/mcp.json` | In your project root. Auto-detected by Kilo Code. | + +Project-level configs can be committed to version control to share with your team. + +{% /tab %} +{% tab label="CLI" %} + +The CLI accepts several config filenames. The recommended file is `kilo.json`: + +| Scope | Recommended Path | Also supported | +| ----------- | ------------------------------------ | -------------------------------------------------------------- | +| **Global** | `~/.config/kilo/kilo.json` | `kilo.jsonc`, `opencode.json`, `opencode.jsonc`, `config.json` | +| **Project** | `./kilo.json` or `./.kilo/kilo.json` | `kilo.jsonc`, `opencode.jsonc`, `opencode.json` | + +{% /tab %} +{% /tabs %} + +## Configuration Format + +{% tabs %} +{% tab label="VSCode (Legacy)" %} + +Both global and project-level files use a JSON format with a `mcpServers` object containing named server configurations: ```json { @@ -51,11 +123,43 @@ Both files use a JSON format with a `mcpServers` object containing named server _Example of MCP Server config in Kilo Code (STDIO Transport)_ -### Understanding Transport Types +{% /tab %} +{% tab label="VSCode" %} -MCP supports three transport types for server communication: +In the VS Code extension, open **Settings → MCP** and click **Add Server** to configure a new server through the UI. You can also edit the config files directly — see the **CLI** tab for the JSON format. -#### STDIO Transport +{% /tab %} +{% tab label="CLI" %} + +Add MCP servers under the `mcp` key in your config file. Each server has a unique name that you can reference in prompts. + +```json +{ + "mcp": { + "my-server": { + "type": "local", + "command": ["npx", "-y", "my-mcp-command"], + "enabled": true + } + } +} +``` + +You can disable a server by setting `enabled` to `false` without removing it from your config. + +{% /tab %} +{% /tabs %} + +## Understanding Transport Types + +MCP supports two main transport types: + +- **Local (STDIO)**: Servers run as a child process on your machine, communicating over stdin/stdout. +- **Remote (HTTP/SSE)**: Servers hosted over HTTP/HTTPS. Kilo Code tries `StreamableHTTP` first, then falls back to `SSE` automatically. + +For more details, see [STDIO & SSE Transports](server-transports). + +### STDIO Transport Used for local servers running on your machine: @@ -69,6 +173,9 @@ For more in-depth information about how STDIO transport works, see [STDIO Transp STDIO configuration example: +{% tabs %} +{% tab label="VSCode (Legacy)" %} + ```json { "mcpServers": { @@ -85,7 +192,43 @@ STDIO configuration example: } ``` -#### Streamable HTTP Transport +{% /tab %} +{% tab label="VSCode" %} + +In the VS Code extension, open **Settings → MCP**, click **Add Server**, and choose **Local (stdio)**. Fill in the command, arguments, and optional environment variables through the UI. You can also edit the config files directly — see the **CLI** tab for the JSON format. + +{% /tab %} +{% tab label="CLI" %} + +```json +{ + "mcp": { + "my-local-server": { + "type": "local", + "command": ["npx", "-y", "my-mcp-command"], + "enabled": true, + "environment": { + "API_KEY": "your_api_key" + } + } + } +} +``` + +#### Local Server Options + +| Option | Type | Required | Description | +| ------------- | ------- | -------- | --------------------------------------------------------------------- | +| `type` | String | Yes | Must be `"local"`. | +| `command` | Array | Yes | Command and arguments to run the MCP server. | +| `environment` | Object | No | Environment variables to set when running the server. | +| `enabled` | Boolean | No | Enable or disable the MCP server on startup. | +| `timeout` | Number | No | Timeout in ms for fetching tools from the MCP server. Default: 30000. | + +{% /tab %} +{% /tabs %} + +### Streamable HTTP Transport Used for remote servers accessed over HTTP/HTTPS: @@ -94,7 +237,8 @@ Used for remote servers accessed over HTTP/HTTPS: - Requires network access - Allows centralized deployment and management -Streamable HTTP transport configuration example: +{% tabs %} +{% tab label="VSCode (Legacy)" %} ```json { @@ -112,7 +256,43 @@ Streamable HTTP transport configuration example: } ``` -#### SSE Transport +{% /tab %} +{% tab label="VSCode" %} + +In the VS Code extension, open **Settings → MCP**, click **Add Server**, and choose **Remote (HTTP)**. Enter the server URL and optional headers through the UI. You can also edit the config files directly — see the **CLI** tab for the JSON format. + +{% /tab %} +{% tab label="CLI" %} + +```json +{ + "mcp": { + "my-remote-server": { + "type": "remote", + "url": "https://my-mcp-server.com/mcp", + "enabled": true, + "headers": { + "Authorization": "Bearer MY_API_KEY" + } + } + } +} +``` + +#### Remote Server Options + +| Option | Type | Required | Description | +| --------- | ------- | -------- | --------------------------------------------------------------------- | +| `type` | String | Yes | Must be `"remote"`. | +| `url` | String | Yes | URL of the remote MCP server. | +| `enabled` | Boolean | No | Enable or disable the MCP server on startup. | +| `headers` | Object | No | HTTP headers to send with requests. | +| `timeout` | Number | No | Timeout in ms for fetching tools from the MCP server. Default: 30000. | + +{% /tab %} +{% /tabs %} + +### SSE Transport ⚠️ DEPRECATED: The SSE Transport has been deprecated as of MCP specification version 2025-03-26. Please use the HTTP Stream Transport instead, which implements the new Streamable HTTP transport specification. @@ -143,6 +323,24 @@ SSE configuration example: } ``` +## Managing MCP Servers + +{% tabs %} +{% tab label="VSCode (Legacy)" %} + +### Editing MCP Settings Files + +You can edit both global and project-level MCP configuration files directly from the Kilo Code settings. + +1. Click the {% codicon name="gear" /%} icon in the top navigation of the Kilo Code pane to open `Settings`. +2. Click the `Agent Behaviour` tab on the left side +3. Select the `MCP Servers` sub-tab +4. Click the appropriate button: + - **`Edit Global MCP`**: Opens the global `mcp_settings.json` file. + - **`Edit Project MCP`**: Opens the project-specific `.kilocode/mcp.json` file. If this file doesn't exist, Kilo Code will create it for you. + +{% image src="/docs/img/using-mcp-in-kilo-code/mcp-installed-config.png" alt="Edit Global MCP and Edit Project MCP buttons" width="600" caption="Edit Global MCP and Edit Project MCP buttons" /%} + ### Deleting a Server 1. Press the {% codicon name="trash" /%} next to the MCP server you would like to delete @@ -158,16 +356,95 @@ SSE configuration example: 1. Press the {% codicon name="activate" /%} toggle switch next to the MCP server to enable/disable it +{% /tab %} +{% tab label="VSCode" %} + +In the VS Code extension, manage MCP servers from **Settings → MCP**: + +- **Add a server**: Click **Add Server** and fill in the details +- **Enable/disable**: Toggle a server on or off without removing its configuration +- **Delete**: Remove a server from the list + +The extension also supports the `{env:VARIABLE_NAME}` syntax in config files to reference environment variables (see the **CLI** tab for details). + +{% /tab %} +{% tab label="CLI" %} + +### CLI Commands + +| Command | Description | +| ----------------- | ------------------------------- | +| `kilo mcp list` | List all configured MCP servers | +| `kilo mcp add` | Add an MCP server | +| `kilo mcp auth` | Authenticate with an MCP server | +| `kilo mcp logout` | Log out from an MCP server | +| `kilo mcp debug` | Debug an MCP server connection | + +Inside the interactive TUI, use the `/mcps` slash command to toggle MCP servers on or off. + +### Environment Variables + +Use `{env:VARIABLE_NAME}` syntax in config files to reference environment variables: + +```json +{ + "mcp": { + "my-server": { + "type": "remote", + "url": "https://mcp.example.com/mcp", + "headers": { + "Authorization": "Bearer {env:MY_API_KEY}" + } + } + } +} +``` + +{% /tab %} +{% /tabs %} + ### Network Timeout +{% tabs %} +{% tab label="VSCode" %} + +Set the `timeout` field (in milliseconds) in the server's config entry. The default is 10 seconds for local servers and 15 seconds for remote servers. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + To set the maximum time to wait for a response after a tool call to the MCP server: 1. Click the `Network Timeout` pulldown at the bottom of the individual MCP server's config box and change the time. Default is 1 minute but it can be set between 30 seconds and 5 minutes. {% image src="/docs/img/using-mcp-in-kilo-code/using-mcp-in-kilo-code-6.png" alt="Network Timeout pulldown" width="400" caption="Network Timeout pulldown" /%} +{% /tab %} +{% /tabs %} + ### Auto Approve Tools +{% tabs %} +{% tab label="VSCode" %} + +MCP tool calls use the same permission system as built-in tools. Each MCP tool's permission key is its namespaced name: `{server}_{tool}` (e.g. `my_server_do_something`). + +**At runtime:** When an MCP tool is called, the Permission Dock shows an approval prompt. Click **Approve Always** to save an allow rule to your config so future calls to that tool are auto-approved. + +**In your config file:** Add the tool name (or a wildcard pattern) to the `permission` key in `kilo.jsonc`: + +```json +{ + "permission": { + "my_server_do_something": "allow", + "my_server_*": "allow" + } +} +``` + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + MCP tool auto-approval works on a per-tool basis and is disabled by default. To configure auto-approval: 1. First enable the global "Use MCP servers" auto-approval option in [auto-approving-actions](/docs/getting-started/settings/auto-approving-actions) @@ -178,41 +455,14 @@ MCP tool auto-approval works on a per-tool basis and is disabled by default. To When enabled, Kilo Code will automatically approve this specific tool without prompting. Note that the global "Use MCP servers" setting takes precedence - if it's disabled, no MCP tools will be auto-approved. -## Finding and Installing MCP Servers - -Kilo Code does not come with any pre-installed MCP servers. You'll need to find and install them separately. - -- **Community Repositories:** Check for community-maintained lists of MCP servers on GitHub -- **Ask Kilo Code:** You can ask Kilo Code to help you find or even create MCP servers -- **Build Your Own:** Create custom MCP servers using the SDK to extend Kilo Code with your own tools - -For full SDK documentation, visit the [MCP GitHub repository](https://github.com/modelcontextprotocol/). - -## Using MCP Tools in Your Workflow - -After configuring an MCP server, Kilo Code will automatically detect available tools and resources. To use them: - -1. Type your request in the Kilo Code chat interface -2. Kilo Code will identify when an MCP tool can help with your task -3. Approve the tool use when prompted (or use auto-approval) - -Example: "Analyze the performance of my API" might use an MCP tool that tests API endpoints. - -## Troubleshooting MCP Servers - -Common issues and solutions: - -- **Server Not Responding:** Check if the server process is running and verify network connectivity -- **Permission Errors:** Ensure proper API keys and credentials are configured in your `mcp_settings.json` (for global settings) or `.kilocode/mcp.json` (for project settings). -- **Tool Not Available:** Confirm the server is properly implementing the tool and it's not disabled in settings -- **Slow Performance:** Try adjusting the network timeout value for the specific MCP server - -{% callout type="tip" %} -**Reduce system prompt size:** If you're not using MCP, turn it off in Settings > Agent Behaviour > MCP Servers to significantly cut down the size of the system prompt and improve performance. -{% /callout %} +{% /tab %} +{% /tabs %} ## Platform-Specific MCP Configuration Examples +{% tabs %} +{% tab label="VSCode (Legacy)" %} + ### Windows Configuration Example When setting up MCP servers on Windows, you'll need to use the Windows Command Prompt (`cmd`) to execute commands. Here's an example of configuring a Puppeteer MCP server on Windows: @@ -252,4 +502,130 @@ For macOS or Linux, you would use a different configuration: {% /callout %} +{% /tab %} +{% tab label="VSCode" %} + +In the VS Code extension, use **Settings → MCP → Add Server** to add any of the examples below through the UI. You can also edit the config files directly — see the **CLI** tab for the JSON format. + +{% /tab %} +{% tab label="CLI" %} + +### Windows + +When setting up local MCP servers on Windows, use the full `cmd` invocation in the `command` array: + +```json +{ + "mcp": { + "puppeteer": { + "type": "local", + "command": ["cmd", "/c", "npx", "-y", "@modelcontextprotocol/server-puppeteer"], + "enabled": true + } + } +} +``` + The same approach can be used for other MCP servers on Windows, adjusting the package name as needed for different server types. + +### Figma Desktop + +Connect to the Figma Desktop app's MCP server: + +```json +{ + "mcp": { + "Figma Desktop": { + "type": "remote", + "url": "http://127.0.0.1:3845/mcp" + } + } +} +``` + +### Context7 + +Add the [Context7](https://github.com/upstash/context7) MCP server for documentation search: + +```json +{ + "mcp": { + "context7": { + "type": "remote", + "url": "https://mcp.context7.com/mcp" + } + } +} +``` + +### Everything Test Server + +Add the test MCP server for development: + +```json +{ + "mcp": { + "mcp_everything": { + "type": "local", + "command": ["npx", "-y", "@modelcontextprotocol/server-everything"] + } + } +} +``` + +{% /tab %} +{% /tabs %} + +## Finding and Installing MCP Servers + +Kilo Code does not come with any pre-installed MCP servers. You'll need to find and install them separately. + +- **Kilo Marketplace:** Browse community-contributed MCP server configurations and agent skills in the [Kilo Marketplace](https://github.com/Kilo-Org/kilo-marketplace). The marketplace includes ready-to-use configs for popular tools like Figma, Sentry, and more. +- **Community Repositories:** Check for community-maintained lists of MCP servers on GitHub +- **Ask Kilo Code:** You can ask Kilo Code to help you find or even create MCP servers +- **Build Your Own:** Create custom MCP servers using the SDK to extend Kilo Code with your own tools + +For full SDK documentation, visit the [MCP GitHub repository](https://github.com/modelcontextprotocol/). + +## Using MCP Tools in Your Workflow + +After configuring an MCP server, Kilo Code will automatically detect available tools and resources. To use them: + +1. Type your request in the Kilo Code chat interface +2. Kilo Code will identify when an MCP tool can help with your task +3. Approve the tool use when prompted (or use auto-approval) + +Example: "Analyze the performance of my API" might use an MCP tool that tests API endpoints. + +## Troubleshooting MCP Servers + +{% tabs %} +{% tab label="VSCode" %} + +- **Server Not Responding:** Check if the server process is running and verify network connectivity. Review server status in Settings > Agent Behaviour > MCP Servers. +- **`needs_auth` status:** For remote servers with OAuth, the extension will show a notification to start the auth flow. Click it to authenticate. +- **`failed` status:** Check the CLI output for error details. Ensure commands and paths are correct. +- **Tool Not Available:** Confirm the server is properly implementing the tool and it's not disabled in settings. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + +- **Server Not Responding:** Check if the server process is running and verify network connectivity +- **Permission Errors:** Ensure proper API keys and credentials are configured in your `mcp_settings.json` (for global settings) or `.kilocode/mcp.json` (for project settings). +- **Tool Not Available:** Confirm the server is properly implementing the tool and it's not disabled in settings +- **Slow Performance:** Try adjusting the network timeout value for the specific MCP server + +{% /tab %} +{% tab label="CLI" %} + +- **Server Not Responding:** Check if the server process is running. Use `kilo mcp debug ` to inspect the connection. +- **Permission Errors:** Ensure API keys and credentials are set in your `kilo.jsonc` config or via `{env:VARIABLE_NAME}` references. +- **Tool Not Available:** Confirm the server is properly implementing the tool and it is not disabled (`"enabled": false`) in your config. +- **Slow Performance:** Increase the `timeout` value for the specific MCP server in your config. + +{% /tab %} +{% /tabs %} + +{% callout type="tip" %} +**Reduce system prompt size:** If you're not using MCP, turn it off in Settings > Agent Behaviour > MCP Servers to significantly cut down the size of the system prompt and improve performance. +{% /callout %} diff --git a/packages/kilo-docs/pages/automate/tools/index.md b/packages/kilo-docs/pages/automate/tools/index.md index ac473fefdc0..9949a96321d 100644 --- a/packages/kilo-docs/pages/automate/tools/index.md +++ b/packages/kilo-docs/pages/automate/tools/index.md @@ -11,6 +11,92 @@ Kilo Code implements a sophisticated tool system that allows AI models to intera ### Tool Groups +{% tabs %} +{% tab label="VSCode" %} + +Tools are organized into logical groups based on their functionality: + +| Category | Purpose | Tools | Common Use | +| ------------------ | --------------------------------- | ------------------------------------------------------------ | --------------------------------------- | +| **Read Group** | File system reading and searching | `read`, `glob`, `grep` | Code exploration and analysis | +| **Edit Group** | File system modifications | `edit`, `multiedit`, `write`, `apply_patch` | Code changes and file manipulation | +| **Execute Group** | Shell command execution | `bash` | Running scripts, building projects | +| **Web Group** | Fetch and search web content | `webfetch`, `websearch`, `codesearch` | Research, documentation lookup | +| **Browser Group** | Web browser automation | `kilo-playwright_*` (via built-in Playwright MCP) | Browser testing and interaction | +| **MCP Group** | External tool integration | MCP server tools (namespaced as `{server}_{tool}`) | Specialized functionality via MCP | +| **Workflow Group** | Sub-agents and task management | `question`, `task`, `todowrite`, `todoread`, `plan`, `skill` | Context switching and task organization | + +### Always Available Tools + +Certain tools are accessible regardless of the current agent: + +- `question`: Ask the user a clarifying question with selectable options +- `task`: Spawn a sub-agent session +- `todowrite` / `todoread`: Manage session task lists + +## Available Tools + +### Read Tools + +These tools help Kilo Code understand your code and project: + +- `read` - Reads file contents with line numbers +- `glob` - Finds files matching a glob pattern +- `grep` - Searches file contents with regex + +### Edit Tools + +These tools help Kilo Code make changes to your code: + +- `edit` - Makes precise text replacements in a file +- `multiedit` - Multiple edits in a single call +- `write` - Creates new files or fully overwrites existing ones +- `apply_patch` - Applies unified diffs (used with certain models) + +### Execute Tools + +These tools help Kilo Code run commands: + +- `bash` - Runs shell commands with configurable timeout and working directory + +### Web Tools + +These tools help Kilo Code access web content: + +- `webfetch` - Fetches a URL and returns the content +- `websearch` - Searches the web (available to Kilo/OpenRouter users) +- `codesearch` - Semantic code search (available to Kilo/OpenRouter users) + +### Browser Tools + +The VS Code extension has a built-in browser automation tool powered by [Playwright MCP](https://www.npmjs.com/package/@playwright/mcp). Enable it in Settings → Browser Automation. When enabled, it registers an MCP server named `kilo-playwright` and exposes tools such as: + +- `kilo-playwright_browser_navigate` - Navigate to a URL +- `kilo-playwright_browser_click` - Click an element +- `kilo-playwright_browser_type` - Type text into an element +- `kilo-playwright_browser_screenshot` - Capture a screenshot +- `kilo-playwright_browser_snapshot` - Capture an accessibility snapshot + +These follow the same permission model as all MCP tools (see below). + +### MCP Tools + +MCP server tools are automatically available when an MCP server is connected. Tool names are namespaced as `{server}_{tool}`. See [MCP Overview](/docs/automate/mcp/overview) for details. + +### Workflow Tools + +These tools help manage the conversation and task flow: + +- `question` - Asks you a clarifying question with selectable options +- `task` - Spawns a sub-agent (child session) +- `todowrite` - Creates and updates a session TODO list +- `todoread` - Reads the current session TODO list +- `plan` - Enters structured planning mode +- `skill` - Invokes a reusable skill (Markdown instruction module) + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + Tools are organized into logical groups based on their functionality: | Category | Purpose | Tools | Common Use | @@ -80,6 +166,9 @@ These tools help manage the conversation and task flow: - [new_task](/docs/automate/tools/new-task) - Creates a new subtask - [update_todo_list](/docs/automate/tools/update-todo-list) - Tracks task progress with step-by-step checklists +{% /tab %} +{% /tabs %} + ## Tool Calling Mechanism ### When Tools Are Called diff --git a/packages/kilo-docs/pages/code-with-ai/agents/auto-model.md b/packages/kilo-docs/pages/code-with-ai/agents/auto-model.md index 94a48c21970..69ec4bdc5f0 100644 --- a/packages/kilo-docs/pages/code-with-ai/agents/auto-model.md +++ b/packages/kilo-docs/pages/code-with-ai/agents/auto-model.md @@ -131,5 +131,5 @@ Auto Model is actively being improved. We'd love to hear how it's working for yo ## Related - [Model Selection Guide](/docs/code-with-ai/agents/model-selection) - General guidance on choosing models -- [Using Modes](/docs/code-with-ai/agents/using-modes) - Learn about different Kilo Code modes +- [Using Agents](/docs/code-with-ai/agents/using-agents) - Learn about different Kilo Code agents - [Free & Budget Models](/docs/code-with-ai/agents/free-and-budget-models) - Cost-effective alternatives diff --git a/packages/kilo-docs/pages/code-with-ai/agents/chat-interface.md b/packages/kilo-docs/pages/code-with-ai/agents/chat-interface.md index 351af9549ec..7ae2bc19c1d 100644 --- a/packages/kilo-docs/pages/code-with-ai/agents/chat-interface.md +++ b/packages/kilo-docs/pages/code-with-ai/agents/chat-interface.md @@ -6,7 +6,7 @@ description: "Learn how to use the Kilo Code chat interface effectively" # Chatting with Kilo Code {% callout type="tip" %} -**Bottom line:** Kilo Code is an AI coding assistant that lives in VS Code. You chat with it in plain English, and it writes, edits, and explains code for you. +**Bottom line:** Kilo Code is an AI coding assistant. You chat with it in plain English, and it writes, edits, and explains code for you. {% /callout %} {% callout type="note" title="Prefer quick completions?" %} @@ -15,10 +15,26 @@ If you're typing code in the editor and want AI to finish your line or block, ch ## Quick Setup -Find the Kilo Code icon ({% kilo-code-icon /%}) in VS Code's Primary Side Bar. Click it to open the chat panel. +{% tabs %} +{% tab label="VSCode" %} + +Click the Kilo Code icon ({% kiloCodeIcon /%}) in VS Code's Primary Side Bar to open the sidebar chat. You can also pop it out into an editor tab for a larger workspace. + +{% /tab %} +{% tab label="CLI" %} + +Open your terminal and run `kilo` to launch the interactive terminal interface (TUI). You'll see a prompt where you can start typing requests immediately. The TUI is fully keyboard-driven — no mouse required. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + +Find the Kilo Code icon ({% kiloCodeIcon /%}) in VS Code's Primary Side Bar. Click it to open the chat panel. **Lost the panel?** Go to View > Open View... and search for "Kilo Code" +{% /tab %} +{% /tabs %} + ## How to Talk to Kilo Code **The key insight:** Just type what you want in normal English. No special commands needed. @@ -46,6 +62,40 @@ Find the Kilo Code icon ({% kilo-code-icon /%}) in VS Code's Primary Side Bar. C ## The Chat Interface +{% tabs %} +{% tab label="VSCode" %} + +**Essential controls:** + +- **Input prompt** - Type your requests and press Enter to send +- **Action buttons** - Approve or reject proposed changes, answer questions +- **Agent dropdown** - Switch between agents (e.g. Code, Ask, Plan) from the sidebar +- **Session management** - Start new sessions or resume previous ones + +**Providing context:** + +The extension automatically passes context from your editor, including your open tabs and active file. You can type `@` in the chat input to get file autocomplete suggestions, or mention file paths naturally in your message (e.g., "update src/utils.ts to add a helper function"). The agent can also discover files on its own using its built-in tools. + +{% /tab %} +{% tab label="CLI" %} + +**Essential controls:** + +- **Input prompt** - Type your requests and press Enter to send +- **Action buttons** - Approve or reject proposed changes, answer questions +- **Agent cycling** - Switch between agents using keybinds or slash commands +- **Session management** - Start new sessions or resume previous ones +- **New task** - Start a new task, available using the `+` button at the top or `New Task` button above the chat input +- **Worktree** - Continue the current task with it's git state and session history in the Agent Manager in an isolated worktree +- **File changes** - Shows the number of lines changed and opens a diff view + +**Providing context:** + +Type `@` in the TUI to get file autocomplete suggestions, or mention file paths directly in your message (e.g., "look at src/utils.ts") and the agent will read them. When using the non-interactive `kilo run` command, you can pass `-f path/to/file.ts` to explicitly include files. The agent can also discover files on its own using its built-in tools. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + {% image src="/docs/img/the-chat-interface/the-chat-interface-1.png" alt="Chat interface components labeled with callouts" width="800" caption="Everything you need is right here" /%} **Essential controls:** @@ -56,6 +106,20 @@ Find the Kilo Code icon ({% kilo-code-icon /%}) in VS Code's Primary Side Bar. C - **Plus button** - Start a new task session - **Mode selector** - Choose how Kilo should approach your task +**Providing context with @-mentions:** + +Reference files and other context directly in your message using `@`: + +- `@file` - Reference a specific file +- `@url` - Include content from a URL +- `@problems` - Include current VS Code problems +- `@terminal` - Include terminal output +- `@git-changes` - Include uncommitted changes +- `@commit` - Reference a specific commit + +{% /tab %} +{% /tabs %} + ## Quick Interactions **Click to act:** @@ -85,29 +149,19 @@ Find the Kilo Code icon ({% kilo-code-icon /%}) in VS Code's Primary Side Bar. C ## Suggested Responses -When Kilo Code needs more information to complete a task, it uses the [`ask_followup_question`](/docs/automate/tools/ask-followup-question) tool. To make responding easier and faster, Kilo Code often provides suggested answers alongside the question. - -{% image src="/docs/img/suggested-responses/suggested-responses.png" alt="Example of Kilo Code asking a question with suggested response buttons below it" width="800" caption="Suggested responses appear as clickable buttons below questions" /%} +When Kilo Code needs more information to complete a task, it asks a follow-up question and often provides suggested answers to make responding faster. **How it works:** -1. **Question Appears** - Kilo Code asks a question using the `ask_followup_question` tool -2. **Suggestions Displayed** - If suggestions are provided, they appear as buttons below the question -3. **Interaction** - You can interact with these suggestions in two ways +1. **Question Appears** - Kilo Code asks a question using the `question` tool +2. **Options Displayed** - Selectable options are presented that you can choose from +3. **Selection** - Pick an option or type a custom response -**Interacting with suggestions:** +{% callout type="info" title="VSCode (Legacy)" collapsed=true %} +In the legacy extension, Kilo Code uses the `ask_followup_question` tool instead. Suggestions appear as clickable buttons below the question. You can click a button to send the answer directly, or hold `Shift` and click (or click the pencil icon {% codicon name="edit" /%}) to copy the suggestion into the input box for editing before sending. -You have two options for using suggested responses: - -1. **Direct Selection**: - - **Action**: Simply click the button containing the answer you want to provide - - **Result**: The selected answer is immediately sent back to Kilo Code as your response. This is the quickest way to reply if one of the suggestions perfectly matches your intent. - -2. **Edit Before Sending**: - - **Action**: - - Hold down `Shift` and click the suggestion button - - _Alternatively_, hover over the suggestion button and click the pencil icon ({% codicon name="edit" /%}) that appears - - **Result**: The text of the suggestion is copied into the chat input box. You can then modify the text as needed before pressing Enter to send your customized response. This is useful when a suggestion is close but needs minor adjustments. +{% image src="/docs/img/suggested-responses/suggested-responses.png" alt="Example of Kilo Code asking a question with suggested response buttons below it" width="800" caption="Suggested responses appear as clickable buttons below questions" /%} +{% /callout %} **Benefits:** @@ -119,6 +173,41 @@ This feature streamlines the interaction when Kilo Code requires clarification, ## Tips for Better Workflow +{% tabs %} +{% tab label="VSCode" %} + +{% callout type="tip" %} +**Switch agents for different tasks.** Use the agent dropdown, `/agents` slash command, or `Cmd+.` (`Ctrl+.` on Windows/Linux) to switch between agents like Code, Ask, and Plan. Each agent is tuned for a different type of task — see [Using Agents](/docs/code-with-ai/agents/using-agents) for details. +{% /callout %} + +{% callout type="tip" %} +**Your editor context is automatic.** The extension reads your open tabs and active file, so you don't need to manually reference every file. Focus your message on what you want done. +{% /callout %} + +{% callout type="tip" %} +**Pop out to an editor tab.** If the sidebar feels cramped, pop the chat into a full editor tab for more room. +{% /callout %} + +{% callout type="tip" %} +**Move Kilo Code to the Secondary Side Bar** for a better layout. Right-click on the Kilo Code icon in the Activity Bar and select **Move To → Secondary Side Bar**. This lets you see the Explorer, Search, Source Control, etc. alongside Kilo Code. + +{% image src="/docs/img/move-to-secondary.png" alt="Move to Secondary Side Bar" width="600" caption="Move Kilo Code to the Secondary Side Bar for better workspace organization" /%} +{% /callout %} + +{% /tab %} +{% tab label="CLI" %} + +{% callout type="tip" %} +**Switch agents for different tasks.** Use `/agents`, press `Tab` to cycle agents, or use `Ctrl+X a` to open the agent picker. Each agent is tuned for a different type of task — see [Using Agents](/docs/code-with-ai/agents/using-agents) for details. +{% /callout %} + +{% callout type="tip" %} +**The TUI is keyboard-driven.** Navigate, approve changes, and switch agents entirely from the keyboard — no mouse needed. +{% /callout %} + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + {% callout type="tip" %} **Move Kilo Code to the Secondary Side Bar** for a better layout. Right-click on the Kilo Code icon in the Activity Bar and select **Move To → Secondary Side Bar**. This lets you see the Explorer, Search, Source Control, etc. alongside Kilo Code. @@ -129,4 +218,7 @@ This feature streamlines the interaction when Kilo Code requires clarification, **Drag files directly into chat.** Once you have Kilo Code in a separate sidebar from the file explorer, you can drag files from the explorer into the chat window (even multiple at once). Just hold down the Shift key after you start dragging the files. {% /callout %} -Ready to start coding? Open the chat panel and describe what you want to build! +{% /tab %} +{% /tabs %} + +Ready to start coding? Start a session in Kilo Code and describe what you want to build! diff --git a/packages/kilo-docs/pages/code-with-ai/agents/context-mentions.md b/packages/kilo-docs/pages/code-with-ai/agents/context-mentions.md index e4bf59580b0..2320c8ea217 100644 --- a/packages/kilo-docs/pages/code-with-ai/agents/context-mentions.md +++ b/packages/kilo-docs/pages/code-with-ai/agents/context-mentions.md @@ -5,6 +5,92 @@ description: "How to provide context to Kilo Code using mentions" # Context Mentions +Providing the right context helps Kilo Code understand your project and perform tasks accurately. All platforms support `@`-mentions for referencing files, and the agent can also discover context on its own using built-in tools like `read`, `grep`, and `glob`. + +{% tabs %} +{% tab label="VSCode" %} + +The extension supports `@`-mention autocomplete for file paths and also uses a tool-based context model where the agent can automatically discover and read files using built-in tools. + +## How Context Works + +When you describe a task, the agent uses its tools — `read`, `grep`, `glob`, and others — to find and read relevant files on its own. You don't need to explicitly point it at files in most cases; just describe what you want done and the agent will locate the right code. + +### @-Mention Autocomplete + +Type `@` in the chat input followed by a filename to get autocomplete suggestions. Selecting a file attaches its contents to your message. This is the quickest way to reference a specific file. + +### Automatic Editor Context + +The extension automatically includes context from your editor with each message — your currently focused file and all open editor tabs. You don't need to mention these explicitly. + +Selected code and editor diagnostics (errors/warnings) are not included automatically. However, you can send these to Kilo Code through VS Code's Code Actions: select code or hover over an error, then use the lightbulb menu to find context-dependent actions like "Explain with Kilo Code" or "Fix with Kilo Code." + +### Tool-Based File Access + +Rather than attaching file contents up front, the agent reads files on demand during its work: + +| Tool | Purpose | Example | +| -------- | --------------------------------------------- | ------------------------------------------- | +| **read** | Read the contents of a specific file | Agent reads `src/utils.ts` to understand it | +| **glob** | Find files matching a pattern | Agent searches for `**/*.test.ts` | +| **grep** | Search file contents for a pattern | Agent searches for `function handleError` | +| **bash** | Run shell commands including `git` operations | Agent runs `git diff` or `git log` | + +This means the agent can explore your entire project as needed, rather than being limited to files you explicitly mention. + +## Best Practices + +| Practice | Description | +| ------------------------------ | -------------------------------------------------------------------------------------------------- | +| **Describe the task clearly** | The agent finds context on its own — focus on _what_ you want done rather than _where_ the code is | +| **Mention files when helpful** | If you know the exact file, mention its path to save the agent a search step | +| **Keep editor tabs relevant** | Open tabs are passed as context, so keep relevant files open | +| **Trust the agent's tools** | The agent can search, read, and explore your codebase — let it do the discovery work | + +{% /tab %} +{% tab label="CLI" %} + +The CLI uses a tool-based context model. The agent **automatically discovers and reads the context it needs** using built-in tools. In the TUI, you can type `@` to get file autocomplete suggestions for quick file references. + +## How Context Works + +When you describe a task, the agent uses its tools — `read`, `grep`, `glob`, and others — to find and read relevant files on its own. You don't need to explicitly point it at files in most cases; just describe what you want done and the agent will locate the right code. + +### Providing File Context + +In the terminal-based TUI, you can provide context in several ways: + +- **Type `@` for file autocomplete** — In the TUI, type `@` followed by a filename to get autocomplete suggestions for quick file references. +- **Mention file paths in your message** — Simply refer to files by path in your conversation text (e.g., "look at src/utils.ts") and the agent will read them. +- **Use `kilo run -f`** — When using the non-interactive `kilo run` command, pass `-f path/to/file.ts` to explicitly include a file's contents in the context. +- **Let the agent find files itself** — The agent has access to `glob` (find files by pattern), `grep` (search file contents), and `read` (read file contents) tools. Describe what you're looking for and it will locate the relevant code. + +### Tool-Based File Access + +Rather than attaching file contents up front, the agent reads files on demand during its work: + +| Tool | Purpose | Example | +| -------- | --------------------------------------------- | ------------------------------------------- | +| **read** | Read the contents of a specific file | Agent reads `src/utils.ts` to understand it | +| **glob** | Find files matching a pattern | Agent searches for `**/*.test.ts` | +| **grep** | Search file contents for a pattern | Agent searches for `function handleError` | +| **bash** | Run shell commands including `git` operations | Agent runs `git diff` or `git log` | + +This means the agent can explore your entire project as needed, rather than being limited to files you explicitly mention. + +## Best Practices + +| Practice | Description | +| ------------------------------ | -------------------------------------------------------------------------------------------------- | +| **Describe the task clearly** | The agent finds context on its own — focus on _what_ you want done rather than _where_ the code is | +| **Mention files when helpful** | If you know the exact file, mention its path to save the agent a search step | +| **Use `kilo run -f`** | Pass key files with `-f` when using `kilo run` for immediate context | +| **Trust the agent's tools** | The agent can search, read, and explore your codebase — let it do the discovery work | + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + Context mentions are a powerful way to provide Kilo Code with specific information about your project, allowing it to perform tasks more accurately and efficiently. You can use mentions to refer to files, folders, problems, and Git commits. Context mentions start with the `@` symbol. {% image src="/docs/img/context-mentions/context-mentions.png" alt="Context Mentions Overview - showing the @ symbol dropdown menu in the chat interface" width="600" caption="Context mentions overview showing the @ symbol dropdown menu in the chat interface." /%} @@ -116,3 +202,6 @@ The dropdown automatically suggests: | **Click mentions** | Click mentions in chat history to open files or view content | | **Eliminate copy-pasting** | Use mentions instead of manually copying code or errors | | **Combine mentions** | "Fix @problems in @/src/component.ts using the pattern from commit @a1b2c3d" | + +{% /tab %} +{% /tabs %} diff --git a/packages/kilo-docs/pages/code-with-ai/agents/free-and-budget-models.md b/packages/kilo-docs/pages/code-with-ai/agents/free-and-budget-models.md index 8d588e1531b..ce24af58ff3 100644 --- a/packages/kilo-docs/pages/code-with-ai/agents/free-and-budget-models.md +++ b/packages/kilo-docs/pages/code-with-ai/agents/free-and-budget-models.md @@ -131,9 +131,9 @@ When you need more capability than free models provide, these options deliver ex **Use appropriate modes to limit expensive operations:** -- **[Ask Mode](/docs/code-with-ai/agents/using-modes#ask-mode):** Information gathering without code changes -- **[Architect Mode](/docs/code-with-ai/agents/using-modes#architect-mode):** Planning without expensive file operations -- **[Debug Mode](/docs/code-with-ai/agents/using-modes#debug-mode):** Focused troubleshooting +- **[Ask Agent](/docs/code-with-ai/agents/using-agents#ask):** Information gathering without code changes +- **[Plan Agent](/docs/code-with-ai/agents/using-agents#plan):** Planning without expensive file operations +- **[Debug Agent](/docs/code-with-ai/agents/using-agents#debug):** Focused troubleshooting **Custom modes for budget control:** diff --git a/packages/kilo-docs/pages/code-with-ai/agents/model-selection.md b/packages/kilo-docs/pages/code-with-ai/agents/model-selection.md index bf090ac3404..43d9dbec509 100644 --- a/packages/kilo-docs/pages/code-with-ai/agents/model-selection.md +++ b/packages/kilo-docs/pages/code-with-ai/agents/model-selection.md @@ -19,6 +19,33 @@ This isn't benchmarks from some lab. It's real usage data from developers like y While the specifics change constantly, some principles stay consistent: +### How to Select and Switch Models + +{% tabs %} +{% tab label="VSCode" %} + +- Use the **model selector** in the chat prompt area to pick a model for the current session. You can also type `/models` to open the model picker. +- Set per-agent defaults and a global default in the **Settings** panel (Models tab), or directly in the `kilo.jsonc` config file. +- **Model precedence:** Session override → Per-agent config → Global config → Recent models → Kilo Auto (free). + +{% /tab %} +{% tab label="CLI" %} + +- In the TUI, use the **model picker** (`Ctrl+X m` or `/models`) to switch models. +- For non-interactive use, pass `--model` flag to `kilo run` (e.g., `kilo run --model claude-sonnet-4-20250514`). +- Set the global default with the `model` key in `kilo.jsonc`, or configure per-agent models in the `agent` section. +- **Model precedence:** `--model` flag → Per-agent config → Last used in session → Global config → Recent models → First available. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + +- Use the **model dropdown** in the chat panel to select a model for each conversation. +- Configure **API profiles** in Settings to group provider + model combinations and switch between them quickly. +- Models are **sticky per mode** — each mode (Code, Architect, Debug, etc.) remembers the last model you selected. + +{% /tab %} +{% /tabs %} + **For complex coding tasks**: Premium models (Claude Sonnet/Opus, GPT-5 class, Gemini Pro) typically handle nuanced requirements, large refactors, and architectural decisions better. **For everyday coding**: Mid-tier models often provide the best balance of speed, cost, and quality. They're fast enough to keep your flow state intact and capable enough for most tasks. diff --git a/packages/kilo-docs/pages/code-with-ai/agents/orchestrator-mode.md b/packages/kilo-docs/pages/code-with-ai/agents/orchestrator-mode.md index 9fca04b85c2..8fb065bcefa 100644 --- a/packages/kilo-docs/pages/code-with-ai/agents/orchestrator-mode.md +++ b/packages/kilo-docs/pages/code-with-ai/agents/orchestrator-mode.md @@ -1,42 +1,40 @@ --- title: "Orchestrator Mode" -description: "Using Orchestrator mode for complex multi-step tasks" +description: "Orchestrator mode is no longer needed — agents with full tool access now support subagents natively" --- -# Orchestrator Mode: Coordinate Complex Workflows +# Orchestrator Mode (Deprecated) -Orchestrator Mode (formerly known as Boomerang Tasks) allows you to break down complex projects into smaller, manageable pieces. Think of it like delegating parts of your work to specialized assistants. Each subtask runs in its own context, often using a different Kilo Code mode tailored for that specific job (like [`code`](/docs/code-with-ai/agents/using-modes#code-mode-default), [`architect`](/docs/code-with-ai/agents/using-modes#architect-mode), or [`debug`](/docs/code-with-ai/agents/using-modes#debug-mode)). - -{% youtube url="https://www.youtube.com/watch?v=20MmJNeOODo" caption="Orchestrator Mode explained and demonstrated" /%} - -## Why Use Orchestrator Mode? - -- **Tackle Complexity:** Break large, multi-step projects (e.g., building a full feature) into focused subtasks (e.g., design, implementation, documentation). -- **Use Specialized Modes:** Automatically delegate subtasks to the mode best suited for that specific piece of work, leveraging specialized capabilities for optimal results. -- **Maintain Focus & Efficiency:** Each subtask operates in its own isolated context with a separate conversation history. This prevents the parent (orchestrator) task from becoming cluttered with the detailed execution steps (like code diffs or file analysis results), allowing it to focus efficiently on the high-level workflow and manage the overall process based on concise summaries from completed subtasks. -- **Streamline Workflows:** Results from one subtask can be automatically passed to the next, creating a smooth flow (e.g., architectural decisions feeding into the coding task). - -## How It Works - -1. Using Orchestrator Mode, Kilo can analyze a complex task and suggest breaking it down into a subtask. -2. The parent task pauses, and the new subtask begins in a different mode. -3. When the subtask's goal is achieved, Kilo signals completion. -4. The parent task resumes with only the summary of the subtask. The parent uses this summary to continue the main workflow. - -## Key Considerations - -- **Approval Required:** By default, you must approve the creation and completion of each subtask. This can be automated via the [Auto-Approving Actions](/docs/getting-started/settings/auto-approving-actions#subtasks) settings if desired. -- **Context Isolation and Transfer:** Each subtask operates in complete isolation with its own conversation history. It does not automatically inherit the parent's context. Information must be explicitly passed: - - **Down:** Via the initial instructions provided when the subtask is created. - - **Up:** Via the final summary provided when the subtask finishes. Be mindful that only this summary returns to the parent. -- **Navigation:** Kilo's interface helps you see the hierarchy of tasks (which task is the parent, which are children). You can typically navigate between active and paused tasks. - -Orchestrator Mode provides a powerful way to manage complex development workflows directly within Kilo Code, leveraging specialized modes for maximum efficiency. - -{% callout type="tip" title="Keep Tasks Focused" %} -Use subtasks to maintain clarity. If a request significantly shifts focus or requires a different expertise (mode), consider creating a subtask rather than overloading the current one. +{% callout type="warning" title="Deprecated — scheduled for removal" %} +Orchestrator mode is deprecated and will be removed in a future release. In the VSCode extension and CLI, **agents with full tool access (Code, Plan, Debug) can now delegate to subagents automatically**. You no longer need a dedicated orchestrator — just pick the agent for your task and it will coordinate subagents when helpful. (Read-only agents like Ask do not support delegation.) {% /callout %} -1. This context is passed via the `message` parameter of the [`new_task`](/docs/automate/tools/new-task) tool. -2. The mode for the subtask is specified via the `mode` parameter of the [`new_task`](/docs/automate/tools/new-task) tool during initiation. -3. This summary is passed via the `result` parameter of the [`attempt_completion`](/docs/automate/tools/attempt-completion) tool when the subtask finishes. +## What Changed + +Previously, orchestrator mode was the only way to break complex tasks into subtasks. You had to explicitly switch to orchestrator mode, which would then delegate work to other modes like Code or Architect. + +Now, **subagent support is built into agents that have full tool access** (Code, Plan, Debug). When one of these agents encounters a task that would benefit from delegation — like exploring a codebase, running a parallel search, or handling a subtask in isolation — it can launch a subagent directly using the `task` tool. There's no need to switch agents first. + +## What You Should Do + +- **Just pick the right agent for your task.** Use Code for implementation, Plan for architecture, Debug for troubleshooting. Each will orchestrate subagents where it makes sense. +- **Add custom subagents** if you want specialized delegation behavior. See [Custom Subagents](/docs/customize/custom-subagents) for details. +- **Stop switching to orchestrator mode** before complex tasks. Your current agent already has that capability. + +## How Subagents Work + +1. The agent analyzes a complex task and decides a subtask would benefit from isolation. +2. It launches a subagent session using the `task` tool (e.g., `general` for autonomous work, `explore` for codebase research). +3. The subagent runs in its own isolated context — separate conversation history, no shared state. +4. When done, the subagent returns a summary to the parent agent, which continues its work. + +Agents can launch multiple subagent sessions concurrently for parallel work. + +{% callout type="info" title="VSCode (Legacy)" collapsed=true %} +In the legacy extension, orchestrator mode uses two dedicated tools: + +1. [`new_task`](/docs/automate/tools/new-task) — Creates a subtask with context passed via the `message` parameter and a mode specified via `mode` (e.g., `code`, `architect`, `debug`). +2. [`attempt_completion`](/docs/automate/tools/attempt-completion) — Signals subtask completion and passes a summary back to the parent via the `result` parameter. + +{% youtube url="https://www.youtube.com/watch?v=20MmJNeOODo" caption="Orchestrator Mode in the legacy extension" /%} +{% /callout %} diff --git a/packages/kilo-docs/pages/code-with-ai/agents/using-agents.md b/packages/kilo-docs/pages/code-with-ai/agents/using-agents.md new file mode 100644 index 00000000000..c03728dfbb9 --- /dev/null +++ b/packages/kilo-docs/pages/code-with-ai/agents/using-agents.md @@ -0,0 +1,263 @@ +--- +title: "Using Agents" +description: "Understanding and using different agents in Kilo Code" +--- + +# Using Agents + +Agents in Kilo Code are specialized personas that tailor the assistant's behavior to your current task. Each agent offers different capabilities, expertise, and access levels to help you accomplish specific goals. + +{% callout type="info" %} +The **VSCode (Legacy)** extension calls these **modes** instead of agents. The concept is the same — specialized personas with distinct tool access and behavior. +{% /callout %} + +## Why Use Different Agents? + +- **Task specialization:** Get precisely the type of assistance you need for your current task +- **Safety controls:** Prevent unintended file modifications when focusing on planning or learning +- **Focused interactions:** Receive responses optimized for your current activity +- **Workflow optimization:** Seamlessly transition between planning, implementing, debugging, and learning + +## Switching Agents + +{% tabs %} +{% tab label="VSCode" %} + +There are several ways to switch agents: + +- **Dropdown menu:** Click the agent selector in the sidebar to switch between agents. +- **Slash commands:** Type `/agents` in the chat input to open the agent picker. +- **Keyboard shortcut:** Press `Cmd+.` (macOS) or `Ctrl+.` (Windows/Linux) to cycle through available agents. Add `Shift` to cycle in reverse. + +{% /tab %} +{% tab label="CLI" %} + +There are several ways to switch agents: + +- **Cycle agents:** Press `Tab` to cycle forward through agents, or `Shift+Tab` to cycle backward. +- **Agent picker:** Press `Ctrl+X a` (leader key + `a`) to open the full agent list. +- **Slash commands:** Type `/agents` in the chat input to open the agent picker. +- **Config file:** Set the `default_agent` key in your configuration to change the default agent on startup. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + +{% youtube url="https://youtu.be/cS4vQfX528w" caption="Explaining the different modes in Kilo Code" /%} + +Four ways to switch modes: + +1. **Dropdown menu:** Click the selector to the left of the chat input + + {% image src="/docs/img/modes/modes.png" alt="Using the dropdown menu to switch modes" width="400" /%} + +2. **Slash command:** Type `/agents` or `/modes` to list modes and switch. Type `/newtask` to create a new task, or `/smol` to condense your context window. + + {% image src="/docs/img/modes/modes-1.png" alt="Using slash commands to switch modes" width="400" /%} + +### Understanding /newtask vs /smol + +Users often confuse `/newtask` and `/smol`. Here's the key difference: + +| Command | Purpose | When to Use | +| ---------- | ----------------------------------------------------- | ----------------------------------------------------------------------- | +| `/newtask` | Creates a new task with context from the current task | When you want to start something new while carrying over context | +| `/smol` | Condenses your current context window | When your conversation is getting too long and you want to summarize it | + +3. **Toggle command/Keyboard shortcut:** Use the keyboard shortcut below, applicable to your operating system. Each press cycles through the available modes in sequence, wrapping back to the first mode after reaching the end. + + | Operating System | Shortcut | + | ---------------- | -------- | + | macOS | ⌘ + . | + | Windows | Ctrl + . | + | Linux | Ctrl + . | + +You can hold `shift` to move backwards through the list of modes, for example ⌘ + shift + on macOS. + +4. **Accept suggestions:** Click on mode switch suggestions that Kilo Code offers when appropriate + + {% image src="/docs/img/modes/modes-2.png" alt="Accepting a mode switch suggestion from Kilo Code" width="400" /%} + +{% /tab %} +{% /tabs %} + +## Built-in Agents + +{% tabs %} +{% tab label="VSCode" %} + +### code (Default) + +| Aspect | Details | +| -------------------- | ----------------------------------------------------------------------------------------------------------------- | +| **Description** | A skilled software engineer with expertise in programming languages, design patterns, and best practices | +| **Tool Access** | Full access to all tools: `read`, `edit`, `glob`, `grep`, `bash`, `task`, `webfetch`, plus tools from MCP servers | +| **Ideal For** | Writing code, implementing features, debugging, and general development | +| **Special Features** | No tool restrictions — full flexibility for all coding tasks | + +### ask + +| Aspect | Details | +| -------------------- | ------------------------------------------------------------------------------------------------- | +| **Description** | A knowledgeable technical assistant focused on answering questions without changing your codebase | +| **Tool Access** | Read-only tools only (cannot edit files or run commands) | +| **Ideal For** | Code explanation, concept exploration, and technical learning | +| **Special Features** | Optimized for informative responses without modifying your project | + +### plan + +| Aspect | Details | +| -------------------- | ---------------------------------------------------------------------------------------------------- | +| **Description** | An experienced technical leader and planner who helps design systems and create implementation plans | +| **Tool Access** | Read-only tools plus restricted file editing (plan files in `.kilo/plans/` only) | +| **Ideal For** | System design, high-level planning, and architecture discussions | +| **Special Features** | Similar to the legacy extension's "Architect" mode, with a planning-focused approach | + +### debug + +| Aspect | Details | +| -------------------- | ----------------------------------------------------------------------------------- | +| **Description** | An expert problem solver specializing in systematic troubleshooting and diagnostics | +| **Tool Access** | Full access to all tools | +| **Ideal For** | Tracking down bugs, diagnosing errors, and resolving complex issues | +| **Special Features** | Uses a methodical approach of analyzing, narrowing possibilities, and fixing issues | + +### orchestrator (Deprecated) + +| Aspect | Details | +| -------------------- | -------------------------------------------------------------------------------------------------------------------- | +| **Description** | A strategic workflow orchestrator who coordinates complex tasks by delegating them to appropriate specialized agents | +| **Tool Access** | Limited access to create new tasks and coordinate workflows | +| **Ideal For** | Breaking down complex projects into manageable subtasks assigned to specialized agents | +| **Special Features** | Delegates work to other agents; also has access to the **explore** subagent for codebase exploration | + +{% callout type="warning" %} +Orchestrator is deprecated and will be removed in a future release. Agents with full tool access (Code, Plan, Debug) now support subagents natively — there's no need for a dedicated orchestrator. See [Orchestrator Mode (Deprecated)](/docs/code-with-ai/agents/orchestrator-mode) for migration details. +{% /callout %} + +{% callout type="info" %} +The VSCode extension and CLI do not include a built-in Review agent. Code review workflows can be handled by the **code** agent or via custom agent configurations. +{% /callout %} + +{% /tab %} +{% tab label="CLI" %} + +### code (Default) + +| Aspect | Details | +| -------------------- | ----------------------------------------------------------------------------------------------------------------- | +| **Description** | A skilled software engineer with expertise in programming languages, design patterns, and best practices | +| **Tool Access** | Full access to all tools: `read`, `edit`, `glob`, `grep`, `bash`, `task`, `webfetch`, plus tools from MCP servers | +| **Ideal For** | Writing code, implementing features, debugging, and general development | +| **Special Features** | No tool restrictions — full flexibility for all coding tasks | + +### ask + +| Aspect | Details | +| -------------------- | ------------------------------------------------------------------------------------------------- | +| **Description** | A knowledgeable technical assistant focused on answering questions without changing your codebase | +| **Tool Access** | Read-only tools only (cannot edit files or run commands) | +| **Ideal For** | Code explanation, concept exploration, and technical learning | +| **Special Features** | Optimized for informative responses without modifying your project | + +### plan + +| Aspect | Details | +| -------------------- | ---------------------------------------------------------------------------------------------------- | +| **Description** | An experienced technical leader and planner who helps design systems and create implementation plans | +| **Tool Access** | Read-only tools plus restricted file editing (plan files in `.kilo/plans/` only) | +| **Ideal For** | System design, high-level planning, and architecture discussions | +| **Special Features** | Similar to the legacy extension's "Architect" mode, with a planning-focused approach | + +### debug + +| Aspect | Details | +| -------------------- | ----------------------------------------------------------------------------------- | +| **Description** | An expert problem solver specializing in systematic troubleshooting and diagnostics | +| **Tool Access** | Full access to all tools | +| **Ideal For** | Tracking down bugs, diagnosing errors, and resolving complex issues | +| **Special Features** | Uses a methodical approach of analyzing, narrowing possibilities, and fixing issues | + +### orchestrator (Deprecated) + +| Aspect | Details | +| -------------------- | -------------------------------------------------------------------------------------------------------------------- | +| **Description** | A strategic workflow orchestrator who coordinates complex tasks by delegating them to appropriate specialized agents | +| **Tool Access** | Limited access to create new tasks and coordinate workflows | +| **Ideal For** | Breaking down complex projects into manageable subtasks assigned to specialized agents | +| **Special Features** | Delegates work to other agents; also has access to the **explore** subagent for codebase exploration | + +{% callout type="warning" %} +Orchestrator is deprecated and will be removed in a future release. Agents with full tool access (Code, Plan, Debug) now support subagents natively — there's no need for a dedicated orchestrator. See [Orchestrator Mode (Deprecated)](/docs/code-with-ai/agents/orchestrator-mode) for migration details. +{% /callout %} + +{% callout type="info" %} +The VSCode extension and CLI do not include a built-in Review agent. Code review workflows can be handled by the **code** agent or via custom agent configurations. +{% /callout %} + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + +### Code Mode (Default) + +| Aspect | Details | +| -------------------- | -------------------------------------------------------------------------------------------------------- | +| **Description** | A skilled software engineer with expertise in programming languages, design patterns, and best practices | +| **Tool Access** | Full access to all tool groups: `read`, `edit`, `browser`, `command`, `mcp` | +| **Ideal For** | Writing code, implementing features, debugging, and general development | +| **Special Features** | No tool restrictions—full flexibility for all coding tasks | + +### Ask Mode + +| Aspect | Details | +| -------------------- | ------------------------------------------------------------------------------------------------- | +| **Description** | A knowledgeable technical assistant focused on answering questions without changing your codebase | +| **Tool Access** | Limited access: `read`, `browser`, `mcp` only (cannot edit files or run commands) | +| **Ideal For** | Code explanation, concept exploration, and technical learning | +| **Special Features** | Optimized for informative responses without modifying your project | + +### Architect Mode + +| Aspect | Details | +| -------------------- | ---------------------------------------------------------------------------------------------------- | +| **Description** | An experienced technical leader and planner who helps design systems and create implementation plans | +| **Tool Access** | Access to `read`, `browser`, `mcp`, and restricted `edit` (markdown files only) | +| **Ideal For** | System design, high-level planning, and architecture discussions | +| **Special Features** | Follows a structured approach from information gathering to detailed planning | + +### Debug Mode + +| Aspect | Details | +| -------------------- | ----------------------------------------------------------------------------------- | +| **Description** | An expert problem solver specializing in systematic troubleshooting and diagnostics | +| **Tool Access** | Full access to all tool groups: `read`, `edit`, `browser`, `command`, `mcp` | +| **Ideal For** | Tracking down bugs, diagnosing errors, and resolving complex issues | +| **Special Features** | Uses a methodical approach of analyzing, narrowing possibilities, and fixing issues | + +{% callout type="tip" %} +**Keep debugging separate from main tasks:** When using Debug mode, ask Kilo to "start a new task in Debug mode with all of the necessary context needed to figure out X" so that the debugging process uses its own context window and doesn't pollute the main task. +{% /callout %} + +### Orchestrator Mode + +| Aspect | Details | +| -------------------- | ------------------------------------------------------------------------------------------------------------------- | +| **Description** | A strategic workflow orchestrator who coordinates complex tasks by delegating them to appropriate specialized modes | +| **Tool Access** | Limited access to create new tasks and coordinate workflows | +| **Ideal For** | Breaking down complex projects into manageable subtasks assigned to specialized modes | +| **Special Features** | Uses the new_task tool to delegate work to other modes | + +### Review Mode + +| Aspect | Details | +| -------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| **Description** | An expert code reviewer specializing in analyzing changes to provide structured feedback on quality, security, and best practices | +| **Tool Access** | Access to `read`, `browser`, `mcp`, and when permitted, `edit` | +| **Ideal For** | Catching issues early, enforcing code standards, accelerating PR turnaround | +| **Special Features** | Code review before committing, surfacing feedback across performance, security, style, and test coverage | + +{% /tab %} +{% /tabs %} + +## Custom Agents + +Create your own specialized assistants by defining tool access, file permissions, and behavior instructions. Custom agents help enforce team standards or create purpose-specific assistants. See [Custom Modes documentation](/docs/customize/custom-modes) for setup instructions. diff --git a/packages/kilo-docs/pages/code-with-ai/agents/using-modes.md b/packages/kilo-docs/pages/code-with-ai/agents/using-modes.md deleted file mode 100644 index 1f0c4f1e0d9..00000000000 --- a/packages/kilo-docs/pages/code-with-ai/agents/using-modes.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: "Using Modes" -description: "Understanding and using different modes in Kilo Code" ---- - -# Using Modes - -Modes in Kilo Code are specialized personas that tailor the assistant's behavior to your current task. Each mode offers different capabilities, expertise, and access levels to help you accomplish specific goals. - -## Why Use Different Modes? - -- **Task specialization:** Get precisely the type of assistance you need for your current task -- **Safety controls:** Prevent unintended file modifications when focusing on planning or learning -- **Focused interactions:** Receive responses optimized for your current activity -- **Workflow optimization:** Seamlessly transition between planning, implementing, debugging, and learning - -{% youtube url="https://youtu.be/cS4vQfX528w" caption="Explaining the different modes in Kilo Code" /%} - -## Switching Between Modes - -Four ways to switch modes: - -1. **Dropdown menu:** Click the selector to the left of the chat input - - {% image src="/docs/img/modes/modes.png" alt="Using the dropdown menu to switch modes" width="400" /%} - -2. **Slash command:** Type `/architect`, `/ask`, `/debug`, or `/code` in the chat input to switch modes. Type `/newtask` to create a new task, or `/smol` to condense your context window. - - {% image src="/docs/img/modes/modes-1.png" alt="Using slash commands to switch modes" width="400" /%} - -### Understanding /newtask vs /smol - -Users often confuse `/newtask` and `/smol`. Here's the key difference: - -| Command | Purpose | When to Use | -| ---------- | ----------------------------------------------------- | ----------------------------------------------------------------------- | -| `/newtask` | Creates a new task with context from the current task | When you want to start something new while carrying over context | -| `/smol` | Condenses your current context window | When your conversation is getting too long and you want to summarize it | - -3. **Toggle command/Keyboard shortcut:** Use the keyboard shortcut below, applicable to your operating system. Each press cycles through the available modes in sequence, wrapping back to the first mode after reaching the end. - - | Operating System | Shortcut | - | ---------------- | -------- | - | macOS | ⌘ + . | - | Windows | Ctrl + . | - | Linux | Ctrl + . | - -4. **Accept suggestions:** Click on mode switch suggestions that Kilo Code offers when appropriate - - {% image src="/docs/img/modes/modes-2.png" alt="Accepting a mode switch suggestion from Kilo Code" width="400" /%} - -## Built-in Modes - -### Code Mode (Default) - -| Aspect | Details | -| -------------------- | -------------------------------------------------------------------------------------------------------- | -| **Description** | A skilled software engineer with expertise in programming languages, design patterns, and best practices | -| **Tool Access** | Full access to all tool groups: `read`, `edit`, `browser`, `command`, `mcp` | -| **Ideal For** | Writing code, implementing features, debugging, and general development | -| **Special Features** | No tool restrictions—full flexibility for all coding tasks | - -### Ask Mode - -| Aspect | Details | -| -------------------- | ------------------------------------------------------------------------------------------------- | -| **Description** | A knowledgeable technical assistant focused on answering questions without changing your codebase | -| **Tool Access** | Limited access: `read`, `browser`, `mcp` only (cannot edit files or run commands) | -| **Ideal For** | Code explanation, concept exploration, and technical learning | -| **Special Features** | Optimized for informative responses without modifying your project | - -### Architect Mode - -| Aspect | Details | -| -------------------- | ---------------------------------------------------------------------------------------------------- | -| **Description** | An experienced technical leader and planner who helps design systems and create implementation plans | -| **Tool Access** | Access to `read`, `browser`, `mcp`, and restricted `edit` (markdown files only) | -| **Ideal For** | System design, high-level planning, and architecture discussions | -| **Special Features** | Follows a structured approach from information gathering to detailed planning | - -### Debug Mode - -| Aspect | Details | -| -------------------- | ----------------------------------------------------------------------------------- | -| **Description** | An expert problem solver specializing in systematic troubleshooting and diagnostics | -| **Tool Access** | Full access to all tool groups: `read`, `edit`, `browser`, `command`, `mcp` | -| **Ideal For** | Tracking down bugs, diagnosing errors, and resolving complex issues | -| **Special Features** | Uses a methodical approach of analyzing, narrowing possibilities, and fixing issues | - -{% callout type="tip" %} -**Keep debugging separate from main tasks:** When using Debug mode, ask Kilo to "start a new task in Debug mode with all of the necessary context needed to figure out X" so that the debugging process uses its own context window and doesn't pollute the main task. -{% /callout %} - -### Orchestrator Mode - -| Aspect | Details | -| -------------------- | ------------------------------------------------------------------------------------------------------------------- | -| **Description** | A strategic workflow orchestrator who coordinates complex tasks by delegating them to appropriate specialized modes | -| **Tool Access** | Limited access to create new tasks and coordinate workflows | -| **Ideal For** | Breaking down complex projects into manageable subtasks assigned to specialized modes | -| **Special Features** | Uses the new_task tool to delegate work to other modes | - -### Review Mode - -| Aspect | Details | -| -------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| **Description** | An expert code reviewer specializing in analyzing changes to provide structured feedback on quality, security, and best practices | -| **Tool Access** | Access to `read`, `browser`, `mcp`, and when permitted, `edit` | -| **Ideal For** | Catching issues early, enforcing code standards, accelerating PR turnaround | -| **Special Features** | Code review before committing, surfacing feedback across performance, security, style, and test coverage | - -## Custom Modes - -Create your own specialized assistants by defining tool access, file permissions, and behavior instructions. Custom modes help enforce team standards or create purpose-specific assistants. See [Custom Modes documentation](/docs/customize/custom-modes) for setup instructions. - - diff --git a/packages/kilo-docs/pages/code-with-ai/features/autocomplete/index.md b/packages/kilo-docs/pages/code-with-ai/features/autocomplete/index.md index 311ae3e0b87..d26c1d6f086 100644 --- a/packages/kilo-docs/pages/code-with-ai/features/autocomplete/index.md +++ b/packages/kilo-docs/pages/code-with-ai/features/autocomplete/index.md @@ -7,6 +7,45 @@ description: "AI-powered code autocompletion in Kilo Code" Kilo Code's autocomplete feature provides intelligent code suggestions and completions while you're typing, helping you write code faster and more efficiently. It offers both automatic and manual triggering options. +{% tabs %} +{% tab label="VSCode" %} + +## How Autocomplete Works + +The extension uses **Fill-in-the-Middle (FIM)** completion powered by Codestral (`mistralai/codestral-2508`). It analyzes the code before and after your cursor to generate contextually accurate inline suggestions. + +## Triggering Options + +### Auto-trigger + +Autocomplete is **enabled by default** and automatically shows inline suggestions as you type. Suggestions appear as ghost text that you can accept with `Tab`. + +### Trigger on keybinding (Cmd+L) + +Press `Cmd+L` (Mac) or `Ctrl+L` (Windows/Linux) to manually request a completion at your cursor position. + +{% callout type="note" %} +This keybinding requires `kilo-code.new.autocomplete.enableSmartInlineTaskKeybinding` to be enabled in VS Code settings. It is **disabled by default**. +{% /callout %} + +## Status Bar + +The extension displays an **autocomplete status indicator** in the VS Code status bar, including: + +- Current autocomplete state (active/snoozed) +- Cumulative cost tracking for autocomplete requests + +### Snooze / Unsnooze + +You can temporarily disable autocomplete by clicking the status bar item to **snooze** it. Click again to **unsnooze** and re-enable suggestions. + +## Copilot Conflict Detection + +The extension automatically detects if **GitHub Copilot** inline suggestions are enabled and warns you about potential conflicts. Disable Copilot's inline completions for the best experience with Kilo Code autocomplete. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + ## How Autocomplete Works Autocomplete analyzes your code context and provides: @@ -86,6 +125,9 @@ If using Cursor, go to **Settings** > **Cursor Settings** > **Tab**, and toggle {% image src="https://github.com/user-attachments/assets/fd2eeae2-f770-40ca-8a72-a9d5a1c17d47" alt="Disable Cursor autocomplete" width="800" caption="Disable Cursor autocomplete" /%} +{% /tab %} +{% /tabs %} + ## Best Practices 1. **Balance speed and quality**: Faster models provide quicker suggestions but may be less accurate diff --git a/packages/kilo-docs/pages/code-with-ai/features/browser-use.md b/packages/kilo-docs/pages/code-with-ai/features/browser-use.md index 8255cf275b6..40d29c18728 100644 --- a/packages/kilo-docs/pages/code-with-ai/features/browser-use.md +++ b/packages/kilo-docs/pages/code-with-ai/features/browser-use.md @@ -13,6 +13,32 @@ Browser Use requires an advanced agentic model. It is typically most reliable wi ## How Browser Use Works +{% tabs %} +{% tab label="VSCode" %} + +Browser automation is built into the extension and requires no manual setup. Enable it from **Settings → Browser** and Kilo handles the rest automatically. + +{% /tab %} +{% tab label="CLI" %} + +Kilo Code uses [Playwright](https://playwright.dev/) for browser automation. Add it to your `kilo.jsonc` configuration: + +```json +{ + "mcp": { + "playwright": { + "type": "local", + "command": ["npx", "-y", "@playwright/mcp@latest"] + } + } +} +``` + +Playwright downloads Chromium automatically on first use. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + By default, Kilo Code uses a built-in browser that: - Launches automatically when you ask Kilo to visit a website @@ -22,6 +48,9 @@ By default, Kilo Code uses a built-in browser that: All of this happens directly within VS Code, with no setup required. +{% /tab %} +{% /tabs %} + ## Using Browser Use A typical browser interaction follows this pattern: @@ -39,6 +68,38 @@ For example: ## How Browser Actions Work +{% tabs %} +{% tab label="VSCode" %} + +Kilo launches a browser automatically when asked and returns screenshots after each action so you can see what's happening. It can navigate to URLs, click elements, fill in forms, scroll, hover, select from dropdowns, and drag and drop — all driven by natural language instructions in chat. + +{% /tab %} +{% tab label="CLI" %} + +The Playwright MCP server provides a set of browser tools for interacting with web pages. These tools return screenshots and accessibility snapshots after each action. + +Key characteristics: + +- The browser launches automatically when a browser tool is invoked +- Multiple browser tools can be used in sequence +- Screenshots are captured after each action for visual feedback + +### Available Browser Tools + +| Tool | Description | When to Use | +| -------------------- | ----------------------------------- | ------------------------------------- | +| `browser_navigate` | Navigates to a URL | Opening a web page | +| `browser_click` | Clicks an element on the page | Interacting with buttons, links, etc. | +| `browser_type` | Types text into an input element | Filling forms, search boxes | +| `browser_screenshot` | Captures a screenshot of the page | Inspecting visual state | +| `browser_scroll` | Scrolls the page or a specific area | Viewing content above or below | +| `browser_hover` | Hovers over an element | Revealing tooltips or menus | +| `browser_select` | Selects an option from a dropdown | Choosing from select elements | +| `browser_drag` | Drags an element to a target | Drag-and-drop interactions | + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + The browser_action tool controls a browser instance that returns screenshots and console logs after each action, allowing you to see the results of interactions. Key characteristics: @@ -59,8 +120,28 @@ Key characteristics: | `scroll_up` | Scrolls up by one page | Returning to previous content | | `close` | Closes the browser | Ending a browser session | +{% /tab %} +{% /tabs %} + ## Browser Use Settings +{% tabs %} +{% tab label="VSCode" %} + +Browser automation settings are available under **Settings → Browser**: + +- **Enable browser automation**: Toggle to enable or disable browser automation +- **Headless mode**: Run the browser without a visible window (default: disabled) +- **Use system Chrome**: Enabled by default — uses your installed Chrome. Disable to have Playwright download and use Chromium instead. + +{% /tab %} +{% tab label="CLI" %} + +Browser automation is configured in your `kilo.jsonc` file. No additional settings are required — Playwright manages the browser lifecycle automatically. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + {% callout type="info" title="Default Browser Settings" %} - **Enable browser tool**: Enabled @@ -161,3 +242,6 @@ Connect to a visible Chrome window to observe Kilo's interactions in real-time: ```bash google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug --no-first-run ``` + +{% /tab %} +{% /tabs %} diff --git a/packages/kilo-docs/pages/code-with-ai/features/checkpoints.md b/packages/kilo-docs/pages/code-with-ai/features/checkpoints.md index 377f9dc108e..f928aef3899 100644 --- a/packages/kilo-docs/pages/code-with-ai/features/checkpoints.md +++ b/packages/kilo-docs/pages/code-with-ai/features/checkpoints.md @@ -14,6 +14,65 @@ Checkpoints let you: - Compare different implementation approaches - Revert to previous project states without losing work +## Configuration Options + +{% tabs %} +{% tab label="VSCode" %} + +Checkpoints (called **snapshots** in the new extension) are configured via the `snapshot` key in your config file (`kilo.jsonc` or `~/.config/kilo/kilo.jsonc`): + +```json +{ + "snapshot": true +} +``` + +You can also toggle this in Settings: + +1. Open Settings by clicking the gear icon {% codicon name="gear" /%} +2. Go to the `Checkpoints` tab +3. Toggle the snapshot setting + +{% /tab %} +{% tab label="CLI" %} + +Checkpoints are controlled by the `snapshot` boolean in your `kilo.jsonc` configuration file: + +```json +{ + "snapshot": true +} +``` + +When enabled, the system automatically captures snapshots at each step of a task. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + +Access checkpoint settings in Kilo Code settings under the "Checkpoints" section: + +1. Open Settings by clicking the gear icon {% codicon name="gear" /%} → Checkpoints +2. Check or uncheck the "Enable automatic checkpoints" checkbox + + {% image src="/docs/img/checkpoints/checkpoints.png" alt="Checkpoint settings in Kilo Code configuration" width="500" /%} + +{% /tab %} +{% /tabs %} + +## How Checkpoints Work + +{% tabs %} +{% tab label="VSCode" %} + +The new extension uses **git-based snapshots** of your working directory. Snapshots are taken before and after agent edits. They integrate with your existing Git repository — no separate shadow repository is created. + +**Reverting changes:** + +You can revert any message's changes from the chat. A **Revert Banner** appears at the top of the chat when the session is in a reverted state, making it clear that you are viewing an earlier state. Use the banner to unrevert and return to the latest state. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + {% callout type="info" title="Important Notes" %} - **Checkpoints are enabled by default.** @@ -25,17 +84,6 @@ Checkpoints let you: {% /callout %} -## Configuration Options - -Access checkpoint settings in Kilo Code settings under the "Checkpoints" section: - -1. Open Settings by clicking the gear icon {% codicon name="gear" /%} → Checkpoints -2. Check or uncheck the "Enable automatic checkpoints" checkbox - - {% image src="/docs/img/checkpoints/checkpoints.png" alt="Checkpoint settings in Kilo Code configuration" width="500" /%} - -## How Checkpoints Work - Kilo Code captures snapshots of your project's state using a shadow Git repository, separate from your main version control system. These snapshots, called checkpoints, automatically record changes throughout your AI-assisted workflow—whenever tasks begin, files change, or commands run. Checkpoints are stored as Git commits in the shadow repository, capturing: @@ -46,8 +94,35 @@ Checkpoints are stored as Git commits in the shadow repository, capturing: - Renamed files - Binary file changes +{% /tab %} +{% /tabs %} + ## Working with Checkpoints +{% tabs %} +{% tab label="VSCode" %} + +Checkpoints are integrated directly into your workflow through the chat interface. Each message that caused file changes shows a diff summary. You can: + +- Click the diff badge on a message to open the **Diff Viewer** and review what changed +- Click **Revert** on any message to restore the workspace to its state before that message + +A **Revert Banner** is shown at the top of the chat whenever you are in a reverted state, with an option to return to the current state. + +{% /tab %} +{% tab label="CLI" %} + +Checkpoints are captured automatically at each step of a task. In the CLI terminal interface, checkpoints appear as revert points in the conversation. You can revert to any point by selecting the corresponding message. + +### Reverting Changes + +- **Full revert**: Revert your workspace to any point in the conversation +- **Undo a revert**: Restore the state before the last revert +- **Per-file revert**: Selectively undo changes to specific files while keeping others + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + Checkpoints are integrated directly into your workflow through the chat interface. Checkpoints appear directly in your chat history in two forms: @@ -93,6 +168,9 @@ To restore a project to a previous checkpoint state: {% image src="/docs/img/checkpoints/checkpoints-9.png" alt="Confirmation dialog for restoring checkpoint with files & task" width="300" /%} +{% /tab %} +{% /tabs %} + ### Limitations and Considerations - **Scope**: Checkpoints only capture changes made during active Kilo Code tasks @@ -102,6 +180,14 @@ To restore a project to a previous checkpoint state: ## Technical Implementation +{% tabs %} +{% tab label="VSCode" %} + +The new extension uses the underlying Git repository in your workspace to create snapshot commits. No shadow repository is used. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + ### Checkpoint Architecture The checkpoint system consists of: @@ -183,9 +269,12 @@ Checkpoints do not support nested Git repositories. The working directory must b Operations are queued to prevent concurrent Git operations that might corrupt repository state. This ensures that rapid checkpoint operations complete safely even when requested in quick succession. +{% /tab %} +{% /tabs %} + ## Git Installation -Checkpoints require Git to be installed on your system. The implementation uses the `simple-git` library, which relies on Git command-line tools to create and manage shadow repositories. +Checkpoints require Git to be installed on your system. ### macOS diff --git a/packages/kilo-docs/pages/code-with-ai/features/code-actions.md b/packages/kilo-docs/pages/code-with-ai/features/code-actions.md index c36e900e7f6..0cf1059a108 100644 --- a/packages/kilo-docs/pages/code-with-ai/features/code-actions.md +++ b/packages/kilo-docs/pages/code-with-ai/features/code-actions.md @@ -7,6 +7,37 @@ description: "Quick code actions and refactoring with Kilo Code" Code Actions are a powerful feature of VS Code that provide quick fixes, refactorings, and other code-related suggestions directly within the editor. Kilo Code integrates with this system to offer AI-powered assistance for common coding tasks. +{% callout type="info" %} +Code Actions are a **VS Code extension feature** and are not available in the CLI/TUI. +{% /callout %} + +{% tabs %} +{% tab label="VSCode" %} + +## Available Code Actions + +The extension provides code actions via the editor context menu and lightbulb: + +- **Add to Context:** Adds selected code (with file path and line numbers) to the active chat session. Keyboard shortcut: `Cmd+K Cmd+A` (Mac) or `Ctrl+K Ctrl+A` (Windows/Linux). +- **Explain Code:** Asks Kilo to explain the selected code. +- **Fix Code:** Asks Kilo to fix problems in the selected code. +- **Improve Code:** Asks Kilo to suggest improvements to the selected code. + +### Agent Manager Integration + +If the **Agent Manager** is active, code actions route to the current Agent Manager session rather than the sidebar chat. This allows code actions to work seamlessly within multi-session workflows. + +### Terminal Context Menu + +The extension also adds code actions to the **terminal context menu**: + +- **Add Terminal Content:** Adds selected terminal output to the chat context. +- **Fix Command:** Asks Kilo to fix a failed terminal command. +- **Explain Command:** Asks Kilo to explain a terminal command or its output. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + ## What are Code Actions? Code Actions appear as a lightbulb icon (💡) in the editor gutter (the area to the left of the line numbers). They can also be accessed via the right-click context menu, or via keyboard shortcut. They are triggered when: @@ -90,4 +121,7 @@ You can customize the prompts used for each Code Action by modifying the "Suppor 3. **Edit the Prompts:** Modify the text in the text area for the prompt you want to customize. You can use placeholders like `${filePath}` and `${selectedText}` to include information about the current file and selection. 4. **Click "Done":** Save your changes. +{% /tab %} +{% /tabs %} + By using Kilo Code's Code Actions, you can quickly get AI-powered assistance directly within your coding workflow. This can save you time and help you write better code. diff --git a/packages/kilo-docs/pages/code-with-ai/features/git-commit-generation.md b/packages/kilo-docs/pages/code-with-ai/features/git-commit-generation.md index 31582101198..6485311aa07 100644 --- a/packages/kilo-docs/pages/code-with-ai/features/git-commit-generation.md +++ b/packages/kilo-docs/pages/code-with-ai/features/git-commit-generation.md @@ -53,6 +53,20 @@ Common types include: ## Configuration +{% tabs %} +{% tab label="VSCode" %} + +The extension provides the same **SCM button** in the VS Code Source Control panel. Clicking it generates a commit message using the CLI backend's commit message generation API. + +Configuration is handled through the extension's settings or the shared `kilo.jsonc` config file. + +{% callout type="info" %} +Git commit message generation is a **VS Code extension feature**. It is not available in the CLI/TUI. +{% /callout %} + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + ### Customizing the Commit Template You can customize how commit messages are generated by modifying the prompt template: @@ -81,6 +95,9 @@ You can configure which API profile to use for commit message generation: Consider creating a dedicated [API configuration profile](/docs/ai-providers) with a faster, more cost-effective model specifically for commit message generation. {% /callout %} +{% /tab %} +{% /tabs %} + ## Best Practices ### Staging Strategy diff --git a/packages/kilo-docs/pages/code-with-ai/index.md b/packages/kilo-docs/pages/code-with-ai/index.md index 486ee35d3cc..2e229d00fdc 100644 --- a/packages/kilo-docs/pages/code-with-ai/index.md +++ b/packages/kilo-docs/pages/code-with-ai/index.md @@ -34,10 +34,10 @@ Use Kilo Code wherever you work: Kilo uses specialized agents to help with different tasks: - [**Chat Interface**](/docs/code-with-ai/agents/chat-interface) — Conversation-based coding -- [**Using Modes**](/docs/code-with-ai/agents/using-modes) — Switch between Code, Architect, Debug, and Ask modes +- [**Using Agents**](/docs/code-with-ai/agents/using-agents) — Switch between Code, Ask, Plan, Debug, and other agents - [**Model Selection**](/docs/code-with-ai/agents/model-selection) — Choose the right AI model for each task - [**Context Mentions**](/docs/code-with-ai/agents/context-mentions) — Reference files, functions, and symbols -- [**Orchestrator Mode**](/docs/code-with-ai/agents/orchestrator-mode) — Complex multi-step tasks +- [**Orchestrator Mode**](/docs/code-with-ai/agents/orchestrator-mode) — Legacy orchestration (now built into all agents) - [**Free & Budget Models**](/docs/code-with-ai/agents/free-and-budget-models) — Cost-effective AI options ## Features diff --git a/packages/kilo-docs/pages/code-with-ai/platforms/cli.md b/packages/kilo-docs/pages/code-with-ai/platforms/cli.md index 04d6ff8e2a8..91b40871124 100644 --- a/packages/kilo-docs/pages/code-with-ai/platforms/cli.md +++ b/packages/kilo-docs/pages/code-with-ai/platforms/cli.md @@ -1,6 +1,7 @@ --- title: "Kilo CLI" description: "Using Kilo Code from the command line" +platform: new --- {% callout type="warning" title="Version Notice" %} @@ -167,7 +168,7 @@ Review your code locally before pushing — catch issues early without waiting f Configuration is managed through: - `/connect` command for provider setup (interactive) -- Config files in **`~/.config/kilo/`**: the CLI (Kilo CLI 1.0 from [Kilo-Org/kilocode](https://github.com/Kilo-Org/kilocode)) merges `config.json`, `opencode.json`, and `opencode.jsonc`. Use **`opencode.json`** (or `opencode.jsonc`) for provider, model, permission, and **MCP** settings. Restart the CLI after editing. See [Using MCP in the CLI](/docs/automate/mcp/using-in-cli) for MCP config format. +- Config files in **`~/.config/kilo/`**: use **`kilo.jsonc`** for provider, model, permission, and **MCP** settings. Restart the CLI after editing. See [Using MCP in Kilo Code](/docs/automate/mcp/using-in-kilo-code) for MCP config format. - `kilo auth` for credential management ## Slash Commands @@ -175,7 +176,7 @@ Configuration is managed through: The CLI's interactive mode supports slash commands for common operations. The main commands are documented above in the [Interactive Slash Commands](#interactive-slash-commands) section. {% callout type="tip" %} -**Confused about /newtask vs /smol in the IDE?** See the [Using Modes](/docs/code-with-ai/agents/using-modes#understanding-newtask-vs-smol) documentation for details. +**Confused about /newtask vs /smol in the IDE?** See the [Using Agents](/docs/code-with-ai/agents/using-agents#understanding-newtask-vs-smol) documentation for details. {% /callout %} ## Permissions diff --git a/packages/kilo-docs/pages/code-with-ai/platforms/vscode.md b/packages/kilo-docs/pages/code-with-ai/platforms/vscode.md index a06044fe304..2db22d89a61 100644 --- a/packages/kilo-docs/pages/code-with-ai/platforms/vscode.md +++ b/packages/kilo-docs/pages/code-with-ai/platforms/vscode.md @@ -5,6 +5,60 @@ description: "Using Kilo Code in Visual Studio Code" # VS Code Extension +Kilo Code is available as two VS Code extensions: the **VSCode (Legacy)** extension and the current **VSCode** version built on the Kilo CLI core. + +{% tabs %} +{% tab label="VSCode" %} + +## Installation + +1. Open VS Code +2. Go to Extensions (`Ctrl+Shift+X` / `Cmd+Shift+X`) +3. Search for "Kilo Code" +4. Click the dropdown arrow next to **Install** and select **Install Pre-Release Version** + +The extension bundles its own CLI binary and spawns `kilo serve` as a background process. All communication happens over HTTP + SSE. + +## Key Features + +Key features include: + +- **SolidJS-based UI** — Rebuilt sidebar with a modern component architecture +- **[JSONC config files](/docs/getting-started/settings)** — Portable settings in `kilo.jsonc` instead of VS Code settings +- **[Granular permissions](/docs/getting-started/settings/auto-approving-actions)** — Per-tool permission rules with glob patterns +- **[Agents](/docs/code-with-ai/agents/using-agents)** — Customizable agents (`.kilo/agents/*.md`) replacing the modes system +- **[Agent Manager](/docs/automate/agent-manager)** — Enhanced with diff panel, multi-model comparison, PR import, and code review annotations +- **[Autocomplete](/docs/code-with-ai/features/autocomplete)** — FIM-based with Codestral, status bar cost tracking +- **[Workflows](/docs/customize/workflows)** — Repeatable prompt templates as `.md` files +- **[Skills](/docs/customize/skills)** — Load specialized domain knowledge from SKILL.md files +- **[Custom Subagents](/docs/customize/custom-subagents)** — Define specialized sub-agents for the `task` tool +- **Open in Tab** — Pop the chat out into a full editor tab +- **Sub-Agent Viewer** — Read-only panels for viewing child agent sessions +- **Legacy Migration** — Automatic migration wizard for VSCode extension settings + +## Shared Settings + +The extension shares its configuration with the CLI. Settings in `~/.config/kilo/kilo.jsonc` (global) and `./kilo.jsonc` (project) apply to both the CLI and the extension. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + ## Installation {% partial file="install-vscode.md" /%} + +## Key Features + +- **Sidebar chat** — AI-powered chat panel in the VS Code activity bar +- **[Autocomplete](/docs/code-with-ai/features/autocomplete)** — Inline code completions as you type +- **[Code Actions](/docs/code-with-ai/features/code-actions)** — Explain, fix, and improve code from the editor context menu +- **[Agents](/docs/code-with-ai/agents/using-agents)** — Code, Ask, Architect, Debug, Orchestrator, and Review modes +- **[Custom Modes](/docs/customize/custom-modes)** — Define custom modes with `.kilocodemodes` YAML files +- **[MCP](/docs/automate/mcp/overview)** — Connect to MCP servers for extended capabilities +- **[Agent Manager](/docs/automate/agent-manager)** — Multi-session orchestration with git worktree isolation +- **[Git Commit Generation](/docs/code-with-ai/features/git-commit-generation)** — AI-powered commit messages from the Source Control panel +- **[Context Mentions](/docs/code-with-ai/agents/context-mentions)** — Reference files, URLs, diagnostics, and git changes with `@` +- **[Checkpoints](/docs/code-with-ai/features/checkpoints)** — Git-based snapshots for undo/redo + +{% /tab %} +{% /tabs %} diff --git a/packages/kilo-docs/pages/collaborate/teams/custom-modes-org.md b/packages/kilo-docs/pages/collaborate/teams/custom-modes-org.md index e25615ab238..56211e329d6 100644 --- a/packages/kilo-docs/pages/collaborate/teams/custom-modes-org.md +++ b/packages/kilo-docs/pages/collaborate/teams/custom-modes-org.md @@ -5,7 +5,7 @@ description: "Create organization-wide custom modes" # Custom Modes (Org) -Custom Modes let you create tailored versions of Kilo’s built-in [modes](/docs/code-with-ai/agents/using-modes) for your organization. You can also adjust the settings for Kilo Code's original default modes. You can define a mode’s purpose, behavior, and tool access — helping Kilo adapt to your team’s unique workflows. +Custom Modes let you create tailored versions of Kilo's built-in [agents](/docs/code-with-ai/agents/using-agents) for your organization. You can also adjust the settings for Kilo Code's original default modes. You can define a mode's purpose, behavior, and tool access — helping Kilo adapt to your team's unique workflows. For example, Admins and Owners can extend these by creating **Custom Modes** with specialized roles or personalities (e.g. "Documentation Writer" or "Security Reviewer"). @@ -22,7 +22,7 @@ For example, Admins and Owners can extend these by creating **Custom Modes** wit | ---------------------------------- | ---------------------------------------------------------------------------------------------------- | | **Mode Name** | Display name for the new mode (e.g. _Security Reviewer_). | | **Mode Slug** | A short identifier used internally (e.g. `security-reviewer`). | -| **Role Definition** | Describe Kilo’s role and personality for this mode. Shapes how it reasons and responds. | +| **Role Definition** | Describe Kilo's role and personality for this mode. Shapes how it reasons and responds. | | **Short Description** | A brief summary shown in the mode selector. | | **When to Use (optional)** | Guidance for when this mode should be used. Helps the Orchestrator choose the right mode for a task. | | **Custom Instructions (optional)** | Add behavioral guidelines specific to this mode. | diff --git a/packages/kilo-docs/pages/contributing/cline-to-kilo-migration.md b/packages/kilo-docs/pages/contributing/cline-to-kilo-migration.md deleted file mode 100644 index 4e4d399fc7f..00000000000 --- a/packages/kilo-docs/pages/contributing/cline-to-kilo-migration.md +++ /dev/null @@ -1,180 +0,0 @@ ---- -title: "Cline to Kilo: Contributor Migration Guide" -description: "A guide for Cline contributors who want to start contributing to Kilo Code" ---- - -# Cline to Kilo: Contributor Migration Guide - -If you've been contributing to Cline and you're ready to bring those skills over to Kilo Code, you're in the right place. This guide will walk you through what's different, what's the same, and how to get up and running as a Kilo contributor. - -The good news: if you've been contributing to Cline, you already have most of the skills you need. The workflows are similar, but there are some differences worth knowing about before you dive in. - -## The Quick Version - -| What You Know from Cline | What's Different in Kilo | -| -------------------------------------------- | ------------------------ | -| `npm run install:all` | `pnpm install` | -| `npm run protos` required before first build | Not required | -| F5 to launch dev extension | Same — F5 to launch | -| Changesets for versioning | Same — `pnpm changeset` | - -## Setting Up Your Environment - -### What Stays the Same - -- Git, Node.js (v20.18.1+), and VS Code are still your core tools -- F5 still launches the extension in debug mode -- The project structure follows similar patterns (`src/`, `webview-ui/`, `e2e/`) - -### What's Changed - -**Package Manager: pnpm instead of npm** - -Kilo uses pnpm for dependency management. If you don't have it installed: - -```bash -npm install -g pnpm -``` - -Then instead of: - -```bash -# Cline -npm run install:all -``` - -You'll run: - -```bash -# Kilo -pnpm install -``` - -This single command handles everything — the main extension, webview UI, and e2e tests. - -**No Protocol Buffer Generation** - -In Cline, you needed to run `npm run protos` before your first build. Kilo doesn't require this step. Just install dependencies and you're ready to go. - -**Building the Extension** - -```bash -pnpm build -``` - -This builds the webview UI, compiles TypeScript, bundles everything, and drops a `.vsix` file in `bin/`. - -## Development Workflow Differences - -### Hot Reloading - -Kilo has improved hot reloading in development mode: - -- **Webview UI changes:** Apply immediately without restart (same as Cline) -- **Core extension changes:** In dev mode (`NODE_ENV="development"`), Kilo automatically triggers `workbench.action.reloadWindow` — no manual debugger restarts needed - -In Cline, you had to manually stop debugging, kill background tasks, and restart. Kilo handles this for you during development. - -**Note:** Production builds still require the manual stop/restart cycle. - -### Git Hooks - -Kilo uses Husky for git hooks, which run automatically: - -**Pre-commit:** - -- Blocks commits directly to main -- Runs type generation (`pnpm generate-types`) -- Checks for type file changes -- Runs lint-staged - -**Pre-push:** - -- Blocks pushes directly to main -- Compiles the project -- Reminds you to create a changeset if needed - -These hooks catch issues early. If a commit or push fails, check the hook output for details. - -## Testing - -### Running Tests - -```bash -# All tests -pnpm test - -# Extension tests only -pnpm test:extension - -# Webview tests only -pnpm test:webview - -# E2E / Integration tests -pnpm test:integration -``` - -### E2E Test Setup - -For integration tests, create a `.env.local` file in the project root: - -``` -OPENROUTER_API_KEY=sk-or-v1-... -``` - -Check `e2e/VSCODE_INTEGRATION_TESTS.md` for full details. - -## Contributing Code - -### Creating a Pull Request - -The changeset workflow is identical to Cline: - -```bash -pnpm changeset -``` - -Choose your version bump: - -- **major** — breaking changes -- **minor** — new features -- **patch** — bug fixes - -Commit the generated `.changeset` file with your changes. - -### Code Quality Checks - -```bash -pnpm lint # ESLint -pnpm check-types # TypeScript type checking -``` - -## What's New in Kilo - -Beyond the workflow changes, Kilo has expanded significantly as a platform. As a contributor, you might find opportunities to work on: - -- **Multiple interfaces:** VS Code, JetBrains, CLI, and web (Cloud Agents, App Builder) -- **Specialized Agent modes:** Code, Ask, Debug, Architect, Orchestrator -- **Custom Modes:** A system for creating and sharing specialized agent configurations -- **Platform features:** Sessions, Parallel Agents, Deploy, Code Reviews, Managed Indexing -- **Kilo Marketplace:** A community-driven repository where you can contribute Skills (modular workflows), MCP Servers (tool integrations), and Modes (custom agent behaviors) - -Check the [Architecture Overview](architecture) to understand how these pieces fit together. - -## Getting Help - -- **Discord:** Real-time support from the community -- **GitHub Discussions:** For questions and feature ideas -- **Reddit:** Community discussions - -## TL;DR Checklist - -- ✅ Install pnpm globally -- ✅ Fork and clone the Kilo repo -- ✅ Run `pnpm install` (not `npm run install:all`) -- ✅ Skip the protos step — it's not needed -- ✅ Press F5 to launch the dev extension -- ✅ Create a changeset before your PR (`pnpm changeset`) -- ✅ Let the git hooks do their thing - -Welcome to Kilo. We're glad you're here. diff --git a/packages/kilo-docs/pages/contributing/index.md b/packages/kilo-docs/pages/contributing/index.md index ba8960f7be3..1b8fa9e8604 100644 --- a/packages/kilo-docs/pages/contributing/index.md +++ b/packages/kilo-docs/pages/contributing/index.md @@ -6,7 +6,7 @@ description: "Contribute to Kilo Code" # Contributing Overview {% callout type="info" %} -**New versions of the VS Code extension and CLI are being developed in [Kilo-Org/Kilo](https://github.com/Kilo-Org/Kilo)** (extension at `packages/kilo-vscode`, CLI at `packages/opencode`). If you're looking to contribute to the extension or CLI, please head over to that repository. +**New versions of the VS Code extension and CLI are being developed in [Kilo-Org/kilocode](https://github.com/Kilo-Org/kilocode)** (extension at `packages/kilo-vscode`, CLI at `packages/opencode`). If you're looking to contribute to the extension or CLI, please head over to that repository. {% /callout %} Kilo Code is an open-source project that welcomes contributions from developers of all skill levels. This guide will help you get started with contributing to Kilo Code, whether you're fixing bugs, adding features, improving documentation, or sharing custom modes. diff --git a/packages/kilo-docs/pages/customize/agents-md.md b/packages/kilo-docs/pages/customize/agents-md.md index cd34077e7a0..a3d19b9b65a 100644 --- a/packages/kilo-docs/pages/customize/agents-md.md +++ b/packages/kilo-docs/pages/customize/agents-md.md @@ -138,6 +138,35 @@ When you start a task in Kilo Code: ### Interaction with Other Rules +{% tabs %} +{% tab label="VSCode" %} + +In the new platform, AGENTS.md is loaded alongside other instruction sources. The CLI also supports `.claude/` and `.agents/` directories for compatibility with other tools. + +| Source | Scope | Location | Priority | +| ------------------------------------------------ | --------- | ------------------------------------------ | ---------------- | +| **Agent prompt** | Per-agent | `agent..prompt` in config | 1 (Highest) | +| **[Instructions](/docs/customize/custom-rules)** | Project | `instructions` key in project `kilo.jsonc` | 2 | +| **AGENTS.md** | Project | `AGENTS.md` at project root | 3 | +| **[Instructions](/docs/customize/custom-rules)** | Global | `instructions` key in global `kilo.jsonc` | 4 | +| **[Skills](/docs/customize/skills)** | Both | `.kilo/skills/`, config `skills` key | Loaded on demand | + +{% /tab %} +{% tab label="CLI" %} + +In the new platform, AGENTS.md is loaded alongside other instruction sources. The CLI also supports `.claude/` and `.agents/` directories for compatibility with other tools. + +| Source | Scope | Location | Priority | +| ------------------------------------------------ | --------- | ------------------------------------------ | ---------------- | +| **Agent prompt** | Per-agent | `agent..prompt` in config | 1 (Highest) | +| **[Instructions](/docs/customize/custom-rules)** | Project | `instructions` key in project `kilo.jsonc` | 2 | +| **AGENTS.md** | Project | `AGENTS.md` at project root | 3 | +| **[Instructions](/docs/customize/custom-rules)** | Global | `instructions` key in global `kilo.jsonc` | 4 | +| **[Skills](/docs/customize/skills)** | Both | `.kilo/skills/`, config `skills` key | Loaded on demand | + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + AGENTS.md works alongside Kilo Code's other configuration systems: | Feature | Scope | Location | Purpose | Priority | @@ -148,9 +177,37 @@ AGENTS.md works alongside Kilo Code's other configuration systems: | **[Global Custom Rules](/docs/customize/custom-rules)** | Global | `~/.kilocode/rules/` | Global Kilo Code rules | 4 | | **[Custom Instructions](/docs/customize/custom-instructions)** | Global | IDE settings | Personal preferences across all projects | 5 (Lowest) | +{% /tab %} +{% /tabs %} + ### Enabling/Disabling AGENTS.md -AGENTS.md support is **enabled by default** in Kilo Code. To disable it, edit `settings.json`: +{% tabs %} +{% tab label="VSCode" %} + +AGENTS.md is loaded automatically. To disable external skill directories (`.claude/skills/`, `.agents/skills/`), set the environment variable: + +```bash +export KILO_DISABLE_EXTERNAL_SKILLS=true +``` + +AGENTS.md itself cannot be individually disabled — it is always loaded if present. To override its instructions, use higher-priority sources like the `instructions` config key or agent-specific prompts. + +{% /tab %} +{% tab label="CLI" %} + +AGENTS.md is loaded automatically. To disable external skill directories (`.claude/skills/`, `.agents/skills/`), set the environment variable: + +```bash +export KILO_DISABLE_EXTERNAL_SKILLS=true +``` + +AGENTS.md itself cannot be individually disabled — it is always loaded if present. To override its instructions, use higher-priority sources like the `instructions` config key or agent-specific prompts. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + +AGENTS.md support is **enabled by default**. To disable it, edit `settings.json`: ```json { @@ -158,6 +215,9 @@ AGENTS.md support is **enabled by default** in Kilo Code. To disable it, edit `s } ``` +{% /tab %} +{% /tabs %} + ## Related Features - **[Custom Rules](/docs/customize/custom-rules)** - Kilo Code-specific rules with more control diff --git a/packages/kilo-docs/pages/customize/context/codebase-indexing.md b/packages/kilo-docs/pages/customize/context/codebase-indexing.md index ff6e1312f01..3f38b01a76d 100644 --- a/packages/kilo-docs/pages/customize/context/codebase-indexing.md +++ b/packages/kilo-docs/pages/customize/context/codebase-indexing.md @@ -1,6 +1,7 @@ --- title: "Codebase Indexing" description: "Index your codebase for improved AI understanding" +platform: legacy --- # Codebase Indexing diff --git a/packages/kilo-docs/pages/customize/context/context-condensing.md b/packages/kilo-docs/pages/customize/context/context-condensing.md index 9ab1a2d2a8b..3d010446f35 100644 --- a/packages/kilo-docs/pages/customize/context/context-condensing.md +++ b/packages/kilo-docs/pages/customize/context/context-condensing.md @@ -17,9 +17,142 @@ Every AI model has a maximum context window - a limit on how much text it can pr - Higher API costs due to increased token usage - Eventually hitting the context limit and being unable to continue +{% tabs %} +{% tab label="VSCode" %} + +## The Solution: Auto-Compaction + +The new platform uses a **Compaction** system to manage context automatically. When your conversation approaches the token limit, compaction kicks in and produces a structured summary that captures: + +- The overall goal of the session +- Key discoveries made along the way +- What has been accomplished so far +- Files that were modified + +This summary replaces the earlier conversation history, freeing up context window space while maintaining continuity in your work. + +## How Compaction Works + +### Automatic Compaction + +Compaction triggers automatically when the conversation reaches the `usableWindow` token threshold. The full conversation history is sent to a dedicated **compaction agent**, which produces a structured summary. This happens in the background without interrupting your workflow. + +### Context Pruning + +In addition to compaction, the system can **prune** old tool outputs to reclaim context space incrementally. Tool results older than a 40,000-token recency window are replaced with `"[Old tool result content cleared]"`. This is a lighter-weight mechanism that runs alongside full compaction. + +### Manual Compaction + +You can also trigger compaction manually: + +- **CLI TUI**: Press `c` to compact the current session +- **Extension Webview**: Send a `CompactRequest` message to trigger compaction + +{% callout type="info" %} +There is no `/condense` chat command on the new platform. Use the keybinding or message-based invocation instead. +{% /callout %} + +### The Compaction Process + +When compaction is triggered: + +1. **Threshold Check**: The system detects that context usage has reached the `usableWindow` limit +2. **Agent Summarization**: The full conversation history is sent to a dedicated compaction agent +3. **Structured Summary**: The agent produces a summary covering the goal, discoveries, accomplishments, and modified files +4. **Replacement**: The detailed history is replaced with the compacted summary +5. **Continuation**: You continue working with the freed-up context space + +## Configuration Options + +Compaction is configured in your `kilo.jsonc` file: + +```jsonc +{ + "compaction": { + "auto": true, // Enable or disable automatic compaction + "reserved": 4096, // Number of tokens to reserve (keep free) after compaction + "prune": true, // Enable pruning of old tool outputs beyond the recency window + }, +} +``` + +| Option | Type | Description | +| --------------------- | ------- | ------------------------------------------------------------------------ | +| `compaction.auto` | boolean | Enable or disable automatic compaction when the context threshold is hit | +| `compaction.reserved` | number | Number of tokens to reserve after compaction | +| `compaction.prune` | boolean | Enable pruning of old tool outputs outside the 40K token recency window | + +{% /tab %} +{% tab label="CLI" %} + +## The Solution: Auto-Compaction + +The new platform uses a **Compaction** system to manage context automatically. When your conversation approaches the token limit, compaction kicks in and produces a structured summary that captures: + +- The overall goal of the session +- Key discoveries made along the way +- What has been accomplished so far +- Files that were modified + +This summary replaces the earlier conversation history, freeing up context window space while maintaining continuity in your work. + +## How Compaction Works + +### Automatic Compaction + +Compaction triggers automatically when the conversation reaches the `usableWindow` token threshold. The full conversation history is sent to a dedicated **compaction agent**, which produces a structured summary. This happens in the background without interrupting your workflow. + +### Context Pruning + +In addition to compaction, the system can **prune** old tool outputs to reclaim context space incrementally. Tool results older than a 40,000-token recency window are replaced with `"[Old tool result content cleared]"`. This is a lighter-weight mechanism that runs alongside full compaction. + +### Manual Compaction + +You can also trigger compaction manually: + +- **CLI TUI**: Press `c` to compact the current session +- **Extension Webview**: Send a `CompactRequest` message to trigger compaction + +{% callout type="info" %} +There is no `/condense` chat command on the new platform. Use the keybinding or message-based invocation instead. +{% /callout %} + +### The Compaction Process + +When compaction is triggered: + +1. **Threshold Check**: The system detects that context usage has reached the `usableWindow` limit +2. **Agent Summarization**: The full conversation history is sent to a dedicated compaction agent +3. **Structured Summary**: The agent produces a summary covering the goal, discoveries, accomplishments, and modified files +4. **Replacement**: The detailed history is replaced with the compacted summary +5. **Continuation**: You continue working with the freed-up context space + +## Configuration Options + +Compaction is configured in your `kilo.jsonc` file: + +```jsonc +{ + "compaction": { + "auto": true, // Enable or disable automatic compaction + "reserved": 4096, // Number of tokens to reserve (keep free) after compaction + "prune": true, // Enable pruning of old tool outputs beyond the recency window + }, +} +``` + +| Option | Type | Description | +| --------------------- | ------- | ------------------------------------------------------------------------ | +| `compaction.auto` | boolean | Enable or disable automatic compaction when the context threshold is hit | +| `compaction.reserved` | number | Number of tokens to reserve after compaction | +| `compaction.prune` | boolean | Enable pruning of old tool outputs outside the 40K token recency window | + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + ## The Solution: Intelligent Condensing -Context Condensing solves this problem by creating a concise summary of your conversation that captures: +**Context Condensing** solves this problem by creating a concise summary of your conversation that captures: - The original task or goal - Key decisions made during the session @@ -63,20 +196,6 @@ Context Condensing uses an AI model to generate summaries. You can configure whi You can configure context condensing thresholds and behavior on a per-profile basis, allowing different settings for different projects or use cases. -## Best Practices - -### When to Condense - -- **Long sessions**: If you've been working for an extended period on a complex task -- **Before major transitions**: When switching to a different aspect of your project -- **When prompted**: When Kilo Code suggests condensing due to context limits - -### Maintaining Context Quality - -- **Be specific in your initial task**: A clear task description helps create better summaries -- **Use AGENTS.md**: Combine with [AGENTS.md](/docs/customize/agents-md) for persistent project context that doesn't need to be condensed -- **Review the summary**: After condensing, the summary is visible in your chat history - ## Troubleshooting ### Context Condensing Error @@ -95,6 +214,23 @@ If the condensed summary doesn't capture important details: - Use clear, specific language when describing your tasks - Important context can be reinforced after condensing by reminding Kilo Code of key details +{% /tab %} +{% /tabs %} + +## Best Practices + +### When to Condense + +- **Long sessions**: If you've been working for an extended period on a complex task +- **Before major transitions**: When switching to a different aspect of your project +- **When prompted**: When Kilo Code suggests condensing or compaction due to context limits + +### Maintaining Context Quality + +- **Be specific in your initial task**: A clear task description helps create better summaries +- **Use AGENTS.md**: Combine with [AGENTS.md](/docs/customize/agents-md) for persistent project context that doesn't need to be condensed +- **Review the summary**: After condensing or compaction, the summary is visible in your chat history + ## Related Features - [AGENTS.md](/docs/customize/agents-md) - Persistent context storage across sessions diff --git a/packages/kilo-docs/pages/customize/context/kilocodeignore.md b/packages/kilo-docs/pages/customize/context/kilocodeignore.md index c929aab46ff..25e979374c2 100644 --- a/packages/kilo-docs/pages/customize/context/kilocodeignore.md +++ b/packages/kilo-docs/pages/customize/context/kilocodeignore.md @@ -13,6 +13,61 @@ If no `.kilocodeignore` file exists, Kilo Code can access all files in the works ## Quick Start +{% tabs %} +{% tab label="VSCode" %} + +The primary mechanism for controlling file access is the **permission system** in `kilo.jsonc`. You define tool-level permissions with glob patterns: + +```json +{ + "permission": { + "read": { "*.env": "deny", "*": "allow" }, + "edit": { "dist/**": "deny", "*": "allow" } + } +} +``` + +If you have an existing `.kilocodeignore` file, it is still supported. The **IgnoreMigrator** automatically converts `.kilocodeignore` patterns into permission `deny` rules on `read` and `edit` tools, so your existing rules continue to work without manual changes. + +You can also exclude paths from the file watcher separately using `watcher.ignore`: + +```json +{ + "watcher": { + "ignore": ["tmp/**", "logs/**"] + } +} +``` + +{% /tab %} +{% tab label="CLI" %} + +The primary mechanism for controlling file access is the **permission system** in `kilo.jsonc`. You define tool-level permissions with glob patterns: + +```json +{ + "permission": { + "read": { "*.env": "deny", "*": "allow" }, + "edit": { "dist/**": "deny", "*": "allow" } + } +} +``` + +If you have an existing `.kilocodeignore` file, it is still supported. The **IgnoreMigrator** automatically converts `.kilocodeignore` patterns into permission `deny` rules on `read` and `edit` tools, so your existing rules continue to work without manual changes. + +You can also exclude paths from the file watcher separately using `watcher.ignore`: + +```json +{ + "watcher": { + "ignore": ["tmp/**", "logs/**"] + } +} +``` + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + 1. Create a `.kilocodeignore` file at the root of your project. 2. Add patterns for files or folders you want Kilo Code to avoid. 3. Save the file. Kilo Code will pick up the changes automatically. @@ -34,6 +89,9 @@ coverage/ !secrets/README.md ``` +{% /tab %} +{% /tabs %} + ## Pattern Rules `.kilocodeignore` follows the same rules as `.gitignore`: @@ -47,6 +105,35 @@ Patterns are evaluated relative to the workspace root. ## What It Affects +{% tabs %} +{% tab label="VSCode" %} + +File access is controlled through **permission-based access control**. Each tool (`read`, `edit`, `glob`, `grep`, `write`, `bash`, etc.) has its own permission rules evaluated against glob patterns. + +In addition to your explicit permission rules: + +- **Hardcoded directory ignores** — 27 directories are always skipped (e.g. `node_modules`, `.git`, `dist`, `build`, `.cache`, `__pycache__`, `vendor`, and others). +- **Hardcoded file pattern ignores** — 11 file patterns are always skipped (e.g. lock files, binary artifacts). +- **`.gitignore` and `.ignore` files** are also respected when listing and searching files. + +If a file is denied by a permission rule, the tool will report that access was blocked. + +{% /tab %} +{% tab label="CLI" %} + +File access is controlled through **permission-based access control**. Each tool (`read`, `edit`, `glob`, `grep`, `write`, `bash`, etc.) has its own permission rules evaluated against glob patterns. + +In addition to your explicit permission rules: + +- **Hardcoded directory ignores** — 27 directories are always skipped (e.g. `node_modules`, `.git`, `dist`, `build`, `.cache`, `__pycache__`, `vendor`, and others). +- **Hardcoded file pattern ignores** — 11 file patterns are always skipped (e.g. lock files, binary artifacts). +- **`.gitignore` and `.ignore` files** are also respected when listing and searching files. + +If a file is denied by a permission rule, the tool will report that access was blocked. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + Kilo Code checks `.kilocodeignore` before accessing files in tools like: - [`read_file`](/docs/automate/tools/read-file) @@ -58,17 +145,109 @@ Kilo Code checks `.kilocodeignore` before accessing files in tools like: If a file is blocked, Kilo Code will return an "access denied" message and suggest updating your `.kilocodeignore` rules. -## Visibility in Lists +{% /tab %} +{% /tabs %} + +## Configuration Details + +{% tabs %} +{% tab label="VSCode" %} + +### Permission Rules + +Permission rules are defined per-tool in `kilo.jsonc`. Patterns are evaluated in order — the last matching rule wins: + +```json +{ + "permission": { + "read": { + "*.env": "deny", + "secrets/**": "deny", + "*": "allow" + }, + "edit": { + "dist/**": "deny", + "*.lock": "deny", + "*": "allow" + } + } +} +``` + +### Migrating from .kilocodeignore + +If you already have a `.kilocodeignore` file, you don't need to do anything — the IgnoreMigrator reads your existing patterns and applies them as `deny` rules on `read` and `edit` tools automatically. You can optionally move your rules into `kilo.jsonc` for more granular control (e.g. denying edits but allowing reads). + +### File Watcher Exclusions + +The `watcher.ignore` setting controls which paths the file watcher skips. This is separate from tool permissions and only affects change detection: + +```json +{ + "watcher": { + "ignore": ["tmp/**", "logs/**", ".build/**"] + } +} +``` + +{% /tab %} +{% tab label="CLI" %} + +### Permission Rules + +Permission rules are defined per-tool in `kilo.jsonc`. Patterns are evaluated in order — the last matching rule wins: + +```json +{ + "permission": { + "read": { + "*.env": "deny", + "secrets/**": "deny", + "*": "allow" + }, + "edit": { + "dist/**": "deny", + "*.lock": "deny", + "*": "allow" + } + } +} +``` + +### Migrating from .kilocodeignore + +If you already have a `.kilocodeignore` file, you don't need to do anything — the IgnoreMigrator reads your existing patterns and applies them as `deny` rules on `read` and `edit` tools automatically. You can optionally move your rules into `kilo.jsonc` for more granular control (e.g. denying edits but allowing reads). + +### File Watcher Exclusions + +The `watcher.ignore` setting controls which paths the file watcher skips. This is separate from tool permissions and only affects change detection: + +```json +{ + "watcher": { + "ignore": ["tmp/**", "logs/**", ".build/**"] + } +} +``` + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + +### Visibility in Lists By default, ignored files are hidden from file lists. You can show them with a lock icon by enabling: Settings -> Context -> **Show .kilocodeignore'd files in lists and searches** +{% /tab %} +{% /tabs %} + ## Checkpoints vs .kilocodeignore -Checkpoint tracking is separate from file access rules. Files blocked by `.kilocodeignore` can still be checkpointed if they are not excluded by `.gitignore`. See the [Checkpoints](/docs/code-with-ai/features/checkpoints) documentation for details. +Checkpoint tracking is separate from file access rules. Files blocked by `.kilocodeignore` or permission rules can still be checkpointed if they are not excluded by `.gitignore`. See the [Checkpoints](/docs/code-with-ai/features/checkpoints) documentation for details. ## Troubleshooting -- **Kilo can't access a file you want:** Remove or narrow the matching rule in `.kilocodeignore`. -- **A file still appears in lists:** Check the setting that shows ignored files in lists and searches. +- **Kilo can't access a file you want:** Remove or narrow the matching rule in `.kilocodeignore` (legacy) or adjust the permission rules in `kilo.jsonc` (VSCode extension & CLI). +- **A file still appears in lists:** In the legacy extension, check the setting that shows ignored files in lists and searches. In the extension & CLI, verify your permission and watcher ignore configuration. +- **`.kilocodeignore` patterns not working in the new platform:** Ensure the file is at the workspace root. The IgnoreMigrator reads it automatically — check that your patterns use valid `.gitignore` syntax. diff --git a/packages/kilo-docs/pages/customize/context/large-projects.md b/packages/kilo-docs/pages/customize/context/large-projects.md index a0aab196f0a..101fb1621b6 100644 --- a/packages/kilo-docs/pages/customize/context/large-projects.md +++ b/packages/kilo-docs/pages/customize/context/large-projects.md @@ -1,6 +1,7 @@ --- title: "Large Projects" description: "Best practices for using Kilo Code with large codebases" +platform: legacy --- # Working with Large Projects diff --git a/packages/kilo-docs/pages/customize/custom-instructions.md b/packages/kilo-docs/pages/customize/custom-instructions.md index b7ea7b7d8fb..c46dda3120e 100644 --- a/packages/kilo-docs/pages/customize/custom-instructions.md +++ b/packages/kilo-docs/pages/customize/custom-instructions.md @@ -5,18 +5,162 @@ description: "Provide custom instructions to guide Kilo Code" # Custom Instructions -Custom Instructions allow you to personalize how Kilo Code behaves, providing specific guidance that shapes responses, coding style, and decision-making processes. +Custom Instructions allow you to personalize how Kilo Code behaves, providing specific guidance that shapes responses, coding style, and decision-making processes. Both the **VSCode** and **CLI** versions support custom instructions, though the mechanisms differ. ## What Are Custom Instructions? Custom Instructions define specific Extension behaviors, preferences, and constraints beyond Kilo's basic role definition. Examples include coding style, documentation standards, testing requirements, and workflow guidelines. +{% tabs %} +{% tab label="VSCode" %} + +The extension provides multiple layers of instruction configuration — from per-agent prompts in the Settings UI to auto-discovered files in your project and global config. + +## Per-Agent Prompts + +Each agent can have its own custom prompt configured through the settings UI: + +1. Open **Settings → Agent Behaviour → Agents** subtab +2. Select the agent you want to customize +3. Enter your instructions in the markdown text area under the agent's `prompt` field +4. Save your changes + +These prompts are injected into the agent's system prompt and apply across all sessions using that agent. + +## Instruction Files + +Kilo automatically discovers instruction files at your project root and in parent directories (via `findUp`). The following filenames are recognized: + +- **`AGENTS.md`** — The primary instruction file for Kilo +- **`CLAUDE.md`** — Also supported for compatibility +- **`CONTEXT.md`** — Additional project context + +Place any of these files at your project root to provide project-wide instructions to the agent. + +### Global Instructions + +For instructions that apply across all your projects, place an `AGENTS.md` file in your global config directory: + +- **Kilo:** `~/.config/kilo/AGENTS.md` +- **Claude-compatible:** `~/.claude/CLAUDE.md` + +Project-level instructions are loaded before global instructions and apply to every session. + +### Per-Directory Instructions + +You can place `AGENTS.md` files in any subdirectory of your project. These are loaded dynamically — when the agent's Read tool accesses a file in that directory, the corresponding `AGENTS.md` is discovered and its contents are injected into the conversation as `` tags. + +This is useful for providing context-specific guidance for different parts of a monorepo or project. + +## Additional Instruction Sources + +The `instructions` key in `kilo.jsonc` accepts an array of paths, globs, or URLs pointing to additional instruction files. You can manage these in **Settings → Agent Behaviour → Rules** subtab. + +```yaml +# Examples of instruction sources +instructions: + - ./docs/coding-standards.md + - ./teams/frontend-rules.md + - https://example.com/team-instructions.md +``` + +{% callout type="info" title="URL-Based Instructions" %} +URL-based instruction sources are fetched at session start with a 5-second timeout. If the URL is unreachable, the instruction source is silently skipped. +{% /callout %} + +## Legacy `.kilocoderules` Support + +If your project contains `.kilocoderules` files from the VSCode extension, these are still loaded via auto-migration. However, migrating to `AGENTS.md` is recommended for new projects. + +{% /tab %} +{% tab label="CLI" %} + +The CLI provides multiple layers of instruction configuration — from per-agent prompts in agent definition files to auto-discovered files in your project and global config. + +## Per-Agent Prompts + +Each agent can have its own custom prompt defined in its `.md` file (the markdown body) or via the `agent..prompt` key in `kilo.jsonc`: + +```jsonc +// kilo.jsonc +{ + "agent": { + "code": { + "prompt": "You are a Python specialist. Follow PEP8 strictly.", + }, + }, +} +``` + +Or as the markdown body in `.kilo/agents/code.md`: + +```markdown +--- +description: Python specialist +--- + +You are a Python specialist. Follow PEP8 strictly. +``` + +These prompts are injected into the agent's system prompt and apply across all sessions using that agent. + +## Instruction Files + +Kilo automatically discovers instruction files at your project root and in parent directories (via `findUp`). The following filenames are recognized: + +- **`AGENTS.md`** — The primary instruction file for Kilo +- **`CLAUDE.md`** — Also supported for compatibility +- **`CONTEXT.md`** — Additional project context + +Place any of these files at your project root to provide project-wide instructions to the agent. + +### Global Instructions + +For instructions that apply across all your projects, place an `AGENTS.md` file in your global config directory: + +- **Kilo:** `~/.config/kilo/AGENTS.md` +- **Claude-compatible:** `~/.claude/CLAUDE.md` + +Project-level instructions are loaded before global instructions and apply to every session. + +### Per-Directory Instructions + +You can place `AGENTS.md` files in any subdirectory of your project. These are loaded dynamically — when the agent's Read tool accesses a file in that directory, the corresponding `AGENTS.md` is discovered and its contents are injected into the conversation as `` tags. + +This is useful for providing context-specific guidance for different parts of a monorepo or project. + +## Additional Instruction Sources + +The `instructions` key in `kilo.jsonc` accepts an array of paths, globs, or URLs pointing to additional instruction files. Configure these in your `kilo.jsonc`: + +```jsonc +// kilo.jsonc +{ + "instructions": [ + "./docs/coding-standards.md", + "./teams/frontend-rules.md", + "https://example.com/team-instructions.md", + ], +} +``` + +{% callout type="info" title="URL-Based Instructions" %} +URL-based instruction sources are fetched at session start with a 5-second timeout. If the URL is unreachable, the instruction source is silently skipped. +{% /callout %} + +## Legacy `.kilocoderules` Support + +If your project contains `.kilocoderules` files from the VSCode extension, these are still loaded via auto-migration. However, migrating to `AGENTS.md` is recommended for new projects. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + +## Setting Custom Instructions + {% callout type="info" title="Custom Instructions vs Rules" %} Custom Instructions are IDE-wide and are applied across all workspaces and maintain your preferences regardless of which project you're working on. Unlike Instructions, [Custom Rules](/docs/customize/custom-rules) are project specific and allow you to setup workspace-based ruleset. {% /callout %} -## Setting Custom Instructions - **How to set them:** {% image src="/docs/img/custom-instructions/custom-instructions.png" alt="Kilo Code Modes tab showing global custom instructions interface" width="600" caption="Kilo Code Modes tab showing global custom instructions interface" /%} @@ -37,20 +181,24 @@ Mode-specific instructions can be set using the Modes Tab * **Save Changes:** Click "Done" to save your changes {% callout type="info" title="Global Mode Rules" %} - If the mode itself is global (not workspace-specific), any custom instructions you set for it will also apply globally for that mode across all workspaces. - {% /callout %} -## Mode-Specific Instructions from Files +If the mode itself is global (not workspace-specific), any custom instructions you set for it will also apply globally for that mode across all workspaces. +{% /callout %} + +#### Mode-Specific Instructions from Files For version-controlled mode instructions, use the mode rules file paths documented in [Custom Modes](/docs/customize/custom-modes#mode-specific-instructions-via-filesdirectories): - Preferred: `.kilo/rules-{mode-slug}/` (directory) -- Fallback: `.kilorules-{mode-slug}` (single file) +- Fallback: `.kilocoderules-{mode-slug}` (single file) {% callout type="info" title="Legacy Naming Note" %} -Older naming like `.clinerules-{mode-slug}` is not the recommended path for current Kilo mode-specific instructions. +Only `.kilocoderules-{mode-slug}` is recognized as the legacy fallback. Older naming like `.clinerules-{mode-slug}` is not supported. {% /callout %} +{% /tab %} +{% /tabs %} + ## Related Features - [Custom Modes](/docs/customize/custom-modes) diff --git a/packages/kilo-docs/pages/customize/custom-modes.md b/packages/kilo-docs/pages/customize/custom-modes.md index 86bcc17a2c4..f75a4a6b9c6 100644 --- a/packages/kilo-docs/pages/customize/custom-modes.md +++ b/packages/kilo-docs/pages/customize/custom-modes.md @@ -5,11 +5,11 @@ description: "Create and configure custom modes in Kilo Code" # Custom Modes -Kilo Code allows you to create **custom modes** to tailor Kilo's behavior to specific tasks or workflows. Custom modes can be either **global** (available across all projects) or **project-specific** (defined within a single project). +Kilo Code allows you to create **custom modes** (also called **agents**) to tailor Kilo's behavior to specific tasks or workflows. Custom modes can be either **global** (available across all projects) or **project-specific** (defined within a single project). -## Sticky Models for Efficient Workflow - -Each mode—including custom ones—features **Sticky Models**. This means Kilo Code automatically remembers and selects the last model you used with a particular mode. This lets you assign different preferred models to different tasks without constant reconfiguration, as Kilo switches between models when you change modes. +{% callout type="info" %} +The current VS Code extension (built on the Kilo CLI) uses **agent Markdown files** to define custom modes. The legacy extension used `custom_modes.yaml` / `.kilocodemodes`. See the tabs below for the relevant approach. +{% /callout %} ## Why Use Custom Modes? @@ -18,6 +18,443 @@ Each mode—including custom ones—features **Sticky Models**. This means Kilo - **Experimentation:** Safely experiment with different prompts and configurations without affecting other modes - **Team Collaboration:** Share custom modes with your team to standardize workflows +{% tabs %} +{% tab label="VSCode" %} + +In the VSCode extension and CLI, custom behavioral profiles are called **agents** instead of modes. Agents are defined as Markdown files with YAML frontmatter or as entries in the `agent` key of your config file. + +## What's Included in a Custom Agent? + +| Property | Description | +| --------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| **name** (filename) | The agent's identifier, derived from the `.md` filename (e.g., `docs-writer.md` creates an agent named `docs-writer`) | +| **description** | A short summary displayed in the agent picker and used by the orchestrator for delegation | +| **model** | Pin a specific model in `provider/model` format (e.g., `anthropic/claude-sonnet-4-20250514`) | +| **prompt** (markdown body) | The system prompt text — the markdown body of the file, injected into the agent's system prompt | +| **mode** | Role classification: `primary` (user-selectable), `subagent` (only invoked by other agents), or `all` (both) | +| **permission** | Per-agent permission overrides controlling which tools the agent can use (e.g., deny `edit`, `bash`) | +| **color** | Hex color (`#FF5733`) or theme keyword (`primary`, `accent`, `warning`, etc.) for the agent picker UI | +| **steps** | Maximum agentic iterations before forcing a text-only response | +| **temperature** / **top_p** | Sampling parameters for the agent's model | +| **variant** | Default model variant | +| **hidden** | If `true`, the agent is hidden from the UI (only meaningful for subagents) | +| **disable** | If `true`, removes the agent entirely | + +## Methods for Creating and Configuring Agents + +### 1. Ask Kilo! (Recommended) + +Ask Kilo to create an agent for you: + +``` +Create a new agent called "docs-writer" that can only read files and edit Markdown files. +``` + +Kilo will generate the agent definition and write it to `.kilo/agent/` in your project. + +### 2. Using the Settings UI + +You can manage agents through the **Settings → Agent Behaviour → Agents** subtab in the extension. This lets you view, create, and edit agent configurations — including the agent's prompt, model, permissions, and other properties. + +### 3. Markdown Files with YAML Frontmatter + +Create `.md` files in any of these directories: + +``` +.kilo/agents/my-agent.md +.kilo/agent/my-agent.md +.opencode/agents/my-agent.md +``` + +For global agents, place files in your global config directory: + +``` +~/.config/kilo/agent/my-agent.md +``` + +The **filename** (minus `.md`) becomes the agent name. Nested directories create namespaced names (e.g., `agents/backend/sql.md` becomes agent `backend/sql`). + +**Example agent file** (`.kilo/agents/docs-writer.md`): + +```markdown +--- +description: Specialized for writing and editing technical documentation +mode: primary +color: "#10B981" +permission: + edit: + "*.md": "allow" + "*": "deny" + bash: deny +--- + +You are a technical documentation specialist. Your expertise includes: + +- Writing clear, well-structured documentation +- Following markdown best practices +- Creating helpful code examples + +Focus on clarity and completeness. Only edit Markdown files. +``` + +### 4. Config File (`kilo.jsonc`) + +Define agents under the `agent` key in your project's `kilo.jsonc`: + +```jsonc +{ + "agent": { + "docs-writer": { + "description": "Specialized for writing and editing technical documentation", + "mode": "primary", + "color": "#10B981", + "prompt": "You are a technical documentation specialist...", + "permission": { + "edit": { + "*.md": "allow", + "*": "deny", + }, + "bash": "deny", + }, + }, + // Override a built-in agent + "code": { + "model": "anthropic/claude-sonnet-4-20250514", + "temperature": 0.3, + }, + }, +} +``` + +## Agent Property Reference + +### `mode` + +Controls where the agent appears: + +| Value | Behavior | +| ---------- | -------------------------------------------------------------------------------------- | +| `primary` | Shown in the agent picker — the user can select it directly | +| `subagent` | Only invokable by other agents via the `task` tool | +| `all` | Available both as a top-level pick and as a subagent (default for user-defined agents) | + +### `permission` + +An ordered set of rules controlling tool access. Permissions support three actions: `allow`, `deny`, and `ask` (prompt the user). You can use glob patterns to scope rules to specific files or commands: + +```yaml +permission: + edit: + "*.md": "allow" + "*": "deny" + bash: deny + read: allow +``` + +Known permission types include: `read`, `edit`, `bash`, `glob`, `grep`, `list`, `task`, `webfetch`, `websearch`, `codesearch`, `todowrite`, `todoread`, and more. + +### `model` + +Pin a specific model using the `provider/model` format: + +```yaml +model: anthropic/claude-sonnet-4-20250514 +``` + +### `steps` + +Limits the number of agentic iterations (tool call rounds) before the agent is forced to respond with text only. Useful for preventing runaway agents: + +```yaml +steps: 25 +``` + +## Configuration Precedence + +Agent configurations merge from lowest to highest priority: + +1. Built-in (native) agent defaults +2. Global config (`~/.config/kilo/kilo.jsonc`) +3. Project config (`kilo.jsonc` at project root) +4. `.kilo/` / `.opencode/` directory configs and agent `.md` files +5. Environment variable overrides (`KILO_CONFIG_CONTENT`) + +When the same agent name appears at multiple levels, properties are merged (not replaced wholesale), so you can override just a model or temperature without redefining the entire agent. + +## Overriding Built-in Agents + +Override any built-in agent (**code**, **plan**, **debug**, **ask**, **orchestrator**, **explore**, **general**) by defining an agent with the same name: + +```jsonc +// kilo.jsonc — override the built-in "code" agent +{ + "agent": { + "code": { + "model": "openai/gpt-4o", + "temperature": 0.2, + "permission": { + "edit": { + "*.py": "allow", + "*": "deny", + }, + }, + }, + }, +} +``` + +Or as a `.md` file (`.kilo/agents/code.md`): + +```markdown +--- +model: openai/gpt-4o +temperature: 0.2 +permission: + edit: + "*.py": "allow" + "*": "deny" +--- + +You are a Python specialist. Only edit Python files. +``` + +## Migration from VSCode Extension Modes + +If you have existing `.kilocodemodes` or `custom_modes.yaml` files from the VSCode extension, the extension automatically migrates them on startup. The migration converts: + +- `slug` to the agent name (key) +- `roleDefinition` + `customInstructions` to `prompt` +- `groups` (e.g., `["read", "edit", "browser"]`) to `permission` rules +- `whenToUse` / `description` to `description` +- Mode is set to `primary` + +Default legacy mode slugs (`code`, `build`, `architect`, `ask`, `debug`, `orchestrator`) are skipped during migration since they map to built-in agents (`build` → `code`, `architect` → `plan`). + +{% /tab %} +{% tab label="CLI" %} + +In the CLI, custom behavioral profiles are called **agents** instead of modes. Agents are defined as Markdown files with YAML frontmatter or as entries in the `agent` key of your config file. + +## What's Included in a Custom Agent? + +| Property | Description | +| --------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| **name** (filename) | The agent's identifier, derived from the `.md` filename (e.g., `docs-writer.md` creates an agent named `docs-writer`) | +| **description** | A short summary displayed in the agent picker and used by the orchestrator for delegation | +| **model** | Pin a specific model in `provider/model` format (e.g., `anthropic/claude-sonnet-4-20250514`) | +| **prompt** (markdown body) | The system prompt text — the markdown body of the file, injected into the agent's system prompt | +| **mode** | Role classification: `primary` (user-selectable), `subagent` (only invoked by other agents), or `all` (both) | +| **permission** | Per-agent permission overrides controlling which tools the agent can use (e.g., deny `edit`, `bash`) | +| **color** | Hex color (`#FF5733`) or theme keyword (`primary`, `accent`, `warning`, etc.) for the agent picker UI | +| **steps** | Maximum agentic iterations before forcing a text-only response | +| **temperature** / **top_p** | Sampling parameters for the agent's model | +| **variant** | Default model variant | +| **hidden** | If `true`, the agent is hidden from the UI (only meaningful for subagents) | +| **disable** | If `true`, removes the agent entirely | + +## Methods for Creating and Configuring Agents + +### 1. Ask Kilo! (Recommended) + +Ask Kilo to create an agent for you: + +``` +Create a new agent called "docs-writer" that can only read files and edit Markdown files. +``` + +Kilo will generate the agent definition and write it to `.kilo/agent/` in your project. + +### 2. Using `kilo agent create` + +The CLI provides an interactive command: + +```bash +kilo agent create +``` + +This walks you through selecting a description, mode, and tools, then uses an LLM to generate the agent's system prompt and writes a `.md` file with YAML frontmatter. + +### 3. Markdown Files with YAML Frontmatter + +Create `.md` files in any of these directories: + +``` +.kilo/agents/my-agent.md +.kilo/agent/my-agent.md +.opencode/agents/my-agent.md +``` + +For global agents, place files in your global config directory: + +``` +~/.config/kilo/agent/my-agent.md +``` + +The **filename** (minus `.md`) becomes the agent name. Nested directories create namespaced names (e.g., `agents/backend/sql.md` becomes agent `backend/sql`). + +**Example agent file** (`.kilo/agents/docs-writer.md`): + +```markdown +--- +description: Specialized for writing and editing technical documentation +mode: primary +color: "#10B981" +permission: + edit: + "*.md": "allow" + "*": "deny" + bash: deny +--- + +You are a technical documentation specialist. Your expertise includes: + +- Writing clear, well-structured documentation +- Following markdown best practices +- Creating helpful code examples + +Focus on clarity and completeness. Only edit Markdown files. +``` + +### 4. Config File (`kilo.jsonc`) + +Define agents under the `agent` key in your project's `kilo.jsonc`: + +```jsonc +{ + "agent": { + "docs-writer": { + "description": "Specialized for writing and editing technical documentation", + "mode": "primary", + "color": "#10B981", + "prompt": "You are a technical documentation specialist...", + "permission": { + "edit": { + "*.md": "allow", + "*": "deny", + }, + "bash": "deny", + }, + }, + // Override a built-in agent + "code": { + "model": "anthropic/claude-sonnet-4-20250514", + "temperature": 0.3, + }, + }, +} +``` + +## Agent Property Reference + +### `mode` + +Controls where the agent appears: + +| Value | Behavior | +| ---------- | -------------------------------------------------------------------------------------- | +| `primary` | Shown in the agent picker — the user can select it directly | +| `subagent` | Only invokable by other agents via the `task` tool | +| `all` | Available both as a top-level pick and as a subagent (default for user-defined agents) | + +### `permission` + +An ordered set of rules controlling tool access. Permissions support three actions: `allow`, `deny`, and `ask` (prompt the user). You can use glob patterns to scope rules to specific files or commands: + +```yaml +permission: + edit: + "*.md": "allow" + "*": "deny" + bash: deny + read: allow +``` + +Known permission types include: `read`, `edit`, `bash`, `glob`, `grep`, `list`, `task`, `webfetch`, `websearch`, `codesearch`, `todowrite`, `todoread`, and more. + +### `model` + +Pin a specific model using the `provider/model` format: + +```yaml +model: anthropic/claude-sonnet-4-20250514 +``` + +### `steps` + +Limits the number of agentic iterations (tool call rounds) before the agent is forced to respond with text only. Useful for preventing runaway agents: + +```yaml +steps: 25 +``` + +## Configuration Precedence + +Agent configurations merge from lowest to highest priority: + +1. Built-in (native) agent defaults +2. Global config (`~/.config/kilo/kilo.jsonc`) +3. Project config (`kilo.jsonc` at project root) +4. `.kilo/` / `.opencode/` directory configs and agent `.md` files +5. Environment variable overrides (`KILO_CONFIG_CONTENT`) + +When the same agent name appears at multiple levels, properties are merged (not replaced wholesale), so you can override just a model or temperature without redefining the entire agent. + +## Overriding Built-in Agents + +Override any built-in agent (**code**, **plan**, **debug**, **ask**, **orchestrator**, **explore**, **general**) by defining an agent with the same name: + +```jsonc +// kilo.jsonc — override the built-in "code" agent +{ + "agent": { + "code": { + "model": "openai/gpt-4o", + "temperature": 0.2, + "permission": { + "edit": { + "*.py": "allow", + "*": "deny", + }, + }, + }, + }, +} +``` + +Or as a `.md` file (`.kilo/agents/code.md`): + +```markdown +--- +model: openai/gpt-4o +temperature: 0.2 +permission: + edit: + "*.py": "allow" + "*": "deny" +--- + +You are a Python specialist. Only edit Python files. +``` + +## Migration from VSCode Extension Modes + +If you have existing `.kilocodemodes` or `custom_modes.yaml` files from the VSCode extension, the CLI automatically migrates them on startup. The migration converts: + +- `slug` to the agent name (key) +- `roleDefinition` + `customInstructions` to `prompt` +- `groups` (e.g., `["read", "edit", "browser"]`) to `permission` rules +- `whenToUse` / `description` to `description` +- Mode is set to `primary` + +Default legacy mode slugs (`code`, `build`, `architect`, `ask`, `debug`, `orchestrator`) are skipped during migration since they map to built-in agents (`build` → `code`, `architect` → `plan`). + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + +## Sticky Models for Efficient Workflow + +Each mode—including custom ones—features **Sticky Models**. This means Kilo Code automatically remembers and selects the last model you used with a particular mode. This lets you assign different preferred models to different tasks without constant reconfiguration, as Kilo switches between models when you change modes. + {% callout type="tip" %} **Keep custom modes on track:** Limit the types of files that they're allowed to edit using the `fileRegex` option in the `groups` configuration. This prevents modes from accidentally modifying files outside their intended scope. {% /callout %} @@ -89,6 +526,57 @@ When importing modes, you can change the slug in the exported YAML file before i ## Methods for Creating and Configuring Custom Modes +{% tabs %} +{% tab label="VSCode" %} + +Custom agents are defined as Markdown files with optional YAML frontmatter. You can place them in: + +- **Project agents:** `.kilo/agents/*.md` (or `.opencode/agents/*.md`) +- **Global agents:** `~/.config/kilo/agents/*.md` + +### Agent File Format + +```markdown +--- +model: anthropic/claude-3-5-sonnet-20241022 +description: A specialized agent for writing documentation +mode: primary +--- + +You are a technical writer specializing in clear, concise documentation. +Focus on clarity, completeness, and consistent formatting. +``` + +**YAML frontmatter fields:** + +| Field | Description | +| ------------- | ----------------------------------------------------------------------------- | +| `model` | Override the default model for this agent | +| `description` | Short description shown in the agent selector | +| `mode` | `"primary"` (user-selectable), `"subagent"` (invoked by AI only), or `"all"` | +| `permission` | Tool permission overrides (same format as the global `permission` config key) | +| `temperature` | Model temperature override | +| `top_p` | Model top_p override | + +The filename (without `.md`) becomes the agent's slug and display name. + +### Installing via Marketplace + +You can also install community-contributed agents from the **Marketplace** tab in the extension sidebar. + +### Ask Kilo! (Recommended) + +You can also have Kilo create an agent file for you. For example: + +``` +Create a new agent called "Documentation Writer". It should only be able to read files and write Markdown files. +``` + +Kilo will create the appropriate `.kilo/agents/docs-writer.md` file with the right frontmatter. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + You can create and configure custom modes in several ways: ### 1. Ask Kilo! (Recommended) @@ -135,8 +623,6 @@ If you see both YAML and JSON mode files, this is usually from legacy configurat YAML is now the preferred format for defining custom modes due to better readability, comment support, and cleaner multi-line strings. -### YAML Example - ```yaml customModes: - slug: docs-writer @@ -388,9 +874,46 @@ customModes: - command ``` +{% /tab %} +{% /tabs %} + ## Understanding Regex in Custom Modes -Regular expressions (`fileRegex`) offer fine-grained control over file editing permissions. +{% tabs %} +{% tab label="VSCode" %} + +The extension uses **permission rules with glob patterns** instead of regex. Permissions are defined per-tool (e.g., `edit`, `bash`, `read`) and support `allow`, `deny`, and `ask` actions with glob matching: + +```yaml +permission: + edit: + "*.md": "allow" + "*": "deny" +``` + +The **VSCode (Legacy)** version's `fileRegex` approach is automatically converted to permission rules during migration. + +{% /tab %} +{% tab label="CLI" %} + +The CLI uses **permission rules with glob patterns** instead of regex. Permissions are defined per-tool (e.g., `edit`, `bash`, `read`) and support `allow`, `deny`, and `ask` actions with glob matching: + +```yaml +permission: + edit: + "*.md": "allow" + "*": "deny" +``` + +The **VSCode (Legacy)** version's `fileRegex` approach is automatically converted to permission rules during migration. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + +Regular expressions (`fileRegex`) in the **VSCode** version offer fine-grained control over file editing permissions within tool groups. + +{% /tab %} +{% /tabs %} {% callout type="tip" %} @@ -445,6 +968,183 @@ When a mode attempts to edit a file that doesn't match its `fileRegex` pattern, ## Example Configurations +{% tabs %} +{% tab label="VSCode" %} + +### Basic Documentation Writer (`.kilo/agents/docs-writer.md`) + +```markdown +--- +description: Specialized for writing and editing technical documentation +mode: primary +color: "#10B981" +permission: + edit: + "*.md": "allow" + "*": "deny" + bash: deny +--- + +You are a technical writer specializing in clear documentation. +Focus on clear explanations and examples. +``` + +### Test Engineer (`.kilo/agents/test-engineer.md`) + +```markdown +--- +description: Focused on writing and maintaining test suites +mode: primary +color: "#F59E0B" +permission: + edit: + "*.{test,spec}.{js,ts}": "allow" + "*": "deny" +--- + +You are a test engineer focused on code quality. +Use for writing tests, debugging test failures, and improving test coverage. +``` + +### Security Reviewer (`.kilo/agents/security-review.md`) + +```markdown +--- +description: Read-only security analysis and vulnerability assessment +mode: primary +color: "#EF4444" +permission: + edit: deny + bash: deny +--- + +You are a security specialist reviewing code for vulnerabilities. + +Focus on: + +- Input validation issues +- Authentication and authorization flaws +- Data exposure risks +- Injection vulnerabilities +``` + +### Config File Example (`kilo.jsonc`) + +```jsonc +{ + "agent": { + "docs-writer": { + "description": "Specialized for writing and editing technical documentation", + "mode": "primary", + "color": "#10B981", + "prompt": "You are a technical writer specializing in clear documentation.", + "permission": { + "edit": { "*.md": "allow", "*": "deny" }, + "bash": "deny", + }, + }, + "test-engineer": { + "description": "Focused on writing and maintaining test suites", + "mode": "primary", + "prompt": "You are a test engineer focused on code quality.", + "permission": { + "edit": { "*.{test,spec}.{js,ts}": "allow", "*": "deny" }, + }, + }, + }, +} +``` + +{% /tab %} +{% tab label="CLI" %} + +### Basic Documentation Writer (`.kilo/agents/docs-writer.md`) + +```markdown +--- +description: Specialized for writing and editing technical documentation +mode: primary +color: "#10B981" +permission: + edit: + "*.md": "allow" + "*": "deny" + bash: deny +--- + +You are a technical writer specializing in clear documentation. +Focus on clear explanations and examples. +``` + +### Test Engineer (`.kilo/agents/test-engineer.md`) + +```markdown +--- +description: Focused on writing and maintaining test suites +mode: primary +color: "#F59E0B" +permission: + edit: + "*.{test,spec}.{js,ts}": "allow" + "*": "deny" +--- + +You are a test engineer focused on code quality. +Use for writing tests, debugging test failures, and improving test coverage. +``` + +### Security Reviewer (`.kilo/agents/security-review.md`) + +```markdown +--- +description: Read-only security analysis and vulnerability assessment +mode: primary +color: "#EF4444" +permission: + edit: deny + bash: deny +--- + +You are a security specialist reviewing code for vulnerabilities. + +Focus on: + +- Input validation issues +- Authentication and authorization flaws +- Data exposure risks +- Injection vulnerabilities +``` + +### Config File Example (`kilo.jsonc`) + +```jsonc +{ + "agent": { + "docs-writer": { + "description": "Specialized for writing and editing technical documentation", + "mode": "primary", + "color": "#10B981", + "prompt": "You are a technical writer specializing in clear documentation.", + "permission": { + "edit": { "*.md": "allow", "*": "deny" }, + "bash": "deny", + }, + }, + "test-engineer": { + "description": "Focused on writing and maintaining test suites", + "mode": "primary", + "prompt": "You are a test engineer focused on code quality.", + "permission": { + "edit": { "*.{test,spec}.{js,ts}": "allow", "*": "deny" }, + }, + }, + }, +} +``` + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + ### Basic Documentation Writer (YAML) ```yaml @@ -498,8 +1198,48 @@ customModes: - browser ``` +{% /tab %} +{% /tabs %} + ## Troubleshooting +{% tabs %} +{% tab label="VSCode" %} + +### Common Issues + +- **Agent not appearing:** Ensure the `.md` file is in a recognized directory (`.kilo/agents/`, `.kilo/agent/`, `.opencode/agents/`). Check that the `mode` property is `primary` or `all` if you expect it in the agent picker. +- **Permission errors:** Permission rules are evaluated last-match-wins. If an agent can't use a tool you expect, check that an `allow` rule appears after any `deny` rules for that permission. +- **YAML frontmatter parse errors:** Ensure the frontmatter block starts and ends with `---` on its own line. Validate that YAML keys match expected property names (e.g., `top_p` not `topP`). +- **Agent overrides not working:** Config merges from global to project level. If a global config sets a property, your project config can override it, but both must use the same agent name. + +### Tips for Agent Definitions + +- **Keep prompts focused:** The markdown body is your system prompt — write it as if briefing a colleague +- **Use `mode: subagent`** for helper agents that shouldn't be directly selectable by users +- **Use the Settings UI** to view and edit agents through the **Settings → Agent Behaviour → Agents** subtab +- **Legacy modes are auto-migrated:** If you have `.kilocodemodes` files, they'll be converted on startup — no manual migration needed + +{% /tab %} +{% tab label="CLI" %} + +### Common Issues + +- **Agent not appearing:** Ensure the `.md` file is in a recognized directory (`.kilo/agents/`, `.kilo/agent/`, `.opencode/agents/`). Check that the `mode` property is `primary` or `all` if you expect it in the agent picker. +- **Permission errors:** Permission rules are evaluated last-match-wins. If an agent can't use a tool you expect, check that an `allow` rule appears after any `deny` rules for that permission. +- **YAML frontmatter parse errors:** Ensure the frontmatter block starts and ends with `---` on its own line. Validate that YAML keys match expected property names (e.g., `top_p` not `topP`). +- **Agent overrides not working:** Config merges from global to project level. If a global config sets a property, your project config can override it, but both must use the same agent name. + +### Tips for Agent Definitions + +- **Keep prompts focused:** The markdown body is your system prompt — write it as if briefing a colleague +- **Use `mode: subagent`** for helper agents that shouldn't be directly selectable by users +- **Test with `kilo agent create`** to see how the CLI generates agent definitions, then customize from there +- **Legacy modes are auto-migrated:** If you have `.kilocodemodes` files, they'll be converted on startup — no manual migration needed + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + ### Common Issues - **Mode not appearing:** After creating or importing a mode, you may need to reload the VS Code window @@ -514,6 +1254,9 @@ customModes: - **Hyphens for List Items:** List items start with a hyphen and a space (e.g., `- read`) - **Validate Your YAML:** Use online YAML validators or your editor's built-in validation +{% /tab %} +{% /tabs %} + ## Community Gallery -Ready to explore more? Check out the [Show and Tell](https://github.com/Kilo-Org/kilocode/discussions/categories/show-and-tell) to discover and share custom modes created by the community! +Ready to explore more? Check out the [Show and Tell](https://github.com/Kilo-Org/kilocode/discussions/categories/show-and-tell) to discover and share custom modes and agents created by the community! diff --git a/packages/kilo-docs/pages/customize/custom-rules.md b/packages/kilo-docs/pages/customize/custom-rules.md index ccecb0528ec..eb3c7fea120 100644 --- a/packages/kilo-docs/pages/customize/custom-rules.md +++ b/packages/kilo-docs/pages/customize/custom-rules.md @@ -26,11 +26,82 @@ Kilo Code supports two types of custom rules: - **Project Rules**: Apply only to the current project workspace - **Global Rules**: Apply across all projects and workspaces -{% callout type="note" title="UI Support" %} -The built-in rules management UI is available for general rules only. Mode-specific rules must be managed through the file system. +## Rule Location + +{% tabs %} +{% tab label="VSCode" %} + +### Project Rules + +Project rules are configured via the `instructions` key in your project's `kilo.jsonc` file. You can edit this file directly or use the **Settings** webview to manage the `instructions` configuration. Each entry points to a file path or glob pattern: + +```jsonc +// kilo.jsonc +{ + "instructions": [".kilo/rules/formatting.md", ".kilo/rules/*.md"], +} +``` + +You can also place rule files in the **`.kilo/`** directory structure: + +``` +project/ +├── .kilo/ +│ ├── rules/ +│ │ ├── formatting.md +│ │ ├── restricted_files.md +│ │ └── naming_conventions.md +├── kilo.json +├── src/ +└── ... +``` + +### Global Rules + +Global rules are configured via the `instructions` key in your global `kilo.jsonc` config file (typically at `~/.config/kilo/kilo.jsonc`). + +{% callout type="note" title="Migration" %} +The extension is backward compatible with `.kilocode/rules/` directories. Existing rules will continue to work, but migrating to `kilo.jsonc` is recommended. {% /callout %} -## Rule Location +{% /tab %} +{% tab label="CLI" %} + +### Project Rules + +Project rules are configured via the `instructions` key in your project's `kilo.jsonc` file. Each entry points to a file path or glob pattern: + +```jsonc +// kilo.jsonc +{ + "instructions": [".kilo/rules/formatting.md", ".kilo/rules/*.md"], +} +``` + +You can also place rule files in the **`.kilo/`** directory structure: + +``` +project/ +├── .kilo/ +│ ├── rules/ +│ │ ├── formatting.md +│ │ ├── restricted_files.md +│ │ └── naming_conventions.md +├── kilo.json +├── src/ +└── ... +``` + +### Global Rules + +Global rules are configured via the `instructions` key in your global `kilo.jsonc` config file (typically at `~/.config/kilo/kilo.jsonc`). + +{% callout type="note" title="Migration" %} +The CLI is backward compatible with `.kilocode/rules/` directories. Existing rules will continue to work, but migrating to `kilo.jsonc` is recommended. +{% /callout %} + +{% /tab %} +{% tab label="VSCode (Legacy)" %} ### Project Rules @@ -59,8 +130,54 @@ Global rules are stored in your home directory and apply to all projects: │ └── documentation_style.md ``` +{% /tab %} +{% /tabs %} + ## Managing Rules Through the UI +{% tabs %} +{% tab label="VSCode" %} + +Rules are managed by editing the `instructions` array in your `kilo.jsonc` config file. You can also use the **Settings** webview in VS Code to edit the configuration. + +- **Add a rule**: Add a file path or glob pattern to the `instructions` array +- **Remove a rule**: Remove the entry from the array +- **Disable a rule temporarily**: Comment out the line in `kilo.jsonc` (JSONC supports `//` comments) + +```jsonc +// kilo.jsonc +{ + "instructions": [ + ".kilo/rules/formatting.md", + // ".kilo/rules/experimental.md" -- temporarily disabled + ".kilo/rules/naming_conventions.md", + ], +} +``` + +{% /tab %} +{% tab label="CLI" %} + +Rules are managed by editing the `instructions` array in your `kilo.jsonc` config file directly. + +- **Add a rule**: Add a file path or glob pattern to the `instructions` array +- **Remove a rule**: Remove the entry from the array +- **Disable a rule temporarily**: Comment out the line in `kilo.jsonc` (JSONC supports `//` comments) + +```jsonc +// kilo.jsonc +{ + "instructions": [ + ".kilo/rules/formatting.md", + // ".kilo/rules/experimental.md" -- temporarily disabled + ".kilo/rules/naming_conventions.md", + ], +} +``` + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + Kilo Code provides a built-in interface for managing your custom rules without manually editing files in the `.kilocode/rules/` directories. To access the UI, click on the icon in the **bottom right corner** of the Kilo Code window. You can access the rules management UI to: @@ -70,8 +187,46 @@ You can access the rules management UI to: - Create and edit rules directly in the interface - Organize rules by category and priority +{% callout type="note" title="UI Support" %} +The built-in rules management UI is available for general rules only. Mode-specific rules must be managed through the file system. +{% /callout %} + +{% /tab %} +{% /tabs %} + ## Rule Loading Order +{% tabs %} +{% tab label="VSCode" %} + +Rules are loaded in the order they appear in the `instructions` array in `kilo.jsonc`: + +1. **Global instructions** from the global `kilo.jsonc` config +2. **Project instructions** from the project's `kilo.jsonc` + +Files matched by glob patterns are loaded in filesystem order. Project-level instructions take precedence over global instructions for conflicting directives. + +{% callout type="note" title="Backward Compatibility" %} +If `.kilocode/rules/` directories exist in your project, their contents are automatically included for backward compatibility. To fully migrate, move your rule files and reference them in `kilo.jsonc`. +{% /callout %} + +{% /tab %} +{% tab label="CLI" %} + +Rules are loaded in the order they appear in the `instructions` array in `kilo.jsonc`: + +1. **Global instructions** from the global `kilo.jsonc` config +2. **Project instructions** from the project's `kilo.jsonc` + +Files matched by glob patterns are loaded in filesystem order. Project-level instructions take precedence over global instructions for conflicting directives. + +{% callout type="note" title="Backward Compatibility" %} +If `.kilocode/rules/` directories exist in your project, their contents are automatically included for backward compatibility. To fully migrate, move your rule files and reference them in `kilo.jsonc`. +{% /callout %} + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + ### General Rules (Any Mode) Rules are loaded in the following priority order: @@ -86,21 +241,64 @@ Rules are loaded in the following priority order: When both global and project rules exist, they are combined with project rules taking precedence over global rules for conflicting directives. {% callout type="note" %} -We strongly recommend keeping your rules in the `.kilocode/rules/` folder as it provides better organization and is the preferred approach for future versions. The folder-based structure allows for more granular rule organization and clearer separation of concerns. The legacy file-based approach is maintained for backward compatibility but may be subject to change in future releases. +We strongly recommend keeping your rules in the `.kilocode/rules/` folder as it provides better organization and is the preferred approach for future versions. The legacy file-based approach is maintained for backward compatibility but may be subject to change in future releases. {% /callout %} ### Mode-Specific Rules -Additionally, the system supports mode-specific rules, which are loaded separately and have their own priority order: +The system also supports mode-specific rules with their own priority order: 1. First, it checks for `.kilocode/rules-${mode}/` directory 2. If that doesn't exist or is empty, it falls back to `.kilocoderules-${mode}` file (deprecated) -Currently, mode-specific rules are only supported at the project level. -When both generic rules and mode-specific rules exist, the mode-specific rules are given priority in the final output. +Mode-specific rules are only supported at the project level. When both generic and mode-specific rules exist, mode-specific rules take priority. + +{% /tab %} +{% /tabs %} ## Creating Custom Rules +{% tabs %} +{% tab label="VSCode" %} + +### Using the Settings UI or Config File + +1. Create a `kilo.jsonc` file in your project root (if it doesn't exist) +2. Create a `.kilo/rules/` directory (or any directory you prefer) +3. Write your rule as a Markdown file in that directory +4. Add the file path or a glob pattern to the `instructions` array in `kilo.jsonc` + +```jsonc +// kilo.jsonc +{ + "instructions": [".kilo/rules/my-new-rule.md"], +} +``` + +Rules are applied on the next interaction. You can also edit `kilo.jsonc` through the **Settings** webview in VS Code. + +{% /tab %} +{% tab label="CLI" %} + +### Using the Config File + +1. Create a `kilo.jsonc` file in your project root (if it doesn't exist) +2. Create a `.kilo/rules/` directory (or any directory you prefer) +3. Write your rule as a Markdown file in that directory +4. Add the file path or a glob pattern to the `instructions` array in `kilo.jsonc` + +```jsonc +// kilo.jsonc +{ + "instructions": [".kilo/rules/my-new-rule.md"], +} +``` + +Rules are applied on the next interaction. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + ### Using the UI Interface {% image src="/docs/img/custom-rules/rules-ui.png" alt="Rules tab in Kilo Code" width="400" /%} @@ -132,6 +330,9 @@ To create rules manually: Rules will be automatically applied to all future Kilo Code interactions. Any new changes will be applied immediately. +{% /tab %} +{% /tabs %} + ## Example Rules ### Example 1: Table Formatting @@ -192,10 +393,6 @@ Custom rules can be applied to a wide variety of scenarios: - **Keep It Simple**: Rules should be concise and easy to understand - **Update Regularly**: Review and update rules as project requirements change -{% callout type="tip" title="Pro Tip: File-Based Team Standards" %} -When working in team environments, placing `.kilocode/rules/codestyle.md` files under version control allows you to standardize Kilo's behavior across your entire development team. This ensures consistent code style, documentation practices, and development workflows for everyone on the project. -{% /callout %} - ## Limitations - Rules are applied on a best-effort basis by the AI models @@ -205,16 +402,41 @@ When working in team environments, placing `.kilocode/rules/codestyle.md` files ## Troubleshooting +{% tabs %} +{% tab label="VSCode" %} + +If your rules aren't being followed: + +1. **Check the `instructions` array** in your config to ensure the file path is correct. +2. **Verify Markdown formatting**: Ensure the file is valid Markdown. +3. **Restart the session**: Start a new chat session to pick up config changes. + +{% /tab %} +{% tab label="CLI" %} + +If your rules aren't being followed: + +1. **Check the `instructions` array** in your config to ensure the file path is correct. +2. **Verify Markdown formatting**: Ensure the file is valid Markdown. +3. **Restart the session**: Start a new chat session to pick up config changes. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + If your custom rules aren't being properly followed: -1. **Check rule status in the UI**: Use the rules management interface to verify that your rules are active and properly loaded 1. **Verify rule formatting**: Ensure that your rules are properly formatted with clear Markdown structure -1. **Check rule locations**: Ensure that your rules are located in supported locations: - - Global rules: `~/.kilocode/rules/` directory - - Project rules: `.kilocode/rules/` directory - - Legacy files: `.kilocoderules`, `.roorules`, or `.clinerules` -1. **Rule specificity**: Verify that the rules are specific and unambiguous -1. **Restart VS Code**: Restart VS Code to ensure the rules are properly loaded +2. **Rule specificity**: Verify that the rules are specific and unambiguous +3. **Check rule locations**: + - **Check rule status in the UI**: Use the rules management interface to verify that your rules are active and properly loaded + - Ensure rules are in supported locations: + - Global rules: `~/.kilocode/rules/` directory + - Project rules: `.kilocode/rules/` directory + - Legacy files: `.kilocoderules`, `.roorules`, or `.clinerules` + - **Restart VS Code** to ensure the rules are properly loaded + +{% /tab %} +{% /tabs %} ## Related Features diff --git a/packages/kilo-docs/pages/customize/custom-subagents.md b/packages/kilo-docs/pages/customize/custom-subagents.md index e97090c4a1e..ed4b3340a40 100644 --- a/packages/kilo-docs/pages/customize/custom-subagents.md +++ b/packages/kilo-docs/pages/customize/custom-subagents.md @@ -1,6 +1,7 @@ --- title: "Custom Subagents" description: "Create and configure custom subagents in Kilo Code's CLI" +platform: new --- # Custom Subagents @@ -8,7 +9,7 @@ description: "Create and configure custom subagents in Kilo Code's CLI" Kilo Code's CLI supports **custom subagents** — specialized AI assistants that can be invoked by primary agents or manually via `@` mentions. Subagents run in their own isolated sessions with tailored prompts, models, tool access, and permissions, enabling you to build purpose-built workflows for tasks like code review, documentation, security audits, and more. {% callout type="info" %} -Custom subagents are currently configured through the config file (`kilo.json`) or via markdown agent files. UI-based configuration is not yet available. +Custom subagents are currently configured through the config file (`kilo.jsonc`) or via markdown agent files. UI-based configuration is not yet available. {% /callout %} ## What Are Subagents? @@ -47,7 +48,7 @@ There are two ways to define custom subagents: through JSON configuration or mar ### Method 1: JSON Configuration -Add agents to the `agent` section of your `kilo.json` config file. Any key that doesn't match a built-in agent name creates a new custom agent. +Add agents to the `agent` section of your `kilo.jsonc` config file. Any key that doesn't match a built-in agent name creates a new custom agent. ```json { @@ -245,8 +246,8 @@ Agent configurations are merged from multiple sources. Later sources override ea 1. **Built-in agent defaults** (native agents defined in the codebase) 2. **Global config** (`~/.config/kilo/config.json`) -3. **Global agent markdown files** (`~/.config/kilo/agents/*.md`) -4. **Project config** (`kilo.json` in the project root) +3. **Project config** (`kilo.jsonc` in the project root) +4. **Global agent markdown files** (`~/.config/kilo/agents/*.md`) 5. **Project agent markdown files** (`.kilo/agents/*.md`) When overriding a built-in agent, properties are merged — only the fields you specify are overridden. When creating a new custom agent, unspecified fields use sensible defaults (`mode: "all"`, full permissions inherited from global config). @@ -373,5 +374,5 @@ To disable a built-in agent entirely: - [Custom Modes](/docs/customize/custom-modes) — Create specialized primary agents with tool restrictions - [Custom Rules](/docs/customize/custom-rules) — Define rules that apply to specific file types or situations -- [Orchestrator Mode](/docs/code-with-ai/agents/orchestrator-mode) — Coordinate complex tasks by delegating to subagents +- [Orchestrator Mode](/docs/code-with-ai/agents/orchestrator-mode) — Legacy mode for task delegation (now built into all agents) - [Task Tool](/docs/automate/tools/new-task) — The tool used to invoke subagents diff --git a/packages/kilo-docs/pages/customize/skills.md b/packages/kilo-docs/pages/customize/skills.md index 8f553d681ef..cc180e4df6a 100644 --- a/packages/kilo-docs/pages/customize/skills.md +++ b/packages/kilo-docs/pages/customize/skills.md @@ -47,6 +47,115 @@ This means: Skills are loaded from multiple locations, allowing both personal skills and project-specific instructions. +{% tabs %} +{% tab label="VSCode" %} + +### Global Skills (User-Level) + +Global skills are located in the `.kilo` directory within your Home directory: + +- Mac and Linux: `~/.kilo/skills/` +- Windows: `\Users\\.kilo\skills\` + +``` +~/.kilo/ +└── skills/ # Generic skills (all modes) + ├── my-skill/ + │ └── SKILL.md + └── another-skill/ + └── SKILL.md +``` + +### Project Skills (Workspace-Level) + +Located in `.kilo/skills/` within your project: + +``` +your-project/ +└── .kilo/ + └── skills/ # Generic skills for this project + └── project-conventions/ + └── SKILL.md +``` + +### Compatibility Directories + +For interoperability with other tools, the CLI also loads skills from: + +- `.claude/skills/` — Claude Code compatibility +- `.agents/skills/` — Open agent standard + +### Additional Skill Paths and Remote URLs + +You can configure extra skill locations and remote skill URLs in your `kilo.jsonc` config (project or global): + +```jsonc +{ + "skills": { + "paths": ["/path/to/shared/skills", "~/my-skills", "relative/skills"], + "urls": ["https://example.com/skills/my-skill/SKILL.md"], + }, +} +``` + +The `skills.paths` key accepts absolute paths, `~/` home-relative paths, or paths relative to the project root. The `skills.urls` key accepts URLs pointing to remote `SKILL.md` files that are fetched on demand. + +{% /tab %} +{% tab label="CLI" %} + +### Global Skills (User-Level) + +Global skills are located in the `.kilo` directory within your Home directory: + +- Mac and Linux: `~/.kilo/skills/` +- Windows: `\Users\\.kilo\skills\` + +``` +~/.kilo/ +└── skills/ # Generic skills (all modes) + ├── my-skill/ + │ └── SKILL.md + └── another-skill/ + └── SKILL.md +``` + +### Project Skills (Workspace-Level) + +Located in `.kilo/skills/` within your project: + +``` +your-project/ +└── .kilo/ + └── skills/ # Generic skills for this project + └── project-conventions/ + └── SKILL.md +``` + +### Compatibility Directories + +For interoperability with other tools, the CLI also loads skills from: + +- `.claude/skills/` — Claude Code compatibility +- `.agents/skills/` — Open agent standard + +### Additional Skill Paths and Remote URLs + +You can configure extra skill locations and remote skill URLs in your `kilo.jsonc` config (project or global): + +```jsonc +{ + "skills": { + "paths": ["/path/to/shared/skills", "~/my-skills", "relative/skills"], + "urls": ["https://example.com/skills/my-skill/SKILL.md"], + }, +} +``` + +The `skills.paths` key accepts absolute paths, `~/` home-relative paths, or paths relative to the project root. The `skills.urls` key accepts URLs pointing to remote `SKILL.md` files that are fetched on demand. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + ### Global Skills (User-Level) Global skills are located in the `.kilocode` directory within your Home directory. @@ -84,9 +193,29 @@ your-project/ └── SKILL.md ``` +{% /tab %} +{% /tabs %} + ## Mode-Specific Skills -To create a skill that only appears in a specific mode: +{% tabs %} +{% tab label="VSCode" %} + +The new platform does not use mode-specific skill directories. All skills are loaded into a shared pool and the agent decides which skill to invoke based on the skill's `description` field and the current task context. + +If you need a skill to only apply in certain situations, write a clear and specific `description` in the SKILL.md frontmatter so the agent knows when to use it. + +{% /tab %} +{% tab label="CLI" %} + +The new platform does not use mode-specific skill directories. All skills are loaded into a shared pool and the agent decides which skill to invoke based on the skill's `description` field and the current task context. + +If you need a skill to only apply in certain situations, write a clear and specific `description` in the SKILL.md frontmatter so the agent knows when to use it. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + +To create a skill that only appears in a specific mode, place it in a `skills-{mode-slug}` directory: ```bash # For Code mode only @@ -98,8 +227,24 @@ mkdir -p ~/.kilocode/skills-architect/microservices The directory naming pattern is `skills-{mode-slug}` where `{mode-slug}` matches the mode's identifier (e.g., `code`, `architect`, `ask`, `debug`). +{% /tab %} +{% /tabs %} + ## Priority and Overrides +{% tabs %} +{% tab label="VSCode" %} + +When multiple skills share the same name, project-level skills (`.kilo/skills/`) take precedence over global skills (`~/.kilo/skills/`). Skills from compatibility directories (`.claude/skills/`, `.agents/skills/`) and additional configured paths are loaded alongside project and global skills. + +{% /tab %} +{% tab label="CLI" %} + +When multiple skills share the same name, project-level skills (`.kilo/skills/`) take precedence over global skills (`~/.kilo/skills/`). Skills from compatibility directories (`.claude/skills/`, `.agents/skills/`) and additional configured paths are loaded alongside project and global skills. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + When multiple skills share the same name, Kilo Code uses these priority rules: 1. **Project skills override global skills** - A project skill with the same name takes precedence @@ -111,8 +256,34 @@ This allows you to: - Override them per-project when needed - Customize behavior for specific modes +{% /tab %} +{% /tabs %} + ## When Skills Are Loaded +{% tabs %} +{% tab label="VSCode" %} + +Skills are discovered when a session starts. The CLI scans all configured skill directories and reads metadata (name, description, file path) for each skill. + +- In the **CLI**: Skills are loaded when you start a new session or run `kilo run` +- In the **VS Code extension**: Skills are loaded when the extension connects to the CLI server + +Skills are re-scanned at the start of each new session. To pick up newly added or modified skills, start a new session. + +{% /tab %} +{% tab label="CLI" %} + +Skills are discovered when a session starts. The CLI scans all configured skill directories and reads metadata (name, description, file path) for each skill. + +- In the **CLI**: Skills are loaded when you start a new session or run `kilo run` +- In the **VS Code extension**: Skills are loaded when the extension connects to the CLI server + +Skills are re-scanned at the start of each new session. To pick up newly added or modified skills, start a new session. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + Skills are discovered when Kilo Code initializes: - When VSCode starts @@ -126,6 +297,9 @@ Skills directories are monitored for changes to `SKILL.md` files. However, the m You can symlink skills directories to share skills across machines or from a central repository. When using symlinks, the skill's `name` field must match the **symlink name**, not the target directory name. +{% /tab %} +{% /tabs %} + ## SKILL.md Format The `SKILL.md` file uses YAML frontmatter followed by Markdown content containing the instructions: @@ -213,62 +387,145 @@ These additional files can be referenced from your skill's instructions, allowin ## Example: Creating a Skill +{% tabs %} +{% tab label="VSCode" %} + +1. Create the skill directory: + + ```bash + mkdir -p ~/.kilo/skills/api-design + ``` + +2. Create `SKILL.md` (see content below) + +3. Start a new session to pick up the skill + +{% /tab %} +{% tab label="CLI" %} + +1. Create the skill directory: + + ```bash + mkdir -p ~/.kilo/skills/api-design + ``` + +2. Create `SKILL.md` (see content below) + +3. Start a new session to pick up the skill + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + 1. Create the skill directory: ```bash mkdir -p ~/.kilocode/skills/api-design ``` -2. Create `SKILL.md`: - - ```markdown - --- - name: api-design - description: REST API design best practices and conventions - --- - - # API Design Guidelines - - When designing REST APIs, follow these conventions: - - ## URL Structure - - - Use plural nouns for resources: `/users`, `/orders` - - Use kebab-case for multi-word resources: `/order-items` - - Nest related resources: `/users/{id}/orders` - - ## HTTP Methods - - - GET: Retrieve resources - - POST: Create new resources - - PUT: Replace entire resource - - PATCH: Partial update - - DELETE: Remove resource - - ## Response Codes - - - 200: Success - - 201: Created - - 400: Bad Request - - 404: Not Found - - 500: Server Error - ``` +2. Create `SKILL.md` (see content below) 3. Reload VSCode to load the skill 4. The skill will now be available in all modes +{% /tab %} +{% /tabs %} + +Example `SKILL.md`: + +```markdown +--- +name: api-design +description: REST API design best practices and conventions +--- + +# API Design Guidelines + +When designing REST APIs, follow these conventions: + +## URL Structure + +- Use plural nouns for resources: `/users`, `/orders` +- Use kebab-case for multi-word resources: `/order-items` +- Nest related resources: `/users/{id}/orders` + +## HTTP Methods + +- GET: Retrieve resources +- POST: Create new resources +- PUT: Replace entire resource +- PATCH: Partial update +- DELETE: Remove resource + +## Response Codes + +- 200: Success +- 201: Created +- 400: Bad Request +- 404: Not Found +- 500: Server Error +``` + ## Finding Skills +{% tabs %} +{% tab label="VSCode" %} + +The new platform does not have a marketplace UI yet. You can find and share skills through: + +- **[Kilo Marketplace repository](https://github.com/Kilo-Org/kilo-marketplace)** — Browse community skills on GitHub and manually download them into your skills directory +- **[Agent Skills Specification](https://agentskills.io/home)** — The open specification that skills follow, enabling interoperability across different AI agents +- **Remote URLs** — Use the `skills.urls` config key to load skills directly from URLs without manually downloading them + +{% /tab %} +{% tab label="CLI" %} + +The new platform does not have a marketplace UI yet. You can find and share skills through: + +- **[Kilo Marketplace repository](https://github.com/Kilo-Org/kilo-marketplace)** — Browse community skills on GitHub and manually download them into your skills directory +- **[Agent Skills Specification](https://agentskills.io/home)** — The open specification that skills follow, enabling interoperability across different AI agents +- **Remote URLs** — Use the `skills.urls` config key to load skills directly from URLs without manually downloading them + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + You can discover and install community-created skills through: -- **Kilo Marketplace** - Browse skills directly in the Kilo Code extension via the Marketplace tab, or explore the [Kilo Marketplace repository](https://github.com/Kilo-Org/kilo-marketplace) on GitHub -- [Agent Skills Specification](https://agentskills.io/home) - The open specification that skills follow, enabling interoperability across different AI agents +- **Kilo Marketplace** — Browse skills directly in the Kilo Code extension via the Marketplace tab, or explore the [Kilo Marketplace repository](https://github.com/Kilo-Org/kilo-marketplace) on GitHub +- [Agent Skills Specification](https://agentskills.io/home) — The open specification that skills follow, enabling interoperability across different AI agents + +{% /tab %} +{% /tabs %} ## Troubleshooting ### Skill Not Loading? +{% tabs %} +{% tab label="VSCode" %} + +1. **Verify frontmatter**: Ensure `name` and `description` are present in the YAML frontmatter. The `name` does not need to match the directory name but should be unique across all loaded skills. + +2. **Start a new session**: Skills are scanned at session start. Begin a new session to pick up changes. + +3. **Check file location**: Ensure `SKILL.md` is directly inside the skill directory (e.g., `.kilo/skills/my-skill/SKILL.md`), not nested further. + +4. **Check config paths**: If using `skills.paths` or `skills.urls`, verify the paths and URLs are correct in your `kilo.jsonc`. + +{% /tab %} +{% tab label="CLI" %} + +1. **Verify frontmatter**: Ensure `name` and `description` are present in the YAML frontmatter. The `name` does not need to match the directory name but should be unique across all loaded skills. + +2. **Start a new session**: Skills are scanned at session start. Begin a new session to pick up changes. + +3. **Check file location**: Ensure `SKILL.md` is directly inside the skill directory (e.g., `.kilo/skills/my-skill/SKILL.md`), not nested further. + +4. **Check config paths**: If using `skills.paths` or `skills.urls`, verify the paths and URLs are correct in your `kilo.jsonc`. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + 1. **Check the Output panel**: Open `View` → `Output` → Select "Kilo Code" from dropdown. Look for skill-related errors. 2. **Verify frontmatter**: Ensure `name` exactly matches the directory name and `description` is present. @@ -277,6 +534,9 @@ You can discover and install community-created skills through: 4. **Check file location**: Ensure `SKILL.md` is directly inside the skill directory, not nested further. +{% /tab %} +{% /tabs %} + ### Verifying a Skill is Available To confirm a skill is properly loaded and available to the agent, you can ask the agent directly. Simply send a message like: @@ -291,10 +551,26 @@ If the agent confirms the skill is available, you're ready to use it. If not, ch ### Checking if a Skill Was Used +{% tabs %} +{% tab label="VSCode" %} + +When the agent uses a skill, it invokes the `skill` tool with the skill's name. Look for a `skill` tool call in the conversation to confirm a skill was loaded. The tool output includes the full skill content injected into context. + +{% /tab %} +{% tab label="CLI" %} + +When the agent uses a skill, it invokes the `skill` tool with the skill's name. Look for a `skill` tool call in the conversation to confirm a skill was loaded. The tool output includes the full skill content injected into context. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + To see if a skill was actually used during a conversation, look for a `read_file` tool call in the chat that targets a `SKILL.md` file. When the agent decides to use a skill, it reads the full skill file into context—this appears as a file read operation in the conversation. There's currently no dedicated UI indicator showing "Skill X was activated." The `read_file` call is the most reliable way to confirm a skill was used. +{% /tab %} +{% /tabs %} + ### Common Errors | Error | Cause | Solution | @@ -307,6 +583,24 @@ There's currently no dedicated UI indicator showing "Skill X was activated." The Have you created a skill that others might find useful? Share it with the community by contributing to the [Kilo Marketplace](https://github.com/Kilo-Org/kilo-marketplace)! +{% tabs %} +{% tab label="VSCode" %} + +While the new platform does not yet have a built-in marketplace UI, skills from the [Kilo Marketplace repository](https://github.com/Kilo-Org/kilo-marketplace) can be manually downloaded into your `.kilo/skills/` directory or loaded via `skills.urls` in config. + +{% /tab %} +{% tab label="CLI" %} + +While the new platform does not yet have a built-in marketplace UI, skills from the [Kilo Marketplace repository](https://github.com/Kilo-Org/kilo-marketplace) can be manually downloaded into your `.kilo/skills/` directory or loaded via `skills.urls` in config. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + +Skills submitted to the marketplace are browsable and installable directly from the Marketplace tab in the **VSCode** version. + +{% /tab %} +{% /tabs %} + ### How to Submit Your Skill 1. **Prepare your skill**: Ensure your skill directory contains a valid `SKILL.md` file with proper frontmatter diff --git a/packages/kilo-docs/pages/customize/workflows.md b/packages/kilo-docs/pages/customize/workflows.md index c18a0030fb8..50ea192b3b6 100644 --- a/packages/kilo-docs/pages/customize/workflows.md +++ b/packages/kilo-docs/pages/customize/workflows.md @@ -1,16 +1,64 @@ --- title: "Workflows" description: "Create automated workflows with Kilo Code" +platform: new --- # Workflows -Workflows automate repetitive tasks by defining step-by-step instructions for Kilo Code to execute. Invoke any workflow by typing `/[workflow-name.md]` in the chat. +Workflows (also called **slash commands** in the new extension) automate repetitive tasks by defining step-by-step instructions for Kilo Code to execute. {% image src="/docs/img/slash-commands/workflows.png" alt="Workflows tab in Kilo Code" width="600" caption="Workflows tab in Kilo Code" /%} ## Creating Workflows +{% tabs %} +{% tab label="VSCode" %} + +Workflows are Markdown files stored as **slash commands** in `.kilo/commands/`: + +- **Global commands**: `~/.config/kilo/commands/` (available in all projects) +- **Project commands**: `[project]/.kilo/commands/` (project-specific) + +### Basic Setup + +1. Create a `.md` file with step-by-step instructions +2. Save it in your commands directory +3. Type `/command-name` in the chat (just the filename without `.md` extension) to execute + +For example, a file at `.kilo/commands/submit-pr.md` is invoked with `/submit-pr`. + +### Optional Frontmatter + +Command files can include YAML frontmatter: + +```markdown +--- +description: Submit a pull request with checks +agent: code +--- + +You are helping submit a pull request... +``` + +| Field | Description | +| ------------- | --------------------------------------------- | +| `description` | Shown in the command picker | +| `agent` | Which agent to use when invoking this command | +| `model` | Model override for this command | +| `subtask` | When `true`, runs as a sub-agent session | + +### Workflow Capabilities + +Workflows can leverage all built-in tools: `read`, `glob`, `grep`, `edit`, `write`, `bash`, `webfetch`, and MCP server tools. + +### Migration from Legacy Workflows + +The new extension automatically migrates legacy workflows from `.kilocode/workflows/` to the new command format on startup. You can also manually move files and remove the `.md` extension from invocations. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} + Workflows are markdown files stored in `.kilocode/workflows/`: - **Global workflows**: `~/.kilocode/workflows/` (available in all projects) @@ -29,7 +77,10 @@ Workflows can leverage: - [Built-in tools](/docs/automate/tools): [`read_file()`](/docs/automate/tools/read-file), [`search_files()`](/docs/automate/tools/search-files), [`execute_command()`](/docs/automate/tools/execute-command) - CLI tools: `gh`, `docker`, `npm`, custom scripts - [MCP integrations](/docs/automate/mcp/overview): Slack, databases, APIs -- [Mode switching](/docs/code-with-ai/agents/using-modes): [`new_task()`](/docs/automate/tools/new-task) for specialized contexts +- [Agent switching](/docs/code-with-ai/agents/using-agents): [`new_task()`](/docs/automate/tools/new-task) for specialized contexts + +{% /tab %} +{% /tabs %} ## Common Workflow Patterns @@ -64,7 +115,38 @@ Workflows can leverage: ## Example: PR Submission Workflow -Let's walk through creating a workflow for submitting a pull request. This workflow handles the entire process from code review to deployment notification. +Let's walk through creating a workflow for submitting a pull request. + +{% tabs %} +{% tab label="VSCode" %} + +Create a file called `submit-pr.md` in your `.kilo/commands` directory: + +```markdown +--- +description: Submit a pull request with full checks +--- + +# Submit PR Workflow + +You are helping submit a pull request. Follow these steps: + +1. First, use `grep` to check for any TODO comments or console.log statements that shouldn't be committed +2. Run tests using `bash` with `npm test` or the appropriate test command +3. If tests pass, stage and commit changes with a descriptive commit message +4. Push the branch and create a pull request using `bash` with `gh pr create` +5. Use `question` to get the PR title and description from the user + +Parameters needed (ask if not provided): + +- Branch name +- Reviewers to assign +``` + +Trigger this workflow by typing `/submit-pr` in the chat. + +{% /tab %} +{% tab label="VSCode (Legacy)" %} Create a file called `submit-pr.md` in your `.kilocode/workflows` directory: @@ -85,12 +167,16 @@ Parameters needed (ask if not provided): - Reviewers to assign ``` -Now you can trigger this workflow by typing `/submit-pr.md` in the chat. Kilo Code will: +Trigger this workflow by typing `/submit-pr.md` in the chat. + +{% /tab %} +{% /tabs %} + +Kilo Code will: - Scan your code for common issues before committing - Run your test suite to catch problems early - Handle the Git operations and PR creation -- Notify your team automatically - Set up follow-up tasks for deployment -This saves you from manually running the same 7-step process every time you want to submit code for review. +This saves you from manually running the same steps every time you want to submit code for review. diff --git a/packages/kilo-docs/pages/getting-started/quickstart.md b/packages/kilo-docs/pages/getting-started/quickstart.md index 5a1a82f2229..03e3206ab1c 100644 --- a/packages/kilo-docs/pages/getting-started/quickstart.md +++ b/packages/kilo-docs/pages/getting-started/quickstart.md @@ -157,7 +157,7 @@ Kilo Code analyzes your request and proposes specific actions. These may include {% callout type="tip" %} The level of autonomy is configurable, allowing you to make the agent more or less autonomous. -You can learn more about [using modes](/docs/code-with-ai/agents/using-modes) and [auto-approving actions](/docs/getting-started/settings/auto-approving-actions). +You can learn more about [using agents](/docs/code-with-ai/agents/using-agents) and [auto-approving actions](/docs/getting-started/settings/auto-approving-actions). {% /callout %} ### Step 5: Iterate @@ -180,7 +180,7 @@ You've completed your first task. Along the way you learned: Ready for more? Here are some next steps: - **[Autocomplete](/docs/code-with-ai/features/autocomplete)** — Get inline code suggestions as you type -- **[Modes](/docs/code-with-ai/agents/using-modes)** — Explore different modes for different tasks +- **[Agents](/docs/code-with-ai/agents/using-agents)** — Explore different agents for different tasks - **[Git commit generation](/docs/code-with-ai/features/git-commit-generation)** — Automatically generate commit messages {% callout type="tip" %} diff --git a/packages/kilo-docs/pages/getting-started/settings/index.md b/packages/kilo-docs/pages/getting-started/settings/index.md index 00e1cc30a2a..acd1bd43ff6 100644 --- a/packages/kilo-docs/pages/getting-started/settings/index.md +++ b/packages/kilo-docs/pages/getting-started/settings/index.md @@ -140,7 +140,29 @@ Use this option only if you are certain you want to remove all Kilo Code data or {% tabs %} {% tab label="VSCode" %} -The extension does not currently expose the same experimental feature toggles as the **VSCode (Legacy)** version. Advanced options are configured via the JSONC config files that the Settings webview reads and writes. Refer to the auto-generated `$schema` in your `kilo.jsonc` for the full list of available options. +The new extension exposes experimental features via the **Experimental** tab in Settings (click the gear icon {% codicon name="gear" /%} → Experimental). + +Available experimental toggles include: + +- **Share mode** — `manual`, `auto`, or `disabled` session sharing +- **LSP integration** — expose language server diagnostics to the agent +- **Paste summary** — summarize large clipboard pastes before including them +- **Batch tool** — allow the agent to batch multiple tool calls in one step + +Advanced options not exposed in the UI can be configured via the `experimental` key in `kilo.jsonc`: + +```json +{ + "experimental": { + "codebase_search": true, + "batch_tool": false, + "disable_paste_summary": false, + "mcp_timeout": 30000 + } +} +``` + +Refer to the auto-generated `$schema` in your `kilo.jsonc` for the full list of available options. {% /tab %} {% tab label="CLI" %} diff --git a/packages/kilo-docs/pages/kiloclaw/chat-platforms.md b/packages/kilo-docs/pages/kiloclaw/chat-platforms.md deleted file mode 100644 index 6767956eb36..00000000000 --- a/packages/kilo-docs/pages/kiloclaw/chat-platforms.md +++ /dev/null @@ -1,155 +0,0 @@ ---- -title: "Connecting Chat Platforms" -description: "Connect your KiloClaw agent to Telegram, Discord, Slack, and more" ---- - -# Connecting Chat Platforms - -KiloClaw supports connecting your AI agent to Telegram, Discord, and Slack. You can configure channels from the **Settings** tab on your [KiloClaw dashboard](/docs/kiloclaw/dashboard#channels), or from the OpenClaw Control UI after accessing your instance. - -While the exact steps vary for configuring a chat platform (called a _channel_ by OpenClaw), the steps are to: - -1. Configure the channel -2. Redeploy the KiloClaw instance -3. Initiate the pairing in the chat app -4. Accept the pairing request in the [KiloClaw UI](https://app.kilo.ai/claw) - -Detailed instructions for supported chat apps are below. - -## Chat Apps (Channels) - -### Telegram - -1. Open Telegram and search for [@BotFather](https://t.me/BotFather) -2. Send `/newbot` and follow the prompts to create your bot -3. Copy the **Bot Token** that BotFather gives you -4. Go to the **Settings** tab on your [KiloClaw dashboard](/docs/kiloclaw/dashboard) -5. Paste the token into the **Telegram Bot Token** field -6. Click **Save** -7. Redeploy your KiloClaw instance -8. Send a direct message to your bot in Telegram: `/start` - -{% image src="/docs/img/kiloclaw/telegram.png" alt="Connect account screen" width="800" caption="Telegram bot token entry" /%} - -You can remove or replace a configured token at any time. - -> ℹ️ **Info** -> Advanced settings such as DM policy, allow lists, and groups can be configured in the OpenClaw Control UI after connecting. - -### Discord - -To connect Discord, you need a **Bot Token** from the [Discord Developer Portal](https://discord.com/developers/applications). - -#### Create an Application and Bot - -1. Go to the [Discord Developer Portal](https://discord.com/developers/applications) and log in -2. Click **New Application**, give it a name, and click **Create** -3. Click **Bot** on the left sidebar -4. Click **Add Bot** and confirm - -#### Enable Privileged Intents - -On the **Bot** page, scroll down to **Privileged Gateway Intents** and enable: - -- **Message Content Intent** (required) -- **Server Members Intent** (recommended — needed for role allowlists and name matching) -- **Presence Intent** (optional) - -#### Copy Your Bot Token - -1. Scroll back up on the **Bot** page and click **Reset Token** - -> 📝 **Note** -> Despite the name, this generates your first token — nothing is being "reset." - -2. Copy the token that appears and paste it into the **Discord Bot Token** field in your KiloClaw dashboard. - -{% image src="/docs/img/kiloclaw/discord.png" alt="Connect account screen" width="800" caption="Discord bot token entry" /%} - -Enter the token in the Settings tab and click **Save**. You can remove or replace a configured token at any time. - -#### Generate an Invite URL and Add the Bot to Your Server - -1. Click **OAuth2** on the sidebar -2. Scroll down to **OAuth2 URL Generator** and enable: - - `bot` - - `applications.commands` -3. A **Bot Permissions** section will appear below. Enable: - - View Channels - - Send Messages - - Read Message History - - Embed Links - - Attach Files - - Add Reactions (optional) -4. Copy the generated URL at the bottom -5. Paste it into your browser, select your server, and click **Continue** -6. You should now see your bot in the Discord server - -#### Start Chatting with the Bot - -1. Right-click on the Bot in Discord and click **Message** -2. DM the bot `/pair` -3. You should get a response back with a pairing code -4. Return to [app.kilocode.ai/claw](https://app.kilocode.ai/claw) and confirm the pairing code and approve -5. You should now be able to chat with the bot from Discord - -### Slack - -#### Step 1: Create a Slack App from the OpenClaw Manifest - -1. Go to [Slack App Management](https://api.slack.com/apps) and click **Create New App** → **From a Manifest** -2. Copy the manifest from the [OpenClaw docs](https://docs.openclaw.ai/channels/slack#manifest-and-scope-checklist) -3. Paste the manifest JSON into Slack's manifest editor -4. Customize the manifest before creating: - - Rename the app to your preferred name wherever it appears - - Update the slash command if desired (e.g., `/kiloclaw`) -5. Click **Create** - -#### Step 2: Generate Tokens - -You need two tokens from Slack: - -**App-Level Token** - -1. In your Slack app settings, scroll down to **App-Level Tokens** -2. Click **Generate Token** -3. Add the `connections:write` scope -4. Generate and copy the token (starts with `xapp-`) - -**Bot User OAuth Token** - -1. In the left sidebar, click **Install App** -2. Install the app to your workspace -3. Copy the **Bot User OAuth Token** (starts with `xoxb-`) - -#### Step 3: Connect Slack to KiloClaw - -1. In the [KiloClaw UI](https://app.kilo.ai/claw), find the Slack integration section (may show "not configured") -2. Enter both tokens: - - The `xapp-` app-level token - - The `xoxb-` bot user OAuth token -3. Click **Save** -4. Scroll to the top of the KiloClaw UI and click **Redeploy**. Wait for the instance to come back up - -#### Step 4: Pair Slack with KiloClaw - -1. In Slack, DM the app and type your slash command (e.g., `/claw`) followed by anything — this triggers the pairing flow - -> 📝 **Note** -> The slash command is whatever you defined in the manifest. Any text after the command will work to trigger pairing. - -2. The app will return a pairing code -3. Return to [app.kilocode.ai/claw](https://app.kilocode.ai/claw) and confirm the pairing code and approve -4. You should now be able to chat with the bot from Slack - -## Future Support - -Additional platforms (such as WhatsApp) are planned for future releases. For the latest on supported platforms, refer to the [OpenClaw documentation](https://docs.openclaw.ai). - -## Related - -- [KiloClaw Overview](/docs/kiloclaw/overview) -- [Dashboard Reference](/docs/kiloclaw/dashboard) -- [Troubleshooting](/docs/kiloclaw/troubleshooting) -- [KiloClaw Pricing](/docs/kiloclaw/pricing) -- [OpenClaw Documentation](https://docs.openclaw.ai) diff --git a/packages/kilo-docs/pages/kiloclaw/chat-platforms/discord.md b/packages/kilo-docs/pages/kiloclaw/chat-platforms/discord.md new file mode 100644 index 00000000000..219e6799c68 --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/chat-platforms/discord.md @@ -0,0 +1,67 @@ +--- +title: "Discord" +description: "Connect your KiloClaw agent to Discord" +--- + +# Discord + +Connect your KiloClaw agent to Discord by creating a bot in the Discord Developer Portal and linking it to your KiloClaw dashboard. + +## Prerequisites + +Make sure you have a Discord server ready to add the bot to. If you don't have one, open Discord, scroll to the bottom of your server list, click **+**, choose **Create My Own**, then **For me and my friends**, and give it a name. + +## Create an Application and Bot + +1. Go to the [Discord Developer Portal](https://discord.com/developers/applications) and log in +2. Click **New Application**, give it a name, and click **Create** + +## Enable Privileged Intents + +On the **Bot** page, scroll down to **Privileged Gateway Intents** and enable: + +- **Message Content Intent** (required) +- **Server Members Intent** (recommended — needed for role allowlists and name matching) +- **Presence Intent** (optional) + +## Generate an Invite URL and Add the Bot to Your Server + +1. Click **OAuth2** on the sidebar +2. Scroll down to **OAuth2 URL Generator** and enable: + - `bot` + - `applications.commands` +3. A **Bot Permissions** section will appear below. Enable: + - View Channels + - Send Messages + - Read Message History + - Embed Links + - Attach Files + - Add Reactions (optional) +4. Copy the generated URL at the bottom +5. Paste it into your browser, select your server, and click **Continue** +6. You should now see your bot in the Discord server + +## Copy Your Bot Token + +1. Go back to the **Bot** page on the left sidebar and click **Reset Token** + +> 📝 **Note** +> Despite the name, this generates your first token — nothing is being "reset." + +2. Copy the token that appears and paste it into the **Discord Bot Token** field in your KiloClaw dashboard. + +{% image src="/docs/img/kiloclaw/discord.png" alt="Connect account screen" width="800" caption="Discord bot token entry" /%} + +Enter the token in the Settings tab and click **Save**. You can remove or replace a configured token at any time. + +## Redeploy to Apply Changes + +After saving your token, click **Redeploy** (the yellow button at the top of the KiloClaw dashboard) to apply the changes. The server will restart in about 30–45 seconds. Wait for the redeploy to complete before pairing. + +## Start Chatting with the Bot + +1. Right-click on the Bot in Discord and click **Message** +2. DM the bot `/pair` +3. You should get a response back with a pairing code +4. Return to [app.kilo.ai/claw](https://app.kilo.ai/claw) and confirm the pairing code and approve +5. You should now be able to chat with the bot from Discord diff --git a/packages/kilo-docs/pages/kiloclaw/chat-platforms/index.md b/packages/kilo-docs/pages/kiloclaw/chat-platforms/index.md new file mode 100644 index 00000000000..69482f76a5c --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/chat-platforms/index.md @@ -0,0 +1,21 @@ +--- +title: "Chat Platforms" +description: "Connect your KiloClaw agent to Telegram, Discord, and Slack" +--- + +# Chat Platforms + +KiloClaw supports connecting your AI agent to messaging platforms so it can receive instructions and send responses directly in your chat apps. You can configure channels from the **Settings** tab on your [KiloClaw dashboard](/docs/kiloclaw/dashboard#channels), or from the OpenClaw Control UI after accessing your instance. + +The general steps to connect any chat platform are: + +1. Configure the channel token in Settings +2. Redeploy the KiloClaw instance +3. Initiate the pairing in the chat app +4. Accept the pairing request in the [KiloClaw UI](https://app.kilo.ai/claw) + +## Supported Platforms + +- [**Telegram**](/docs/kiloclaw/chat-platforms/telegram) — Connect via a BotFather bot token. +- [**Discord**](/docs/kiloclaw/chat-platforms/discord) — Connect via a Discord Developer Portal bot token. +- [**Slack**](/docs/kiloclaw/chat-platforms/slack) — Connect via a Slack app manifest with app-level and bot tokens. diff --git a/packages/kilo-docs/pages/kiloclaw/chat-platforms/slack.md b/packages/kilo-docs/pages/kiloclaw/chat-platforms/slack.md new file mode 100644 index 00000000000..08fbb66f7b6 --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/chat-platforms/slack.md @@ -0,0 +1,55 @@ +--- +title: "Slack" +description: "Connect your KiloClaw agent to Slack" +--- + +# Slack + +Connect your KiloClaw agent to Slack by creating a Slack app from the OpenClaw manifest and linking it to your KiloClaw dashboard. + +## Step 1: Create a Slack App from the OpenClaw Manifest + +1. Go to [Slack App Management](https://api.slack.com/apps) and click **Create New App** → **From a Manifest** +2. Copy the manifest from the [OpenClaw docs](https://docs.openclaw.ai/channels/slack#manifest-and-scope-checklist) +3. Paste the manifest JSON into Slack's manifest editor +4. Customize the manifest before creating: + - Rename the app to your preferred name wherever it appears + - Update the slash command if desired (e.g., `/kiloclaw`) +5. Click **Create** + +## Step 2: Generate Tokens + +You need two tokens from Slack: + +**App-Level Token** + +1. In your Slack app settings, scroll down to **App-Level Tokens** +2. Click **Generate Token** +3. Add the `connections:write` scope +4. Generate and copy the token (starts with `xapp-`) + +**Bot User OAuth Token** + +1. In the left sidebar, click **Install App** +2. Install the app to your workspace +3. Copy the **Bot User OAuth Token** (starts with `xoxb-`) + +## Step 3: Connect Slack to KiloClaw + +1. In the [KiloClaw UI](https://app.kilo.ai/claw), find the Slack integration section (may show "not configured") +2. Enter both tokens: + - The `xapp-` app-level token + - The `xoxb-` bot user OAuth token +3. Click **Save** +4. Scroll to the top of the KiloClaw UI and click **Redeploy**. Wait for the instance to come back up + +## Step 4: Pair Slack with KiloClaw + +1. In Slack, DM the app and type your slash command (e.g., `/claw`) followed by anything — this triggers the pairing flow + +> 📝 **Note** +> The slash command is whatever you defined in the manifest. Any text after the command will work to trigger pairing. + +2. The app will return a pairing code +3. Return to [app.kilocode.ai/claw](https://app.kilocode.ai/claw) and confirm the pairing code and approve +4. You should now be able to chat with the bot from Slack diff --git a/packages/kilo-docs/pages/kiloclaw/chat-platforms/telegram.md b/packages/kilo-docs/pages/kiloclaw/chat-platforms/telegram.md new file mode 100644 index 00000000000..8fd8d7b524d --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/chat-platforms/telegram.md @@ -0,0 +1,24 @@ +--- +title: "Telegram" +description: "Connect your KiloClaw agent to Telegram" +--- + +# Telegram + +Connect your KiloClaw agent to Telegram by creating a bot via BotFather and linking it to your KiloClaw dashboard. + +1. Open Telegram and search for [@BotFather](https://t.me/BotFather) +2. Send `/newbot` and follow the prompts to create your bot +3. Copy the **Bot Token** that BotFather gives you +4. Go to the **Settings** tab on your [KiloClaw dashboard](/docs/kiloclaw/dashboard) +5. Paste the token into the **Telegram Bot Token** field +6. Click **Save** +7. Redeploy your KiloClaw instance +8. Send a direct message to your bot in Telegram: `/start` + +{% image src="/docs/img/kiloclaw/telegram.png" alt="Connect account screen" width="800" caption="Telegram bot token entry" /%} + +You can remove or replace a configured token at any time. + +> ℹ️ **Info** +> Advanced settings such as DM policy, allow lists, and groups can be configured in the OpenClaw Control UI after connecting. diff --git a/packages/kilo-docs/pages/kiloclaw/control-ui.md b/packages/kilo-docs/pages/kiloclaw/control-ui.md deleted file mode 100644 index 03aec4885ca..00000000000 --- a/packages/kilo-docs/pages/kiloclaw/control-ui.md +++ /dev/null @@ -1,116 +0,0 @@ ---- -title: "OpenClaw Control UI" -description: "Browser-based dashboard for managing your OpenClaw instance" ---- - -# OpenClaw Control UI - -The Control UI is a browser-based dashboard (built with Vite + Lit) served by the OpenClaw Gateway on the same port as the gateway itself (default: `http://localhost:18789/`). It connects via WebSocket and gives you real-time control over your agent, channels, sessions, and system configuration. For KiloClaw users, see [Accessing the Control UI](/docs/kiloclaw/dashboard#accessing-the-control-ui) to get started. - -## Features - -- **Chat** — Send messages, stream responses with live tool-call output, view history, and abort runs. -- **Channels** — View the status of connected messaging platforms, scan QR codes for login, and edit per-channel config. -- **Sessions** — List active sessions with thinking and verbose overrides. -- **Cron Jobs** — Create, edit, enable/disable, run, and view history of scheduled tasks. -- **Skills** — View status, enable/disable, install, and manage API keys for skills. -- **Nodes** — List paired devices and their capabilities. -- **Exec Approvals** — Edit gateway or node command allowlists. See [Exec Approvals](#exec-approvals) below. -- **Config** — View and edit `openclaw.json` with schema-based form rendering and a raw JSON editor. -- **Logs** — Live tail of gateway logs with filtering and export. -- **Debug** — Status, health, model snapshots, event log, and manual RPC calls. -- **Update** — Run package updates and restart the gateway. - -For more details, please see the official [OpenClaw documentation](https://docs.openclaw.ai/web/control-ui). - -{% callout type="warning" %} -Do not use the **Update** feature in the Control UI to update KiloClaw. Use **Redeploy** from the [KiloClaw Dashboard](/docs/kiloclaw/dashboard#redeploy) instead. Updating via the Control UI will not apply the correct KiloClaw platform image and may break your instance. -{% /callout %} - -## Changing Models - -The Control UI Chat tab doubles as a command line for model management. KiloClaw exposes 335+ models through the `kilocode` provider and you can browse and switch between them without leaving the chat. - -| Command | Description | -| ------------------------------------ | ------------------------------------------------------------------------------- | -| `/model status` | View the currently active model and provider | -| `/models kilocode` | Browse available models (paginated, 20 per page) | -| `/models kilocode ` | Jump to a specific page (e.g. `/models kilocode 2`) | -| `/model kilocode//` | Switch to a specific model (e.g. `/model kilocode/anthropic/claude-sonnet-4.6`) | -| `/models kilocode all` | List every available model at once | - -Each `/models` response includes helper text at the bottom with shortcuts for switching, paging, and listing all models. - -To change the default model for all new sessions, edit `agents.defaults.model.primary` in your `openclaw.json` via **Config** in the Control UI (or the [KiloClaw Dashboard](/docs/kiloclaw/dashboard#changing-the-model) for a quick dropdown pick). - -For the full list of providers, advanced configuration, and CLI commands, see the [OpenClaw Model Providers documentation](https://docs.openclaw.ai/providers). - -## Authentication - -Auth is handled via token or password on the WebSocket handshake. Remote connections require one-time device pairing — the pairing request appears on the [KiloClaw Dashboard](/docs/kiloclaw/dashboard#pairing-requests) or in the Control UI itself. - -## Exec Approvals - -Exec approvals are the safety interlock that controls which commands your agent can run on the host machine (gateway or node). By default, **all host exec requests are denied** — you must explicitly allowlist the commands you want your agent to run independently. This prevents accidental execution of destructive commands. - -{% callout type="warning" %} -The default security policy is `deny`. You must configure an allowlist before your agent can execute any host commands. -{% /callout %} - -### How It Works - -Approvals are enforced locally on the execution host and sit on top of tool policy and elevated gating. The effective policy is always the **stricter** of `tools.exec.*` and the approvals defaults. Settings are stored in `~/.openclaw/exec-approvals.json` on the host. - -### Security Policies - -| Policy | Behavior | -| ----------- | ---------------------------------------------- | -| `deny` | Block all host exec requests (default) | -| `allowlist` | Allow only commands matching the allowlist | -| `full` | Allow everything (equivalent to elevated mode) | - -### Ask Behavior - -The `ask` setting controls when the user is prompted for approval: - -| Setting | Behavior | -| --------- | ------------------------------------------------------- | -| `off` | Never prompt | -| `on-miss` | Prompt only when the allowlist does not match (default) | -| `always` | Prompt on every command | - -If a prompt is required but no UI is reachable, the `askFallback` setting decides the outcome (`deny` by default). - -### Allowlists - -Allowlists are **per agent** — each agent has its own set of allowed command patterns. Patterns are case-insensitive globs that must resolve to binary paths (basename-only entries are ignored). - -Example patterns: - -``` -~/Projects/**/bin/rg -~/.local/bin/* -/opt/homebrew/bin/rg -``` - -Each entry tracks last-used metadata (timestamp, command, resolved path) so you can audit and keep the list tidy. - -### Approval Flow - -When a command requires approval, the gateway broadcasts the request to connected operator clients. The approval dialog shows the command, arguments, working directory, agent ID, and resolved path. You can: - -- **Allow once** — run the command now -- **Allow always** — add to the allowlist and run -- **Deny** — block the request - -Approval prompts can also be forwarded to chat channels (Slack, Telegram, Discord, etc.) and resolved with `/approve`. - -### Editing in the Control UI - -Navigate to **Nodes > Exec Approvals** in the Control UI to edit defaults, per-agent overrides, and allowlists. Select a scope (Defaults or a specific agent), adjust the policy, add or remove allowlist patterns, then save. - -## Related - -- [KiloClaw Dashboard](/docs/kiloclaw/dashboard) -- [KiloClaw Overview](/docs/kiloclaw/overview) -- [Connecting Chat Platforms](/docs/kiloclaw/chat-platforms) diff --git a/packages/kilo-docs/pages/kiloclaw/control-ui/changing-models.md b/packages/kilo-docs/pages/kiloclaw/control-ui/changing-models.md new file mode 100644 index 00000000000..63c7fb77c62 --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/control-ui/changing-models.md @@ -0,0 +1,22 @@ +--- +title: "Changing Models" +description: "Browse and switch models from the Control UI chat" +--- + +# Changing Models + +The Control UI Chat tab doubles as a command line for model management. KiloClaw exposes 335+ models through the `kilocode` provider and you can browse and switch between them without leaving the chat. + +| Command | Description | +| ------------------------------------ | ------------------------------------------------------------------------------- | +| `/model status` | View the currently active model and provider | +| `/models kilocode` | Browse available models (paginated, 20 per page) | +| `/models kilocode ` | Jump to a specific page (e.g. `/models kilocode 2`) | +| `/model kilocode//` | Switch to a specific model (e.g. `/model kilocode/anthropic/claude-sonnet-4.6`) | +| `/models kilocode all` | List every available model at once | + +Each `/models` response includes helper text at the bottom with shortcuts for switching, paging, and listing all models. + +To change the default model for all new sessions, edit `agents.defaults.model.primary` in your `openclaw.json` via **Config** in the Control UI (or the [KiloClaw Dashboard](/docs/kiloclaw/dashboard#changing-the-model) for a quick dropdown pick). + +For the full list of providers, advanced configuration, and CLI commands, see the [OpenClaw Model Providers documentation](https://docs.openclaw.ai/providers). diff --git a/packages/kilo-docs/pages/kiloclaw/control-ui/exec-approvals.md b/packages/kilo-docs/pages/kiloclaw/control-ui/exec-approvals.md new file mode 100644 index 00000000000..1188f545c43 --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/control-ui/exec-approvals.md @@ -0,0 +1,64 @@ +--- +title: "Exec Approvals" +description: "Control which commands your KiloClaw agent can run on the host machine" +--- + +# Exec Approvals + +Exec approvals are the safety interlock that controls which commands your agent can run on the host machine (gateway or node). By default, **all host exec requests are denied** — you must explicitly allowlist the commands you want your agent to run independently. This prevents accidental execution of destructive commands. + +{% callout type="warning" %} +The default security policy is `deny`. You must configure an allowlist before your agent can execute any host commands. +{% /callout %} + +## How It Works + +Approvals are enforced locally on the execution host and sit on top of tool policy and elevated gating. The effective policy is always the **stricter** of `tools.exec.*` and the approvals defaults. Settings are stored in `~/.openclaw/exec-approvals.json` on the host. + +## Security Policies + +| Policy | Behavior | +| ----------- | ---------------------------------------------- | +| `deny` | Block all host exec requests (default) | +| `allowlist` | Allow only commands matching the allowlist | +| `full` | Allow everything (equivalent to elevated mode) | + +## Ask Behavior + +The `ask` setting controls when the user is prompted for approval: + +| Setting | Behavior | +| --------- | ------------------------------------------------------- | +| `off` | Never prompt | +| `on-miss` | Prompt only when the allowlist does not match (default) | +| `always` | Prompt on every command | + +If a prompt is required but no UI is reachable, the `askFallback` setting decides the outcome (`deny` by default). + +## Allowlists + +Allowlists are **per agent** — each agent has its own set of allowed command patterns. Patterns are case-insensitive globs that must resolve to binary paths (basename-only entries are ignored). + +Example patterns: + +``` +~/Projects/**/bin/rg +~/.local/bin/* +/opt/homebrew/bin/rg +``` + +Each entry tracks last-used metadata (timestamp, command, resolved path) so you can audit and keep the list tidy. + +## Approval Flow + +When a command requires approval, the gateway broadcasts the request to connected operator clients. The approval dialog shows the command, arguments, working directory, agent ID, and resolved path. You can: + +- **Allow once** — run the command now +- **Allow always** — add to the allowlist and run +- **Deny** — block the request + +Approval prompts can also be forwarded to chat channels (Slack, Telegram, Discord, etc.) and resolved with `/approve`. + +## Editing in the Control UI + +Navigate to **Nodes > Exec Approvals** in the Control UI to edit defaults, per-agent overrides, and allowlists. Select a scope (Defaults or a specific agent), adjust the policy, add or remove allowlist patterns, then save. diff --git a/packages/kilo-docs/pages/kiloclaw/control-ui/overview.md b/packages/kilo-docs/pages/kiloclaw/control-ui/overview.md new file mode 100644 index 00000000000..564e11364eb --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/control-ui/overview.md @@ -0,0 +1,32 @@ +--- +title: "Control UI Overview" +description: "Browser-based dashboard for managing your OpenClaw instance" +--- + +# OpenClaw Control UI + +The Control UI is a browser-based dashboard (built with Vite + Lit) served by the OpenClaw Gateway on the same port as the gateway itself (default: `http://localhost:18789/`). It connects via WebSocket and gives you real-time control over your agent, channels, sessions, and system configuration. For KiloClaw users, see [Accessing the Control UI](/docs/kiloclaw/dashboard#accessing-the-control-ui) to get started. + +## Features + +- **Chat** — Send messages, stream responses with live tool-call output, view history, and abort runs. +- **Channels** — View the status of connected messaging platforms, scan QR codes for login, and edit per-channel config. +- **Sessions** — List active sessions with thinking and verbose overrides. +- **Cron Jobs** — Create, edit, enable/disable, run, and view history of scheduled tasks. +- **Skills** — View status, enable/disable, install, and manage API keys for skills. +- **Nodes** — List paired devices and their capabilities. +- **Exec Approvals** — Edit gateway or node command allowlists. See [Exec Approvals](/docs/kiloclaw/control-ui/exec-approvals). +- **Config** — View and edit `openclaw.json` with schema-based form rendering and a raw JSON editor. +- **Logs** — Live tail of gateway logs with filtering and export. +- **Debug** — Status, health, model snapshots, event log, and manual RPC calls. +- **Update** — Run package updates and restart the gateway. + +For more details, please see the official [OpenClaw documentation](https://docs.openclaw.ai/web/control-ui). + +{% callout type="warning" %} +Do not use the **Update** feature in the Control UI to update KiloClaw. Use **Redeploy** from the [KiloClaw Dashboard](/docs/kiloclaw/dashboard#redeploy) instead. Updating via the Control UI will not apply the correct KiloClaw platform image and may break your instance. +{% /callout %} + +## Authentication + +Auth is handled via token or password on the WebSocket handshake. Remote connections require one-time device pairing — the pairing request appears on the [KiloClaw Dashboard](/docs/kiloclaw/dashboard#pairing-requests) or in the Control UI itself. diff --git a/packages/kilo-docs/pages/kiloclaw/version-pinning.md b/packages/kilo-docs/pages/kiloclaw/control-ui/version-pinning.md similarity index 91% rename from packages/kilo-docs/pages/kiloclaw/version-pinning.md rename to packages/kilo-docs/pages/kiloclaw/control-ui/version-pinning.md index 5f2157e7629..9905620b83a 100644 --- a/packages/kilo-docs/pages/kiloclaw/version-pinning.md +++ b/packages/kilo-docs/pages/kiloclaw/control-ui/version-pinning.md @@ -45,9 +45,3 @@ To return to automatic updates: {% callout type="warning" %} Clearing a pin and running **Upgrade & Redeploy** will update your instance to the latest supported platform version. Review the changelog before upgrading to check for breaking changes. {% /callout %} - -## Related - -- [Dashboard Reference](/docs/kiloclaw/dashboard) -- [KiloClaw Overview](/docs/kiloclaw/overview) -- [Troubleshooting](/docs/kiloclaw/troubleshooting) diff --git a/packages/kilo-docs/pages/kiloclaw/dashboard.md b/packages/kilo-docs/pages/kiloclaw/dashboard.md index 9904f07bc74..ae04957539f 100644 --- a/packages/kilo-docs/pages/kiloclaw/dashboard.md +++ b/packages/kilo-docs/pages/kiloclaw/dashboard.md @@ -74,6 +74,10 @@ If the gateway crashes, it's automatically restarted. The machine itself can be Gateway process info is only available when the machine is running. {% /callout %} +## Instance Specs + +The specs of your instance, including number of CPUs, memory, and storage, are visible at the top right of the instance controls section. + ## Settings ### Changing the Model @@ -96,7 +100,7 @@ You can pin your instance to a specific OpenClaw version and variant from the Se Select a version and variant from the dropdowns and click **Save**. To return to automatic updates, clear the version pin and save. -See [Version Pinning](/docs/kiloclaw/version-pinning) for details. +See [Version Pinning](/docs/kiloclaw/control-ui/version-pinning) for details. ### Version Status Indicators @@ -195,4 +199,4 @@ These are the beta specifications for machines and subject to change without not - [OpenClaw Control UI](/docs/kiloclaw/control-ui) - [Connecting Chat Platforms](/docs/kiloclaw/chat-platforms) - [Troubleshooting](/docs/kiloclaw/troubleshooting) -- [KiloClaw Pricing](/docs/kiloclaw/pricing) +- [KiloClaw Pricing](/docs/kiloclaw/faq/pricing) diff --git a/packages/kilo-docs/pages/kiloclaw/development-tools/index.md b/packages/kilo-docs/pages/kiloclaw/development-tools/index.md new file mode 100644 index 00000000000..a99a3d705de --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/development-tools/index.md @@ -0,0 +1,13 @@ +--- +title: "Development Tools" +description: "Connect your KiloClaw agent to development platforms like GitHub and Google Workspace" +--- + +# Development Tools + +KiloClaw supports integrations with popular development platforms, allowing your agent to interact with repositories, code reviews, calendars, documents, and more — all autonomously. + +## Available Integrations + +- [**GitHub**](/docs/kiloclaw/development-tools/github) — Clone repositories, push commits, open pull requests, and leave code reviews. +- [**Google Workspace**](/docs/kiloclaw/development-tools/google) — Access Gmail, Calendar, Drive, Docs, Sheets, Slides, Tasks, and more. diff --git a/packages/kilo-docs/pages/kiloclaw/end-to-end.md b/packages/kilo-docs/pages/kiloclaw/end-to-end.md new file mode 100644 index 00000000000..5aa0e1913d8 --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/end-to-end.md @@ -0,0 +1,157 @@ +--- +title: "Setup walkthrough" +description: "Start-to-finish guide for configuring your KiloClaw instance" +--- + +# Setup walkthrough + +This guide walks you through a full KiloClaw setup — from creating accounts to scheduling your first automated workflow. Plan for about 60 minutes. + +## Planning your setup + +For most users, a useful KiloClaw configuration involves: + +1. A **chat platform** (called a "channel" in OpenClaw) so you can message your Claw +2. **Google services** for email, calendar, and Drive +3. **GitHub** for code and markdown syncing + +### Use dedicated accounts for your Claw + +We recommend creating **separate accounts** for your KiloClaw rather than connecting it to your personal accounts. This applies to Google, GitHub, and any other services you connect. A dedicated account improves isolation — your personal data stays separate, and you can control exactly what access the Claw has by sharing or delegating only what you want. + +### Chat platform options + +- **[Kilo Chat](https://app.kilo.ai)** — available in the web app and coming soon to iOS and Android; requires zero configuration +- **[Telegram](/docs/kiloclaw/chat-platforms/telegram)** — easy to set up, private by default +- **[Discord](/docs/kiloclaw/chat-platforms/discord)** — moderate setup +- **[Slack](/docs/kiloclaw/chat-platforms/slack)** — most involved setup + +{% callout type="warning" title="Chain-of-connection security" %} +If your Claw has access to sensitive data (like your email), be careful which chat platform you connect it to. On broadly-accessible platforms like Slack or Discord, anyone on the server could potentially message your Claw and access that data. If you're connecting sensitive integrations, use a private platform like Kilo Chat or Telegram. +{% /callout %} + +The steps below walk you through this configuration. + +## Preflight Steps + +Take these steps before configuring your Claw. + +If you are doing a [1-1 configuration call with Kilo](https://kilo.ai/kiloclaw/config-service), please complete these steps before the call. + +### Google + +Configuring Google services is by far the most involved part of setting up your Claw. + +Before configuring, take these preflight steps: + +1. **Create a Google Account for your Claw** — Go to [google.com](https://www.google.com/) and create a new Google/Gmail account dedicated to your KiloClaw. Something like `yourname.bot@gmail.com` works well. + +2. **Set up Google Cloud** — Visit [console.cloud.google.com](https://console.cloud.google.com). Accept the terms of service and click "Start my free tier". You may need to add a credit card for identity verification. + + {% callout type="info" %} + Nothing KiloClaw does costs any money with Google. + {% /callout %} + +3. **Install Docker** — KiloClaw configures Google by running a Docker container on your machine. Download Docker at [docker.com](https://www.docker.com/), then open it. You don't need to sign in or create a Docker account. + +## Other Services + +1. **Create a GitHub account for your Claw** — Using your new Gmail address, create a matching GitHub account for your Claw. + +## Set up a messaging platform + +Your Claw needs a way to communicate with you. **[Kilo Chat](https://app.kilo.ai)** requires no setup — just open the web app. For other platforms, follow the relevant guide: + +- [Telegram](/docs/kiloclaw/chat-platforms/telegram) — about 2 minutes +- [Discord](/docs/kiloclaw/chat-platforms/discord) — about 10 minutes +- [Slack](/docs/kiloclaw/chat-platforms/slack) — about 15 minutes; always use the manifest + +{% callout type="tip" %} +If you're not sure which to pick, Kilo Chat (no setup) or Telegram (2 minutes) are the easiest options. +{% /callout %} + +## Set up Google OAuth + +This lets your Claw act as the bot Google account — sending email, reading calendar, and more. Takes about 15 minutes. + +Prerequisites: Docker is installed and running, and your bot Google account is already created. + +1. In the KiloClaw dashboard, go to **Settings → Google Account** and copy the Docker command shown. +2. Open a terminal and run the command. +3. Follow the steps in the console: + - At each step, confirm you're logged in to the bot account (check the top-right corner of the screen). + - After project creation, confirm you're in the correct project. + - The last step may look like it failed — this is expected. + +For full details, see the [Google setup guide](/docs/kiloclaw/development-tools/google). + +## Set up GitHub + +A dedicated bot GitHub account is strongly recommended. Takes about 7 minutes. + +**Create a Personal Access Token (PAT):** + +1. In GitHub, go to **Settings → Developer Settings → Personal Access Tokens → Classic → Generate new token**. +2. Select these scopes: `repo`, `workflow`, `write:org`, `read:user`. + +For full details, see the [GitHub setup guide](/docs/kiloclaw/development-tools/github). + +**Set up a private workspace repo:** + +Once GitHub is connected, ask your Claw to back up its workspace: + +> Use your GitHub access to back up your workspace. Make it a GitHub repo and push it as a private repo. Add me as a member so I can see it. Then set up a cron job to pull, rebase, and push any changes at least once an hour. + +After sending that, redeploy from the dashboard to pick up the changes. + +## Grant email and calendar access + +After OAuth is set up, decide how much access to give your Claw to your personal accounts. + +| Option | What it does | Best for | Configured from | +| ----------------------- | --------------------------------------------------------------------- | ------------------------------------------ | ------------------------------------------------------- | +| Forward select emails | A Gmail filter forwards specific senders or labels to the bot account | Targeted use cases like newsletter digests | Your personal account | +| Forward all email | Forwards your full inbox to the bot | Simpler setups where noise is acceptable | Bot account (destination) | +| Full account delegation | Gives the bot direct read/write access to your personal account | Maximum capability | Your personal account — Gmail Settings → Add a delegate | + +{% callout type="info" %} +Email forwarding is configured from the **destination** (bot) account. Account delegation is configured from the **source** (personal) account. +{% /callout %} + +**Push notifications:** by default, your Claw wakes up on every incoming email. If you'd prefer a digest (e.g., once at 7am), disable push notifications in **Settings → Google Account** on the [dashboard](/docs/kiloclaw/dashboard) — otherwise it processes each email as it arrives. + +**Google Calendar:** share your personal calendar from your personal Google account. Go to **Google Calendar → Settings → Settings for my calendars → [your calendar] → Share with specific people**, and add the bot account. + +## Enable auto-approval + +By default, KiloClaw asks for confirmation before every tool call. To let it act freely, go to the [KiloClaw dashboard](https://app.kilo.ai/claw) and enable auto-approval in the **Default Permissions** section. + +## Prompt and schedule work + +### How to prompt your Claw + +Just tell it in plain language what you want. Be specific. If you want it to remember something across sessions, tell it to write it down in a specific file. + +### Scheduling jobs + +Tell your Claw when and what to do — for example: + +> Schedule a daily cron job at 7am to summarize my emails and send me a digest. + +{% callout type="tip" %} +Mentioning "cron job" helps it understand you want a recurring scheduled task. +{% /callout %} + +### Skills + +Reusable capabilities that extend what your Claw can do — things like triaging email, summarizing documents, or managing GitHub issues. You can install a pre-built skill by asking your Claw: + +> Install the [skill name] skill. + +Or ask your Claw to build a custom skill from scratch — it has a built-in skill-builder skill for exactly this. You can explore popular skills and use case inspiration at the [KiloClaw Bytes library](https://kilo.ai/kiloclaw/bytes). + +## Manage inference + +**Model picker:** Balanced is a good starting point. Frontier is more capable but significantly more expensive. + +You can also use your KiloPass credits — find this under **Profile** in the dashboard. diff --git a/packages/kilo-docs/pages/kiloclaw/faq/general.md b/packages/kilo-docs/pages/kiloclaw/faq/general.md new file mode 100644 index 00000000000..6a63a54d016 --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/faq/general.md @@ -0,0 +1,27 @@ +--- +title: "FAQ" +description: "Frequently asked questions about KiloClaw" +--- + +# FAQ + +## How can I change my model? + +You can change the model in two ways: + +- **From chat** — Type `/model` in the Chat window within the OpenClaw Control UI to switch models directly. +- **From the dashboard** — Go to [https://app.kilo.ai/claw](https://app.kilo.ai/claw), select the model you want, and click **Save**. No redeploy is needed. + +## Can I access the filesystem? + +You can access instance files in `/root/.openclaw/` directly from the [KiloClaw Dashboard](https://app.kilo.ai/claw). This is useful for examining or restoring config files. You can also interact with files through your OpenClaw agent using its built-in file tools. + +## Can I access my KiloClaw via SSH? + +For security reasons, SSH access is currently disabled for all KiloClaw instances. Our primary goal is to provide a secure environment for all users, and restricting direct SSH access is one of the many measures we take to ensure the platform remains safe and protected for everyone. + +## How can I update my OpenClaw? + +Do **not** click **Update Now** inside the OpenClaw Control UI — this is not supported for KiloClaw instances and may break your setup. + +Updates are managed by the KiloClaw platform team to ensure stability. When a new version is available, it will be announced in the **Changelog** on your dashboard. To apply the update, click **Upgrade & Redeploy** from the [KiloClaw Dashboard](/docs/kiloclaw/dashboard#redeploy). diff --git a/packages/kilo-docs/pages/kiloclaw/pricing.md b/packages/kilo-docs/pages/kiloclaw/faq/pricing.md similarity index 81% rename from packages/kilo-docs/pages/kiloclaw/pricing.md rename to packages/kilo-docs/pages/kiloclaw/faq/pricing.md index 2d4be00d332..e63d9aa99b2 100644 --- a/packages/kilo-docs/pages/kiloclaw/pricing.md +++ b/packages/kilo-docs/pages/kiloclaw/faq/pricing.md @@ -1,37 +1,31 @@ --- -title: "KiloClaw Pricing" +title: "Pricing" description: "Pricing details for KiloClaw instances and model inference" --- -# KiloClaw Pricing +# Pricing KiloClaw uses Kilo Gateway credits by default — if you route requests through BYOK, model usage is billed directly by your provider instead. -### Instance Hosting +## Instance Hosting KiloClaw hosting is **free during the beta period**. Each user gets a dedicated machine (2 shared vCPUs, 3 GB RAM, 10 GB SSD) at no cost. > ℹ️ **Info** > Beta pricing is subject to change. Paid hosting tiers may be introduced after the beta period ends. Any changes will be announced in advance. -### Model Inference +## Model Inference Model usage is charged against your [Gateway credit balance](/docs/gateway/usage-and-billing). Costs vary by model — premium models like Claude Opus or GPT-5.4-pro cost more per token than smaller models. -### Free Models +## Free Models Several models are available at **no additional cost** to your Gateway balance. These are great for getting started or for tasks that don't need the most powerful models. To see which models are currently free, check the [Kilo Leaderboard](https://kilo.ai/leaderboard#all-models) — free models are marked accordingly. -### Adding Credits +## Adding Credits You can add Gateway credits from your [Kilo account](https://app.kilo.ai). Credits are shared across all Kilo products (VSCode extension, CLI, Cloud Agents, and KiloClaw). See [Adding Credits](/docs/getting-started/adding-credits) and [Gateway Usage and Billing](/docs/gateway/usage-and-billing) for details. - -## Related - -- [KiloClaw Overview](/docs/kiloclaw/overview) -- [Connecting Chat Platforms](/docs/kiloclaw/chat-platforms) -- [Gateway Usage and Billing](/docs/gateway/usage-and-billing) diff --git a/packages/kilo-docs/pages/kiloclaw/overview.md b/packages/kilo-docs/pages/kiloclaw/overview.md index 713fa0e6cb3..40624dd2f6c 100644 --- a/packages/kilo-docs/pages/kiloclaw/overview.md +++ b/packages/kilo-docs/pages/kiloclaw/overview.md @@ -96,7 +96,7 @@ For more information on use cases: - [Dashboard Reference](/docs/kiloclaw/dashboard) - [Connecting Chat Platforms](/docs/kiloclaw/chat-platforms) - [Troubleshooting](/docs/kiloclaw/troubleshooting) -- [KiloClaw Pricing](/docs/kiloclaw/pricing) +- [KiloClaw Pricing](/docs/kiloclaw/faq/pricing) - [Gateway Usage and Billing](/docs/gateway/usage-and-billing) - [Agent Manager](/docs/automate/agent-manager) - [OpenClaw Documentation](https://docs.openclaw.ai) diff --git a/packages/kilo-docs/pages/kiloclaw/suggested-configuration.md b/packages/kilo-docs/pages/kiloclaw/suggested-configuration.md new file mode 100644 index 00000000000..fa32037e7aa --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/suggested-configuration.md @@ -0,0 +1,171 @@ +--- +title: "Setup walkthrough" +description: "Start-to-finish guide for configuring your KiloClaw instance" +--- + +# Setup walkthrough + +This guide walks you through a full KiloClaw setup — from creating accounts to scheduling your first automated workflow. Plan for about 60 minutes. + +--- + +## Planning your setup + +For most users, a useful KiloClaw configuration involves: + +1. A **chat platform** (called a "channel" in OpenClaw) so you can message your Claw +2. **Google services** for email, calendar, and Drive +3. **GitHub** for code and markdown syncing + +### Use dedicated accounts for your Claw + +We recommend creating **separate accounts** for your KiloClaw rather than connecting it to your personal accounts. This applies to Google, GitHub, and any other services you connect. A dedicated account improves isolation — your personal data stays separate, and you can control exactly what access the Claw has by sharing or delegating only what you want. + +### Chat platform options + +- **[Kilo Chat](https://app.kilo.ai)** — available in the web app and coming soon to iOS and Android; requires zero configuration +- **[Telegram](/docs/kiloclaw/chat-platforms/telegram)** — easy to set up, private by default +- **[Discord](/docs/kiloclaw/chat-platforms/discord)** — moderate setup +- **[Slack](/docs/kiloclaw/chat-platforms/slack)** — most involved setup + +{% callout type="warning" title="Chain-of-connection security" %} +If your Claw has access to sensitive data (like your email), be careful which chat platform you connect it to. On broadly-accessible platforms like Slack or Discord, anyone on the server could potentially message your Claw and access that data. If you're connecting sensitive integrations, use a private platform like Kilo Chat or Telegram. +{% /callout %} + +The steps below walk you through this configuration. + +--- + +## Preflight Steps + +Take these steps before configuring your Claw. + +If you are doing a [1-1 configuration call with Kilo](https://kilo.ai/kiloclaw/config-service), please complete these steps before the call. + +### Google + +Configuring Google services is by far the most involved part of setting up your Claw. + +Before configuring, take these preflight steps: + +1. **Create a Google Account for your Claw** — Go to [google.com](https://www.google.com/) and create a new Google/Gmail account dedicated to your KiloClaw. Something like `yourname.bot@gmail.com` works well. + +2. **Set up Google Cloud** — Visit [console.cloud.google.com](https://console.cloud.google.com). Accept the terms of service and click "Start my free tier". You may need to add a credit card for identity verification. + + {% callout type="info" %} + Nothing KiloClaw does costs any money with Google. + {% /callout %} + +3. **Install Docker** — KiloClaw configures Google by running a Docker container on your machine. Download Docker at [docker.com](https://www.docker.com/), then open it. You don't need to sign in or create a Docker account. + +## Other Services + +1. **Create a GitHub account for your Claw** — Using your new Gmail address, create a matching GitHub account for your Claw. + +--- + +## Set up a messaging platform + +Your Claw needs a way to communicate with you. **[Kilo Chat](https://app.kilo.ai)** requires no setup — just open the web app. For other platforms, follow the relevant guide: + +- [Telegram](/docs/kiloclaw/chat-platforms/telegram) — about 2 minutes +- [Discord](/docs/kiloclaw/chat-platforms/discord) — about 10 minutes +- [Slack](/docs/kiloclaw/chat-platforms/slack) — about 15 minutes; always use the manifest + +{% callout type="tip" %} +If you're not sure which to pick, Kilo Chat (no setup) or Telegram (2 minutes) are the easiest options. +{% /callout %} + +--- + +## Set up Google OAuth + +This lets your Claw act as the bot Google account — sending email, reading calendar, and more. Takes about 15 minutes. + +Prerequisites: Docker is installed and running, and your bot Google account is already created. + +1. In the KiloClaw dashboard, go to **Settings → Google Account** and copy the Docker command shown. +2. Open a terminal and run the command. +3. Follow the steps in the console: + - At each step, confirm you're logged in to the bot account (check the top-right corner of the screen). + - After project creation, confirm you're in the correct project. + - The last step may look like it failed — this is expected. + +For full details, see the [Google setup guide](/docs/kiloclaw/development-tools/google). + +--- + +## Set up GitHub + +A dedicated bot GitHub account is strongly recommended. Takes about 7 minutes. + +**Create a Personal Access Token (PAT):** + +1. In GitHub, go to **Settings → Developer Settings → Personal Access Tokens → Classic → Generate new token**. +2. Select these scopes: `repo`, `workflow`, `write:org`, `read:user`. + +For full details, see the [GitHub setup guide](/docs/kiloclaw/development-tools/github). + +**Set up a private workspace repo:** + +Once GitHub is connected, ask your Claw to back up its workspace: + +``` +Use your GitHub access to back up your workspace. Make it a GitHub repo and push it as a private repo. Add me as a member so I can see it. Then set up a cron job to pull, rebase, and push any changes at least once an hour. +``` + +After sending that, redeploy from the dashboard to pick up the changes. + +--- + +## Grant email and calendar access + +After OAuth is set up, decide how much access to give your Claw to your personal accounts. + +| Option | What it does | Best for | Configured from | +| ----------------------- | --------------------------------------------------------------------- | ------------------------------------------ | ------------------------------------------------------- | +| Forward select emails | A Gmail filter forwards specific senders or labels to the bot account | Targeted use cases like newsletter digests | Your personal account | +| Forward all email | Forwards your full inbox to the bot | Simpler setups where noise is acceptable | Bot account (destination) | +| Full account delegation | Gives the bot direct read/write access to your personal account | Maximum capability | Your personal account — Gmail Settings → Add a delegate | + +{% callout type="info" %} +Email forwarding is configured from the **destination** (bot) account. Account delegation is configured from the **source** (personal) account. +{% /callout %} + +**Push notifications:** by default, your Claw wakes up on every incoming email. If you'd prefer a digest (e.g., once at 7am), disable push notifications in **Settings → Google Account** on the [dashboard](/docs/kiloclaw/dashboard) — otherwise it processes each email as it arrives. + +**Google Calendar:** share your personal calendar from your personal Google account. Go to **Google Calendar → Settings → Settings for my calendars → [your calendar] → Share with specific people**, and add the bot account. + +--- + +## Enable auto-approval + +By default, KiloClaw asks for confirmation before every tool call. To let it act freely, go to the [KiloClaw dashboard](https://app.kilo.ai/claw) and enable auto-approval in the **Default Permissions** section. + +--- + +## Prompt and schedule work + +**How to prompt your Claw:** just tell it in plain language what you want. Be specific. If you want it to remember something across sessions, tell it to write it down in a specific file. + +**Scheduling jobs:** tell your Claw when and what to do — for example: + +``` +Every day at 7am, summarize my emails and send me a digest. +``` + +Mentioning "cron job" helps it understand you want a recurring scheduled task. + +**Skills:** the OpenClaw Skills hub has pre-built capabilities you can add. The easiest way to install a skill is to just ask your Claw by name: + +``` +Install the [skill name] skill. +``` + +--- + +## Manage inference + +**Model picker:** Balanced is a good starting point. Frontier is more capable but significantly more expensive. + +You can also use your KiloPass credits — find this under **Profile** in the dashboard. diff --git a/packages/kilo-docs/pages/kiloclaw/tools/1password.md b/packages/kilo-docs/pages/kiloclaw/tools/1password.md new file mode 100644 index 00000000000..10868c41ef4 --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/tools/1password.md @@ -0,0 +1,37 @@ +--- +title: "1Password Integration" +description: "Connect your KiloClaw agent to 1Password to securely manage credentials" +--- + +# 1Password Integration Guide + +Connect your KiloClaw agent to 1Password to securely manage credentials. This allows your agent to fetch API keys or passwords without ever seeing them in plain text. + +## Step 1: Create a Dedicated Vault + +For maximum security, do not give the bot access to your personal vault. + +1. Log in to your 1Password account. +2. Create a **New Vault** (e.g., name it `Kilo-Agent-Vault`). +3. Move only the specific items/keys you want the bot to use into this vault. + +## Step 2: Generate a Service Account Token + +1. Go to the [1Password Developer Portal](https://developer.1password.com/). +2. Select **Service Accounts** and click **Create a Service Account**. +3. **Important:** When prompted for permissions, select only the dedicated vault you created in Step 1. +4. Copy the generated token (it will begin with `ops_`). + +## Step 3: Configure KiloClaw + +1. Navigate to your KiloClaw dashboard: [app.kilo.ai/claw](https://app.kilo.ai/claw). +2. Go to **Settings > Tools** (or **Edit Files**). +3. Paste your `ops_` token into the **1Password Setup** field. +4. Click **Save**. + +## Step 4: Activate the Integration + +To apply the changes and inject the 1Password CLI into your environment: + +1. Select **Upgrade to latest**. +2. Perform a **Redeploy** to restart the agent with the new permissions active. diff --git a/packages/kilo-docs/pages/kiloclaw/tools/agentcard.md b/packages/kilo-docs/pages/kiloclaw/tools/agentcard.md new file mode 100644 index 00000000000..79a23bf4622 --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/tools/agentcard.md @@ -0,0 +1,44 @@ +--- +title: "AgentCard Integration" +description: "Enable your KiloClaw agents to perform financial transactions with virtual debit cards" +--- + +# AgentCard Integration + +Enable your KiloClaw agents to perform financial transactions by creating and managing virtual debit cards. This integration allows for automated purchasing and expense management within set limits. + +## AgentCard Setup + +### 1. Create an AgentCard Account + +Install the AgentCard CLI and sign up via your terminal: + +```bash +agent-cards signup +``` + +### 2. Add a Payment Method + +Link your funding source (via Stripe) to enable the creation of virtual cards: + +```bash +agent-cards payment-method +``` + +### 3. Retrieve Your API Key + +Open your local configuration file located at `~/.agent-cards/config.json`. Copy the value assigned to the `jwt` key. + +### 4. Configure KiloClaw + +1. Paste the **JWT** into the AgentCard setup field in your KiloClaw settings. +2. Click **Save**. +3. Use **Redeploy** to apply the new secret. Only use **Upgrade & Redeploy** if you also need the latest platform version. + +## Available Tools + +Once activated, your agent will have access to: + +- `create_card`: Generate a new virtual debit card. +- `list_cards`: View existing cards and their statuses. +- `check_balance`: Monitor available funds. diff --git a/packages/kilo-docs/pages/kiloclaw/tools/brave-search.md b/packages/kilo-docs/pages/kiloclaw/tools/brave-search.md new file mode 100644 index 00000000000..6d448c3dada --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/tools/brave-search.md @@ -0,0 +1,28 @@ +--- +title: "Brave Search Integration" +description: "Equip your KiloClaw agent with real-time web browsing via the Brave Search API" +--- + +# Brave Search Integration + +Equip your KiloClaw agent with real-time web browsing capabilities by integrating the Brave Search API. This allows the agent to fetch up-to-date information, perform market research, and verify facts beyond its training data. + +## How to Generate a Brave Search API Key + +To get started, you will need to obtain a "BSA" (Brave Search API) key from the Brave developer portal. + +### 1. Access the Brave Search Dashboard + +Go to [api.search.brave.com](https://api.search.brave.com) and sign in or create a developer account. + +### 2. Choose a Subscription Plan + +Brave Search API requires a paid subscription. Select the plan that fits your usage volume. + +### 3. Create an API Key + +Once your account is active, navigate to the **API Keys** section and click **"Create New Key."** + +### 4. Copy the Key + +Your key will typically begin with the prefix `BSA`. Copy this key immediately, as it may not be displayed again for security reasons. diff --git a/packages/kilo-docs/pages/kiloclaw/tools/index.md b/packages/kilo-docs/pages/kiloclaw/tools/index.md new file mode 100644 index 00000000000..4a17e3289e7 --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/tools/index.md @@ -0,0 +1,14 @@ +--- +title: "Tools" +description: "Third-party tool integrations for your KiloClaw agent" +--- + +# Tools + +KiloClaw supports integrations with third-party tools that extend your agent's capabilities — from secure credential management to web search and financial transactions. + +## Available Integrations + +- [**1Password**](/docs/kiloclaw/tools/1password) — Securely manage credentials and let your agent fetch API keys or passwords without ever seeing them in plain text. +- [**Brave Search**](/docs/kiloclaw/tools/brave-search) — Equip your agent with real-time web browsing via the Brave Search API. +- [**AgentCard**](/docs/kiloclaw/tools/agentcard) — Enable your agent to perform financial transactions using virtual debit cards. diff --git a/packages/kilo-docs/pages/kiloclaw/triggers/index.md b/packages/kilo-docs/pages/kiloclaw/triggers/index.md new file mode 100644 index 00000000000..10412d71eb3 --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/triggers/index.md @@ -0,0 +1,32 @@ +--- +title: "Triggers" +description: "Automate your KiloClaw agent with webhooks and scheduled triggers" +--- + +# Triggers + +Triggers let external events and schedules drive your KiloClaw agent automatically. Instead of typing every instruction yourself, triggers deliver messages to your agent on your behalf. This lets it react to real-world events or run tasks on a schedule without polling. + +All triggers are managed from the **Settings** tab on your [KiloClaw dashboard](/docs/kiloclaw/dashboard). + +## Trigger Types + +| Type | Description | Status | +| --- | --- | --- | +| [**Webhooks**](/docs/kiloclaw/triggers/webhooks) | Receive HTTP requests from external services (GitHub, Stripe, monitoring tools, etc.) and deliver them as chat messages to your agent | Available | +| **Time-based** | Run tasks on a schedule using cron expressions | Coming soon | + +## How Triggers Work + +1. An event occurs (an HTTP request arrives, or a schedule fires) +2. The trigger validates the request and renders the payload through a **prompt template** +3. The rendered message is delivered to your KiloClaw instance as a chat message +4. Your agent processes and responds like any other conversation + +Prompt templates give you control over how payloads are presented to your agent. You can include instructions, context, and formatting alongside the raw event data. + +## Related + +- [Webhooks](/docs/kiloclaw/triggers/webhooks) +- [KiloClaw Overview](/docs/kiloclaw/overview) +- [Dashboard Reference](/docs/kiloclaw/dashboard) diff --git a/packages/kilo-docs/pages/kiloclaw/triggers/webhooks.md b/packages/kilo-docs/pages/kiloclaw/triggers/webhooks.md new file mode 100644 index 00000000000..c2c04cdabbf --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/triggers/webhooks.md @@ -0,0 +1,110 @@ +--- +title: "Webhooks" +description: "Trigger your KiloClaw agent from external events using webhooks" +--- + +# Webhooks + +KiloClaw supports inbound webhooks so external events can trigger your agent automatically. Form submissions, alerts, calendar updates, ecommerce orders, IoT sensor data; anything that can send an HTTP request can kick off a conversation with your agent. When a webhook fires, the payload is rendered through a prompt template and delivered as a chat message to your KiloClaw instance. The agent processes and responds as if you typed it yourself. + +## Setup + +1. Go to the **Settings** tab on your [KiloClaw dashboard](/docs/kiloclaw/dashboard) +2. Find the **Webhook Integration** card and click **Manage** +3. Click **Set Up Webhook** + +KiloClaw generates a unique webhook URL for your instance. Copy it and configure it as the destination in whatever service you want to receive events from (GitHub, Stripe, a monitoring tool, etc.). + +{% callout type="warning" title="Treat the URL as a secret" %} +The webhook URL contains 128 bits of entropy and acts as its own credential (similar to Slack webhook URLs). Anyone with the URL can send messages to your instance. Do not commit it to public repositories or share it in public channels. +{% /callout %} + +## How It Works + +1. An external service sends an HTTP POST to your webhook URL +2. The webhook worker validates the request (and optionally checks authentication) +3. The payload is rendered through your **prompt template** (see below) +4. The rendered message is delivered to your KiloClaw instance as a chat message +5. Your agent receives and responds to the message like any other conversation + +## Prompt Template + +The prompt template controls how webhook payloads are presented to your agent. You can customize it from the **Webhook Integration** section in Settings. + +**Default template:** + +``` +You received a webhook event. Here is the payload: + +{{bodyJson}} +``` + +**Available variables:** + +| Variable | Description | +| --- | --- | +| `{{body}}` | Raw request body | +| `{{bodyJson}}` | Pretty-printed JSON body | +| `{{method}}` | HTTP method (e.g., `POST`) | +| `{{headers}}` | Request headers | +| `{{path}}` | Request path | +| `{{query}}` | Query string parameters | +| `{{timestamp}}` | Time the webhook was received | + +You can tailor the template to give your agent more context. For example: + +``` +A GitHub push event just arrived. Summarize the changes and open a PR if any tests are affected. + +Payload: +{{bodyJson}} +``` + +## Managing Your Webhook + +Once set up, the Webhook Integration card in Settings gives you several controls: + +### Pause and Resume + +Toggle the **Active/Paused** switch to temporarily stop accepting webhooks without deleting the URL. When paused, incoming requests are rejected. Resume at any time to start accepting them again. + +### Rotate URL + +If your webhook URL is compromised, click **Rotate URL** to generate a new one. This immediately invalidates the old URL, so you will need to update your integrations with the new URL afterward. A confirmation dialog is shown before rotation. + +### Webhook Authentication (Optional) + +For additional security, you can require inbound requests to include a shared secret header. This is useful when the sending service supports webhook signing. + +1. Toggle **Webhook Authentication** to enabled +2. Set the **Secret Header** name (default: `x-webhook-secret`) +3. Enter a **Shared Secret** value +4. Click **Save** + +Requests missing the header or providing an incorrect secret are rejected. + +{% callout type="note" title="Authentication is optional" %} +The webhook URL itself is already a credential (128-bit entropy). Authentication adds a second layer and is only needed if your sending service requires or supports it. +{% /callout %} + +## Viewing Webhook Activity + +KiloClaw webhooks also appear in the **Webhooks** page under Cloud (read only). From there you can click **View Captured Requests** to inspect recent payloads, response codes, and timing. This is useful for debugging integration issues. + +## Example: GitHub Push Notifications + +1. Set up a webhook in your KiloClaw Settings +2. In your GitHub repository, go to **Settings > Webhooks > Add webhook** +3. Paste your KiloClaw webhook URL as the **Payload URL** +4. Set **Content type** to `application/json` +5. Select the events you want to trigger on (e.g., **Just the push event**) +6. Click **Add webhook** + +Now every push to that repository sends a payload to your agent. Customize the prompt template to tell the agent what to do with it. You could have it summarize commits, run checks, notify a channel, or anything else. + +## Related + +- [KiloClaw Overview](/docs/kiloclaw/overview) +- [Dashboard Reference](/docs/kiloclaw/dashboard) +- [GitHub Integration](/docs/kiloclaw/development-tools/github) +- [Connecting Chat Platforms](/docs/kiloclaw/chat-platforms) diff --git a/packages/kilo-docs/pages/kiloclaw/troubleshooting.md b/packages/kilo-docs/pages/kiloclaw/troubleshooting.md deleted file mode 100644 index c3f07a9f0a0..00000000000 --- a/packages/kilo-docs/pages/kiloclaw/troubleshooting.md +++ /dev/null @@ -1,101 +0,0 @@ ---- -title: "Troubleshooting" -description: "Common issues, diagnostics, and FAQ for KiloClaw instances" ---- - -# Troubleshooting - -## OpenClaw Doctor - -OpenClaw Doctor is the recommended first step when something isn't working. It runs diagnostics on your instance and automatically fixes common configuration issues. - -To use it: - -1. Make sure your instance is running -2. Click **OpenClaw Doctor** on your [dashboard](/docs/kiloclaw/dashboard) -3. Watch the output as it runs — results appear in real time - -## Common Questions - -### Does Redeploy reset my instance? - -No. Redeploy does **not** delete your files, git repos, or cron jobs. It stops the machine, applies the latest platform image and your current configuration, and starts it again with the same persistent storage. Think of it as "update and restart." - -### When should I use Restart OpenClaw vs Redeploy? - -- **Restart OpenClaw** — Restarts just the OpenClaw process. The machine stays up. Use this for quick recovery from a process-level issue or when you want to apply openclaw config changes. -- **Redeploy** — Stops and restarts the entire machine with the latest image and config. Use this when the changelog shows a redeploy hint, or after changing channel tokens or secrets. - -### My bot isn't responding on Telegram/Discord/Slack - -1. Check that the channel token is configured in [Settings](/docs/kiloclaw/dashboard#channels) -2. Make sure you **Redeployed** or **Restarted OpenClaw** after saving tokens -3. Check for pending [pairing requests](/docs/kiloclaw/chat-platforms#pairing-requests) — the user may need to be approved -4. Try running **OpenClaw Doctor** - -### Accessing and Restoring Config Files - -You can directly access the files in /root/.openclaw/ on the [KiloClaw Dashboard](https://app.kilo.ai/claw) using the file browser of the edit files dialog. This can be a useful way to examine or update the config files (especially `openclaw.json`) if you run into an issue. There may also be backups in the form of `openclaw.bak` files that you can manually restore from if needed. - -### The gateway shows "Crashed" - -The OpenClaw process is automatically restarted when it crashes. Check the Gateway Process tab on your dashboard for the exit code and restart count. If it keeps crashing: - -1. Run **OpenClaw Doctor** -2. Try a **Redeploy** to apply the latest platform image -3. If the issue persists, join the [Kilo Discord](https://kilo.ai/discord) and share details in the KiloClaw channel - -### I changed the model but the agent is still using the old one - -After selecting a new model, click **Save & Provision** to apply it. This refreshes the API key and saves the new model. You may also need to **Restart OpenClaw** for the change to take full effect. - -## Gateway Process States - -The Gateway Process tab shows the current state of the OpenClaw process inside your machine: - -- **Running** — The process is up and handling requests -- **Stopped** — The process is not running -- **Starting** — The process is booting up -- **Stopping** — The process is shutting down gracefully -- **Crashed** — The process exited unexpectedly and will be automatically restarted -- **Shutting Down** — The process is stopping as part of a machine stop or redeploy - -## FAQ - -### How can I change my model? - -You can change the model in two ways: - -- **From chat** — Type `/model` in the Chat window within the OpenClaw Control UI to switch models directly. -- **From the dashboard** — Go to [https://app.kilo.ai/claw](https://app.kilo.ai/claw), select the model you want, and click **Save**. No redeploy is needed. - -### Can I access the filesystem? - -You can access instance files in `/root/.openclaw/` directly from the [KiloClaw Dashboard](https://app.kilo.ai/claw). This is useful for examining or restoring config files — see [Accessing and Restoring Config Files](#accessing-and-restoring-config-files) above. You can also interact with files through your OpenClaw agent using its built-in file tools. - -### Can I access my KiloClaw via SSH? - -For security reasons, SSH access is currently disabled for all KiloClaw instances. Our primary goal is to provide a secure environment for all users, and restricting direct SSH access is one of the many measures we take to ensure the platform remains safe and protected for everyone. - -### How can I update my OpenClaw? - -Do **not** click **Update Now** inside the OpenClaw Control UI — this is not supported for KiloClaw instances and may break your setup. - -Updates are managed by the KiloClaw platform team to ensure stability. When a new version is available, it will be announced in the **Changelog** on your dashboard. To apply the update, click **Upgrade & Redeploy** from the [KiloClaw Dashboard](/docs/kiloclaw/dashboard#redeploy). - -## Architecture Notes - -For advanced users — how KiloClaw instances are structured: - -- **Dedicated machine** — Each user gets their own machine and persistent volume. There is no shared infrastructure between users. -- **Region-pinned storage** — Your persistent volume stays in the region where your instance was originally created. -- **Network isolation** — OpenClaw binds to loopback only; external traffic is proxied through a Kilo controller. -- **Per-user authentication** — The gateway token is derived per-user for authenticating requests to your machine. -- **Encryption at rest** — Sensitive data (API keys, channel tokens) is encrypted at rest in the machine configuration. - -## Related - -- [KiloClaw Overview](/docs/kiloclaw/overview) -- [Dashboard Reference](/docs/kiloclaw/dashboard) -- [Connecting Chat Platforms](/docs/kiloclaw/chat-platforms) -- [KiloClaw Pricing](/docs/kiloclaw/pricing) diff --git a/packages/kilo-docs/pages/kiloclaw/troubleshooting/architecture.md b/packages/kilo-docs/pages/kiloclaw/troubleshooting/architecture.md new file mode 100644 index 00000000000..2290fb1b9c2 --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/troubleshooting/architecture.md @@ -0,0 +1,14 @@ +--- +title: "Architecture Notes" +description: "How KiloClaw instances are structured" +--- + +# Architecture Notes + +For advanced users — how KiloClaw instances are structured: + +- **Dedicated machine** — Each user gets their own machine and persistent volume. There is no shared infrastructure between users. +- **Region-pinned storage** — Your persistent volume stays in the region where your instance was originally created. +- **Network isolation** — OpenClaw binds to loopback only; external traffic is proxied through a Kilo controller. +- **Per-user authentication** — The gateway token is derived per-user for authenticating requests to your machine. +- **Encryption at rest** — Sensitive data (API keys, channel tokens) is encrypted at rest in the machine configuration. diff --git a/packages/kilo-docs/pages/kiloclaw/troubleshooting/common-questions.md b/packages/kilo-docs/pages/kiloclaw/troubleshooting/common-questions.md new file mode 100644 index 00000000000..1c49d2a39df --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/troubleshooting/common-questions.md @@ -0,0 +1,48 @@ +--- +title: "Common Questions" +description: "Answers to common KiloClaw troubleshooting questions" +--- + +# Common Questions + +## OpenClaw Doctor + +OpenClaw Doctor is the recommended first step when something isn't working. It runs diagnostics on your instance and automatically fixes common configuration issues. + +To use it: + +1. Make sure your instance is running +2. Click **OpenClaw Doctor** on your [dashboard](/docs/kiloclaw/dashboard) +3. Watch the output as it runs — results appear in real time + +## Does Redeploy reset my instance? + +No. Redeploy does **not** delete your files, git repos, or cron jobs. It stops the machine, applies the latest platform image and your current configuration, and starts it again with the same persistent storage. Think of it as "update and restart." + +## When should I use Restart OpenClaw vs Redeploy? + +- **Restart OpenClaw** — Restarts just the OpenClaw process. The machine stays up. Use this for quick recovery from a process-level issue or when you want to apply openclaw config changes. +- **Redeploy** — Stops and restarts the entire machine with the latest image and config. Use this when the changelog shows a redeploy hint, or after changing channel tokens or secrets. + +## My bot isn't responding on Telegram/Discord/Slack + +1. Check that the channel token is configured in [Settings](/docs/kiloclaw/dashboard#channels) +2. Make sure you **Redeployed** or **Restarted OpenClaw** after saving tokens +3. Check for pending pairing requests — the user may need to be approved +4. Try running **OpenClaw Doctor** + +## Accessing and Restoring Config Files + +You can directly access the files in `/root/.openclaw/` on the [KiloClaw Dashboard](https://app.kilo.ai/claw) using the file browser of the edit files dialog. This can be a useful way to examine or update the config files (especially `openclaw.json`) if you run into an issue. There may also be backups in the form of `openclaw.bak` files that you can manually restore from if needed. + +## The gateway shows "Crashed" + +The OpenClaw process is automatically restarted when it crashes. Check the Gateway Process tab on your dashboard for the exit code and restart count. If it keeps crashing: + +1. Run **OpenClaw Doctor** +2. Try a **Redeploy** to apply the latest platform image +3. If the issue persists, join the [Kilo Discord](https://kilo.ai/discord) and share details in the KiloClaw channel + +## I changed the model but the agent is still using the old one + +After selecting a new model, click **Save & Provision** to apply it. This refreshes the API key and saves the new model. You may also need to **Restart OpenClaw** for the change to take full effect. diff --git a/packages/kilo-docs/pages/kiloclaw/troubleshooting/faq.md b/packages/kilo-docs/pages/kiloclaw/troubleshooting/faq.md new file mode 100644 index 00000000000..6a63a54d016 --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/troubleshooting/faq.md @@ -0,0 +1,27 @@ +--- +title: "FAQ" +description: "Frequently asked questions about KiloClaw" +--- + +# FAQ + +## How can I change my model? + +You can change the model in two ways: + +- **From chat** — Type `/model` in the Chat window within the OpenClaw Control UI to switch models directly. +- **From the dashboard** — Go to [https://app.kilo.ai/claw](https://app.kilo.ai/claw), select the model you want, and click **Save**. No redeploy is needed. + +## Can I access the filesystem? + +You can access instance files in `/root/.openclaw/` directly from the [KiloClaw Dashboard](https://app.kilo.ai/claw). This is useful for examining or restoring config files. You can also interact with files through your OpenClaw agent using its built-in file tools. + +## Can I access my KiloClaw via SSH? + +For security reasons, SSH access is currently disabled for all KiloClaw instances. Our primary goal is to provide a secure environment for all users, and restricting direct SSH access is one of the many measures we take to ensure the platform remains safe and protected for everyone. + +## How can I update my OpenClaw? + +Do **not** click **Update Now** inside the OpenClaw Control UI — this is not supported for KiloClaw instances and may break your setup. + +Updates are managed by the KiloClaw platform team to ensure stability. When a new version is available, it will be announced in the **Changelog** on your dashboard. To apply the update, click **Upgrade & Redeploy** from the [KiloClaw Dashboard](/docs/kiloclaw/dashboard#redeploy). diff --git a/packages/kilo-docs/pages/kiloclaw/troubleshooting/gateway-process.md b/packages/kilo-docs/pages/kiloclaw/troubleshooting/gateway-process.md new file mode 100644 index 00000000000..045139fa11c --- /dev/null +++ b/packages/kilo-docs/pages/kiloclaw/troubleshooting/gateway-process.md @@ -0,0 +1,15 @@ +--- +title: "Gateway Process States" +description: "Understanding KiloClaw gateway process states" +--- + +# Gateway Process States + +The Gateway Process tab shows the current state of the OpenClaw process inside your machine: + +- **Running** — The process is up and handling requests +- **Stopped** — The process is not running +- **Starting** — The process is booting up +- **Stopping** — The process is shutting down gracefully +- **Crashed** — The process exited unexpectedly and will be automatically restarted +- **Shutting Down** — The process is stopping as part of a machine stop or redeploy diff --git a/packages/kilo-docs/previous-docs-redirects.js b/packages/kilo-docs/previous-docs-redirects.js index 60b42f13cf2..c6d3804f430 100644 --- a/packages/kilo-docs/previous-docs-redirects.js +++ b/packages/kilo-docs/previous-docs-redirects.js @@ -1,4 +1,10 @@ module.exports = [ + { + source: "/docs/contributing/cline-to-kilo-migration", + destination: "/docs/contributing", + basePath: false, + permanent: true, + }, { source: "/docs/contributing/architecture/model-provider-blocklist", destination: "/docs/collaborate/enterprise/model-access-controls", @@ -138,7 +144,7 @@ module.exports = [ }, { source: "/docs/basic-usage/using-modes", - destination: "/docs/code-with-ai/agents/using-modes", + destination: "/docs/code-with-ai/agents/using-agents", basePath: false, permanent: true, }, @@ -807,4 +813,10 @@ module.exports = [ basePath: false, permanent: true, }, + { + source: "/docs/code-with-ai/agents/using-modes", + destination: "/docs/code-with-ai/agents/using-agents", + basePath: false, + permanent: true, + }, ] diff --git a/packages/kilo-docs/public/globals.css b/packages/kilo-docs/public/globals.css index 1dd89b9e0a4..ecc0be3b3fc 100644 --- a/packages/kilo-docs/public/globals.css +++ b/packages/kilo-docs/public/globals.css @@ -182,6 +182,15 @@ a:hover { color: #dcdcaa; } +/* Blockquotes */ +.article-content blockquote { + border-left: 3px solid var(--border-color); + margin: 1em 0; + padding: 0.25em 1em; + color: var(--text-secondary); + font-style: italic; +} + /* Lists - Override Tailwind's reset to restore default list styling */ .article-content ul, .article-content ol { diff --git a/packages/kilo-docs/source-links.md b/packages/kilo-docs/source-links.md index b6e0e4a57f9..a92e7a29d83 100644 --- a/packages/kilo-docs/source-links.md +++ b/packages/kilo-docs/source-links.md @@ -3,6 +3,9 @@ +- + + - - diff --git a/packages/kilo-gateway/package.json b/packages/kilo-gateway/package.json index 696ca04e5be..e4c6bc17e36 100644 --- a/packages/kilo-gateway/package.json +++ b/packages/kilo-gateway/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@kilocode/kilo-gateway", - "version": "7.1.5", + "version": "7.1.17", "type": "module", "license": "MIT", "description": "Unified Kilo Gateway package for OpenCode - authentication, provider, and API integration", @@ -30,7 +30,7 @@ "@kilocode/plugin": "workspace:*", "@kilocode/sdk": "workspace:*", "@ai-sdk/anthropic": "2.0.65", - "@ai-sdk/openai": "2.0.89", + "@ai-sdk/openai": "2.0.101", "@ai-sdk/openai-compatible": "1.0.32", "@openrouter/ai-sdk-provider": "1.5.4", "@clack/prompts": "1.0.0-alpha.1", diff --git a/packages/kilo-gateway/src/auth/device-auth-tui.ts b/packages/kilo-gateway/src/auth/device-auth-tui.ts index 8d233f26b82..466aca7baaf 100644 --- a/packages/kilo-gateway/src/auth/device-auth-tui.ts +++ b/packages/kilo-gateway/src/auth/device-auth-tui.ts @@ -1,4 +1,4 @@ -import open from "open" +import { execFile } from "child_process" import type { DeviceAuthInitiateResponse, DeviceAuthPollResponse } from "../types.js" import { poll } from "./polling.js" import { getKiloProfile, getKiloDefaultModel } from "../api/profile.js" @@ -70,10 +70,14 @@ export async function authenticateWithDeviceAuthTUI(inputs?: Record { - // Silently fail if browser can't be opened - user can manually open URL - }) + // Step 2: Open browser (windowsHide: true prevents cmd.exe flash on Windows) + const [cmd, ...args] = + process.platform === "darwin" + ? ["open", verificationUrl] + : process.platform === "win32" + ? ["cmd", "/c", "start", "", verificationUrl] + : ["xdg-open", verificationUrl] + execFile(cmd, args, { windowsHide: true }) // Step 3: Return instructions and callback for TUI to handle return { diff --git a/packages/kilo-i18n/package.json b/packages/kilo-i18n/package.json index 61d49a06fd0..65b6485f300 100644 --- a/packages/kilo-i18n/package.json +++ b/packages/kilo-i18n/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@kilocode/kilo-i18n", - "version": "7.1.5", + "version": "7.1.17", "type": "module", "license": "MIT", "description": "Kilo-specific i18n translations and overrides", diff --git a/packages/kilo-i18n/src/uk.ts b/packages/kilo-i18n/src/uk.ts new file mode 100644 index 00000000000..458772d31b1 --- /dev/null +++ b/packages/kilo-i18n/src/uk.ts @@ -0,0 +1,72 @@ +export const dict = { + // Kilo Gateway provider translations + "provider.connect.kiloGateway.line1": + "Kilo Gateway надає доступ до добірки надійних оптимізованих моделей для агентів кодування.", + "provider.connect.kiloGateway.line2": + "За допомогою одного API-ключа ви отримаєте доступ до таких моделей, як Claude, GPT, Gemini, GLM та інших.", + "provider.connect.kiloGateway.visit.prefix": "Відвідайте ", + "provider.connect.kiloGateway.visit.link": "kilo.ai", + "provider.connect.kiloGateway.visit.suffix": " щоб отримати свій API-ключ.", + + // Provider dialog translations + "dialog.provider.group.recommended": "Рекомендовані", + "dialog.provider.kilo.note": "Доступ до 500+ моделей ШІ", + + // Reasoning block label + "ui.permission.run": "Виконати", + "ui.reasoning.label": "Міркування", + + // Marketplace + "marketplace.tab.skills": "Навички", + "marketplace.tab.mcpServers": "MCP-сервери", + "marketplace.tab.modes": "Режими", + "marketplace.category.all": "Усі", + "marketplace.placeholder": "Буде реалізовано", + "marketplace.card.installed": "Встановлено", + "marketplace.card.install": "Встановити", + "marketplace.card.remove": "Видалити", + "marketplace.card.removeScope": "Видалити ({{scope}})", + "marketplace.card.showMore": "Показати більше", + "marketplace.card.showLess": "Показати менше", + "marketplace.install.title": "Встановити {{name}}", + "marketplace.install.scope": "Область", + "marketplace.install.scope.project": "Проєкт", + "marketplace.install.scope.global": "Глобально", + "marketplace.install.prerequisites": "Передумови", + "marketplace.install.installing": "Встановлення...", + "marketplace.install.cancel": "Скасувати", + "marketplace.install.success": "Успішно встановлено!", + "marketplace.install.failed": "Встановлення не вдалося", + "marketplace.install.done": "Готово", + "marketplace.install.close": "Закрити", + "marketplace.remove.title": "Видалити {{name}}?", + "marketplace.remove.confirm": + "Ви впевнені, що хочете видалити цей {{type}}? Це видалить його з вашої конфігурації {{scope}}.", + "marketplace.remove.cancel": "Скасувати", + "marketplace.remove.confirm.button": "Видалити", + "marketplace.tab.mcp": "MCP", + "marketplace.search": "Пошук...", + "marketplace.filter.all": "Усі елементи", + "marketplace.filter.notInstalled": "Не встановлено", + "marketplace.empty": "Елементів не знайдено", + "marketplace.badge.mcpServer": "MCP-сервер", + "marketplace.badge.mode": "Режим", + "marketplace.card.by": "від {{author}}", + "marketplace.install.method": "Метод встановлення", + "marketplace.install.parameters": "Параметри", + "marketplace.install.optional": "(необов'язково)", + "marketplace.install.required": "{{name}} є обов'язковим", + "marketplace.scope.project": "проєкт", + "marketplace.scope.global": "глобально", + "marketplace.remove.type.mcp": "MCP-сервер", + "marketplace.remove.type.skill": "навичка", + "marketplace.remove.type.mode": "режим", + "marketplace.remove.failed": "Не вдалося видалити {{name}}", + "marketplace.install": "Встановити", + "marketplace.filter.installed": "Встановлено", + "marketplace.error.dismiss": "Закрити", + "marketplace.warning.busyOne": "Виконується одна сесія, її буде перервано", + "marketplace.warning.busyMany": "Виконується кілька сесій, їх буде перервано", + "marketplace.warning.installAnyway": "Встановити все одно", + "marketplace.warning.cancel": "Скасувати", +} diff --git a/packages/kilo-telemetry/package.json b/packages/kilo-telemetry/package.json index 2142f3c6609..15bf57d2d65 100644 --- a/packages/kilo-telemetry/package.json +++ b/packages/kilo-telemetry/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@kilocode/kilo-telemetry", - "version": "7.1.5", + "version": "7.1.17", "type": "module", "license": "MIT", "description": "Telemetry for Kilo CLI - PostHog analytics integration", diff --git a/packages/kilo-ui/package.json b/packages/kilo-ui/package.json index 182ef0bd2ce..eddf942797e 100644 --- a/packages/kilo-ui/package.json +++ b/packages/kilo-ui/package.json @@ -1,6 +1,6 @@ { "name": "@kilocode/kilo-ui", - "version": "7.1.5", + "version": "7.1.17", "type": "module", "license": "MIT", "exports": { diff --git a/packages/kilo-ui/src/components/message-part.tsx b/packages/kilo-ui/src/components/message-part.tsx index ac6b5a4cf21..187a6a2df21 100644 --- a/packages/kilo-ui/src/components/message-part.tsx +++ b/packages/kilo-ui/src/components/message-part.tsx @@ -669,6 +669,15 @@ function isContextGroupTool(part: PartType): part is ToolPart { function ExaOutput(props: { output?: string }) { const links = createMemo(() => urls(props.output)) + const data = useData() + + const open = (url: string, event: MouseEvent) => { + event.stopPropagation() + event.preventDefault() + const handler = data.openUrl + if (handler) return handler(url) + window.open(url, "_blank", "noopener,noreferrer") + } return ( 0}> @@ -676,13 +685,7 @@ function ExaOutput(props: { output?: string }) {
{(url) => ( - event.stopPropagation()} - > + {url} )} @@ -1306,6 +1309,15 @@ function useToolReveal(pending: () => boolean, animate?: () => boolean) { function WebfetchMeta(props: { url: string; animate?: boolean }) { let ref: HTMLSpanElement | undefined useToolFade(() => ref, { wipe: true, animate: props.animate }) + const data = useData() + + const open = (event: MouseEvent) => { + event.stopPropagation() + event.preventDefault() + const handler = data.openUrl + if (handler) return handler(props.url) + window.open(props.url, "_blank", "noopener,noreferrer") + } return ( @@ -1316,11 +1328,11 @@ function WebfetchMeta(props: { url: string; animate?: boolean }) { href={props.url} target="_blank" rel="noopener noreferrer" - onClick={(event) => event.stopPropagation()} + onClick={open} > {props.url} -
+
@@ -2007,8 +2019,8 @@ interface ApplyPatchFile { relativePath: string type: "add" | "update" | "delete" | "move" diff: string - before: string - after: string + before?: string + after?: string additions: number deletions: number movePath?: string @@ -2158,7 +2170,7 @@ ToolRegistry.register({ - +
} > -
- -
+ +
+ +
+
)} diff --git a/packages/kilo-ui/src/i18n/uk.ts b/packages/kilo-ui/src/i18n/uk.ts new file mode 100644 index 00000000000..197e28172a4 --- /dev/null +++ b/packages/kilo-ui/src/i18n/uk.ts @@ -0,0 +1 @@ +export * from "@opencode-ai/ui/i18n/uk" diff --git a/packages/kilo-vscode/LICENSE b/packages/kilo-vscode/LICENSE new file mode 100644 index 00000000000..5cb50685f18 --- /dev/null +++ b/packages/kilo-vscode/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2025 Kilo Code +Copyright (c) 2025 opencode + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/kilo-vscode/README.md b/packages/kilo-vscode/README.md index aef1c95a4d2..e69a35887f8 100644 --- a/packages/kilo-vscode/README.md +++ b/packages/kilo-vscode/README.md @@ -1,9 +1,9 @@

- VS Code Marketplace - X (Twitter) - Substack Blog - Discord - Reddit + VS Code Marketplace + X (Twitter) + Substack Blog + Discord + Reddit

# 🚀 Kilo diff --git a/packages/kilo-vscode/assets/icons/kilo-dark.svg b/packages/kilo-vscode/assets/icons/kilo-dark.svg index 7239bf80a80..2a4e0aaabc0 100644 --- a/packages/kilo-vscode/assets/icons/kilo-dark.svg +++ b/packages/kilo-vscode/assets/icons/kilo-dark.svg @@ -1,6 +1,4 @@ - - - - - - \ No newline at end of file + + + + diff --git a/packages/kilo-vscode/assets/icons/kilo-light.svg b/packages/kilo-vscode/assets/icons/kilo-light.svg index 3daa5626073..53469c85fee 100644 --- a/packages/kilo-vscode/assets/icons/kilo-light.svg +++ b/packages/kilo-vscode/assets/icons/kilo-light.svg @@ -1,6 +1,4 @@ - - - - - - \ No newline at end of file + + + + diff --git a/packages/kilo-vscode/docs/agent-behaviour/mcp-server-creation.md b/packages/kilo-vscode/docs/agent-behaviour/mcp-server-creation.md index 7656a450dcb..2b2096bb9c1 100644 --- a/packages/kilo-vscode/docs/agent-behaviour/mcp-server-creation.md +++ b/packages/kilo-vscode/docs/agent-behaviour/mcp-server-creation.md @@ -2,7 +2,7 @@ **Priority:** P2 -The legacy MCP Servers sub-tab (842 lines) had full server lifecycle management. The new sub-tab can only view and remove servers. +The legacy MCP Servers sub-tab (842 lines) had full server lifecycle management. The new sub-tab supports viewing, removing, and toggling servers with live connection status. ## Side-by-Side Comparison @@ -12,8 +12,8 @@ The legacy MCP Servers sub-tab (842 lines) had full server lifecycle management. | Add server | Via edit config file buttons | Not available | | Remove server | Delete button + confirmation | Remove button + confirmation | | Edit server config | Via edit config file buttons | Not available | -| Connection status | Colored dot (green/yellow/red) | Not displayed | -| Enable/disable toggle | `ToggleSwitch` per server | Not available | +| Connection status | Colored dot (green/yellow/red) | Live status display | +| Enable/disable toggle | `ToggleSwitch` per server | Connect/disconnect toggle | | Restart/refresh | Per-server refresh button | Not available | | Refresh all | "Refresh All MCP Servers" button | Not available | | Edit Global MCP config | Button to open file | Not available | @@ -42,8 +42,6 @@ The new extension has none of this expandable detail. - **Add MCP Server dialog**: Form to define a new server with name, transport type (stdio/SSE), command+args or URL, environment variables. Write to CLI config via `updateConfig()` - **Edit MCP Server**: Allow modifying existing server configurations -- **Connection status indicators**: Display per-server connection state. Requires CLI to expose MCP connection status via API or SSE events -- **Enable/disable toggle**: Per-server toggle that writes to CLI config without removing the server - **Restart/refresh button**: Per-server and "refresh all" buttons. Requires CLI endpoint to restart MCP servers - **Edit config file buttons**: Quick links to open global/project MCP config in the editor diff --git a/packages/kilo-vscode/docs/features/custom-openai-provider-ui.md b/packages/kilo-vscode/docs/features/custom-openai-provider-ui.md deleted file mode 100644 index b23f58af664..00000000000 --- a/packages/kilo-vscode/docs/features/custom-openai-provider-ui.md +++ /dev/null @@ -1,15 +0,0 @@ -# Custom OpenAI-Compatible Provider UI - -**Priority:** P1 -**Issue:** [#6163](https://github.com/Kilo-Org/kilocode/issues/6163) - -No UI for adding custom OpenAI-compatible providers. Users must manually edit `opencode.json`. The web/TUI app has a full `DialogCustomProvider`. - -## Remaining Work - -- Port `DialogCustomProvider` from `packages/app/src/components/dialog-custom-provider.tsx` to extension webview -- Add "Add custom provider" button to the Providers tab -- Dialog should collect: Provider ID, display name, base URL, API key, model entries, optional custom HTTP headers -- On save, write to CLI config via `handleUpdateConfig()` endpoint -- Validate inputs; show inline errors -- After adding, provider should appear in list and models in model selector diff --git a/packages/kilo-vscode/docs/migration/memorybank-migration.md b/packages/kilo-vscode/docs/migration/memorybank-migration.md deleted file mode 100644 index 6956da0d1cc..00000000000 --- a/packages/kilo-vscode/docs/migration/memorybank-migration.md +++ /dev/null @@ -1,12 +0,0 @@ -# MemoryBank Migration - -**Priority:** P1 -**Issue:** [#6091](https://github.com/Kilo-Org/kilocode/issues/6091) - -## Remaining Work - -- Detect whether user has MemoryBank content in old extension's `workspaceState` -- Offer to migrate MemoryBank content to `AGENTS.md` in workspace root (or `~/.kilocode/rules/` for global rules) -- Show content for review before writing — do not silently overwrite existing `AGENTS.md` -- If `AGENTS.md` already exists, offer to append with a clear delimiter -- Show documentation explaining that `AGENTS.md` / rules files are the equivalent of MemoryBank diff --git a/packages/kilo-vscode/docs/migration/settings-migration.md b/packages/kilo-vscode/docs/migration/settings-migration.md deleted file mode 100644 index 140a592f500..00000000000 --- a/packages/kilo-vscode/docs/migration/settings-migration.md +++ /dev/null @@ -1,30 +0,0 @@ -# Settings Migration from Old Extension - -**Priority:** P1 -**Issue:** [#6089](https://github.com/Kilo-Org/kilocode/issues/6089) - -## Remaining Work - -- On first activation, detect whether old extension settings exist in `vscode.ExtensionContext.globalState` or `vscode.workspace.getConfiguration('kilo-code')` -- Read relevant settings: API keys, provider configuration, model preferences, auto-approve rules, custom instructions -- Map old settings keys to CLI config equivalents in `opencode.json` -- If CLI config already has settings, show a diff and ask user to confirm before overwriting -- Write approved settings to CLI config via `/global/config` endpoint or directly to `opencode.json` -- Show what was migrated and what was not -- Mark migration as complete in `globalState` so it doesn't run again - -## Agent Behaviour Tab Settings to Migrate - -Settings from the legacy "Agent Behaviour" tab (Modes, MCP Servers, Rules, Workflows, Skills sub-tabs): - -| Legacy Setting | CLI Equivalent | Notes | -| ----------------------------------------------------- | --------------------------------------------------------- | ---------------------------------------------------------------- | -| `customModes` (custom mode definitions) | CLI agent config in `opencode.json` | Map `roleDefinition` → `prompt`, `groups` → CLI tool permissions | -| `customModePrompts` (per-mode overrides) | Per-agent `prompt`, `temperature`, etc. | Map each mode slug to CLI agent name | -| `customInstructions` (global, shown in Modes sub-tab) | Rule files in `.kilocode/rules/` or `config.instructions` | May need a global instructions config key in CLI | -| `modeApiConfigs` (per-mode model) | Per-agent `model` | Map mode slug → agent name → model ID | -| MCP server configs | `config.mcp` | CLI owns MCP config | -| `localRulesToggles` / `globalRulesToggles` | `config.instructions` | Toggle state doesn't map directly — CLI has path list | -| `localWorkflowToggles` / `globalWorkflowToggles` | CLI custom commands (TBD) | Workflow concept mapping needs clarification | - -See [Agent Behaviour Tab Parity](../agent-behaviour/) docs for detailed sub-tab comparisons. diff --git a/packages/kilo-vscode/docs/migration/upgrade-onboarding.md b/packages/kilo-vscode/docs/migration/upgrade-onboarding.md deleted file mode 100644 index 4f409abd2ee..00000000000 --- a/packages/kilo-vscode/docs/migration/upgrade-onboarding.md +++ /dev/null @@ -1,15 +0,0 @@ -# Upgrade Onboarding Experience - -**Priority:** P1 -**Issue:** [#6188](https://github.com/Kilo-Org/kilocode/issues/6188) - -## Remaining Work - -- Detect upgraders by checking for old `globalState` keys (e.g., `kilo-code.taskHistory`) -- Show distinct onboarding screen that: - - Acknowledges they are an existing user - - Explains the new CLI backend architecture - - Shows what settings have been migrated and what hasn't - - Links to documentation on what changed -- Do not show generic "new user" welcome screen to upgraders -- Store `kilo-code.new.upgradeOnboardingShown` flag in `globalState` diff --git a/packages/kilo-vscode/docs/non-agent-features/mcp-and-mcp-hub.md b/packages/kilo-vscode/docs/non-agent-features/mcp-and-mcp-hub.md index 0d2e3eb1742..abfd67524fa 100644 --- a/packages/kilo-vscode/docs/non-agent-features/mcp-and-mcp-hub.md +++ b/packages/kilo-vscode/docs/non-agent-features/mcp-and-mcp-hub.md @@ -2,13 +2,11 @@ **Priority:** P1 -Settings UI shows a read-only list of configured MCP servers. HTTP client methods exist for add/connect/disconnect. +Settings UI supports viewing, removing, and toggling MCP servers with live connection status. Add/edit is not yet available. ## Remaining Work -- Add/edit/delete MCP server controls in the settings UI -- Connect/disconnect controls per server +- Add/edit MCP server controls in the settings UI - Tool allowlisting/disablement per server -- Connection status display per server (connected/disconnected/error) - Auto-reconnect and error history display - MCP Hub for discovering available MCP servers diff --git a/packages/kilo-vscode/docs/non-agent-features/settings-ui.md b/packages/kilo-vscode/docs/non-agent-features/settings-ui.md index 47dc84ffd58..0bd936280a0 100644 --- a/packages/kilo-vscode/docs/non-agent-features/settings-ui.md +++ b/packages/kilo-vscode/docs/non-agent-features/settings-ui.md @@ -2,14 +2,13 @@ **Priority:** P1 -12 of 14 tabs are functional. +12 of 14 tabs are functional. Import/export settings is available in the About tab. ## Remaining Work - **Terminal tab**: Shows "Not implemented" message - **Prompts tab**: Shows "Not implemented" message - **Workflows subtab** (inside AgentBehaviour): Renders a `` with no functionality -- Import/export settings functionality ## Related Docs diff --git a/packages/kilo-vscode/docs/opencode-migration-plan.md b/packages/kilo-vscode/docs/opencode-migration-plan.md index e16202e4dfd..bf244c5a446 100644 --- a/packages/kilo-vscode/docs/opencode-migration-plan.md +++ b/packages/kilo-vscode/docs/opencode-migration-plan.md @@ -22,23 +22,23 @@ This document tracks remaining work needed for feature parity with the old exten ## Non-Agent Feature Parity -| Feature | Remaining Work | Backend | Priority | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -------- | -| [Authentication & Enterprise](non-agent-features/authentication-organization-enterprise-enforcement.md) | Org feature flags, MDM policy enforcement | CLI handles its auth; extension handles org/MDM | P1 | -| [Auto-Purge](non-agent-features/auto-purge.md) | Scheduled cleanup of old session/task storage | Extension-side (storage ownership TBD) | P3 | -| [Cloud Task Support](non-agent-features/cloud-task-support.md) | Upload local sessions to cloud, real-time sync, conflict resolution | Kilo cloud API + CLI; extension provides UI | P2 | -| [Code Reviews](non-agent-features/code-reviews.md) | Local review mode, automated AI review of uncommitted/branch changes | CLI (partial); extension for VS Code review UX | P2 | -| [Codebase Indexing & Semantic Search](non-agent-features/codebase-indexing-semantic-search.md) | Vector indexing, semantic search, embeddings infrastructure | CLI has grep/glob endpoints; semantic indexing is extension or cloud | P2 | -| [Contribution Tracking](non-agent-features/contribution-tracking.md) | AI attribution tracking, line fingerprinting, reporting | Extension-side | P3 | -| [Custom Commands](non-agent-features/custom-command-system.md) | Slash command system, project-level command discovery, YAML frontmatter support | CLI has custom commands; extension provides UI entry points | P2 | -| [Marketplace](non-agent-features/marketplace.md) | Catalog, install, update capabilities (toolbar button exists but renders a stub) | Extension-side | P2 | -| [MCP & MCP Hub](non-agent-features/mcp-and-mcp-hub.md) | MCP configuration UI (add/edit/delete servers), tool allowlisting, connection status display | CLI owns MCP lifecycle; extension provides config UI | P1 | -| [Repository Initialization](non-agent-features/repository-initialization.md) | /init command support for setting up agentic engineering | CLI /init endpoint; extension provides UI trigger | P3 | -| [Rules & Workflows](non-agent-features/rules-and-workflows.md) | Workflow management UI (rules subtab exists, workflows subtab is a stub) | CLI owns rules runtime; extension provides management UI | P3 | -| [Settings Sync](non-agent-features/settings-sync-integration.md) | VS Code Settings Sync allowlist registration | Extension-side (VS Code API) | P3 | -| [Settings UI](non-agent-features/settings-ui.md) | Terminal and Prompts tabs (show "Not implemented"), Workflows subtab stub, import/export settings | CLI exposes config; extension provides settings forms | P1 | -| [Skills System](non-agent-features/skills-system.md) | Skill execution, discovery, hot-reload (config UI for paths/URLs exists) | CLI has skills runtime; extension provides packaging/UI | P2 | -| [Speech-to-Text](non-agent-features/speech-to-text.md) | Voice input, streaming STT | Webview (mic capture); CLI-compatible STT optional | P3 | +| Feature | Remaining Work | Backend | Priority | +| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -------- | +| [Authentication & Enterprise](non-agent-features/authentication-organization-enterprise-enforcement.md) | Org feature flags, MDM policy enforcement | CLI handles its auth; extension handles org/MDM | P1 | +| [Auto-Purge](non-agent-features/auto-purge.md) | Scheduled cleanup of old session/task storage | Extension-side (storage ownership TBD) | P3 | +| [Cloud Task Support](non-agent-features/cloud-task-support.md) | Upload local sessions to cloud, real-time sync, conflict resolution | Kilo cloud API + CLI; extension provides UI | P2 | +| [Code Reviews](non-agent-features/code-reviews.md) | Local review mode, automated AI review of uncommitted/branch changes | CLI (partial); extension for VS Code review UX | P2 | +| [Codebase Indexing & Semantic Search](non-agent-features/codebase-indexing-semantic-search.md) | Vector indexing, semantic search, embeddings infrastructure | CLI has grep/glob endpoints; semantic indexing is extension or cloud | P2 | +| [Contribution Tracking](non-agent-features/contribution-tracking.md) | AI attribution tracking, line fingerprinting, reporting | Extension-side | P3 | +| [Custom Commands](non-agent-features/custom-command-system.md) | Slash command system, project-level command discovery, YAML frontmatter support | CLI has custom commands; extension provides UI entry points | P2 | +| [Marketplace](non-agent-features/marketplace.md) | Catalog, install, update capabilities (toolbar button exists but renders a stub) | Extension-side | P2 | +| [MCP & MCP Hub](non-agent-features/mcp-and-mcp-hub.md) | MCP configuration UI (add/edit/delete servers), tool allowlisting | CLI owns MCP lifecycle; extension provides config UI | P1 | +| [Repository Initialization](non-agent-features/repository-initialization.md) | /init command support for setting up agentic engineering | CLI /init endpoint; extension provides UI trigger | P3 | +| [Rules & Workflows](non-agent-features/rules-and-workflows.md) | Workflow management UI (rules subtab exists, workflows subtab is a stub) | CLI owns rules runtime; extension provides management UI | P3 | +| [Settings Sync](non-agent-features/settings-sync-integration.md) | VS Code Settings Sync allowlist registration | Extension-side (VS Code API) | P3 | +| [Settings UI](non-agent-features/settings-ui.md) | Terminal and Prompts tabs (show "Not implemented"), Workflows subtab stub | CLI exposes config; extension provides settings forms | P1 | +| [Skills System](non-agent-features/skills-system.md) | Skill execution, discovery, hot-reload (config UI for paths/URLs exists) | CLI has skills runtime; extension provides packaging/UI | P2 | +| [Speech-to-Text](non-agent-features/speech-to-text.md) | Voice input, streaming STT | Webview (mic capture); CLI-compatible STT optional | P3 | --- @@ -49,7 +49,7 @@ The "Agent Behaviour" settings tab contains 5 sub-tabs in both the legacy and ne | Sub-Tab | Remaining Work | Priority | | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------- | | [Modes / Agents](agent-behaviour/modes-subtab-parity.md) | Core CRUD done (PR #7225). Remaining: when-to-use, system prompt preview, import/export, default variant, hidden/disable, org features | P2 | -| [MCP Servers](agent-behaviour/mcp-server-creation.md) | Add/edit servers, connection status, enable/disable toggle, restart, per-server timeout, expandable detail (tools/resources/logs/auth) | P2 | +| [MCP Servers](agent-behaviour/mcp-server-creation.md) | Add/edit servers, restart, per-server timeout, expandable detail (tools/resources/logs/auth) | P2 | | [Rules & Workflows](agent-behaviour/rules-workflows-subtab-parity.md) | Rules: description text, global/workspace separation, per-rule toggles, new file creation, auto-discovery. Workflows: entire sub-tab is a stub | P2/P3 | | Skills | Minor gaps: project/global separation, mode badge per skill. Covered by [Skills System](non-agent-features/skills-system.md) | P2 | @@ -70,28 +70,19 @@ Open issues from the [GitHub project board](https://github.com/orgs/Kilo-Org/pro ### Features -| Feature | Remaining Work | Priority | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------- | -------- | -| [File Attachments](features/file-attachments.md) | Add non-image file attachment via button, drag-and-drop, or file picker | P2 | -| [Task Completion Notification](features/task-completion-notification.md) | VS Code toast when task completes or awaits input while panel is hidden | P2 | -| [Custom OpenAI-Compatible Provider UI](features/custom-openai-provider-ui.md) | Port `DialogCustomProvider` from `packages/app` to extension webview | P1 | -| [Remember Last Model Choice](features/remember-last-model.md) | Persist last-used model and pre-select it for new sessions | P2 | -| [Expandable MCP Tools](features/expandable-mcp-tools.md) | Make MCP tool rows expandable to show inputs/outputs like regular tools | P2 | -| [Session Preview Improvements](features/session-preview-improvements.md) | Evaluate showing first message snippet or improving title generation | P2 | - -### Migration (old extension → new) - -| Feature | Remaining Work | Priority | -| --------------------------------------------------------- | ---------------------------------------------------------------------------- | -------- | -| [Settings Migration](migration/settings-migration.md) | Read old extension settings and offer to import into CLI config on first run | P1 | -| [MemoryBank Migration](migration/memorybank-migration.md) | Detect MemoryBank content and offer to migrate it to AGENTS.md | P1 | -| [Upgrade Onboarding](migration/upgrade-onboarding.md) | Show distinct onboarding for upgraders explaining what changed | P1 | +| Feature | Remaining Work | Priority | +| ------------------------------------------------------------------------ | ----------------------------------------------------------------------- | -------- | +| [File Attachments](features/file-attachments.md) | Add non-image file attachment via button, drag-and-drop, or file picker | P2 | +| [Task Completion Notification](features/task-completion-notification.md) | VS Code toast when task completes or awaits input while panel is hidden | P2 | +| [Remember Last Model Choice](features/remember-last-model.md) | Persist last-used model and pre-select it for new sessions | P2 | +| [Expandable MCP Tools](features/expandable-mcp-tools.md) | Make MCP tool rows expandable to show inputs/outputs like regular tools | P2 | +| [Session Preview Improvements](features/session-preview-improvements.md) | Evaluate showing first message snippet or improving title generation | P2 | ### Error Handling & Reliability | Feature | Remaining Work | Priority | | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -------- | -| [Pre-Release Switch CPU Spike](error-handling/pre-release-switch-crash.md) | Fix race condition / process conflict when switching release ↔ pre-release | P0 | +| [Pre-Release Switch CPU Spike](error-handling/pre-release-switch-crash.md) | Fix race condition / process conflict when switching release ↔ pre-release | P0 | | [Extension View Doesn't Refresh on Update](error-handling/extension-refresh-on-update.md) | Force webview reload when extension version changes | P1 | | [Propagate CLI Errors to UI](error-handling/propagate-cli-errors-to-ui.md) | Surface CLI stderr errors in chat or as VS Code notifications | P1 | | [CLI Startup Errors](error-handling/cli-startup-errors.md) | Detect CLI process exit before connection; show error with details and retry | P1 | diff --git a/packages/kilo-vscode/package.json b/packages/kilo-vscode/package.json index 8b66288b51b..f459d109308 100644 --- a/packages/kilo-vscode/package.json +++ b/packages/kilo-vscode/package.json @@ -2,7 +2,7 @@ "name": "kilo-code", "displayName": "Kilo Code: AI Coding Agent, Copilot, and Autocomplete", "description": "Open Source AI coding agent that generates code from natural language, automates tasks, and runs terminal commands. Features inline autocomplete, browser automation, automated refactoring, and custom modes for planning, coding, and debugging. Supports 500+ AI models including Claude (Anthropic), Gemini, Grok, GPT, Codex and GLM.", - "version": "7.1.5", + "version": "7.1.17", "icon": "assets/icons/logo-outline-black.png", "galleryBanner": { "color": "#FFFFFF", @@ -17,6 +17,7 @@ "engines": { "vscode": "^1.105.1" }, + "license": "MIT", "author": { "name": "Kilo Code" }, @@ -77,7 +78,7 @@ { "command": "kilo-code.new.agentManagerOpen", "title": "Agent Manager", - "icon": "$(agent)" + "icon": "$(circuit-board)" }, { "command": "kilo-code.new.marketplaceButtonClicked", @@ -372,6 +373,26 @@ "command": "kilo-code.new.openInTab", "group": "navigation", "when": "true" + }, + { + "command": "kilo-code.new.plusButtonClicked", + "group": "navigation@0", + "when": "activeWebviewPanelId == kilo-code.new.TabPanel" + }, + { + "command": "kilo-code.new.historyButtonClicked", + "group": "navigation@1", + "when": "activeWebviewPanelId == kilo-code.new.TabPanel" + }, + { + "command": "kilo-code.new.profileButtonClicked", + "group": "navigation@2", + "when": "activeWebviewPanelId == kilo-code.new.TabPanel" + }, + { + "command": "kilo-code.new.settingsButtonClicked", + "group": "navigation@3", + "when": "activeWebviewPanelId == kilo-code.new.TabPanel" } ], "editor/context": [ @@ -632,7 +653,8 @@ "th", "bs", "tr", - "nl" + "nl", + "uk" ], "enumDescriptions": [ "Auto (VS Code language)", @@ -653,7 +675,8 @@ "ภาษาไทย", "Bosanski", "Türkçe", - "Nederlands" + "Nederlands", + "Українська" ] }, "kilo-code.new.model.providerID": { diff --git a/packages/kilo-vscode/script/build.ts b/packages/kilo-vscode/script/build.ts index cb9b162560c..ee00dbb778e 100644 --- a/packages/kilo-vscode/script/build.ts +++ b/packages/kilo-vscode/script/build.ts @@ -82,7 +82,7 @@ for (const config of targets) { console.log(` 📦 Packaging .vsix for ${config.target}...`) const vsixPath = join(outDir, `kilo-vscode-${config.target}.vsix`) - await $`vsce package --pre-release --no-dependencies --skip-license --target ${config.target} -o ${vsixPath}`.env({ + await $`vsce package --no-dependencies --skip-license --target ${config.target} -o ${vsixPath}`.env({ ...process.env, npm_config_ignore_scripts: "true", }) diff --git a/packages/kilo-vscode/script/publish.ts b/packages/kilo-vscode/script/publish.ts index 87ce086f029..ef891606266 100755 --- a/packages/kilo-vscode/script/publish.ts +++ b/packages/kilo-vscode/script/publish.ts @@ -7,6 +7,7 @@ import { Script } from "@opencode-ai/script" console.log(`Publishing VSCode extension for release: v${Script.version}`) const outDir = process.env.VSIX_DIR || join(import.meta.dir, "..", "out") + console.log(`Using VSIX directory: ${outDir}`) if (!existsSync(outDir)) { @@ -37,15 +38,13 @@ console.log(`\nFound ${vsixFiles.length} VSIX files`) for (const target of targets) { const vsixPath = join(outDir, `kilo-vscode-${target}.vsix`) - console.log(`\n🚀 Publishing ${target} to VS Code Marketplace...`) - await $`vsce publish --pre-release --packagePath ${vsixPath}` + await $`vsce publish --packagePath ${vsixPath}` console.log(` ✅ Published ${target} to VS Code Marketplace`) - // Note: Open VSX publishing is commented out as it doesn't support prereleases - // console.log(`\n📤 Publishing ${target} to Open VSX...`) - // await $`npx ovsx publish ${vsixPath} --target ${target} -p ${process.env.OPENVSX_TOKEN}` - // console.log(` ✅ Published ${target} to Open VSX`) + console.log(`\n📤 Publishing ${target} to Open VSX...`) + await $`npx ovsx publish --pat ${process.env.OPENVSX_TOKEN} --packagePath ${vsixPath}` + console.log(` ✅ Published ${target} to Open VSX`) } if (Script.release) { diff --git a/packages/kilo-vscode/src/KiloProvider.ts b/packages/kilo-vscode/src/KiloProvider.ts index 15883cd3e0a..16f66d982ae 100644 --- a/packages/kilo-vscode/src/KiloProvider.ts +++ b/packages/kilo-vscode/src/KiloProvider.ts @@ -32,10 +32,14 @@ import { resolveWorkspaceDirectory, type SessionRefreshContext, } from "./kilo-provider-utils" +import { GitOps } from "./agent-manager/GitOps" +import { GitStatsPoller, type LocalStats } from "./agent-manager/GitStatsPoller" +import { getWorkspaceRoot } from "./review-utils" import { MarketplaceService } from "./services/marketplace" import { resolveProjectDirectory } from "./project-directory" import { getBusySessionCount, seedSessionStatuses } from "./session-status" import { slimPart, slimParts } from "./kilo-provider/slim-metadata" +import { matchFollowup, recordFollowup, type Followup } from "./kilo-provider/followup-session" // legacy-migration start import { checkAndShowMigrationWizard, @@ -77,6 +81,7 @@ import { disconnectProvider as disconnectProviderAction, saveCustomProvider as saveCustomProviderAction, } from "./provider-actions" +import { fetchOpenAIModels, FetchModelsError } from "./shared/fetch-models" type KiloProviderOptions = { projectDirectory?: string | null @@ -109,6 +114,8 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper private cachedCommandsMessage: unknown = null /** Cached configLoaded payload so requestConfig can be served before client is ready */ private cachedConfigMessage: unknown = null + /** Cached mcpStatusLoaded payload so requestMcpStatus can be served before client is ready */ + private cachedMcpStatusMessage: unknown = null /** Ref-count of in-flight handleUpdateConfig calls; prevents fetchAndSendConfig from sending stale data */ private pending = 0 /** Cached notificationsLoaded payload */ @@ -137,6 +144,9 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper private unsubscribeNotificationDismiss: (() => void) | null = null private unsubscribeLanguageChange: (() => void) | null = null private unsubscribeProfileChange: (() => void) | null = null + private unsubscribeMigrationComplete: (() => void) | null = null // legacy-migration + private unsubscribeClearPendingPrompts: (() => void) | null = null + private unsubscribeDirectoryProvider: (() => void) | null = null private initConnectionPromise: Promise | null = null private webviewMessageDisposable: vscode.Disposable | null = null @@ -148,6 +158,11 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper private projectDirectory: string | null | undefined private slimEditMetadata = true + private pendingFollowup: Followup | null = null + /** Worktree diff stats poller for the sidebar badge — reuses GitStatsPoller (local stats only) */ + private statsPoller: GitStatsPoller | null = null + private cachedStats: unknown = null + /** Optional interceptor called before the standard message handler. * Return null to consume the message, or return a (possibly transformed) message. */ private onBeforeMessage: ((msg: Record) => Promise | null>) | null = null @@ -165,6 +180,7 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper ) { this.projectDirectory = options?.projectDirectory this.slimEditMetadata = options?.slimEditMetadata ?? true + TelemetryProxy.getInstance().setProvider(this) } @@ -266,17 +282,27 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper data: profileData, }) + // Re-send cached worktree stats so the badge renders immediately after webview reload. + if (this.cachedStats) this.postMessage(this.cachedStats) + // Seed session status map so the Settings panel knows about already-running sessions. // Must run after webview is ready (postMessage is a no-op before that). - void this.seedSessionStatusMap() + // Only reconcile (reset missing busy→idle) when the map is empty, i.e. + // on the very first seed before any real-time SSE events have arrived. + // On SSE reconnects or webview recreations the live SSE data is + // authoritative and reconciliation risks race-resetting busy sessions. + const reconcile = this.sessionStatusMap.size === 0 + void this.seedSessionStatusMap(reconcile) } // legacy-migration start - // Only show the migration wizard once the CLI connection is established so the - // webview has finished loading providers/agents before we navigate to the wizard. - if (reason === "webviewReady" && this.connectionState === "connected") { - void checkAndShowMigrationWizard(this.migrationCtx) - } else if (reason === "sse-connected") { + // Show the migration wizard once the CLI connection is established. + // Three triggers cover all timing scenarios: + // "webviewReady" + connected — webview loaded after SSE was already up + // "sse-connected" — SSE connected after webview was ready + // "initializeConnection" — sidebar path where connect() resolves before + // onStateChange is subscribed, so sse-connected never fires + if (this.connectionState === "connected") { void checkAndShowMigrationWizard(this.migrationCtx) } // legacy-migration end @@ -303,6 +329,11 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper // Handle messages from webview (shared handler) this.setupWebviewMessageHandler(webviewView.webview) + // Pause stats polling when sidebar is hidden, resume when visible + webviewView.onDidChangeVisibility(() => { + this.statsPoller?.setEnabled(webviewView.visible) + }) + // Initialize connection to CLI backend this.initializeConnection() } @@ -555,6 +586,9 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper case "openSettingsPanel": vscode.commands.executeCommand("kilo-code.new.settingsButtonClicked", message.tab) break + case "openMarketplacePanel": + vscode.commands.executeCommand("kilo-code.new.marketplaceButtonClicked", this.projectDirectory) + break case "openChanges": vscode.commands.executeCommand("kilo-code.new.showChanges") break @@ -570,6 +604,13 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper error: err instanceof Error ? err.message : String(err), }) }) + } else if (message.sessionId) { + console.error("[Kilo New] continueInWorktree: no handler registered") + this.postMessage({ + type: "continueInWorktreeProgress", + status: "error", + error: "Continue in Worktree is not available", + }) } break case "retryConnection": @@ -599,6 +640,11 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper case "saveCustomProvider": await this.handleProviderAction(message) break + case "fetchCustomProviderModels": + this.handleFetchCustomProviderModels(message).catch((e) => + console.error("[Kilo New] fetchCustomProviderModels failed:", e), + ) + break case "compact": await this.handleCompact(message.sessionID, message.providerID, message.modelID) break @@ -622,16 +668,34 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper case "removeMcp": this.handleRemoveMcp(message.name).catch((e) => console.error("[Kilo New] handleRemoveMcp failed:", e)) break + case "requestMcpStatus": + this.fetchAndSendMcpStatus().catch((e) => console.error("[Kilo New] fetchAndSendMcpStatus failed:", e)) + break + case "connectMcp": + this.handleConnectMcp(message.name).catch((e) => console.error("[Kilo New] handleConnectMcp failed:", e)) + break + case "disconnectMcp": + this.handleDisconnectMcp(message.name).catch((e) => + console.error("[Kilo New] handleDisconnectMcp failed:", e), + ) + break case "questionReply": - await handleQuestionReply(this.questionCtx, message.requestID, message.answers) + this.noteFollowup(message.answers, message.sessionID) + if (!(await handleQuestionReply(this.questionCtx, message.requestID, message.answers, message.sessionID))) { + this.pendingFollowup = null + } break case "questionReject": - await handleQuestionReject(this.questionCtx, message.requestID) + this.pendingFollowup = null + await handleQuestionReject(this.questionCtx, message.requestID, message.sessionID) break case "requestConfig": this.fetchAndSendConfig().catch((e) => console.error("[Kilo New] fetchAndSendConfig failed:", e)) break + case "requestGlobalConfig": + this.fetchAndSendGlobalConfig().catch((e) => console.error("[Kilo New] fetchAndSendGlobalConfig failed:", e)) + break case "updateConfig": await this.handleUpdateConfig(message.config) break @@ -901,6 +965,8 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper this.unsubscribeNotificationDismiss?.() this.unsubscribeLanguageChange?.() this.unsubscribeProfileChange?.() + this.unsubscribeClearPendingPrompts?.() + this.unsubscribeDirectoryProvider?.() try { const workspaceDir = this.getWorkspaceDirectory() @@ -918,6 +984,10 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper return event.type !== "message.part.updated" && event.type !== "message.part.delta" } + if (event.type === "session.created" && this.matchesPendingFollowup(event.properties.info)) { + return true + } + // session.status must always pass through — even for sessions not tracked by this // KiloProvider instance. The Settings panel is a separate provider with no tracked // sessions, but it needs session.status to populate sessionStatusMap and allStatusMap @@ -972,6 +1042,23 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper this.postMessage({ type: "profileData", data }) }) + // legacy-migration start + // Subscribe to migration-complete broadcast from any KiloProvider instance + this.unsubscribeMigrationComplete = this.connectionService.onMigrationComplete(() => { + this.postMessage({ type: "migrationState", needed: false }) + }) + // legacy-migration end + + // Subscribe to clear-pending-prompts broadcast (fired after config save drains prompts) + this.unsubscribeClearPendingPrompts = this.connectionService.onClearPendingPrompts(() => { + this.postMessage({ type: "clearPendingPrompts" }) + }) + + // Register this provider's directories so drainPendingPrompts() covers all instances + this.unsubscribeDirectoryProvider = this.connectionService.registerDirectoryProvider(() => { + return [this.getWorkspaceDirectory(), ...this.sessionDirectories.values()] + }) + // Get current state and push to webview const serverInfo = this.connectionService.getServerInfo() this.connectionState = this.connectionService.getConnectionState() @@ -1004,6 +1091,9 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper ]) this.sendNotificationSettings() + // Start polling worktree diff stats for the sidebar badge + this.startStatsPolling() + console.log("[Kilo New] KiloProvider: ✅ initializeConnection completed successfully") } catch (error) { console.error("[Kilo New] KiloProvider: ❌ Failed to initialize connection:", error) @@ -1422,6 +1512,22 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper return saveCustomProviderAction(ctx, rid, pid, config, key, this.cachedConfigMessage, set) } + private async handleFetchCustomProviderModels(msg: Record): Promise { + const rid = typeof msg.requestId === "string" ? msg.requestId : "" + const url = typeof msg.baseURL === "string" ? msg.baseURL : "" + if (!rid || !url) return + const key = typeof msg.apiKey === "string" ? msg.apiKey : undefined + const headers = msg.headers && typeof msg.headers === "object" ? (msg.headers as Record) : undefined + try { + const models = await fetchOpenAIModels({ baseURL: url, apiKey: key, headers }) + this.postMessage({ type: "customProviderModelsFetched", requestId: rid, models }) + } catch (err: unknown) { + const message = err instanceof Error ? err.message : "Failed to fetch models" + const auth = err instanceof FetchModelsError && err.auth + this.postMessage({ type: "customProviderModelsFetched", requestId: rid, error: message, auth }) + } + } + /** * Fetch agents (modes) from the backend and send to webview. */ @@ -1448,6 +1554,7 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper mode: a.mode, native: a.native, color: a.color, + deprecated: a.deprecated, })), defaultAgent, } @@ -1611,6 +1718,51 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper } } + private async fetchAndSendMcpStatus(): Promise { + if (!this.client) { + if (this.cachedMcpStatusMessage) { + this.postMessage(this.cachedMcpStatusMessage) + } + return + } + + try { + const directory = this.getWorkspaceDirectory() + const { data } = await this.client.mcp.status({ directory }) + if (data) { + const message = { type: "mcpStatusLoaded", status: data } + this.cachedMcpStatusMessage = message + this.postMessage(message) + } + } catch (error) { + console.error("[Kilo New] KiloProvider: Failed to fetch MCP status:", error) + } + } + + private async handleConnectMcp(name: string): Promise { + if (!this.client) return + try { + const directory = this.getWorkspaceDirectory() + await this.client.mcp.connect({ name, directory }) + await this.fetchAndSendMcpStatus() + } catch (error) { + console.error("[Kilo New] KiloProvider: Failed to connect MCP:", name, error) + await this.fetchAndSendMcpStatus() + } + } + + private async handleDisconnectMcp(name: string): Promise { + if (!this.client) return + try { + const directory = this.getWorkspaceDirectory() + await this.client.mcp.disconnect({ name, directory }) + await this.fetchAndSendMcpStatus() + } catch (error) { + console.error("[Kilo New] KiloProvider: Failed to disconnect MCP:", name, error) + await this.fetchAndSendMcpStatus() + } + } + /** * Dispose the CLI backend instance so it re-reads config from disk. * Call after any marketplace install/remove that writes config files directly. @@ -1700,15 +1852,30 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper } } + /** Fetch global-only config (no project/managed layers) for settings export. */ + private async fetchAndSendGlobalConfig(): Promise { + if (!this.client || this.connectionState !== "connected") return + try { + const { data: config } = await this.client.global.config.get({ throwOnError: true }) + this.postMessage({ type: "globalConfigLoaded", config }) + } catch (error) { + console.error("[Kilo New] KiloProvider: Failed to fetch global config:", error) + } + } + /** * Seed sessionStatusMap with current session statuses on connect. * Without this, the Settings panel (which has no tracked sessions) would see * busyCount() = 0 for sessions that were already running before it opened. + * + * @param reconcile When true, reset locally-busy sessions absent from the + * server response to idle (crash recovery). Set to false on SSE reconnects + * to avoid a race where a brief HTTP fetch gap causes the spinner to vanish. */ - private async seedSessionStatusMap(): Promise { + private async seedSessionStatusMap(reconcile = true): Promise { if (!this.client || this.connectionState !== "connected") return const dir = this.getWorkspaceDirectory() - await seedSessionStatuses(this.client, dir, this.sessionStatusMap, (msg) => this.postMessage(msg)) + await seedSessionStatuses(this.client, dir, this.sessionStatusMap, (msg) => this.postMessage(msg), reconcile) } /** @@ -1847,6 +2014,11 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper // races with the async config.update() write on the CLI backend). this.pending++ try { + // Reject all pending permissions and questions across every provider + // so their CLI-side Promises resolve before disposeAll() wipes + // Instance state. Throws on failure to abort the config save. + await this.connectionService.drainPendingPrompts() + await this.client.global.config.update({ config: partial }, { throwOnError: true }) // Re-fetch the full merged config (global + project + all layers) so the @@ -1878,11 +2050,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper } } - /** - * Handle sending a message from the webview. - * Uses promptAsync (fire-and-forget) — the server queues concurrent prompts - * internally, so the client doesn't need to block on busy sessions. - */ /** * Ensure a session exists, creating one if needed. Returns the resolved * session ID and workspace directory, or undefined when the client is @@ -2303,10 +2470,24 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper await config.update(leaf, undefined, vscode.ConfigurationTarget.Global) } + // Clear globalState items that are not part of the configuration + await this.extensionContext?.globalState.update("variantSelections", undefined) + await this.extensionContext?.globalState.update("recentModels", undefined) + await this.extensionContext?.globalState.update("kilo.dismissedNotificationIds", undefined) + // Re-send all settings to the webview so the UI reflects the reset this.sendAutocompleteSettings() this.sendBrowserSettings() this.sendNotificationSettings() + + // Re-send globalState items to the webview + this.postMessage({ type: "variantsLoaded", variants: {} }) + this.postMessage({ type: "recentsLoaded", recents: [] }) + + // Re-fetch notifications to reflect cleared dismissed IDs + await this.fetchAndSendNotifications() + + vscode.window.showInformationMessage("Kilo Code settings have been reset to defaults.") } /** @@ -2360,6 +2541,10 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper } // Extract sessionID from the event + if (event.type === "session.created" && this.adoptPendingFollowup(event.properties.info)) { + return + } + const sessionID = this.connectionService.resolveEventSessionId(event) // Events without sessionID (server.connected, server.heartbeat) → always forward @@ -2618,6 +2803,35 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper this.sessionDirectories.set(sessionId, dir) } + private noteFollowup(answers: string[][], sessionID?: string) { + const dir = this.getWorkspaceDirectory(sessionID) + this.pendingFollowup = recordFollowup({ answers, dir, now: Date.now() }) ?? null + } + + private matchesPendingFollowup(session: Session) { + return matchFollowup({ pending: this.pendingFollowup, dir: session.directory, now: Date.now() }) + } + + private adoptPendingFollowup(session: Session) { + const now = Date.now() + const match = this.matchesPendingFollowup(session) + if (!match) { + if ( + this.pendingFollowup && + !matchFollowup({ pending: this.pendingFollowup, dir: this.pendingFollowup.dir, now }) + ) { + this.pendingFollowup = null + } + return false + } + + this.pendingFollowup = null + this.trackDirectory(session.id, session.directory) + this.registerSession(session) + void this.handleLoadMessages(session.id) + return true + } + private getProjectDirectory(sessionId?: string): string | undefined { return resolveProjectDirectory(this.projectDirectory, () => this.getWorkspaceDirectory(sessionId)) } @@ -2654,7 +2868,9 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper set migrationCheckInFlight(val) { self.migrationCheckInFlight = val }, + refreshSessions: () => this.refreshSessions(), disposeGlobal: () => this.disposeGlobal(), + broadcastComplete: () => this.connectionService.notifyMigrationComplete(), } } @@ -2666,16 +2882,46 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper return this.marketplace } + // ── Worktree stats polling (sidebar diff badge) ────────────────── + + private startStatsPolling(): void { + this.statsPoller?.stop() + const git = new GitOps({ log: () => {} }) + this.statsPoller = new GitStatsPoller({ + getWorktrees: () => [], + getWorkspaceRoot: () => getWorkspaceRoot(), + getClient: () => this.connectionService.getClient(), + git, + onStats: () => {}, + onLocalStats: (stats: LocalStats) => { + const msg = { + type: "worktreeStatsLoaded" as const, + files: stats.files, + additions: stats.additions, + deletions: stats.deletions, + } + this.cachedStats = msg + this.postMessage(msg) + }, + log: () => {}, + }) + this.statsPoller.setEnabled(true) + } + /** * Dispose of the provider and clean up subscriptions. * Does NOT kill the server — that's the connection service's job. */ dispose(): void { + this.statsPoller?.stop() this.unsubscribeEvent?.() this.unsubscribeState?.() this.unsubscribeNotificationDismiss?.() this.unsubscribeLanguageChange?.() this.unsubscribeProfileChange?.() + this.unsubscribeMigrationComplete?.() + this.unsubscribeClearPendingPrompts?.() + this.unsubscribeDirectoryProvider?.() this.webviewMessageDisposable?.dispose() this.trackedSessionIds.clear() this.syncedChildSessions.clear() diff --git a/packages/kilo-vscode/src/SettingsEditorProvider.ts b/packages/kilo-vscode/src/SettingsEditorProvider.ts index afaa819944b..922754e319f 100644 --- a/packages/kilo-vscode/src/SettingsEditorProvider.ts +++ b/packages/kilo-vscode/src/SettingsEditorProvider.ts @@ -51,10 +51,10 @@ export class SettingsEditorProvider implements vscode.Disposable { return view } - openPanel(view: PanelView, tab?: string): void { + openPanel(view: PanelView, tab?: string, directory?: string | null): void { if (tab) this.tabs.set(view, tab) - const projectDirectory = this.getProjectDirectory() + const projectDirectory = directory ?? this.getProjectDirectory() const existing = this.panels.get(view) if (existing) { this.providers.get(view)?.setProjectDirectory(projectDirectory) diff --git a/packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts b/packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts index b463e7682da..be86c3e14bb 100644 --- a/packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts +++ b/packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts @@ -19,6 +19,7 @@ import { createTerminalHost } from "./terminal-host" import { executeVscodeTask } from "./task-runner" import { forkSession } from "./fork-session" import { continueInWorktree } from "./continue-in-worktree" + import { shouldStopDiffPolling } from "./delete-worktree" import { buildKeybindingMap } from "./format-keybinding" import { resolveVersionModels, buildInitialMessages, type CreatedVersion } from "./multi-version" @@ -58,11 +59,11 @@ export class AgentManagerProvider implements Disposable { private cachedWorktreeStats: AgentManagerOutMessage | undefined private cachedLocalStats: AgentManagerOutMessage | undefined private applyingWorktreeId: string | undefined + /** Session ID most recently loaded via a `loadMessages` message from the webview. * Updated synchronously — unlike the session provider's currentSession which depends on * an async `session.get` round-trip and can be stale during rapid tab switches. */ private activeSessionId: string | undefined - constructor( private readonly host: Host, private readonly connectionService: KiloConnectionService, diff --git a/packages/kilo-vscode/src/agent-manager/WorktreeManager.ts b/packages/kilo-vscode/src/agent-manager/WorktreeManager.ts index a95226ffdab..899d7471c94 100644 --- a/packages/kilo-vscode/src/agent-manager/WorktreeManager.ts +++ b/packages/kilo-vscode/src/agent-manager/WorktreeManager.ts @@ -10,8 +10,6 @@ import * as path from "path" import * as fs from "fs" import { randomUUID } from "crypto" import simpleGit, { type SimpleGit } from "simple-git" - -const TEMP_PREFIX = ".kilo-delete-" import { generateBranchName, sanitizeBranchName } from "./branch-name" import type { GitOps } from "./GitOps" import { execWithShellEnv } from "./shell-env" @@ -29,6 +27,9 @@ import { type BranchListItem, } from "./git-import" +const TEMP_PREFIX = ".kilo-delete-" +const RM_OPTS: fs.RmOptions = { recursive: true, force: true, maxRetries: 3, retryDelay: 200 } + interface WorktreeInfo { branch: string path: string @@ -388,7 +389,7 @@ export class WorktreeManager { if (branch) await this.deleteBranch(branch) // 4. Background delete — fire-and-forget, cross-platform - fs.promises.rm(temp, { recursive: true, force: true }).catch((err) => { + fs.promises.rm(temp, RM_OPTS).catch((err) => { this.log(`Background cleanup failed for ${temp}: ${err}`) }) } @@ -411,7 +412,7 @@ export class WorktreeManager { for (const e of entries) { if (e.isDirectory() && e.name.startsWith(TEMP_PREFIX)) { const stale = path.join(this.dir, e.name) - fs.promises.rm(stale, { recursive: true, force: true }).catch((err) => { + fs.promises.rm(stale, RM_OPTS).catch((err) => { this.log(`Failed to clean orphaned temp dir ${stale}: ${err}`) }) } diff --git a/packages/kilo-vscode/src/agent-manager/WorktreeStateManager.ts b/packages/kilo-vscode/src/agent-manager/WorktreeStateManager.ts index 695af8899b3..6dbaee91edb 100644 --- a/packages/kilo-vscode/src/agent-manager/WorktreeStateManager.ts +++ b/packages/kilo-vscode/src/agent-manager/WorktreeStateManager.ts @@ -318,8 +318,11 @@ export class WorktreeStateManager { this.reviewDiffStyle = "unified" for (const [id, wt] of Object.entries(data.worktrees ?? {})) { - // Rewrite stale .kilocode/ paths (handles both Unix / and Windows \ separators) - const fixed = wt.path?.replace(/[/\\]\.kilocode[/\\]/g, `${path.sep}.kilo${path.sep}`) ?? wt.path + // Rewrite stale .kilocode paths while preserving the separator style already stored. + const fixed = + wt.path?.replace(/([/\\])\.kilocode([/\\])/g, (_match, leadingSep, trailingSep) => { + return `${leadingSep}.kilo${trailingSep}` + }) ?? wt.path this.worktrees.set(id, { id, ...wt, path: fixed }) } for (const [id, s] of Object.entries(data.sessions ?? {})) { diff --git a/packages/kilo-vscode/src/extension.ts b/packages/kilo-vscode/src/extension.ts index f5e704bf756..6679ac84453 100644 --- a/packages/kilo-vscode/src/extension.ts +++ b/packages/kilo-vscode/src/extension.ts @@ -45,6 +45,18 @@ export function activate(context: vscode.ExtensionContext) { } }) + // Track all open tab panel providers so toolbar button commands can target them. + // NOTE: The editor/title toolbar for tab panels intentionally omits Agent Manager + // and Marketplace buttons (unlike the sidebar). Too many icons causes VS Code to + // collapse them into a "..." overflow menu, hiding important buttons like Settings. + const tabPanels = new Map() + const activeTabProvider = () => { + for (const [panel, p] of tabPanels) { + if (panel.active) return p + } + return undefined + } + // Create the provider with shared service const provider = new KiloProvider(context.extensionUri, connectionService, context) @@ -90,10 +102,15 @@ export function activate(context: vscode.ExtensionContext) { vscode.window.registerWebviewPanelSerializer("kilo-code.new.TabPanel", { deserializeWebviewPanel(panel: vscode.WebviewPanel) { const tabProvider = new KiloProvider(context.extensionUri, connectionService, context) + tabProvider.setContinueInWorktreeHandler((sessionId, progress) => + agentManagerProvider.continueFromSidebar(sessionId, progress), + ) tabProvider.resolveWebviewPanel(panel) + tabPanels.set(panel, tabProvider) panel.onDidDispose( () => { console.log("[Kilo New] Tab panel restored from restart disposed") + tabPanels.delete(panel) tabProvider.dispose() }, null, @@ -155,16 +172,20 @@ export function activate(context: vscode.ExtensionContext) { // Register toolbar button command handlers context.subscriptions.push( vscode.commands.registerCommand("kilo-code.new.plusButtonClicked", () => { - provider.postMessage({ type: "action", action: "plusButtonClicked" }) + const tab = activeTabProvider() + if (tab) tab.postMessage({ type: "action", action: "plusButtonClicked" }) + else provider.postMessage({ type: "action", action: "plusButtonClicked" }) }), vscode.commands.registerCommand("kilo-code.new.agentManagerOpen", () => { agentManagerProvider.openPanel() }), - vscode.commands.registerCommand("kilo-code.new.marketplaceButtonClicked", () => { - settingsEditorProvider.openPanel("marketplace") + vscode.commands.registerCommand("kilo-code.new.marketplaceButtonClicked", (directory?: string) => { + settingsEditorProvider.openPanel("marketplace", undefined, directory) }), vscode.commands.registerCommand("kilo-code.new.historyButtonClicked", () => { - provider.postMessage({ type: "action", action: "historyButtonClicked" }) + const tab = activeTabProvider() + if (tab) tab.postMessage({ type: "action", action: "historyButtonClicked" }) + else provider.postMessage({ type: "action", action: "historyButtonClicked" }) }), vscode.commands.registerCommand("kilo-code.new.cycleAgentMode", () => { provider.postMessage({ type: "action", action: "cycleAgentMode" }) @@ -182,7 +203,7 @@ export function activate(context: vscode.ExtensionContext) { }), // legacy-migration start vscode.commands.registerCommand("kilo-code.new.openMigrationWizard", () => { - provider.postMessage({ type: "navigate", view: "migration" }) + provider.postMessage({ type: "migrationState", needed: true }) }), // legacy-migration end vscode.commands.registerCommand("kilo-code.new.generateTerminalCommand", async () => { @@ -196,7 +217,7 @@ export function activate(context: vscode.ExtensionContext) { provider.postMessage({ type: "triggerTask", text: `Generate a terminal command: ${input}` }) }), vscode.commands.registerCommand("kilo-code.new.openInTab", () => { - return openKiloInNewTab(context, connectionService) + return openKiloInNewTab(context, connectionService, agentManagerProvider, tabPanels) }), vscode.commands.registerCommand("kilo-code.new.showChanges", () => { diffViewerProvider.openPanel() @@ -323,7 +344,12 @@ export function deactivate() { TelemetryProxy.getInstance().shutdown() } -async function openKiloInNewTab(context: vscode.ExtensionContext, connectionService: KiloConnectionService) { +async function openKiloInNewTab( + context: vscode.ExtensionContext, + connectionService: KiloConnectionService, + agentManagerProvider: AgentManagerProvider, + tabPanels: Map, +) { const lastCol = Math.max(...vscode.window.visibleTextEditors.map((e) => e.viewColumn || 0), 0) const hasVisibleEditors = vscode.window.visibleTextEditors.length > 0 @@ -345,7 +371,11 @@ async function openKiloInNewTab(context: vscode.ExtensionContext, connectionServ } const tabProvider = new KiloProvider(context.extensionUri, connectionService, context) + tabProvider.setContinueInWorktreeHandler((sessionId, progress) => + agentManagerProvider.continueFromSidebar(sessionId, progress), + ) tabProvider.resolveWebviewPanel(panel) + tabPanels.set(panel, tabProvider) // Wait for the new panel to become active before locking the editor group. // This avoids the race where VS Code hasn't switched focus yet. @@ -355,6 +385,7 @@ async function openKiloInNewTab(context: vscode.ExtensionContext, connectionServ panel.onDidDispose( () => { console.log("[Kilo New] Tab panel disposed") + tabPanels.delete(panel) tabProvider.dispose() }, null, diff --git a/packages/kilo-vscode/src/kilo-provider-utils.ts b/packages/kilo-vscode/src/kilo-provider-utils.ts index 510422bc226..6b91cb668ec 100644 --- a/packages/kilo-vscode/src/kilo-provider-utils.ts +++ b/packages/kilo-vscode/src/kilo-provider-utils.ts @@ -61,6 +61,7 @@ export function getErrorMessage(error: unknown): string { export function sessionToWebview(session: Session) { return { id: session.id, + parentID: session.parentID ?? null, title: session.title, createdAt: new Date(session.time.created).toISOString(), updatedAt: new Date(session.time.updated).toISOString(), diff --git a/packages/kilo-vscode/src/kilo-provider/followup-session.ts b/packages/kilo-vscode/src/kilo-provider/followup-session.ts new file mode 100644 index 00000000000..3b220d44926 --- /dev/null +++ b/packages/kilo-vscode/src/kilo-provider/followup-session.ts @@ -0,0 +1,25 @@ +import { normalizePath } from "../agent-manager/git-import" + +const TTL = 30_000 +const LABEL = "Start new session" + +export interface Followup { + dir: string + time: number +} + +export function recordFollowup(input: { answers: string[][]; dir: string; now: number }): Followup | undefined { + const answer = input.answers[0]?.[0]?.trim() + if (answer !== LABEL) return + return { + dir: input.dir, + time: input.now, + } +} + +export function matchFollowup(input: { pending: Followup | null; dir: string; now: number }): boolean { + const item = input.pending + if (!item) return false + if (input.now - item.time > TTL) return false + return normalizePath(item.dir) === normalizePath(input.dir) +} diff --git a/packages/kilo-vscode/src/kilo-provider/handlers/migration.ts b/packages/kilo-vscode/src/kilo-provider/handlers/migration.ts index 2a508d4f9cc..b95d630610f 100644 --- a/packages/kilo-vscode/src/kilo-provider/handlers/migration.ts +++ b/packages/kilo-vscode/src/kilo-provider/handlers/migration.ts @@ -28,14 +28,19 @@ export interface MigrationContext { readonly client: KiloClient | null readonly extensionContext: MigrationExtensionContext | undefined postMessage(msg: unknown): void + refreshSessions(): void cachedLegacyData: LegacyMigrationData | null migrationCheckInFlight: boolean disposeGlobal(): Promise + broadcastComplete(): void } /** - * Check for legacy data on first run and auto-navigate to the migration wizard + * Check for legacy data on first run and send migration state to the webview * if the user has not yet been prompted. + * + * Uses a state-based approach (migrationState message) instead of navigate + * to avoid race conditions with SettingsEditorProvider's view navigation. */ export async function checkAndShowMigrationWizard(ctx: MigrationContext): Promise { if (!ctx.extensionContext) return @@ -58,13 +63,14 @@ export async function checkAndShowMigrationWizard(ctx: MigrationContext): Promis ctx.cachedLegacyData = data console.log("[Kilo New] KiloProvider: 🔄 Legacy data detected, showing migration wizard") - ctx.postMessage({ type: "navigate", view: "migration" }) ctx.postMessage({ - type: "legacyMigrationData", + type: "migrationState", + needed: true, data: { providers: data.providers, mcpServers: data.mcpServers, customModes: data.customModes, + sessions: data.sessions, defaultModel: data.defaultModel, settings: data.settings, }, @@ -84,6 +90,7 @@ export async function handleRequestLegacyMigrationData(ctx: MigrationContext): P providers: data.providers, mcpServers: data.mcpServers, customModes: data.customModes, + sessions: data.sessions, defaultModel: data.defaultModel, settings: data.settings, }, @@ -107,19 +114,19 @@ export async function handleStartLegacyMigration( ctx.cachedLegacyData?.settings, ) - // Dispose all instances after migration - // Reloading the data will be handled once the server replies with a global.disposed event - await ctx.disposeGlobal() - - // Only mark as completed if at least one item succeeded — if everything failed - // the user can still re-run migration via Settings → About. + const failed = results.some((r) => r.status === "error") const success = results.some((r) => r.status === "success") - if (success) { + if (!failed && success) { + // Dispose all instances after a fully successful migration. + // Reloading the data will be handled once the server replies with a global.disposed event. + await ctx.disposeGlobal() await MigrationService.setMigrationStatus( ctx.extensionContext as Parameters[0], "completed", ) + ctx.broadcastComplete() + ctx.refreshSessions() } ctx.postMessage({ type: "legacyMigrationComplete", results }) @@ -139,13 +146,14 @@ export async function handleStartLegacyMigration( } } -/** Record that the user skipped migration. */ +/** Record that the user skipped migration and broadcast to all instances. */ export async function handleSkipLegacyMigration(ctx: MigrationContext): Promise { if (!ctx.extensionContext) return await MigrationService.setMigrationStatus( ctx.extensionContext as Parameters[0], "skipped", ) + ctx.broadcastComplete() } /** Clear legacy data from SecretStorage and globalState after user opts in. */ diff --git a/packages/kilo-vscode/src/kilo-provider/handlers/question.ts b/packages/kilo-vscode/src/kilo-provider/handlers/question.ts index 53e722df50c..2279088c5e1 100644 --- a/packages/kilo-vscode/src/kilo-provider/handlers/question.ts +++ b/packages/kilo-vscode/src/kilo-provider/handlers/question.ts @@ -15,37 +15,51 @@ interface QuestionContext { } /** Handle question reply from the webview. */ -export async function handleQuestionReply(ctx: QuestionContext, requestID: string, answers: string[][]): Promise { +export async function handleQuestionReply( + ctx: QuestionContext, + requestID: string, + answers: string[][], + sessionID?: string, +): Promise { if (!ctx.client) { ctx.postMessage({ type: "questionError", requestID }) - return + return false } + const sid = sessionID ?? ctx.currentSessionId + try { await ctx.client.question.reply( - { requestID, answers, directory: ctx.getWorkspaceDirectory(ctx.currentSessionId) }, + { requestID, answers, directory: ctx.getWorkspaceDirectory(sid) }, { throwOnError: true }, ) + return true } catch (error) { console.error("[Kilo New] KiloProvider: Failed to reply to question:", error) ctx.postMessage({ type: "questionError", requestID }) + return false } } /** Handle question reject (dismiss) from the webview. */ -export async function handleQuestionReject(ctx: QuestionContext, requestID: string): Promise { +export async function handleQuestionReject( + ctx: QuestionContext, + requestID: string, + sessionID?: string, +): Promise { if (!ctx.client) { ctx.postMessage({ type: "questionError", requestID }) - return + return false } + const sid = sessionID ?? ctx.currentSessionId + try { - await ctx.client.question.reject( - { requestID, directory: ctx.getWorkspaceDirectory(ctx.currentSessionId) }, - { throwOnError: true }, - ) + await ctx.client.question.reject({ requestID, directory: ctx.getWorkspaceDirectory(sid) }, { throwOnError: true }) + return true } catch (error) { console.error("[Kilo New] KiloProvider: Failed to reject question:", error) ctx.postMessage({ type: "questionError", requestID }) + return false } } diff --git a/packages/kilo-vscode/src/kilo-provider/slim-metadata.ts b/packages/kilo-vscode/src/kilo-provider/slim-metadata.ts index d81b70045d4..3ec760d7c4a 100644 --- a/packages/kilo-vscode/src/kilo-provider/slim-metadata.ts +++ b/packages/kilo-vscode/src/kilo-provider/slim-metadata.ts @@ -1,54 +1,169 @@ /** - * Pure data-transform helpers that strip heavy edit-tool metadata from + * Pure data-transform helpers that strip heavy tool metadata from * message parts before sending them to the webview via postMessage. * + * The webview communicates with the extension over VS Code's IPC bridge. + * Every message is JSON-serialised → deserialised on each side. Tool parts + * from edit, apply_patch, multiedit and write often carry full file contents + * (before/after snapshots, patch text, written content). Sending those on + * every session switch makes serialisation the dominant bottleneck. + * + * This module strips fields the webview never (or rarely) needs while keeping + * everything required to render collapsed tool-part headers and diagnostics. + * * No vscode dependency — safe to unit-test in isolation. */ -/** Strip a filediff down to path + addition/deletion counts. */ -function slimEditMeta(meta: unknown): Record | undefined { - if (!meta || typeof meta !== "object") return undefined +// Max chars to keep for truncated output fields (bash metadata.output etc.) +const OUTPUT_CAP = 4000 - const obj = meta as Record - const filediff = obj.filediff - if (!filediff || typeof filediff !== "object") return undefined +// --------------------------------------------------------------------------- +// Helpers +// --------------------------------------------------------------------------- - const diff = filediff as Record - const file = typeof diff.file === "string" ? diff.file : undefined - const additions = typeof diff.additions === "number" ? diff.additions : 0 - const deletions = typeof diff.deletions === "number" ? diff.deletions : 0 - - const result: Record = { - filediff: { - ...(file ? { file } : {}), - additions, - deletions, - }, - } - // Preserve diagnostics so post-edit LSP errors still render - if (obj.diagnostics) result.diagnostics = obj.diagnostics - return result +function isObj(v: unknown): v is Record { + return !!v && typeof v === "object" && !Array.isArray(v) } -/** Strip heavy metadata from a single edit tool part; pass-through for everything else. */ +/** Truncate a string value to cap, appending a marker when trimmed. */ +function cap(v: unknown, limit = OUTPUT_CAP): string | undefined { + if (typeof v !== "string") return undefined + if (v.length <= limit) return v + return v.slice(0, limit) + `\n… (truncated, ${v.length - limit} chars omitted)` +} + +// --------------------------------------------------------------------------- +// Per-tool slimmers +// --------------------------------------------------------------------------- + +/** edit: strip filediff.before/after (webview falls back to input.oldString/newString). */ +function slimEdit(state: Record): Record { + const next = { ...state } + const meta = state.metadata + if (!isObj(meta)) { + delete next.metadata + return next + } + + const result: Record = {} + const fd = meta.filediff + if (isObj(fd)) { + result.filediff = { + ...(typeof fd.file === "string" ? { file: fd.file } : {}), + additions: typeof fd.additions === "number" ? fd.additions : 0, + deletions: typeof fd.deletions === "number" ? fd.deletions : 0, + } + } + if (meta.diagnostics) result.diagnostics = meta.diagnostics + next.metadata = result + return next +} + +/** apply_patch: strip files[].before/after/diff + input.patchText. */ +function slimPatch(state: Record): Record { + const next = { ...state } + const meta = state.metadata + if (isObj(meta) && Array.isArray(meta.files)) { + next.metadata = { + ...meta, + files: (meta.files as Record[]).map((f) => ({ + filePath: f.filePath, + relativePath: f.relativePath, + type: f.type, + additions: f.additions, + deletions: f.deletions, + movePath: f.movePath, + })), + } + if (isObj(meta) && meta.diagnostics) { + ;(next.metadata as Record).diagnostics = meta.diagnostics + } + } + // Strip the full patch text from input — only keep files count for title + const input = state.input + if (isObj(input) && typeof input.patchText === "string") { + next.input = { ...input, patchText: undefined } + } + return next +} + +/** multiedit: strip nested results (each is a full edit metadata object). */ +function slimMultiedit(state: Record): Record { + const next = { ...state } + const meta = state.metadata + if (isObj(meta) && Array.isArray(meta.results)) { + next.metadata = { + ...meta, + results: (meta.results as Record[]).map((r) => { + const slim: Record = {} + if (r.diagnostics) slim.diagnostics = r.diagnostics + const fd = r.filediff + if (isObj(fd)) { + slim.filediff = { + ...(typeof fd.file === "string" ? { file: fd.file } : {}), + additions: typeof fd.additions === "number" ? fd.additions : 0, + deletions: typeof fd.deletions === "number" ? fd.deletions : 0, + } + } + return slim + }), + } + } + return next +} + +/** write: strip input.content (entire file). Keep filePath + diagnostics. */ +function slimWrite(state: Record): Record { + const next = { ...state } + const input = state.input + if (isObj(input) && typeof input.content === "string") { + next.input = { ...input, content: undefined } + } + return next +} + +/** bash: truncate metadata.output (up to 30KB) and state.output (up to 50KB). */ +function slimBash(state: Record): Record { + const next = { ...state } + const meta = state.metadata + if (isObj(meta) && typeof meta.output === "string" && meta.output.length > OUTPUT_CAP) { + next.metadata = { ...meta, output: cap(meta.output) } + } + if (typeof state.output === "string" && (state.output as string).length > OUTPUT_CAP) { + next.output = cap(state.output) + } + return next +} + +// --------------------------------------------------------------------------- +// Public API +// --------------------------------------------------------------------------- + +const slimmers: Record) => Record> = { + edit: slimEdit, + apply_patch: slimPatch, + multiedit: slimMultiedit, + write: slimWrite, + bash: slimBash, +} + +/** Strip heavy metadata from a single tool part; pass-through for non-tool parts. */ export function slimPart(part: T): T { if (!part || typeof part !== "object") return part const obj = part as Record - if (obj.type !== "tool" || obj.tool !== "edit") return part + if (obj.type !== "tool") return part + + const tool = obj.tool + if (typeof tool !== "string") return part + + const fn = slimmers[tool] + if (!fn) return part const state = obj.state - if (!state || typeof state !== "object") return part + if (!isObj(state)) return part - const next = { ...(state as Record) } - const meta = slimEditMeta(next.metadata) - if (meta) next.metadata = meta - else delete next.metadata - - return { - ...obj, - state: next, - } as T + return { ...obj, state: fn(state) } as T } /** Slim every part in an array. */ diff --git a/packages/kilo-vscode/src/legacy-migration/errors/migration-error.ts b/packages/kilo-vscode/src/legacy-migration/errors/migration-error.ts new file mode 100644 index 00000000000..a54892df80e --- /dev/null +++ b/packages/kilo-vscode/src/legacy-migration/errors/migration-error.ts @@ -0,0 +1,83 @@ +interface ErrorLike { + message?: unknown + status?: unknown + data?: unknown + body?: unknown +} + +function isObject(value: unknown): value is Record { + return typeof value === "object" && value !== null +} + +function getText(value: unknown): string | undefined { + if (typeof value === "string") { + const text = value.trim() + return text || undefined + } + + if (typeof value === "number" || typeof value === "boolean") { + return String(value) + } + + return undefined +} + +function getMessage(value: unknown) { + if (!isObject(value)) return undefined + return getText((value as ErrorLike).message) +} + +function getStatus(value: unknown) { + if (!isObject(value)) return undefined + const status = (value as ErrorLike).status + return typeof status === "number" ? String(status) : getText(status) +} + +function getBody(value: unknown) { + if (!isObject(value)) return undefined + + const body = (value as ErrorLike).body + const text = getText(body) + if (text) return text + + if (isObject(body)) { + const msg = getMessage(body) + if (msg) return msg + } + + return undefined +} + +function getData(value: unknown) { + if (!isObject(value)) return undefined + + const data = (value as ErrorLike).data + const text = getText(data) + if (text) return text + + if (isObject(data)) { + const msg = getMessage(data) + if (msg) return msg + } + + return undefined +} + +export function getMigrationErrorMessage(err: unknown) { + const message = getMessage(err) + if (message) return message + + const body = getBody(err) + if (body) return body + + const data = getData(err) + if (data) return data + + const status = getStatus(err) + if (status) return `Request failed (${status})` + + const text = getText(err) + if (text) return text + + return "Unknown migration error" +} diff --git a/packages/kilo-vscode/src/legacy-migration/legacy-types.ts b/packages/kilo-vscode/src/legacy-migration/legacy-types.ts index 3f3af3018f9..a57ae2bff84 100644 --- a/packages/kilo-vscode/src/legacy-migration/legacy-types.ts +++ b/packages/kilo-vscode/src/legacy-migration/legacy-types.ts @@ -261,6 +261,18 @@ export interface LegacyCustomMode { groups: Array]> } +// --------------------------------------------------------------------------- +// Custom mode prompts (stored in VS Code globalState under "customModePrompts") +// --------------------------------------------------------------------------- + +/** Partial prompt overrides the legacy extension stored per-mode in globalState */ +export interface LegacyPromptComponent { + roleDefinition?: string + customInstructions?: string + whenToUse?: string + description?: string +} + // --------------------------------------------------------------------------- // Migration data shapes // --------------------------------------------------------------------------- @@ -282,12 +294,15 @@ export interface MigrationMcpServerInfo { export interface MigrationCustomModeInfo { name: string slug: string + /** Original slug when migrating a modified native mode under a new slug */ + nativeSlug?: string } export interface LegacyMigrationData { providers: MigrationProviderInfo[] mcpServers: MigrationMcpServerInfo[] customModes: MigrationCustomModeInfo[] + sessions?: string[] defaultModel?: { provider: string; model: string } settings?: LegacySettings hasData: boolean @@ -318,13 +333,7 @@ export interface MigrationSelections { providers: string[] mcpServers: string[] customModes: string[] + sessions?: string[] defaultModel: boolean settings: MigrationSettingsSelections } - -export interface MigrationResultItem { - item: string - category: "provider" | "mcpServer" | "customMode" | "defaultModel" | "settings" - status: "success" | "warning" | "error" - message?: string -} diff --git a/packages/kilo-vscode/src/legacy-migration/migration-service.ts b/packages/kilo-vscode/src/legacy-migration/migration-service.ts index 1fd2b1e6d1c..a3ea98ca44e 100644 --- a/packages/kilo-vscode/src/legacy-migration/migration-service.ts +++ b/packages/kilo-vscode/src/legacy-migration/migration-service.ts @@ -16,6 +16,8 @@ import type { } from "@kilocode/sdk/v2/client" import { PROVIDER_MAP, UNSUPPORTED_PROVIDERS, DEFAULT_MODE_SLUGS } from "./provider-mapping" import type { ProviderMapping } from "./provider-mapping" +import { NATIVE_MODE_DEFAULTS } from "./native-mode-defaults" +import { getMigrationErrorMessage } from "./errors/migration-error" import type { LegacyProviderProfiles, LegacyProviderSettings, @@ -24,14 +26,17 @@ import type { LegacyMcpServer, LegacySettings, LegacyAutocompleteSettings, + LegacyPromptComponent, LegacyMigrationData, MigrationSelections, MigrationAutoApprovalSelections, MigrationProviderInfo, MigrationMcpServerInfo, MigrationCustomModeInfo, - MigrationResultItem, } from "./legacy-types" +import type { MigrationResultItem } from "./migration-types" +import { createSessionID } from "./sessions/lib/ids" +import { migrate as migrateSession } from "./sessions/migrate" // --------------------------------------------------------------------------- // Constants @@ -67,7 +72,9 @@ export async function detectLegacyData(context: vscode.ExtensionContext): Promis const profiles = await readLegacyProviderProfiles(context) const mcpSettings = await readLegacyMcpSettings(context) const customModes = await readLegacyCustomModes(context) + const prompts = readLegacyCustomModePrompts(context) const settings = readLegacySettings(context) + const sessions = await readSessionsInGlobalStorage(context) const oauthProviders = new Set() const codexRaw = await context.secrets.get(CODEX_OAUTH_SECRET_KEY) @@ -75,7 +82,7 @@ export async function detectLegacyData(context: vscode.ExtensionContext): Promis const providers = buildProviderList(profiles, oauthProviders) const mcpServers = buildMcpServerList(mcpSettings) - const modes = buildCustomModeList(customModes) + const modes = buildCustomModeList(customModes, prompts) const defaultModel = resolveDefaultModel(profiles, oauthProviders) const hasSettings = @@ -92,18 +99,35 @@ export async function detectLegacyData(context: vscode.ExtensionContext): Promis Boolean(settings.language) || Boolean(settings.autocomplete) - const hasData = providers.length > 0 || mcpServers.length > 0 || modes.length > 0 || hasSettings + const hasData = + providers.length > 0 || mcpServers.length > 0 || modes.length > 0 || hasSettings || sessions.length > 0 return { providers, mcpServers, customModes: modes, + sessions: sessions.length > 0 ? sessions : undefined, defaultModel, settings: hasSettings ? settings : undefined, hasData, } } +async function readSessionsInGlobalStorage(context: vscode.ExtensionContext) { + const items = context.globalState.get<{ id: string }[]>("taskHistory", []) + const base = vscode.Uri.joinPath(context.globalStorageUri, "tasks") + const ids: string[] = [] + for (const item of items) { + const file = vscode.Uri.joinPath(base, item.id, "api_conversation_history.json") + const exists = await vscode.workspace.fs.stat(file).then( + () => true, + () => false, + ) + if (exists) ids.push(item.id) + } + return ids +} + // --------------------------------------------------------------------------- // Migration // --------------------------------------------------------------------------- @@ -131,6 +155,7 @@ export async function migrate( const profiles = await readLegacyProviderProfiles(context) const mcpSettings = await readLegacyMcpSettings(context) const customModes = await readLegacyCustomModes(context) + const prompts = readLegacyCustomModePrompts(context) const legacySettings = cachedSettings ?? readLegacySettings(context) const results: MigrationResultItem[] = [] @@ -179,24 +204,73 @@ export async function migrate( } // Migrate custom modes as agents - if (selections.customModes.length > 0 && customModes) { + if (selections.customModes.length > 0) { const agentConfig: Record = {} + // Build a lookup of detected modes by slug so we can resolve nativeSlug + const detected = buildCustomModeList(customModes, prompts) for (const slug of selections.customModes) { - const mode = customModes.find((m) => m.slug === slug) - if (!mode) { + const info = detected.find((m) => m.slug === slug) + if (!info) { results.push({ item: slug, category: "customMode", status: "error", message: "Mode not found" }) continue } - onProgress(mode.name, "migrating") - agentConfig[slug] = convertCustomMode(mode) - results.push({ item: mode.name, category: "customMode", status: "success" }) - onProgress(mode.name, "success") + + if (info.nativeSlug) { + // Modified native mode — merge YAML custom mode + customModePrompts + const merged = buildMergedNativeMode( + customModes?.find((m) => m.slug === info.nativeSlug), + prompts?.[info.nativeSlug], + info.nativeSlug, + ) + if (merged) { + onProgress(info.name, "migrating") + const agent = convertCustomMode(merged) + // Set explicit name so the UI shows "(Custom)" instead of title-casing the slug + agent.name = info.name + agentConfig[slug] = agent + results.push({ item: info.name, category: "customMode", status: "success" }) + onProgress(info.name, "success") + } else { + results.push({ + item: info.name, + category: "customMode", + status: "error", + message: "Failed to build merged mode", + }) + } + } else { + // Regular custom mode (existing behavior) + const mode = customModes?.find((m) => m.slug === slug) + if (!mode) { + results.push({ item: slug, category: "customMode", status: "error", message: "Mode not found" }) + continue + } + onProgress(mode.name, "migrating") + agentConfig[slug] = convertCustomMode(mode) + results.push({ item: mode.name, category: "customMode", status: "success" }) + onProgress(mode.name, "success") + } } if (Object.keys(agentConfig).length > 0) { await client.global.config.update({ config: { agent: agentConfig } }) } } + if (selections.sessions?.length) { + for (const id of selections.sessions) { + onProgress(id, "migrating") + const result = await migrateSession(id, context, client) + const reason = result.ok ? "Session migrated" : result.message + results.push({ + item: id, + category: "session", + status: result.ok ? "success" : "error", + message: reason, + }) + onProgress(id, result.ok ? "success" : "error", reason) + } + } + // Migrate default model if (selections.defaultModel && profiles) { const activeName = profiles.currentApiConfigName @@ -374,6 +448,24 @@ async function migrateProvider( return { item: profileName, category: "provider", status: "warning", message: "No API key found in profile" } } + // The profile endpoint requires type:"oauth". The legacy extension stored the same Kilo + // API token — write it in the OAuth format the new extension expects (matching device-auth: + // access + refresh + 1-year expiry). + if (mapping.id === "kilo") { + const org = mapping.organizationIdField ? (settings[mapping.organizationIdField] as string | undefined) : undefined + await client.auth.set({ + providerID: "kilo", + auth: { + type: "oauth" as const, + access: apiKey, + refresh: apiKey, + expires: Date.now() + 365 * 24 * 60 * 60 * 1000, + accountId: org, + }, + }) + return { item: profileName, category: "provider", status: "success" } + } + // For providers that support an organization ID (e.g. Kilo Gateway), migrate using OAuth // auth so the CLI can read accountId for org-scoped API requests. const organizationId = mapping.organizationIdField @@ -617,7 +709,7 @@ async function migrateAutocomplete(settings: LegacyAutocompleteSettings): Promis item: "Autocomplete settings", category: "settings", status: "error", - message: err instanceof Error ? err.message : String(err), + message: getMigrationErrorMessage(err), } } } @@ -665,7 +757,7 @@ async function migrateLanguage(language: string): Promise { item: "Language preference", category: "settings", status: "error", - message: err instanceof Error ? err.message : String(err), + message: getMigrationErrorMessage(err), } } } @@ -743,11 +835,22 @@ function convertCustomModePermissions(groups: LegacyCustomMode["groups"]): Permi } function convertCustomMode(mode: LegacyCustomMode): AgentConfig { - const prompt = [mode.roleDefinition, mode.customInstructions].filter(Boolean).join("\n\n") + const parts = [mode.roleDefinition] + if (mode.customInstructions?.trim()) { + parts.push( + [ + "USER'S CUSTOM INSTRUCTIONS", + "", + "The following additional instructions are provided by the user, and should be followed to the best of your ability.", + "", + `Mode-specific Instructions:\n${mode.customInstructions.trim()}`, + ].join("\n"), + ) + } return { mode: "primary", - description: mode.customInstructions ?? mode.roleDefinition?.slice(0, 120), - prompt, + description: mode.description ?? mode.whenToUse ?? mode.roleDefinition?.slice(0, 120), + prompt: parts.filter(Boolean).join("\n\n"), permission: convertCustomModePermissions(mode.groups), } } @@ -824,6 +927,10 @@ async function readLegacyCustomModes(context: vscode.ExtensionContext): Promise< return parseCustomModesYaml(text) } +function readLegacyCustomModePrompts(context: vscode.ExtensionContext): Record | null { + return context.globalState.get>("customModePrompts") ?? null +} + function readLegacySettings(context: vscode.ExtensionContext): LegacySettings { const raw = context.globalState.get>("ghostServiceSettings") const autocomplete: LegacyAutocompleteSettings | undefined = @@ -1043,9 +1150,96 @@ function buildMcpServerList(settings: LegacyMcpSettings | null): MigrationMcpSer .map(([name, server]) => ({ name, type: server.type ?? "stdio" })) } -function buildCustomModeList(modes: LegacyCustomMode[] | null): MigrationCustomModeInfo[] { - if (!modes) return [] - return modes.filter((m) => !DEFAULT_MODE_SLUGS.has(m.slug)).map((m) => ({ name: m.name, slug: m.slug })) +/** @internal — exported for testing only */ +export function buildCustomModeList( + modes: LegacyCustomMode[] | null, + prompts: Record | null, +): MigrationCustomModeInfo[] { + const result: MigrationCustomModeInfo[] = [] + + // Non-native custom modes (existing behavior) + if (modes) { + for (const m of modes) { + if (!DEFAULT_MODE_SLUGS.has(m.slug)) { + result.push({ name: m.name, slug: m.slug }) + } + } + } + + // Modified native modes — detect user modifications and offer migration under a new slug + for (const slug of DEFAULT_MODE_SLUGS) { + const defaults = NATIVE_MODE_DEFAULTS[slug] + if (!defaults) continue // "build" has no legacy defaults + + const yaml = modes?.find((m) => m.slug === slug) + const prompt = prompts?.[slug] + + if (!isNativeModeModified(yaml, prompt, defaults)) continue + + const name = yaml?.name ?? defaults.name + result.push({ name: `${name} (Custom)`, slug: `${slug}-custom`, nativeSlug: slug }) + } + + return result +} + +/** + * Checks whether a native mode has been meaningfully modified from its defaults. + * A full YAML override always counts as modified. For customModePrompts, we compare + * each field against the known default and only count it if it actually differs. + * @internal — exported for testing only + */ +export function isNativeModeModified( + yaml: LegacyCustomMode | undefined, + prompt: LegacyPromptComponent | undefined, + defaults: { roleDefinition: string; customInstructions?: string; whenToUse?: string; description?: string }, +): boolean { + if (yaml) return true + if (!prompt) return false + + if (prompt.roleDefinition && prompt.roleDefinition !== defaults.roleDefinition) return true + if (prompt.customInstructions && prompt.customInstructions !== (defaults.customInstructions ?? "")) return true + if (prompt.whenToUse && prompt.whenToUse !== (defaults.whenToUse ?? "")) return true + if (prompt.description && prompt.description !== (defaults.description ?? "")) return true + + return false +} + +/** + * Builds a merged LegacyCustomMode for a modified native mode by combining the YAML + * custom mode (if any) with customModePrompts overrides. When only prompts exist, the + * native defaults provide the base structure (name, groups). + * @internal — exported for testing only + */ +export function buildMergedNativeMode( + yaml: LegacyCustomMode | undefined, + prompt: LegacyPromptComponent | undefined, + slug: string, +): LegacyCustomMode | null { + const defaults = NATIVE_MODE_DEFAULTS[slug] + if (!defaults) return null + + const base: LegacyCustomMode = yaml + ? { ...yaml } + : { + slug, + name: defaults.name, + roleDefinition: defaults.roleDefinition, + customInstructions: defaults.customInstructions, + whenToUse: defaults.whenToUse, + description: defaults.description, + groups: [...defaults.groups], + } + + // Overlay customModePrompts on top (matching legacy runtime behavior) + if (prompt) { + if (prompt.roleDefinition) base.roleDefinition = prompt.roleDefinition + if (prompt.customInstructions) base.customInstructions = prompt.customInstructions + if (prompt.whenToUse) base.whenToUse = prompt.whenToUse + if (prompt.description) base.description = prompt.description + } + + return base } function resolveDefaultModel( diff --git a/packages/kilo-vscode/src/legacy-migration/migration-types.ts b/packages/kilo-vscode/src/legacy-migration/migration-types.ts new file mode 100644 index 00000000000..bd32d39ffd5 --- /dev/null +++ b/packages/kilo-vscode/src/legacy-migration/migration-types.ts @@ -0,0 +1,6 @@ +export interface MigrationResultItem { + item: string + category: "provider" | "mcpServer" | "customMode" | "defaultModel" | "settings" | "session" + status: "success" | "warning" | "error" + message?: string +} diff --git a/packages/kilo-vscode/src/legacy-migration/native-mode-defaults.ts b/packages/kilo-vscode/src/legacy-migration/native-mode-defaults.ts new file mode 100644 index 00000000000..e8f52c0d6b6 --- /dev/null +++ b/packages/kilo-vscode/src/legacy-migration/native-mode-defaults.ts @@ -0,0 +1,91 @@ +/** + * legacy-migration - Default values for native modes from the legacy Kilo Code v5.x extension. + * + * These are the exact built-in mode definitions shipped with the legacy extension. + * They are frozen references used to detect whether a user has actually modified a + * native mode's prompts before migrating it as a custom agent. + */ + +import type { LegacyCustomMode } from "./legacy-types" + +/** Prompt-level fields we compare against to detect modifications */ +export interface NativeModeDefaults { + name: string + roleDefinition: string + customInstructions?: string + whenToUse?: string + /** Short description shown in the UI (e.g., "Write, modify, and refactor code") */ + description?: string + groups: LegacyCustomMode["groups"] +} + +/** + * Built-in default values for each native mode slug from legacy Kilo Code v5.x. + * "build" is excluded because it does not exist as a legacy built-in mode. + */ +export const NATIVE_MODE_DEFAULTS: Record = { + architect: { + name: "Architect", + roleDefinition: + "You are Kilo Code, an experienced technical leader who is inquisitive and an excellent planner. Your goal is to gather information and get context to create a detailed plan for accomplishing the user's task, which the user will review and approve before they switch into another mode to implement the solution.", + whenToUse: + "Use this mode when you need to plan, design, or strategize before implementation. Perfect for breaking down complex problems, creating technical specifications, designing system architecture, or brainstorming solutions before coding.", + description: "Plan and design before implementation", + customInstructions: + "1. Do some information gathering (using provided tools) to get more context about the task.\n\n2. You should also ask the user clarifying questions to get a better understanding of the task.\n\n3. Once you've gained more context about the user's request, break down the task into clear, actionable steps and create a todo list using the `update_todo_list` tool. Each todo item should be:\n - Specific and actionable\n - Listed in logical execution order\n - Focused on a single, well-defined outcome\n - Clear enough that another mode could execute it independently\n\n **Note:** If the `update_todo_list` tool is not available, write the plan to a markdown file (e.g., `plan.md` or `todo.md`) instead.\n\n4. As you gather more information or discover new requirements, update the todo list to reflect the current understanding of what needs to be accomplished.\n\n5. Ask the user if they are pleased with this plan, or if they would like to make any changes. Think of this as a brainstorming session where you can discuss the task and refine the todo list.\n\n6. Include Mermaid diagrams if they help clarify complex workflows or system architecture. Please avoid using double quotes (\"\") and parentheses () inside square brackets ([]) in Mermaid diagrams, as this can cause parsing errors.\n\n7. Use the switch_mode tool to request switching to another mode when you need to edit non-markdown files (like source code files: .ts, .js, .py, .java, etc.) or execute commands. You CAN directly create and edit markdown files (.md) without switching modes.\n\n**IMPORTANT: Focus on creating clear, actionable todo lists rather than lengthy markdown documents. Use the todo list as your primary planning tool to track and organize the work that needs to be done.**\n\n**CRITICAL: Never provide level of effort time estimates (e.g., hours, days, weeks) for tasks. Focus solely on breaking down the work into clear, actionable steps without estimating how long they will take.**\n\nUnless told otherwise, if you want to save a plan file, put it in the /plans directory", + groups: ["read", ["edit", { fileRegex: "\\.md$", description: "Markdown files only" }], "browser", "mcp"], + }, + code: { + name: "Code", + roleDefinition: + "You are Kilo Code, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.", + whenToUse: + "Use this mode when you need to write, modify, or refactor code. Ideal for implementing features, fixing bugs, creating new files, or making code improvements across any programming language or framework.", + description: "Write, modify, and refactor code", + groups: ["read", "edit", "browser", "command", "mcp"], + }, + ask: { + name: "Ask", + roleDefinition: + "You are Kilo Code, a knowledgeable technical assistant focused on answering questions and providing information about software development, technology, and related topics.", + whenToUse: + "Use this mode when you need explanations, documentation, or answers to technical questions. Best for understanding concepts, analyzing existing code, getting recommendations, or learning about technologies without making changes.", + description: "Get answers and explanations", + customInstructions: + "You can analyze code, explain concepts, and access external resources. Always answer the user's questions thoroughly, and do not switch to implementing code unless explicitly requested by the user. Include Mermaid diagrams when they clarify your response.", + groups: ["read", "browser", "mcp"], + }, + debug: { + name: "Debug", + roleDefinition: + "You are Kilo Code, an expert software debugger specializing in systematic problem diagnosis and resolution.", + whenToUse: + "Use this mode when you're troubleshooting issues, investigating errors, or diagnosing problems. Specialized in systematic debugging, adding logging, analyzing stack traces, and identifying root causes before applying fixes.", + description: "Diagnose and fix software issues", + customInstructions: + "Reflect on 5-7 different possible sources of the problem, distill those down to 1-2 most likely sources, and then add logs to validate your assumptions. Explicitly ask the user to confirm the diagnosis before fixing the problem.", + groups: ["read", "edit", "browser", "command", "mcp"], + }, + orchestrator: { + name: "Orchestrator", + roleDefinition: + "You are Kilo Code, a strategic workflow orchestrator who coordinates complex tasks by delegating them to appropriate specialized modes. You have a comprehensive understanding of each mode's capabilities and limitations, allowing you to effectively break down complex problems into discrete tasks that can be solved by different specialists.", + whenToUse: + "Use this mode for complex, multi-step projects that require coordination across different specialties. Ideal when you need to break down large tasks into subtasks, manage workflows, or coordinate work that spans multiple domains or expertise areas.", + description: "Coordinate tasks across multiple modes", + customInstructions: + "Your role is to coordinate complex workflows by delegating tasks to specialized modes. As an orchestrator, you should:\n\n1. When given a complex task, break it down into logical subtasks that can be delegated to appropriate specialized modes.\n\n2. For each subtask, use the `new_task` tool to delegate. Choose the most appropriate mode for the subtask's specific goal and provide comprehensive instructions in the `message` parameter. These instructions must include:\n * All necessary context from the parent task or previous subtasks required to complete the work.\n * A clearly defined scope, specifying exactly what the subtask should accomplish.\n * An explicit statement that the subtask should *only* perform the work outlined in these instructions and not deviate.\n * An instruction for the subtask to signal completion by using the `attempt_completion` tool, providing a concise yet thorough summary of the outcome in the `result` parameter, keeping in mind that this summary will be the source of truth used to keep track of what was completed on this project.\n * A statement that these specific instructions supersede any conflicting general instructions the subtask's mode might have.\n\n3. Track and manage the progress of all subtasks. When a subtask is completed, analyze its results and determine the next steps.\n\n4. Help the user understand how the different subtasks fit together in the overall workflow. Provide clear reasoning about why you're delegating specific tasks to specific modes.\n\n5. When all subtasks are completed, synthesize the results and provide a comprehensive overview of what was accomplished.\n\n6. Ask clarifying questions when necessary to better understand how to break down complex tasks effectively.\n\n7. Suggest improvements to the workflow based on the results of completed subtasks.\n\nUse subtasks to maintain clarity. If a request significantly shifts focus or requires a different expertise (mode), consider creating a subtask rather than overloading the current one.", + groups: [], + }, + review: { + name: "Review", + roleDefinition: + "You are Kilo Code, an expert code reviewer with deep expertise in software engineering best practices, security vulnerabilities, performance optimization, and code quality. Your role is advisory - provide clear, actionable feedback on code quality and potential issues.", + whenToUse: + "Use this mode when you need to review code changes. Ideal for reviewing uncommitted work before committing, comparing your branch against main/develop, or analyzing changes before merging.", + description: "Review code changes locally", + customInstructions: + 'When you enter Review mode, you will receive a list of changed files. Use tools to explore the changes dynamically.\n\n## How to Review\n\n1. **Start with git diff**: Use `execute_command` to run `git diff` (for uncommitted) or `git diff ..HEAD` (for branch) to see the actual changes.\n\n2. **Examine specific files**: For complex changes, use `read_file` to see the full file context, not just the diff.\n\n3. **Gather history context**: Use `git log`, `git blame`, or `git show` when you need to understand why code was written a certain way.\n\n4. **Be confident**: Only flag issues where you have high confidence. Use these thresholds:\n - **CRITICAL (95%+)**: Security vulnerabilities, data loss risks, crashes, authentication bypasses\n - **WARNING (85%+)**: Bugs, logic errors, performance issues, unhandled errors\n - **SUGGESTION (75%+)**: Code quality improvements, best practices, maintainability\n - **Below 75%**: Don\'t comment - gather more context first\n\n5. **Focus on what matters**:\n - Security: Injection, auth issues, data exposure\n - Bugs: Logic errors, null handling, race conditions\n - Performance: Inefficient algorithms, memory leaks\n - Error handling: Missing try-catch, unhandled promises\n\n6. **Don\'t flag**:\n - Style preferences that don\'t affect functionality\n - Minor naming suggestions\n - Patterns that match existing codebase conventions\n\n## Output Format\n\n### Summary\n2-3 sentences describing what this change does and your overall assessment.\n\n### Issues Found\n| Severity | File:Line | Issue |\n|----------|-----------|-------|\n| CRITICAL | path/file.ts:42 | Brief description |\n| WARNING | path/file.ts:78 | Brief description |\n\nIf no issues: "No issues found."\n\n### Detailed Findings\nFor each issue:\n- **File:** `path/to/file.ts:line`\n- **Confidence:** X%\n- **Problem:** What\'s wrong and why it matters\n- **Suggestion:** Recommended fix with code snippet\n\n### Recommendation\nOne of: **APPROVE** | **APPROVE WITH SUGGESTIONS** | **NEEDS CHANGES**\n\n## Presenting Your Review\n\nAfter completing your review analysis and formatting your findings:\n\n- If your recommendation is **APPROVE** with no issues found, use `attempt_completion` to present your clean review.\n- If your recommendation is **APPROVE WITH SUGGESTIONS** or **NEEDS CHANGES**, use `ask_followup_question` instead of `attempt_completion`. Present your full review as the question text and include fix suggestions with mode switching so the user can apply fixes with one click.\n\nWhen using `ask_followup_question`, always provide exactly 1-3 suggestions in the `follow_up` array (never more than 3). Tailor them based on what you found. Choose the appropriate mode for each suggestion:\n- `mode="code"` for direct code fixes (bugs, missing error handling, clear improvements)\n- `mode="debug"` for issues needing investigation before fixing (race conditions, unclear root causes, intermittent failures)\n- `mode="orchestrator"` when there are many issues (3+) spanning different categories that need coordinated, planned fixes\n\nSuggestion patterns based on review findings:\n- **Few clear fixes (1-4 issues, same category):** offer mode="code" fixes\n- **Many issues across categories (3+, mixed security/performance/quality):** offer mode="orchestrator" to plan fixes and mode="code" for quick wins\n- **Issues needing investigation:** include a mode="debug" option to investigate root causes\n- **Suggestions only:** offer mode="code" to apply improvements\n\nExample with complex findings across multiple categories:\nUse `ask_followup_question` with:\n- question: Your full review (Summary, Issues Found table, Detailed Findings, and Recommendation)\n- follow_up:\n - { text: "Plan and coordinate fixes across all issue categories", mode: "orchestrator" }\n - { text: "Fix critical and warning issues only", mode: "code" }\n\nExample with straightforward fixes:\nUse `ask_followup_question` with:\n- question: Your full review (Summary, Issues Found table, Detailed Findings, and Recommendation)\n- follow_up:\n - { text: "Fix all issues found in this review", mode: "code" }\n - { text: "Fix critical issues only", mode: "code" }', + groups: ["read", "browser", "mcp", "command"], + }, +} diff --git a/packages/kilo-vscode/src/legacy-migration/provider-mapping.ts b/packages/kilo-vscode/src/legacy-migration/provider-mapping.ts index 28d8cf5dca3..02c67a2357b 100644 --- a/packages/kilo-vscode/src/legacy-migration/provider-mapping.ts +++ b/packages/kilo-vscode/src/legacy-migration/provider-mapping.ts @@ -251,6 +251,13 @@ export const PROVIDER_MAP: Record = { key: "syntheticApiKey", name: "Synthetic", }, + apertis: { + id: "apertis", + key: "apertisApiKey", + name: "Apertis", + modelField: "apertisModelId", + urlField: "apertisBaseUrl", + }, "openai-codex": { id: "openai", key: "", @@ -295,7 +302,6 @@ export const UNSUPPORTED_PROVIDERS = new Set([ "virtual-quota-fallback", "glama", "roo", - "apertis", ]) /** Built-in default mode slugs that should not be migrated */ diff --git a/packages/kilo-vscode/src/legacy-migration/sessions/lib/ids.ts b/packages/kilo-vscode/src/legacy-migration/sessions/lib/ids.ts new file mode 100644 index 00000000000..8f15054c049 --- /dev/null +++ b/packages/kilo-vscode/src/legacy-migration/sessions/lib/ids.ts @@ -0,0 +1,29 @@ +import { createHash } from "node:crypto" + +export function createProjectID(worktree?: string) { + return hash(worktree ?? "") +} + +export function createSessionID(id: string) { + return prefixed("ses", id) +} + +export function createMessageID(id: string, index: number) { + return prefixed("msg", `${id}:${index}`) +} + +export function createPartID(id: string, index: number, part: number) { + return prefixed("prt", `${id}:${index}:${part}`) +} + +export function createExtraPartID(id: string, index: number, kind: string) { + return prefixed("prt", `${id}:${index}:${kind}`) +} + +function prefixed(prefix: string, value: string) { + return `${prefix}_migrated_${hash(value).slice(0, 26)}` +} + +function hash(value: string) { + return createHash("sha1").update(value).digest("hex") +} diff --git a/packages/kilo-vscode/src/legacy-migration/sessions/lib/legacy-conversation.ts b/packages/kilo-vscode/src/legacy-migration/sessions/lib/legacy-conversation.ts new file mode 100644 index 00000000000..e103ef589d2 --- /dev/null +++ b/packages/kilo-vscode/src/legacy-migration/sessions/lib/legacy-conversation.ts @@ -0,0 +1,17 @@ +import * as path from "node:path" +import * as vscode from "vscode" +import type { LegacyApiMessage } from "./legacy-types" + +export async function getApiConversationHistory(id: string, dir: string) { + const file = path.join(dir, id, "api_conversation_history.json") + return vscode.workspace.fs.readFile(vscode.Uri.file(file)) +} + +export function parseFile(file: Uint8Array): LegacyApiMessage[] { + const text = Buffer.from(file).toString("utf8") + const json = JSON.parse(text) as unknown + if (!Array.isArray(json)) { + throw new Error("Legacy conversation history must be a JSON array") + } + return json.filter((entry): entry is LegacyApiMessage => Boolean(entry && typeof entry === "object")) +} diff --git a/packages/kilo-vscode/src/legacy-migration/sessions/lib/legacy-types.ts b/packages/kilo-vscode/src/legacy-migration/sessions/lib/legacy-types.ts new file mode 100644 index 00000000000..7288fd51a99 --- /dev/null +++ b/packages/kilo-vscode/src/legacy-migration/sessions/lib/legacy-types.ts @@ -0,0 +1,28 @@ +import type { Anthropic } from "@anthropic-ai/sdk" + +export interface LegacyHistoryItem { + id: string + rootTaskId?: string + parentTaskId?: string + ts?: number + task?: string + workspace?: string + mode?: string +} + +export type LegacyApiMessage = Anthropic.MessageParam & { + ts?: number + isSummary?: boolean + id?: string + type?: "reasoning" + summary?: unknown[] + encrypted_content?: string + text?: string + reasoning_details?: unknown[] + reasoning_content?: string + condenseId?: string + condenseParent?: string + truncationId?: string + truncationParent?: string + isTruncationMarker?: boolean +} diff --git a/packages/kilo-vscode/src/legacy-migration/sessions/lib/messages.ts b/packages/kilo-vscode/src/legacy-migration/sessions/lib/messages.ts new file mode 100644 index 00000000000..c0ddc3d75bb --- /dev/null +++ b/packages/kilo-vscode/src/legacy-migration/sessions/lib/messages.ts @@ -0,0 +1,87 @@ +import type { KilocodeSessionImportMessageData as Message } from "@kilocode/sdk/v2" +import type { LegacyApiMessage, LegacyHistoryItem } from "./legacy-types" +import { createMessageID, createSessionID } from "./ids" + +type Body = NonNullable +type Data = Body["data"] +type User = Extract +type Assistant = Extract + +export function parseMessagesFromConversation( + conversation: LegacyApiMessage[], + id: string, + dirOrItem?: string | LegacyHistoryItem, + item?: LegacyHistoryItem, +): Array> { + const dir = typeof dirOrItem === "string" ? dirOrItem : (dirOrItem?.workspace ?? "") + const next = typeof dirOrItem === "string" ? item : dirOrItem + + return conversation + .filter((entry) => entry.role === "user" || entry.role === "assistant") + .map((entry, index) => parseMessage(entry, index, id, dir, next)) + .filter((message): message is NonNullable => Boolean(message)) +} + +function parseMessage( + entry: LegacyApiMessage, + index: number, + id: string, + dir: string, + item?: LegacyHistoryItem, +): NonNullable | undefined { + const created = entry.ts ?? item?.ts ?? 0 + + if (entry.role === "user") { + const data: User = { + role: "user", + time: { created }, + agent: "user", + model: { + providerID: "legacy", + modelID: "legacy", + }, + } + + return { + id: createMessageID(id, index), + sessionID: createSessionID(id), + timeCreated: created, + data, + } + } + + if (entry.role === "assistant") { + const data: Assistant = { + role: "assistant", + time: { created, completed: created }, + parentID: index > 0 ? createMessageID(id, index - 1) : createMessageID(id, index), + modelID: "legacy", + providerID: "legacy", + mode: item?.mode ?? "code", + agent: "main", + path: { + cwd: dir, + root: dir, + }, + cost: 0, + tokens: { + input: 0, + output: 0, + reasoning: 0, + cache: { + read: 0, + write: 0, + }, + }, + } + + return { + id: createMessageID(id, index), + sessionID: createSessionID(id), + timeCreated: created, + data, + } + } + + return undefined +} diff --git a/packages/kilo-vscode/src/legacy-migration/sessions/lib/parts/merge-tools.ts b/packages/kilo-vscode/src/legacy-migration/sessions/lib/parts/merge-tools.ts new file mode 100644 index 00000000000..1604654b7d8 --- /dev/null +++ b/packages/kilo-vscode/src/legacy-migration/sessions/lib/parts/merge-tools.ts @@ -0,0 +1,66 @@ +import type { KilocodeSessionImportPartData as Part } from "@kilocode/sdk/v2" +import type { LegacyApiMessage } from "../legacy-types" +import { getText, getToolUse, isToolResult, record } from "./parts-util" + +type Body = NonNullable +type Data = Body["data"] +type Tool = Extract +type ToolCompleted = Extract + +// This takes the "tool started" half and the matching "tool finished" half, +// and merges both so the migrated session keeps one complete tool action. +export function mergeToolUseAndResult( + partID: string, + messageID: string, + sessionID: string, + created: number, + conversation: LegacyApiMessage[], + result: { type?: string; tool_use_id?: string; content?: unknown }, +): NonNullable | undefined { + const tool = getToolUseFromConversation(conversation, result.tool_use_id) + if (!tool) return undefined + const callID = typeof tool.id === "string" ? tool.id : partID + const name = typeof tool.name === "string" ? tool.name : "unknown" + const output = getText(result.content) ?? name + const state: ToolCompleted = { + status: "completed", + input: record(tool.input), + output, + title: name, + metadata: {}, + time: { + start: created, + end: created, + }, + } + + const data: Tool = { + type: "tool", + callID, + tool: name, + state, + } + + return { + id: partID, + messageID, + sessionID, + timeCreated: created, + data, + } +} + +export function thereIsNoToolResult(conversation: LegacyApiMessage[], id: string | undefined) { + return !conversation.some( + (entry) => + Array.isArray(entry.content) && entry.content.some((part) => isToolResult(part) && part.tool_use_id === id), + ) +} + +function getToolUseFromConversation(conversation: LegacyApiMessage[], id: string | undefined) { + for (const entry of conversation) { + const tool = getToolUse(entry, id) + if (tool) return tool + } + return undefined +} diff --git a/packages/kilo-vscode/src/legacy-migration/sessions/lib/parts/parts-builder.ts b/packages/kilo-vscode/src/legacy-migration/sessions/lib/parts/parts-builder.ts new file mode 100644 index 00000000000..fd91dbaa445 --- /dev/null +++ b/packages/kilo-vscode/src/legacy-migration/sessions/lib/parts/parts-builder.ts @@ -0,0 +1,102 @@ +import type { KilocodeSessionImportPartData as Part } from "@kilocode/sdk/v2" +import { cleanLegacyTaskText, isLegacySystemErrorText, record } from "./parts-util" + +type Body = NonNullable +type Data = Body["data"] +type Text = Extract +type Reasoning = Extract +type Tool = Extract +type ToolCompleted = Extract + +export function toTool( + partID: string, + messageID: string, + sessionID: string, + created: number, + part: { type?: string; id?: string; name?: string; input?: unknown }, +): NonNullable { + const tool = typeof part.name === "string" ? part.name : "unknown" + const state: ToolCompleted = { + status: "completed", + input: record(part.input), + output: tool, + title: tool, + metadata: {}, + time: { + start: created, + end: created, + }, + } + + const data: Tool = { + type: "tool", + callID: part.id ?? partID, + tool, + state, + } + + return { + id: partID, + messageID, + sessionID, + timeCreated: created, + data, + } +} + +export function toText( + partID: string, + messageID: string, + sessionID: string, + created: number, + text: string, +): NonNullable { + const value = cleanLegacyTaskText(text) + const data: Text = { + type: "text", + text: value, + ...(isLegacySystemErrorText(value) && { + ignored: true, + metadata: { + source: "legacy-system-error", + }, + }), + time: { + start: created, + end: created, + }, + } + + return { + id: partID, + messageID, + sessionID, + timeCreated: created, + data, + } +} + +export function toReasoning( + partID: string, + messageID: string, + sessionID: string, + created: number, + text: string, +): NonNullable { + const data: Reasoning = { + type: "reasoning", + text, + time: { + start: created, + end: created, + }, + } + + return { + id: partID, + messageID, + sessionID, + timeCreated: created, + data, + } +} diff --git a/packages/kilo-vscode/src/legacy-migration/sessions/lib/parts/parts-util.ts b/packages/kilo-vscode/src/legacy-migration/sessions/lib/parts/parts-util.ts new file mode 100644 index 00000000000..d6359eafd9d --- /dev/null +++ b/packages/kilo-vscode/src/legacy-migration/sessions/lib/parts/parts-util.ts @@ -0,0 +1,132 @@ +import type { LegacyApiMessage } from "../legacy-types" + +type ToolUse = { + type?: string + id?: string + name?: string + input?: unknown +} + +export function isSimpleText(input: LegacyApiMessage): input is LegacyApiMessage & { content: string } { + return typeof input.content === "string" && Boolean(input.content) +} + +export function isReasoning(input: LegacyApiMessage): input is LegacyApiMessage & { type: "reasoning"; text: string } { + return input.type === "reasoning" && typeof input.text === "string" && Boolean(input.text) +} + +export function isProviderSpecificReasoning(input: LegacyApiMessage) { + return Boolean(getReasoningText(input)) +} + +export function getReasoningText(input: LegacyApiMessage) { + if (typeof input.reasoning_content === "string" && input.reasoning_content.trim()) { + // Some providers store the model thinking outside normal content blocks, so we need to lift it manually. + return input.reasoning_content.trim() + } + + if (!Array.isArray(input.reasoning_details)) return undefined + + const text = input.reasoning_details + .flatMap((item) => { + if (!item || typeof item !== "object") return [] + if (typeof (item as { text?: unknown }).text === "string") return [(item as { text: string }).text] + if (typeof (item as { reasoning?: unknown }).reasoning === "string") + return [(item as { reasoning: string }).reasoning] + return [] + }) + .join("\n") + .trim() + + // reasoning_details can come as provider-specific arrays, so we collapse the readable text we can find. + return text || undefined +} + +export function isSingleTextWithinMessage(input: unknown): input is { type?: string; text: string } { + return isText(input) && Boolean(input.text) +} + +export function isEnvironmentDetails(input: string) { + return /^\s*[\s\S]*<\/environment_details>\s*$/i.test(input) +} + +export function isCompletionResult( + input: unknown, +): input is { type?: string; name?: string; input: { result: string } } { + return Boolean( + input && + typeof input === "object" && + "type" in input && + input.type === "tool_use" && + "name" in input && + input.name === "attempt_completion" && + "input" in input && + input.input && + typeof input.input === "object" && + "result" in input.input && + typeof input.input.result === "string" && + input.input.result, + ) +} + +export function record(input: unknown): Record { + if (!input || typeof input !== "object" || Array.isArray(input)) return {} + return input as Record +} + +export function isToolUse(input: unknown): input is { type?: string; id?: string; name?: string; input?: unknown } { + return Boolean(input && typeof input === "object" && "type" in input && input.type === "tool_use") +} + +export function isText(input: unknown): input is { type?: string; text?: string } { + return Boolean(input && typeof input === "object" && "type" in input && input.type === "text") +} + +export function isToolResult(input: unknown): input is { type?: string; tool_use_id?: string; content?: unknown } { + return Boolean(input && typeof input === "object" && "type" in input && input.type === "tool_result") +} + +// This looks through the blocks inside one legacy message and finds the tool_use whose id +// matches the tool_result we are processing, so we know which tool call produced that result. +export function getToolUse(input: LegacyApiMessage, id: string | undefined) { + if (!Array.isArray(input.content)) return undefined + return input.content.find((part) => isToolUse(part) && part.id === id) as ToolUse | undefined +} + +export function getText(input: unknown) { + if (typeof input === "string") return input + if (!Array.isArray(input)) return undefined + const text = input + .flatMap((item) => { + if (isText(item) && item.text) return [item.text] + return [] + }) + .join("\n") + .trim() + return text || undefined +} + +export function cleanLegacyTaskText(input: string) { + // Legacy sometimes stores the real user prompt wrapped inside ..., followed by + // extra ... prompt scaffolding. We only want the + // actual task text to appear in the migrated conversation, so if a block exists we keep + // just that inner text and drop the wrapper plus the extra environment block. + const task = input.match(/([\s\S]*?)<\/task>/i)?.[1]?.trim() + if (task) return task + + if (isEnvironmentDetails(input)) return "" + + return input +} + +export function isLegacySystemErrorText(input: string) { + return input.trimStart().startsWith("[ERROR]") +} + +export function getFeedbackText(input: unknown) { + const text = getText(input) + if (!text) return undefined + const match = text.match(/([\s\S]*?)<\/feedback>/i) + const value = match?.[1]?.trim() + return value || undefined +} diff --git a/packages/kilo-vscode/src/legacy-migration/sessions/lib/parts/parts.ts b/packages/kilo-vscode/src/legacy-migration/sessions/lib/parts/parts.ts new file mode 100644 index 00000000000..4b122a2f0a5 --- /dev/null +++ b/packages/kilo-vscode/src/legacy-migration/sessions/lib/parts/parts.ts @@ -0,0 +1,107 @@ +import type { KilocodeSessionImportPartData as Part } from "@kilocode/sdk/v2" +import type { LegacyApiMessage, LegacyHistoryItem } from "../legacy-types" +import { createExtraPartID, createMessageID, createPartID, createSessionID } from "../ids" +import { toReasoning, toText, toTool } from "./parts-builder" +import { + getFeedbackText, + isCompletionResult, + isEnvironmentDetails, + getReasoningText, + isProviderSpecificReasoning, + isReasoning, + isSimpleText, + isSingleTextWithinMessage, + isToolResult, + isToolUse, +} from "./parts-util" +import { mergeToolUseAndResult, thereIsNoToolResult } from "./merge-tools" + +export function parsePartsFromConversation( + conversation: LegacyApiMessage[], + id: string, + item?: LegacyHistoryItem, +): Array> { + const list = conversation.filter((entry) => entry.role === "user" || entry.role === "assistant") + return list.flatMap((entry, index) => parseParts(entry, index, id, list, item)) +} + +function parseParts( + entry: LegacyApiMessage, + index: number, + id: string, + conversation: LegacyApiMessage[], + item?: LegacyHistoryItem, +): Array> { + const messageID = createMessageID(id, index) + const sessionID = createSessionID(id) + const created = entry.ts ?? item?.ts ?? 0 + + if (isSimpleText(entry)) { + // Ignore raw blocks because they are legacy prompt scaffolding, + // not actual user-visible conversation content we want to preserve in the migrated session. + if (isEnvironmentDetails(entry.content)) return [] + return [toText(createPartID(id, index, 0), messageID, sessionID, created, entry.content)] + } + + if (!Array.isArray(entry.content)) return [] + + const parts: Array> = [] + + if (isReasoning(entry)) { + parts.push(toReasoning(createExtraPartID(id, index, "reasoning"), messageID, sessionID, created, entry.text)) + } + + // Some providers store thinking outside normal content blocks, so this handles those provider-specific fields. + if (!isReasoning(entry) && isProviderSpecificReasoning(entry)) { + const reasoning = getReasoningText(entry) + if (reasoning) { + parts.push( + toReasoning(createExtraPartID(id, index, "provider-reasoning"), messageID, sessionID, created, reasoning), + ) + } + } + + entry.content.forEach((part, partIndex) => { + const partID = createPartID(id, index, partIndex) + + // Legacy can store a message as several pieces; this handles one text block inside that larger message. + if (isSingleTextWithinMessage(part)) { + // Ignore standalone text blocks for the same reason: they describe + // editor/runtime context for the old prompt, but they are not meaningful chat content. + if (isEnvironmentDetails(part.text)) return + parts.push(toText(partID, messageID, sessionID, created, part.text)) + return + } + + // The legacy session can contain a final completion message after an assistant interaction. + // Treat it like a regular assistant text part so the migrated session keeps that final visible answer. + if (isCompletionResult(part)) { + const text = part.input.result + parts.push(toText(partID, messageID, sessionID, created, text)) + return + } + + if (isToolUse(part) && thereIsNoToolResult(conversation, part.id)) { + parts.push(toTool(partID, messageID, sessionID, created, part)) + return + } + + if (isToolResult(part)) { + const feedback = getFeedbackText(part.content) + if (feedback) { + parts.push( + toText(createExtraPartID(id, index, `feedback-${partIndex}`), messageID, sessionID, created, feedback), + ) + } + + // tool_result usually lives in the following user message, while the matching tool_use lives + // in the earlier assistant message, so we need the whole conversation to reconcile both halves. + const tool = mergeToolUseAndResult(partID, messageID, sessionID, created, conversation, part) + if (!tool) return + parts.push(tool) + return + } + }) + + return parts +} diff --git a/packages/kilo-vscode/src/legacy-migration/sessions/lib/path.ts b/packages/kilo-vscode/src/legacy-migration/sessions/lib/path.ts new file mode 100644 index 00000000000..4b841725400 --- /dev/null +++ b/packages/kilo-vscode/src/legacy-migration/sessions/lib/path.ts @@ -0,0 +1,25 @@ +import * as fs from "fs/promises" +import * as path from "path" + +export async function normalizeLegacyPath(input?: string): Promise { + const raw = input?.trim() + if (!raw) return "" + + // Collapse legacy paths into one stable absolute form before importing them. + const normalized = path.normalize(path.resolve(raw)) + const canonical = normalizeWindowsDriveLetter(normalized) + + return fs.realpath(canonical).catch(() => canonical) +} + +export function isWindowsDrivePath(input: string): boolean { + return /^[a-z]:[\\/]/i.test(input) +} + +function normalizeWindowsDriveLetter(input: string): string { + // Match the canonical drive-letter casing used later by Windows path filters. + if (!isWindowsDrivePath(input)) return input + const head = input[0] + if (!head) return input + return head.toUpperCase() + input.slice(1) +} diff --git a/packages/kilo-vscode/src/legacy-migration/sessions/lib/project.ts b/packages/kilo-vscode/src/legacy-migration/sessions/lib/project.ts new file mode 100644 index 00000000000..6a06b364796 --- /dev/null +++ b/packages/kilo-vscode/src/legacy-migration/sessions/lib/project.ts @@ -0,0 +1,30 @@ +import type { KilocodeSessionImportProjectData as Project } from "@kilocode/sdk/v2" +import type { LegacyHistoryItem } from "./legacy-types" +import { createProjectID } from "./ids" + +export function createProject(item?: LegacyHistoryItem): NonNullable { + const project = makeProject() + const dir = item?.workspace ?? "" + + project.id = createProjectID(dir) + + project.worktree = dir + + project.sandboxes = dir ? [dir] : [] + + project.timeCreated = item?.ts ?? 0 + + project.timeUpdated = item?.ts ?? 0 + + return project +} + +function makeProject(): NonNullable { + return { + id: "", + worktree: "", + sandboxes: [], + timeCreated: 0, + timeUpdated: 0, + } +} diff --git a/packages/kilo-vscode/src/legacy-migration/sessions/lib/session.ts b/packages/kilo-vscode/src/legacy-migration/sessions/lib/session.ts new file mode 100644 index 00000000000..725aacf6059 --- /dev/null +++ b/packages/kilo-vscode/src/legacy-migration/sessions/lib/session.ts @@ -0,0 +1,43 @@ +import type { KilocodeSessionImportSessionData as Session } from "@kilocode/sdk/v2" +import type { LegacyHistoryItem } from "./legacy-types" +import { createSessionID } from "./ids" + +export function createSession( + id: string, + item: LegacyHistoryItem | undefined, + projectID: string, + dir: string, +): NonNullable { + const session = makeSession() + + session.id = createSessionID(id) + + session.projectID = projectID + + session.slug = id + + session.directory = dir + + session.title = item?.task ?? id + + session.version = "v2" + + session.timeCreated = item?.ts ?? 0 + + session.timeUpdated = item?.ts ?? 0 + + return session +} + +function makeSession(): NonNullable { + return { + id: "", + projectID: "", + slug: "", + directory: "", + title: "", + version: "", + timeCreated: 0, + timeUpdated: 0, + } +} diff --git a/packages/kilo-vscode/src/legacy-migration/sessions/migrate.ts b/packages/kilo-vscode/src/legacy-migration/sessions/migrate.ts new file mode 100644 index 00000000000..0fa38fdaf0d --- /dev/null +++ b/packages/kilo-vscode/src/legacy-migration/sessions/migrate.ts @@ -0,0 +1,65 @@ +import * as vscode from "vscode" +import type { KiloClient } from "@kilocode/sdk/v2/client" +import { getMigrationErrorMessage } from "../errors/migration-error" +import type { LegacyHistoryItem } from "./lib/legacy-types" +import { parseSession } from "./parser" + +type Result = + | { + ok: true + skipped?: boolean + payload: Awaited> + } + | { + ok: false + payload: Awaited> + message: string + } + +export async function migrate(id: string, context: vscode.ExtensionContext, client: KiloClient): Promise { + const dir = vscode.Uri.joinPath(context.globalStorageUri, "tasks").fsPath + const items = context.globalState.get("taskHistory", []) + const item = items.find((item) => item.id === id) + const payload = await parseSession(id, dir, item) + + try { + const project = await client.kilocode.sessionImport.project(payload.project, { throwOnError: true }) + const projectID = project.data?.id ?? payload.project.id + const session = await client.kilocode.sessionImport.session( + { + ...payload.session, + projectID, + query_directory: payload.session.directory, + body_directory: payload.session.directory, + }, + { throwOnError: true }, + ) + // Skip child imports when the session already exists so rerunning migration only imports missing sessions. + if (session.data?.skipped) { + return { + ok: true, + skipped: true, + payload, + } + } + + for (const msg of payload.messages) { + await client.kilocode.sessionImport.message(msg, { throwOnError: true }) + } + + for (const part of payload.parts) { + await client.kilocode.sessionImport.part(part, { throwOnError: true }) + } + + return { + ok: true, + payload, + } + } catch (error) { + return { + ok: false, + payload, + message: getMigrationErrorMessage(error), + } + } +} diff --git a/packages/kilo-vscode/src/legacy-migration/sessions/parser.ts b/packages/kilo-vscode/src/legacy-migration/sessions/parser.ts new file mode 100644 index 00000000000..966ba46bf41 --- /dev/null +++ b/packages/kilo-vscode/src/legacy-migration/sessions/parser.ts @@ -0,0 +1,38 @@ +import type { LegacyHistoryItem } from "./lib/legacy-types" +import type { + KilocodeSessionImportMessageData as Message, + KilocodeSessionImportPartData as Part, + KilocodeSessionImportProjectData as Project, + KilocodeSessionImportSessionData as Session, +} from "@kilocode/sdk/v2" +import { getApiConversationHistory, parseFile } from "./lib/legacy-conversation" +import { parseMessagesFromConversation } from "./lib/messages" +import { parsePartsFromConversation } from "./lib/parts/parts" +import { normalizeLegacyPath } from "./lib/path" +import { createProject } from "./lib/project" +import { createSession } from "./lib/session" + +export interface NormalizedSession { + project: NonNullable + session: NonNullable + messages: Array> + parts: Array> +} + +export async function parseSession(id: string, dir: string, item?: LegacyHistoryItem): Promise { + const root = await normalizeLegacyPath(item?.workspace) + const next = item ? { ...item, workspace: root } : undefined + const project = createProject(next) + const session = createSession(id, next, project.id, root) + const file = await getApiConversationHistory(id, dir) + const conversation = parseFile(file) + const messages = parseMessagesFromConversation(conversation, id, root, next) + const parts = parsePartsFromConversation(conversation, id, item) + + return { + project, + session, + messages, + parts, + } +} diff --git a/packages/kilo-vscode/src/services/autocomplete/classic-auto-complete/AutocompleteInlineCompletionProvider.ts b/packages/kilo-vscode/src/services/autocomplete/classic-auto-complete/AutocompleteInlineCompletionProvider.ts index 73fe0cdf10c..93ef16b749e 100644 --- a/packages/kilo-vscode/src/services/autocomplete/classic-auto-complete/AutocompleteInlineCompletionProvider.ts +++ b/packages/kilo-vscode/src/services/autocomplete/classic-auto-complete/AutocompleteInlineCompletionProvider.ts @@ -126,6 +126,8 @@ export class AutocompleteInlineCompletionProvider implements vscode.InlineComple private recentlyVisitedRangesService: RecentlyVisitedRangesService private recentlyEditedTracker: RecentlyEditedTracker private debounceTimer: NodeJS.Timeout | null = null + /** The pending request associated with the current debounce timer (if any) */ + private debouncedPendingRequest: PendingRequest | null = null private isFirstCall: boolean = true private ignoreController: Promise /** Abort controller for the current in-flight FIM request */ @@ -297,6 +299,8 @@ export class AutocompleteInlineCompletionProvider implements vscode.InlineComple clearTimeout(this.debounceTimer) this.debounceTimer = null } + this.debouncedPendingRequest = null + this.pendingRequests.length = 0 this.fimAbortController?.abort() this.fimAbortController = null this.telemetry?.dispose() @@ -500,14 +504,25 @@ export class AutocompleteInlineCompletionProvider implements vscode.InlineComple } // If this is the first call (no pending debounce), execute immediately + // but still track it as a pending request so subsequent calls can reuse it if (this.isFirstCall && this.debounceTimer === null) { this.isFirstCall = false - return this.fetchAndCacheSuggestion(prompt, prefix, suffix, languageId) + const promise = this.fetchAndCacheSuggestion(prompt, prefix, suffix, languageId) + const leading: PendingRequest = { prefix, suffix, promise } + promise.finally(() => this.removePendingRequest(leading)) + this.pendingRequests.push(leading) + return promise } - // Clear any existing timer (reset the debounce) + // Clear any existing timer and remove the stale pending request it belongs to. + // The cancelled timer's callback will never fire, so the pending entry would + // otherwise linger with a never-resolving promise. if (this.debounceTimer !== null) { clearTimeout(this.debounceTimer) + if (this.debouncedPendingRequest) { + this.removePendingRequest(this.debouncedPendingRequest) + this.debouncedPendingRequest = null + } } // Create the pending request object first so we can reference it in the cleanup @@ -520,6 +535,7 @@ export class AutocompleteInlineCompletionProvider implements vscode.InlineComple const requestPromise = new Promise((resolve) => { this.debounceTimer = setTimeout(async () => { this.debounceTimer = null + this.debouncedPendingRequest = null this.isFirstCall = true // Reset for next sequence await this.fetchAndCacheSuggestion(prompt, prefix, suffix, languageId) // Remove this request from pending when done @@ -531,6 +547,9 @@ export class AutocompleteInlineCompletionProvider implements vscode.InlineComple // Complete the pending request object pendingRequest.promise = requestPromise + // Track so we can remove it if the timer is cleared by a subsequent call + this.debouncedPendingRequest = pendingRequest + // Add to the list of pending requests this.pendingRequests.push(pendingRequest) diff --git a/packages/kilo-vscode/src/services/autocomplete/classic-auto-complete/__tests__/AutocompleteInlineCompletionProvider.test.ts b/packages/kilo-vscode/src/services/autocomplete/classic-auto-complete/__tests__/AutocompleteInlineCompletionProvider.test.ts index 77a9297f640..65d709f7232 100644 --- a/packages/kilo-vscode/src/services/autocomplete/classic-auto-complete/__tests__/AutocompleteInlineCompletionProvider.test.ts +++ b/packages/kilo-vscode/src/services/autocomplete/classic-auto-complete/__tests__/AutocompleteInlineCompletionProvider.test.ts @@ -1973,6 +1973,57 @@ describe("AutocompleteInlineCompletionProvider", () => { expect(callCount).toBe(1) }) + it("should reuse slow leading-edge request when user types forward before it completes", async () => { + // Mock the model with a slow response that takes 500ms + let callCount = 0 + let resolvers: Array<() => void> = [] + vi.mocked(mockModel.generateFimResponse).mockImplementation(async (_prefix, _suffix, onChunk) => { + callCount++ + // Simulate a slow FIM response — wait for manual resolution + await new Promise((resolve) => { + resolvers.push(resolve) + }) + if (onChunk) { + onChunk("console.log('test');") + } + return { + cost: 0.01, + inputTokens: 100, + outputTokens: 50, + cacheWriteTokens: 0, + cacheReadTokens: 0, + } + }) + + // First request: leading edge fires immediately for "const x = 1" + const doc1 = new MockTextDocument(vscode.Uri.file("/test.ts"), "const x = 1\nconst y = 2") + const pos1 = new vscode.Position(0, 11) + const promise1 = provider.provideInlineCompletionItems(doc1, pos1, mockContext, mockToken) + + // Leading edge should have started the request immediately + expect(callCount).toBe(1) + + // User types "c" while the leading-edge request is still in-flight + const doc2 = new MockTextDocument(vscode.Uri.file("/test.ts"), "const x = 1c\nconst y = 2") + const pos2 = new vscode.Position(0, 12) + const promise2 = provider.provideInlineCompletionItems(doc2, pos2, mockContext, mockToken) + + // The second request should NOT have triggered a new FIM call — + // it should reuse the leading-edge pending request since the prefix + // extends and the suffix is unchanged + expect(callCount).toBe(1) + + // Now resolve the FIM response + resolvers[0]() + await vi.advanceTimersByTimeAsync(500) + + await promise1 + await promise2 + + // Only one FIM request should have been made total + expect(callCount).toBe(1) + }) + it("should NOT reuse pending request when suffix changes", async () => { // Mock the model to track call count let callCount = 0 diff --git a/packages/kilo-vscode/src/services/cli-backend/connection-service.ts b/packages/kilo-vscode/src/services/cli-backend/connection-service.ts index 929aa1cbf9a..a4e4a089ddb 100644 --- a/packages/kilo-vscode/src/services/cli-backend/connection-service.ts +++ b/packages/kilo-vscode/src/services/cli-backend/connection-service.ts @@ -12,6 +12,9 @@ type SSEEventFilter = (event: Event) => boolean type NotificationDismissListener = (notificationId: string) => void type LanguageChangeListener = (locale: string) => void type ProfileChangeListener = (data: unknown) => void +type MigrationCompleteListener = () => void +type ClearPendingPromptsListener = () => void +type DirectoryProvider = () => string[] // Poll /global/health at the same interval as packages/app/src/context/server.tsx. // This provides a second detection channel for server death independent of the SSE heartbeat. @@ -36,6 +39,9 @@ export class KiloConnectionService { private readonly notificationDismissListeners: Set = new Set() private readonly languageChangeListeners: Set = new Set() private readonly profileChangeListeners: Set = new Set() + private readonly migrationCompleteListeners: Set = new Set() + private readonly clearPendingPromptsListeners: Set = new Set() + private readonly directoryProviders: Set = new Set() /** * Shared mapping used to resolve session scope for events that don't reliably include a sessionID. @@ -207,6 +213,107 @@ export class KiloConnectionService { } } + /** + * Subscribe to migration-complete events broadcast from any KiloProvider. Returns unsubscribe function. + */ + onMigrationComplete(listener: MigrationCompleteListener): () => void { + this.migrationCompleteListeners.add(listener) + return () => { + this.migrationCompleteListeners.delete(listener) + } + } + + /** + * Broadcast a migration-complete event to all subscribed KiloProvider instances. + */ + notifyMigrationComplete(): void { + for (const listener of this.migrationCompleteListeners) { + listener() + } + } + + /** + * Subscribe to clear-pending-prompts broadcast. Returns unsubscribe function. + * Fired after a config save drains all pending permissions/questions so each + * webview can clear stale prompt UI. + */ + onClearPendingPrompts(listener: ClearPendingPromptsListener): () => void { + this.clearPendingPromptsListeners.add(listener) + return () => { + this.clearPendingPromptsListeners.delete(listener) + } + } + + /** + * Register a callback that returns workspace directories tracked by a + * KiloProvider (root + worktree dirs). Used by drainPendingPrompts() to + * cover all active Instance directories across every provider. + */ + registerDirectoryProvider(provider: DirectoryProvider): () => void { + this.directoryProviders.add(provider) + return () => { + this.directoryProviders.delete(provider) + } + } + + /** + * Reject all pending permission requests and questions across every + * directory known to any KiloProvider **and** every project the CLI + * backend has ever opened. The project list covers worktree sessions + * whose provider was disposed (panel/sidebar closed) while the CLI + * backend kept running. + * + * Must be called before operations that trigger Instance.disposeAll() + * (e.g. config save) to prevent orphaned Promises from freezing + * sessions. + * + * Throws if any list/reject call fails so callers can abort the + * destructive operation. + */ + async drainPendingPrompts(): Promise { + if (!this.client) return + + // Collect directories from all mounted providers (root + worktree dirs). + const dirs = new Set() + for (const provider of this.directoryProviders) { + for (const dir of provider()) { + dirs.add(dir) + } + } + + // Also include every project directory the CLI backend knows about. + // This covers worktree sessions whose KiloProvider was already disposed. + const { data: projects, error: projectsErr } = await this.client.project.list() + if (projectsErr) throw new Error(`Failed to list projects: ${String(projectsErr)}`) + if (projects) { + for (const p of projects) { + dirs.add(p.worktree) + } + } + + for (const dir of dirs) { + const { data: perms, error: permsErr } = await this.client.permission.list({ directory: dir }) + if (permsErr) throw new Error(`Failed to list permissions for ${dir}: ${String(permsErr)}`) + if (perms) { + for (const perm of perms) { + const { error } = await this.client.permission.reply({ requestID: perm.id, reply: "reject", directory: dir }) + if (error) throw new Error(`Failed to reject permission ${perm.id}: ${String(error)}`) + } + } + const { data: qs, error: qsErr } = await this.client.question.list({ directory: dir }) + if (qsErr) throw new Error(`Failed to list questions for ${dir}: ${String(qsErr)}`) + if (qs) { + for (const q of qs) { + const { error } = await this.client.question.reject({ requestID: q.id, directory: dir }) + if (error) throw new Error(`Failed to reject question ${q.id}: ${String(error)}`) + } + } + } + for (const listener of this.clearPendingPromptsListeners) { + listener() + } + } + /** * Subscribe to connection state changes. Returns unsubscribe function. */ @@ -228,6 +335,9 @@ export class KiloConnectionService { this.stateListeners.clear() this.notificationDismissListeners.clear() this.profileChangeListeners.clear() + this.migrationCompleteListeners.clear() + this.clearPendingPromptsListeners.clear() + this.directoryProviders.clear() this.messageSessionIdsByMessageId.clear() this.client = null this.sseClient = null @@ -260,7 +370,7 @@ export class KiloConnectionService { const healthy = await this.checkHealth(baseUrl, password) if (!healthy && this.state === "connected") { console.warn("[Kilo New] ConnectionService: ❤️‍🩹 Health check failed — forcing SSE reconnect") - this.sseClient?.disconnect() + this.sseClient?.reconnect() } }, HEALTH_POLL_INTERVAL_MS) diff --git a/packages/kilo-vscode/src/services/cli-backend/i18n/index.ts b/packages/kilo-vscode/src/services/cli-backend/i18n/index.ts index 88163caafbc..494688559ec 100644 --- a/packages/kilo-vscode/src/services/cli-backend/i18n/index.ts +++ b/packages/kilo-vscode/src/services/cli-backend/i18n/index.ts @@ -15,6 +15,7 @@ import { dict as ru } from "./ru" import { dict as th } from "./th" import { dict as zh } from "./zh" import { dict as tr } from "./tr" +import { dict as uk } from "./uk" import { dict as zht } from "./zht" import { type dict as enDict } from "./en" @@ -35,13 +36,19 @@ const bundles: Record> = { ru, th, tr, + uk, zh, zht, } function resolveLocale(lang: string): string { const lower = lang.toLowerCase() - if (lower.startsWith("zh")) return lower.includes("hant") ? "zht" : "zh" + if (lower.startsWith("zh")) { + if (lower === "zht") return "zht" + const traditional = + lower.includes("hant") || lower.includes("-tw") || lower.includes("-hk") || lower.includes("-mo") + return traditional ? "zht" : "zh" + } if (lower.startsWith("nb") || lower.startsWith("nn")) return "no" if (lower.startsWith("pt")) return "br" for (const key of Object.keys(bundles)) { diff --git a/packages/kilo-vscode/src/services/cli-backend/i18n/uk.ts b/packages/kilo-vscode/src/services/cli-backend/i18n/uk.ts new file mode 100644 index 00000000000..fe0c703d0e7 --- /dev/null +++ b/packages/kilo-vscode/src/services/cli-backend/i18n/uk.ts @@ -0,0 +1,4 @@ +export const dict = { + "server.processExited": "Процес CLI завершився з кодом {{code}} до запуску сервера", + "server.startupTimeout": "Час очікування запуску сервера вичерпано після {{seconds}} секунд", +} as const diff --git a/packages/kilo-vscode/src/services/cli-backend/sdk-sse-adapter.ts b/packages/kilo-vscode/src/services/cli-backend/sdk-sse-adapter.ts index 967b86fa5c5..0021e4e7a9a 100644 --- a/packages/kilo-vscode/src/services/cli-backend/sdk-sse-adapter.ts +++ b/packages/kilo-vscode/src/services/cli-backend/sdk-sse-adapter.ts @@ -32,6 +32,7 @@ export class SdkSSEAdapter { private readonly stateHandlers = new Set() private abortController: AbortController | null = null + private attemptController: AbortController | null = null private heartbeatTimer: ReturnType | null = null // 15s matches packages/app/src/context/global-sdk.tsx — server sends heartbeats @@ -71,9 +72,24 @@ export class SdkSSEAdapter { console.log("[Kilo New] SSE: 🔌 disconnect() called") this.abortController?.abort() this.abortController = null + this.attemptController = null this.clearHeartbeat() } + /** + * Force the current SSE attempt to reconnect without killing the outer loop. + * Aborts only the per-attempt controller so `consumeLoop` re-enters its + * reconnection path instead of terminating permanently. + */ + reconnect(): void { + if (!this.attemptController) { + console.log("[Kilo New] SSE: ⚠️ reconnect() called but no active attempt") + return + } + console.log("[Kilo New] SSE: 🔄 reconnect() — aborting current attempt") + this.attemptController.abort() + } + /** * Disconnect and clear all registered handlers. */ @@ -121,14 +137,26 @@ export class SdkSSEAdapter { const onAbort = () => attempt.abort() signal.addEventListener("abort", onAbort) + this.attemptController = attempt + try { console.log("[Kilo New] SSE: 🎬 Calling SDK global.event()...") const events = await this.client.global.event({ signal: attempt.signal, + // Disable SDK-internal retries — consumeLoop handles reconnection + // with its own outer while-loop. Without this the SDK's infinite + // retry loop with exponential backoff runs in parallel, causing + // duplicate connections and "error" state flicker. + sseMaxRetryAttempts: 1, onSseError: (error) => { if (signal.aborted) { return } + // Filter AbortErrors — they are expected during heartbeat timeout + // or manual reconnect() calls, not real connection failures. + if (error instanceof DOMException && error.name === "AbortError") { + return + } console.error("[Kilo New] SSE: ❌ SDK SSE error callback:", error) this.notifyError(error instanceof Error ? error : new Error(String(error))) }, @@ -153,12 +181,16 @@ export class SdkSSEAdapter { console.log("[Kilo New] SSE: 📭 Stream ended normally") } catch (error) { - if (!signal.aborted) { + // Suppress AbortErrors — they are expected when the heartbeat timer + // or reconnect() aborts the per-attempt controller. + const aborted = signal.aborted || (error instanceof DOMException && error.name === "AbortError") + if (!aborted) { console.error("[Kilo New] SSE: ❌ Stream error:", error) this.notifyError(error instanceof Error ? error : new Error(String(error))) } } finally { signal.removeEventListener("abort", onAbort) + this.attemptController = null this.clearHeartbeat() } diff --git a/packages/kilo-vscode/src/session-status.ts b/packages/kilo-vscode/src/session-status.ts index 6e086f15197..e596603e704 100644 --- a/packages/kilo-vscode/src/session-status.ts +++ b/packages/kilo-vscode/src/session-status.ts @@ -16,17 +16,26 @@ export function getBusySessionCount(map: Map): nu * Fetch all current session statuses and seed the provided map + webview. * Called on connect so the Settings panel knows about already-running sessions * without waiting for the next session.status SSE event. + * + * When `reconcile` is true (default: first seed), locally-busy sessions absent + * from the server response are reset to idle — covering server crash/restart. + * On SSE reconnects set `reconcile: false` to avoid a race where the HTTP + * fetch briefly returns stale data and the spinner disappears mid-stream. */ export async function seedSessionStatuses( client: KiloClient, dir: string, map: Map, post: (msg: unknown) => void, + reconcile = true, ): Promise { try { const result = await client.session.status({ directory: dir }) if (!result.data) return - for (const [sid, info] of Object.entries(result.data) as [string, SessionStatus][]) { + const active = result.data + + // Seed/update entries the server knows about + for (const [sid, info] of Object.entries(active) as [string, SessionStatus][]) { map.set(sid, info.type) post({ type: "sessionStatus", @@ -35,6 +44,19 @@ export async function seedSessionStatuses( ...(info.type === "retry" ? { attempt: info.attempt, message: info.message, next: info.next } : {}), }) } + + // Reconcile: any locally non-idle session absent from the server response + // means the server lost its in-memory state (crash/restart). Reset to idle. + // Skipped on SSE reconnects — the real-time SSE events are authoritative + // for status transitions and the brief HTTP fetch can race with them. + if (reconcile) { + for (const [sid, status] of map) { + if (status !== "idle" && !active[sid]) { + map.set(sid, "idle") + post({ type: "sessionStatus", sessionID: sid, status: "idle" }) + } + } + } } catch (error) { console.error("[Kilo New] KiloProvider: Failed to seed session statuses:", error) } diff --git a/packages/kilo-vscode/src/shared/fetch-models.ts b/packages/kilo-vscode/src/shared/fetch-models.ts new file mode 100644 index 00000000000..c8ae62260e9 --- /dev/null +++ b/packages/kilo-vscode/src/shared/fetch-models.ts @@ -0,0 +1,66 @@ +/** + * Fetch available models from an OpenAI-compatible /models endpoint. + * Runs in the extension host — no CLI backend dependency. + */ + +type Options = { + baseURL: string + apiKey?: string + headers?: Record +} + +type ModelEntry = { + id: string + name: string +} + +export class FetchModelsError extends Error { + constructor( + message: string, + public readonly status?: number, + ) { + super(message) + this.name = "FetchModelsError" + } + + get auth() { + return this.status === 401 || this.status === 403 + } +} + +export async function fetchOpenAIModels(opts: Options): Promise { + const url = opts.baseURL.replace(/\/+$/, "") + "/models" + const headers: Record = { + "Content-Type": "application/json", + ...opts.headers, + } + if (opts.apiKey) { + headers["Authorization"] = `Bearer ${opts.apiKey}` + } + + const response = await fetch(url, { + method: "GET", + headers, + signal: AbortSignal.timeout(15_000), + }) + + if (!response.ok) { + const text = await response.text().catch(() => "") + throw new FetchModelsError(`HTTP ${response.status}: ${text.slice(0, 200)}`, response.status) + } + + const body = (await response.json()) as { data?: Array<{ id?: string; name?: string }> } + const items = body?.data + if (!Array.isArray(items)) return [] + + const seen = new Set() + const result: ModelEntry[] = [] + for (const item of items) { + const id = typeof item.id === "string" ? item.id.trim() : "" + if (!id || seen.has(id)) continue + seen.add(id) + result.push({ id, name: typeof item.name === "string" ? item.name.trim() : id }) + } + result.sort((a, b) => a.id.localeCompare(b.id)) + return result +} diff --git a/packages/kilo-vscode/tests/unit/config-utils.test.ts b/packages/kilo-vscode/tests/unit/config-utils.test.ts new file mode 100644 index 00000000000..c8974427c11 --- /dev/null +++ b/packages/kilo-vscode/tests/unit/config-utils.test.ts @@ -0,0 +1,158 @@ +import { describe, it, expect } from "bun:test" +import { deepMerge, stripNulls, ConfigState } from "../../webview-ui/src/utils/config-utils" +import type { Config } from "../../webview-ui/src/types/messages" + +// --------------------------------------------------------------------------- +// Pure helpers +// --------------------------------------------------------------------------- + +describe("deepMerge", () => { + it("overrides scalar values", () => { + const target: Config = { snapshot: true } + const source: Partial = { snapshot: false } + expect(deepMerge(target, source)).toEqual({ snapshot: false }) + }) + + it("merges nested objects recursively", () => { + const target: Config = { agent: { code: { temperature: 0.5 } } } + const source: Partial = { agent: { code: { steps: 10 } } } + const result = deepMerge(target, source) + expect(result.agent?.code?.temperature).toBe(0.5) + expect(result.agent?.code?.steps).toBe(10) + }) + + it("preserves keys not present in source", () => { + const target: Config = { snapshot: true, username: "alice" } + const source: Partial = { snapshot: false } + expect(deepMerge(target, source)).toEqual({ snapshot: false, username: "alice" }) + }) + + it("replaces arrays instead of merging them", () => { + const target: Config = { instructions: ["a", "b"] } + const source: Partial = { instructions: ["c"] } + expect(deepMerge(target, source)).toEqual({ instructions: ["c"] }) + }) +}) + +describe("stripNulls", () => { + it("removes null values", () => { + const cfg = { snapshot: true, username: null } as unknown as Config + expect(stripNulls(cfg)).toEqual({ snapshot: true }) + }) + + it("removes undefined values", () => { + const cfg = { snapshot: true, username: undefined } as unknown as Config + expect(stripNulls(cfg)).toEqual({ snapshot: true }) + }) + + it("strips nulls recursively in nested objects", () => { + const cfg = { agent: { code: { temperature: 0.5, prompt: null } } } as unknown as Config + expect(stripNulls(cfg)).toEqual({ agent: { code: { temperature: 0.5 } } }) + }) +}) + +// --------------------------------------------------------------------------- +// Config state machine — reproduces the actual message-handler flow +// --------------------------------------------------------------------------- + +describe("ConfigState", () => { + it("configLoaded sets config when no draft is pending", () => { + const s = new ConfigState() + s.handleConfigLoaded({ snapshot: true, username: "alice" }) + expect(s.config).toEqual({ snapshot: true, username: "alice" }) + expect(s.loading).toBe(false) + }) + + describe("configLoaded while draft is pending (the reported bug)", () => { + it("preserves the user's pending toggle change", () => { + const s = new ConfigState() + + // 1. Server sends initial config + s.handleConfigLoaded({ snapshot: true, username: "alice" }) + expect(s.config.snapshot).toBe(true) + + // 2. User toggles snapshot off (but hasn't saved yet) + s.updateConfig({ snapshot: false }) + expect(s.config.snapshot).toBe(false) + expect(s.dirty).toBe(true) + + // 3. A configLoaded push arrives from the extension (e.g. SSE event, + // tab switch, or another webview triggers a config reload). + // The server still has snapshot: true. + s.handleConfigLoaded({ snapshot: true, username: "alice" }) + + // BUG (old code): config.snapshot would be reset to true here + // FIX: the draft is re-applied, so the user's toggle stays false + expect(s.config.snapshot).toBe(false) + expect(s.config.username).toBe("alice") + expect(s.dirty).toBe(true) + }) + + it("preserves nested draft changes across configLoaded pushes", () => { + const s = new ConfigState() + s.handleConfigLoaded({ agent: { code: { temperature: 0.7 } } }) + s.updateConfig({ agent: { code: { steps: 5 } } }) + + // Server pushes a reload — temperature may have changed server-side + s.handleConfigLoaded({ agent: { code: { temperature: 0.9 } } }) + + expect(s.config.agent?.code?.steps).toBe(5) + expect(s.config.agent?.code?.temperature).toBe(0.9) + }) + }) + + describe("configUpdated while draft is pending", () => { + it("preserves draft when update comes from another source", () => { + const s = new ConfigState() + s.handleConfigLoaded({ snapshot: true, username: "alice" }) + s.updateConfig({ snapshot: false }) + + // Another webview (e.g. PermissionDock) saves a different setting + s.handleConfigUpdated({ snapshot: true, username: "bob" }) + + expect(s.config.snapshot).toBe(false) // draft preserved + expect(s.config.username).toBe("bob") // server update applied + }) + + it("clears draft when update confirms our save", () => { + const s = new ConfigState() + s.handleConfigLoaded({ snapshot: true }) + s.updateConfig({ snapshot: false }) + s.saveConfig() + expect(s.saving).toBe(true) + + // Server confirms the write + s.handleConfigUpdated({ snapshot: false }) + + expect(s.config.snapshot).toBe(false) + expect(s.dirty).toBe(false) + expect(s.saving).toBe(false) + expect(Object.keys(s.draft).length).toBe(0) + }) + }) + + it("configLoaded is ignored while save is in-flight", () => { + const s = new ConfigState() + s.handleConfigLoaded({ snapshot: true }) + s.updateConfig({ snapshot: false }) + s.saveConfig() + + // A stale configLoaded arrives during the write round-trip + s.handleConfigLoaded({ snapshot: true }) + + // Config must not revert — the save is still in flight + expect(s.config.snapshot).toBe(false) + }) + + it("discardConfig restores server state", () => { + const s = new ConfigState() + s.handleConfigLoaded({ snapshot: true, username: "alice" }) + s.updateConfig({ snapshot: false }) + expect(s.dirty).toBe(true) + + s.discardConfig() + + expect(s.config.snapshot).toBe(true) + expect(s.dirty).toBe(false) + }) +}) diff --git a/packages/kilo-vscode/tests/unit/extension-arch.test.ts b/packages/kilo-vscode/tests/unit/extension-arch.test.ts index 8a935d450d2..233f844bdb3 100644 --- a/packages/kilo-vscode/tests/unit/extension-arch.test.ts +++ b/packages/kilo-vscode/tests/unit/extension-arch.test.ts @@ -14,6 +14,8 @@ import path from "node:path" const ROOT = path.resolve(import.meta.dir, "../..") const PKG_JSON_FILE = path.join(ROOT, "package.json") const SRC_DIR = path.join(ROOT, "src") +const EXTENSION_FILE = path.join(ROOT, "src/extension.ts") +const KILO_PROVIDER_FILE = path.join(ROOT, "src/KiloProvider.ts") function readSrcFiles(dir: string): string { const parts: string[] = [] @@ -84,3 +86,100 @@ describe("Extension — package.json command sync", () => { ).toEqual([]) }) }) + +// --------------------------------------------------------------------------- +// KiloProvider handler wiring — every new KiloProvider() must get +// setContinueInWorktreeHandler() called before resolving its webview. +// +// Regression: tab panels created via openKiloInNewTab() and the TabPanel +// deserializer were missing the handler, causing "Capturing changes..." to +// spin forever because the webview message was silently dropped. +// --------------------------------------------------------------------------- + +describe("Extension — KiloProvider handler wiring", () => { + const ext = fs.readFileSync(EXTENSION_FILE, "utf-8") + + /** + * Every `new KiloProvider(` in extension.ts must be followed (before the + * next `new KiloProvider(`) by a `setContinueInWorktreeHandler` call. + * This prevents future tab/panel additions from silently missing the handler. + */ + it("every KiloProvider instance gets setContinueInWorktreeHandler wired", () => { + const pattern = /new KiloProvider\(/g + const instances: number[] = [] + let match + while ((match = pattern.exec(ext)) !== null) { + instances.push(match.index) + } + + expect( + instances.length, + "expected at least 3 KiloProvider instances (sidebar, tab, deserializer)", + ).toBeGreaterThanOrEqual(3) + + const missing: string[] = [] + for (let i = 0; i < instances.length; i++) { + const start = instances[i] + const end = instances[i + 1] ?? ext.length + const region = ext.slice(start, end) + + if (!region.includes("setContinueInWorktreeHandler")) { + const line = ext.slice(0, start).split("\n").length + missing.push(`KiloProvider at line ${line}`) + } + } + + expect( + missing, + `These KiloProvider instances are missing setContinueInWorktreeHandler.\n` + + `Without it, "Continue in Worktree" silently no-ops and the spinner\n` + + `stays stuck on "Capturing changes..." forever.\n\n` + + missing.map((m) => ` - ${m}`).join("\n"), + ).toEqual([]) + }) + + it("openKiloInNewTab wires setContinueInWorktreeHandler before resolveWebviewPanel", () => { + const fn = ext.indexOf("function openKiloInNewTab") + expect(fn, "openKiloInNewTab must exist").toBeGreaterThan(-1) + const body = ext.slice(fn, fn + 1500) + const handler = body.indexOf("setContinueInWorktreeHandler") + const resolve = body.indexOf("resolveWebviewPanel") + expect(handler, "setContinueInWorktreeHandler must be called").toBeGreaterThan(-1) + expect(resolve, "resolveWebviewPanel must be called").toBeGreaterThan(-1) + expect(handler, "handler must be wired before resolving the panel").toBeLessThan(resolve) + }) + + it("TabPanel deserializer wires setContinueInWorktreeHandler before resolveWebviewPanel", () => { + const serializer = ext.indexOf('"kilo-code.new.TabPanel"') + expect(serializer, "TabPanel serializer must exist").toBeGreaterThan(-1) + const body = ext.slice(serializer, serializer + 800) + const handler = body.indexOf("setContinueInWorktreeHandler") + const resolve = body.indexOf("resolveWebviewPanel") + expect(handler, "setContinueInWorktreeHandler must be called in deserializer").toBeGreaterThan(-1) + expect(resolve, "resolveWebviewPanel must be called in deserializer").toBeGreaterThan(-1) + expect(handler, "handler must be wired before resolving the panel").toBeLessThan(resolve) + }) +}) + +// --------------------------------------------------------------------------- +// KiloProvider — continueInWorktree error fallback +// +// Regression: when continueInWorktreeHandler is null, the message handler +// must send an error back to the webview so the spinner resets. Previously +// it silently no-op'd, leaving the UI stuck. +// --------------------------------------------------------------------------- + +describe("KiloProvider — continueInWorktree error fallback", () => { + const provider = fs.readFileSync(KILO_PROVIDER_FILE, "utf-8") + + it("sends error progress when handler is missing", () => { + const caseStart = provider.indexOf('case "continueInWorktree"') + expect(caseStart, "continueInWorktree case must exist").toBeGreaterThan(-1) + const caseEnd = provider.indexOf("break", caseStart) + const block = provider.slice(caseStart, caseEnd) + + expect(block, "must have else branch for missing handler").toContain("else if") + expect(block, "must send error status back to webview").toContain('"error"') + expect(block, "must use continueInWorktreeProgress message type").toContain("continueInWorktreeProgress") + }) +}) diff --git a/packages/kilo-vscode/tests/unit/file-tree.test.ts b/packages/kilo-vscode/tests/unit/file-tree.test.ts index b997f86cfd4..a54908dab20 100644 --- a/packages/kilo-vscode/tests/unit/file-tree.test.ts +++ b/packages/kilo-vscode/tests/unit/file-tree.test.ts @@ -1,5 +1,11 @@ import { describe, it, expect } from "bun:test" -import { buildFileTree, flatten, flattenChain, type FileTreeNode } from "../../webview-ui/agent-manager/file-tree-utils" +import { + buildFileTree, + flatten, + flattenChain, + treeOrder, + type FileTreeNode, +} from "../../webview-ui/agent-manager/file-tree-utils" import type { WorktreeFileDiff } from "../../webview-ui/src/types/messages" function diff(file: string, status?: "added" | "deleted" | "modified"): WorktreeFileDiff { @@ -13,13 +19,13 @@ describe("buildFileTree", () => { expect(buildFileTree([])).toEqual([]) }) - it("places root-level files at the top", () => { + it("sorts root-level files alphabetically", () => { const tree = buildFileTree([diff("README.md"), diff("package.json")]) expect(tree).toHaveLength(2) - expect(tree[0]!.name).toBe("README.md") - expect(tree[0]!.path).toBe("README.md") + expect(tree[0]!.name).toBe("package.json") + expect(tree[0]!.path).toBe("package.json") expect(tree[0]!.children).toBeUndefined() - expect(tree[1]!.name).toBe("package.json") + expect(tree[1]!.name).toBe("README.md") }) it("groups files under shared directories", () => { @@ -66,15 +72,15 @@ describe("buildFileTree", () => { expect(tree[0]!.children![0]!.children![0]!.children![0]!.children![0]!.name).toBe("e.ts") }) - it("mixes root-level files with directory files", () => { + it("sorts directories before files at each level", () => { const tree = buildFileTree([diff("README.md"), diff("src/index.ts"), diff("test/index.test.ts")]) - expect(tree).toHaveLength(3) // README.md, src/, test/ - expect(tree[0]!.name).toBe("README.md") - expect(tree[0]!.children).toBeUndefined() - expect(tree[1]!.name).toBe("src") + expect(tree).toHaveLength(3) // src/, test/, README.md + expect(tree[0]!.name).toBe("src") + expect(tree[0]!.children).toHaveLength(1) + expect(tree[1]!.name).toBe("test") expect(tree[1]!.children).toHaveLength(1) - expect(tree[2]!.name).toBe("test") - expect(tree[2]!.children).toHaveLength(1) + expect(tree[2]!.name).toBe("README.md") + expect(tree[2]!.children).toBeUndefined() }) it("attaches diff data to leaf nodes", () => { @@ -89,6 +95,17 @@ describe("buildFileTree", () => { expect(tree[0]!.diff).toBeUndefined() }) + it("sorts directories before files within each level", () => { + const tree = buildFileTree([diff("src/a.ts"), diff("src/b/c.ts")]) + const src = tree[0]! + expect(src.children).toHaveLength(2) + // Directory before file + expect(src.children![0]!.name).toBe("b") + expect(src.children![0]!.children).toBeDefined() + expect(src.children![1]!.name).toBe("a.ts") + expect(src.children![1]!.children).toBeUndefined() + }) + it("separates diverging paths with common prefix", () => { const tree = buildFileTree([diff("src/a.ts"), diff("src/b/c.ts")]) const src = tree[0]! @@ -310,3 +327,82 @@ describe("flatten", () => { expect(result[0]!.children![0]!.name).toBe("index.ts") }) }) + +// ── treeOrder ────────────────────────────────────────────────────────────── + +describe("treeOrder", () => { + it("returns empty array for empty input", () => { + expect(treeOrder([])).toEqual([]) + }) + + it("returns single-element array unchanged", () => { + const input = [diff("a.ts")] + expect(treeOrder(input)).toEqual(input) + }) + + it("groups files by directory", () => { + // Git lexicographic order interleaves directories: a/x, b/y, a/z + // but buildFileTree groups by directory: a/{x,z}, b/{y} + const input = [diff("a/x.ts"), diff("b/y.ts"), diff("a/z.ts")] + const result = treeOrder(input) + expect(result.map((d) => d.file)).toEqual(["a/x.ts", "a/z.ts", "b/y.ts"]) + }) + + it("groups untracked files with their directory siblings", () => { + // The actual bug: backend appends untracked/new files AFTER all tracked + // files. settings-io.ts (untracked, added) ends up after all the tracked + // i18n modifications, but should appear with its directory siblings. + const input = [ + diff("src/components/settings/about.ts"), // tracked modification + diff("src/i18n/ar.ts"), // tracked modification + diff("src/i18n/de.ts"), // tracked modification + diff("src/i18n/en.ts"), // tracked modification + diff("src/components/settings/settings-io.ts"), // untracked, appended last + diff("tests/unit/settings-io.test.ts"), // untracked, appended last + ] + const result = treeOrder(input) + // Tree groups by directory: components/settings/ together, i18n/ together + // Directories sorted alphabetically: components/ before i18n/ before tests/ + expect(result.map((d) => d.file)).toEqual([ + "src/components/settings/about.ts", + "src/components/settings/settings-io.ts", // now grouped with about.ts! + "src/i18n/ar.ts", + "src/i18n/de.ts", + "src/i18n/en.ts", + "tests/unit/settings-io.test.ts", + ]) + }) + + it("reorders when git path sort diverges from tree grouping", () => { + // Files from the same directory are scattered in the input (e.g. because + // untracked files are appended after tracked files) + const input = [ + diff("pkg/tests/a.test.ts"), + diff("pkg/webview/src/components/x.ts"), + diff("pkg/webview/src/i18n/ar.ts"), + diff("pkg/webview/src/i18n/de.ts"), + diff("pkg/tests/b.test.ts"), + ] + const result = treeOrder(input) + // Tree groups and sorts: tests/{a,b}, webview/src/{components/x, i18n/{ar,de}} + expect(result.map((d) => d.file)).toEqual([ + "pkg/tests/a.test.ts", + "pkg/tests/b.test.ts", + "pkg/webview/src/components/x.ts", + "pkg/webview/src/i18n/ar.ts", + "pkg/webview/src/i18n/de.ts", + ]) + }) + + it("sorts root-level files alphabetically", () => { + const input = [diff("README.md"), diff("package.json"), diff("tsconfig.json")] + const result = treeOrder(input) + expect(result.map((d) => d.file)).toEqual(["package.json", "README.md", "tsconfig.json"]) + }) + + it("puts directories before files at each level", () => { + const input = [diff("README.md"), diff("src/a.ts"), diff("src/b.ts"), diff("tsconfig.json")] + const result = treeOrder(input) + expect(result.map((d) => d.file)).toEqual(["src/a.ts", "src/b.ts", "README.md", "tsconfig.json"]) + }) +}) diff --git a/packages/kilo-vscode/tests/unit/followup-session.test.ts b/packages/kilo-vscode/tests/unit/followup-session.test.ts new file mode 100644 index 00000000000..bca8e448c13 --- /dev/null +++ b/packages/kilo-vscode/tests/unit/followup-session.test.ts @@ -0,0 +1,38 @@ +import { describe, expect, it } from "bun:test" +import { matchFollowup, recordFollowup } from "../../src/kilo-provider/followup-session" + +describe("followup-session", () => { + it("records a pending follow-up for Start new session replies", () => { + const pending = recordFollowup({ + answers: [["Start new session"]], + dir: "/repo", + now: 1, + }) + + expect(pending).toEqual({ + dir: "/repo", + time: 1, + }) + }) + + it("ignores other question replies", () => { + const pending = recordFollowup({ + answers: [["Continue here"]], + dir: "/repo", + now: 1, + }) + + expect(pending).toBeUndefined() + }) + + it("matches pending follow-ups by normalized directory before expiry", () => { + const pending = { + dir: "c:/repo/.kilo/worktrees/feature", + time: 1, + } + + expect(matchFollowup({ pending, dir: "C:\\repo\\.kilo\\worktrees\\feature\\", now: 2 })).toBe(true) + expect(matchFollowup({ pending, dir: "c:/repo/.kilo/worktrees/other", now: 2 })).toBe(false) + expect(matchFollowup({ pending, dir: "c:/repo/.kilo/worktrees/feature", now: 30_002 })).toBe(false) + }) +}) diff --git a/packages/kilo-vscode/tests/unit/kilo-provider-followup.test.ts b/packages/kilo-vscode/tests/unit/kilo-provider-followup.test.ts new file mode 100644 index 00000000000..cab3ed6de02 --- /dev/null +++ b/packages/kilo-vscode/tests/unit/kilo-provider-followup.test.ts @@ -0,0 +1,129 @@ +import { describe, expect, it } from "bun:test" +import type { Event, Session } from "@kilocode/sdk/v2/client" + +// vscode mock is provided by the shared preload (tests/setup/vscode-mock.ts) +const { KiloProvider } = await import("../../src/KiloProvider") + +type Internals = { + webview: { postMessage: (message: unknown) => Promise } | null + trackedSessionIds: Set + currentSession: Session | null + pendingFollowup: { dir: string; time: number } | null + handleLoadMessages: (sessionID: string) => Promise + initializeConnection: () => Promise + syncWebviewState: () => Promise + flushPendingSessionRefresh: () => Promise + fetchAndSendProviders: () => Promise + fetchAndSendAgents: () => Promise + fetchAndSendSkills: () => Promise + fetchAndSendCommands: () => Promise + fetchAndSendConfig: () => Promise + fetchAndSendNotifications: () => Promise + seedSessionStatusMap: () => Promise + sendNotificationSettings: () => void + startStatsPolling: () => void +} + +function created(input: { id: string; directory: string }): Event { + return { + type: "session.created", + properties: { + info: { + id: input.id, + slug: `${input.id}-slug`, + projectID: "project-1", + directory: input.directory, + title: "Session", + version: "1", + time: { created: 1, updated: 1 }, + }, + }, + } as Event +} + +function connection() { + let filter: ((event: Event) => boolean) | undefined + let listener: ((event: Event) => void) | undefined + + return { + emit(event: Event) { + if (!filter || !listener) throw new Error("expected SSE subscription") + if (!filter(event)) return + listener(event) + }, + connect: async () => {}, + getClient: () => ({}) as never, + onEventFiltered: (next: (event: Event) => boolean, cb: (event: Event) => void) => { + filter = next + listener = cb + return () => undefined + }, + onStateChange: () => () => undefined, + onNotificationDismissed: () => () => undefined, + onLanguageChanged: () => () => undefined, + onProfileChanged: () => () => undefined, + onMigrationComplete: () => () => undefined, + getServerInfo: () => ({ port: 12345 }), + getConnectionState: () => "connected" as const, + resolveEventSessionId: (event: Event) => (event.type === "session.created" ? event.properties.info.id : undefined), + recordMessageSessionId: () => undefined, + notifyNotificationDismissed: () => undefined, + } +} + +describe("KiloProvider follow-up sessions", () => { + it("adopts pending follow-up sessions for single-session views", async () => { + const service = connection() + const provider = new KiloProvider({} as never, service as never) + const internal = provider as unknown as Internals + const sent: unknown[] = [] + const loaded: string[] = [] + + internal.webview = { + postMessage: async (message: unknown) => { + sent.push(message) + return true + }, + } + internal.syncWebviewState = async () => {} + internal.flushPendingSessionRefresh = async () => {} + internal.fetchAndSendProviders = async () => {} + internal.fetchAndSendAgents = async () => {} + internal.fetchAndSendSkills = async () => {} + internal.fetchAndSendCommands = async () => {} + internal.fetchAndSendConfig = async () => {} + internal.fetchAndSendNotifications = async () => {} + internal.seedSessionStatusMap = async () => {} + internal.sendNotificationSettings = () => {} + internal.startStatsPolling = () => {} + + await internal.initializeConnection() + sent.length = 0 + + internal.pendingFollowup = { dir: "/repo", time: Date.now() } + internal.handleLoadMessages = async (sessionID: string) => { + loaded.push(sessionID) + } + + service.emit(created({ id: "ses-followup", directory: "/repo" })) + await Promise.resolve() + + expect(internal.currentSession?.id).toBe("ses-followup") + expect(internal.trackedSessionIds.has("ses-followup")).toBe(true) + expect(loaded).toEqual(["ses-followup"]) + expect(sent).toEqual([ + { + type: "sessionCreated", + session: { + id: "ses-followup", + title: "Session", + createdAt: new Date(1).toISOString(), + updatedAt: new Date(1).toISOString(), + parentID: null, + revert: null, + summary: null, + }, + }, + ]) + }) +}) diff --git a/packages/kilo-vscode/tests/unit/kilo-provider-session-refresh.test.ts b/packages/kilo-vscode/tests/unit/kilo-provider-session-refresh.test.ts index 4f0e44c986a..d201bbf9816 100644 --- a/packages/kilo-vscode/tests/unit/kilo-provider-session-refresh.test.ts +++ b/packages/kilo-vscode/tests/unit/kilo-provider-session-refresh.test.ts @@ -80,6 +80,9 @@ function createConnection(client: ReturnType) { onNotificationDismissed: () => () => undefined, onLanguageChanged: () => () => undefined, onProfileChanged: () => () => undefined, + onMigrationComplete: () => () => undefined, + onClearPendingPrompts: () => () => undefined, + registerDirectoryProvider: () => () => undefined, getServerInfo: () => ({ port: 12345 }), getConnectionState: () => "connected" as const, resolveEventSessionId: () => undefined, diff --git a/packages/kilo-vscode/tests/unit/language-utils.test.ts b/packages/kilo-vscode/tests/unit/language-utils.test.ts index 75ad9bd5f8c..cc1a8c286bd 100644 --- a/packages/kilo-vscode/tests/unit/language-utils.test.ts +++ b/packages/kilo-vscode/tests/unit/language-utils.test.ts @@ -15,8 +15,11 @@ describe("normalizeLocale", () => { }) it("returns 'zht' for Traditional Chinese", () => { + expect(normalizeLocale("zht")).toBe("zht") expect(normalizeLocale("zh-Hant")).toBe("zht") - expect(normalizeLocale("zh-TW")).toBe("zh") + expect(normalizeLocale("zh-TW")).toBe("zht") + expect(normalizeLocale("zh-HK")).toBe("zht") + expect(normalizeLocale("zh-MO")).toBe("zht") expect(normalizeLocale("zh-hant-TW")).toBe("zht") }) diff --git a/packages/kilo-vscode/tests/unit/legacy-migration/messages.test.ts b/packages/kilo-vscode/tests/unit/legacy-migration/messages.test.ts new file mode 100644 index 00000000000..f89e2fc330e --- /dev/null +++ b/packages/kilo-vscode/tests/unit/legacy-migration/messages.test.ts @@ -0,0 +1,107 @@ +import { describe, expect, it } from "bun:test" +import { parseMessagesFromConversation } from "../../../src/legacy-migration/sessions/lib/messages" +import type { LegacyApiMessage } from "../../../src/legacy-migration/sessions/lib/legacy-types" + +const id = "019d3df5-d5d9-73dc-bc2c-43a6304ac62c" +const item = { + id, + ts: 1774861014564, + task: "In this folder I need you to create 3 python files with random content, oriented towards web development", + workspace: "/workspace/testing-4", + mode: "code", +} + +function sample(): LegacyApiMessage[] { + return [ + { + role: "user", + content: [ + { + type: "text", + text: "\nIn this folder I need you to create 3 python files with random content, oriented towards web development\n", + }, + ], + ts: 1774861014564, + }, + { + role: "assistant", + content: [ + { + type: "text", + text: "\n\nI'll create 3 Python files with web development-oriented content.", + }, + ], + ts: 1774861031791, + }, + { + role: "system", + content: "ignored", + ts: 1774861032000, + } as unknown as LegacyApiMessage, + ] +} + +describe("legacy migration messages", () => { + it("parses a basic legacy conversation into ordered user and assistant messages with stable ids", () => { + const list = parseMessagesFromConversation(sample(), id, item.workspace, item) + + expect(list).toHaveLength(2) + expect(list[0]?.data.role).toBe("user") + expect(list[1]?.data.role).toBe("assistant") + expect(list[0]?.id).toBeDefined() + expect(list[1]?.id).toBeDefined() + }) + + it("creates valid assistant message metadata for the SDK/backend shape", () => { + const list = parseMessagesFromConversation(sample(), id, item.workspace, item) + const msg = list.find((x) => x.data.role === "assistant") + + expect(msg?.data.role).toBe("assistant") + if (msg?.data.role !== "assistant") throw new Error("assistant message not found") + expect(msg.data.mode).toBe("code") + expect(msg.data.path.cwd).toBe("/workspace/testing-4") + expect(msg.data.path.root).toBe("/workspace/testing-4") + expect(msg.data.tokens.input).toBe(0) + expect(msg.data.tokens.output).toBe(0) + }) + + it("ignores unsupported legacy entries instead of producing broken messages", () => { + const list = parseMessagesFromConversation(sample(), id, item.workspace, item) + + expect(list).toHaveLength(2) + expect(list.some((x) => x.data.role !== "user" && x.data.role !== "assistant")).toBe(false) + }) + + it("keeps assistant parentID pointing to the previous imported message when skipped entries exist", () => { + const list = parseMessagesFromConversation( + [ + { + role: "user", + content: "hello", + ts: 1, + }, + { + role: "system", + content: "ignored", + ts: 2, + } as unknown as LegacyApiMessage, + { + role: "assistant", + content: "hi", + ts: 3, + }, + ], + id, + item.workspace, + item, + ) + + const user = list[0] + const assistant = list[1] + + expect(user?.id).toBeDefined() + expect(assistant?.data.role).toBe("assistant") + if (assistant?.data.role !== "assistant") throw new Error("assistant message not found") + expect(assistant.data.parentID).toBe(user?.id) + }) +}) diff --git a/packages/kilo-vscode/tests/unit/legacy-migration/migrate.test.ts b/packages/kilo-vscode/tests/unit/legacy-migration/migrate.test.ts new file mode 100644 index 00000000000..5eede710e73 --- /dev/null +++ b/packages/kilo-vscode/tests/unit/legacy-migration/migrate.test.ts @@ -0,0 +1,212 @@ +import { beforeEach, describe, expect, it, mock } from "bun:test" + +const parseSession = mock(async () => ({ + project: { + id: "project-local", + worktree: "/workspace/testing", + sandboxes: ["/workspace/testing"], + timeCreated: 1, + timeUpdated: 1, + }, + session: { + id: "ses_local", + projectID: "project-local", + slug: "legacy-task-1", + directory: "/workspace/testing", + title: "Legacy task", + version: "v2", + timeCreated: 1, + timeUpdated: 1, + }, + messages: [], + parts: [], +})) + +mock.module("../../../src/legacy-migration/sessions/parser", () => ({ + parseSession, +})) + +const { migrate } = await import("../../../src/legacy-migration/sessions/migrate") + +function ctx() { + return { + globalStorageUri: { path: "/storage" }, + globalState: { + get: (key: string) => { + if (key === "taskHistory") return [{ id: "legacy-task-1", workspace: "/workspace/testing" }] + return undefined + }, + update: async () => undefined, + }, + } +} + +function client() { + const calls: Array<{ name: string; body: unknown }> = [] + return { + calls, + kilocode: { + sessionImport: { + project: async (body: unknown) => { + calls.push({ name: "project", body }) + return { data: { id: "project-real" } } + }, + session: async (body: unknown) => { + calls.push({ name: "session", body }) + return { data: { ok: true } } + }, + message: async (body: unknown) => { + calls.push({ name: "message", body }) + return { data: { ok: true } } + }, + part: async (body: unknown) => { + calls.push({ name: "part", body }) + return { data: { ok: true } } + }, + }, + }, + } +} + +describe("legacy migration migrate", () => { + beforeEach(() => { + parseSession.mockClear() + }) + + it("inserts project then session then message then part in the correct order", async () => { + const calls: string[] = [] + const api = { + kilocode: { + sessionImport: { + project: async () => { + calls.push("project") + return { data: { id: "project-real" } } + }, + session: async () => { + calls.push("session") + return { data: { ok: true } } + }, + message: async () => { + calls.push("message") + return { data: { ok: true } } + }, + part: async () => { + calls.push("part") + return { data: { ok: true } } + }, + }, + }, + } + + parseSession.mockResolvedValueOnce({ + project: { + id: "project-local", + worktree: "/workspace/testing", + sandboxes: ["/workspace/testing"], + timeCreated: 1, + timeUpdated: 1, + }, + session: { + id: "ses_local", + projectID: "project-local", + slug: "legacy-task-1", + directory: "/workspace/testing", + title: "Legacy task", + version: "v2", + timeCreated: 1, + timeUpdated: 1, + }, + messages: [ + { + id: "msg_1", + sessionID: "ses_local", + timeCreated: 1, + data: { + role: "user", + time: { created: 1 }, + agent: "user", + model: { providerID: "legacy", modelID: "legacy" }, + }, + }, + ] as never, + parts: [ + { + id: "prt_1", + sessionID: "ses_local", + messageID: "msg_1", + timeCreated: 1, + data: { + type: "text", + text: "hello", + time: { start: 1, end: 1 }, + }, + }, + ] as never, + }) + + await migrate("legacy-task-1", ctx() as never, api as never) + + expect(calls).toEqual(["project", "session", "message", "part"]) + }) + + it("uses the projectID returned by backend when inserting the session", async () => { + const api = client() + + await migrate("legacy-task-1", ctx() as never, api as never) + + const call = api.calls.find((x) => x.name === "session") + expect(call).toBeDefined() + expect((call?.body as { projectID: string }).projectID).toBe("project-real") + }) + + it("returns ok false without throwing when one backend insert fails", async () => { + const api = { + kilocode: { + sessionImport: { + project: async () => ({ data: { id: "project-real" } }), + session: async () => { + throw new Error("session failed") + }, + message: async () => ({ data: { ok: true } }), + part: async () => ({ data: { ok: true } }), + }, + }, + } + + const result = await migrate("legacy-task-1", ctx() as never, api as never) + + expect(result.ok).toBe(false) + }) + + it("skips message and part imports when backend reports the session already exists", async () => { + const calls: string[] = [] + const api = { + kilocode: { + sessionImport: { + project: async () => { + calls.push("project") + return { data: { id: "project-real" } } + }, + session: async () => { + calls.push("session") + return { data: { ok: true, skipped: true } } + }, + message: async () => { + calls.push("message") + return { data: { ok: true } } + }, + part: async () => { + calls.push("part") + return { data: { ok: true } } + }, + }, + }, + } + + const result = await migrate("legacy-task-1", ctx() as never, api as never) + + expect(result.ok).toBe(true) + expect(result).toHaveProperty("skipped", true) + expect(calls).toEqual(["project", "session"]) + }) +}) diff --git a/packages/kilo-vscode/tests/unit/legacy-migration/native-modes.test.ts b/packages/kilo-vscode/tests/unit/legacy-migration/native-modes.test.ts new file mode 100644 index 00000000000..980f4842bf4 --- /dev/null +++ b/packages/kilo-vscode/tests/unit/legacy-migration/native-modes.test.ts @@ -0,0 +1,322 @@ +import { describe, expect, it } from "bun:test" +import { + buildCustomModeList, + isNativeModeModified, + buildMergedNativeMode, +} from "../../../src/legacy-migration/migration-service" +import { NATIVE_MODE_DEFAULTS } from "../../../src/legacy-migration/native-mode-defaults" +import type { LegacyCustomMode, LegacyPromptComponent } from "../../../src/legacy-migration/legacy-types" + +// --------------------------------------------------------------------------- +// isNativeModeModified +// --------------------------------------------------------------------------- + +describe("isNativeModeModified", () => { + const defaults = NATIVE_MODE_DEFAULTS["code"]! + + it("returns true when a YAML override exists", () => { + const yaml: LegacyCustomMode = { + slug: "code", + name: "My Code", + roleDefinition: "custom role", + groups: ["read"], + } + expect(isNativeModeModified(yaml, undefined, defaults)).toBe(true) + }) + + it("returns false when no YAML and no prompts exist", () => { + expect(isNativeModeModified(undefined, undefined, defaults)).toBe(false) + }) + + it("returns false when prompts match the defaults exactly", () => { + const prompt: LegacyPromptComponent = { + roleDefinition: defaults.roleDefinition, + } + expect(isNativeModeModified(undefined, prompt, defaults)).toBe(false) + }) + + it("returns true when roleDefinition differs from default", () => { + const prompt: LegacyPromptComponent = { + roleDefinition: "You are a Python specialist.", + } + expect(isNativeModeModified(undefined, prompt, defaults)).toBe(true) + }) + + it("returns true when customInstructions differs from default", () => { + const prompt: LegacyPromptComponent = { + customInstructions: "Always use type hints.", + } + // code mode has no default customInstructions, so any non-empty value is different + expect(isNativeModeModified(undefined, prompt, defaults)).toBe(true) + }) + + it("returns true when whenToUse differs from default", () => { + const prompt: LegacyPromptComponent = { + whenToUse: "Use for Python only.", + } + expect(isNativeModeModified(undefined, prompt, defaults)).toBe(true) + }) + + it("returns false when prompts have empty strings", () => { + const prompt: LegacyPromptComponent = { + roleDefinition: "", + customInstructions: "", + whenToUse: "", + } + expect(isNativeModeModified(undefined, prompt, defaults)).toBe(false) + }) + + it("returns false when customInstructions matches default (ask mode)", () => { + const ask = NATIVE_MODE_DEFAULTS["ask"]! + const prompt: LegacyPromptComponent = { + customInstructions: ask.customInstructions, + } + expect(isNativeModeModified(undefined, prompt, ask)).toBe(false) + }) + + it("returns true when customInstructions differs from default (ask mode)", () => { + const ask = NATIVE_MODE_DEFAULTS["ask"]! + const prompt: LegacyPromptComponent = { + customInstructions: "Different instructions.", + } + expect(isNativeModeModified(undefined, prompt, ask)).toBe(true) + }) + + it("returns true when description differs from default", () => { + const prompt: LegacyPromptComponent = { + description: "My custom short description", + } + expect(isNativeModeModified(undefined, prompt, defaults)).toBe(true) + }) + + it("returns false when description matches default", () => { + const prompt: LegacyPromptComponent = { + description: defaults.description, + } + expect(isNativeModeModified(undefined, prompt, defaults)).toBe(false) + }) +}) + +// --------------------------------------------------------------------------- +// buildCustomModeList +// --------------------------------------------------------------------------- + +describe("buildCustomModeList", () => { + it("returns non-native custom modes as before", () => { + const modes: LegacyCustomMode[] = [ + { slug: "translate", name: "Translate", roleDefinition: "translator", groups: ["read"] }, + ] + const result = buildCustomModeList(modes, null) + expect(result).toEqual([{ name: "Translate", slug: "translate" }]) + }) + + it("still filters out unmodified native modes from YAML", () => { + // A mode list with only non-native entries + an exact-slug match that is not a YAML + // override (just a non-matching slug that happens to be native) — this shouldn't happen + // in practice because custom_modes.yaml would only have a native slug if the user put it there + const result = buildCustomModeList(null, null) + expect(result).toEqual([]) + }) + + it("includes a modified native mode from YAML with -custom slug", () => { + const modes: LegacyCustomMode[] = [ + { + slug: "code", + name: "My Code Mode", + roleDefinition: "You are a specialized engineer.", + groups: ["read", "edit"], + }, + ] + const result = buildCustomModeList(modes, null) + expect(result).toEqual([{ name: "My Code Mode (Custom)", slug: "code-custom", nativeSlug: "code" }]) + }) + + it("includes a modified native mode from customModePrompts with -custom slug", () => { + const prompts: Record = { + code: { roleDefinition: "You are a Python expert." }, + } + const result = buildCustomModeList(null, prompts) + expect(result).toEqual([{ name: "Code (Custom)", slug: "code-custom", nativeSlug: "code" }]) + }) + + it("does not include a native mode when prompts match defaults", () => { + const defaults = NATIVE_MODE_DEFAULTS["code"]! + const prompts: Record = { + code: { roleDefinition: defaults.roleDefinition }, + } + const result = buildCustomModeList(null, prompts) + expect(result).toEqual([]) + }) + + it("combines non-native custom modes and modified native modes", () => { + const modes: LegacyCustomMode[] = [ + { slug: "translate", name: "Translate", roleDefinition: "translator", groups: ["read"] }, + { slug: "code", name: "Custom Code", roleDefinition: "specialized", groups: ["read", "edit"] }, + ] + const result = buildCustomModeList(modes, null) + expect(result).toHaveLength(2) + expect(result[0]).toEqual({ name: "Translate", slug: "translate" }) + expect(result[1]).toEqual({ name: "Custom Code (Custom)", slug: "code-custom", nativeSlug: "code" }) + }) + + it("produces only one entry when both YAML and prompts exist for same native slug", () => { + const modes: LegacyCustomMode[] = [ + { slug: "code", name: "Custom Code", roleDefinition: "from yaml", groups: ["read"] }, + ] + const prompts: Record = { + code: { roleDefinition: "from prompts" }, + } + const result = buildCustomModeList(modes, prompts) + const native = result.filter((m) => m.nativeSlug === "code") + expect(native).toHaveLength(1) + expect(native[0]!.slug).toBe("code-custom") + }) + + it("excludes 'build' since it is a native slug with no legacy defaults", () => { + const modes: LegacyCustomMode[] = [{ slug: "build", name: "Build", roleDefinition: "builder", groups: ["read"] }] + // "build" is in DEFAULT_MODE_SLUGS (so filtered from non-native pass) but has no + // entry in NATIVE_MODE_DEFAULTS (so skipped in the native-modification pass) + const result = buildCustomModeList(modes, null) + expect(result).toEqual([]) + }) + + it("detects multiple modified native modes", () => { + const prompts: Record = { + code: { roleDefinition: "Custom code role" }, + debug: { roleDefinition: "Custom debug role" }, + } + const result = buildCustomModeList(null, prompts) + const slugs = result.map((m) => m.slug) + expect(slugs).toContain("code-custom") + expect(slugs).toContain("debug-custom") + }) +}) + +// --------------------------------------------------------------------------- +// buildMergedNativeMode +// --------------------------------------------------------------------------- + +describe("buildMergedNativeMode", () => { + it("returns null for unknown slugs", () => { + expect(buildMergedNativeMode(undefined, undefined, "nonexistent")).toBeNull() + }) + + it("uses YAML mode as base when present", () => { + const yaml: LegacyCustomMode = { + slug: "code", + name: "My Code", + roleDefinition: "custom role from yaml", + groups: ["read"], + } + const result = buildMergedNativeMode(yaml, undefined, "code") + expect(result).not.toBeNull() + expect(result!.roleDefinition).toBe("custom role from yaml") + expect(result!.groups).toEqual(["read"]) + }) + + it("uses native defaults as base when no YAML", () => { + const prompt: LegacyPromptComponent = { + roleDefinition: "custom role from prompts", + } + const result = buildMergedNativeMode(undefined, prompt, "code") + expect(result).not.toBeNull() + expect(result!.roleDefinition).toBe("custom role from prompts") + expect(result!.name).toBe("Code") + expect(result!.groups).toEqual(NATIVE_MODE_DEFAULTS["code"]!.groups) + }) + + it("overlays prompts on top of YAML", () => { + const yaml: LegacyCustomMode = { + slug: "code", + name: "My Code", + roleDefinition: "yaml role", + customInstructions: "yaml instructions", + groups: ["read"], + } + const prompt: LegacyPromptComponent = { + roleDefinition: "prompt role", + } + const result = buildMergedNativeMode(yaml, prompt, "code") + expect(result).not.toBeNull() + expect(result!.roleDefinition).toBe("prompt role") + expect(result!.customInstructions).toBe("yaml instructions") + }) + + it("preserves default groups when only prompts are present", () => { + const prompt: LegacyPromptComponent = { + customInstructions: "extra instructions", + } + const result = buildMergedNativeMode(undefined, prompt, "architect") + expect(result).not.toBeNull() + expect(result!.groups).toEqual(NATIVE_MODE_DEFAULTS["architect"]!.groups) + }) + + it("does not mutate the YAML input", () => { + const yaml: LegacyCustomMode = { + slug: "code", + name: "My Code", + roleDefinition: "original", + groups: ["read"], + } + const prompt: LegacyPromptComponent = { + roleDefinition: "overridden", + } + buildMergedNativeMode(yaml, prompt, "code") + expect(yaml.roleDefinition).toBe("original") + }) + + it("does not overlay empty prompt strings", () => { + const yaml: LegacyCustomMode = { + slug: "code", + name: "My Code", + roleDefinition: "yaml role", + groups: ["read"], + } + const prompt: LegacyPromptComponent = { + roleDefinition: "", + customInstructions: "", + } + const result = buildMergedNativeMode(yaml, prompt, "code") + expect(result!.roleDefinition).toBe("yaml role") + expect(result!.customInstructions).toBeUndefined() + }) + + it("includes whenToUse from prompts", () => { + const prompt: LegacyPromptComponent = { + whenToUse: "Use for special tasks", + } + const result = buildMergedNativeMode(undefined, prompt, "code") + expect(result!.whenToUse).toBe("Use for special tasks") + }) + + it("overlays description from prompts", () => { + const prompt: LegacyPromptComponent = { + description: "My custom description", + } + const result = buildMergedNativeMode(undefined, prompt, "code") + expect(result!.description).toBe("My custom description") + }) + + it("preserves default description when prompt description is empty", () => { + const prompt: LegacyPromptComponent = { + description: "", + } + const result = buildMergedNativeMode(undefined, prompt, "code") + expect(result!.description).toBe(NATIVE_MODE_DEFAULTS["code"]!.description) + }) + + it("overlays description from prompts on top of YAML", () => { + const yaml: LegacyCustomMode = { + slug: "code", + name: "My Code", + roleDefinition: "yaml role", + description: "yaml description", + groups: ["read"], + } + const prompt: LegacyPromptComponent = { + description: "prompt description", + } + const result = buildMergedNativeMode(yaml, prompt, "code") + expect(result!.description).toBe("prompt description") + }) +}) diff --git a/packages/kilo-vscode/tests/unit/legacy-migration/parser.test.ts b/packages/kilo-vscode/tests/unit/legacy-migration/parser.test.ts new file mode 100644 index 00000000000..0d3d9fa34ea --- /dev/null +++ b/packages/kilo-vscode/tests/unit/legacy-migration/parser.test.ts @@ -0,0 +1,36 @@ +import { describe, expect, it } from "bun:test" +import { createProject } from "../../../src/legacy-migration/sessions/lib/project" +import { createSession } from "../../../src/legacy-migration/sessions/lib/session" +import { createMessageID, createPartID } from "../../../src/legacy-migration/sessions/lib/ids" + +const id = "019d3df5-d5d9-73dc-bc2c-43a6304ac62c" +const item = { + id, + ts: 1774861014564, + task: "In this folder I need you to create 3 python files with random content, oriented towards web development", + workspace: "/workspace/testing-4", + mode: "code", +} + +describe("legacy migration parser", () => { + it("uses the final deterministic ids expected for migration", () => { + const project = createProject(item) + const session = createSession(id, item, project.id, item.workspace) + const msg1 = createMessageID(id, 0) + const msg2 = createMessageID(id, 1) + const prt1 = createPartID(id, 0, 0) + const prt2 = createPartID(id, 1, 0) + + expect(project.id).toBe(createProject(item).id) + expect(session.id).toBe(createSession(id, item, project.id, item.workspace).id) + expect(session.id.startsWith("ses_migrated_")).toBe(true) + expect(msg1).toBe(createMessageID(id, 0)) + expect(msg2).toBe(createMessageID(id, 1)) + expect(msg1.startsWith("msg_migrated_")).toBe(true) + expect(msg2.startsWith("msg_migrated_")).toBe(true) + expect(prt1).toBe(createPartID(id, 0, 0)) + expect(prt2).toBe(createPartID(id, 1, 0)) + expect(prt1.startsWith("prt_migrated_")).toBe(true) + expect(prt2.startsWith("prt_migrated_")).toBe(true) + }) +}) diff --git a/packages/kilo-vscode/tests/unit/legacy-migration/parts.test.ts b/packages/kilo-vscode/tests/unit/legacy-migration/parts.test.ts new file mode 100644 index 00000000000..60b81062410 --- /dev/null +++ b/packages/kilo-vscode/tests/unit/legacy-migration/parts.test.ts @@ -0,0 +1,224 @@ +import { describe, expect, it } from "bun:test" +import { parsePartsFromConversation } from "../../../src/legacy-migration/sessions/lib/parts/parts" +import type { LegacyApiMessage } from "../../../src/legacy-migration/sessions/lib/legacy-types" + +type Data = ReturnType[number]["data"] +type Text = Extract + +function text(list: ReturnType) { + return list.filter((x): x is (typeof list)[number] & { data: Text } => x.data.type === "text").map((x) => x.data.text) +} + +const id = "019d3df5-d5d9-73dc-bc2c-43a6304ac62c" +const item = { + id, + ts: 1774861014564, + task: "In this folder I need you to create 3 python files with random content, oriented towards web development", + workspace: "/workspace/testing-4", + mode: "code", +} + +function sample(): LegacyApiMessage[] { + return [ + { + role: "user", + content: [ + { + type: "text", + text: "\nIn this folder I need you to create 3 python files with random content, oriented towards web development\n", + }, + { + type: "text", + text: "\nCurrent time: 2026-03-30T12:54:59+02:00\n", + }, + ], + ts: 1774861014564, + }, + { + role: "assistant", + content: [ + { + type: "text", + text: "\n\nI'll create 3 Python files with web development-oriented content.", + }, + ], + ts: 1774861031791, + }, + { + role: "assistant", + content: [ + { + type: "tool_use", + id: "toolu_attempt_1", + name: "attempt_completion", + input: { + result: "Created 3 Python files with web development content.", + }, + }, + ], + ts: 1774861079951, + }, + ] +} + +describe("legacy migration parts", () => { + it("converts plain text and text blocks into visible text parts without losing content", async () => { + const list = parsePartsFromConversation(sample(), id, item) + + const items = text(list) + + expect(items.some((x) => x.includes("In this folder I need you to create 3 python files"))).toBe(true) + expect(items.some((x) => x.includes("I'll create 3 Python files with web development-oriented content."))).toBe( + true, + ) + }) + + it("drops standalone environment_details blocks but keeps the real task text", async () => { + const list = parsePartsFromConversation(sample(), id, item) + + const items = text(list) + + expect(items.some((x) => x.includes(""))).toBe(false) + expect(items.some((x) => x.includes("In this folder I need you to create 3 python files"))).toBe(true) + }) + + it("keeps only the first task block content when text exists outside the legacy task wrapper", () => { + const list = parsePartsFromConversation( + [ + { + role: "user", + content: [ + { + type: "text", + text: "Some preamble\nactual task\nSome postamble", + }, + ], + ts: 1774861014564, + }, + ] as LegacyApiMessage[], + id, + item, + ) + + expect(text(list)).toEqual(["actual task"]) + }) + + it("preserves attempt_completion input.result as assistant-visible text", async () => { + const list = parsePartsFromConversation(sample(), id, item) + + const items = text(list) + + expect(items.some((x) => x.includes("Created 3 Python files with web development content"))).toBe(true) + }) + + it("adds a visible user text part for feedback embedded in tool_result", () => { + const list = parsePartsFromConversation( + [ + { + role: "assistant", + content: [ + { + type: "tool_use", + id: "toolu_feedback_1", + name: "attempt_completion", + input: { + result: "Done.", + }, + }, + ], + ts: 10, + }, + { + role: "user", + content: [ + { + type: "tool_result", + tool_use_id: "toolu_feedback_1", + content: [ + { + type: "text", + text: "The user has provided feedback on the results. Consider their input to continue the task, and then attempt completion again.\n\nAdd two more lines\n", + }, + ], + }, + ], + ts: 11, + }, + ] as LegacyApiMessage[], + id, + item, + ) + + expect(text(list)).toContain("Add two more lines") + }) + + it("does not create parts for skipped legacy entries like system messages", () => { + const list = parsePartsFromConversation( + [ + { + role: "system", + content: "ignored", + ts: 1774861015000, + } as unknown as LegacyApiMessage, + ], + id, + item, + ) + + expect(list).toEqual([]) + }) + + it("keeps part message ids aligned with imported message ids when skipped entries exist", () => { + const list = parsePartsFromConversation( + [ + { + role: "user", + content: "hello", + ts: 1, + }, + { + role: "system", + content: "ignored", + ts: 2, + } as unknown as LegacyApiMessage, + { + role: "assistant", + content: "hi", + ts: 3, + }, + ], + id, + item, + ) + + const ids = list.map((x) => x.messageID) + + expect(ids.some((x) => x === "msg_legacy-task-1_2")).toBe(false) + }) + + it("uses non-colliding ids for reasoning and normal content parts in the same message", () => { + const list = parsePartsFromConversation( + [ + { + role: "assistant", + type: "reasoning", + text: "Think first", + content: [ + { + type: "text", + text: "Visible answer", + }, + ], + ts: 1774861015000, + } as unknown as LegacyApiMessage, + ], + id, + item, + ) + + const ids = list.map((x) => x.id) + + expect(ids).toHaveLength(2) + expect(new Set(ids).size).toBe(2) + }) +}) diff --git a/packages/kilo-vscode/tests/unit/legacy-migration/path.test.ts b/packages/kilo-vscode/tests/unit/legacy-migration/path.test.ts new file mode 100644 index 00000000000..71e807c1560 --- /dev/null +++ b/packages/kilo-vscode/tests/unit/legacy-migration/path.test.ts @@ -0,0 +1,48 @@ +import { beforeEach, describe, expect, it, mock } from "bun:test" +import * as path from "path" + +const realpath = mock(async (input: string) => input) + +mock.module("fs/promises", () => ({ + realpath, +})) + +const { isWindowsDrivePath, normalizeLegacyPath } = await import("../../../src/legacy-migration/sessions/lib/path") + +describe("legacy migration path", () => { + beforeEach(() => { + realpath.mockReset() + realpath.mockImplementation(async (input: string) => input) + }) + + it("returns an empty string for empty legacy paths", async () => { + expect(await normalizeLegacyPath(" ")).toBe("") + expect(realpath).not.toHaveBeenCalled() + }) + + it("detects Windows drive paths without relying on runtime platform", () => { + expect(isWindowsDrivePath("c:\\repo")).toBe(true) + expect(isWindowsDrivePath("C:/repo")).toBe(true) + expect(isWindowsDrivePath("/repo")).toBe(false) + }) + + it("uppercases the Windows drive letter before resolving the final path", async () => { + realpath.mockImplementation(async (input: string) => input) + + const value = await normalizeLegacyPath("c:/repo/../repo/file.txt") + const expected = path.normalize(path.resolve("c:/repo/../repo/file.txt")) + + expect(realpath).toHaveBeenCalledTimes(1) + expect(realpath.mock.calls[0]?.[0]).toBe(expected.replace(/^c:/, "C:")) + expect(value).toBe(expected.replace(/^c:/, "C:")) + }) + + it("falls back to the normalized path when realpath fails", async () => { + realpath.mockRejectedValueOnce(new Error("missing")) + + const input = "C:/repo/./child" + const value = await normalizeLegacyPath(input) + + expect(value).toBe(path.normalize(path.resolve(input))) + }) +}) diff --git a/packages/kilo-vscode/tests/unit/legacy-migration/project.test.ts b/packages/kilo-vscode/tests/unit/legacy-migration/project.test.ts new file mode 100644 index 00000000000..2f7331af489 --- /dev/null +++ b/packages/kilo-vscode/tests/unit/legacy-migration/project.test.ts @@ -0,0 +1,35 @@ +import { describe, expect, it } from "bun:test" +import { createProject } from "../../../src/legacy-migration/sessions/lib/project" + +describe("legacy migration project", () => { + it("builds a project from the legacy workspace and timestamp", () => { + const project = createProject({ + id: "legacy-task-1", + ts: 1774861014564, + workspace: "/workspace/testing", + task: "Understand this project", + mode: "code", + }) + + expect(project.worktree).toBe("/workspace/testing") + expect(project.sandboxes).toEqual(["/workspace/testing"]) + expect(project.timeCreated).toBe(1774861014564) + expect(project.timeUpdated).toBe(1774861014564) + }) + + it("creates a deterministic project id for the same workspace", () => { + const a = createProject({ id: "legacy-1", workspace: "/workspace/testing" }) + const b = createProject({ id: "legacy-1", workspace: "/workspace/testing" }) + + expect(a.id).toBe(b.id) + }) + + it("falls back to empty defaults when legacy workspace data is missing", () => { + const project = createProject() + + expect(project.worktree).toBe("") + expect(project.sandboxes).toEqual([]) + expect(project.timeCreated).toBe(0) + expect(project.timeUpdated).toBe(0) + }) +}) diff --git a/packages/kilo-vscode/tests/unit/legacy-migration/reasoning.test.ts b/packages/kilo-vscode/tests/unit/legacy-migration/reasoning.test.ts new file mode 100644 index 00000000000..f5c9a688849 --- /dev/null +++ b/packages/kilo-vscode/tests/unit/legacy-migration/reasoning.test.ts @@ -0,0 +1,99 @@ +import { describe, expect, it } from "bun:test" +import { parsePartsFromConversation } from "../../../src/legacy-migration/sessions/lib/parts/parts" +import type { LegacyApiMessage } from "../../../src/legacy-migration/sessions/lib/legacy-types" + +type Reasoning = Extract[number]["data"], { type: "reasoning" }> + +function reasoning(list: ReturnType) { + return list + .filter((x): x is (typeof list)[number] & { data: Reasoning } => x.data.type === "reasoning") + .map((x) => x.data.text) +} + +const id = "legacy-reasoning-1" +const item = { + id, + ts: 1774861014564, + task: "Reasoning parsing test", + workspace: "/workspace/testing", + mode: "code", +} + +describe("legacy migration reasoning", () => { + it("converts type reasoning plus text into a reasoning part", () => { + const list = parsePartsFromConversation( + [ + { + role: "assistant", + type: "reasoning", + text: "I should inspect the files first.", + content: [], + ts: 1774861015000, + } as unknown as LegacyApiMessage, + ], + id, + item, + ) + + const out = reasoning(list) + expect(out).toEqual(["I should inspect the files first."]) + }) + + it("extracts reasoning from reasoning_content", () => { + const list = parsePartsFromConversation( + [ + { + role: "assistant", + content: [], + reasoning_content: "I should read the markdown before answering.", + ts: 1774861015000, + } as unknown as LegacyApiMessage, + ], + id, + item, + ) + + const out = reasoning(list) + expect(out).toEqual(["I should read the markdown before answering."]) + }) + + it("extracts readable reasoning text from reasoning_details", () => { + const list = parsePartsFromConversation( + [ + { + role: "assistant", + content: [], + reasoning_details: [{ text: "First inspect the repo." }, { reasoning: "Then summarize the structure." }], + ts: 1774861015000, + } as unknown as LegacyApiMessage, + ], + id, + item, + ) + + const out = reasoning(list) + expect(out).toHaveLength(1) + expect(out[0]).toContain("First inspect the repo.") + expect(out[0]).toContain("Then summarize the structure.") + }) + + it("prefers explicit reasoning entries over provider-specific reasoning fields when both exist", () => { + const list = parsePartsFromConversation( + [ + { + role: "assistant", + type: "reasoning", + text: "I should inspect the files first.", + reasoning_content: "I should inspect the files first.", + content: [], + ts: 1774861015000, + } as unknown as LegacyApiMessage, + ], + id, + item, + ) + + const out = reasoning(list) + expect(out).toEqual(["I should inspect the files first."]) + }) +}) diff --git a/packages/kilo-vscode/tests/unit/legacy-migration/session.test.ts b/packages/kilo-vscode/tests/unit/legacy-migration/session.test.ts new file mode 100644 index 00000000000..4faceb315cb --- /dev/null +++ b/packages/kilo-vscode/tests/unit/legacy-migration/session.test.ts @@ -0,0 +1,42 @@ +import { describe, expect, it } from "bun:test" +import { createSession } from "../../../src/legacy-migration/sessions/lib/session" + +describe("legacy migration session", () => { + it("builds a session from legacy task metadata and the resolved project id", () => { + const session = createSession( + "019d3df5-d5d9-73dc-bc2c-43a6304ac62c", + { + id: "019d3df5-d5d9-73dc-bc2c-43a6304ac62c", + ts: 1774861014564, + workspace: "/workspace/testing", + task: "Understand this project", + mode: "code", + }, + "project-1", + "/workspace/testing", + ) + + expect(session.projectID).toBe("project-1") + expect(session.directory).toBe("/workspace/testing") + expect(session.title).toBe("Understand this project") + expect(session.version).toBe("v2") + expect(session.timeCreated).toBe(1774861014564) + expect(session.timeUpdated).toBe(1774861014564) + }) + + it("creates a deterministic session id from the legacy task id", () => { + const a = createSession("legacy-task-1", undefined, "project-1", "") + const b = createSession("legacy-task-1", undefined, "project-1", "") + + expect(a.id).toBe(b.id) + expect(a.id.startsWith("ses_migrated_")).toBe(true) + }) + + it("falls back to the legacy id as title when task metadata is missing", () => { + const session = createSession("legacy-task-1", undefined, "project-1", "") + + expect(session.slug).toBe("legacy-task-1") + expect(session.title).toBe("legacy-task-1") + expect(session.directory).toBe("") + }) +}) diff --git a/packages/kilo-vscode/tests/unit/legacy-migration/tools.test.ts b/packages/kilo-vscode/tests/unit/legacy-migration/tools.test.ts new file mode 100644 index 00000000000..e1262a352be --- /dev/null +++ b/packages/kilo-vscode/tests/unit/legacy-migration/tools.test.ts @@ -0,0 +1,134 @@ +import { describe, expect, it } from "bun:test" +import { parsePartsFromConversation } from "../../../src/legacy-migration/sessions/lib/parts/parts" +import type { LegacyApiMessage } from "../../../src/legacy-migration/sessions/lib/legacy-types" + +type Tool = Extract[number]["data"], { type: "tool" }> + +function tools(list: ReturnType) { + return list.filter((x): x is (typeof list)[number] & { data: Tool } => x.data.type === "tool").map((x) => x.data) +} + +const id = "legacy-task-1" +const item = { + id, + ts: 1774861014564, + task: "Tool parsing test", + workspace: "/workspace/testing", + mode: "code", +} + +function fallback(): LegacyApiMessage[] { + return [ + { + role: "assistant", + content: [ + { + type: "tool_use", + id: "toolu_fallback_1", + name: "read_file", + input: { path: "app.py" }, + }, + ], + ts: 1774861015000, + }, + ] +} + +function merged(): LegacyApiMessage[] { + return [ + { + role: "assistant", + content: [ + { + type: "tool_use", + id: "toolu_merge_1", + name: "read_file", + input: { path: "app.py" }, + }, + ], + ts: 1774861015000, + }, + { + role: "user", + content: [ + { + type: "tool_result", + tool_use_id: "toolu_merge_1", + content: [ + { + type: "text", + text: "File: app.py\nHello world", + }, + ], + }, + ], + ts: 1774861016000, + }, + ] +} + +function noTextResult(): LegacyApiMessage[] { + return [ + { + role: "assistant", + content: [ + { + type: "tool_use", + id: "toolu_merge_2", + name: "read_file", + input: { path: "app.py" }, + }, + ], + ts: 1774861015000, + }, + { + role: "user", + content: [ + { + type: "tool_result", + tool_use_id: "toolu_merge_2", + content: [], + }, + ], + ts: 1774861016000, + }, + ] +} + +describe("legacy migration tools", () => { + it("creates a fallback tool part from tool_use when there is no matching tool_result", () => { + const list = parsePartsFromConversation(fallback(), id, item) + const out = tools(list) + + expect(out).toHaveLength(1) + expect(out[0]?.tool).toBe("read_file") + expect(out[0]?.state.status).toBe("completed") + }) + + it("merges tool_use and tool_result into one completed tool part using the correct tool id", () => { + const list = parsePartsFromConversation(merged(), id, item) + const out = tools(list) + + expect(out).toHaveLength(1) + expect(out[0]?.callID).toBe("toolu_merge_1") + expect(out[0]?.tool).toBe("read_file") + if (out[0]?.state.status !== "completed") throw new Error("tool was not completed") + expect(out[0].state.output).toContain("File: app.py") + }) + + it("does not duplicate a tool part when a matching tool_result exists later in the conversation", () => { + const list = parsePartsFromConversation(merged(), id, item) + const out = tools(list) + + expect(out).toHaveLength(1) + }) + + it("falls back to the tool name when tool_result has no readable text content", () => { + const list = parsePartsFromConversation(noTextResult(), id, item) + const out = tools(list) + + expect(out).toHaveLength(1) + if (out[0]?.state.status !== "completed") throw new Error("tool was not completed") + expect(out[0].state.output).toBe("read_file") + }) +}) diff --git a/packages/kilo-vscode/tests/unit/mode-io.test.ts b/packages/kilo-vscode/tests/unit/mode-io.test.ts new file mode 100644 index 00000000000..bb6b99c1ce9 --- /dev/null +++ b/packages/kilo-vscode/tests/unit/mode-io.test.ts @@ -0,0 +1,222 @@ +import { describe, it, expect } from "bun:test" +import { parseImport, buildExport, MAX_IMPORT_SIZE } from "../../webview-ui/src/components/settings/mode-io" + +describe("parseImport", () => { + it("parses a valid full definition", () => { + const json = JSON.stringify({ + name: "reviewer", + description: "Reviews code", + prompt: "You review code.", + model: "anthropic/claude-sonnet-4-20250514", + mode: "primary", + temperature: 0.7, + top_p: 0.9, + steps: 10, + }) + const result = parseImport(json, []) + expect(result).toEqual({ + ok: true, + name: "reviewer", + config: { + description: "Reviews code", + prompt: "You review code.", + model: "anthropic/claude-sonnet-4-20250514", + mode: "primary", + temperature: 0.7, + top_p: 0.9, + steps: 10, + }, + }) + }) + + it("defaults mode to primary when omitted", () => { + const json = JSON.stringify({ name: "my-agent" }) + const result = parseImport(json, []) + expect(result).toEqual({ + ok: true, + name: "my-agent", + config: { mode: "primary" }, + }) + }) + + it("rejects invalid JSON", () => { + expect(parseImport("not json", [])).toEqual({ ok: false, error: "invalidJson" }) + }) + + it("rejects JSON null", () => { + expect(parseImport("null", [])).toEqual({ ok: false, error: "invalidJson" }) + }) + + it("rejects JSON array", () => { + expect(parseImport("[]", [])).toEqual({ ok: false, error: "invalidJson" }) + }) + + it("rejects JSON string", () => { + expect(parseImport('"hello"', [])).toEqual({ ok: false, error: "invalidJson" }) + }) + + it("rejects JSON number", () => { + expect(parseImport("42", [])).toEqual({ ok: false, error: "invalidJson" }) + }) + + it("rejects missing name", () => { + expect(parseImport("{}", [])).toEqual({ ok: false, error: "invalidName" }) + }) + + it("rejects name starting with number", () => { + expect(parseImport(JSON.stringify({ name: "1agent" }), [])).toEqual({ ok: false, error: "invalidName" }) + }) + + it("rejects name with uppercase", () => { + expect(parseImport(JSON.stringify({ name: "MyAgent" }), [])).toEqual({ ok: false, error: "invalidName" }) + }) + + it("rejects name with spaces", () => { + expect(parseImport(JSON.stringify({ name: "my agent" }), [])).toEqual({ ok: false, error: "invalidName" }) + }) + + it("rejects duplicate name", () => { + const json = JSON.stringify({ name: "existing" }) + expect(parseImport(json, ["existing", "other"])).toEqual({ ok: false, error: "nameTaken" }) + }) + + it("ignores invalid mode values", () => { + const json = JSON.stringify({ name: "test", mode: "bogus" }) + const result = parseImport(json, []) + expect(result).toEqual({ + ok: true, + name: "test", + config: { mode: "primary" }, + }) + }) + + it("accepts all valid mode values", () => { + for (const mode of ["subagent", "primary", "all"] as const) { + const json = JSON.stringify({ name: "test", mode }) + const result = parseImport(json, []) + expect(result).toEqual({ ok: true, name: "test", config: { mode } }) + } + }) + + it("ignores non-string and non-number fields", () => { + const json = JSON.stringify({ + name: "test", + description: 123, + prompt: true, + model: [], + temperature: "hot", + top_p: null, + steps: "many", + }) + const result = parseImport(json, []) + expect(result).toEqual({ ok: true, name: "test", config: { mode: "primary" } }) + }) + + it("trims whitespace from name", () => { + const json = JSON.stringify({ name: " trimmed " }) + // "trimmed" doesn't have hyphens or digits so it should be valid + const result = parseImport(json, []) + expect(result).toEqual({ ok: true, name: "trimmed", config: { mode: "primary" } }) + }) + + it("preserves valid permission entries", () => { + const json = JSON.stringify({ + name: "reviewer", + permission: { read: "allow", bash: "allow", edit: "deny", mcp: "ask" }, + }) + const result = parseImport(json, []) + expect(result).toEqual({ + ok: true, + name: "reviewer", + config: { + mode: "primary", + permission: { read: "allow", bash: "allow", edit: "deny", mcp: "ask" }, + }, + }) + }) + + it("drops invalid permission values", () => { + const json = JSON.stringify({ + name: "test", + permission: { read: "allow", bad: "nope", num: 42, arr: [] }, + }) + const result = parseImport(json, []) + expect(result).toEqual({ + ok: true, + name: "test", + config: { mode: "primary", permission: { read: "allow" } }, + }) + }) + + it("preserves nested per-pattern permission rules", () => { + const json = JSON.stringify({ + name: "test", + permission: { bash: { "*": "ask", uname: "allow" }, read: "allow" }, + }) + const result = parseImport(json, []) + expect(result).toEqual({ + ok: true, + name: "test", + config: { + mode: "primary", + permission: { bash: { "*": "ask", uname: "allow" }, read: "allow" }, + }, + }) + }) + + it("ignores non-object permission field", () => { + const json = JSON.stringify({ name: "test", permission: "allow" }) + const result = parseImport(json, []) + expect(result).toEqual({ ok: true, name: "test", config: { mode: "primary" } }) + }) + + it("round-trips permission through export and import", () => { + const cfg = { + mode: "primary" as const, + prompt: "Review code", + permission: { read: "allow" as const, edit: "deny" as const }, + } + const exported = buildExport("reviewer", cfg) + const json = JSON.stringify(exported) + const result = parseImport(json, []) + expect(result).toEqual({ + ok: true, + name: "reviewer", + config: { mode: "primary", prompt: "Review code", permission: { read: "allow", edit: "deny" } }, + }) + }) +}) + +describe("buildExport", () => { + it("includes name and all config fields", () => { + const result = buildExport("reviewer", { + description: "Reviews code", + prompt: "You review code.", + model: "anthropic/claude-sonnet-4-20250514", + mode: "primary", + temperature: 0.7, + top_p: 0.9, + steps: 10, + }) + expect(result).toEqual({ + name: "reviewer", + description: "Reviews code", + prompt: "You review code.", + model: "anthropic/claude-sonnet-4-20250514", + mode: "primary", + temperature: 0.7, + top_p: 0.9, + steps: 10, + }) + }) + + it("handles empty config", () => { + expect(buildExport("minimal", {})).toEqual({ name: "minimal" }) + }) +}) + +describe("MAX_IMPORT_SIZE", () => { + it("is 1 MB", () => { + expect(MAX_IMPORT_SIZE).toBe(1_048_576) + }) +}) diff --git a/packages/kilo-vscode/tests/unit/model-price-format.test.ts b/packages/kilo-vscode/tests/unit/model-price-format.test.ts new file mode 100644 index 00000000000..9203210f352 --- /dev/null +++ b/packages/kilo-vscode/tests/unit/model-price-format.test.ts @@ -0,0 +1,36 @@ +import { describe, it, expect } from "bun:test" +import { fmtPrice } from "../../webview-ui/src/components/shared/model-preview-utils" + +// Prices arriving at fmtPrice are already in $/M tokens (converted by parseApiPrice). +// This test suite guards against the double-multiplication bug where fmtPrice was +// incorrectly multiplying by 1_000_000 again, turning $3.00/1M into $3,000,000.00/1M. + +describe("fmtPrice", () => { + it("formats Claude Sonnet 4.6 input price correctly ($3/1M)", () => { + expect(fmtPrice(3)).toBe("$3.00/1M") + }) + + it("formats Claude Sonnet 4.6 output price correctly ($15/1M)", () => { + expect(fmtPrice(15)).toBe("$15.00/1M") + }) + + it("returns 'Free' for zero price", () => { + expect(fmtPrice(0)).toBe("Free") + }) + + it("uses 4 decimal places for sub-cent prices", () => { + expect(fmtPrice(0.005)).toBe("$0.0050/1M") + }) + + it("uses 2 decimal places at the $0.01 boundary", () => { + expect(fmtPrice(0.01)).toBe("$0.01/1M") + }) + + it("formats a typical cheap model price ($0.50/1M)", () => { + expect(fmtPrice(0.5)).toBe("$0.50/1M") + }) + + it("formats a high-cost model price ($75/1M)", () => { + expect(fmtPrice(75)).toBe("$75.00/1M") + }) +}) diff --git a/packages/kilo-vscode/tests/unit/question-handler.test.ts b/packages/kilo-vscode/tests/unit/question-handler.test.ts new file mode 100644 index 00000000000..3353d6586a8 --- /dev/null +++ b/packages/kilo-vscode/tests/unit/question-handler.test.ts @@ -0,0 +1,104 @@ +import { describe, expect, it } from "bun:test" +import type { KiloClient } from "@kilocode/sdk/v2/client" +import { handleQuestionReject, handleQuestionReply } from "../../src/kilo-provider/handlers/question" + +describe("question handlers", () => { + it("routes replies using the question session when provided", async () => { + const calls: Array> = [] + const client = { + question: { + reply: async (input: Record) => { + calls.push(input) + return true + }, + reject: async () => true, + }, + } as unknown as KiloClient + + const ok = await handleQuestionReply( + { + client, + currentSessionId: "ses-root", + postMessage() {}, + getWorkspaceDirectory(sessionId) { + return sessionId ? `/repo/${sessionId}` : "/repo" + }, + }, + "req-1", + [["Start new session"]], + "ses-worktree", + ) + + expect(ok).toBe(true) + expect(calls).toEqual([ + { + requestID: "req-1", + answers: [["Start new session"]], + directory: "/repo/ses-worktree", + }, + ]) + }) + + it("falls back to the current session when no question session is provided", async () => { + const calls: Array> = [] + const client = { + question: { + reply: async (input: Record) => { + calls.push(input) + return true + }, + reject: async () => true, + }, + } as unknown as KiloClient + + const ok = await handleQuestionReply( + { + client, + currentSessionId: "ses-root", + postMessage() {}, + getWorkspaceDirectory(sessionId) { + return sessionId ? `/repo/${sessionId}` : "/repo" + }, + }, + "req-2", + [["Continue here"]], + ) + + expect(ok).toBe(true) + expect(calls[0]?.directory).toBe("/repo/ses-root") + }) + + it("routes rejects using the question session when provided", async () => { + const calls: Array> = [] + const client = { + question: { + reply: async () => true, + reject: async (input: Record) => { + calls.push(input) + return true + }, + }, + } as unknown as KiloClient + + const ok = await handleQuestionReject( + { + client, + currentSessionId: "ses-root", + postMessage() {}, + getWorkspaceDirectory(sessionId) { + return sessionId ? `/repo/${sessionId}` : "/repo" + }, + }, + "req-3", + "ses-worktree", + ) + + expect(ok).toBe(true) + expect(calls).toEqual([ + { + requestID: "req-3", + directory: "/repo/ses-worktree", + }, + ]) + }) +}) diff --git a/packages/kilo-vscode/tests/unit/session-status.test.ts b/packages/kilo-vscode/tests/unit/session-status.test.ts new file mode 100644 index 00000000000..62478587521 --- /dev/null +++ b/packages/kilo-vscode/tests/unit/session-status.test.ts @@ -0,0 +1,218 @@ +import { describe, it, expect } from "bun:test" +import { seedSessionStatuses, getBusySessionCount } from "../../src/session-status" +import type { SessionStatus } from "@kilocode/sdk/v2/client" + +/** + * Minimal fake client that satisfies the KiloClient.session.status() call. + * Returns controlled data or throws to simulate server errors. + */ +function createClient(response: { data: Record | null } | Error) { + return { + session: { + status: async (_params: { directory: string }) => { + if (response instanceof Error) throw response + return response + }, + }, + } as Parameters[0] +} + +function collect() { + const msgs: unknown[] = [] + return { msgs, post: (msg: unknown) => msgs.push(msg) } +} + +// --------------------------------------------------------------------------- +// seedSessionStatuses +// --------------------------------------------------------------------------- + +describe("seedSessionStatuses", () => { + it("seeds map and posts messages for non-idle sessions", async () => { + const client = createClient({ + data: { + s1: { type: "busy" }, + s2: { type: "retry", attempt: 3, message: "rate limited", next: 5000 }, + }, + }) + const map = new Map() + const { msgs, post } = collect() + + await seedSessionStatuses(client, "/repo", map, post) + + expect(map.get("s1")).toBe("busy") + expect(map.get("s2")).toBe("retry") + expect(msgs).toEqual([ + { type: "sessionStatus", sessionID: "s1", status: "busy" }, + { type: "sessionStatus", sessionID: "s2", status: "retry", attempt: 3, message: "rate limited", next: 5000 }, + ]) + }) + + // ---- THE BUG: stale entries not cleared on reconnect ---- + + it("clears stale busy entries absent from server response", async () => { + const client = createClient({ data: {} }) + const map = new Map([["s1", "busy"]]) + const { msgs, post } = collect() + + await seedSessionStatuses(client, "/repo", map, post) + + expect(map.get("s1")).toBe("idle") + expect(msgs).toEqual([{ type: "sessionStatus", sessionID: "s1", status: "idle" }]) + }) + + it("clears stale retry entries absent from server response", async () => { + const client = createClient({ data: {} }) + const map = new Map([["s1", "retry"]]) + const { msgs, post } = collect() + + await seedSessionStatuses(client, "/repo", map, post) + + expect(map.get("s1")).toBe("idle") + expect(msgs).toEqual([{ type: "sessionStatus", sessionID: "s1", status: "idle" }]) + }) + + it("preserves entries that server confirms as still active", async () => { + const client = createClient({ data: { s1: { type: "busy" } } }) + const map = new Map([["s1", "busy"]]) + const { msgs, post } = collect() + + await seedSessionStatuses(client, "/repo", map, post) + + expect(map.get("s1")).toBe("busy") + expect(msgs).toEqual([{ type: "sessionStatus", sessionID: "s1", status: "busy" }]) + }) + + it("does not send redundant idle for already-idle entries", async () => { + const client = createClient({ data: {} }) + const map = new Map([["s1", "idle"]]) + const { msgs, post } = collect() + + await seedSessionStatuses(client, "/repo", map, post) + + // Already idle — no message should be posted + expect(msgs).toEqual([]) + expect(map.get("s1")).toBe("idle") + }) + + it("handles mixed: some stale, some confirmed, some new", async () => { + const client = createClient({ + data: { + confirmed: { type: "busy" }, + fresh: { type: "busy" }, + }, + }) + const map = new Map([ + ["stale", "busy"], + ["confirmed", "retry"], + ]) + const { msgs, post } = collect() + + await seedSessionStatuses(client, "/repo", map, post) + + // stale: was busy locally, absent from server → idle + expect(map.get("stale")).toBe("idle") + // confirmed: was retry locally, server says busy → busy + expect(map.get("confirmed")).toBe("busy") + // fresh: new from server → busy + expect(map.get("fresh")).toBe("busy") + // Messages: server entries first (confirmed, fresh), then stale reconciliation + expect(msgs).toEqual([ + { type: "sessionStatus", sessionID: "confirmed", status: "busy" }, + { type: "sessionStatus", sessionID: "fresh", status: "busy" }, + { type: "sessionStatus", sessionID: "stale", status: "idle" }, + ]) + }) + + it("handles server error gracefully — no map changes", async () => { + const client = createClient(new Error("connection refused")) + const map = new Map([["s1", "busy"]]) + const { msgs, post } = collect() + + await seedSessionStatuses(client, "/repo", map, post) + + // Map unchanged on error — conservative behavior + expect(map.get("s1")).toBe("busy") + expect(msgs).toEqual([]) + }) + + it("handles null data response — no map changes", async () => { + const client = createClient({ data: null }) + const map = new Map([["s1", "busy"]]) + const { msgs, post } = collect() + + await seedSessionStatuses(client, "/repo", map, post) + + // Null data could mean a non-2xx response (401/500), not "no active sessions". + // Conservative: leave map unchanged to avoid false-clearing busy sessions. + expect(map.get("s1")).toBe("busy") + expect(msgs).toEqual([]) + }) + + // ---- reconcile=false (SSE reconnect) ---- + + it("skips reconciliation when reconcile=false", async () => { + const client = createClient({ data: {} }) + const map = new Map([["s1", "busy"]]) + const { msgs, post } = collect() + + await seedSessionStatuses(client, "/repo", map, post, false) + + // Session stays busy — reconciliation skipped on SSE reconnect + expect(map.get("s1")).toBe("busy") + expect(msgs).toEqual([]) + }) + + it("still seeds server entries when reconcile=false", async () => { + const client = createClient({ + data: { s1: { type: "busy" }, s2: { type: "retry", attempt: 1, message: "err", next: 1000 } }, + }) + const map = new Map() + const { msgs, post } = collect() + + await seedSessionStatuses(client, "/repo", map, post, false) + + expect(map.get("s1")).toBe("busy") + expect(map.get("s2")).toBe("retry") + expect(msgs).toEqual([ + { type: "sessionStatus", sessionID: "s1", status: "busy" }, + { type: "sessionStatus", sessionID: "s2", status: "retry", attempt: 1, message: "err", next: 1000 }, + ]) + }) + + it("does not reset stale entries when reconcile=false but updates confirmed ones", async () => { + const client = createClient({ data: { confirmed: { type: "busy" } } }) + const map = new Map([ + ["stale", "busy"], + ["confirmed", "retry"], + ]) + const { msgs, post } = collect() + + await seedSessionStatuses(client, "/repo", map, post, false) + + // stale: stays busy (no reconciliation) + expect(map.get("stale")).toBe("busy") + // confirmed: updated to busy from server + expect(map.get("confirmed")).toBe("busy") + expect(msgs).toEqual([{ type: "sessionStatus", sessionID: "confirmed", status: "busy" }]) + }) +}) + +// --------------------------------------------------------------------------- +// getBusySessionCount +// --------------------------------------------------------------------------- + +describe("getBusySessionCount", () => { + it("returns 0 for empty map", () => { + expect(getBusySessionCount(new Map())).toBe(0) + }) + + it("counts only busy entries, not idle or retry", () => { + const map = new Map([ + ["a", "busy"], + ["b", "idle"], + ["c", "retry"], + ["d", "busy"], + ]) + expect(getBusySessionCount(map)).toBe(2) + }) +}) diff --git a/packages/kilo-vscode/tests/unit/session-utils.test.ts b/packages/kilo-vscode/tests/unit/session-utils.test.ts index bd18a874ef7..07a873c08f9 100644 --- a/packages/kilo-vscode/tests/unit/session-utils.test.ts +++ b/packages/kilo-vscode/tests/unit/session-utils.test.ts @@ -1,5 +1,12 @@ import { describe, it, expect } from "bun:test" -import { computeStatus, calcTotalCost, calcContextUsage } from "../../webview-ui/src/context/session-utils" +import { + computeStatus, + calcTotalCost, + calcContextUsage, + buildFamilyCosts, + buildFamilyLabels, + buildCostBreakdown, +} from "../../webview-ui/src/context/session-utils" import type { Part } from "../../webview-ui/src/types/messages" const t = (key: string) => key @@ -125,3 +132,154 @@ describe("calcContextUsage", () => { expect(result.percentage).toBe(10) }) }) + +// ── Cost breakdown helpers ────────────────────────────────────────────── + +function msg(id: string, role: string, cost?: number) { + return { id, role, cost } +} + +function toolPart(tool: string, sessionId?: string, input?: { subagent_type?: string; description?: string }) { + return { + type: "tool" as const, + tool, + state: { + input: input ?? {}, + metadata: sessionId ? { sessionId } : {}, + }, + } +} + +describe("buildFamilyCosts", () => { + it("returns empty map for empty family", () => { + expect(buildFamilyCosts(new Set(), {}).size).toBe(0) + }) + + it("sums costs per session, skipping zero-cost sessions", () => { + const family = new Set(["s1", "s2", "s3"]) + const messages = { + s1: [msg("m1", "assistant", 0.05), msg("m2", "assistant", 0.03)], + s2: [msg("m3", "user", 999), msg("m4", "assistant", 0)], + s3: [msg("m5", "assistant", 0.1)], + } + const costs = buildFamilyCosts(family, messages) + expect(costs.size).toBe(2) + expect(costs.get("s1")).toBeCloseTo(0.08) + expect(costs.has("s2")).toBe(false) + expect(costs.get("s3")).toBeCloseTo(0.1) + }) + + it("handles missing messages for a family member", () => { + const family = new Set(["s1", "s2"]) + const messages = { s1: [msg("m1", "assistant", 0.01)] } + const costs = buildFamilyCosts(family, messages) + expect(costs.size).toBe(1) + expect(costs.get("s1")).toBeCloseTo(0.01) + }) +}) + +describe("buildFamilyLabels", () => { + it("returns empty map when no task tool parts exist", () => { + const family = new Set(["s1"]) + const messages = { s1: [msg("m1", "assistant")] } + const parts = { m1: [{ type: "text" }] } + expect(buildFamilyLabels(family, messages as any, parts as any).size).toBe(0) + }) + + it("extracts label from subagent_type", () => { + const family = new Set(["s1", "child1"]) + const messages = { s1: [msg("m1", "assistant")] } + const parts = { + m1: [toolPart("task", "child1", { subagent_type: "explore" })], + } + const labels = buildFamilyLabels(family, messages as any, parts as any) + expect(labels.get("child1")).toBe("explore") + }) + + it("falls back to description when subagent_type is absent", () => { + const family = new Set(["s1", "child1"]) + const messages = { s1: [msg("m1", "assistant")] } + const parts = { + m1: [toolPart("task", "child1", { description: "Fix the bug" })], + } + const labels = buildFamilyLabels(family, messages as any, parts as any) + expect(labels.get("child1")).toBe("Fix the bug") + }) + + it("falls back to tool name when no input fields", () => { + const family = new Set(["s1", "child1"]) + const messages = { s1: [msg("m1", "assistant")] } + const parts = { + m1: [toolPart("task", "child1")], + } + const labels = buildFamilyLabels(family, messages as any, parts as any) + expect(labels.get("child1")).toBe("task") + }) + + it("truncates labels longer than 24 chars", () => { + const family = new Set(["s1", "child1"]) + const messages = { s1: [msg("m1", "assistant")] } + const parts = { + m1: [toolPart("task", "child1", { description: "A very long description that exceeds the cap" })], + } + const labels = buildFamilyLabels(family, messages as any, parts as any) + const label = labels.get("child1")! + expect(label.length).toBeLessThanOrEqual(24) + expect(label.endsWith("…")).toBe(true) + }) + + it("ignores child sessions not in the family set", () => { + const family = new Set(["s1"]) + const messages = { s1: [msg("m1", "assistant")] } + const parts = { + m1: [toolPart("task", "orphan", { subagent_type: "general" })], + } + const labels = buildFamilyLabels(family, messages as any, parts as any) + expect(labels.size).toBe(0) + }) + + it("uses first label when multiple parts reference same child", () => { + const family = new Set(["s1", "child1"]) + const messages = { s1: [msg("m1", "assistant"), msg("m2", "assistant")] } + const parts = { + m1: [toolPart("task", "child1", { subagent_type: "first" })], + m2: [toolPart("task", "child1", { subagent_type: "second" })], + } + const labels = buildFamilyLabels(family, messages as any, parts as any) + expect(labels.get("child1")).toBe("first") + }) +}) + +describe("buildCostBreakdown", () => { + it("returns empty array for empty costs", () => { + expect(buildCostBreakdown("s1", new Map(), new Map(), "This session")).toEqual([]) + }) + + it("labels root session with the provided rootLabel", () => { + const costs = new Map([["s1", 0.05]]) + const result = buildCostBreakdown("s1", costs, new Map(), "This session") + expect(result).toEqual([{ label: "This session", cost: 0.05 }]) + }) + + it("labels child sessions from the labels map", () => { + const costs = new Map([ + ["s1", 0.05], + ["child1", 0.03], + ]) + const labels = new Map([["child1", "explore"]]) + const result = buildCostBreakdown("s1", costs, labels, "This session") + expect(result).toEqual([ + { label: "This session", cost: 0.05 }, + { label: "explore", cost: 0.03 }, + ]) + }) + + it("falls back to truncated session ID for unlabeled children", () => { + const costs = new Map([ + ["s1", 0.05], + ["abcdef1234567890", 0.02], + ]) + const result = buildCostBreakdown("s1", costs, new Map(), "This session") + expect(result[1].label).toBe("abcdef12") + }) +}) diff --git a/packages/kilo-vscode/tests/unit/settings-io.test.ts b/packages/kilo-vscode/tests/unit/settings-io.test.ts new file mode 100644 index 00000000000..142f1e82ad1 --- /dev/null +++ b/packages/kilo-vscode/tests/unit/settings-io.test.ts @@ -0,0 +1,397 @@ +import { describe, it, expect } from "bun:test" +import { + buildExport, + parseImport, + mergeConfig, + MAX_IMPORT_SIZE, + KNOWN_KEYS, + META_VERSION, +} from "../../webview-ui/src/components/settings/settings-io" +import type { Config } from "../../webview-ui/src/types/messages" + +// --------------------------------------------------------------------------- +// buildExport +// --------------------------------------------------------------------------- +describe("buildExport", () => { + it("wraps config in _meta envelope", () => { + const cfg: Config = { model: "anthropic/claude-sonnet-4-20250514" } + const result = buildExport(cfg) + expect(result._meta).toBeDefined() + expect(result._meta.version).toBe(META_VERSION) + expect(typeof result._meta.exportedAt).toBe("string") + expect(result.model).toBe("anthropic/claude-sonnet-4-20250514") + }) + + it("preserves provider fields including secrets", () => { + const cfg: Config = { + provider: { + openai: { name: "OpenAI", api_key: "sk-secret-123" }, + custom: { name: "Custom", options: { apiKey: "secret", baseURL: "https://example.com" } }, + }, + } + const result = buildExport(cfg) + expect(result.provider.openai.api_key).toBe("sk-secret-123") + expect(result.provider.openai.name).toBe("OpenAI") + expect(result.provider.custom.options.apiKey).toBe("secret") + expect(result.provider.custom.options.baseURL).toBe("https://example.com") + }) + + it("preserves mcp fields including env and headers", () => { + const cfg: Config = { + mcp: { + github: { + type: "local" as const, + command: "npx", + env: { GITHUB_TOKEN: "ghp_secret123" }, + enabled: true, + }, + server: { + type: "local" as const, + command: "node", + environment: { SECRET: "val" }, + }, + remote: { + type: "remote" as const, + url: "https://mcp.example.com", + headers: { Authorization: "Bearer secret-token" }, + enabled: true, + }, + }, + } + const result = buildExport(cfg) + expect(result.mcp.github.env.GITHUB_TOKEN).toBe("ghp_secret123") + expect(result.mcp.github.command).toBe("npx") + expect(result.mcp.server.environment.SECRET).toBe("val") + expect(result.mcp.remote.headers.Authorization).toBe("Bearer secret-token") + expect(result.mcp.remote.url).toBe("https://mcp.example.com") + }) + + it("preserves all config fields", () => { + const cfg: Config = { + model: "test-model", + small_model: "test-small", + default_agent: "coder", + agent: { coder: { mode: "primary", prompt: "Code stuff" } }, + permission: { read: "allow" }, + instructions: ["rule1.md"], + snapshot: true, + share: "manual", + } + const result = buildExport(cfg) + expect(result.model).toBe("test-model") + expect(result.small_model).toBe("test-small") + expect(result.default_agent).toBe("coder") + expect(result.agent).toEqual({ coder: { mode: "primary", prompt: "Code stuff" } }) + expect(result.permission).toEqual({ read: "allow" }) + expect(result.instructions).toEqual(["rule1.md"]) + expect(result.snapshot).toBe(true) + expect(result.share).toBe("manual") + }) + + it("handles empty config", () => { + const result = buildExport({}) + expect(result._meta).toBeDefined() + expect(Object.keys(result).length).toBe(1) // only _meta + }) + + it("handles config with no providers or mcp", () => { + const cfg: Config = { model: "test" } + const result = buildExport(cfg) + expect(result.model).toBe("test") + expect(result.provider).toBeUndefined() + expect(result.mcp).toBeUndefined() + }) +}) + +// --------------------------------------------------------------------------- +// parseImport +// --------------------------------------------------------------------------- +describe("parseImport", () => { + it("rejects non-JSON", () => { + const result = parseImport("not json at all") + expect(result.ok).toBe(false) + if (!result.ok) expect(result.error).toBe("invalidJson") + }) + + it("rejects JSON null", () => { + const result = parseImport("null") + expect(result.ok).toBe(false) + if (!result.ok) expect(result.error).toBe("invalidJson") + }) + + it("rejects JSON array", () => { + const result = parseImport("[]") + expect(result.ok).toBe(false) + if (!result.ok) expect(result.error).toBe("invalidJson") + }) + + it("rejects JSON string", () => { + const result = parseImport('"hello"') + expect(result.ok).toBe(false) + if (!result.ok) expect(result.error).toBe("invalidJson") + }) + + it("rejects JSON number", () => { + const result = parseImport("42") + expect(result.ok).toBe(false) + if (!result.ok) expect(result.error).toBe("invalidJson") + }) + + it("rejects empty object (no known keys)", () => { + const result = parseImport("{}") + expect(result.ok).toBe(false) + if (!result.ok) expect(result.error).toBe("invalidConfig") + }) + + it("rejects object with only unknown keys", () => { + const result = parseImport(JSON.stringify({ foo: "bar", baz: 42 })) + expect(result.ok).toBe(false) + if (!result.ok) expect(result.error).toBe("invalidConfig") + }) + + it("accepts valid partial config (just agent)", () => { + const json = JSON.stringify({ + agent: { coder: { mode: "primary", prompt: "Code things" } }, + }) + const result = parseImport(json) + expect(result.ok).toBe(true) + if (result.ok) { + expect(result.config.agent).toEqual({ coder: { mode: "primary", prompt: "Code things" } }) + } + }) + + it("accepts valid partial config (just model)", () => { + const json = JSON.stringify({ model: "test-model" }) + const result = parseImport(json) + expect(result.ok).toBe(true) + if (result.ok) expect(result.config.model).toBe("test-model") + }) + + it("strips _meta before returning config", () => { + const json = JSON.stringify({ + _meta: { version: 1, exportedAt: "2026-01-01", secretsStripped: true }, + model: "test", + }) + const result = parseImport(json) + expect(result.ok).toBe(true) + if (result.ok) { + expect((result.config as Record)._meta).toBeUndefined() + expect(result.config.model).toBe("test") + } + }) + + it("strips unknown top-level keys", () => { + const json = JSON.stringify({ + model: "test", + unknownField: "should be stripped", + anotherUnknown: 42, + }) + const result = parseImport(json) + expect(result.ok).toBe(true) + if (result.ok) { + expect(result.config.model).toBe("test") + expect((result.config as Record).unknownField).toBeUndefined() + expect((result.config as Record).anotherUnknown).toBeUndefined() + } + }) + + it("returns warning when _meta.version > current", () => { + const json = JSON.stringify({ + _meta: { version: 999 }, + model: "test", + }) + const result = parseImport(json) + expect(result.ok).toBe(true) + if (result.ok) { + expect(result.warning).toBe("newerVersion") + } + }) + + it("returns no warning when _meta.version <= current", () => { + const json = JSON.stringify({ + _meta: { version: META_VERSION }, + model: "test", + }) + const result = parseImport(json) + expect(result.ok).toBe(true) + if (result.ok) { + expect(result.warning).toBeUndefined() + } + }) + + it("returns no warning when _meta is absent", () => { + const json = JSON.stringify({ model: "test" }) + const result = parseImport(json) + expect(result.ok).toBe(true) + if (result.ok) { + expect(result.warning).toBeUndefined() + } + }) + + it("accepts config with all known keys", () => { + const cfg: Record = {} + for (const key of KNOWN_KEYS) { + cfg[key] = key === "instructions" ? ["rule.md"] : key === "snapshot" ? true : "value" + } + const json = JSON.stringify(cfg) + const result = parseImport(json) + expect(result.ok).toBe(true) + }) + + it("preserves provider and mcp fields as-is (including secrets on import)", () => { + const json = JSON.stringify({ + provider: { openai: { name: "OpenAI", api_key: "sk-123" } }, + mcp: { gh: { command: "npx", env: { TOKEN: "secret" } } }, + }) + const result = parseImport(json) + expect(result.ok).toBe(true) + if (result.ok) { + expect(result.config.provider?.openai?.api_key).toBe("sk-123") + expect(result.config.mcp?.gh?.env?.TOKEN).toBe("secret") + } + }) +}) + +// --------------------------------------------------------------------------- +// mergeConfig +// --------------------------------------------------------------------------- +describe("mergeConfig", () => { + it("merges imported agents with existing agents", () => { + const existing: Config = { + agent: { + coder: { mode: "primary", prompt: "Code" }, + reviewer: { mode: "primary", prompt: "Review" }, + }, + } + const imported: Config = { + agent: { + reviewer: { mode: "primary", prompt: "Updated review" }, + planner: { mode: "primary", prompt: "Plan" }, + }, + } + const result = mergeConfig(existing, imported) + expect(result.agent?.coder?.prompt).toBe("Code") + expect(result.agent?.reviewer?.prompt).toBe("Updated review") + expect(result.agent?.planner?.prompt).toBe("Plan") + }) + + it("imported values override existing for same keys", () => { + const existing: Config = { model: "old-model", default_agent: "coder" } + const imported: Config = { model: "new-model" } + const result = mergeConfig(existing, imported) + expect(result.model).toBe("new-model") + expect(result.default_agent).toBe("coder") + }) + + it("existing values not in import are preserved", () => { + const existing: Config = { + model: "test", + permission: { read: "allow" }, + instructions: ["old.md"], + } + const imported: Config = { model: "updated" } + const result = mergeConfig(existing, imported) + expect(result.model).toBe("updated") + expect(result.permission).toEqual({ read: "allow" }) + expect(result.instructions).toEqual(["old.md"]) + }) + + it("merges providers without losing existing ones", () => { + const existing: Config = { + provider: { + openai: { name: "OpenAI", api_key: "sk-existing" }, + anthropic: { name: "Anthropic", api_key: "sk-ant" }, + }, + } + const imported: Config = { + provider: { + openai: { name: "OpenAI Updated", base_url: "https://new.api" }, + }, + } + const result = mergeConfig(existing, imported) + expect(result.provider?.openai?.name).toBe("OpenAI Updated") + expect(result.provider?.openai?.base_url).toBe("https://new.api") + expect(result.provider?.anthropic?.name).toBe("Anthropic") + expect(result.provider?.anthropic?.api_key).toBe("sk-ant") + }) + + it("handles empty existing config", () => { + const imported: Config = { model: "test", agent: { coder: { mode: "primary" } } } + const result = mergeConfig({}, imported) + expect(result.model).toBe("test") + expect(result.agent?.coder?.mode).toBe("primary") + }) + + it("handles empty imported config", () => { + const existing: Config = { model: "test" } + const result = mergeConfig(existing, {}) + expect(result.model).toBe("test") + }) +}) + +// --------------------------------------------------------------------------- +// Round-trip +// --------------------------------------------------------------------------- +describe("round-trip", () => { + it("export then import preserves all fields including secrets", () => { + const original: Config = { + model: "test-model", + agent: { coder: { mode: "primary", prompt: "Code" } }, + provider: { openai: { name: "OpenAI", api_key: "sk-secret" } }, + mcp: { gh: { command: "npx", env: { TOKEN: "secret" } } }, + permission: { read: "allow" }, + instructions: ["rules.md"], + } + const exported = buildExport(original) + const json = JSON.stringify(exported) + const result = parseImport(json) + expect(result.ok).toBe(true) + if (result.ok) { + expect(result.config.model).toBe("test-model") + expect(result.config.agent).toEqual({ coder: { mode: "primary", prompt: "Code" } }) + expect(result.config.provider?.openai?.name).toBe("OpenAI") + expect(result.config.provider?.openai?.api_key).toBe("sk-secret") + expect(result.config.mcp?.gh?.command).toBe("npx") + expect(result.config.mcp?.gh?.env?.TOKEN).toBe("secret") + expect(result.config.permission).toEqual({ read: "allow" }) + expect(result.config.instructions).toEqual(["rules.md"]) + } + }) +}) + +// --------------------------------------------------------------------------- +// Constants +// --------------------------------------------------------------------------- +describe("constants", () => { + it("MAX_IMPORT_SIZE is 1 MB", () => { + expect(MAX_IMPORT_SIZE).toBe(1_048_576) + }) + + it("META_VERSION is 1", () => { + expect(META_VERSION).toBe(1) + }) + + it("KNOWN_KEYS includes core config keys", () => { + expect(KNOWN_KEYS).toContain("agent") + expect(KNOWN_KEYS).toContain("provider") + expect(KNOWN_KEYS).toContain("mcp") + expect(KNOWN_KEYS).toContain("permission") + expect(KNOWN_KEYS).toContain("model") + expect(KNOWN_KEYS).toContain("instructions") + }) + + it("KNOWN_KEYS matches all keys in the Config interface (drift guard)", async () => { + // Read the Config interface from messages.ts and extract its keys. + // If someone adds a new field to Config, this test fails as a reminder + // to also add it to KNOWN_KEYS in settings-io.ts. + const src = await Bun.file(require("path").join(__dirname, "../../webview-ui/src/types/messages.ts")).text() + const match = src.match(/export interface Config \{([^}]+)\}/) + expect(match).not.toBeNull() + const body = match![1] + const keys = [...body.matchAll(/^\s+(\w+)\??:/gm)].map((m) => m[1]) + expect(keys.length).toBeGreaterThan(0) + + const sorted = (arr: readonly string[]) => [...arr].sort() + expect(sorted(KNOWN_KEYS)).toEqual(sorted(keys)) + }) +}) diff --git a/packages/kilo-vscode/tests/unit/worktree-state-manager.test.ts b/packages/kilo-vscode/tests/unit/worktree-state-manager.test.ts index 8e0a18a7066..5b0c2af1be2 100644 --- a/packages/kilo-vscode/tests/unit/worktree-state-manager.test.ts +++ b/packages/kilo-vscode/tests/unit/worktree-state-manager.test.ts @@ -548,9 +548,8 @@ describe("WorktreeStateManager", () => { await manager.load() - // path.sep is / on unix, \ on windows — the rewrite uses path.sep - const expected = `C:${path.sep}.kilo${path.sep}worktrees\\fix` - expect(manager.getWorktrees()[0].path).toBe(expected) + // Separator style from the stored path is preserved (backslashes stay as backslashes) + expect(manager.getWorktrees()[0].path).toBe("C:\\.kilo\\worktrees\\fix") }) }) }) diff --git a/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/chat/welcome-with-switcher-and-notification-chromium-linux.png b/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/chat/welcome-with-switcher-and-notification-chromium-linux.png index b7c12d607a5..38729c2837b 100644 --- a/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/chat/welcome-with-switcher-and-notification-chromium-linux.png +++ b/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/chat/welcome-with-switcher-and-notification-chromium-linux.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:31bf6a6c046503a150ec6e49eae627411af10da26c17c7c5c455bb3c74198bc5 -size 27697 +oid sha256:bffa5ba48085a9df0245c2067dc316d2574b974a0d107c0ec64f1bfb051c98e7 +size 27621 diff --git a/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/settings/agent-behaviour-agents-chromium-linux.png b/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/settings/agent-behaviour-agents-chromium-linux.png index b4a57e37a4a..795674c1ad6 100644 --- a/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/settings/agent-behaviour-agents-chromium-linux.png +++ b/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/settings/agent-behaviour-agents-chromium-linux.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:41df17f60c5361a230839c07a9bd29d9dbf645a9750db6fa00e37c0bd06eff11 -size 25424 +oid sha256:8e9f04f72f6227b08bff321ab4af7a794fa754dc58bd504eb88259cd244ba51b +size 27146 diff --git a/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/settings/mcp-edit-view-local-chromium-linux.png b/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/settings/mcp-edit-view-local-chromium-linux.png new file mode 100644 index 00000000000..6a0acb42d64 --- /dev/null +++ b/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/settings/mcp-edit-view-local-chromium-linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31d595b148c5efa68c023eff922e1eedf15b2d4e8af91efc18c99b7830238999 +size 26230 diff --git a/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/settings/mcp-edit-view-local-with-env-chromium-linux.png b/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/settings/mcp-edit-view-local-with-env-chromium-linux.png new file mode 100644 index 00000000000..8f6bf7613d5 --- /dev/null +++ b/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/settings/mcp-edit-view-local-with-env-chromium-linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:220e3129994f8cb0cb0ead6fc51b9965e0e9cd2ed24269f1a65d065bea4c9d92 +size 26970 diff --git a/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/settings/mcp-edit-view-remote-chromium-linux.png b/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/settings/mcp-edit-view-remote-chromium-linux.png new file mode 100644 index 00000000000..40f6ee9d981 --- /dev/null +++ b/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/settings/mcp-edit-view-remote-chromium-linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f90ee0aa1073be693836469cfd63e1bb3a2f55edcdc964dae1f68b73b12fc367 +size 12016 diff --git a/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/settings/mode-edit-export-chromium-linux.png b/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/settings/mode-edit-export-chromium-linux.png new file mode 100644 index 00000000000..f7c6fb041c5 --- /dev/null +++ b/packages/kilo-vscode/tests/visual-regression.spec.ts-snapshots/settings/mode-edit-export-chromium-linux.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4dcc9ddf87e9c5b6e5cf736bfa5d42005020d14e2bb6fe7cd99a82a149db3e5c +size 37073 diff --git a/packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx b/packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx index 08917a8ecc4..d26b0cf7cb1 100644 --- a/packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx +++ b/packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx @@ -1084,20 +1084,24 @@ const AgentManagerContent: Component = () => { } window.addEventListener("focus", onWindowFocus) - // When a session is created while on local, replace the current pending tab with the real session. - // Guard against duplicate sessionCreated events (HTTP response + SSE can both fire). + // When a session is created, add it as a local tab. This handles both direct + // creation from the prompt input and backend-created follow-up sessions (plan + // follow-up "Start new session"). Guard against duplicates (HTTP + SSE can both fire). const unsubCreate = vscode.onMessage((msg) => { - if (msg.type === "sessionCreated" && selection() === LOCAL) { - const created = msg as { type: string; session: { id: string } } - if (localSessionIDs().includes(created.session.id)) return - const pending = activePendingId() - if (pending) { - setLocalSessionIDs((prev) => prev.map((id) => (id === pending ? created.session.id : id))) - setActivePendingId(undefined) - } else { - setLocalSessionIDs((prev) => [...prev, created.session.id]) - } + if (msg.type !== "sessionCreated") return + const created = msg as { type: string; session: { id: string } } + if (localSessionIDs().includes(created.session.id)) return + if (worktreeSessionIds().has(created.session.id)) return + const pending = selection() === LOCAL ? activePendingId() : undefined + if (pending) { + setLocalSessionIDs((prev) => prev.map((id) => (id === pending ? created.session.id : id))) + setActivePendingId(undefined) + } else { + saveTabMemory() + setLocalSessionIDs((prev) => [...prev, created.session.id]) + setSelection(LOCAL) } + session.selectSession(created.session.id) }) // Mark sessions loaded as soon as the session context receives data (even if empty) @@ -1157,6 +1161,8 @@ const AgentManagerContent: Component = () => { if (msg.type === "agentManager.sessionAdded") { const ev = msg as { type: string; sessionId: string; worktreeId: string } + saveTabMemory() + setSelection(ev.worktreeId) session.selectSession(ev.sessionId) } diff --git a/packages/kilo-vscode/webview-ui/agent-manager/DiffPanel.tsx b/packages/kilo-vscode/webview-ui/agent-manager/DiffPanel.tsx index 96963fac288..3c00d20d5cd 100644 --- a/packages/kilo-vscode/webview-ui/agent-manager/DiffPanel.tsx +++ b/packages/kilo-vscode/webview-ui/agent-manager/DiffPanel.tsx @@ -22,6 +22,7 @@ import { } from "./review-annotations" import { LONG_DIFF_MARKER_FILE_COUNT, initialOpenFiles, isLargeDiffFile } from "./diff-open-policy" import { DiffEndMarker } from "./DiffEndMarker" +import { treeOrder } from "./file-tree-utils" // --- Data model --- @@ -67,6 +68,10 @@ export const DiffPanel: Component = (props) => { // only pruning happens so the user's manual collapse state is preserved. let initializedKey: string | undefined + // Reorder diffs to match the file-tree's depth-first visual order so + // scrolling through the accordion matches the tree grouping. + const sorted = createMemo(() => treeOrder(props.diffs)) + const comments = () => props.comments const setComments = (next: ReviewComment[]) => props.onCommentsChange(next) const updateComments = (updater: (prev: ReviewComment[]) => ReviewComment[]) => setComments(updater(comments())) @@ -380,7 +385,7 @@ export const DiffPanel: Component = (props) => { 0}>
- + {(diff) => { const isAdded = () => diff.status === "added" const isDeleted = () => diff.status === "deleted" diff --git a/packages/kilo-vscode/webview-ui/agent-manager/FullScreenDiffView.tsx b/packages/kilo-vscode/webview-ui/agent-manager/FullScreenDiffView.tsx index 03344ca8a11..041b1fbf142 100644 --- a/packages/kilo-vscode/webview-ui/agent-manager/FullScreenDiffView.tsx +++ b/packages/kilo-vscode/webview-ui/agent-manager/FullScreenDiffView.tsx @@ -15,6 +15,7 @@ import type { DiffLineAnnotation, AnnotationSide, SelectedLineRange } from "@pie import type { WorktreeFileDiff } from "../src/types/messages" import { useLanguage } from "../src/context/language" import { FileTree } from "./FileTree" +import { treeOrder } from "./file-tree-utils" import { getDirectory, getFilename, lineCount, sanitizeReviewComments, type ReviewComment } from "./review-comments" import { buildFileAnnotations, @@ -74,6 +75,10 @@ export const FullScreenDiffView: Component = (props) => let scrollRef: HTMLDivElement | undefined let syncFrame: number | undefined + // Reorder diffs to match the file-tree's depth-first visual order so + // scrolling through the diff panel matches the tree on the left. + const sorted = createMemo(() => treeOrder(props.diffs)) + const comments = () => props.comments const setComments = (next: ReviewComment[]) => props.onCommentsChange(next) const updateComments = (updater: (prev: ReviewComment[]) => ReviewComment[]) => setComments(updater(comments())) @@ -481,7 +486,7 @@ export const FullScreenDiffView: Component = (props) => 0}>
- + {(diff) => { const isAdded = () => diff.status === "added" const isDeleted = () => diff.status === "deleted" diff --git a/packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx b/packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx index eef2a0a4031..18a62cdeb4e 100644 --- a/packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx +++ b/packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx @@ -515,7 +515,8 @@ export const NewWorktreeDialog: Component<{ onClose: () => void; defaultBaseBran { + const aDir = a.children ? 0 : 1 + const bDir = b.children ? 0 : 1 + if (aDir !== bDir) return aDir - bDir + return a.name.localeCompare(b.name) + }) + for (const node of nodes) { + if (node.children) sortTree(node.children) + } +} + // Flatten single-child directory chains: src/components/ instead of src > components export function flatten(nodes: FileTreeNode[]): FileTreeNode[] { return nodes.map((node) => { @@ -51,3 +65,18 @@ export function flattenChain(node: FileTreeNode): FileTreeNode { if (!child.children) return node return flattenChain({ name: `${node.name}/${child.name}`, path: child.path, children: child.children }) } + +/** Return diffs sorted to match the tree's depth-first visual order. */ +export function treeOrder(diffs: WorktreeFileDiff[]): WorktreeFileDiff[] { + if (diffs.length <= 1) return diffs + const tree = buildFileTree(diffs) + const result: WorktreeFileDiff[] = [] + function walk(nodes: FileTreeNode[]) { + for (const node of nodes) { + if (node.diff) result.push(node.diff) + if (node.children) walk(node.children) + } + } + walk(tree) + return result +} diff --git a/packages/kilo-vscode/webview-ui/agent-manager/i18n/uk.ts b/packages/kilo-vscode/webview-ui/agent-manager/i18n/uk.ts new file mode 100644 index 00000000000..ae8f2cd143f --- /dev/null +++ b/packages/kilo-vscode/webview-ui/agent-manager/i18n/uk.ts @@ -0,0 +1,173 @@ +export const dict = { + "agentManager.local": "локальний", + "agentManager.section.worktrees": "РОБОЧІ ДЕРЕВА", + "agentManager.section.sessions": "СЕСІЇ", + "agentManager.notGitRepo": "Не є git-репозиторієм", + + "agentManager.worktree.settings": "Налаштування робочого дерева", + "agentManager.worktree.new": "Нове робоче дерево", + "agentManager.worktree.setupScript": "Скрипт налаштування робочого дерева", + "agentManager.worktree.delete": "Видалити робоче дерево", + "agentManager.worktree.confirmDelete": "Видалити?", + "agentManager.worktree.stale": "Застаріле", + "agentManager.worktree.staleTooltip": "Відсутнє на диску або більше не відстежується як робоче дерево Git", + "agentManager.worktree.removeStale": "Видалити застаріле робоче дерево", + "agentManager.worktree.doubleClickRename": "Двічі клацніть для перейменування", + "agentManager.worktree.versions": "{{count}} версій", + "agentManager.worktree.advancedOptions": "Розширені параметри робочого дерева", + "agentManager.worktree.defaultBaseBranch": "Гілка за замовчуванням", + "agentManager.worktree.defaultBaseBranchAuto": "Автоматичне визначення", + "agentManager.worktree.copyPath": "Копіювати шлях", + "agentManager.worktree.openInVscode": "Відкрити у VS Code", + "agentManager.worktree.rename": "Перейменувати", + + "agentManager.hoverCard.branch": "ГІЛКА", + "agentManager.hoverCard.base": "База", + "agentManager.hoverCard.sessions": "Сесії", + "agentManager.hoverCard.files": "Файли", + "agentManager.hoverCard.changes": "Зміни", + "agentManager.hoverCard.commits": "Коміти", + + "agentManager.session.new": "Нова сесія", + "agentManager.session.untitled": "Без назви", + "agentManager.session.newSession": "Нова сесія", + "agentManager.session.openInWorktree": "Відкрити у робочому дереві", + "agentManager.session.openLocally": "Відкрити локально", + "agentManager.session.readonly": "Сесія лише для читання", + "agentManager.session.noSessions": "Немає відкритих сесій", + + "agentManager.tab.close": "Закрити", + "agentManager.tab.closeTab": "Закрити вкладку", + "agentManager.tab.forkSession": "Розгалужити сесію", + "agentManager.tab.terminal": "Термінал", + "agentManager.tab.openTerminal": "Відкрити термінал", + + "agentManager.setup.failed": "Налаштування робочого дерева не вдалося", + "agentManager.setup.settingUp": "Налаштування робочого дерева", + "agentManager.setup.error.git_not_found": + "Git не встановлено або не знайдено в PATH. Будь ласка, встановіть Git і перезапустіть VS Code.", + "agentManager.setup.error.not_git_repo": + "Відкрийте папку, що містить git-репозиторій, щоб використовувати робочі дерева.", + "agentManager.setup.error.lfs_missing": + "Цей репозиторій використовує Git LFS, але git-lfs не знайдено. Будь ласка, встановіть Git LFS.", + "agentManager.shortcuts.title": "Клавіатурні скорочення", + "agentManager.shortcuts.category.sidebar": "Бічна панель", + "agentManager.shortcuts.category.tabs": "Вкладки", + "agentManager.shortcuts.category.terminal": "Термінал", + "agentManager.shortcuts.category.global": "Глобальні", + "agentManager.shortcuts.previousItem": "Попередній елемент", + "agentManager.shortcuts.nextItem": "Наступний елемент", + "agentManager.shortcuts.newWorktree": "Нове робоче дерево", + "agentManager.shortcuts.openWorktree": "Відкрити робоче дерево", + "agentManager.shortcuts.advancedWorktree": "Розширене робоче дерево", + "agentManager.shortcuts.deleteWorktree": "Видалити робоче дерево", + "agentManager.shortcuts.previousTab": "Попередня вкладка", + "agentManager.shortcuts.nextTab": "Наступна вкладка", + "agentManager.shortcuts.newTab": "Нова вкладка", + "agentManager.shortcuts.closeTab": "Закрити вкладку", + "agentManager.shortcuts.toggleTerminal": "Перемкнути термінал", + "agentManager.shortcuts.openAgentManager": "Відкрити Agent Manager", + "agentManager.shortcuts.cycleAgentMode": "Наступний режим агента", + "agentManager.shortcuts.cyclePreviousAgentMode": "Попередній режим агента", + "agentManager.shortcuts.showShortcuts": "Показати клавіатурні скорочення", + + "agentManager.dialog.removeStaleWorktree.title": "Видалити застаріле робоче дерево", + "agentManager.dialog.removeStaleWorktree.messagePre": "Видалити застаріле робоче дерево ", + "agentManager.dialog.removeStaleWorktree.messagePost": + "? Це лише видалить відображення в Agent Manager і не торкнеться файлів на диску.", + "agentManager.dialog.removeStaleWorktree.cancel": "Скасувати", + "agentManager.dialog.removeStaleWorktree.confirm": "Видалити застаріле робоче дерево", + + "agentManager.dialog.openWorktree": "Нове робоче дерево", + "agentManager.dialog.tab.new": "Нове", + "agentManager.dialog.tab.import": "Імпортувати", + "agentManager.dialog.namePlaceholder": "Назва робочого дерева (необов'язково)", + "agentManager.dialog.promptPlaceholder.mac": "Введіть повідомлення (\u2318Enter для надсилання)", + "agentManager.dialog.promptPlaceholder.other": "Введіть повідомлення (Ctrl+Enter для надсилання)", + "agentManager.dialog.advancedOptions": "Розширені параметри", + "agentManager.dialog.branchName": "Назва гілки", + "agentManager.dialog.branchNamePlaceholder": "автоматично згенерована", + "agentManager.dialog.baseBranch": "Базова гілка", + "agentManager.dialog.searchBranches": "Пошук гілок...", + "agentManager.dialog.branchBadge.default": "за замовчуванням", + "agentManager.dialog.branchBadge.remote": "віддалена", + "agentManager.dialog.versions": "Версії", + "agentManager.dialog.versionHint": "{{count}} робочих дерев виконуватимуться паралельно", + "agentManager.dialog.compareModels": "Порівняти моделі", + "agentManager.dialog.compareModels.tooltip": + "Запустіть агентів на різних моделях паралельно для порівняння результатів", + "agentManager.dialog.compareModels.searchModels": "Пошук моделей...", + "agentManager.dialog.compareModels.selectModels": "Оберіть моделі...", + "agentManager.dialog.creating": "Створення...", + "agentManager.dialog.createWorktree": "Створити робоче дерево", + "agentManager.dialog.removeImage": "Видалити зображення", + "agentManager.dialog.advanced": "Розширено...", + + "agentManager.diff.toggle": "Показати або приховати diff", + "agentManager.diff.openFile": "Відкрити файл", + "agentManager.open.button": "Відкрити", + "agentManager.open.tooltip": "Відкрити це робоче дерево у VS Code", + "agentManager.apply.button": "Застосувати локально", + "agentManager.apply.globalButton": "Застосувати", + "agentManager.apply.tooltip": "Застосувати вибрані зміни робочого дерева до локальної гілки", + "agentManager.apply.dialogTitle": "Застосувати зміни до локальної гілки", + "agentManager.apply.confirm": "Застосувати зараз", + "agentManager.apply.retry": "Повторити застосування", + "agentManager.apply.previewTitle": "Застосувати ці зміни до локальної гілки?", + "agentManager.apply.previewSummary": "{{files}} файлів, +{{additions}} -{{deletions}}", + "agentManager.apply.selectionSummary": "{{selected}} з {{total}} файлів вибрано", + "agentManager.apply.selectAll": "Вибрати все", + "agentManager.apply.selectNone": "Зняти вибір", + "agentManager.apply.moreFiles": "+{{count}} ще", + "agentManager.apply.moreReasons": "{{reason}} (+{{count}} ще)", + "agentManager.apply.checking": "Перевірка...", + "agentManager.apply.applying": "Застосування...", + "agentManager.apply.success": "Зміни застосовано", + "agentManager.apply.conflict": "Під час застосування виникли конфлікти", + "agentManager.apply.conflictToast": + "{{count}} конфліктів у {{files}} файлах. Перегляньте деталі в розділі Застосувати.", + "agentManager.apply.error": "Застосування не вдалося", + "agentManager.apply.conflictsTitle": "Конфлікти", + "agentManager.apply.unknownFile": "Нерозв'язаний файл", + "agentManager.apply.reason.index": "Локальний файл відрізняється від очікуваної версії", + "agentManager.apply.reason.patch": "Патч неможливо застосувати без конфліктів", + "agentManager.apply.reason.contents": "Неможливо прочитати вміст поточного локального файлу", + "agentManager.apply.reason.unknown": "Виявлено конфлікт", + "agentManager.apply.inline.success": "Застосовано", + "agentManager.apply.inline.conflict": "Конфлікти", + "agentManager.apply.inline.error": "Не вдалося", + "agentManager.shortcuts.toggleDiff": "Показати або приховати панель diff", + "agentManager.shortcuts.category.quickSwitch": "Швидке перемикання", + "agentManager.shortcuts.jumpToItem": "Перейти до елемента 1\u20139", + "agentManager.review.sendAllToChat": "Надіслати все до чату", + "agentManager.review.sendAllToChatWithCount": "Надіслати все до чату ({{count}})", + "agentManager.review.sendAllShortcut.mac": "⌘Enter", + "agentManager.review.sendAllShortcut.other": "Ctrl+Enter", + "agentManager.review.modalTitle": "Перегляд коментаря", + "agentManager.review.inlineCount": "Переглянути коментарі ({{count}})", + "agentManager.review.clearAll": "Очистити все", + "agentManager.review.commentOnLine": "Коментар до рядка {{line}}", + "agentManager.review.editCommentOnLine": "Редагувати коментар до рядка {{line}}", + "agentManager.review.commentPlaceholder": "Залишити коментар...", + "agentManager.review.commentAction": "Коментувати", + "agentManager.review.sendToChat": "Надіслати до чату", + "agentManager.review.metaFile": "Файл", + "agentManager.review.metaLine": "Рядок", + "agentManager.review.metaComment": "Коментар користувача", + "agentManager.review.collapsedOnly": "{{count}} згорнуто", + "agentManager.review.collapsedWithLarge": "{{collapsed}} згорнуто, {{large}} великих", + "agentManager.review.largeFileCollapsed": "Великий файл (згорнуто)", + "agentManager.review.endOfLongDiff": "Ви дійшли до кінця!", + + "agentManager.import.pullRequest": "Pull Request", + "agentManager.import.pastePrUrl": "Вставте URL PR...", + "agentManager.import.open": "Відкрити", + "agentManager.import.branches": "Гілки", + "agentManager.import.selectBranch": "Оберіть гілку...", + "agentManager.import.loading": "Завантаження...", + "agentManager.import.loadingBranches": "Завантаження гілок...", + "agentManager.import.noMatchingBranches": "Відповідних гілок не знайдено", + "agentManager.import.noBranchesFound": "Гілок не знайдено.", + "agentManager.import.noBranchesHint": "Вставте URL PR вище або створіть нове робоче дерево.", + "agentManager.import.failed": "Імпортування не вдалося", +} diff --git a/packages/kilo-vscode/webview-ui/src/App.tsx b/packages/kilo-vscode/webview-ui/src/App.tsx index 05035afd21f..8e4c2806f71 100644 --- a/packages/kilo-vscode/webview-ui/src/App.tsx +++ b/packages/kilo-vscode/webview-ui/src/App.tsx @@ -1,4 +1,4 @@ -import { Component, createSignal, createMemo, Switch, Match, onMount, onCleanup } from "solid-js" +import { Component, createSignal, createMemo, Switch, Match, Show, onMount, onCleanup } from "solid-js" import { ThemeProvider } from "@kilocode/kilo-ui/theme" import { DialogProvider } from "@kilocode/kilo-ui/context/dialog" import { MarkedProvider } from "@kilocode/kilo-ui/context/marked" @@ -34,23 +34,8 @@ import { NotificationsProvider } from "./context/notifications" import type { Message as SDKMessage, Part as SDKPart } from "@kilocode/sdk/v2" import "./styles/chat.css" -type ViewType = - | "newTask" - | "marketplace" - | "history" - | "profile" - | "settings" - | "migration" // legacy-migration - | "subAgentViewer" -const VALID_VIEWS = new Set([ - "newTask", - "marketplace", - "history", - "profile", - "settings", - "migration", // legacy-migration - "subAgentViewer", -]) +type ViewType = "newTask" | "marketplace" | "history" | "profile" | "settings" | "subAgentViewer" +const VALID_VIEWS = new Set(["newTask", "marketplace", "history", "profile", "settings", "subAgentViewer"]) /** * Bridge our session store to the DataProvider's expected Data shape. @@ -109,6 +94,10 @@ export const DataBridge: Component<{ children: any }> = (props) => { vscode.postMessage({ type: "openFile", filePath, line, column }) } + const openUrl = (url: string) => { + vscode.postMessage({ type: "openExternal", url }) + } + const directory = () => { const dir = server.workspaceDirectory() if (!dir) return "" @@ -124,6 +113,7 @@ export const DataBridge: Component<{ children: any }> = (props) => { onQuestionReply={reply} onQuestionReject={reject} onOpenFile={open} + onOpenUrl={openUrl} > {props.children} @@ -147,9 +137,12 @@ export const LanguageBridge: Component<{ children: any }> = (props) => { const AppContent: Component = () => { const [currentView, setCurrentView] = createSignal("newTask") const [settingsTab, setSettingsTab] = createSignal() - const [migrationReturnView, setMigrationReturnView] = createSignal("newTask") // legacy-migration + // legacy-migration: state-driven flag independent of currentView to avoid + // race conditions with SettingsEditorProvider's navigate messages. + const [migrationNeeded, setMigrationNeeded] = createSignal(false) const session = useSession() const server = useServer() + const vscode = useVSCode() const handleViewAction = (action: string) => { switch (action) { @@ -211,6 +204,11 @@ const AppContent: Component = () => { session.setCurrentSessionID(message.sessionID) setCurrentView("subAgentViewer") } + // legacy-migration: state-driven migration wizard + if (message?.type === "migrationState") { + console.log("[Kilo New] App: 🔄 migrationState:", message.needed) + setMigrationNeeded(message.needed) + } } window.addEventListener("message", handler) onCleanup(() => window.removeEventListener("message", handler)) @@ -223,50 +221,50 @@ const AppContent: Component = () => { return (
- }> - - setCurrentView("history")} - continueInWorktree - /> - - - - - - setCurrentView("newTask")} /> - - - - - - { - setMigrationReturnView("settings") - setCurrentView("migration") - }} - /> - {/* legacy-migration */} - - {/* legacy-migration start */} - - setCurrentView(migrationReturnView())} - onComplete={() => setCurrentView(migrationReturnView())} - /> - - {/* legacy-migration end */} - - - - + {/* legacy-migration start — state-driven overlay, independent of currentView */} + }> + + setCurrentView("history")} + continueInWorktree + /> + + + + + + setCurrentView("newTask")} /> + + + + + + { + setMigrationNeeded(true) + vscode.postMessage({ type: "requestLegacyMigrationData" }) + }} + /> + + + + + + } + > + setMigrationNeeded(false)} onComplete={() => setMigrationNeeded(false)} /> + + {/* legacy-migration end */}
) } diff --git a/packages/kilo-vscode/webview-ui/src/components/chat/ChatView.tsx b/packages/kilo-vscode/webview-ui/src/components/chat/ChatView.tsx index 7cb2666f9bf..5b4b562d4d5 100644 --- a/packages/kilo-vscode/webview-ui/src/components/chat/ChatView.tsx +++ b/packages/kilo-vscode/webview-ui/src/components/chat/ChatView.tsx @@ -183,17 +183,30 @@ export const ChatView: Component = (props) => { - - + + 1 ? "s" : ""} changed · +${session.worktreeStats()!.additions} -${session.worktreeStats()!.deletions}` + : "No file changes" + } + placement="top" + class="session-diff-wrapper" + > diff --git a/packages/kilo-vscode/webview-ui/src/components/chat/KiloNotifications.tsx b/packages/kilo-vscode/webview-ui/src/components/chat/KiloNotifications.tsx index 7beffc2fc00..e0d01ef86e6 100644 --- a/packages/kilo-vscode/webview-ui/src/components/chat/KiloNotifications.tsx +++ b/packages/kilo-vscode/webview-ui/src/components/chat/KiloNotifications.tsx @@ -6,6 +6,7 @@ import { useProvider } from "../../context/provider" import { useLanguage } from "../../context/language" import { KILO_PROVIDER_ID } from "../../../../src/shared/provider-model" import { TelemetryEventName } from "../../../../src/services/telemetry/types" +import { stripSubProviderPrefix } from "../shared/model-selector-utils" export const KiloNotifications: Component = () => { const { filteredNotifications, dismiss } = useNotifications() @@ -61,6 +62,14 @@ export const KiloNotifications: Component = () => { return true }) + const suggestedName = createMemo(() => { + const suggestion = suggestedModel() + if (!suggestion) return undefined + const model = provider.findModel(suggestion) + if (!model?.name) return undefined + return stripSubProviderPrefix(model.name) + }) + const handleTryModel = () => { const suggestion = suggestedModel() if (!suggestion) return @@ -86,22 +95,24 @@ export const KiloNotifications: Component = () => {

{current()?.message}

0}> +
+
{groupMessage("sessions")}
+
+
+
+
+ + {/* Default Model */}
@@ -737,21 +804,8 @@ const MigrationWizard: Component = (props) => {
- {/* Divider + Cannot be migrated */} -
- -
- -
-
{language.t("migration.migrate.chatHistory")}
-
{language.t("migration.migrate.chatHistoryDesc")}
-
-
- {/* Cleanup option after done */} + {/*
@@ -771,6 +825,7 @@ const MigrationWizard: Component = (props) => {
+ */}
@@ -783,7 +838,7 @@ const MigrationWizard: Component = (props) => { class="migration-wizard__btn migration-wizard__btn--ghost" onClick={() => setScreen("whats-new")} > - {language.t("migration.migrate.back")} + {language.t("common.goBack")} + + +
-
+
= (props) => { const language = useLanguage() const vscode = useVSCode() + const { updateConfig } = useConfig() + const [importing, setImporting] = createSignal(false) + const [exporting, setExporting] = createSignal(false) + let epoch = 0 const open = (url: string) => { vscode.postMessage({ type: "openExternal", url }) } + // Listen for globalConfigLoaded response + const handler = (event: MessageEvent) => { + const msg = event.data as ExtensionMessage + if (msg.type !== "globalConfigLoaded" || !exporting()) return + setExporting(false) + epoch++ + const payload = buildExport(msg.config) + const json = JSON.stringify(payload, null, 2) + const blob = new Blob([json], { type: "application/json" }) + const url = URL.createObjectURL(blob) + const a = document.createElement("a") + a.href = url + a.download = "kilo-settings.json" + a.click() + URL.revokeObjectURL(url) + } + window.addEventListener("message", handler) + onCleanup(() => window.removeEventListener("message", handler)) + + // ----- Export ----- + const handleExport = () => { + if (exporting()) return + setExporting(true) + const token = ++epoch + vscode.postMessage({ type: "requestGlobalConfig" }) + setTimeout(() => { + if (epoch === token) setExporting(false) + }, 5000) + } + + // ----- Import ----- + const handleImport = () => { + if (importing()) return + const input = document.createElement("input") + input.type = "file" + input.accept = ".json" + input.style.display = "none" + input.addEventListener("change", () => { + const file = input.files?.[0] + if (!file) return + if (file.size > MAX_IMPORT_SIZE) { + showToast({ variant: "error", title: language.t("settings.aboutKiloCode.importSettings.tooLarge") }) + return + } + setImporting(true) + const reader = new FileReader() + reader.onload = () => { + setImporting(false) + const text = reader.result as string + const result = parseImport(text) + if (!result.ok) { + const key = + result.error === "invalidJson" + ? "settings.aboutKiloCode.importSettings.invalidJson" + : "settings.aboutKiloCode.importSettings.invalidConfig" + showToast({ variant: "error", title: language.t(key) }) + return + } + if (result.warning === "newerVersion") { + showToast({ + variant: "default", + title: language.t("settings.aboutKiloCode.importSettings.newerVersion"), + }) + } + updateConfig(result.config) + showToast({ + variant: "success", + title: language.t("settings.aboutKiloCode.importSettings.success"), + }) + } + reader.onerror = () => { + setImporting(false) + showToast({ variant: "error", title: language.t("settings.aboutKiloCode.importSettings.invalidJson") }) + } + reader.readAsText(file) + }) + document.body.appendChild(input) + input.click() + document.body.removeChild(input) + } + const getStatusColor = () => { switch (props.connectionState) { case "connected": @@ -158,6 +248,31 @@ const AboutKiloCodeTab: Component = (props) => {
+ {/* Settings Transfer */} +
+

{language.t("settings.aboutKiloCode.settingsTransfer.title")}

+

+ {language.t("settings.aboutKiloCode.settingsTransfer.description")} +

+
+ + +
+
+ {/* legacy-migration start */}

{language.t("settings.aboutKiloCode.legacyMigration.title")}

diff --git a/packages/kilo-vscode/webview-ui/src/components/settings/AgentBehaviourTab.tsx b/packages/kilo-vscode/webview-ui/src/components/settings/AgentBehaviourTab.tsx index 83dd16956e7..3210a800f44 100644 --- a/packages/kilo-vscode/webview-ui/src/components/settings/AgentBehaviourTab.tsx +++ b/packages/kilo-vscode/webview-ui/src/components/settings/AgentBehaviourTab.tsx @@ -6,14 +6,19 @@ import { Button } from "@kilocode/kilo-ui/button" import { IconButton } from "@kilocode/kilo-ui/icon-button" import { Dialog } from "@kilocode/kilo-ui/dialog" import { useDialog } from "@kilocode/kilo-ui/context/dialog" +import { Switch } from "@kilocode/kilo-ui/switch" import { useConfig } from "../../context/config" import { useSession } from "../../context/session" import { useLanguage } from "../../context/language" +import { useVSCode } from "../../context/vscode" import type { AgentInfo, SkillInfo } from "../../types/messages" import ModeEditView from "./ModeEditView" import ModeCreateView from "./ModeCreateView" +import McpEditView from "./McpEditView" import WorkflowsTab from "./agent-behaviour/WorkflowsTab" +import { parseImport, MAX_IMPORT_SIZE } from "./mode-io" +import type { ImportError } from "./mode-io" type SubtabId = "agents" | "mcpServers" | "rules" | "workflows" | "skills" @@ -37,21 +42,6 @@ interface SelectOption { import SettingsRow from "./SettingsRow" -const Placeholder: Component<{ text: string }> = (props) => ( - -

- {useLanguage().t("settings.agentBehaviour.notImplemented")} {props.text} -

-
-) - // View states for the agents subtab type AgentView = "list" | "create" | "edit" @@ -60,15 +50,20 @@ const AgentBehaviourTab: Component = () => { const { config, updateConfig } = useConfig() const session = useSession() const dialog = useDialog() + const vscode = useVSCode() const [activeSubtab, setActiveSubtab] = createSignal("agents") const [newSkillPath, setNewSkillPath] = createSignal("") const [newSkillUrl, setNewSkillUrl] = createSignal("") const [newInstruction, setNewInstruction] = createSignal("") + const browse = () => vscode.postMessage({ type: "openMarketplacePanel" }) // Agent view state const [agentView, setAgentView] = createSignal("list") const [editingAgent, setEditingAgent] = createSignal("") + // MCP view state + const [editingMcp, setEditingMcp] = createSignal("") + // Fetch skills whenever the skills subtab becomes active createEffect(() => { if (activeSubtab() === "skills") { @@ -227,6 +222,41 @@ const AgentBehaviourTab: Component = () => { setEditingAgent("") } + const [importError, setImportError] = createSignal("") + + const errorKey = (tag: ImportError) => `settings.agentBehaviour.importMode.${tag}` as const + + const importMode = (file: File) => { + setImportError("") + if (file.size > MAX_IMPORT_SIZE) { + setImportError(language.t(errorKey("tooLarge"))) + return + } + const reader = new FileReader() + reader.onload = () => { + const result = parseImport(reader.result as string, agentNames()) + if (!result.ok) { + setImportError(language.t(errorKey(result.error))) + return + } + const existing = config().agent ?? {} + updateConfig({ agent: { ...existing, [result.name]: result.config } }) + setImportError("") + } + reader.readAsText(file) + } + + const triggerImport = () => { + const input = document.createElement("input") + input.type = "file" + input.accept = ".json" + input.onchange = () => { + const file = input.files?.[0] + if (file) importMode(file) + } + input.click() + } + const renderAgentsSubtab = () => { const view = agentView() if (view === "create") return @@ -270,11 +300,31 @@ const AgentBehaviourTab: Component = () => { }} >
{language.t("settings.agentBehaviour.availableAgents")}
- +
+ + + +
+ +
+ {importError()} +
+
+ {/* Agents list - clickable to edit */} 0} @@ -296,6 +346,10 @@ const AgentBehaviourTab: Component = () => { {(name, index) => { const agent = () => session.agents().find((a) => a.name === name) const isCustom = () => !agent()?.native + const agentCfg = () => config().agent?.[name] ?? {} + const disabled = () => agentCfg().disable ?? false + const hidden = () => agentCfg().hidden ?? false + const deprecated = () => agent()?.deprecated ?? false return (
{ "border-bottom": index() < agentNames().length - 1 ? "1px solid var(--border-weak-base)" : "none", "border-radius": "4px", cursor: "pointer", + opacity: disabled() ? "0.5" : "1", }} onClick={() => startEdit(name)} onMouseEnter={(e) => { @@ -331,6 +386,45 @@ const AgentBehaviourTab: Component = () => { custom + + + {language.t("settings.agentBehaviour.badge.hidden")} + + + + + {language.t("settings.agentBehaviour.badge.disabled")} + + + + + {language.t("settings.agentBehaviour.badge.deprecated")} + +
{ setExpanded((prev) => ({ ...prev, [name]: !prev[name] })) } + const statusColor = (name: string) => { + const s = session.mcpStatus()[name]?.status + if (s === "connected") return "var(--vscode-testing-iconPassed, #4caf50)" + if (s === "failed") return "var(--vscode-testing-iconFailed, #f44336)" + if (s === "needs_auth" || s === "needs_client_registration") + return "var(--vscode-editorWarning-foreground, #ff9800)" + if (s === "disabled") return "var(--vscode-disabledForeground, #888)" + return "var(--vscode-disabledForeground, #888)" + } + + const statusLabel = (name: string) => { + const s = session.mcpStatus()[name]?.status + if (!s) return "" + const key = { + connected: "mcp.status.connected", + failed: "mcp.status.failed", + needs_auth: "mcp.status.needs_auth", + disabled: "mcp.status.disabled", + needs_client_registration: "mcp.status.needs_registration", + }[s] + return key ? language.t(key) : s + } + + const isConnected = (name: string) => session.mcpStatus()[name]?.status === "connected" + + if (editingMcp()) { + return ( + setEditingMcp("")} + onRemove={(name) => { + confirmRemoveMcp(name) + setEditingMcp("") + }} + /> + ) + } + return (
+
+ +
0} fallback={ @@ -427,6 +571,12 @@ const AgentBehaviourTab: Component = () => { {([name, mcp], index) => { const open = () => expanded()[name] ?? false const env = () => Object.entries(mcp.environment ?? mcp.env ?? {}) + const error = () => { + const s = session.mcpStatus()[name] + if (s?.status === "failed") return s.error + if (s?.status === "needs_client_registration") return s.error + return undefined + } return (
{ toggle(name) }} /> + {/* Status dot */} +
{name}
{ color: "var(--text-weak-base, var(--vscode-descriptionForeground))", }} > - {mcp.url ? "remote" : "stdio"} + {statusLabel(name) || (mcp.url ? "remote" : "stdio")}
- { - e.stopPropagation() - confirmRemoveMcp(name) - }} - /> +
+
e.stopPropagation()}> + { + if (isConnected(name)) { + session.disconnectMcp(name) + } else { + session.connectMcp(name) + } + }} + hideLabel + > + {name} + +
+ { + e.stopPropagation() + confirmRemoveMcp(name) + }} + /> + { + e.stopPropagation() + setEditingMcp(name) + }} + /> +
+ {/* Error message */} + +
+ {error()} +
+
+ {/* Expandable detail */}
{ )} - -
- {language.t("settings.agentBehaviour.mcpDetail.disabled")} -
-
@@ -563,6 +754,18 @@ const AgentBehaviourTab: Component = () => { const renderSkillsSubtab = () => (
+
+ +
{/* Discovered skills */}

{language.t("settings.agentBehaviour.discoveredSkills")} @@ -832,11 +1035,12 @@ const AgentBehaviourTab: Component = () => { + + {/* Fetch error */} + + {(err) => ( + {err()} + )} + + + {/* Fetch status (success/info messages) */} + + {(status) => ( + + {status()} + + )} + + + {/* Model selection picker */} + + {(models) => ( +
+ {/* Header with count + toggle */} +
+ + + {language.t("provider.custom.models.fetch.showing", { + shown: String(filtered().length), + total: String(models().length), + })} + + +
+ + +
+
+ + {/* Search */} + 10}> + + + + {/* Model list */} +
+ + {(m) => ( + + )} + +
+ + {/* Actions */} +
+ + +
+
+ )} +

{/* Headers */} diff --git a/packages/kilo-vscode/webview-ui/src/components/settings/McpEditView.tsx b/packages/kilo-vscode/webview-ui/src/components/settings/McpEditView.tsx new file mode 100644 index 00000000000..634794307a0 --- /dev/null +++ b/packages/kilo-vscode/webview-ui/src/components/settings/McpEditView.tsx @@ -0,0 +1,221 @@ +import { Component, Show, createMemo, createSignal, For } from "solid-js" +import { TextField } from "@kilocode/kilo-ui/text-field" +import { Card } from "@kilocode/kilo-ui/card" +import { Button } from "@kilocode/kilo-ui/button" +import { IconButton } from "@kilocode/kilo-ui/icon-button" + +import { useConfig } from "../../context/config" +import { useLanguage } from "../../context/language" +import type { McpConfig } from "../../types/messages" +import SettingsRow from "./SettingsRow" + +interface Props { + name: string + onBack: () => void + onRemove: (name: string) => void +} + +const McpEditView: Component = (props) => { + const language = useLanguage() + const { config, updateConfig } = useConfig() + + const cfg = createMemo(() => config().mcp?.[props.name] ?? {}) + + const [envKey, setEnvKey] = createSignal("") + const [envVal, setEnvVal] = createSignal("") + + const update = (partial: Partial) => { + const existing = config().mcp ?? {} + const current = existing[props.name] ?? {} + updateConfig({ + mcp: { ...existing, [props.name]: { ...current, ...partial } }, + }) + } + + const transport = () => cfg().type ?? (cfg().url ? "remote" : "local") + + const cmd = () => { + const c = cfg().command + if (Array.isArray(c)) return c[0] ?? "" + return c ?? "" + } + + const args = () => { + const c = cfg().command + if (Array.isArray(c)) return c.slice(1).join("\n") + return "" + } + + const env = createMemo(() => Object.entries(cfg().environment ?? cfg().env ?? {})) + + const addEnv = () => { + const key = envKey().trim() + const val = envVal().trim() + if (!key) return + const existing = cfg().environment ?? cfg().env ?? {} + update({ environment: { ...existing, [key]: val } }) + setEnvKey("") + setEnvVal("") + } + + const removeEnv = (key: string) => { + const existing = { ...(cfg().environment ?? cfg().env ?? {}) } + delete existing[key] + update({ environment: existing }) + } + + return ( +
+
+
+ + + {language.t("settings.agentBehaviour.editMcp")} — {props.name} + +
+ props.onRemove(props.name)} /> +
+ + {/* Transport info */} + +
+ {transport() === "local" + ? language.t("settings.agentBehaviour.editMcp.transportLocal") + : language.t("settings.agentBehaviour.editMcp.transportRemote")} +
+
+ + {/* Command / URL */} + + +
+ {language.t("settings.agentBehaviour.addMcp.command")} +
+ { + const existing = cfg().command + const rest = Array.isArray(existing) ? existing.slice(1) : [] + update({ command: [val.trim(), ...rest] }) + }} + /> +
+ +
+ {language.t("settings.agentBehaviour.addMcp.args")} +
+
+ {language.t("settings.agentBehaviour.addMcp.args.help")} +
+ { + const parts = val.split(/\n/).filter(Boolean) + update({ command: [cmd(), ...parts] }) + }} + /> +
+
+ + + +
+ {language.t("settings.agentBehaviour.addMcp.url")} +
+ update({ url: val.trim() || undefined })} + /> +
+
+ + {/* Environment variables (local servers only) */} + + +
+ {language.t("settings.agentBehaviour.editMcp.env")} +
+
+ {language.t("settings.agentBehaviour.editMcp.env.help")} +
+ +
0 ? "1px solid var(--border-weak-base)" : "none", + }} + > +
+ setEnvKey(val)} /> +
+
+ setEnvVal(val)} + onKeyDown={(e: KeyboardEvent) => { + if (e.key === "Enter") addEnv() + }} + /> +
+ +
+ + + {([key, val], index) => ( +
+ + {key}={val} + + removeEnv(key)} /> +
+ )} +
+
+
+ +
+ +
+
+ ) +} + +export default McpEditView diff --git a/packages/kilo-vscode/webview-ui/src/components/settings/ModeEditView.tsx b/packages/kilo-vscode/webview-ui/src/components/settings/ModeEditView.tsx index 7ae4b12c8f2..3f1a60ac162 100644 --- a/packages/kilo-vscode/webview-ui/src/components/settings/ModeEditView.tsx +++ b/packages/kilo-vscode/webview-ui/src/components/settings/ModeEditView.tsx @@ -1,5 +1,6 @@ import { Component, Show, createMemo } from "solid-js" import { TextField } from "@kilocode/kilo-ui/text-field" +import { Switch } from "@kilocode/kilo-ui/switch" import { Card } from "@kilocode/kilo-ui/card" import { Button } from "@kilocode/kilo-ui/button" import { IconButton } from "@kilocode/kilo-ui/icon-button" @@ -9,6 +10,7 @@ import { useSession } from "../../context/session" import { useLanguage } from "../../context/language" import type { AgentConfig, AgentInfo } from "../../types/messages" import SettingsRow from "./SettingsRow" +import { buildExport } from "./mode-io" interface Props { name: string @@ -40,6 +42,18 @@ const ModeEditView: Component = (props) => { }) } + const exportMode = () => { + const data = buildExport(props.name, cfg()) + const json = JSON.stringify(data, null, 2) + const blob = new Blob([json], { type: "application/json" }) + const url = URL.createObjectURL(blob) + const anchor = document.createElement("a") + anchor.href = url + anchor.download = `${props.name}.agent.json` + anchor.click() + URL.revokeObjectURL(url) + } + return (
= (props) => {
- { - const a = agent() - if (a) props.onRemove(a) - }} - /> +
+ + { + const a = agent() + if (a) props.onRemove(a) + }} + /> +
@@ -156,7 +179,6 @@ const ModeEditView: Component = (props) => { = (props) => { }} /> + + + { + update({ hidden: val || undefined }) + // Clear default_agent if hiding the current default + if (val && config().default_agent === props.name) { + updateConfig({ default_agent: undefined }) + } + }} + hideLabel + > + {language.t("settings.agentBehaviour.hidden.title")} + + + + + { + update({ disable: val || undefined }) + // Clear default_agent if disabling the current default + if (val && config().default_agent === props.name) { + updateConfig({ default_agent: undefined }) + } + }} + hideLabel + > + {language.t("settings.agentBehaviour.disable.title")} + +
diff --git a/packages/kilo-vscode/webview-ui/src/components/settings/PromptsTab.tsx b/packages/kilo-vscode/webview-ui/src/components/settings/PromptsTab.tsx deleted file mode 100644 index 1502281d2d4..00000000000 --- a/packages/kilo-vscode/webview-ui/src/components/settings/PromptsTab.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { Component } from "solid-js" -import { useLanguage } from "../../context/language" - -const PromptsTab: Component = () => { - const language = useLanguage() - - return ( -
-
-

- {language.t("settings.notImplemented")}{" "} - {language.t("settings.notImplemented.description")} -

-
-
- ) -} - -export default PromptsTab diff --git a/packages/kilo-vscode/webview-ui/src/components/settings/ProvidersTab.tsx b/packages/kilo-vscode/webview-ui/src/components/settings/ProvidersTab.tsx index 4f4408b7735..53738608898 100644 --- a/packages/kilo-vscode/webview-ui/src/components/settings/ProvidersTab.tsx +++ b/packages/kilo-vscode/webview-ui/src/components/settings/ProvidersTab.tsx @@ -17,7 +17,7 @@ import ProviderConnectDialog from "./ProviderConnectDialog" import ProviderSelectDialog from "./ProviderSelectDialog" import { CUSTOM_PROVIDER_ID, isPopularProvider, providerIcon, providerNoteKey, sortProviders } from "./provider-catalog" import { visibleConnectedIds } from "./provider-visibility" -import { KILO_PROVIDER_ID } from "../../../../src/shared/provider-model" +import { KILO_PROVIDER_ID, CUSTOM_PROVIDER_PACKAGE } from "../../../../src/shared/provider-model" import { createProviderAction } from "../../utils/provider-action" type ProviderSource = "env" | "api" | "config" | "custom" @@ -83,6 +83,17 @@ const ProvidersTab: Component = () => { return source(item) !== "env" } + function isCustom(item: Provider) { + const cfg = config().provider?.[item.id] + return cfg?.npm === CUSTOM_PROVIDER_PACKAGE + } + + function editProvider(item: Provider) { + const cfg = config().provider?.[item.id] + if (!cfg) return + dialog.show(() => ) + } + function disconnect(providerID: string, name: string) { action.send( { type: "disconnectProvider", providerID }, @@ -203,9 +214,16 @@ const ProvidersTab: Component = () => { } > - +
+ + + + +
)} diff --git a/packages/kilo-vscode/webview-ui/src/components/settings/Settings.tsx b/packages/kilo-vscode/webview-ui/src/components/settings/Settings.tsx index bb206a188be..7ce196444f4 100644 --- a/packages/kilo-vscode/webview-ui/src/components/settings/Settings.tsx +++ b/packages/kilo-vscode/webview-ui/src/components/settings/Settings.tsx @@ -17,8 +17,7 @@ import DisplayTab from "./DisplayTab" import AutocompleteTab from "./AutocompleteTab" import NotificationsTab from "./NotificationsTab" import ContextTab from "./ContextTab" -import TerminalTab from "./TerminalTab" -import PromptsTab from "./PromptsTab" + import ExperimentalTab from "./ExperimentalTab" import LanguageTab from "./LanguageTab" import AboutKiloCodeTab from "./AboutKiloCodeTab" @@ -138,14 +137,7 @@ const Settings: Component = (props) => { {language.t("settings.context.title")} - - - {language.t("settings.terminal.title")} - - - - {language.t("settings.prompts.title")} - + {language.t("settings.experimental.title")} @@ -200,14 +192,7 @@ const Settings: Component = (props) => {

{language.t("settings.context.title")}

- -

{language.t("settings.terminal.title")}

- -
- -

{language.t("settings.prompts.title")}

- -
+

{language.t("settings.experimental.title")}

diff --git a/packages/kilo-vscode/webview-ui/src/components/settings/TerminalTab.tsx b/packages/kilo-vscode/webview-ui/src/components/settings/TerminalTab.tsx deleted file mode 100644 index 92b64625509..00000000000 --- a/packages/kilo-vscode/webview-ui/src/components/settings/TerminalTab.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { Component } from "solid-js" -import { useLanguage } from "../../context/language" - -const TerminalTab: Component = () => { - const language = useLanguage() - - return ( -
-
-

- {language.t("settings.notImplemented")}{" "} - {language.t("settings.notImplemented.description")} -

-
-
- ) -} - -export default TerminalTab diff --git a/packages/kilo-vscode/webview-ui/src/components/settings/mode-io.ts b/packages/kilo-vscode/webview-ui/src/components/settings/mode-io.ts new file mode 100644 index 00000000000..79428b38646 --- /dev/null +++ b/packages/kilo-vscode/webview-ui/src/components/settings/mode-io.ts @@ -0,0 +1,95 @@ +import type { AgentConfig, PermissionConfig } from "../../types/messages" + +/** Maximum import file size in bytes (1 MB). */ +export const MAX_IMPORT_SIZE = 1_048_576 + +const NAME_RE = /^[a-z][a-z0-9-]*$/ +const MODES = ["subagent", "primary", "all"] as const +const LEVELS = new Set(["allow", "ask", "deny"]) + +export type ImportError = "invalidJson" | "invalidName" | "nameTaken" | "tooLarge" + +export type ImportResult = { ok: true; name: string; config: AgentConfig } | { ok: false; error: ImportError } + +/** Check if a value is a valid permission level string. */ +function isLevel(v: unknown): boolean { + return typeof v === "string" && LEVELS.has(v) +} + +/** Validate and extract a permission map, dropping unknown entries. */ +function parsePermission(raw: unknown): PermissionConfig | undefined { + if (typeof raw !== "object" || raw === null || Array.isArray(raw)) return undefined + const out: PermissionConfig = {} + let count = 0 + for (const [key, val] of Object.entries(raw)) { + if (isLevel(val)) { + out[key] = val as PermissionConfig[string] + count++ + } else if (typeof val === "object" && val !== null && !Array.isArray(val)) { + // Nested per-pattern rules like { "*": "ask", "uname": "allow" } + const nested: Record = {} + let valid = 0 + for (const [pat, lev] of Object.entries(val)) { + if (isLevel(lev)) { + nested[pat] = lev as string + valid++ + } + } + if (valid > 0) { + out[key] = nested as PermissionConfig[string] + count++ + } + } + } + return count > 0 ? out : undefined +} + +/** + * Parse a raw JSON string into a validated agent name + config. + * Returns an error tag (matching the i18n key suffix) on failure. + */ +export function parseImport(json: string, taken: string[]): ImportResult { + let data: unknown + try { + data = JSON.parse(json) + } catch { + return { ok: false, error: "invalidJson" } + } + if (typeof data !== "object" || data === null || Array.isArray(data)) { + return { ok: false, error: "invalidJson" } + } + const obj = data as Record + + const name = typeof obj.name === "string" ? obj.name.trim() : "" + if (!name || !NAME_RE.test(name)) { + return { ok: false, error: "invalidName" } + } + if (taken.includes(name)) { + return { ok: false, error: "nameTaken" } + } + + const partial: Partial = {} + if (typeof obj.description === "string") partial.description = obj.description + if (typeof obj.prompt === "string") partial.prompt = obj.prompt + if (typeof obj.model === "string") partial.model = obj.model + if (typeof obj.mode === "string" && (MODES as readonly string[]).includes(obj.mode)) + partial.mode = obj.mode as AgentConfig["mode"] + if (typeof obj.temperature === "number") partial.temperature = obj.temperature + if (typeof obj.top_p === "number") partial.top_p = obj.top_p + if (typeof obj.steps === "number") partial.steps = obj.steps + const perms = parsePermission(obj.permission) + if (perms) partial.permission = perms + + return { + ok: true, + name, + config: { ...partial, mode: partial.mode ?? "primary" }, + } +} + +/** + * Build the JSON-serialisable export payload for a mode. + */ +export function buildExport(name: string, cfg: AgentConfig): Record { + return { name, ...cfg } +} diff --git a/packages/kilo-vscode/webview-ui/src/components/settings/settings-io.ts b/packages/kilo-vscode/webview-ui/src/components/settings/settings-io.ts new file mode 100644 index 00000000000..ea46f235d27 --- /dev/null +++ b/packages/kilo-vscode/webview-ui/src/components/settings/settings-io.ts @@ -0,0 +1,130 @@ +import type { Config } from "../../types/messages" +import { deepMerge } from "../../utils/config-utils" + +/** Maximum import file size in bytes (1 MB). */ +export const MAX_IMPORT_SIZE = 1_048_576 + +/** Current export format version. */ +export const META_VERSION = 1 + +/** Top-level keys recognised as valid Config fields. */ +export const KNOWN_KEYS: ReadonlyArray = [ + "permission", + "model", + "small_model", + "default_agent", + "agent", + "provider", + "disabled_providers", + "enabled_providers", + "mcp", + "command", + "instructions", + "skills", + "snapshot", + "share", + "username", + "watcher", + "formatter", + "lsp", + "compaction", + "tools", + "layout", + "experimental", +] + +export type ImportError = "invalidJson" | "invalidConfig" | "tooLarge" +export type ImportWarning = "newerVersion" + +export type ImportResult = { ok: true; config: Config; warning?: ImportWarning } | { ok: false; error: ImportError } + +interface ExportMeta { + version: number + exportedAt: string +} + +// --------------------------------------------------------------------------- +// Export +// --------------------------------------------------------------------------- + +/** + * Build a JSON-serialisable export payload from the current config. + * All fields are included as-is so the export is a complete snapshot + * that can be imported on another instance without re-entering secrets. + */ +export function buildExport(cfg: Config): Record { + const meta: ExportMeta = { + version: META_VERSION, + exportedAt: new Date().toISOString(), + } + + const out: Record = { _meta: meta } + + for (const [key, value] of Object.entries(cfg)) { + if (value === undefined || value === null) continue + out[key] = value + } + + return out +} + +// --------------------------------------------------------------------------- +// Import +// --------------------------------------------------------------------------- + +/** + * Parse a raw JSON string into a validated Config. + * Unknown keys and `_meta` are stripped. Returns an error tag on failure + * or a warning when the file was exported from a newer version. + */ +export function parseImport(json: string): ImportResult { + let data: unknown + try { + data = JSON.parse(json) + } catch { + return { ok: false, error: "invalidJson" } + } + + if (typeof data !== "object" || data === null || Array.isArray(data)) { + return { ok: false, error: "invalidJson" } + } + + const obj = data as Record + + // Check for newer version warning + let warning: ImportWarning | undefined + const meta = obj._meta + if (typeof meta === "object" && meta !== null && !Array.isArray(meta)) { + const version = (meta as Record).version + if (typeof version === "number" && version > META_VERSION) { + warning = "newerVersion" + } + } + + // Keep only known config keys + const config: Record = {} + for (const key of KNOWN_KEYS) { + if (key in obj && obj[key] !== undefined) { + config[key] = obj[key] + } + } + + // Must have at least one known key + if (Object.keys(config).length === 0) { + return { ok: false, error: "invalidConfig" } + } + + return warning ? { ok: true, config: config as Config, warning } : { ok: true, config: config as Config } +} + +// --------------------------------------------------------------------------- +// Merge +// --------------------------------------------------------------------------- + +/** + * Deep-merge imported config on top of existing config. + * Imported values take precedence; existing values not in import are preserved. + */ +export function mergeConfig(existing: Config, imported: Config): Config { + return deepMerge(existing, imported) +} diff --git a/packages/kilo-vscode/webview-ui/src/components/shared/ModeSwitcher.tsx b/packages/kilo-vscode/webview-ui/src/components/shared/ModeSwitcher.tsx index 422d0b4801a..e8e4424bc0e 100644 --- a/packages/kilo-vscode/webview-ui/src/components/shared/ModeSwitcher.tsx +++ b/packages/kilo-vscode/webview-ui/src/components/shared/ModeSwitcher.tsx @@ -11,6 +11,7 @@ import { Component, createSignal, onCleanup, For, Show } from "solid-js" import { PopupSelector } from "./PopupSelector" import { Button } from "@kilocode/kilo-ui/button" import { useSession } from "../../context/session" +import { useLanguage } from "../../context/language" import type { AgentInfo } from "../../types/messages" /** Format an agent for display. Uses displayName if available, otherwise title-cases the slug. */ @@ -38,6 +39,7 @@ export interface ModeSwitcherBaseProps { export const ModeSwitcherBase: Component = (props) => { const [open, setOpen] = createSignal(false) const [focused, setFocused] = createSignal(-1) + const language = useLanguage() let listRef: HTMLDivElement | undefined // Listen for slash command trigger @@ -132,7 +134,22 @@ export const ModeSwitcherBase: Component = (props) => { onClick={() => pick(agent.name)} onFocus={() => setFocused(i())} > - {formatAgentLabel(agent)} +
+ {formatAgentLabel(agent)} + + + {language.t("settings.agentBehaviour.badge.deprecated")} + + +
{agent.description} diff --git a/packages/kilo-vscode/webview-ui/src/components/shared/ModelPreview.tsx b/packages/kilo-vscode/webview-ui/src/components/shared/ModelPreview.tsx index 34232e52539..3cd4af62786 100644 --- a/packages/kilo-vscode/webview-ui/src/components/shared/ModelPreview.tsx +++ b/packages/kilo-vscode/webview-ui/src/components/shared/ModelPreview.tsx @@ -2,18 +2,12 @@ import { Component, Show, For } from "solid-js" import type { EnrichedModel } from "../../context/provider" import { Markdown } from "@kilocode/kilo-ui/markdown" import { sanitizeName } from "./model-selector-utils" +import { fmtPrice } from "./model-preview-utils" interface Props { model: EnrichedModel | null } -function fmtPrice(n: number): string { - if (n === 0) return "Free" - const per1M = n * 1_000_000 - if (per1M < 0.01) return `$${per1M.toFixed(4)}/1M` - return `$${per1M.toFixed(2)}/1M` -} - function fmtContext(n: number): string { if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(n % 1_000_000 === 0 ? 0 : 1)}M` if (n >= 1_000) return `${(n / 1_000).toFixed(n % 1_000 === 0 ? 0 : 1)}K` diff --git a/packages/kilo-vscode/webview-ui/src/components/shared/model-preview-utils.ts b/packages/kilo-vscode/webview-ui/src/components/shared/model-preview-utils.ts new file mode 100644 index 00000000000..1d7cfcb73a6 --- /dev/null +++ b/packages/kilo-vscode/webview-ui/src/components/shared/model-preview-utils.ts @@ -0,0 +1,9 @@ +/** + * Format a model price for display. + * Expects `n` in $/M tokens (as stored in model.cost.input / model.cost.output). + */ +export function fmtPrice(n: number): string { + if (n === 0) return "Free" + if (n < 0.01) return `$${n.toFixed(4)}/1M` + return `$${n.toFixed(2)}/1M` +} diff --git a/packages/kilo-vscode/webview-ui/src/context/config.tsx b/packages/kilo-vscode/webview-ui/src/context/config.tsx index 66474bd2622..015c4934bbf 100644 --- a/packages/kilo-vscode/webview-ui/src/context/config.tsx +++ b/packages/kilo-vscode/webview-ui/src/context/config.tsx @@ -11,6 +11,7 @@ import { createContext, useContext, createSignal, onCleanup, ParentComponent, Accessor } from "solid-js" import { useVSCode } from "./vscode" import type { Config, ExtensionMessage } from "../types/messages" +import { deepMerge, stripNulls, resolveConfig } from "../utils/config-utils" interface ConfigContextValue { config: Accessor @@ -21,37 +22,6 @@ interface ConfigContextValue { discardConfig: () => void } -function isRecord(value: unknown): value is Record { - return !!value && typeof value === "object" && !Array.isArray(value) -} - -/** Deep merge two objects, with source values overriding target values. */ -function deepMerge(target: Config, source: Partial): Config { - const result: Record = { ...target } - for (const [key, value] of Object.entries(source)) { - if (isRecord(value) && isRecord(result[key])) { - result[key] = deepMerge(result[key] as Config, value as Partial) - } else { - result[key] = value - } - } - return result as Config -} - -/** Recursively remove keys whose value is null (null = "deleted"). */ -function stripNulls(obj: Config): Config { - const result: Record = {} - for (const [key, value] of Object.entries(obj)) { - if (value === null || value === undefined) continue - if (isRecord(value)) { - result[key] = stripNulls(value as Config) - } else { - result[key] = value - } - } - return result as Config -} - export const ConfigContext = createContext() export const ConfigProvider: ParentComponent = (props) => { @@ -74,7 +44,9 @@ export const ConfigProvider: ParentComponent = (props) => { // Skip if a save is in-flight — a stale configLoaded must not overwrite // the optimistically-updated state while the write is being confirmed. if (saving) return - setConfig(message.config) + // Re-apply the draft on top so pending changes (e.g. a toggled switch the + // user hasn't saved yet) stay visible instead of snapping back. + setConfig(resolveConfig(message.config, draft(), isDirty())) setSaved(message.config) setLoading(false) return @@ -90,11 +62,7 @@ export const ConfigProvider: ParentComponent = (props) => { } else { // configUpdated from a different source (e.g. PermissionDock save). // Re-apply the draft on top so pending settings changes are preserved. - if (isDirty()) { - setConfig(stripNulls(deepMerge(message.config, draft()))) - } else { - setConfig(message.config) - } + setConfig(resolveConfig(message.config, draft(), isDirty())) } setSaved(message.config) return diff --git a/packages/kilo-vscode/webview-ui/src/context/language-utils.ts b/packages/kilo-vscode/webview-ui/src/context/language-utils.ts index f3f989e220a..37241b6ba4b 100644 --- a/packages/kilo-vscode/webview-ui/src/context/language-utils.ts +++ b/packages/kilo-vscode/webview-ui/src/context/language-utils.ts @@ -17,6 +17,21 @@ export type Locale = | "bs" | "tr" | "nl" + | "uk" + +/** Locales that use right-to-left script. */ +export const RTL_LOCALES = new Set(["ar"]) + +/** Map internal locale IDs to valid BCP 47 language tags for the HTML lang attribute. */ +export const LOCALE_BCP47: Partial> = { + br: "pt-BR", + zht: "zh-TW", +} + +/** Return the BCP 47 language tag for a locale (falls back to the locale id itself). */ +export function localeToBcp47(locale: Locale): string { + return LOCALE_BCP47[locale] ?? locale +} export const LOCALES: readonly Locale[] = [ "en", @@ -37,6 +52,7 @@ export const LOCALES: readonly Locale[] = [ "bs", "tr", "nl", + "uk", ] /** @@ -46,7 +62,10 @@ export const LOCALES: readonly Locale[] = [ export function normalizeLocale(lang: string): Locale { const lower = lang.toLowerCase() if (lower.startsWith("zh")) { - return lower.includes("hant") ? "zht" : "zh" + if (lower === "zht") return "zht" + const traditional = + lower.includes("hant") || lower.includes("-tw") || lower.includes("-hk") || lower.includes("-mo") + return traditional ? "zht" : "zh" } for (const loc of LOCALES) { if (lower.startsWith(loc)) { diff --git a/packages/kilo-vscode/webview-ui/src/context/language.tsx b/packages/kilo-vscode/webview-ui/src/context/language.tsx index 5d063e1cc7a..76bfde6c068 100644 --- a/packages/kilo-vscode/webview-ui/src/context/language.tsx +++ b/packages/kilo-vscode/webview-ui/src/context/language.tsx @@ -27,6 +27,7 @@ import { dict as uiTh } from "@kilocode/kilo-ui/i18n/th" import { dict as uiBs } from "@kilocode/kilo-ui/i18n/bs" import { dict as uiTr } from "@kilocode/kilo-ui/i18n/tr" import { dict as uiNl } from "@kilocode/kilo-ui/i18n/nl" +import { dict as uiUk } from "@kilocode/kilo-ui/i18n/uk" import { dict as appEn } from "../i18n/en" import { dict as appZh } from "../i18n/zh" import { dict as appZht } from "../i18n/zht" @@ -45,6 +46,7 @@ import { dict as appTh } from "../i18n/th" import { dict as appBs } from "../i18n/bs" import { dict as appTr } from "../i18n/tr" import { dict as appNl } from "../i18n/nl" +import { dict as appUk } from "../i18n/uk" import { dict as amEn } from "../../agent-manager/i18n/en" import { dict as amZh } from "../../agent-manager/i18n/zh" import { dict as amZht } from "../../agent-manager/i18n/zht" @@ -63,6 +65,7 @@ import { dict as amTh } from "../../agent-manager/i18n/th" import { dict as amBs } from "../../agent-manager/i18n/bs" import { dict as amTr } from "../../agent-manager/i18n/tr" import { dict as amNl } from "../../agent-manager/i18n/nl" +import { dict as amUk } from "../../agent-manager/i18n/uk" import { dict as kiloEn } from "@kilocode/kilo-i18n/en" import { dict as kiloZh } from "@kilocode/kilo-i18n/zh" import { dict as kiloZht } from "@kilocode/kilo-i18n/zht" @@ -81,13 +84,14 @@ import { dict as kiloTh } from "@kilocode/kilo-i18n/th" import { dict as kiloBs } from "@kilocode/kilo-i18n/bs" import { dict as kiloTr } from "@kilocode/kilo-i18n/tr" import { dict as kiloNl } from "@kilocode/kilo-i18n/nl" +import { dict as kiloUk } from "@kilocode/kilo-i18n/uk" import { useVSCode } from "./vscode" import { normalizeLocale as _normalizeLocale, resolveTemplate as _resolveTemplate } from "./language-utils" export type { Locale } from "./language-utils" export { LOCALES } from "./language-utils" import type { Locale } from "./language-utils" -import { LOCALES } from "./language-utils" +import { LOCALES, RTL_LOCALES, localeToBcp47 } from "./language-utils" export const LOCALE_LABELS: Record = { en: "English", @@ -108,6 +112,7 @@ export const LOCALE_LABELS: Record = { bs: "Bosanski", tr: "Türkçe", nl: "Nederlands", + uk: "Українська", } // Merge 4 dict layers: app + ui + kilo + agent manager (kilo and agent manager override last) @@ -131,6 +136,7 @@ const dicts: Record> = { bs: { ...base, ...appBs, ...uiBs, ...kiloBs, ...amEn, ...amBs }, tr: { ...base, ...appTr, ...uiTr, ...kiloTr, ...amEn, ...amTr }, nl: { ...base, ...appNl, ...uiNl, ...kiloNl, ...amEn, ...amNl }, + uk: { ...base, ...appUk, ...uiUk, ...kiloUk, ...amEn, ...amUk }, } function normalizeLocale(lang: string): Locale { @@ -176,6 +182,13 @@ export const LanguageProvider: ParentComponent = (props) const dict = createMemo(() => dicts[locale()] ?? dicts.en) + // Update and when locale changes + createEffect(() => { + const loc = locale() + document.documentElement.lang = localeToBcp47(loc) + document.documentElement.dir = RTL_LOCALES.has(loc) ? "rtl" : "ltr" + }) + const t = (key: UiI18nKey, params?: UiI18nParams) => { const text = (dict() as Record)[key] ?? String(key) return resolveTemplate(text, params) diff --git a/packages/kilo-vscode/webview-ui/src/context/session-utils.ts b/packages/kilo-vscode/webview-ui/src/context/session-utils.ts index 5e774d32ba6..893a1973283 100644 --- a/packages/kilo-vscode/webview-ui/src/context/session-utils.ts +++ b/packages/kilo-vscode/webview-ui/src/context/session-utils.ts @@ -1,5 +1,14 @@ import type { Part } from "../types/messages" +/** Minimal message shape for cost breakdown helpers. */ +export type CostMessage = { id: string; role: string; cost?: number } + +/** Minimal tool part shape for label extraction. */ +type ToolState = { + input?: { description?: string; subagent_type?: string } + metadata?: { sessionId?: string } +} + /** * Derive a human-readable status string from the last streaming part. * Returns undefined for part types that don't map to a status. @@ -62,3 +71,68 @@ export function calcContextUsage( const percentage = contextLimit ? Math.round((total / contextLimit) * 100) : null return { tokens: total, percentage } } + +/** + * Build a map of session ID → total cost for each session in the family + * that has non-zero cost. Pure function — no store dependency. + */ +export function buildFamilyCosts( + family: Set, + messages: Record>, +): Map { + const costs = new Map() + for (const sid of family) { + const cost = calcTotalCost(messages[sid] ?? []) + if (cost > 0) costs.set(sid, cost) + } + return costs +} + +const LABEL_CAP = 24 + +/** + * Build a map of child session ID → label by scanning tool parts in the + * family for task tool metadata. Pure function — no store dependency. + */ +export function buildFamilyLabels( + family: Set, + messages: Record, + parts: Record>, +): Map { + const labels = new Map() + for (const sid of family) { + const msgs = messages[sid] + if (!msgs) continue + for (const msg of msgs) { + const list = parts[msg.id] + if (!list) continue + for (const p of list) { + if (p.type !== "tool") continue + const child = p.state?.metadata?.sessionId + if (!child || !family.has(child)) continue + const raw = p.state?.input?.subagent_type || p.state?.input?.description || p.tool || "task" + const desc = raw.length > LABEL_CAP ? raw.slice(0, LABEL_CAP - 2) + "…" : raw + if (!labels.has(child)) labels.set(child, desc) + } + } + } + return labels +} + +/** + * Combine costs and labels into the final breakdown array. + * Pure function — no store dependency. + */ +export function buildCostBreakdown( + root: string, + costs: Map, + labels: Map, + rootLabel: string, +): Array<{ label: string; cost: number }> { + const items: Array<{ label: string; cost: number }> = [] + for (const [sid, cost] of costs) { + const label = sid === root ? rootLabel : (labels.get(sid) ?? sid.slice(0, 8)) + items.push({ label, cost }) + } + return items +} diff --git a/packages/kilo-vscode/webview-ui/src/context/session.tsx b/packages/kilo-vscode/webview-ui/src/context/session.tsx index de6db53320d..7c05abac5d9 100644 --- a/packages/kilo-vscode/webview-ui/src/context/session.tsx +++ b/packages/kilo-vscode/webview-ui/src/context/session.tsx @@ -40,9 +40,16 @@ import type { ExtensionMessage, FileAttachment, SendMessageFailedMessage, + McpStatusEntry, } from "../types/messages" import { removeSessionPermissions, upsertPermission } from "./permission-queue" -import { computeStatus, calcTotalCost, calcContextUsage } from "./session-utils" +import { + computeStatus, + calcContextUsage, + buildFamilyCosts, + buildFamilyLabels, + buildCostBreakdown, +} from "./session-utils" import { Identifier } from "../utils/id" import { resolveModelSelection } from "./model-selection" import { KILO_AUTO, parseModelString } from "../../../src/shared/provider-model" @@ -125,7 +132,7 @@ interface SessionContextValue { clearModelOverride: () => void // Cost and context usage for the current session - totalCost: Accessor + costBreakdown: Accessor> contextUsage: Accessor // Skills loaded from the CLI backend @@ -137,6 +144,13 @@ interface SessionContextValue { agents: Accessor removeMode: (name: string) => void removeMcp: (name: string) => void + + // MCP server status (runtime connect/disconnect) + mcpStatus: Accessor> + mcpLoading: Accessor + connectMcp: (name: string) => void + disconnectMcp: (name: string) => void + refreshMcpStatus: () => void selectedAgent: Accessor selectAgent: (name: string) => void getSessionAgent: (sessionID: string) => string @@ -154,6 +168,9 @@ interface SessionContextValue { revertedCount: Accessor summary: Accessor + // Live worktree diff stats (polled from CLI backend) + worktreeStats: Accessor<{ files: number; additions: number; deletions: number } | undefined> + // Actions revertSession: (messageID: string) => void unrevertSession: () => void @@ -260,12 +277,39 @@ export const SessionProvider: ParentComponent = (props) => { vscode.postMessage({ type: "removeMcp", name }) } + // MCP runtime status + const [mcpStatus, setMcpStatus] = createSignal>({}) + const [mcpLoading, setMcpLoading] = createSignal(null) + + const connectMcp = (name: string) => { + if (mcpLoading()) return + if (!server.isConnected()) return + setMcpLoading(name) + vscode.postMessage({ type: "connectMcp", name }) + } + + const disconnectMcp = (name: string) => { + if (mcpLoading()) return + if (!server.isConnected()) return + setMcpLoading(name) + vscode.postMessage({ type: "disconnectMcp", name }) + } + + const refreshMcpStatus = () => { + vscode.postMessage({ type: "requestMcpStatus" }) + } + // Pending agent selection for before a session exists const [pendingAgentSelection, setPendingAgentSelection] = createSignal(null) // Cloud session preview state const [cloudPreviewId, setCloudPreviewId] = createSignal(null) + // Live worktree diff stats from extension polling + const [worktreeStats, setWorktreeStats] = createSignal< + { files: number; additions: number; deletions: number } | undefined + >() + // Tracks optimistic messageIDs that haven't been confirmed by the server yet. // Prevents handleMessagesLoaded from wiping them when it replaces the array. const pendingOptimistic = new Map>() @@ -466,10 +510,32 @@ export const SessionProvider: ParentComponent = (props) => { vscode.postMessage({ type: "removeSkill", location }) } + // MCP status loaded from CLI backend + const unsubMcpStatus = vscode.onMessage((message: ExtensionMessage) => { + if (message.type === "mcpStatusLoaded") { + setMcpStatus(message.status) + setMcpLoading(null) + } + }) + + // Request MCP status on init with retry (same pattern as agents) + let mcpRetries = 0 + vscode.postMessage({ type: "requestMcpStatus" }) + const mcpRetryTimer = setInterval(() => { + mcpRetries++ + if (Object.keys(mcpStatus()).length > 0 || mcpRetries >= 5) { + clearInterval(mcpRetryTimer) + return + } + vscode.postMessage({ type: "requestMcpStatus" }) + }, 500) + onCleanup(() => { unsubAgents() unsubSkills() + unsubMcpStatus() clearInterval(agentRetryTimer) + clearInterval(mcpRetryTimer) }) // Variant (thinking effort) selection — keyed by "providerID/modelID" @@ -572,6 +638,12 @@ export const SessionProvider: ParentComponent = (props) => { handleQuestionError(message.requestID) break + case "clearPendingPrompts": + setPermissions([]) + setQuestions([]) + setRespondingPermissions(new Set()) + break + case "sessionsLoaded": handleSessionsLoaded(message.sessions) break @@ -636,6 +708,10 @@ export const SessionProvider: ParentComponent = (props) => { }) console.error("[Kilo New] Cloud session import failed:", message.error) break + + case "worktreeStatsLoaded": + setWorktreeStats({ files: message.files, additions: message.additions, deletions: message.deletions }) + break } }) @@ -1380,18 +1456,24 @@ export const SessionProvider: ParentComponent = (props) => { function replyToQuestion(requestID: string, answers: string[][]) { clearQuestionError(requestID) + const question = questions().find((item) => item.id === requestID) + const sessionID = question?.sessionID ?? currentSessionID() ?? "" vscode.postMessage({ type: "questionReply", requestID, + sessionID, answers, }) } function rejectQuestion(requestID: string) { clearQuestionError(requestID) + const question = questions().find((item) => item.id === requestID) + const sessionID = question?.sessionID ?? currentSessionID() ?? "" vscode.postMessage({ type: "questionReject", requestID, + sessionID, }) } @@ -1556,7 +1638,27 @@ export const SessionProvider: ParentComponent = (props) => { .sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime()), ) - const totalCost = createMemo(() => calcTotalCost(messages())) + /** Per-session cost — only reads store.messages (not parts). */ + const familyCosts = createMemo>(() => { + const id = currentSessionID() + if (!id) return new Map() + return buildFamilyCosts(sessionFamily(id), store.messages) + }) + + /** Child session labels — only reads store.parts (not message costs). */ + const familyLabels = createMemo>(() => { + const id = currentSessionID() + if (!id) return new Map() + return buildFamilyLabels(sessionFamily(id), store.messages as any, store.parts as any) + }) + + /** Combined cost breakdown with labels. */ + const costBreakdown = createMemo>(() => { + const id = currentSessionID() + const costs = familyCosts() + if (!id || costs.size === 0) return [] + return buildCostBreakdown(id, costs, familyLabels(), language.t("context.stats.thisSession")) + }) // Status text derived from last assistant message parts const statusText = createMemo(() => { @@ -1611,7 +1713,7 @@ export const SessionProvider: ParentComponent = (props) => { selectModel, hasModelOverride, clearModelOverride, - totalCost, + costBreakdown, contextUsage, agents, skills, @@ -1619,6 +1721,11 @@ export const SessionProvider: ParentComponent = (props) => { removeSkill, removeMode, removeMcp, + mcpStatus, + mcpLoading, + connectMcp, + disconnectMcp, + refreshMcpStatus, selectedAgent: selectedAgentName, selectAgent, getSessionAgent: (sessionID: string) => store.agentSelections[sessionID] ?? defaultAgent(), @@ -1650,6 +1757,7 @@ export const SessionProvider: ParentComponent = (props) => { revert, revertedCount, summary, + worktreeStats, revertSession, unrevertSession, sendMessage, diff --git a/packages/kilo-vscode/webview-ui/src/hooks/useFileMention.ts b/packages/kilo-vscode/webview-ui/src/hooks/useFileMention.ts index f87a9567441..79f5d697f3a 100644 --- a/packages/kilo-vscode/webview-ui/src/hooks/useFileMention.ts +++ b/packages/kilo-vscode/webview-ui/src/hooks/useFileMention.ts @@ -132,6 +132,7 @@ export function useFileMention(vscode: VSCodeContext): FileMention { onSelect?: () => void, ): boolean => { if (!showMention()) return false + if (e.isComposing) return false if (e.key === "ArrowDown") { e.preventDefault() diff --git a/packages/kilo-vscode/webview-ui/src/hooks/useSlashCommand.ts b/packages/kilo-vscode/webview-ui/src/hooks/useSlashCommand.ts index 4835b6e1757..b546cadfce2 100644 --- a/packages/kilo-vscode/webview-ui/src/hooks/useSlashCommand.ts +++ b/packages/kilo-vscode/webview-ui/src/hooks/useSlashCommand.ts @@ -183,6 +183,7 @@ export function useSlashCommand(vscode: VSCodeContext, exclude?: Set): S onSelect?: () => void, ): boolean => { if (!show()) return false + if (e.isComposing) return false const filtered = results() diff --git a/packages/kilo-vscode/webview-ui/src/i18n/ar.ts b/packages/kilo-vscode/webview-ui/src/i18n/ar.ts index 8416cc7f23b..96e3deb074d 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/ar.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/ar.ts @@ -266,6 +266,7 @@ export const dict = { "mcp.status.connected": "متصل", "mcp.status.failed": "فشل", "mcp.status.needs_auth": "يحتاج إلى مصادقة", + "mcp.status.needs_registration": "يحتاج إلى تسجيل العميل", "mcp.status.disabled": "معطل", "dialog.fork.empty": "لا توجد رسائل للتفرع منها", @@ -745,6 +746,20 @@ export const dict = { "provider.custom.models.name.placeholder": "الاسم المعروض", "provider.custom.models.remove": "إزالة النموذج", "provider.custom.models.add": "إضافة نموذج", + "provider.custom.models.fetch": "جلب النماذج", + "provider.custom.models.fetching": "جارٍ الجلب\u2026", + "provider.custom.models.fetch.error": "فشل جلب النماذج: {{error}}", + "provider.custom.models.fetch.authError": "فشلت المصادقة. تحقق من مفتاح API أعلاه وحاول مرة أخرى.", + "provider.custom.models.fetch.empty": "لم يتم العثور على نماذج على هذا الخادم.", + "provider.custom.models.fetch.added": "تمت إضافة {{count}} نموذج(نماذج).", + "provider.custom.models.fetch.allExist": "جميع النماذج المجلوبة مضافة بالفعل.", + "provider.custom.models.fetch.selectAll": "تحديد الكل", + "provider.custom.models.fetch.deselectAll": "إلغاء تحديد الكل", + "provider.custom.models.fetch.found": "تم العثور على {{count}} نموذج", + "provider.custom.models.fetch.showing": "عرض {{shown}} من {{total}}", + "provider.custom.models.fetch.search": "البحث في النماذج\u2026", + "provider.custom.models.fetch.add": "إضافة {{count}} نموذج(نماذج)", + "provider.custom.edit.title": "تعديل المزود", "provider.custom.headers.label": "الرؤوس (اختياري)", "provider.custom.headers.key.label": "الرأس", "provider.custom.headers.key.placeholder": "Header-Name", @@ -903,8 +918,7 @@ export const dict = { "settings.autocomplete.title": "الإكمال التلقائي", "settings.notifications.title": "الإشعارات", "settings.context.title": "السياق", - "settings.terminal.title": "المحطة الطرفية", - "settings.prompts.title": "الموجهات", + "settings.experimental.title": "تجريبي", "settings.language.title": "اللغة", "settings.aboutKiloCode.title": "حول Kilo Code", @@ -925,6 +939,7 @@ export const dict = { "prompt.placeholder.default": "اكتب رسالة... (Enter للإرسال، Shift+Enter لسطر جديد)", "context.usage.sessionCost": "تكلفة الجلسة", + "context.stats.thisSession": "هذه الجلسة", "time.justNow": "الآن", "time.minutesAgo": "قبل {{count}} دقيقة", @@ -953,8 +968,18 @@ export const dict = { "settings.aboutKiloCode.support.prefix": "لأسئلة الفوترة أو الحساب، تواصل مع دعم العملاء على", "settings.aboutKiloCode.resetSettings.title": "إعادة تعيين الإعدادات", "settings.aboutKiloCode.resetSettings.description": - "إعادة تعيين جميع إعدادات إضافة Kilo Code إلى قيمها الافتراضية. لا يؤثر هذا على تكوين CLI أو الواجهة الخلفية.", + "يؤدي هذا إلى إعادة تعيين الإعدادات الخاصة بامتداد VS Code فقط إلى قيمها الافتراضية. الإعدادات المشتركة مع CLI، مثل الأوضاع وقواعد الموافقة التلقائية، مخزّنة في تكوين CLI ولن تتأثر.", "settings.aboutKiloCode.resetSettings.button": "إعادة تعيين جميع الإعدادات", + "settings.aboutKiloCode.settingsTransfer.title": "نقل الإعدادات", + "settings.aboutKiloCode.settingsTransfer.description": "تصدير أو استيراد إعداداتك لنقلها بين نُسخ VS Code.", + "settings.aboutKiloCode.exportSettings": "تصدير", + "settings.aboutKiloCode.importSettings": "استيراد", + "settings.aboutKiloCode.importSettings.invalidJson": "ملف JSON غير صالح. يرجى اختيار ملف إعدادات صالح.", + "settings.aboutKiloCode.importSettings.invalidConfig": "الملف لا يحتوي على إعدادات Kilo صالحة.", + "settings.aboutKiloCode.importSettings.tooLarge": "الملف كبير جدًا. يجب أن تكون ملفات الإعدادات أقل من 1 MB.", + "settings.aboutKiloCode.importSettings.newerVersion": + "تم تصدير هذا الملف من إصدار أحدث من Kilo. قد يتم تجاهل بعض الإعدادات.", + "settings.aboutKiloCode.importSettings.success": "تم استيراد الإعدادات. راجع التغييرات أعلاه، ثم انقر على حفظ.", "settings.agentBehaviour.subtab.modes": "الأوضاع", "settings.agentBehaviour.subtab.agents": "Agents", @@ -978,8 +1003,7 @@ export const dict = { "common.add": "إضافة", "common.choose": "اختر…", - "settings.notImplemented": "هذا القسم لم يتم تنفيذه بعد.", - "settings.notImplemented.description": "سيحتوي على خيارات التكوين والنص التوضيحي.", + "settings.autocomplete.autoTrigger.title": "تمكين الإكمال التلقائي المضمّن", "settings.autocomplete.autoTrigger.description": "عرض اقتراحات الإكمال المضمّن تلقائياً أثناء الكتابة", "settings.autocomplete.smartKeybinding.title": "تمكين اختصار المهمة المضمّنة الذكي", @@ -1037,6 +1061,13 @@ export const dict = { "settings.agentBehaviour.topP.description": "معامل أخذ العينات النووي (0-1)", "settings.agentBehaviour.maxSteps.title": "الحد الأقصى للخطوات", "settings.agentBehaviour.maxSteps.description": "الحد الأقصى لتكرارات الوكيل", + "settings.agentBehaviour.hidden.title": "مخفي", + "settings.agentBehaviour.hidden.description": "إخفاء هذا الوكيل من مبدل الأوضاع في إدخال الدردشة", + "settings.agentBehaviour.disable.title": "معطل", + "settings.agentBehaviour.disable.description": "تعطيل هذا الوكيل بالكامل — لن يظهر في أي مكان", + "settings.agentBehaviour.badge.hidden": "مخفي", + "settings.agentBehaviour.badge.disabled": "معطل", + "settings.agentBehaviour.badge.deprecated": "مُهمَل", "settings.agentBehaviour.discoveredSkills": "المهارات المكتشفة", "settings.agentBehaviour.noSkillsFound": "لم يتم العثور على مهارات. أضف مسارات مجلدات أو عناوين URL أدناه لإتاحة المهارات.", @@ -1059,12 +1090,20 @@ export const dict = { "settings.agentBehaviour.createMode.nameRequired": "الاسم مطلوب", "settings.agentBehaviour.createMode.nameInvalid": "يجب أن يحتوي الاسم على أحرف صغيرة وأرقام وشرطات فقط", "settings.agentBehaviour.createMode.nameTaken": "يوجد وضع بهذا الاسم بالفعل", + "settings.agentBehaviour.importMode": "استيراد", + "settings.agentBehaviour.importMode.invalidName": + "اسم الوضع في الملف غير صالح. يجب أن يبدأ الاسم بحرف صغير ويحتوي فقط على أحرف صغيرة وأرقام وشرطات.", + "settings.agentBehaviour.importMode.nameTaken": "يوجد وضع بهذا الاسم بالفعل.", + "settings.agentBehaviour.importMode.invalidJson": "ملف JSON غير صالح. يرجى اختيار ملف تعريف وكيل صالح.", + "settings.agentBehaviour.importMode.tooLarge": "الملف كبير جدًا. يجب أن تكون تعريفات الوكيل أقل من 1 ميجابايت.", + "settings.agentBehaviour.exportMode": "تصدير تعريف الوكيل", "settings.agentBehaviour.editMode": "تعديل الوضع", "settings.agentBehaviour.editMode.description": "الوصف", "settings.agentBehaviour.editMode.prompt": "موجه النظام", "settings.agentBehaviour.editMode.save": "تم", "settings.agentBehaviour.editMode.back": "العودة إلى القائمة", - "settings.agentBehaviour.editMode.native": "وضع مدمج (تعريف للقراءة فقط)", + "settings.agentBehaviour.editMode.native": + "هذا وضع مضمن. لا يمكن تغيير تعريفه الأساسي، ولكن يمكنك تكوين التجاوزات أدناه.", "settings.agentBehaviour.editMode.promptOverride": "تجاوز موجه مخصص لهذا الوضع المدمج", "settings.agentBehaviour.removeMode.title": "إزالة الوضع", "settings.agentBehaviour.removeMode.confirm": @@ -1073,6 +1112,19 @@ export const dict = { "settings.agentBehaviour.removeMcp.title": "إزالة خادم MCP", "settings.agentBehaviour.removeMcp.confirm": 'هل تريد إزالة خادم MCP "{{name}}"؟ سيؤدي هذا إلى إزالته من الإعدادات.', "settings.agentBehaviour.removeMcp.button": "إزالة", + "settings.agentBehaviour.editMcp": "تعديل خادم MCP", + "settings.agentBehaviour.editMcp.transportLocal": "خادم محلي (نقل stdio)", + "settings.agentBehaviour.editMcp.transportRemote": "خادم بعيد (نقل SSE/HTTP)", + "settings.agentBehaviour.editMcp.env": "متغيرات البيئة", + "settings.agentBehaviour.editMcp.env.help": "المتغيرات التي يتم تمريرها إلى عملية خادم MCP.", + "settings.agentBehaviour.addMcp.command": "الأمر", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "الوسائط", + "settings.agentBehaviour.addMcp.args.help": + "وسيطة واحدة لكل سطر. يتم الحفاظ على المسارات التي تحتوي على مسافات كما هي.", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "عنوان URL للخادم", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", "settings.agentBehaviour.skillPaths": "مسارات مجلدات المهارات", "settings.agentBehaviour.skillUrls": "عناوين URL للمهارات", "settings.agentBehaviour.removeSkill.title": "إزالة المهارة", @@ -1087,14 +1139,16 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "الوسائط", "settings.agentBehaviour.mcpDetail.env": "البيئة", "settings.agentBehaviour.mcpDetail.disabled": "هذا الخادم معطّل.", - "settings.agentBehaviour.mcpEmpty": "لم يتم تهيئة خوادم MCP. قم بتحرير ملف تهيئة opencode لإضافة خوادم MCP.", + "settings.agentBehaviour.mcpBrowseMarketplace": "تصفح Marketplace", + "settings.agentBehaviour.mcpEmpty": + "لم يتم تهيئة خوادم MCP. أضف خوادم MCP في kilo.jsonc، أو اطلب من الوكيل إضافتها لك.", "settings.agentBehaviour.workflowsPlaceholder": "تُدار سير العمل عبر ملفات سير العمل في مساحة العمل.", "settings.agentBehaviour.workflows.description": "سير العمل هي أوامر شرطة مائلة مخصصة محددة في التهيئة الخاصة بك. اكتب /command-name في الدردشة لتشغيلها. يتم تهيئة الأوامر في opencode.json ضمن قسم 'command'.", "settings.agentBehaviour.workflows.empty": "لم يتم تهيئة أوامر مخصصة. أضف أوامر إلى opencode.json لرؤيتها هنا.", "settings.agentBehaviour.workflows.detail.description": "الوصف", "settings.agentBehaviour.workflows.detail.template": "القالب", - "settings.agentBehaviour.notImplemented": "لم يتم التنفيذ بعد.", + "settings.autoApprove.description": "تحديد كيفية السماح بتشغيل الأدوات. معظم الأدوات معينة افتراضياً على السماح. doom_loop و external_directory معينة افتراضياً على السؤال.", "settings.autoApprove.level.allow": "سماح", @@ -1144,7 +1198,8 @@ export const dict = { "settings.providers.defaultModel.title": "النموذج الافتراضي", "settings.providers.defaultModel.description": "النموذج الأساسي للمحادثات", "settings.providers.smallModel.title": "نموذج صغير", - "settings.providers.smallModel.description": "نموذج خفيف لتوليد العناوين والمهام السريعة", + "settings.providers.smallModel.description": + "نموذج خفيف لتوليد العناوين ورسائل الـ commit وتحسين المطالبات والمهام السريعة الأخرى", "settings.providers.disabled": "مزودون معطلون", "settings.providers.disabled.description": "مزودون لإخفائهم من القائمة", "settings.providers.enabled": "مزودون مفعلون (قائمة بيضاء)", @@ -1167,7 +1222,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "ما الجديد في Kilo Code", - "migration.whatsNew.badge": "Beta", "migration.whatsNew.subtitle": "لقد أعدنا بناء الإضافة على أساس أسرع وأكثر كفاءة.", "migration.whatsNew.features.performance.title": "أداء أسرع للوكيل", "migration.whatsNew.features.performance.detail": @@ -1192,7 +1246,6 @@ export const dict = { "migration.migrate.chatHistoryDesc": "غير متوافق مع البنية الجديدة", "migration.migrate.button": "ترحيل الإعدادات", "migration.migrate.skip": "تخطي", - "migration.migrate.back": "رجوع", "migration.migrate.keysDetected": "تم اكتشاف {{count}} مفاتيح", "migration.migrate.serversConfigured": "تم تكوين {{count}} خادم(خوادم)", "migration.migrate.modesFound": "تم العثور على {{count}} وضع(أوضاع)", @@ -1213,6 +1266,11 @@ export const dict = { "migration.complete.cleanupDescription": "هذا يزيل الإعدادات القديمة من مساحة تخزين VS Code. لن تتمكن من إعادة تشغيل هذا الترحيل.", "migration.complete.done": "تم", + "migration.migrate.sessionsDetected": "تم اكتشاف {{count}} جلسة", + "migration.error.sessionFailed": "فشل ترحيل الجلسة", + "migration.error.continue": "متابعة", + "migration.error.action.copy": "نسخ", + "migration.error.toast.copied": "تم نسخ الخطأ إلى الحافظة", // legacy-migration end "error.details.show": "التفاصيل", @@ -1226,8 +1284,7 @@ export const dict = { "settings.saveBar.warning.many": "عدة جلسات تعمل وستتوقف", "settings.saveBar.saveAnyway": "حفظ على أي حال", "settings.saveBar.cancel": "إلغاء", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "التالي", + "notifications.action.close": "إغلاق", + "notifications.action.tryModel": "جرّب {{model}}", } diff --git a/packages/kilo-vscode/webview-ui/src/i18n/br.ts b/packages/kilo-vscode/webview-ui/src/i18n/br.ts index 6a195aaa1b0..7b62a18e627 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/br.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/br.ts @@ -266,6 +266,7 @@ export const dict = { "mcp.status.connected": "conectado", "mcp.status.failed": "falhou", "mcp.status.needs_auth": "precisa de autenticação", + "mcp.status.needs_registration": "precisa de registro do cliente", "mcp.status.disabled": "desabilitado", "dialog.fork.empty": "Nenhuma mensagem para bifurcar", @@ -752,6 +753,20 @@ export const dict = { "provider.custom.models.name.placeholder": "Nome de Exibição", "provider.custom.models.remove": "Remover modelo", "provider.custom.models.add": "Adicionar modelo", + "provider.custom.models.fetch": "Buscar modelos", + "provider.custom.models.fetching": "Buscando\u2026", + "provider.custom.models.fetch.error": "Falha ao buscar modelos: {{error}}", + "provider.custom.models.fetch.authError": "Falha na autenticação. Verifique a chave de API acima e tente novamente.", + "provider.custom.models.fetch.empty": "Nenhum modelo encontrado neste servidor.", + "provider.custom.models.fetch.added": "{{count}} modelo(s) adicionado(s).", + "provider.custom.models.fetch.allExist": "Todos os modelos buscados já foram adicionados.", + "provider.custom.models.fetch.selectAll": "Selecionar todos", + "provider.custom.models.fetch.deselectAll": "Desmarcar todos", + "provider.custom.models.fetch.found": "{{count}} modelos encontrados", + "provider.custom.models.fetch.showing": "Mostrando {{shown}} de {{total}}", + "provider.custom.models.fetch.search": "Pesquisar modelos\u2026", + "provider.custom.models.fetch.add": "Adicionar {{count}} modelo(s)", + "provider.custom.edit.title": "Editar provedor", "provider.custom.headers.label": "Headers (opcional)", "provider.custom.headers.key.label": "Header", "provider.custom.headers.key.placeholder": "Header-Name", @@ -911,8 +926,7 @@ export const dict = { "settings.autocomplete.title": "Autocompletar", "settings.notifications.title": "Notificações", "settings.context.title": "Contexto", - "settings.terminal.title": "Terminal", - "settings.prompts.title": "Prompts", + "settings.experimental.title": "Experimental", "settings.language.title": "Idioma", "settings.aboutKiloCode.title": "Sobre o Kilo Code", @@ -933,6 +947,7 @@ export const dict = { "prompt.placeholder.default": "Digite uma mensagem... (Enter para enviar, Shift+Enter para nova linha)", "context.usage.sessionCost": "Custo da sessão", + "context.stats.thisSession": "Esta sessão", "time.justNow": "agora mesmo", "time.minutesAgo": "{{count}} min atrás", @@ -962,8 +977,22 @@ export const dict = { "Para questões de cobrança ou conta, entre em contato com o Suporte ao Cliente em", "settings.aboutKiloCode.resetSettings.title": "Redefinir Configurações", "settings.aboutKiloCode.resetSettings.description": - "Redefinir todas as configurações da extensão Kilo Code para os valores padrão. Isso não afeta a configuração do CLI ou do backend.", + "Isso redefine apenas as configurações específicas da extensão VS Code para seus valores padrão. As configurações compartilhadas com o CLI, como modos e regras de aprovação automática, são armazenadas na configuração do CLI e não serão redefinidas.", "settings.aboutKiloCode.resetSettings.button": "Redefinir Todas as Configurações", + "settings.aboutKiloCode.settingsTransfer.title": "Transferência de configurações", + "settings.aboutKiloCode.settingsTransfer.description": + "Exporte ou importe suas configurações para transferi-las entre instâncias do VS Code.", + "settings.aboutKiloCode.exportSettings": "Exportar", + "settings.aboutKiloCode.importSettings": "Importar", + "settings.aboutKiloCode.importSettings.invalidJson": + "Arquivo JSON inválido. Selecione um arquivo de configurações válido.", + "settings.aboutKiloCode.importSettings.invalidConfig": "O arquivo não contém configurações válidas do Kilo.", + "settings.aboutKiloCode.importSettings.tooLarge": + "O arquivo é muito grande. Arquivos de configurações devem ter menos de 1 MB.", + "settings.aboutKiloCode.importSettings.newerVersion": + "Este arquivo foi exportado de uma versão mais recente do Kilo. Algumas configurações podem ser ignoradas.", + "settings.aboutKiloCode.importSettings.success": + "Configurações importadas. Revise as alterações acima e clique em Salvar.", "settings.agentBehaviour.subtab.modes": "Modos", "settings.agentBehaviour.subtab.agents": "Agents", @@ -989,8 +1018,7 @@ export const dict = { "common.add": "Adicionar", "common.choose": "Escolher…", - "settings.notImplemented": "Esta seção ainda não foi implementada.", - "settings.notImplemented.description": "Conterá opções de configuração e texto explicativo.", + "settings.autocomplete.autoTrigger.title": "Ativar completamento automático inline", "settings.autocomplete.autoTrigger.description": "Mostrar automaticamente sugestões de completamento inline ao digitar", @@ -1050,6 +1078,14 @@ export const dict = { "settings.agentBehaviour.topP.description": "Parâmetro de amostragem nucleus (0-1)", "settings.agentBehaviour.maxSteps.title": "Passos máximos", "settings.agentBehaviour.maxSteps.description": "Iterações máximas do agente", + "settings.agentBehaviour.hidden.title": "Oculto", + "settings.agentBehaviour.hidden.description": "Ocultar este agente do seletor de modos na entrada do chat", + "settings.agentBehaviour.disable.title": "Desativado", + "settings.agentBehaviour.disable.description": + "Desativar completamente este agente — ele não aparecerá em nenhum lugar", + "settings.agentBehaviour.badge.hidden": "oculto", + "settings.agentBehaviour.badge.disabled": "desativado", + "settings.agentBehaviour.badge.deprecated": "Descontinuado", "settings.agentBehaviour.discoveredSkills": "Habilidades descobertas", "settings.agentBehaviour.noSkillsFound": "Nenhuma habilidade encontrada. Adicione caminhos de pastas ou URLs abaixo para disponibilizar habilidades.", @@ -1072,12 +1108,21 @@ export const dict = { "settings.agentBehaviour.createMode.nameRequired": "Nome é obrigatório", "settings.agentBehaviour.createMode.nameInvalid": "O nome deve conter apenas letras minúsculas, números e hífens", "settings.agentBehaviour.createMode.nameTaken": "Já existe um modo com este nome", + "settings.agentBehaviour.importMode": "Importar", + "settings.agentBehaviour.importMode.invalidName": + "Nome de modo inválido no arquivo. O nome deve começar com uma letra minúscula e conter apenas letras minúsculas, números e hífens.", + "settings.agentBehaviour.importMode.nameTaken": "Já existe um modo com este nome.", + "settings.agentBehaviour.importMode.invalidJson": + "Arquivo JSON inválido. Por favor, selecione um arquivo de definição de agente válido.", + "settings.agentBehaviour.importMode.tooLarge": "Arquivo muito grande. Definições de agente devem ter menos de 1 MB.", + "settings.agentBehaviour.exportMode": "Exportar definição do agente", "settings.agentBehaviour.editMode": "Editar Modo", "settings.agentBehaviour.editMode.description": "Descrição", "settings.agentBehaviour.editMode.prompt": "Prompt do Sistema", "settings.agentBehaviour.editMode.save": "Concluído", "settings.agentBehaviour.editMode.back": "Voltar à lista", - "settings.agentBehaviour.editMode.native": "Modo integrado (definição somente leitura)", + "settings.agentBehaviour.editMode.native": + "Este é um modo embutido. Sua definição base não pode ser alterada, mas você pode configurar as sobrescritas abaixo.", "settings.agentBehaviour.editMode.promptOverride": "Substituição de prompt personalizado para este modo integrado", "settings.agentBehaviour.removeMode.title": "Remover modo", "settings.agentBehaviour.removeMode.confirm": @@ -1087,6 +1132,19 @@ export const dict = { "settings.agentBehaviour.removeMcp.confirm": 'Remover o servidor MCP "{{name}}"? Isso o removerá da sua configuração.', "settings.agentBehaviour.removeMcp.button": "Remover", + "settings.agentBehaviour.editMcp": "Editar Servidor MCP", + "settings.agentBehaviour.editMcp.transportLocal": "Servidor local (transporte stdio)", + "settings.agentBehaviour.editMcp.transportRemote": "Servidor remoto (transporte SSE/HTTP)", + "settings.agentBehaviour.editMcp.env": "Variáveis de Ambiente", + "settings.agentBehaviour.editMcp.env.help": "Variáveis passadas para o processo do servidor MCP.", + "settings.agentBehaviour.addMcp.command": "Comando", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "Argumentos", + "settings.agentBehaviour.addMcp.args.help": + "Um argumento por linha. Caminhos com espaços são preservados como estão.", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "URL do Servidor", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", "settings.agentBehaviour.skillPaths": "Caminhos de pastas de habilidades", "settings.agentBehaviour.skillUrls": "URLs de habilidades", "settings.agentBehaviour.removeSkill.title": "Remover habilidade", @@ -1102,8 +1160,9 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "Argumentos", "settings.agentBehaviour.mcpDetail.env": "Ambiente", "settings.agentBehaviour.mcpDetail.disabled": "Este servidor está desativado.", + "settings.agentBehaviour.mcpBrowseMarketplace": "Explorar Marketplace", "settings.agentBehaviour.mcpEmpty": - "Nenhum servidor MCP configurado. Edite o arquivo de configuração do opencode para adicionar servidores MCP.", + "Nenhum servidor MCP configurado. Adicione servidores MCP em kilo.jsonc ou peça ao agente para adicioná-los.", "settings.agentBehaviour.workflowsPlaceholder": "Fluxos de trabalho são gerenciados por arquivos de fluxo de trabalho no espaço de trabalho.", "settings.agentBehaviour.workflows.description": @@ -1112,7 +1171,7 @@ export const dict = { "Nenhum comando personalizado configurado. Adicione comandos ao opencode.json para vê-los aqui.", "settings.agentBehaviour.workflows.detail.description": "Descrição", "settings.agentBehaviour.workflows.detail.template": "Modelo", - "settings.agentBehaviour.notImplemented": "Ainda não implementado.", + "settings.autoApprove.description": "Defina como as ferramentas têm permissão para serem executadas. A maioria das ferramentas tem o padrão Permitir. doom_loop e external_directory têm o padrão Perguntar.", "settings.autoApprove.level.allow": "Permitir", @@ -1168,7 +1227,8 @@ export const dict = { "settings.providers.defaultModel.title": "Modelo padrão", "settings.providers.defaultModel.description": "Modelo principal para conversas", "settings.providers.smallModel.title": "Modelo pequeno", - "settings.providers.smallModel.description": "Modelo leve para geração de títulos e tarefas rápidas", + "settings.providers.smallModel.description": + "Modelo leve para geração de títulos, mensagens de commit, aprimoramento de prompts e outras tarefas rápidas", "settings.providers.disabled": "Provedores desativados", "settings.providers.disabled.description": "Provedores a ocultar da lista", "settings.providers.enabled": "Provedores ativados (lista branca)", @@ -1191,7 +1251,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "O Que Há de Novo no Kilo Code", - "migration.whatsNew.badge": "Beta", "migration.whatsNew.subtitle": "Reconstruímos a extensão sobre uma base mais rápida e eficiente.", "migration.whatsNew.features.performance.title": "Desempenho de Agente Mais Rápido", "migration.whatsNew.features.performance.detail": @@ -1216,7 +1275,6 @@ export const dict = { "migration.migrate.chatHistoryDesc": "Incompatível com a nova arquitetura", "migration.migrate.button": "Migrar Configurações", "migration.migrate.skip": "Pular", - "migration.migrate.back": "Voltar", "migration.migrate.keysDetected": "{{count}} chaves detectadas", "migration.migrate.serversConfigured": "{{count}} servidor(es) configurado(s)", "migration.migrate.modesFound": "{{count}} modo(s) encontrado(s)", @@ -1237,6 +1295,11 @@ export const dict = { "migration.complete.cleanupDescription": "Isso remove as configurações antigas do armazenamento do VS Code. Você não poderá executar esta migração novamente.", "migration.complete.done": "Concluído", + "migration.migrate.sessionsDetected": "{{count}} sessões detectadas", + "migration.error.sessionFailed": "Falha na migração da sessão", + "migration.error.continue": "Continuar", + "migration.error.action.copy": "Copiar", + "migration.error.toast.copied": "Erro copiado para a área de transferência", // legacy-migration end "error.details.show": "Detalhes", @@ -1250,8 +1313,7 @@ export const dict = { "settings.saveBar.warning.many": "Várias sessões estão em execução e serão interrompidas", "settings.saveBar.saveAnyway": "Salvar mesmo assim", "settings.saveBar.cancel": "Cancelar", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "Próximo", + "notifications.action.close": "Fechar", + "notifications.action.tryModel": "Experimentar {{model}}", } diff --git a/packages/kilo-vscode/webview-ui/src/i18n/bs.ts b/packages/kilo-vscode/webview-ui/src/i18n/bs.ts index 83e392192b0..3c5100613fa 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/bs.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/bs.ts @@ -268,6 +268,7 @@ export const dict = { "mcp.status.connected": "povezano", "mcp.status.failed": "neuspjelo", "mcp.status.needs_auth": "potrebna autentifikacija", + "mcp.status.needs_registration": "potrebna registracija klijenta", "mcp.status.disabled": "onemogućeno", "dialog.fork.empty": "Nema poruka za fork", @@ -757,6 +758,21 @@ export const dict = { "provider.custom.models.name.placeholder": "Naziv za prikaz", "provider.custom.models.remove": "Ukloni model", "provider.custom.models.add": "Dodaj model", + "provider.custom.models.fetch": "Preuzmi modele", + "provider.custom.models.fetching": "Preuzimanje\u2026", + "provider.custom.models.fetch.error": "Preuzimanje modela nije uspjelo: {{error}}", + "provider.custom.models.fetch.authError": + "Autentifikacija nije uspjela. Provjerite API ključ iznad i pokušajte ponovo.", + "provider.custom.models.fetch.empty": "Nisu pronađeni modeli na ovom serveru.", + "provider.custom.models.fetch.added": "Dodano {{count}} model(a).", + "provider.custom.models.fetch.allExist": "Svi preuzeti modeli su već dodani.", + "provider.custom.models.fetch.selectAll": "Odaberi sve", + "provider.custom.models.fetch.deselectAll": "Poništi odabir", + "provider.custom.models.fetch.found": "{{count}} modela pronađeno", + "provider.custom.models.fetch.showing": "Prikazano {{shown}} od {{total}}", + "provider.custom.models.fetch.search": "Pretraži modele\u2026", + "provider.custom.models.fetch.add": "Dodaj {{count}} model(a)", + "provider.custom.edit.title": "Uredi provajdera", "provider.custom.headers.label": "Zaglavlja (opcionalno)", "provider.custom.headers.key.label": "Zaglavlje", "provider.custom.headers.key.placeholder": "Header-Name", @@ -915,8 +931,7 @@ export const dict = { "settings.autocomplete.title": "Automatsko dovršavanje", "settings.notifications.title": "Obavještenja", "settings.context.title": "Kontekst", - "settings.terminal.title": "Terminal", - "settings.prompts.title": "Upiti", + "settings.experimental.title": "Eksperimentalno", "settings.language.title": "Jezik", "settings.aboutKiloCode.title": "O Kilo Code-u", @@ -937,6 +952,7 @@ export const dict = { "prompt.placeholder.default": "Unesite poruku... (Enter za slanje, Shift+Enter za novi red)", "context.usage.sessionCost": "Cijena sesije", + "context.stats.thisSession": "Ova sesija", "time.justNow": "upravo sada", "time.minutesAgo": "prije {{count}} min", @@ -965,8 +981,20 @@ export const dict = { "settings.aboutKiloCode.support.prefix": "Za pitanja o naplati ili računu, kontaktirajte korisničku podršku na", "settings.aboutKiloCode.resetSettings.title": "Resetovanje postavki", "settings.aboutKiloCode.resetSettings.description": - "Resetujte sve postavke Kilo Code ekstenzije na zadane vrijednosti. Ovo ne utiče na CLI ili backend konfiguraciju.", + "Ovo resetuje samo postavke specifične za VS Code ekstenziju na njihove zadane vrijednosti. Postavke koje se dijele s CLI-jem, kao što su načini rada i pravila automatskog odobravanja, pohranjene su u CLI konfiguraciji i neće biti resetovane.", "settings.aboutKiloCode.resetSettings.button": "Resetuj sve postavke", + "settings.aboutKiloCode.settingsTransfer.title": "Prijenos postavki", + "settings.aboutKiloCode.settingsTransfer.description": + "Izvezite ili uvezite postavke za prijenos između VS Code instanci.", + "settings.aboutKiloCode.exportSettings": "Izvezi", + "settings.aboutKiloCode.importSettings": "Uvezi", + "settings.aboutKiloCode.importSettings.invalidJson": "Nevažeći JSON fajl. Odaberite važeći fajl s postavkama.", + "settings.aboutKiloCode.importSettings.invalidConfig": "Fajl ne sadrži važeće Kilo postavke.", + "settings.aboutKiloCode.importSettings.tooLarge": "Fajl je prevelik. Fajlovi s postavkama moraju biti manji od 1 MB.", + "settings.aboutKiloCode.importSettings.newerVersion": + "Ovaj fajl je izvezen iz novije verzije Kilo-a. Neke postavke mogu biti zanemarene.", + "settings.aboutKiloCode.importSettings.success": + "Postavke su uvezene. Pregledajte promjene iznad, a zatim kliknite Sačuvaj.", "settings.agentBehaviour.subtab.modes": "Modovi", "settings.agentBehaviour.subtab.agents": "Agents", @@ -991,8 +1019,7 @@ export const dict = { "common.add": "Dodaj", "common.choose": "Odaberi…", - "settings.notImplemented": "Ovaj dio još nije implementiran.", - "settings.notImplemented.description": "Sadržavat će opcije konfiguracije i objašnjenje.", + "settings.autocomplete.autoTrigger.title": "Omogući automatsko inline dovršavanje", "settings.autocomplete.autoTrigger.description": "Automatski prikaži prijedloge inline dovršavanja tokom tipkanja", "settings.autocomplete.smartKeybinding.title": "Omogući pametnu prečicu inline zadatka", @@ -1050,6 +1077,13 @@ export const dict = { "settings.agentBehaviour.topP.description": "Nucleus parametar uzorkovanja (0-1)", "settings.agentBehaviour.maxSteps.title": "Maks. koraci", "settings.agentBehaviour.maxSteps.description": "Maksimalne iteracije agenta", + "settings.agentBehaviour.hidden.title": "Skriveno", + "settings.agentBehaviour.hidden.description": "Sakrij ovog agenta iz prebacivača modova u unosu chata", + "settings.agentBehaviour.disable.title": "Onemogućeno", + "settings.agentBehaviour.disable.description": "Potpuno onemogući ovog agenta — neće se pojaviti nigdje", + "settings.agentBehaviour.badge.hidden": "skriveno", + "settings.agentBehaviour.badge.disabled": "onemogućeno", + "settings.agentBehaviour.badge.deprecated": "Zastarjelo", "settings.agentBehaviour.discoveredSkills": "Otkrivene vještine", "settings.agentBehaviour.noSkillsFound": "Nisu pronađene vještine. Dodajte putanje mapa ili URL-ove ispod kako biste učinili vještine dostupnim.", @@ -1072,12 +1106,21 @@ export const dict = { "settings.agentBehaviour.createMode.nameRequired": "Naziv je obavezan", "settings.agentBehaviour.createMode.nameInvalid": "Naziv smije sadržavati samo mala slova, brojeve i crtice", "settings.agentBehaviour.createMode.nameTaken": "Mod s ovim nazivom već postoji", + "settings.agentBehaviour.importMode": "Uvezi", + "settings.agentBehaviour.importMode.invalidName": + "Nevažeći naziv moda u datoteci. Naziv mora počinjati malim slovom i sadržavati samo mala slova, brojeve i crtice.", + "settings.agentBehaviour.importMode.nameTaken": "Mod s ovim nazivom već postoji.", + "settings.agentBehaviour.importMode.invalidJson": + "Nevažeća JSON datoteka. Molimo odaberite važeću datoteku definicije agenta.", + "settings.agentBehaviour.importMode.tooLarge": "Datoteka je prevelika. Definicije agenta moraju biti manje od 1 MB.", + "settings.agentBehaviour.exportMode": "Izvezi definiciju agenta", "settings.agentBehaviour.editMode": "Uredi mod", "settings.agentBehaviour.editMode.description": "Opis", "settings.agentBehaviour.editMode.prompt": "Sistemski prompt", "settings.agentBehaviour.editMode.save": "Gotovo", "settings.agentBehaviour.editMode.back": "Nazad na listu", - "settings.agentBehaviour.editMode.native": "Ugrađeni mod (definicija samo za čitanje)", + "settings.agentBehaviour.editMode.native": + "Ovo je ugrađeni način rada. Njegova osnovna definicija ne može se mijenjati, ali ispod možete konfigurirati nadjačavanja.", "settings.agentBehaviour.editMode.promptOverride": "Prilagođeno nadjačavanje prompta za ovaj ugrađeni mod", "settings.agentBehaviour.removeMode.title": "Ukloni mod", "settings.agentBehaviour.removeMode.confirm": @@ -1087,6 +1130,18 @@ export const dict = { "settings.agentBehaviour.removeMcp.confirm": 'Ukloniti MCP server "{{name}}"? Ovo će ga ukloniti iz vaše konfiguracije.', "settings.agentBehaviour.removeMcp.button": "Ukloni", + "settings.agentBehaviour.editMcp": "Uredi MCP Server", + "settings.agentBehaviour.editMcp.transportLocal": "Lokalni server (stdio transport)", + "settings.agentBehaviour.editMcp.transportRemote": "Udaljeni server (SSE/HTTP transport)", + "settings.agentBehaviour.editMcp.env": "Varijable okruženja", + "settings.agentBehaviour.editMcp.env.help": "Varijable proslijeđene procesu MCP servera.", + "settings.agentBehaviour.addMcp.command": "Naredba", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "Argumenti", + "settings.agentBehaviour.addMcp.args.help": "Jedan argument po liniji. Putanje s razmacima se čuvaju kakve jesu.", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "URL servera", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", "settings.agentBehaviour.skillPaths": "Putanje mapa vještina", "settings.agentBehaviour.skillUrls": "URL-ovi vještina", "settings.agentBehaviour.removeSkill.title": "Ukloni vještinu", @@ -1101,8 +1156,9 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "Argumenti", "settings.agentBehaviour.mcpDetail.env": "Okruženje", "settings.agentBehaviour.mcpDetail.disabled": "Ovaj server je onemogućen.", + "settings.agentBehaviour.mcpBrowseMarketplace": "Pregledaj Marketplace", "settings.agentBehaviour.mcpEmpty": - "Nema konfiguriranih MCP servera. Uredite konfiguracijsku datoteku opencode za dodavanje MCP servera.", + "Nema konfiguriranih MCP servera. Dodajte MCP servere u kilo.jsonc ili zamolite agenta da ih doda.", "settings.agentBehaviour.workflowsPlaceholder": "Tokovi rada se upravljaju putem datoteka tokova rada.", "settings.agentBehaviour.workflows.description": "Tokovi rada su prilagođene slash komande definirane u vašoj konfiguraciji. Upišite /command-name u chat da ih pokrenete. Komande se konfiguriraju u opencode.json pod sekcijom 'command'.", @@ -1110,7 +1166,7 @@ export const dict = { "Nema konfiguriranih prilagođenih komandi. Dodajte komande u opencode.json da ih vidite ovdje.", "settings.agentBehaviour.workflows.detail.description": "Opis", "settings.agentBehaviour.workflows.detail.template": "Predložak", - "settings.agentBehaviour.notImplemented": "Još nije implementirano.", + "settings.autoApprove.description": "Definišite kako je dozvoljeno pokretanje alata. Većina alata je podrazumijevano na Dozvoli. doom_loop i external_directory su podrazumijevano na Pitaj.", "settings.autoApprove.level.allow": "Dozvoli", @@ -1167,7 +1223,8 @@ export const dict = { "settings.providers.defaultModel.title": "Zadani model", "settings.providers.defaultModel.description": "Primarni model za razgovore", "settings.providers.smallModel.title": "Mali model", - "settings.providers.smallModel.description": "Lagani model za generiranje naslova i brze zadatke", + "settings.providers.smallModel.description": + "Lagani model za generiranje naslova, commit poruka, poboljšanje promptova i druge brze zadatke", "settings.providers.disabled": "Onemogućeni pružatelji", "settings.providers.disabled.description": "Pružatelji za skrivanje s popisa", "settings.providers.enabled": "Omogućeni pružatelji (bijela lista)", @@ -1190,7 +1247,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "Šta je novo u Kilo Code", - "migration.whatsNew.badge": "Beta", "migration.whatsNew.subtitle": "Ponovo smo izgradili ekstenziju na bržem i efikasnijem temelju.", "migration.whatsNew.features.performance.title": "Brže performanse agenta", "migration.whatsNew.features.performance.detail": @@ -1215,7 +1271,6 @@ export const dict = { "migration.migrate.chatHistoryDesc": "Nekompatibilno sa novom arhitekturom", "migration.migrate.button": "Migriraj postavke", "migration.migrate.skip": "Preskoči", - "migration.migrate.back": "Nazad", "migration.migrate.keysDetected": "{{count}} ključeva otkriveno", "migration.migrate.serversConfigured": "{{count}} server(a) konfigurisano", "migration.migrate.modesFound": "{{count}} režim(a) pronađeno", @@ -1236,6 +1291,11 @@ export const dict = { "migration.complete.cleanupDescription": "Ovo uklanja stare postavke iz VS Code pohrane. Nećete moći ponovo pokrenuti ovu migraciju.", "migration.complete.done": "Završeno", + "migration.migrate.sessionsDetected": "Otkrivene {{count}} sesije", + "migration.error.sessionFailed": "Migracija sesije nije uspjela", + "migration.error.continue": "Nastavi", + "migration.error.action.copy": "Kopiraj", + "migration.error.toast.copied": "Greška kopirana u međuspremnik", // legacy-migration end "error.details.show": "Detalji", @@ -1249,8 +1309,7 @@ export const dict = { "settings.saveBar.warning.many": "Nekoliko sesija je pokrenuto i bit će prekinuto", "settings.saveBar.saveAnyway": "Spremi svejedno", "settings.saveBar.cancel": "Otkaži", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "Sljedeći", + "notifications.action.close": "Zatvori", + "notifications.action.tryModel": "Probaj {{model}}", } diff --git a/packages/kilo-vscode/webview-ui/src/i18n/da.ts b/packages/kilo-vscode/webview-ui/src/i18n/da.ts index 06f53d140c5..0557602f220 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/da.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/da.ts @@ -267,6 +267,7 @@ export const dict = { "mcp.status.connected": "forbundet", "mcp.status.failed": "mislykkedes", "mcp.status.needs_auth": "kræver godkendelse", + "mcp.status.needs_registration": "kræver klientregistrering", "mcp.status.disabled": "deaktiveret", "dialog.fork.empty": "Ingen beskeder at forgrene fra", @@ -751,6 +752,20 @@ export const dict = { "provider.custom.models.name.placeholder": "Visningsnavn", "provider.custom.models.remove": "Fjern model", "provider.custom.models.add": "Tilføj model", + "provider.custom.models.fetch": "Hent modeller", + "provider.custom.models.fetching": "Henter\u2026", + "provider.custom.models.fetch.error": "Kunne ikke hente modeller: {{error}}", + "provider.custom.models.fetch.authError": "Godkendelse mislykkedes. Kontrollér API-nøglen ovenfor, og prøv igen.", + "provider.custom.models.fetch.empty": "Ingen modeller fundet på denne server.", + "provider.custom.models.fetch.added": "{{count}} model(ler) tilføjet.", + "provider.custom.models.fetch.allExist": "Alle hentede modeller er allerede tilføjet.", + "provider.custom.models.fetch.selectAll": "Vælg alle", + "provider.custom.models.fetch.deselectAll": "Fravælg alle", + "provider.custom.models.fetch.found": "{{count}} modeller fundet", + "provider.custom.models.fetch.showing": "Viser {{shown}} af {{total}}", + "provider.custom.models.fetch.search": "Søg modeller\u2026", + "provider.custom.models.fetch.add": "Tilføj {{count}} model(ler)", + "provider.custom.edit.title": "Rediger udbyder", "provider.custom.headers.label": "Headers (valgfrit)", "provider.custom.headers.key.label": "Header", "provider.custom.headers.key.placeholder": "Header-Name", @@ -909,8 +924,7 @@ export const dict = { "settings.autocomplete.title": "Autofuldførelse", "settings.notifications.title": "Notifikationer", "settings.context.title": "Kontekst", - "settings.terminal.title": "Terminal", - "settings.prompts.title": "Prompts", + "settings.experimental.title": "Eksperimentelt", "settings.language.title": "Sprog", "settings.aboutKiloCode.title": "Om Kilo Code", @@ -931,6 +945,7 @@ export const dict = { "prompt.placeholder.default": "Skriv en besked... (Enter for at sende, Shift+Enter for ny linje)", "context.usage.sessionCost": "Sessionsomkostning", + "context.stats.thisSession": "Denne session", "time.justNow": "lige nu", "time.minutesAgo": "{{count}} min. siden", @@ -960,8 +975,20 @@ export const dict = { "settings.aboutKiloCode.support.prefix": "For fakturerings- eller kontospørgsmål, kontakt kundesupport på", "settings.aboutKiloCode.resetSettings.title": "Nulstil indstillinger", "settings.aboutKiloCode.resetSettings.description": - "Nulstil alle Kilo Code-udvidelsesindstillinger til standardværdierne. Dette påvirker ikke CLI- eller backend-konfiguration.", + "Dette nulstiller kun VS Code-udvidelsesspecifikke indstillinger til deres standardværdier. Indstillinger der deles med CLI, såsom tilstande og regler for automatisk godkendelse, er gemt i CLI-konfigurationen og vil ikke blive nulstillet.", "settings.aboutKiloCode.resetSettings.button": "Nulstil alle indstillinger", + "settings.aboutKiloCode.settingsTransfer.title": "Overførsel af indstillinger", + "settings.aboutKiloCode.settingsTransfer.description": + "Eksportér eller importér dine indstillinger for at overføre dem mellem VS Code-instanser.", + "settings.aboutKiloCode.exportSettings": "Eksportér", + "settings.aboutKiloCode.importSettings": "Importér", + "settings.aboutKiloCode.importSettings.invalidJson": "Ugyldig JSON-fil. Vælg venligst en gyldig indstillingsfil.", + "settings.aboutKiloCode.importSettings.invalidConfig": "Filen indeholder ikke gyldige Kilo-indstillinger.", + "settings.aboutKiloCode.importSettings.tooLarge": "Filen er for stor. Indstillingsfiler skal være under 1 MB.", + "settings.aboutKiloCode.importSettings.newerVersion": + "Denne fil blev eksporteret fra en nyere version af Kilo. Nogle indstillinger kan blive ignoreret.", + "settings.aboutKiloCode.importSettings.success": + "Indstillinger importeret. Gennemgå ændringerne ovenfor, og klik derefter på Gem.", "settings.agentBehaviour.subtab.modes": "Tilstande", "settings.agentBehaviour.subtab.agents": "Agents", @@ -986,8 +1013,7 @@ export const dict = { "common.add": "Tilføj", "common.choose": "Vælg…", - "settings.notImplemented": "Denne sektion er endnu ikke implementeret.", - "settings.notImplemented.description": "Den vil indeholde konfigurationsmuligheder og forklarende tekst.", + "settings.autocomplete.autoTrigger.title": "Aktiver automatisk inline-fuldførelse", "settings.autocomplete.autoTrigger.description": "Vis automatisk inline-fuldførelsesforslag under indtastning", "settings.autocomplete.smartKeybinding.title": "Aktiver smart inline-opgave-tastaturgenvej", @@ -1045,6 +1071,13 @@ export const dict = { "settings.agentBehaviour.topP.description": "Nucleus-samplingparameter (0-1)", "settings.agentBehaviour.maxSteps.title": "Maks. trin", "settings.agentBehaviour.maxSteps.description": "Maksimale agentiterationer", + "settings.agentBehaviour.hidden.title": "Skjult", + "settings.agentBehaviour.hidden.description": "Skjul denne agent fra tilstandsvælgeren i chatinput", + "settings.agentBehaviour.disable.title": "Deaktiveret", + "settings.agentBehaviour.disable.description": "Deaktiver denne agent fuldstændigt — den vises ingen steder", + "settings.agentBehaviour.badge.hidden": "skjult", + "settings.agentBehaviour.badge.disabled": "deaktiveret", + "settings.agentBehaviour.badge.deprecated": "Udfaset", "settings.agentBehaviour.discoveredSkills": "Opdagede skills", "settings.agentBehaviour.noSkillsFound": "Ingen skills fundet. Tilføj skill-mappestier eller URL'er nedenfor for at gøre skills tilgængelige.", @@ -1067,12 +1100,20 @@ export const dict = { "settings.agentBehaviour.createMode.nameRequired": "Navn er påkrævet", "settings.agentBehaviour.createMode.nameInvalid": "Navn må kun indeholde små bogstaver, tal og bindestreger", "settings.agentBehaviour.createMode.nameTaken": "En tilstand med dette navn eksisterer allerede", + "settings.agentBehaviour.importMode": "Importér", + "settings.agentBehaviour.importMode.invalidName": + "Ugyldigt tilstandsnavn i filen. Navnet skal starte med et lille bogstav og kun indeholde små bogstaver, tal og bindestreger.", + "settings.agentBehaviour.importMode.nameTaken": "En tilstand med dette navn eksisterer allerede.", + "settings.agentBehaviour.importMode.invalidJson": "Ugyldig JSON-fil. Vælg venligst en gyldig agentdefinitionsfil.", + "settings.agentBehaviour.importMode.tooLarge": "Filen er for stor. Agentdefinitioner skal være under 1 MB.", + "settings.agentBehaviour.exportMode": "Eksportér agentdefinition", "settings.agentBehaviour.editMode": "Rediger tilstand", "settings.agentBehaviour.editMode.description": "Beskrivelse", "settings.agentBehaviour.editMode.prompt": "Systemprompt", "settings.agentBehaviour.editMode.save": "Færdig", "settings.agentBehaviour.editMode.back": "Tilbage til listen", - "settings.agentBehaviour.editMode.native": "Indbygget tilstand (skrivebeskyttet definition)", + "settings.agentBehaviour.editMode.native": + "Dette er en indbygget tilstand. Dens grundlæggende definition kan ikke ændres, men du kan konfigurere tilsidesættelser nedenfor.", "settings.agentBehaviour.editMode.promptOverride": "Tilpasset prompt-tilsidesættelse for denne indbyggede tilstand", "settings.agentBehaviour.removeMode.title": "Fjern tilstand", "settings.agentBehaviour.removeMode.confirm": @@ -1082,6 +1123,18 @@ export const dict = { "settings.agentBehaviour.removeMcp.confirm": 'Vil du fjerne MCP-serveren "{{name}}"? Dette vil fjerne den fra din konfiguration.', "settings.agentBehaviour.removeMcp.button": "Fjern", + "settings.agentBehaviour.editMcp": "Rediger MCP-server", + "settings.agentBehaviour.editMcp.transportLocal": "Lokal server (stdio-transport)", + "settings.agentBehaviour.editMcp.transportRemote": "Fjernserver (SSE/HTTP-transport)", + "settings.agentBehaviour.editMcp.env": "Miljøvariabler", + "settings.agentBehaviour.editMcp.env.help": "Variabler der sendes til MCP-serverprocessen.", + "settings.agentBehaviour.addMcp.command": "Kommando", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "Argumenter", + "settings.agentBehaviour.addMcp.args.help": "Ét argument per linje. Stier med mellemrum bevares som de er.", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "Server-URL", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", "settings.agentBehaviour.skillPaths": "Skill-mappestier", "settings.agentBehaviour.skillUrls": "Skill-URL'er", "settings.agentBehaviour.removeSkill.title": "Fjern færdighed", @@ -1096,8 +1149,9 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "Argumenter", "settings.agentBehaviour.mcpDetail.env": "Miljø", "settings.agentBehaviour.mcpDetail.disabled": "Denne server er deaktiveret.", + "settings.agentBehaviour.mcpBrowseMarketplace": "Gennemse Marketplace", "settings.agentBehaviour.mcpEmpty": - "Ingen MCP-servere konfigureret. Rediger opencode-konfigurationsfilen for at tilføje MCP-servere.", + "Ingen MCP-servere konfigureret. Tilføj MCP-servere i kilo.jsonc, eller bed agenten om at tilføje dem.", "settings.agentBehaviour.workflowsPlaceholder": "Workflows administreres via workflow-filer i dit arbejdsområde.", "settings.agentBehaviour.workflows.description": "Workflows er brugerdefinerede slash-kommandoer defineret i din konfiguration. Skriv /command-name i chatten for at aktivere dem. Kommandoer konfigureres i opencode.json under sektionen 'command'.", @@ -1105,7 +1159,7 @@ export const dict = { "Ingen brugerdefinerede kommandoer konfigureret. Tilføj kommandoer til opencode.json for at se dem her.", "settings.agentBehaviour.workflows.detail.description": "Beskrivelse", "settings.agentBehaviour.workflows.detail.template": "Skabelon", - "settings.agentBehaviour.notImplemented": "Endnu ikke implementeret.", + "settings.autoApprove.description": "Definer, hvordan værktøjer må køre. De fleste værktøjer er som standard indstillet til Tillad. doom_loop og external_directory er som standard indstillet til Spørg.", "settings.autoApprove.level.allow": "Tillad", @@ -1159,7 +1213,8 @@ export const dict = { "settings.providers.defaultModel.title": "Standardmodel", "settings.providers.defaultModel.description": "Primær model til samtaler", "settings.providers.smallModel.title": "Lille model", - "settings.providers.smallModel.description": "Letvægtsmodel til titelgenerering og hurtige opgaver", + "settings.providers.smallModel.description": + "Letvægtsmodel til titelgenerering, generering af commit-beskeder, prompt-forbedring og andre hurtige opgaver", "settings.providers.disabled": "Deaktiverede udbydere", "settings.providers.disabled.description": "Udbydere at skjule fra listen", "settings.providers.enabled": "Aktiverede udbydere (hvidliste)", @@ -1182,7 +1237,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "Nyheder i Kilo Code", - "migration.whatsNew.badge": "Beta", "migration.whatsNew.subtitle": "Vi har genopbygget udvidelsen på et hurtigere og mere effektivt fundament.", "migration.whatsNew.features.performance.title": "Hurtigere agentydelse", "migration.whatsNew.features.performance.detail": @@ -1208,7 +1262,6 @@ export const dict = { "migration.migrate.chatHistoryDesc": "Ikke kompatibel med den nye arkitektur", "migration.migrate.button": "Migrer indstillinger", "migration.migrate.skip": "Spring over", - "migration.migrate.back": "Tilbage", "migration.migrate.keysDetected": "{{count}} nøgler fundet", "migration.migrate.serversConfigured": "{{count}} server(e) konfigureret", "migration.migrate.modesFound": "{{count}} tilstand(e) fundet", @@ -1229,6 +1282,11 @@ export const dict = { "migration.complete.cleanupDescription": "Dette fjerner de gamle indstillinger fra VS Code-lageret. Du vil ikke kunne køre denne migrering igen.", "migration.complete.done": "Færdig", + "migration.migrate.sessionsDetected": "{{count}} sessioner fundet", + "migration.error.sessionFailed": "Sessionsmigrering mislykkedes", + "migration.error.continue": "Fortsæt", + "migration.error.action.copy": "Kopiér", + "migration.error.toast.copied": "Fejl kopieret til udklipsholder", // legacy-migration end "error.details.show": "Detaljer", @@ -1242,8 +1300,7 @@ export const dict = { "settings.saveBar.warning.many": "Flere sessioner kører og vil blive afbrudt", "settings.saveBar.saveAnyway": "Gem alligevel", "settings.saveBar.cancel": "Annuller", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "Næste", + "notifications.action.close": "Luk", + "notifications.action.tryModel": "Prøv {{model}}", } diff --git a/packages/kilo-vscode/webview-ui/src/i18n/de.ts b/packages/kilo-vscode/webview-ui/src/i18n/de.ts index 7e7bd1184b5..ac76bbf9822 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/de.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/de.ts @@ -272,6 +272,7 @@ export const dict = { "mcp.status.connected": "verbunden", "mcp.status.failed": "fehlgeschlagen", "mcp.status.needs_auth": "benötigt Authentifizierung", + "mcp.status.needs_registration": "Client-Registrierung erforderlich", "mcp.status.disabled": "deaktiviert", "dialog.fork.empty": "Keine Nachrichten zum Abzweigen vorhanden", @@ -762,6 +763,21 @@ export const dict = { "provider.custom.models.name.placeholder": "Anzeigename", "provider.custom.models.remove": "Modell entfernen", "provider.custom.models.add": "Modell hinzufügen", + "provider.custom.models.fetch": "Modelle abrufen", + "provider.custom.models.fetching": "Abrufen\u2026", + "provider.custom.models.fetch.error": "Modelle konnten nicht abgerufen werden: {{error}}", + "provider.custom.models.fetch.authError": + "Authentifizierung fehlgeschlagen. Überprüfen Sie den API-Schlüssel oben und versuchen Sie es erneut.", + "provider.custom.models.fetch.empty": "Keine Modelle auf diesem Server gefunden.", + "provider.custom.models.fetch.added": "{{count}} Modell(e) hinzugefügt.", + "provider.custom.models.fetch.allExist": "Alle abgerufenen Modelle sind bereits hinzugefügt.", + "provider.custom.models.fetch.selectAll": "Alle auswählen", + "provider.custom.models.fetch.deselectAll": "Alle abwählen", + "provider.custom.models.fetch.found": "{{count}} Modelle gefunden", + "provider.custom.models.fetch.showing": "{{shown}} von {{total}} angezeigt", + "provider.custom.models.fetch.search": "Modelle suchen\u2026", + "provider.custom.models.fetch.add": "{{count}} Modell(e) hinzufügen", + "provider.custom.edit.title": "Anbieter bearbeiten", "provider.custom.headers.label": "Header (optional)", "provider.custom.headers.key.label": "Header", "provider.custom.headers.key.placeholder": "Header-Name", @@ -920,8 +936,7 @@ export const dict = { "settings.autocomplete.title": "Autovervollständigung", "settings.notifications.title": "Benachrichtigungen", "settings.context.title": "Kontext", - "settings.terminal.title": "Terminal", - "settings.prompts.title": "Prompts", + "settings.experimental.title": "Experimentell", "settings.language.title": "Sprache", "settings.aboutKiloCode.title": "Über Kilo Code", @@ -943,6 +958,7 @@ export const dict = { "prompt.placeholder.default": "Nachricht eingeben... (Enter zum Senden, Shift+Enter für neue Zeile)", "context.usage.sessionCost": "Sitzungskosten", + "context.stats.thisSession": "Diese Sitzung", "time.justNow": "gerade eben", "time.minutesAgo": "vor {{count}} Min.", @@ -972,8 +988,22 @@ export const dict = { "Bei Abrechnungs- oder Kontofragen wenden Sie sich an den Kundensupport unter", "settings.aboutKiloCode.resetSettings.title": "Einstellungen zurücksetzen", "settings.aboutKiloCode.resetSettings.description": - "Alle Kilo Code-Erweiterungseinstellungen auf Standardwerte zurücksetzen. Dies hat keinen Einfluss auf die CLI- oder Backend-Konfiguration.", + "Dies setzt nur VS Code-erweiterungsspezifische Einstellungen auf ihre Standardwerte zurück. Einstellungen, die mit der CLI geteilt werden, wie Modi und Regeln für die automatische Genehmigung, werden in der CLI-Konfiguration gespeichert und nicht zurückgesetzt.", "settings.aboutKiloCode.resetSettings.button": "Alle Einstellungen zurücksetzen", + "settings.aboutKiloCode.settingsTransfer.title": "Einstellungen übertragen", + "settings.aboutKiloCode.settingsTransfer.description": + "Exportieren oder importieren Sie Ihre Einstellungen, um sie zwischen VS Code-Instanzen zu übertragen.", + "settings.aboutKiloCode.exportSettings": "Exportieren", + "settings.aboutKiloCode.importSettings": "Importieren", + "settings.aboutKiloCode.importSettings.invalidJson": + "Ungültige JSON-Datei. Bitte wählen Sie eine gültige Einstellungsdatei aus.", + "settings.aboutKiloCode.importSettings.invalidConfig": "Die Datei enthält keine gültigen Kilo-Einstellungen.", + "settings.aboutKiloCode.importSettings.tooLarge": + "Die Datei ist zu groß. Einstellungsdateien müssen kleiner als 1 MB sein.", + "settings.aboutKiloCode.importSettings.newerVersion": + "Diese Datei wurde mit einer neueren Version von Kilo exportiert. Einige Einstellungen werden möglicherweise ignoriert.", + "settings.aboutKiloCode.importSettings.success": + "Einstellungen importiert. Überprüfen Sie die obigen Änderungen und klicken Sie dann auf Speichern.", "settings.agentBehaviour.subtab.modes": "Modi", "settings.agentBehaviour.subtab.agents": "Agents", @@ -999,9 +1029,7 @@ export const dict = { "common.add": "Hinzufügen", "common.choose": "Auswählen…", - "settings.notImplemented": "Dieser Bereich ist noch nicht implementiert.", - "settings.notImplemented.description": - "Er wird Konfigurationsoptionen und erklärende Texte zur ausgewählten Einstellungskategorie enthalten.", + "settings.autocomplete.autoTrigger.title": "Automatische Inline-Vervollständigung aktivieren", "settings.autocomplete.autoTrigger.description": "Inline-Vervollständigungsvorschläge beim Tippen automatisch anzeigen", @@ -1063,6 +1091,13 @@ export const dict = { "settings.agentBehaviour.topP.description": "Nucleus-Sampling-Parameter (0-1)", "settings.agentBehaviour.maxSteps.title": "Max. Schritte", "settings.agentBehaviour.maxSteps.description": "Maximale Agent-Iterationen", + "settings.agentBehaviour.hidden.title": "Versteckt", + "settings.agentBehaviour.hidden.description": "Diesen Agent im Modus-Umschalter der Chat-Eingabe ausblenden", + "settings.agentBehaviour.disable.title": "Deaktiviert", + "settings.agentBehaviour.disable.description": "Diesen Agent vollständig deaktivieren — er wird nirgends angezeigt", + "settings.agentBehaviour.badge.hidden": "versteckt", + "settings.agentBehaviour.badge.disabled": "deaktiviert", + "settings.agentBehaviour.badge.deprecated": "Veraltet", "settings.agentBehaviour.discoveredSkills": "Erkannte Skills", "settings.agentBehaviour.noSkillsFound": "Keine Skills gefunden. Fügen Sie unten Skill-Ordnerpfade oder URLs hinzu, um Skills verfügbar zu machen.", @@ -1085,12 +1120,21 @@ export const dict = { "settings.agentBehaviour.createMode.nameRequired": "Name ist erforderlich", "settings.agentBehaviour.createMode.nameInvalid": "Name darf nur Kleinbuchstaben, Zahlen und Bindestriche enthalten", "settings.agentBehaviour.createMode.nameTaken": "Ein Modus mit diesem Namen existiert bereits", + "settings.agentBehaviour.importMode": "Importieren", + "settings.agentBehaviour.importMode.invalidName": + "Ungültiger Modusname in der Datei. Der Name muss mit einem Kleinbuchstaben beginnen und darf nur Kleinbuchstaben, Zahlen und Bindestriche enthalten.", + "settings.agentBehaviour.importMode.nameTaken": "Ein Modus mit diesem Namen existiert bereits.", + "settings.agentBehaviour.importMode.invalidJson": + "Ungültige JSON-Datei. Bitte wählen Sie eine gültige Agenten-Definitionsdatei aus.", + "settings.agentBehaviour.importMode.tooLarge": "Datei ist zu groß. Agentdefinitionen müssen unter 1 MB sein.", + "settings.agentBehaviour.exportMode": "Agenten-Definition exportieren", "settings.agentBehaviour.editMode": "Modus bearbeiten", "settings.agentBehaviour.editMode.description": "Beschreibung", "settings.agentBehaviour.editMode.prompt": "System-Prompt", "settings.agentBehaviour.editMode.save": "Fertig", "settings.agentBehaviour.editMode.back": "Zurück zur Liste", - "settings.agentBehaviour.editMode.native": "Eingebauter Modus (schreibgeschützte Definition)", + "settings.agentBehaviour.editMode.native": + "Dies ist ein integrierter Modus. Seine Basisdefinition kann nicht geändert werden, aber Sie können unten Überschreibungen konfigurieren.", "settings.agentBehaviour.editMode.promptOverride": "Benutzerdefinierte Prompt-Überschreibung für diesen eingebauten Modus", "settings.agentBehaviour.removeMode.title": "Modus entfernen", @@ -1101,6 +1145,19 @@ export const dict = { "settings.agentBehaviour.removeMcp.confirm": 'MCP-Server "{{name}}" entfernen? Dadurch wird er aus Ihrer Konfiguration entfernt.', "settings.agentBehaviour.removeMcp.button": "Entfernen", + "settings.agentBehaviour.editMcp": "MCP-Server bearbeiten", + "settings.agentBehaviour.editMcp.transportLocal": "Lokaler Server (stdio-Transport)", + "settings.agentBehaviour.editMcp.transportRemote": "Remote-Server (SSE/HTTP-Transport)", + "settings.agentBehaviour.editMcp.env": "Umgebungsvariablen", + "settings.agentBehaviour.editMcp.env.help": "Variablen, die an den MCP-Serverprozess übergeben werden.", + "settings.agentBehaviour.addMcp.command": "Befehl", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "Argumente", + "settings.agentBehaviour.addMcp.args.help": + "Ein Argument pro Zeile. Pfade mit Leerzeichen werden unverändert übernommen.", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "Server-URL", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", "settings.agentBehaviour.skillPaths": "Skill-Ordnerpfade", "settings.agentBehaviour.skillUrls": "Skill-URLs", "settings.agentBehaviour.removeSkill.title": "Skill entfernen", @@ -1115,8 +1172,9 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "Argumente", "settings.agentBehaviour.mcpDetail.env": "Umgebung", "settings.agentBehaviour.mcpDetail.disabled": "Dieser Server ist deaktiviert.", + "settings.agentBehaviour.mcpBrowseMarketplace": "Marketplace durchsuchen", "settings.agentBehaviour.mcpEmpty": - "Keine MCP-Server konfiguriert. Bearbeiten Sie die opencode-Konfigurationsdatei, um MCP-Server hinzuzufügen.", + "Keine MCP-Server konfiguriert. Fügen Sie MCP-Server in kilo.jsonc hinzu oder bitten Sie den Agenten, sie hinzuzufügen.", "settings.agentBehaviour.workflowsPlaceholder": "Workflows werden über Workflow-Dateien in Ihrem Arbeitsbereich verwaltet.", "settings.agentBehaviour.workflows.description": @@ -1125,7 +1183,7 @@ export const dict = { "Keine benutzerdefinierten Befehle konfiguriert. Fügen Sie Befehle zu opencode.json hinzu, um sie hier zu sehen.", "settings.agentBehaviour.workflows.detail.description": "Beschreibung", "settings.agentBehaviour.workflows.detail.template": "Vorlage", - "settings.agentBehaviour.notImplemented": "Noch nicht implementiert.", + "settings.autoApprove.description": "Legen Sie fest, wie Tools ausgeführt werden dürfen. Die meisten Tools sind standardmäßig auf Zulassen eingestellt. doom_loop und external_directory sind standardmäßig auf Fragen eingestellt.", "settings.autoApprove.level.allow": "Erlauben", @@ -1181,7 +1239,8 @@ export const dict = { "settings.providers.defaultModel.title": "Standardmodell", "settings.providers.defaultModel.description": "Primäres Modell für Gespräche", "settings.providers.smallModel.title": "Kleines Modell", - "settings.providers.smallModel.description": "Leichtgewichtiges Modell für Titelgenerierung und schnelle Aufgaben", + "settings.providers.smallModel.description": + "Leichtgewichtiges Modell für Titelgenerierung, Commit-Nachrichten, Prompt-Verbesserung und andere schnelle Aufgaben", "settings.providers.disabled": "Deaktivierte Anbieter", "settings.providers.disabled.description": "Anbieter aus der Anbieterliste ausblenden", "settings.providers.enabled": "Aktivierte Anbieter (Whitelist)", @@ -1204,7 +1263,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "Neuigkeiten in Kilo Code", - "migration.whatsNew.badge": "Beta", "migration.whatsNew.subtitle": "Wir haben die Erweiterung auf einer schnelleren, effizienteren Grundlage neu aufgebaut.", "migration.whatsNew.features.performance.title": "Schnellere Agentenleistung", @@ -1231,7 +1289,6 @@ export const dict = { "migration.migrate.chatHistoryDesc": "Nicht kompatibel mit der neuen Architektur", "migration.migrate.button": "Einstellungen migrieren", "migration.migrate.skip": "Überspringen", - "migration.migrate.back": "Zurück", "migration.migrate.keysDetected": "{{count}} Schlüssel erkannt", "migration.migrate.serversConfigured": "{{count}} Server konfiguriert", "migration.migrate.modesFound": "{{count}} Modus/Modi gefunden", @@ -1252,6 +1309,11 @@ export const dict = { "migration.complete.cleanupDescription": "Dadurch werden die alten Einstellungen aus dem VS Code-Speicher entfernt. Sie können diese Migration danach nicht erneut ausführen.", "migration.complete.done": "Fertig", + "migration.migrate.sessionsDetected": "{{count}} Sitzungen erkannt", + "migration.error.sessionFailed": "Sitzungsmigration fehlgeschlagen", + "migration.error.continue": "Weiter", + "migration.error.action.copy": "Kopieren", + "migration.error.toast.copied": "Fehler in die Zwischenablage kopiert", // legacy-migration end "error.details.show": "Details", @@ -1265,8 +1327,7 @@ export const dict = { "settings.saveBar.warning.many": "Mehrere Sitzungen laufen und werden unterbrochen", "settings.saveBar.saveAnyway": "Trotzdem speichern", "settings.saveBar.cancel": "Abbrechen", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "Weiter", + "notifications.action.close": "Schließen", + "notifications.action.tryModel": "{{model}} ausprobieren", } satisfies Partial> diff --git a/packages/kilo-vscode/webview-ui/src/i18n/en.ts b/packages/kilo-vscode/webview-ui/src/i18n/en.ts index 58789081d5a..52e1f8216c1 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/en.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/en.ts @@ -268,6 +268,7 @@ export const dict = { "mcp.status.connected": "connected", "mcp.status.failed": "failed", "mcp.status.needs_auth": "needs auth", + "mcp.status.needs_registration": "needs client registration", "mcp.status.disabled": "disabled", "dialog.fork.empty": "No messages to fork from", @@ -752,6 +753,20 @@ export const dict = { "provider.custom.models.name.placeholder": "Display Name", "provider.custom.models.remove": "Remove model", "provider.custom.models.add": "Add model", + "provider.custom.models.fetch": "Fetch models", + "provider.custom.models.fetching": "Fetching\u2026", + "provider.custom.models.fetch.error": "Failed to fetch models: {{error}}", + "provider.custom.models.fetch.authError": "Authentication failed. Check the API key above and try again.", + "provider.custom.models.fetch.empty": "No models found on this server.", + "provider.custom.models.fetch.added": "Added {{count}} model(s).", + "provider.custom.models.fetch.allExist": "All fetched models are already added.", + "provider.custom.models.fetch.selectAll": "Select all", + "provider.custom.models.fetch.deselectAll": "Deselect all", + "provider.custom.models.fetch.found": "{{count}} models found", + "provider.custom.models.fetch.showing": "Showing {{shown}} of {{total}}", + "provider.custom.models.fetch.search": "Search models\u2026", + "provider.custom.models.fetch.add": "Add {{count}} model(s)", + "provider.custom.edit.title": "Edit provider", "provider.custom.headers.label": "Headers (optional)", "provider.custom.headers.key.label": "Header", "provider.custom.headers.key.placeholder": "Header-Name", @@ -909,8 +924,7 @@ export const dict = { "settings.autocomplete.title": "Autocomplete", "settings.notifications.title": "Notifications", "settings.context.title": "Context", - "settings.terminal.title": "Terminal", - "settings.prompts.title": "Prompts", + "settings.experimental.title": "Experimental", "settings.language.title": "Language", "settings.aboutKiloCode.title": "About Kilo Code", @@ -931,6 +945,7 @@ export const dict = { "prompt.placeholder.error": "Connection failed. Check the output panel or restart the extension.", "context.usage.sessionCost": "Session cost", + "context.stats.thisSession": "This session", "time.justNow": "just now", "time.minutesAgo": "{{count}} min ago", @@ -959,8 +974,19 @@ export const dict = { "settings.aboutKiloCode.support.prefix": "For billing or account questions, contact Customer Support at", "settings.aboutKiloCode.resetSettings.title": "Reset Settings", "settings.aboutKiloCode.resetSettings.description": - "Reset all Kilo Code extension settings to their default values. This does not affect CLI or backend configuration.", + "This resets only VS Code extension-specific settings to their default values. Settings shared with the CLI, such as modes and auto-approve rules, are stored in the CLI configuration and will not be reset.", "settings.aboutKiloCode.resetSettings.button": "Reset All Settings", + "settings.aboutKiloCode.settingsTransfer.title": "Settings Transfer", + "settings.aboutKiloCode.settingsTransfer.description": + "Export or import your settings to transfer them between VS Code instances.", + "settings.aboutKiloCode.exportSettings": "Export", + "settings.aboutKiloCode.importSettings": "Import", + "settings.aboutKiloCode.importSettings.invalidJson": "Invalid JSON file. Please select a valid settings file.", + "settings.aboutKiloCode.importSettings.invalidConfig": "File does not contain valid Kilo settings.", + "settings.aboutKiloCode.importSettings.tooLarge": "File is too large. Settings files must be under 1 MB.", + "settings.aboutKiloCode.importSettings.newerVersion": + "This file was exported from a newer version of Kilo. Some settings may be ignored.", + "settings.aboutKiloCode.importSettings.success": "Settings imported. Review the changes above, then click Save.", "settings.agentBehaviour.subtab.modes": "Modes", "settings.agentBehaviour.subtab.agents": "Agents", @@ -987,10 +1013,6 @@ export const dict = { "common.add": "Add", "common.choose": "Choose…", - "settings.notImplemented": "This section is not implemented yet.", - "settings.notImplemented.description": - "It will contain configuration options and explanatory text related to the selected settings category. During reimplementation, use this space to validate layout, spacing, scrolling behavior, and navigation state before wiring up real controls.", - "settings.autocomplete.autoTrigger.title": "Enable automatic inline completions", "settings.autocomplete.autoTrigger.description": "Automatically show inline completion suggestions as you type", "settings.autocomplete.smartKeybinding.title": "Enable smart inline task keybinding", @@ -1051,6 +1073,13 @@ export const dict = { "settings.agentBehaviour.topP.description": "Nucleus sampling parameter (0-1)", "settings.agentBehaviour.maxSteps.title": "Max Steps", "settings.agentBehaviour.maxSteps.description": "Maximum agentic iterations", + "settings.agentBehaviour.hidden.title": "Hidden", + "settings.agentBehaviour.hidden.description": "Hide this agent from the mode switcher in the chat input", + "settings.agentBehaviour.disable.title": "Disabled", + "settings.agentBehaviour.disable.description": "Fully disable this agent — it will not appear anywhere", + "settings.agentBehaviour.badge.hidden": "hidden", + "settings.agentBehaviour.badge.disabled": "disabled", + "settings.agentBehaviour.badge.deprecated": "deprecated", "settings.agentBehaviour.discoveredSkills": "Discovered Skills", "settings.agentBehaviour.noSkillsFound": "No skills discovered. Add skill folder paths or URLs below to make skills available.", @@ -1077,7 +1106,21 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "Arguments", "settings.agentBehaviour.mcpDetail.env": "Environment", "settings.agentBehaviour.mcpDetail.disabled": "This server is disabled.", - "settings.agentBehaviour.mcpEmpty": "No MCP servers configured. Edit the opencode config file to add MCP servers.", + "settings.agentBehaviour.editMcp": "Edit MCP Server", + "settings.agentBehaviour.editMcp.transportLocal": "Local server (stdio transport)", + "settings.agentBehaviour.editMcp.transportRemote": "Remote server (SSE/HTTP transport)", + "settings.agentBehaviour.editMcp.env": "Environment Variables", + "settings.agentBehaviour.editMcp.env.help": "Variables passed to the MCP server process.", + "settings.agentBehaviour.addMcp.command": "Command", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "Arguments", + "settings.agentBehaviour.addMcp.args.help": "One argument per line. Paths with spaces are preserved as-is.", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "Server URL", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", + "settings.agentBehaviour.mcpBrowseMarketplace": "Browse Marketplace", + "settings.agentBehaviour.mcpEmpty": + "No MCP servers configured. Add MCP servers in kilo.jsonc, or ask the agent to add them for you.", "settings.agentBehaviour.workflowsPlaceholder": "Workflows are managed via workflow files in your workspace.", "settings.agentBehaviour.workflows.description": "Workflows are custom slash commands defined in your config. Type /command-name in the chat to invoke them. Commands are configured in opencode.json under the 'command' section.", @@ -1085,7 +1128,7 @@ export const dict = { "No custom commands configured. Add commands to your opencode.json to see them here.", "settings.agentBehaviour.workflows.detail.description": "Description", "settings.agentBehaviour.workflows.detail.template": "Template", - "settings.agentBehaviour.notImplemented": "Not yet implemented.", + "settings.agentBehaviour.createMode": "Create New Mode", "settings.agentBehaviour.createMode.name": "Name", "settings.agentBehaviour.createMode.name.placeholder": "e.g. reviewer", @@ -1104,6 +1147,13 @@ export const dict = { "settings.agentBehaviour.createMode.nameInvalid": "Name must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens", "settings.agentBehaviour.createMode.nameTaken": "A mode with this name already exists", + "settings.agentBehaviour.importMode": "Import", + "settings.agentBehaviour.importMode.invalidName": + "Invalid mode name in file. Name must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens.", + "settings.agentBehaviour.importMode.nameTaken": "A mode with this name already exists.", + "settings.agentBehaviour.importMode.invalidJson": "Invalid JSON file. Please select a valid agent definition file.", + "settings.agentBehaviour.importMode.tooLarge": "File is too large. Agent definitions must be under 1 MB.", + "settings.agentBehaviour.exportMode": "Export agent definition", "settings.agentBehaviour.editMode": "Edit Mode", "settings.agentBehaviour.editMode.description": "Description", "settings.agentBehaviour.editMode.prompt": "System Prompt", @@ -1165,7 +1215,8 @@ export const dict = { "settings.providers.defaultModel.title": "Default Model", "settings.providers.defaultModel.description": "Primary model for conversations", "settings.providers.smallModel.title": "Small Model", - "settings.providers.smallModel.description": "Lightweight model for title generation and other quick tasks", + "settings.providers.smallModel.description": + "Lightweight model for title generation, commit message generation, prompt enhancement, and other quick tasks", "settings.providers.modeModels": "Model per Mode", "settings.providers.modeModels.description": "Override the default model for specific modes. If not set, the global default model is used.", @@ -1196,7 +1247,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "What's New in Kilo Code", - "migration.whatsNew.badge": "Beta", "migration.whatsNew.subtitle": "We've rebuilt the extension on a faster, more efficient foundation.", "migration.whatsNew.features.performance.title": "Faster Agent Performance", "migration.whatsNew.features.performance.detail": @@ -1221,10 +1271,10 @@ export const dict = { "migration.migrate.chatHistoryDesc": "Incompatible with the new architecture", "migration.migrate.button": "Migrate Settings", "migration.migrate.skip": "Skip", - "migration.migrate.back": "Back", "migration.migrate.keysDetected": "{{count}} keys detected", "migration.migrate.serversConfigured": "{{count}} server(s) configured", "migration.migrate.modesFound": "{{count}} mode(s) found", + "migration.migrate.sessionsDetected": "{{count}} sessions detected", "migration.migrate.nothingToMigrate": "Nothing to migrate was found in the legacy settings.", // Migrate — item labels (reused from old select keys) @@ -1242,6 +1292,10 @@ export const dict = { "migration.complete.cleanupDescription": "This removes the old settings from VS Code storage. You will not be able to re-run this migration.", "migration.complete.done": "Done", + "migration.error.sessionFailed": "Session migration failed", + "migration.error.continue": "Continue", + "migration.error.action.copy": "Copy", + "migration.error.toast.copied": "Error copied to clipboard", // legacy-migration end "error.details.show": "Details", @@ -1257,8 +1311,7 @@ export const dict = { "settings.saveBar.saveAnyway": "Save anyway", "settings.saveBar.cancel": "Cancel", - "notifications.action.previous": "Previous", "notifications.action.next": "Next", "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.tryModel": "Try {{model}}", } diff --git a/packages/kilo-vscode/webview-ui/src/i18n/es.ts b/packages/kilo-vscode/webview-ui/src/i18n/es.ts index 9b2d1da3261..8e8fd8d2bad 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/es.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/es.ts @@ -267,6 +267,7 @@ export const dict = { "mcp.status.connected": "conectado", "mcp.status.failed": "fallido", "mcp.status.needs_auth": "necesita auth", + "mcp.status.needs_registration": "necesita registro de cliente", "mcp.status.disabled": "deshabilitado", "dialog.fork.empty": "No hay mensajes desde donde bifurcar", @@ -757,6 +758,21 @@ export const dict = { "provider.custom.models.name.placeholder": "Nombre para mostrar", "provider.custom.models.remove": "Eliminar modelo", "provider.custom.models.add": "Añadir modelo", + "provider.custom.models.fetch": "Obtener modelos", + "provider.custom.models.fetching": "Obteniendo\u2026", + "provider.custom.models.fetch.error": "Error al obtener modelos: {{error}}", + "provider.custom.models.fetch.authError": + "Autenticación fallida. Verifica la clave de API arriba e intenta de nuevo.", + "provider.custom.models.fetch.empty": "No se encontraron modelos en este servidor.", + "provider.custom.models.fetch.added": "Se añadieron {{count}} modelo(s).", + "provider.custom.models.fetch.allExist": "Todos los modelos obtenidos ya están añadidos.", + "provider.custom.models.fetch.selectAll": "Seleccionar todo", + "provider.custom.models.fetch.deselectAll": "Deseleccionar todo", + "provider.custom.models.fetch.found": "{{count}} modelos encontrados", + "provider.custom.models.fetch.showing": "Mostrando {{shown}} de {{total}}", + "provider.custom.models.fetch.search": "Buscar modelos\u2026", + "provider.custom.models.fetch.add": "Añadir {{count}} modelo(s)", + "provider.custom.edit.title": "Editar proveedor", "provider.custom.headers.label": "Headers (opcional)", "provider.custom.headers.key.label": "Header", "provider.custom.headers.key.placeholder": "Header-Name", @@ -916,8 +932,7 @@ export const dict = { "settings.autocomplete.title": "Autocompletado", "settings.notifications.title": "Notificaciones", "settings.context.title": "Contexto", - "settings.terminal.title": "Terminal", - "settings.prompts.title": "Prompts", + "settings.experimental.title": "Experimental", "settings.language.title": "Idioma", "settings.aboutKiloCode.title": "Acerca de Kilo Code", @@ -938,6 +953,7 @@ export const dict = { "prompt.placeholder.default": "Escribe un mensaje... (Enter para enviar, Shift+Enter para nueva línea)", "context.usage.sessionCost": "Coste de la sesión", + "context.stats.thisSession": "Esta sesión", "time.justNow": "justo ahora", "time.minutesAgo": "hace {{count}} min", @@ -966,8 +982,22 @@ export const dict = { "settings.aboutKiloCode.support.prefix": "Para preguntas de facturación o cuenta, contacta al Soporte al Cliente en", "settings.aboutKiloCode.resetSettings.title": "Restablecer configuración", "settings.aboutKiloCode.resetSettings.description": - "Restablecer todas las configuraciones de la extensión Kilo Code a sus valores predeterminados. Esto no afecta la configuración del CLI o del backend.", + "Esto restablece únicamente las configuraciones específicas de la extensión VS Code a sus valores predeterminados. Las configuraciones compartidas con el CLI, como los modos y las reglas de aprobación automática, se almacenan en la configuración del CLI y no serán restablecidas.", "settings.aboutKiloCode.resetSettings.button": "Restablecer toda la configuración", + "settings.aboutKiloCode.settingsTransfer.title": "Transferencia de ajustes", + "settings.aboutKiloCode.settingsTransfer.description": + "Exporta o importa tus ajustes para transferirlos entre instancias de VS Code.", + "settings.aboutKiloCode.exportSettings": "Exportar", + "settings.aboutKiloCode.importSettings": "Importar", + "settings.aboutKiloCode.importSettings.invalidJson": + "Archivo JSON no válido. Seleccione un archivo de ajustes válido.", + "settings.aboutKiloCode.importSettings.invalidConfig": "El archivo no contiene ajustes válidos de Kilo.", + "settings.aboutKiloCode.importSettings.tooLarge": + "El archivo es demasiado grande. Los archivos de ajustes deben ser menores de 1 MB.", + "settings.aboutKiloCode.importSettings.newerVersion": + "Este archivo fue exportado desde una versión más reciente de Kilo. Algunos ajustes podrían ignorarse.", + "settings.aboutKiloCode.importSettings.success": + "Ajustes importados. Revise los cambios anteriores y luego haga clic en Guardar.", "settings.agentBehaviour.subtab.modes": "Modos", "settings.agentBehaviour.subtab.agents": "Agents", @@ -993,8 +1023,7 @@ export const dict = { "common.add": "Añadir", "common.choose": "Elegir…", - "settings.notImplemented": "Esta sección aún no está implementada.", - "settings.notImplemented.description": "Contendrá opciones de configuración y texto explicativo.", + "settings.autocomplete.autoTrigger.title": "Habilitar completado en línea automático", "settings.autocomplete.autoTrigger.description": "Mostrar automáticamente sugerencias de completado al escribir", "settings.autocomplete.smartKeybinding.title": "Habilitar atajo inteligente de tarea en línea", @@ -1053,6 +1082,13 @@ export const dict = { "settings.agentBehaviour.topP.description": "Parámetro de muestreo nucleus (0-1)", "settings.agentBehaviour.maxSteps.title": "Pasos máximos", "settings.agentBehaviour.maxSteps.description": "Iteraciones máximas del agente", + "settings.agentBehaviour.hidden.title": "Oculto", + "settings.agentBehaviour.hidden.description": "Ocultar este agente del selector de modos en la entrada del chat", + "settings.agentBehaviour.disable.title": "Desactivado", + "settings.agentBehaviour.disable.description": "Desactivar completamente este agente — no aparecerá en ningún lugar", + "settings.agentBehaviour.badge.hidden": "oculto", + "settings.agentBehaviour.badge.disabled": "desactivado", + "settings.agentBehaviour.badge.deprecated": "Obsoleto", "settings.agentBehaviour.discoveredSkills": "Habilidades descubiertas", "settings.agentBehaviour.noSkillsFound": "No se encontraron habilidades. Agregue rutas de carpetas o URLs abajo para hacer disponibles las habilidades.", @@ -1076,12 +1112,22 @@ export const dict = { "settings.agentBehaviour.createMode.nameInvalid": "El nombre solo puede contener letras minúsculas, números y guiones", "settings.agentBehaviour.createMode.nameTaken": "Ya existe un modo con este nombre", + "settings.agentBehaviour.importMode": "Importar", + "settings.agentBehaviour.importMode.invalidName": + "Nombre de modo no válido en el archivo. El nombre debe comenzar con una letra minúscula y contener solo letras minúsculas, números y guiones.", + "settings.agentBehaviour.importMode.nameTaken": "Ya existe un modo con este nombre.", + "settings.agentBehaviour.importMode.invalidJson": + "Archivo JSON no válido. Por favor, seleccione un archivo de definición de agente válido.", + "settings.agentBehaviour.importMode.tooLarge": + "El archivo es demasiado grande. Las definiciones de agente deben ser menores de 1 MB.", + "settings.agentBehaviour.exportMode": "Exportar definición del agente", "settings.agentBehaviour.editMode": "Editar modo", "settings.agentBehaviour.editMode.description": "Descripción", "settings.agentBehaviour.editMode.prompt": "Prompt del sistema", "settings.agentBehaviour.editMode.save": "Listo", "settings.agentBehaviour.editMode.back": "Volver a la lista", - "settings.agentBehaviour.editMode.native": "Modo integrado (definición de solo lectura)", + "settings.agentBehaviour.editMode.native": + "Este es un modo integrado. Su definición base no se puede cambiar, pero puedes configurar sobreescrituras a continuación.", "settings.agentBehaviour.editMode.promptOverride": "Anulación de prompt personalizado para este modo integrado", "settings.agentBehaviour.removeMode.title": "Eliminar modo", "settings.agentBehaviour.removeMode.confirm": @@ -1091,6 +1137,18 @@ export const dict = { "settings.agentBehaviour.removeMcp.confirm": '¿Eliminar el servidor MCP "{{name}}"? Esto lo eliminará de su configuración.', "settings.agentBehaviour.removeMcp.button": "Eliminar", + "settings.agentBehaviour.editMcp": "Editar servidor MCP", + "settings.agentBehaviour.editMcp.transportLocal": "Servidor local (transporte stdio)", + "settings.agentBehaviour.editMcp.transportRemote": "Servidor remoto (transporte SSE/HTTP)", + "settings.agentBehaviour.editMcp.env": "Variables de entorno", + "settings.agentBehaviour.editMcp.env.help": "Variables pasadas al proceso del servidor MCP.", + "settings.agentBehaviour.addMcp.command": "Comando", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "Argumentos", + "settings.agentBehaviour.addMcp.args.help": "Un argumento por línea. Las rutas con espacios se conservan tal cual.", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "URL del servidor", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", "settings.agentBehaviour.skillPaths": "Rutas de carpetas de habilidades", "settings.agentBehaviour.skillUrls": "URLs de habilidades", "settings.agentBehaviour.removeSkill.title": "Eliminar habilidad", @@ -1106,8 +1164,9 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "Argumentos", "settings.agentBehaviour.mcpDetail.env": "Entorno", "settings.agentBehaviour.mcpDetail.disabled": "Este servidor está deshabilitado.", + "settings.agentBehaviour.mcpBrowseMarketplace": "Explorar Marketplace", "settings.agentBehaviour.mcpEmpty": - "No hay servidores MCP configurados. Edite el archivo de configuración de opencode para añadir servidores MCP.", + "No hay servidores MCP configurados. Añada servidores MCP en kilo.jsonc o pida al agente que los añada.", "settings.agentBehaviour.workflowsPlaceholder": "Los flujos de trabajo se gestionan mediante archivos de flujo de trabajo en su espacio de trabajo.", "settings.agentBehaviour.workflows.description": @@ -1116,7 +1175,7 @@ export const dict = { "No hay comandos personalizados configurados. Añada comandos a opencode.json para verlos aquí.", "settings.agentBehaviour.workflows.detail.description": "Descripción", "settings.agentBehaviour.workflows.detail.template": "Plantilla", - "settings.agentBehaviour.notImplemented": "Aún no implementado.", + "settings.autoApprove.description": "Defina cómo se permite la ejecución de las herramientas. La mayoría de las herramientas tienen como valor predeterminado Permitir. doom_loop y external_directory tienen como valor predeterminado Preguntar.", "settings.autoApprove.level.allow": "Permitir", @@ -1172,7 +1231,8 @@ export const dict = { "settings.providers.defaultModel.title": "Modelo predeterminado", "settings.providers.defaultModel.description": "Modelo principal para conversaciones", "settings.providers.smallModel.title": "Modelo pequeño", - "settings.providers.smallModel.description": "Modelo ligero para generación de títulos y tareas rápidas", + "settings.providers.smallModel.description": + "Modelo ligero para generación de títulos, mensajes de commit, mejora de prompts y otras tareas rápidas", "settings.providers.disabled": "Proveedores deshabilitados", "settings.providers.disabled.description": "Proveedores a ocultar de la lista de proveedores", "settings.providers.enabled": "Proveedores habilitados (lista blanca)", @@ -1194,7 +1254,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "Novedades en Kilo Code", - "migration.whatsNew.badge": "Beta", "migration.whatsNew.subtitle": "Hemos reconstruido la extensión sobre una base más rápida y eficiente.", "migration.whatsNew.features.performance.title": "Rendimiento de agente más rápido", "migration.whatsNew.features.performance.detail": @@ -1220,10 +1279,10 @@ export const dict = { "migration.migrate.chatHistoryDesc": "Incompatible con la nueva arquitectura", "migration.migrate.button": "Migrar configuración", "migration.migrate.skip": "Omitir", - "migration.migrate.back": "Atrás", "migration.migrate.keysDetected": "{{count}} claves detectadas", "migration.migrate.serversConfigured": "{{count}} servidor(es) configurado(s)", "migration.migrate.modesFound": "{{count}} modo(s) encontrado(s)", + "migration.migrate.sessionsDetected": "{{count}} sesiones detectadas", "migration.migrate.nothingToMigrate": "No se encontró nada para migrar en la configuración heredada.", // Migrate — item labels (reused from old select keys) @@ -1241,6 +1300,10 @@ export const dict = { "migration.complete.cleanupDescription": "Esto elimina la configuración antigua del almacenamiento de VS Code. No podrás volver a ejecutar esta migración.", "migration.complete.done": "Hecho", + "migration.error.sessionFailed": "La migración de la sesión falló", + "migration.error.continue": "Continuar", + "migration.error.action.copy": "Copiar", + "migration.error.toast.copied": "Error copiado al portapapeles", // legacy-migration end "error.details.show": "Detalles", @@ -1254,8 +1317,7 @@ export const dict = { "settings.saveBar.warning.many": "Varias sesiones están en ejecución y se interrumpirán", "settings.saveBar.saveAnyway": "Guardar de todas formas", "settings.saveBar.cancel": "Cancelar", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "Siguiente", + "notifications.action.close": "Cerrar", + "notifications.action.tryModel": "Probar {{model}}", } diff --git a/packages/kilo-vscode/webview-ui/src/i18n/fr.ts b/packages/kilo-vscode/webview-ui/src/i18n/fr.ts index 0b507379ae4..b2a4da3632b 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/fr.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/fr.ts @@ -268,6 +268,7 @@ export const dict = { "mcp.status.connected": "connecté", "mcp.status.failed": "échoué", "mcp.status.needs_auth": "nécessite auth", + "mcp.status.needs_registration": "nécessite enregistrement client", "mcp.status.disabled": "désactivé", "dialog.fork.empty": "Aucun message à partir duquel bifurquer", @@ -762,6 +763,20 @@ export const dict = { "provider.custom.models.name.placeholder": "Nom d'affichage", "provider.custom.models.remove": "Supprimer le modèle", "provider.custom.models.add": "Ajouter un modèle", + "provider.custom.models.fetch": "Récupérer les modèles", + "provider.custom.models.fetching": "Récupération\u2026", + "provider.custom.models.fetch.error": "Échec de la récupération des modèles : {{error}}", + "provider.custom.models.fetch.authError": "Échec de l'authentification. Vérifiez la clé API ci-dessus et réessayez.", + "provider.custom.models.fetch.empty": "Aucun modèle trouvé sur ce serveur.", + "provider.custom.models.fetch.added": "{{count}} modèle(s) ajouté(s).", + "provider.custom.models.fetch.allExist": "Tous les modèles récupérés sont déjà ajoutés.", + "provider.custom.models.fetch.selectAll": "Tout sélectionner", + "provider.custom.models.fetch.deselectAll": "Tout désélectionner", + "provider.custom.models.fetch.found": "{{count}} modèles trouvés", + "provider.custom.models.fetch.showing": "Affichage de {{shown}} sur {{total}}", + "provider.custom.models.fetch.search": "Rechercher des modèles\u2026", + "provider.custom.models.fetch.add": "Ajouter {{count}} modèle(s)", + "provider.custom.edit.title": "Modifier le fournisseur", "provider.custom.headers.label": "En-têtes (optionnel)", "provider.custom.headers.key.label": "En-tête", "provider.custom.headers.key.placeholder": "Header-Name", @@ -923,8 +938,7 @@ export const dict = { "settings.autocomplete.title": "Autocomplétion", "settings.notifications.title": "Notifications", "settings.context.title": "Contexte", - "settings.terminal.title": "Terminal", - "settings.prompts.title": "Prompts", + "settings.experimental.title": "Expérimental", "settings.language.title": "Langue", "settings.aboutKiloCode.title": "À propos de Kilo Code", @@ -945,6 +959,7 @@ export const dict = { "prompt.placeholder.default": "Tapez un message... (Entrée pour envoyer, Maj+Entrée pour un saut de ligne)", "context.usage.sessionCost": "Coût de la session", + "context.stats.thisSession": "Cette session", "time.justNow": "à l'instant", "time.minutesAgo": "il y a {{count}} min", @@ -975,8 +990,22 @@ export const dict = { "Pour les questions de facturation ou de compte, contactez le support client à", "settings.aboutKiloCode.resetSettings.title": "Réinitialiser les paramètres", "settings.aboutKiloCode.resetSettings.description": - "Réinitialiser tous les paramètres de l'extension Kilo Code à leurs valeurs par défaut. Cela n'affecte pas la configuration CLI ou backend.", + "Ceci réinitialise uniquement les paramètres spécifiques à l'extension VS Code à leurs valeurs par défaut. Les paramètres partagés avec le CLI, tels que les modes et les règles d'approbation automatique, sont stockés dans la configuration du CLI et ne seront pas réinitialisés.", "settings.aboutKiloCode.resetSettings.button": "Réinitialiser tous les paramètres", + "settings.aboutKiloCode.settingsTransfer.title": "Transfert des paramètres", + "settings.aboutKiloCode.settingsTransfer.description": + "Exportez ou importez vos paramètres pour les transférer entre instances VS Code.", + "settings.aboutKiloCode.exportSettings": "Exporter", + "settings.aboutKiloCode.importSettings": "Importer", + "settings.aboutKiloCode.importSettings.invalidJson": + "Fichier JSON invalide. Veuillez sélectionner un fichier de paramètres valide.", + "settings.aboutKiloCode.importSettings.invalidConfig": "Le fichier ne contient pas de paramètres Kilo valides.", + "settings.aboutKiloCode.importSettings.tooLarge": + "Le fichier est trop volumineux. Les fichiers de paramètres doivent faire moins de 1 MB.", + "settings.aboutKiloCode.importSettings.newerVersion": + "Ce fichier a été exporté depuis une version plus récente de Kilo. Certains paramètres pourraient être ignorés.", + "settings.aboutKiloCode.importSettings.success": + "Paramètres importés. Vérifiez les modifications ci-dessus, puis cliquez sur Enregistrer.", "settings.agentBehaviour.subtab.modes": "Modes", "settings.agentBehaviour.subtab.agents": "Agents", @@ -1002,8 +1031,7 @@ export const dict = { "common.add": "Ajouter", "common.choose": "Choisir…", - "settings.notImplemented": "Cette section n'est pas encore implémentée.", - "settings.notImplemented.description": "Elle contiendra des options de configuration et du texte explicatif.", + "settings.autocomplete.autoTrigger.title": "Activer la complétion automatique en ligne", "settings.autocomplete.autoTrigger.description": "Afficher automatiquement les suggestions de complétion lors de la saisie", @@ -1065,6 +1093,13 @@ export const dict = { "settings.agentBehaviour.topP.description": "Paramètre d'échantillonnage nucleus (0-1)", "settings.agentBehaviour.maxSteps.title": "Étapes max.", "settings.agentBehaviour.maxSteps.description": "Itérations maximales de l'agent", + "settings.agentBehaviour.hidden.title": "Masqué", + "settings.agentBehaviour.hidden.description": "Masquer cet agent du sélecteur de mode dans la saisie du chat", + "settings.agentBehaviour.disable.title": "Désactivé", + "settings.agentBehaviour.disable.description": "Désactiver complètement cet agent — il n'apparaîtra nulle part", + "settings.agentBehaviour.badge.hidden": "masqué", + "settings.agentBehaviour.badge.disabled": "désactivé", + "settings.agentBehaviour.badge.deprecated": "Déprécié", "settings.agentBehaviour.discoveredSkills": "Compétences découvertes", "settings.agentBehaviour.noSkillsFound": "Aucune compétence découverte. Ajoutez des chemins de dossiers ou des URLs ci-dessous pour rendre les compétences disponibles.", @@ -1089,12 +1124,22 @@ export const dict = { "settings.agentBehaviour.createMode.nameInvalid": "Le nom ne doit contenir que des minuscules, des chiffres et des tirets", "settings.agentBehaviour.createMode.nameTaken": "Un mode avec ce nom existe déjà", + "settings.agentBehaviour.importMode": "Importer", + "settings.agentBehaviour.importMode.invalidName": + "Nom de mode invalide dans le fichier. Le nom doit commencer par une lettre minuscule et ne contenir que des lettres minuscules, des chiffres et des tirets.", + "settings.agentBehaviour.importMode.nameTaken": "Un mode avec ce nom existe déjà.", + "settings.agentBehaviour.importMode.invalidJson": + "Fichier JSON invalide. Veuillez sélectionner un fichier de définition d'agent valide.", + "settings.agentBehaviour.importMode.tooLarge": + "Le fichier est trop volumineux. Les définitions d'agent doivent faire moins de 1 Mo.", + "settings.agentBehaviour.exportMode": "Exporter la définition de l'agent", "settings.agentBehaviour.editMode": "Modifier le mode", "settings.agentBehaviour.editMode.description": "Description", "settings.agentBehaviour.editMode.prompt": "Prompt système", "settings.agentBehaviour.editMode.save": "Terminé", "settings.agentBehaviour.editMode.back": "Retour à la liste", - "settings.agentBehaviour.editMode.native": "Mode intégré (définition en lecture seule)", + "settings.agentBehaviour.editMode.native": + "Il s'agit d'un mode intégré. Sa définition de base ne peut pas être modifiée, mais vous pouvez configurer des surcharges ci-dessous.", "settings.agentBehaviour.editMode.promptOverride": "Remplacement de prompt personnalisé pour ce mode intégré", "settings.agentBehaviour.removeMode.title": "Supprimer le mode", "settings.agentBehaviour.removeMode.confirm": @@ -1104,6 +1149,19 @@ export const dict = { "settings.agentBehaviour.removeMcp.confirm": 'Supprimer le serveur MCP "{{name}}" ? Cela le supprimera de votre configuration.', "settings.agentBehaviour.removeMcp.button": "Supprimer", + "settings.agentBehaviour.editMcp": "Modifier le serveur MCP", + "settings.agentBehaviour.editMcp.transportLocal": "Serveur local (transport stdio)", + "settings.agentBehaviour.editMcp.transportRemote": "Serveur distant (transport SSE/HTTP)", + "settings.agentBehaviour.editMcp.env": "Variables d'environnement", + "settings.agentBehaviour.editMcp.env.help": "Variables transmises au processus du serveur MCP.", + "settings.agentBehaviour.addMcp.command": "Commande", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "Arguments", + "settings.agentBehaviour.addMcp.args.help": + "Un argument par ligne. Les chemins avec des espaces sont conservés tels quels.", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "URL du serveur", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", "settings.agentBehaviour.skillPaths": "Chemins des dossiers de compétences", "settings.agentBehaviour.skillUrls": "URLs de compétences", "settings.agentBehaviour.removeSkill.title": "Supprimer la compétence", @@ -1118,8 +1176,9 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "Arguments", "settings.agentBehaviour.mcpDetail.env": "Environnement", "settings.agentBehaviour.mcpDetail.disabled": "Ce serveur est désactivé.", + "settings.agentBehaviour.mcpBrowseMarketplace": "Parcourir le Marketplace", "settings.agentBehaviour.mcpEmpty": - "Aucun serveur MCP configuré. Modifiez le fichier de configuration opencode pour ajouter des serveurs MCP.", + "Aucun serveur MCP configuré. Ajoutez des serveurs MCP dans kilo.jsonc ou demandez à l'agent de les ajouter.", "settings.agentBehaviour.workflowsPlaceholder": "Les workflows sont gérés via les fichiers de workflow dans votre espace de travail.", "settings.agentBehaviour.workflows.description": @@ -1128,7 +1187,7 @@ export const dict = { "Aucune commande personnalisée configurée. Ajoutez des commandes à opencode.json pour les voir ici.", "settings.agentBehaviour.workflows.detail.description": "Description", "settings.agentBehaviour.workflows.detail.template": "Modèle", - "settings.agentBehaviour.notImplemented": "Pas encore implémenté.", + "settings.autoApprove.description": "Définissez comment les outils sont autorisés à s'exécuter. La plupart des outils sont définis sur Autoriser par défaut. doom_loop et external_directory sont définis sur Demander par défaut.", "settings.autoApprove.level.allow": "Autoriser", @@ -1185,7 +1244,8 @@ export const dict = { "settings.providers.defaultModel.title": "Modèle par défaut", "settings.providers.defaultModel.description": "Modèle principal pour les conversations", "settings.providers.smallModel.title": "Petit modèle", - "settings.providers.smallModel.description": "Modèle léger pour la génération de titres et tâches rapides", + "settings.providers.smallModel.description": + "Modèle léger pour la génération de titres, de messages de commit, l'amélioration de prompts et d'autres tâches rapides", "settings.providers.disabled": "Fournisseurs désactivés", "settings.providers.disabled.description": "Fournisseurs à masquer de la liste", "settings.providers.enabled": "Fournisseurs activés (liste blanche)", @@ -1207,7 +1267,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "Nouveautés de Kilo Code", - "migration.whatsNew.badge": "Beta", "migration.whatsNew.subtitle": "Nous avons reconstruit l'extension sur une base plus rapide et plus efficace.", "migration.whatsNew.features.performance.title": "Performance accélérée de l'agent", "migration.whatsNew.features.performance.detail": @@ -1233,7 +1292,6 @@ export const dict = { "migration.migrate.chatHistoryDesc": "Incompatible avec la nouvelle architecture", "migration.migrate.button": "Migrer les paramètres", "migration.migrate.skip": "Ignorer", - "migration.migrate.back": "Retour", "migration.migrate.keysDetected": "{{count}} clés détectées", "migration.migrate.serversConfigured": "{{count}} serveur(s) configuré(s)", "migration.migrate.modesFound": "{{count}} mode(s) trouvé(s)", @@ -1254,6 +1312,11 @@ export const dict = { "migration.complete.cleanupDescription": "Cela supprime les anciens paramètres du stockage de VS Code. Vous ne pourrez pas réexécuter cette migration.", "migration.complete.done": "Terminé", + "migration.migrate.sessionsDetected": "{{count}} sessions détectées", + "migration.error.sessionFailed": "La migration de la session a échoué", + "migration.error.continue": "Continuer", + "migration.error.action.copy": "Copier", + "migration.error.toast.copied": "Erreur copiée dans le presse-papiers", // legacy-migration end "error.details.show": "Détails", @@ -1267,8 +1330,7 @@ export const dict = { "settings.saveBar.warning.many": "Plusieurs sessions sont en cours et seront interrompues", "settings.saveBar.saveAnyway": "Enregistrer quand même", "settings.saveBar.cancel": "Annuler", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "Suivant", + "notifications.action.close": "Fermer", + "notifications.action.tryModel": "Essayer {{model}}", } diff --git a/packages/kilo-vscode/webview-ui/src/i18n/ja.ts b/packages/kilo-vscode/webview-ui/src/i18n/ja.ts index 21464079b85..c291aa11b61 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/ja.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/ja.ts @@ -266,6 +266,7 @@ export const dict = { "mcp.status.connected": "接続済み", "mcp.status.failed": "失敗", "mcp.status.needs_auth": "認証が必要", + "mcp.status.needs_registration": "クライアント登録が必要", "mcp.status.disabled": "無効", "dialog.fork.empty": "フォーク元のメッセージがありません", @@ -750,6 +751,20 @@ export const dict = { "provider.custom.models.name.placeholder": "表示名", "provider.custom.models.remove": "モデルを削除", "provider.custom.models.add": "モデルを追加", + "provider.custom.models.fetch": "モデルを取得", + "provider.custom.models.fetching": "取得中\u2026", + "provider.custom.models.fetch.error": "モデルの取得に失敗しました: {{error}}", + "provider.custom.models.fetch.authError": "認証に失敗しました。上記のAPIキーを確認して再試行してください。", + "provider.custom.models.fetch.empty": "このサーバーにモデルが見つかりません。", + "provider.custom.models.fetch.added": "{{count}}個のモデルを追加しました。", + "provider.custom.models.fetch.allExist": "取得したモデルはすべて既に追加されています。", + "provider.custom.models.fetch.selectAll": "すべて選択", + "provider.custom.models.fetch.deselectAll": "すべて選択解除", + "provider.custom.models.fetch.found": "{{count}}個のモデルが見つかりました", + "provider.custom.models.fetch.showing": "{{total}}件中{{shown}}件を表示", + "provider.custom.models.fetch.search": "モデルを検索\u2026", + "provider.custom.models.fetch.add": "{{count}}個のモデルを追加", + "provider.custom.edit.title": "プロバイダーを編集", "provider.custom.headers.label": "ヘッダー(任意)", "provider.custom.headers.key.label": "ヘッダー", "provider.custom.headers.key.placeholder": "Header-Name", @@ -908,8 +923,7 @@ export const dict = { "settings.autocomplete.title": "オートコンプリート", "settings.notifications.title": "通知", "settings.context.title": "コンテキスト", - "settings.terminal.title": "ターミナル", - "settings.prompts.title": "プロンプト", + "settings.experimental.title": "実験的機能", "settings.language.title": "言語", "settings.aboutKiloCode.title": "Kilo Codeについて", @@ -930,6 +944,7 @@ export const dict = { "prompt.placeholder.default": "メッセージを入力... (Enterで送信、Shift+Enterで改行)", "context.usage.sessionCost": "セッションコスト", + "context.stats.thisSession": "このセッション", "time.justNow": "たった今", "time.minutesAgo": "{{count}}分前", @@ -959,8 +974,21 @@ export const dict = { "請求やアカウントに関するご質問は、カスタマーサポートまでお問い合わせください", "settings.aboutKiloCode.resetSettings.title": "設定をリセット", "settings.aboutKiloCode.resetSettings.description": - "Kilo Code拡張機能のすべての設定をデフォルト値にリセットします。CLIやバックエンドの設定には影響しません。", + "これはVS Code拡張機能固有の設定のみをデフォルト値にリセットします。モードや自動承認ルールなど、CLIと共有される設定はCLI設定ファイルに保存されており、リセットされません。", "settings.aboutKiloCode.resetSettings.button": "すべての設定をリセット", + "settings.aboutKiloCode.settingsTransfer.title": "設定の移行", + "settings.aboutKiloCode.settingsTransfer.description": + "VS Code インスタンス間で設定を転送するには、エクスポートまたはインポートしてください。", + "settings.aboutKiloCode.exportSettings": "エクスポート", + "settings.aboutKiloCode.importSettings": "インポート", + "settings.aboutKiloCode.importSettings.invalidJson": + "無効な JSON ファイルです。有効な設定ファイルを選択してください。", + "settings.aboutKiloCode.importSettings.invalidConfig": "ファイルに有効な Kilo の設定が含まれていません。", + "settings.aboutKiloCode.importSettings.tooLarge": "ファイルが大きすぎます。設定ファイルは 1 MB 以下にしてください。", + "settings.aboutKiloCode.importSettings.newerVersion": + "このファイルはより新しいバージョンの Kilo からエクスポートされたものです。一部の設定が無視される場合があります。", + "settings.aboutKiloCode.importSettings.success": + "設定をインポートしました。上記の変更内容を確認してから、保存をクリックしてください。", "settings.agentBehaviour.subtab.modes": "モード", "settings.agentBehaviour.subtab.agents": "Agents", @@ -985,9 +1013,7 @@ export const dict = { "common.add": "追加", "common.choose": "選択…", - "settings.notImplemented": "このセクションはまだ実装されていません。", - "settings.notImplemented.description": - "選択した設定カテゴリに関連する設定オプションと説明テキストが含まれる予定です。", + "settings.autocomplete.autoTrigger.title": "自動インライン補完を有効にする", "settings.autocomplete.autoTrigger.description": "入力時にインライン補完の提案を自動的に表示", "settings.autocomplete.smartKeybinding.title": "スマートインラインタスクキーバインドを有効にする", @@ -1045,6 +1071,13 @@ export const dict = { "settings.agentBehaviour.topP.description": "核サンプリングパラメータ(0-1)", "settings.agentBehaviour.maxSteps.title": "最大ステップ数", "settings.agentBehaviour.maxSteps.description": "最大エージェント反復回数", + "settings.agentBehaviour.hidden.title": "非表示", + "settings.agentBehaviour.hidden.description": "チャット入力のモード切り替えからこのエージェントを非表示にする", + "settings.agentBehaviour.disable.title": "無効", + "settings.agentBehaviour.disable.description": "このエージェントを完全に無効にする — どこにも表示されなくなります", + "settings.agentBehaviour.badge.hidden": "非表示", + "settings.agentBehaviour.badge.disabled": "無効", + "settings.agentBehaviour.badge.deprecated": "非推奨", "settings.agentBehaviour.discoveredSkills": "検出されたスキル", "settings.agentBehaviour.noSkillsFound": "スキルが見つかりません。スキルを利用可能にするには、以下にスキルフォルダパスまたはURLを追加してください。", @@ -1067,12 +1100,22 @@ export const dict = { "settings.agentBehaviour.createMode.nameRequired": "名前は必須です", "settings.agentBehaviour.createMode.nameInvalid": "名前には小文字、数字、ハイフンのみ使用できます", "settings.agentBehaviour.createMode.nameTaken": "この名前のモードはすでに存在します", + "settings.agentBehaviour.importMode": "インポート", + "settings.agentBehaviour.importMode.invalidName": + "ファイル内のモード名が無効です。名前は小文字で始まり、小文字、数字、ハイフンのみを含む必要があります。", + "settings.agentBehaviour.importMode.nameTaken": "この名前のモードはすでに存在します。", + "settings.agentBehaviour.importMode.invalidJson": + "無効なJSONファイルです。有効なエージェント定義ファイルを選択してください。", + "settings.agentBehaviour.importMode.tooLarge": + "ファイルが大きすぎます。エージェント定義は1 MB以下である必要があります。", + "settings.agentBehaviour.exportMode": "エージェント定義をエクスポート", "settings.agentBehaviour.editMode": "モードを編集", "settings.agentBehaviour.editMode.description": "説明", "settings.agentBehaviour.editMode.prompt": "システムプロンプト", "settings.agentBehaviour.editMode.save": "完了", "settings.agentBehaviour.editMode.back": "リストに戻る", - "settings.agentBehaviour.editMode.native": "組み込みモード(読み取り専用の定義)", + "settings.agentBehaviour.editMode.native": + "これは組み込みモードです。基本定義は変更できませんが、以下でオーバーライドを設定できます。", "settings.agentBehaviour.editMode.promptOverride": "この組み込みモードのカスタムプロンプト上書き", "settings.agentBehaviour.removeMode.title": "モードを削除", "settings.agentBehaviour.removeMode.confirm": @@ -1081,6 +1124,18 @@ export const dict = { "settings.agentBehaviour.removeMcp.title": "MCPサーバーを削除", "settings.agentBehaviour.removeMcp.confirm": 'MCPサーバー "{{name}}" を削除しますか?設定から削除されます。', "settings.agentBehaviour.removeMcp.button": "削除", + "settings.agentBehaviour.editMcp": "MCPサーバーを編集", + "settings.agentBehaviour.editMcp.transportLocal": "ローカルサーバー(stdio トランスポート)", + "settings.agentBehaviour.editMcp.transportRemote": "リモートサーバー(SSE/HTTP トランスポート)", + "settings.agentBehaviour.editMcp.env": "環境変数", + "settings.agentBehaviour.editMcp.env.help": "MCPサーバープロセスに渡される変数。", + "settings.agentBehaviour.addMcp.command": "コマンド", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "引数", + "settings.agentBehaviour.addMcp.args.help": "1行に1つの引数。スペースを含むパスはそのまま保持されます。", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "サーバーURL", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", "settings.agentBehaviour.skillPaths": "スキルフォルダパス", "settings.agentBehaviour.skillUrls": "スキルURL", "settings.agentBehaviour.removeSkill.title": "スキルを削除", @@ -1095,8 +1150,9 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "引数", "settings.agentBehaviour.mcpDetail.env": "環境", "settings.agentBehaviour.mcpDetail.disabled": "このサーバーは無効です。", + "settings.agentBehaviour.mcpBrowseMarketplace": "マーケットプレイスを閲覧", "settings.agentBehaviour.mcpEmpty": - "MCPサーバーが設定されていません。opencode設定ファイルを編集してMCPサーバーを追加してください。", + "MCPサーバーが設定されていません。kilo.jsoncでMCPサーバーを追加するか、エージェントに追加を依頼してください。", "settings.agentBehaviour.workflowsPlaceholder": "ワークフローはワークスペース内のワークフローファイルを通じて管理されます。", "settings.agentBehaviour.workflows.description": @@ -1105,7 +1161,7 @@ export const dict = { "カスタムコマンドが設定されていません。opencode.json にコマンドを追加するとここに表示されます。", "settings.agentBehaviour.workflows.detail.description": "説明", "settings.agentBehaviour.workflows.detail.template": "テンプレート", - "settings.agentBehaviour.notImplemented": "まだ実装されていません。", + "settings.autoApprove.description": "ツールの実行許可を定義します。ほとんどのツールはデフォルトで「許可」されます。doom_loop と external_directory はデフォルトで「確認」になります。", "settings.autoApprove.level.allow": "許可", @@ -1158,7 +1214,8 @@ export const dict = { "settings.providers.defaultModel.title": "デフォルトモデル", "settings.providers.defaultModel.description": "会話のプライマリモデル", "settings.providers.smallModel.title": "小型モデル", - "settings.providers.smallModel.description": "タイトル生成やその他の高速タスク用の軽量モデル", + "settings.providers.smallModel.description": + "タイトル生成、コミットメッセージ生成、プロンプト改善、およびその他の高速タスク用の軽量モデル", "settings.providers.disabled": "無効化されたプロバイダー", "settings.providers.disabled.description": "プロバイダーリストから非表示にするプロバイダー", "settings.providers.enabled": "有効化されたプロバイダー(ホワイトリスト)", @@ -1180,7 +1237,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "Kilo Codeの新機能", - "migration.whatsNew.badge": "Beta", "migration.whatsNew.subtitle": "より高速で効率的な基盤上に拡張機能を再構築しました。", "migration.whatsNew.features.performance.title": "高速なエージェントパフォーマンス", "migration.whatsNew.features.performance.detail": @@ -1205,7 +1261,6 @@ export const dict = { "migration.migrate.chatHistoryDesc": "新しいアーキテクチャと互換性がありません", "migration.migrate.button": "設定を移行", "migration.migrate.skip": "スキップ", - "migration.migrate.back": "戻る", "migration.migrate.keysDetected": "{{count}}個のキーを検出", "migration.migrate.serversConfigured": "{{count}}個のサーバーが設定済み", "migration.migrate.modesFound": "{{count}}個のモードが見つかりました", @@ -1226,6 +1281,11 @@ export const dict = { "migration.complete.cleanupDescription": "VS Codeのストレージから古い設定を削除します。この移行を再度実行することはできなくなります。", "migration.complete.done": "完了", + "migration.migrate.sessionsDetected": "{{count}} 件のセッションが見つかりました", + "migration.error.sessionFailed": "セッションの移行に失敗しました", + "migration.error.continue": "続行", + "migration.error.action.copy": "コピー", + "migration.error.toast.copied": "エラーをクリップボードにコピーしました", // legacy-migration end "error.details.show": "詳細", @@ -1239,8 +1299,7 @@ export const dict = { "settings.saveBar.warning.many": "複数のセッションが実行中で中断されます", "settings.saveBar.saveAnyway": "それでも保存", "settings.saveBar.cancel": "キャンセル", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "次へ", + "notifications.action.close": "閉じる", + "notifications.action.tryModel": "{{model}}を試す", } diff --git a/packages/kilo-vscode/webview-ui/src/i18n/ko.ts b/packages/kilo-vscode/webview-ui/src/i18n/ko.ts index 4d262f0b16e..f4ed91ce951 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/ko.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/ko.ts @@ -270,6 +270,7 @@ export const dict = { "mcp.status.connected": "연결됨", "mcp.status.failed": "실패", "mcp.status.needs_auth": "인증 필요", + "mcp.status.needs_registration": "클라이언트 등록 필요", "mcp.status.disabled": "비활성화됨", "dialog.fork.empty": "분기할 메시지 없음", @@ -751,6 +752,20 @@ export const dict = { "provider.custom.models.name.placeholder": "표시 이름", "provider.custom.models.remove": "모델 제거", "provider.custom.models.add": "모델 추가", + "provider.custom.models.fetch": "모델 가져오기", + "provider.custom.models.fetching": "가져오는 중\u2026", + "provider.custom.models.fetch.error": "모델을 가져오지 못했습니다: {{error}}", + "provider.custom.models.fetch.authError": "인증에 실패했습니다. 위의 API 키를 확인하고 다시 시도하세요.", + "provider.custom.models.fetch.empty": "이 서버에서 모델을 찾을 수 없습니다.", + "provider.custom.models.fetch.added": "{{count}}개 모델이 추가되었습니다.", + "provider.custom.models.fetch.allExist": "가져온 모든 모델이 이미 추가되어 있습니다.", + "provider.custom.models.fetch.selectAll": "모두 선택", + "provider.custom.models.fetch.deselectAll": "모두 선택 해제", + "provider.custom.models.fetch.found": "{{count}}개 모델 발견", + "provider.custom.models.fetch.showing": "{{total}}개 중 {{shown}}개 표시", + "provider.custom.models.fetch.search": "모델 검색\u2026", + "provider.custom.models.fetch.add": "{{count}}개 모델 추가", + "provider.custom.edit.title": "공급자 편집", "provider.custom.headers.label": "헤더 (선택사항)", "provider.custom.headers.key.label": "헤더", "provider.custom.headers.key.placeholder": "Header-Name", @@ -908,8 +923,7 @@ export const dict = { "settings.autocomplete.title": "자동 완성", "settings.notifications.title": "알림", "settings.context.title": "컨텍스트", - "settings.terminal.title": "터미널", - "settings.prompts.title": "프롬프트", + "settings.experimental.title": "실험적", "settings.language.title": "언어", "settings.aboutKiloCode.title": "Kilo Code 정보", @@ -930,6 +944,7 @@ export const dict = { "prompt.placeholder.default": "메시지를 입력하세요... (Enter로 전송, Shift+Enter로 줄 바꿈)", "context.usage.sessionCost": "세션 비용", + "context.stats.thisSession": "이 세션", "time.justNow": "방금", "time.minutesAgo": "{{count}}분 전", @@ -958,8 +973,20 @@ export const dict = { "settings.aboutKiloCode.support.prefix": "결제 또는 계정 관련 문의는 고객 지원팀에 문의하세요", "settings.aboutKiloCode.resetSettings.title": "설정 초기화", "settings.aboutKiloCode.resetSettings.description": - "Kilo Code 확장 프로그램의 모든 설정을 기본값으로 초기화합니다. CLI 또는 백엔드 구성에는 영향을 미치지 않습니다.", + "이 기능은 VS Code 확장 프로그램 전용 설정만 기본값으로 초기화합니다. 모드 및 자동 승인 규칙과 같이 CLI와 공유되는 설정은 CLI 구성에 저장되며 초기화되지 않습니다.", "settings.aboutKiloCode.resetSettings.button": "모든 설정 초기화", + "settings.aboutKiloCode.settingsTransfer.title": "설정 이전", + "settings.aboutKiloCode.settingsTransfer.description": + "VS Code 인스턴스 간에 설정을 전송하려면 내보내기 또는 가져오기하세요.", + "settings.aboutKiloCode.exportSettings": "내보내기", + "settings.aboutKiloCode.importSettings": "가져오기", + "settings.aboutKiloCode.importSettings.invalidJson": + "유효하지 않은 JSON 파일입니다. 올바른 설정 파일을 선택해 주세요.", + "settings.aboutKiloCode.importSettings.invalidConfig": "파일에 유효한 Kilo 설정이 포함되어 있지 않습니다.", + "settings.aboutKiloCode.importSettings.tooLarge": "파일이 너무 큽니다. 설정 파일은 1 MB 이하여야 합니다.", + "settings.aboutKiloCode.importSettings.newerVersion": + "이 파일은 더 최신 버전의 Kilo에서 내보낸 것입니다. 일부 설정이 무시될 수 있습니다.", + "settings.aboutKiloCode.importSettings.success": "설정을 가져왔습니다. 위의 변경 사항을 확인한 후 저장을 클릭하세요.", "settings.agentBehaviour.subtab.modes": "모드", "settings.agentBehaviour.subtab.agents": "Agents", @@ -983,8 +1010,7 @@ export const dict = { "common.add": "추가", "common.choose": "선택…", - "settings.notImplemented": "이 섹션은 아직 구현되지 않았습니다.", - "settings.notImplemented.description": "선택한 설정 카테고리와 관련된 구성 옵션 및 설명 텍스트가 포함될 예정입니다.", + "settings.autocomplete.autoTrigger.title": "자동 인라인 완성 활성화", "settings.autocomplete.autoTrigger.description": "입력 시 인라인 완성 제안을 자동으로 표시", "settings.autocomplete.smartKeybinding.title": "스마트 인라인 작업 키바인딩 활성화", @@ -1042,6 +1068,13 @@ export const dict = { "settings.agentBehaviour.topP.description": "핵 샘플링 매개변수 (0-1)", "settings.agentBehaviour.maxSteps.title": "최대 단계", "settings.agentBehaviour.maxSteps.description": "최대 에이전트 반복 횟수", + "settings.agentBehaviour.hidden.title": "숨김", + "settings.agentBehaviour.hidden.description": "채팅 입력의 모드 전환기에서 이 에이전트를 숨기기", + "settings.agentBehaviour.disable.title": "비활성화됨", + "settings.agentBehaviour.disable.description": "이 에이전트를 완전히 비활성화 — 어디에도 표시되지 않습니다", + "settings.agentBehaviour.badge.hidden": "숨김", + "settings.agentBehaviour.badge.disabled": "비활성화됨", + "settings.agentBehaviour.badge.deprecated": "비권장", "settings.agentBehaviour.discoveredSkills": "검색된 스킬", "settings.agentBehaviour.noSkillsFound": "스킬을 찾을 수 없습니다. 스킬을 사용하려면 아래에 스킬 폴더 경로 또는 URL을 추가하세요.", @@ -1063,12 +1096,20 @@ export const dict = { "settings.agentBehaviour.createMode.nameRequired": "이름은 필수입니다", "settings.agentBehaviour.createMode.nameInvalid": "이름에는 소문자, 숫자, 하이픈만 포함될 수 있습니다", "settings.agentBehaviour.createMode.nameTaken": "이 이름의 모드가 이미 존재합니다", + "settings.agentBehaviour.importMode": "가져오기", + "settings.agentBehaviour.importMode.invalidName": + "파일의 모드 이름이 잘못되었습니다. 이름은 소문자로 시작하고 소문자, 숫자, 하이픈만 포함해야 합니다.", + "settings.agentBehaviour.importMode.nameTaken": "이 이름의 모드가 이미 존재합니다.", + "settings.agentBehaviour.importMode.invalidJson": "잘못된 JSON 파일입니다. 유효한 에이전트 정의 파일을 선택하세요.", + "settings.agentBehaviour.importMode.tooLarge": "파일이 너무 큽니다. 에이전트 정의는 1 MB 미만이어야 합니다.", + "settings.agentBehaviour.exportMode": "에이전트 정의 내보내기", "settings.agentBehaviour.editMode": "모드 편집", "settings.agentBehaviour.editMode.description": "설명", "settings.agentBehaviour.editMode.prompt": "시스템 프롬프트", "settings.agentBehaviour.editMode.save": "완료", "settings.agentBehaviour.editMode.back": "목록으로 돌아가기", - "settings.agentBehaviour.editMode.native": "내장 모드 (읽기 전용 정의)", + "settings.agentBehaviour.editMode.native": + "이것은 내장 모드입니다. 기본 정의는 변경할 수 없지만, 아래에서 재정의를 구성할 수 있습니다.", "settings.agentBehaviour.editMode.promptOverride": "이 내장 모드에 대한 사용자 지정 프롬프트 재정의", "settings.agentBehaviour.removeMode.title": "모드 제거", "settings.agentBehaviour.removeMode.confirm": @@ -1077,6 +1118,18 @@ export const dict = { "settings.agentBehaviour.removeMcp.title": "MCP 서버 제거", "settings.agentBehaviour.removeMcp.confirm": 'MCP 서버 "{{name}}"을(를) 제거하시겠습니까? 구성에서 제거됩니다.', "settings.agentBehaviour.removeMcp.button": "제거", + "settings.agentBehaviour.editMcp": "MCP 서버 편집", + "settings.agentBehaviour.editMcp.transportLocal": "로컬 서버 (stdio 전송)", + "settings.agentBehaviour.editMcp.transportRemote": "원격 서버 (SSE/HTTP 전송)", + "settings.agentBehaviour.editMcp.env": "환경 변수", + "settings.agentBehaviour.editMcp.env.help": "MCP 서버 프로세스에 전달되는 변수입니다.", + "settings.agentBehaviour.addMcp.command": "명령어", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "인수", + "settings.agentBehaviour.addMcp.args.help": "한 줄에 하나의 인수. 공백이 포함된 경로는 그대로 유지됩니다.", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "서버 URL", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", "settings.agentBehaviour.skillPaths": "스킬 폴더 경로", "settings.agentBehaviour.skillUrls": "스킬 URL", "settings.agentBehaviour.removeSkill.title": "스킬 제거", @@ -1091,8 +1144,9 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "인수", "settings.agentBehaviour.mcpDetail.env": "환경", "settings.agentBehaviour.mcpDetail.disabled": "이 서버는 비활성화되어 있습니다.", + "settings.agentBehaviour.mcpBrowseMarketplace": "마켓플레이스 둘러보기", "settings.agentBehaviour.mcpEmpty": - "MCP 서버가 구성되지 않았습니다. opencode 구성 파일을 편집하여 MCP 서버를 추가하세요.", + "MCP 서버가 구성되지 않았습니다. kilo.jsonc에서 MCP 서버를 추가하거나 에이전트에게 추가를 요청하세요.", "settings.agentBehaviour.workflowsPlaceholder": "워크플로우는 워크스페이스의 워크플로우 파일을 통해 관리됩니다.", "settings.agentBehaviour.workflows.description": "워크플로우는 구성에서 정의된 사용자 정의 슬래시 명령입니다. 채팅에서 /command-name을 입력하여 실행합니다. 명령은 opencode.json의 'command' 섹션에서 구성됩니다.", @@ -1100,7 +1154,7 @@ export const dict = { "구성된 사용자 정의 명령이 없습니다. opencode.json에 명령을 추가하면 여기에 표시됩니다.", "settings.agentBehaviour.workflows.detail.description": "설명", "settings.agentBehaviour.workflows.detail.template": "템플릿", - "settings.agentBehaviour.notImplemented": "아직 구현되지 않았습니다.", + "settings.autoApprove.description": "도구 실행 허용 방식을 정의합니다. 대부분의 도구 기본값은 '허용'입니다. doom_loop 및 external_directory의 기본값은 '확인'입니다.", "settings.autoApprove.level.allow": "허용", @@ -1148,7 +1202,8 @@ export const dict = { "settings.providers.defaultModel.title": "기본 모델", "settings.providers.defaultModel.description": "대화의 기본 모델", "settings.providers.smallModel.title": "소형 모델", - "settings.providers.smallModel.description": "제목 생성 및 기타 빠른 작업을 위한 경량 모델", + "settings.providers.smallModel.description": + "제목 생성, 커밋 메시지 생성, 프롬프트 개선 및 기타 빠른 작업을 위한 경량 모델", "settings.providers.disabled": "비활성화된 공급자", "settings.providers.disabled.description": "공급자 목록에서 숨길 공급자", "settings.providers.enabled": "활성화된 공급자 (허용 목록)", @@ -1170,7 +1225,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "Kilo Code의 새로운 기능", - "migration.whatsNew.badge": "Beta", "migration.whatsNew.subtitle": "더 빠르고 효율적인 기반 위에 확장 프로그램을 재구축했습니다.", "migration.whatsNew.features.performance.title": "더 빠른 에이전트 성능", "migration.whatsNew.features.performance.detail": @@ -1195,7 +1249,6 @@ export const dict = { "migration.migrate.chatHistoryDesc": "새 아키텍처와 호환되지 않음", "migration.migrate.button": "설정 마이그레이션", "migration.migrate.skip": "건너뛰기", - "migration.migrate.back": "뒤로", "migration.migrate.keysDetected": "{{count}}개의 키 감지됨", "migration.migrate.serversConfigured": "{{count}}개의 서버 구성됨", "migration.migrate.modesFound": "{{count}}개의 모드 발견됨", @@ -1216,6 +1269,11 @@ export const dict = { "migration.complete.cleanupDescription": "이 작업은 VS Code 저장소에서 이전 설정을 제거합니다. 이 마이그레이션을 다시 실행할 수 없게 됩니다.", "migration.complete.done": "완료", + "migration.migrate.sessionsDetected": "{{count}}개의 세션이 감지되었습니다", + "migration.error.sessionFailed": "세션 마이그레이션에 실패했습니다", + "migration.error.continue": "계속", + "migration.error.action.copy": "복사", + "migration.error.toast.copied": "오류가 클립보드에 복사되었습니다", // legacy-migration end "error.details.show": "상세 정보", @@ -1229,8 +1287,7 @@ export const dict = { "settings.saveBar.warning.many": "여러 세션이 실행 중이며 중단됩니다", "settings.saveBar.saveAnyway": "그래도 저장", "settings.saveBar.cancel": "취소", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "다음", + "notifications.action.close": "닫기", + "notifications.action.tryModel": "{{model}} 시도", } diff --git a/packages/kilo-vscode/webview-ui/src/i18n/nl.ts b/packages/kilo-vscode/webview-ui/src/i18n/nl.ts index 6c18764d272..90d29ffd81e 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/nl.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/nl.ts @@ -268,6 +268,7 @@ export const dict = { "mcp.status.connected": "verbonden", "mcp.status.failed": "mislukt", "mcp.status.needs_auth": "authenticatie vereist", + "mcp.status.needs_registration": "clientregistratie vereist", "mcp.status.disabled": "uitgeschakeld", "dialog.fork.empty": "Geen berichten om van af te splitsen", @@ -750,6 +751,21 @@ export const dict = { "provider.custom.models.name.placeholder": "Weergavenaam", "provider.custom.models.remove": "Model verwijderen", "provider.custom.models.add": "Model toevoegen", + "provider.custom.models.fetch": "Modellen ophalen", + "provider.custom.models.fetching": "Ophalen\u2026", + "provider.custom.models.fetch.error": "Kan modellen niet ophalen: {{error}}", + "provider.custom.models.fetch.authError": + "Authenticatie mislukt. Controleer de API-sleutel hierboven en probeer het opnieuw.", + "provider.custom.models.fetch.empty": "Geen modellen gevonden op deze server.", + "provider.custom.models.fetch.added": "{{count}} model(len) toegevoegd.", + "provider.custom.models.fetch.allExist": "Alle opgehaalde modellen zijn al toegevoegd.", + "provider.custom.models.fetch.selectAll": "Alles selecteren", + "provider.custom.models.fetch.deselectAll": "Alles deselecteren", + "provider.custom.models.fetch.found": "{{count}} modellen gevonden", + "provider.custom.models.fetch.showing": "{{shown}} van {{total}} weergegeven", + "provider.custom.models.fetch.search": "Modellen zoeken\u2026", + "provider.custom.models.fetch.add": "{{count}} model(len) toevoegen", + "provider.custom.edit.title": "Provider bewerken", "provider.custom.headers.label": "Headers (optioneel)", "provider.custom.headers.key.label": "Header", "provider.custom.headers.key.placeholder": "Header-Naam", @@ -908,8 +924,7 @@ export const dict = { "settings.autocomplete.title": "Automatisch Aanvullen", "settings.notifications.title": "Meldingen", "settings.context.title": "Context", - "settings.terminal.title": "Terminal", - "settings.prompts.title": "Prompts", + "settings.experimental.title": "Experimenteel", "settings.language.title": "Taal", "settings.aboutKiloCode.title": "Over Kilo Code", @@ -930,6 +945,7 @@ export const dict = { "prompt.placeholder.error": "Verbinding mislukt. Controleer het uitvoerpaneel of herstart de extensie.", "context.usage.sessionCost": "Sessiekosten", + "context.stats.thisSession": "Deze sessie", "time.justNow": "zojuist", "time.minutesAgo": "{{count}} min geleden", @@ -959,8 +975,22 @@ export const dict = { "Voor vragen over facturering of je account, neem contact op met Klantenservice op", "settings.aboutKiloCode.resetSettings.title": "Instellingen resetten", "settings.aboutKiloCode.resetSettings.description": - "Reset alle instellingen van de Kilo Code extensie naar hun standaardwaarden. Dit heeft geen invloed op CLI of backend configuratie.", + "Dit reset alleen VS Code-extensiespecifieke instellingen naar hun standaardwaarden. Instellingen die gedeeld worden met de CLI, zoals modi en regels voor automatisch goedkeuren, worden opgeslagen in de CLI-configuratie en worden niet gereset.", "settings.aboutKiloCode.resetSettings.button": "Alle instellingen resetten", + "settings.aboutKiloCode.settingsTransfer.title": "Instellingen overdragen", + "settings.aboutKiloCode.settingsTransfer.description": + "Exporteer of importeer uw instellingen om ze tussen VS Code-instanties over te dragen.", + "settings.aboutKiloCode.exportSettings": "Exporteren", + "settings.aboutKiloCode.importSettings": "Importeren", + "settings.aboutKiloCode.importSettings.invalidJson": + "Ongeldig JSON-bestand. Selecteer een geldig instellingenbestand.", + "settings.aboutKiloCode.importSettings.invalidConfig": "Het bestand bevat geen geldige Kilo-instellingen.", + "settings.aboutKiloCode.importSettings.tooLarge": + "Het bestand is te groot. Instellingenbestanden moeten kleiner zijn dan 1 MB.", + "settings.aboutKiloCode.importSettings.newerVersion": + "Dit bestand is geëxporteerd vanuit een nieuwere versie van Kilo. Sommige instellingen worden mogelijk genegeerd.", + "settings.aboutKiloCode.importSettings.success": + "Instellingen geïmporteerd. Controleer de bovenstaande wijzigingen en klik vervolgens op Opslaan.", "settings.agentBehaviour.subtab.modes": "Modi", "settings.agentBehaviour.subtab.agents": "Agents", @@ -986,10 +1016,6 @@ export const dict = { "common.add": "Toevoegen", "common.choose": "Kies…", - "settings.notImplemented": "Dit gedeelte is nog niet geïmplementeerd.", - "settings.notImplemented.description": - "Het zal configuratie-opties en verklarende tekst bevatten gerelateerd aan de geselecteerde instellingencategorie. Gebruik deze ruimte tijdens het opnieuw implementeren om lay-out, spatiëring, scrollgedrag en navigatiestatus te valideren voordat de daadwerkelijke besturingselementen worden gekoppeld.", - "settings.autocomplete.autoTrigger.title": "Automatische inline aanvullingen inschakelen", "settings.autocomplete.autoTrigger.description": "Toon automatisch suggesties voor inline aanvullingen tijdens het typen", @@ -1055,11 +1081,26 @@ export const dict = { "settings.agentBehaviour.topP.description": "Nucleus sampling parameter (0-1)", "settings.agentBehaviour.maxSteps.title": "Max Stappen", "settings.agentBehaviour.maxSteps.description": "Maximale agent iteraties", + "settings.agentBehaviour.hidden.title": "Verborgen", + "settings.agentBehaviour.hidden.description": "Verberg deze agent uit de modusschakelaar in de chatinvoer", + "settings.agentBehaviour.disable.title": "Uitgeschakeld", + "settings.agentBehaviour.disable.description": "Schakel deze agent volledig uit — deze verschijnt nergens", + "settings.agentBehaviour.badge.hidden": "verborgen", + "settings.agentBehaviour.badge.disabled": "uitgeschakeld", + "settings.agentBehaviour.badge.deprecated": "Verouderd", "settings.agentBehaviour.discoveredSkills": "Ontdekte Skills", "settings.agentBehaviour.noSkillsFound": "Geen skills ontdekt. Voeg hieronder skill mappaden of URL's toe om skills beschikbaar te maken.", "settings.agentBehaviour.availableModes": "Beschikbare Aangepaste Modi", "settings.agentBehaviour.noModesFound": "Geen modi gevonden.", + "settings.agentBehaviour.importMode": "Importeren", + "settings.agentBehaviour.importMode.invalidName": + "Ongeldige modusnaam in bestand. De naam moet beginnen met een kleine letter en mag alleen kleine letters, cijfers en streepjes bevatten.", + "settings.agentBehaviour.importMode.nameTaken": "Er bestaat al een modus met deze naam.", + "settings.agentBehaviour.importMode.invalidJson": + "Ongeldig JSON-bestand. Selecteer een geldig agentdefinitiebestand.", + "settings.agentBehaviour.importMode.tooLarge": "Bestand is te groot. Agentdefinities moeten kleiner zijn dan 1 MB.", + "settings.agentBehaviour.exportMode": "Agentdefinitie exporteren", "settings.agentBehaviour.removeMode.title": "Verwijder modus", "settings.agentBehaviour.removeMode.confirm": 'Modus "{{name}}" verwijderen? Dit zal de modus uitschakelen door je configuratie bij te werken.', @@ -1083,8 +1124,22 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "Argumenten", "settings.agentBehaviour.mcpDetail.env": "Omgeving", "settings.agentBehaviour.mcpDetail.disabled": "Deze server is uitgeschakeld.", + "settings.agentBehaviour.editMcp": "MCP-server bewerken", + "settings.agentBehaviour.editMcp.transportLocal": "Lokale server (stdio-transport)", + "settings.agentBehaviour.editMcp.transportRemote": "Externe server (SSE/HTTP-transport)", + "settings.agentBehaviour.editMcp.env": "Omgevingsvariabelen", + "settings.agentBehaviour.editMcp.env.help": "Variabelen die worden doorgegeven aan het MCP-serverproces.", + "settings.agentBehaviour.addMcp.command": "Opdracht", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "Argumenten", + "settings.agentBehaviour.addMcp.args.help": + "Eén argument per regel. Paden met spaties worden ongewijzigd overgenomen.", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "Server-URL", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", + "settings.agentBehaviour.mcpBrowseMarketplace": "Bladeren door Marketplace", "settings.agentBehaviour.mcpEmpty": - "Geen MCP-servers geconfigureerd. Bewerk het opencode configuratiebestand om MCP-servers toe te voegen.", + "Geen MCP-servers geconfigureerd. Voeg MCP-servers toe in kilo.jsonc of vraag de agent om ze toe te voegen.", "settings.agentBehaviour.workflowsPlaceholder": "Workflows worden beheerd via workflowbestanden in je workspace.", "settings.agentBehaviour.workflows.description": "Workflows zijn aangepaste slash-commando's gedefinieerd in je configuratie. Typ /command-name in de chat om ze aan te roepen. Commando's worden geconfigureerd in opencode.json onder de sectie 'command'.", @@ -1092,7 +1147,6 @@ export const dict = { "Geen aangepaste commando's geconfigureerd. Voeg commando's toe aan opencode.json om ze hier te zien.", "settings.agentBehaviour.workflows.detail.description": "Beschrijving", "settings.agentBehaviour.workflows.detail.template": "Sjabloon", - "settings.agentBehaviour.notImplemented": "Nog niet geïmplementeerd.", "settings.autoApprove.description": "Definieer hoe tools mogen worden uitgevoerd. De meeste tools staan standaard op Toestaan. doom_loop en external_directory staan standaard op Vragen.", @@ -1154,7 +1208,7 @@ export const dict = { "settings.providers.defaultModel.description": "Primair model voor gesprekken", "settings.providers.smallModel.title": "Klein Model", "settings.providers.smallModel.description": - "Lichtgewicht model voor het genereren van titels en andere snelle taken", + "Lichtgewicht model voor het genereren van titels, commit-berichten, promptverbetering en andere snelle taken", "settings.providers.modeModels": "Model per Modus", "settings.providers.modeModels.description": "Overschrijf het standaard model voor specifieke modi. Indien niet ingesteld, wordt het globale standaard model gebruikt.", @@ -1186,7 +1240,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "Wat is er Nieuw in Kilo Code", - "migration.whatsNew.badge": "Bèta", "migration.whatsNew.subtitle": "We hebben de extensie opnieuw opgebouwd op een snellere, efficiëntere basis.", "migration.whatsNew.features.performance.title": "Snellere Agent Prestaties", "migration.whatsNew.features.performance.detail": @@ -1212,7 +1265,6 @@ export const dict = { "migration.migrate.chatHistoryDesc": "Niet compatibel met de nieuwe architectuur", "migration.migrate.button": "Migreer Instellingen", "migration.migrate.skip": "Overslaan", - "migration.migrate.back": "Terug", "migration.migrate.keysDetected": "{{count}} sleutels gedetecteerd", "migration.migrate.serversConfigured": "{{count}} server(s) geconfigureerd", "migration.migrate.modesFound": "{{count}} modus(sen) gevonden", @@ -1233,6 +1285,11 @@ export const dict = { "migration.complete.cleanupDescription": "Dit verwijdert de oude instellingen uit de VS Code-opslag. U zult deze migratie niet opnieuw kunnen uitvoeren.", "migration.complete.done": "Klaar", + "migration.migrate.sessionsDetected": "{{count}} sessies gedetecteerd", + "migration.error.sessionFailed": "Sessiemigratie is mislukt", + "migration.error.continue": "Doorgaan", + "migration.error.action.copy": "Kopiëren", + "migration.error.toast.copied": "Fout gekopieerd naar het klembord", // legacy-migration end "error.details.show": "Details", @@ -1247,8 +1304,7 @@ export const dict = { "settings.saveBar.warning.many": "Meerdere sessies zijn actief en worden onderbroken", "settings.saveBar.saveAnyway": "Toch opslaan", "settings.saveBar.cancel": "Annuleren", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "Volgende", + "notifications.action.close": "Sluiten", + "notifications.action.tryModel": "Probeer {{model}}", } diff --git a/packages/kilo-vscode/webview-ui/src/i18n/no.ts b/packages/kilo-vscode/webview-ui/src/i18n/no.ts index 5f2f58e8515..7ca68a7c5cc 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/no.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/no.ts @@ -270,6 +270,7 @@ export const dict = { "mcp.status.connected": "tilkoblet", "mcp.status.failed": "mislyktes", "mcp.status.needs_auth": "trenger autentisering", + "mcp.status.needs_registration": "trenger klientregistrering", "mcp.status.disabled": "deaktivert", "dialog.fork.empty": "Ingen meldinger å forgrene fra", @@ -755,6 +756,20 @@ export const dict = { "provider.custom.models.name.placeholder": "Visningsnavn", "provider.custom.models.remove": "Fjern modell", "provider.custom.models.add": "Legg til modell", + "provider.custom.models.fetch": "Hent modeller", + "provider.custom.models.fetching": "Henter\u2026", + "provider.custom.models.fetch.error": "Kunne ikke hente modeller: {{error}}", + "provider.custom.models.fetch.authError": "Autentisering mislyktes. Sjekk API-nøkkelen ovenfor og prøv igjen.", + "provider.custom.models.fetch.empty": "Ingen modeller funnet på denne serveren.", + "provider.custom.models.fetch.added": "{{count}} modell(er) lagt til.", + "provider.custom.models.fetch.allExist": "Alle hentede modeller er allerede lagt til.", + "provider.custom.models.fetch.selectAll": "Velg alle", + "provider.custom.models.fetch.deselectAll": "Fjern alle valg", + "provider.custom.models.fetch.found": "{{count}} modeller funnet", + "provider.custom.models.fetch.showing": "Viser {{shown}} av {{total}}", + "provider.custom.models.fetch.search": "Søk etter modeller\u2026", + "provider.custom.models.fetch.add": "Legg til {{count}} modell(er)", + "provider.custom.edit.title": "Rediger leverandør", "provider.custom.headers.label": "Headere (valgfritt)", "provider.custom.headers.key.label": "Header", "provider.custom.headers.key.placeholder": "Header-Name", @@ -913,8 +928,7 @@ export const dict = { "settings.autocomplete.title": "Autofullfør", "settings.notifications.title": "Varslinger", "settings.context.title": "Kontekst", - "settings.terminal.title": "Terminal", - "settings.prompts.title": "Meldinger", + "settings.experimental.title": "Eksperimentelt", "settings.language.title": "Språk", "settings.aboutKiloCode.title": "Om Kilo Code", @@ -935,6 +949,7 @@ export const dict = { "prompt.placeholder.default": "Skriv en melding... (Enter for å sende, Shift+Enter for ny linje)", "context.usage.sessionCost": "Sesjonskostnad", + "context.stats.thisSession": "Denne sesjonen", "time.justNow": "akkurat nå", "time.minutesAgo": "{{count}} min siden", @@ -963,8 +978,20 @@ export const dict = { "settings.aboutKiloCode.support.prefix": "For fakturerings- eller kontospørsmål, kontakt kundestøtte på", "settings.aboutKiloCode.resetSettings.title": "Tilbakestill innstillinger", "settings.aboutKiloCode.resetSettings.description": - "Tilbakestill alle Kilo Code-utvidelsesinnstillinger til standardverdier. Dette påvirker ikke CLI- eller backend-konfigurasjon.", + "Dette tilbakestiller kun VS Code-utvidelsesspecifikke innstillinger til standardverdiene. Innstillinger som deles med CLI, som modi og regler for automatisk godkjenning, lagres i CLI-konfigurasjonen og vil ikke tilbakestilles.", "settings.aboutKiloCode.resetSettings.button": "Tilbakestill alle innstillinger", + "settings.aboutKiloCode.settingsTransfer.title": "Overføring av innstillinger", + "settings.aboutKiloCode.settingsTransfer.description": + "Eksporter eller importer innstillingene dine for å overføre dem mellom VS Code-instanser.", + "settings.aboutKiloCode.exportSettings": "Eksporter", + "settings.aboutKiloCode.importSettings": "Importer", + "settings.aboutKiloCode.importSettings.invalidJson": "Ugyldig JSON-fil. Vennligst velg en gyldig innstillingsfil.", + "settings.aboutKiloCode.importSettings.invalidConfig": "Filen inneholder ikke gyldige Kilo-innstillinger.", + "settings.aboutKiloCode.importSettings.tooLarge": "Filen er for stor. Innstillingsfiler må være under 1 MB.", + "settings.aboutKiloCode.importSettings.newerVersion": + "Denne filen ble eksportert fra en nyere versjon av Kilo. Noen innstillinger kan bli ignorert.", + "settings.aboutKiloCode.importSettings.success": + "Innstillinger importert. Gjennomgå endringene ovenfor, og klikk deretter på Lagre.", "settings.agentBehaviour.subtab.modes": "Moduser", "settings.agentBehaviour.subtab.agents": "Agents", @@ -989,8 +1016,7 @@ export const dict = { "common.add": "Legg til", "common.choose": "Velg…", - "settings.notImplemented": "Denne seksjonen er ikke implementert ennå.", - "settings.notImplemented.description": "Den vil inneholde konfigurasjonsalternativer og forklarende tekst.", + "settings.autocomplete.autoTrigger.title": "Aktiver automatisk innebygd fullføring", "settings.autocomplete.autoTrigger.description": "Vis automatisk innebygde fullføringsforslag ved skriving", "settings.autocomplete.smartKeybinding.title": "Aktiver smart innebygd oppgavetastbinding", @@ -1048,6 +1074,13 @@ export const dict = { "settings.agentBehaviour.topP.description": "Nucleus-samplingsparameter (0-1)", "settings.agentBehaviour.maxSteps.title": "Maks. trinn", "settings.agentBehaviour.maxSteps.description": "Maksimale agentiterasjoner", + "settings.agentBehaviour.hidden.title": "Skjult", + "settings.agentBehaviour.hidden.description": "Skjul denne agenten fra modusvelgeren i chatinntastingen", + "settings.agentBehaviour.disable.title": "Deaktivert", + "settings.agentBehaviour.disable.description": "Deaktiver denne agenten fullstendig — den vises ikke noe sted", + "settings.agentBehaviour.badge.hidden": "skjult", + "settings.agentBehaviour.badge.disabled": "deaktivert", + "settings.agentBehaviour.badge.deprecated": "Utdatert", "settings.agentBehaviour.discoveredSkills": "Oppdagede ferdigheter", "settings.agentBehaviour.noSkillsFound": "Ingen ferdigheter funnet. Legg til ferdighetsmappestier eller URLer nedenfor for å gjøre ferdigheter tilgjengelige.", @@ -1070,12 +1103,20 @@ export const dict = { "settings.agentBehaviour.createMode.nameRequired": "Navn er påkrevd", "settings.agentBehaviour.createMode.nameInvalid": "Navn kan bare inneholde små bokstaver, tall og bindestreker", "settings.agentBehaviour.createMode.nameTaken": "En modus med dette navnet eksisterer allerede", + "settings.agentBehaviour.importMode": "Importer", + "settings.agentBehaviour.importMode.invalidName": + "Ugyldig modusnavn i filen. Navnet må starte med en liten bokstav og bare inneholde små bokstaver, tall og bindestreker.", + "settings.agentBehaviour.importMode.nameTaken": "En modus med dette navnet eksisterer allerede.", + "settings.agentBehaviour.importMode.invalidJson": "Ugyldig JSON-fil. Vennligst velg en gyldig agentdefinisjonsfil.", + "settings.agentBehaviour.importMode.tooLarge": "Filen er for stor. Agentdefinisjoner må være under 1 MB.", + "settings.agentBehaviour.exportMode": "Eksporter agentdefinisjon", "settings.agentBehaviour.editMode": "Rediger modus", "settings.agentBehaviour.editMode.description": "Beskrivelse", "settings.agentBehaviour.editMode.prompt": "Systemprompt", "settings.agentBehaviour.editMode.save": "Ferdig", "settings.agentBehaviour.editMode.back": "Tilbake til listen", - "settings.agentBehaviour.editMode.native": "Innebygd modus (skrivebeskyttet definisjon)", + "settings.agentBehaviour.editMode.native": + "Dette er en innebygd modus. Grunndefinisjonen kan ikke endres, men du kan konfigurere overstyringer nedenfor.", "settings.agentBehaviour.editMode.promptOverride": "Tilpasset prompt-overstyring for denne innebygde modusen", "settings.agentBehaviour.removeMode.title": "Fjern modus", "settings.agentBehaviour.removeMode.confirm": @@ -1085,6 +1126,18 @@ export const dict = { "settings.agentBehaviour.removeMcp.confirm": 'Vil du fjerne MCP-serveren "{{name}}"? Dette vil fjerne den fra konfigurasjonen din.', "settings.agentBehaviour.removeMcp.button": "Fjern", + "settings.agentBehaviour.editMcp": "Rediger MCP-server", + "settings.agentBehaviour.editMcp.transportLocal": "Lokal server (stdio-transport)", + "settings.agentBehaviour.editMcp.transportRemote": "Ekstern server (SSE/HTTP-transport)", + "settings.agentBehaviour.editMcp.env": "Miljøvariabler", + "settings.agentBehaviour.editMcp.env.help": "Variabler som sendes til MCP-serverprosessen.", + "settings.agentBehaviour.addMcp.command": "Kommando", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "Argumenter", + "settings.agentBehaviour.addMcp.args.help": "Ett argument per linje. Stier med mellomrom bevares som de er.", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "Server-URL", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", "settings.agentBehaviour.skillPaths": "Ferdighetsmappe-stier", "settings.agentBehaviour.skillUrls": "Ferdighets-URLer", "settings.agentBehaviour.removeSkill.title": "Fjern ferdighet", @@ -1099,8 +1152,9 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "Argumenter", "settings.agentBehaviour.mcpDetail.env": "Miljø", "settings.agentBehaviour.mcpDetail.disabled": "Denne serveren er deaktivert.", + "settings.agentBehaviour.mcpBrowseMarketplace": "Bla gjennom Marketplace", "settings.agentBehaviour.mcpEmpty": - "Ingen MCP-servere konfigurert. Rediger opencode-konfigurasjonsfilen for å legge til MCP-servere.", + "Ingen MCP-servere konfigurert. Legg til MCP-servere i kilo.jsonc, eller be agenten om å legge dem til.", "settings.agentBehaviour.workflowsPlaceholder": "Arbeidsflyter administreres via arbeidsflytfiler i arbeidsområdet.", "settings.agentBehaviour.workflows.description": "Arbeidsflyter er egendefinerte skråstrekkommandoer definert i konfigurasjonen din. Skriv /command-name i chatten for å kjøre dem. Kommandoer konfigureres i opencode.json under seksjonen 'command'.", @@ -1108,7 +1162,7 @@ export const dict = { "Ingen egendefinerte kommandoer konfigurert. Legg til kommandoer i opencode.json for å se dem her.", "settings.agentBehaviour.workflows.detail.description": "Beskrivelse", "settings.agentBehaviour.workflows.detail.template": "Mal", - "settings.agentBehaviour.notImplemented": "Ikke implementert ennå.", + "settings.autoApprove.description": "Definer hvordan verktøy kan kjøre. De fleste verktøy har Tillat som standard. doom_loop og external_directory har Spør som standard.", "settings.autoApprove.level.allow": "Tillat", @@ -1161,7 +1215,8 @@ export const dict = { "settings.providers.defaultModel.title": "Standardmodell", "settings.providers.defaultModel.description": "Primær modell for samtaler", "settings.providers.smallModel.title": "Liten modell", - "settings.providers.smallModel.description": "Lettvektsmodell for titelgenerering og raske oppgaver", + "settings.providers.smallModel.description": + "Lettvektsmodell for titelgenerering, generering av commit-meldinger, prompt-forbedring og andre raske oppgaver", "settings.providers.disabled": "Deaktiverte leverandører", "settings.providers.disabled.description": "Leverandører å skjule fra listen", "settings.providers.enabled": "Aktiverte leverandører (hvitliste)", @@ -1183,7 +1238,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "Hva er nytt i Kilo Code", - "migration.whatsNew.badge": "Beta", "migration.whatsNew.subtitle": "Vi har bygget utvidelsen på nytt med et raskere og mer effektivt grunnlag.", "migration.whatsNew.features.performance.title": "Raskere agentytelse", "migration.whatsNew.features.performance.detail": @@ -1208,7 +1262,6 @@ export const dict = { "migration.migrate.chatHistoryDesc": "Ikke kompatibel med den nye arkitekturen", "migration.migrate.button": "Migrer innstillinger", "migration.migrate.skip": "Hopp over", - "migration.migrate.back": "Tilbake", "migration.migrate.keysDetected": "{{count}} nøkler oppdaget", "migration.migrate.serversConfigured": "{{count}} server(e) konfigurert", "migration.migrate.modesFound": "{{count}} modus(er) funnet", @@ -1229,6 +1282,11 @@ export const dict = { "migration.complete.cleanupDescription": "Dette fjerner de gamle innstillingene fra VS Code-lagringen. Du vil ikke kunne kjøre denne migreringen på nytt.", "migration.complete.done": "Ferdig", + "migration.migrate.sessionsDetected": "{{count}} økter oppdaget", + "migration.error.sessionFailed": "Øktmigrering mislyktes", + "migration.error.continue": "Fortsett", + "migration.error.action.copy": "Kopier", + "migration.error.toast.copied": "Feil kopiert til utklippstavlen", // legacy-migration end "task.todos.progress": "{{done}}/{{total}} oppgaver fullført", @@ -1240,8 +1298,7 @@ export const dict = { "settings.saveBar.warning.many": "Flere økter kjører og vil bli avbrutt", "settings.saveBar.saveAnyway": "Lagre uansett", "settings.saveBar.cancel": "Avbryt", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "Neste", + "notifications.action.close": "Lukk", + "notifications.action.tryModel": "Prøv {{model}}", } satisfies Partial> diff --git a/packages/kilo-vscode/webview-ui/src/i18n/pl.ts b/packages/kilo-vscode/webview-ui/src/i18n/pl.ts index 0a616ea4bfb..967596b09c6 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/pl.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/pl.ts @@ -267,6 +267,7 @@ export const dict = { "mcp.status.connected": "połączono", "mcp.status.failed": "niepowodzenie", "mcp.status.needs_auth": "wymaga autoryzacji", + "mcp.status.needs_registration": "wymaga rejestracji klienta", "mcp.status.disabled": "wyłączone", "dialog.fork.empty": "Brak wiadomości do rozwidlenia", @@ -755,6 +756,21 @@ export const dict = { "provider.custom.models.name.placeholder": "Nazwa wyświetlana", "provider.custom.models.remove": "Usuń model", "provider.custom.models.add": "Dodaj model", + "provider.custom.models.fetch": "Pobierz modele", + "provider.custom.models.fetching": "Pobieranie\u2026", + "provider.custom.models.fetch.error": "Nie udało się pobrać modeli: {{error}}", + "provider.custom.models.fetch.authError": + "Uwierzytelnianie nie powiodło się. Sprawdź klucz API powyżej i spróbuj ponownie.", + "provider.custom.models.fetch.empty": "Nie znaleziono modeli na tym serwerze.", + "provider.custom.models.fetch.added": "Dodano {{count}} model(i).", + "provider.custom.models.fetch.allExist": "Wszystkie pobrane modele są już dodane.", + "provider.custom.models.fetch.selectAll": "Zaznacz wszystkie", + "provider.custom.models.fetch.deselectAll": "Odznacz wszystkie", + "provider.custom.models.fetch.found": "Znaleziono {{count}} modeli", + "provider.custom.models.fetch.showing": "Wyświetlanie {{shown}} z {{total}}", + "provider.custom.models.fetch.search": "Szukaj modeli\u2026", + "provider.custom.models.fetch.add": "Dodaj {{count}} model(i)", + "provider.custom.edit.title": "Edytuj dostawcę", "provider.custom.headers.label": "Nagłówki (opcjonalnie)", "provider.custom.headers.key.label": "Nagłówek", "provider.custom.headers.key.placeholder": "Header-Name", @@ -912,8 +928,7 @@ export const dict = { "settings.autocomplete.title": "Autouzupełnianie", "settings.notifications.title": "Powiadomienia", "settings.context.title": "Kontekst", - "settings.terminal.title": "Terminal", - "settings.prompts.title": "Polecenia", + "settings.experimental.title": "Eksperymentalne", "settings.language.title": "Język", "settings.aboutKiloCode.title": "O Kilo Code", @@ -934,6 +949,7 @@ export const dict = { "prompt.placeholder.default": "Wpisz wiadomość... (Enter, aby wysłać, Shift+Enter dla nowej linii)", "context.usage.sessionCost": "Koszt sesji", + "context.stats.thisSession": "Ta sesja", "time.justNow": "przed chwilą", "time.minutesAgo": "{{count}} min temu", @@ -963,8 +979,20 @@ export const dict = { "W sprawach rozliczeń lub konta skontaktuj się z obsługą klienta pod adresem", "settings.aboutKiloCode.resetSettings.title": "Resetuj ustawienia", "settings.aboutKiloCode.resetSettings.description": - "Zresetuj wszystkie ustawienia rozszerzenia Kilo Code do wartości domyślnych. Nie wpływa to na konfigurację CLI ani backendu.", + "To resetuje tylko ustawienia specyficzne dla rozszerzenia VS Code do ich domyślnych wartości. Ustawienia współdzielone z CLI, takie jak tryby i reguły automatycznego zatwierdzania, są przechowywane w konfiguracji CLI i nie zostaną zresetowane.", "settings.aboutKiloCode.resetSettings.button": "Resetuj wszystkie ustawienia", + "settings.aboutKiloCode.settingsTransfer.title": "Przenoszenie ustawień", + "settings.aboutKiloCode.settingsTransfer.description": + "Eksportuj lub importuj ustawienia, aby przenosić je między instancjami VS Code.", + "settings.aboutKiloCode.exportSettings": "Eksportuj", + "settings.aboutKiloCode.importSettings": "Importuj", + "settings.aboutKiloCode.importSettings.invalidJson": "Nieprawidłowy plik JSON. Wybierz prawidłowy plik ustawień.", + "settings.aboutKiloCode.importSettings.invalidConfig": "Plik nie zawiera prawidłowych ustawień Kilo.", + "settings.aboutKiloCode.importSettings.tooLarge": "Plik jest za duży. Pliki ustawień muszą mieć mniej niż 1 MB.", + "settings.aboutKiloCode.importSettings.newerVersion": + "Ten plik został wyeksportowany z nowszej wersji Kilo. Niektóre ustawienia mogą zostać zignorowane.", + "settings.aboutKiloCode.importSettings.success": + "Ustawienia zaimportowane. Przejrzyj powyższe zmiany, a następnie kliknij Zapisz.", "settings.agentBehaviour.subtab.modes": "Tryby", "settings.agentBehaviour.subtab.agents": "Agents", @@ -989,8 +1017,7 @@ export const dict = { "common.add": "Dodaj", "common.choose": "Wybierz…", - "settings.notImplemented": "Ta sekcja nie jest jeszcze zaimplementowana.", - "settings.notImplemented.description": "Będzie zawierać opcje konfiguracji i tekst objaśniający.", + "settings.autocomplete.autoTrigger.title": "Włącz automatyczne uzupełnianie inline", "settings.autocomplete.autoTrigger.description": "Automatycznie pokazuj sugestie uzupełniania podczas pisania", "settings.autocomplete.smartKeybinding.title": "Włącz inteligentny skrót zadania inline", @@ -1048,6 +1075,13 @@ export const dict = { "settings.agentBehaviour.topP.description": "Parametr próbkowania nucleus (0-1)", "settings.agentBehaviour.maxSteps.title": "Maks. kroki", "settings.agentBehaviour.maxSteps.description": "Maksymalna liczba iteracji agenta", + "settings.agentBehaviour.hidden.title": "Ukryty", + "settings.agentBehaviour.hidden.description": "Ukryj tego agenta z przełącznika trybów w polu czatu", + "settings.agentBehaviour.disable.title": "Wyłączony", + "settings.agentBehaviour.disable.description": "Całkowicie wyłącz tego agenta — nie pojawi się nigdzie", + "settings.agentBehaviour.badge.hidden": "ukryty", + "settings.agentBehaviour.badge.disabled": "wyłączony", + "settings.agentBehaviour.badge.deprecated": "Przestarzały", "settings.agentBehaviour.discoveredSkills": "Wykryte umiejętności", "settings.agentBehaviour.noSkillsFound": "Nie znaleziono umiejętności. Dodaj ścieżki folderów lub adresy URL poniżej, aby udostępnić umiejętności.", @@ -1071,12 +1105,21 @@ export const dict = { "settings.agentBehaviour.createMode.nameRequired": "Nazwa jest wymagana", "settings.agentBehaviour.createMode.nameInvalid": "Nazwa może zawierać tylko małe litery, cyfry i myślniki", "settings.agentBehaviour.createMode.nameTaken": "Tryb o tej nazwie już istnieje", + "settings.agentBehaviour.importMode": "Importuj", + "settings.agentBehaviour.importMode.invalidName": + "Nieprawidłowa nazwa trybu w pliku. Nazwa musi zaczynać się od małej litery i zawierać tylko małe litery, cyfry i myślniki.", + "settings.agentBehaviour.importMode.nameTaken": "Tryb o tej nazwie już istnieje.", + "settings.agentBehaviour.importMode.invalidJson": + "Nieprawidłowy plik JSON. Proszę wybrać prawidłowy plik definicji agenta.", + "settings.agentBehaviour.importMode.tooLarge": "Plik jest za duży. Definicje agentów muszą mieć mniej niż 1 MB.", + "settings.agentBehaviour.exportMode": "Eksportuj definicję agenta", "settings.agentBehaviour.editMode": "Edytuj tryb", "settings.agentBehaviour.editMode.description": "Opis", "settings.agentBehaviour.editMode.prompt": "Prompt systemowy", "settings.agentBehaviour.editMode.save": "Gotowe", "settings.agentBehaviour.editMode.back": "Powrót do listy", - "settings.agentBehaviour.editMode.native": "Tryb wbudowany (definicja tylko do odczytu)", + "settings.agentBehaviour.editMode.native": + "To jest wbudowany tryb. Jego podstawowa definicja nie może zostać zmieniona, ale poniżej możesz skonfigurować nadpisania.", "settings.agentBehaviour.editMode.promptOverride": "Niestandardowe nadpisanie promptu dla tego wbudowanego trybu", "settings.agentBehaviour.removeMode.title": "Usuń tryb", "settings.agentBehaviour.removeMode.confirm": @@ -1086,6 +1129,18 @@ export const dict = { "settings.agentBehaviour.removeMcp.confirm": 'Usunąć serwer MCP "{{name}}"? Spowoduje to usunięcie go z konfiguracji.', "settings.agentBehaviour.removeMcp.button": "Usuń", + "settings.agentBehaviour.editMcp": "Edytuj serwer MCP", + "settings.agentBehaviour.editMcp.transportLocal": "Serwer lokalny (transport stdio)", + "settings.agentBehaviour.editMcp.transportRemote": "Serwer zdalny (transport SSE/HTTP)", + "settings.agentBehaviour.editMcp.env": "Zmienne środowiskowe", + "settings.agentBehaviour.editMcp.env.help": "Zmienne przekazywane do procesu serwera MCP.", + "settings.agentBehaviour.addMcp.command": "Polecenie", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "Argumenty", + "settings.agentBehaviour.addMcp.args.help": "Jeden argument na linię. Ścieżki ze spacjami są zachowywane bez zmian.", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "URL serwera", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", "settings.agentBehaviour.skillPaths": "Ścieżki folderów umiejętności", "settings.agentBehaviour.skillUrls": "Adresy URL umiejętności", "settings.agentBehaviour.removeSkill.title": "Usuń umiejętność", @@ -1101,8 +1156,9 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "Argumenty", "settings.agentBehaviour.mcpDetail.env": "Środowisko", "settings.agentBehaviour.mcpDetail.disabled": "Ten serwer jest wyłączony.", + "settings.agentBehaviour.mcpBrowseMarketplace": "Przeglądaj Marketplace", "settings.agentBehaviour.mcpEmpty": - "Brak skonfigurowanych serwerów MCP. Edytuj plik konfiguracyjny opencode, aby dodać serwery MCP.", + "Brak skonfigurowanych serwerów MCP. Dodaj serwery MCP w kilo.jsonc lub poproś agenta o ich dodanie.", "settings.agentBehaviour.workflowsPlaceholder": "Przepływy pracy zarządzane są za pomocą plików przepływów pracy.", "settings.agentBehaviour.workflows.description": "Przepływy pracy to niestandardowe komendy slash zdefiniowane w konfiguracji. Wpisz /command-name na czacie, aby je uruchomić. Komendy konfiguruje się w opencode.json w sekcji 'command'.", @@ -1110,7 +1166,7 @@ export const dict = { "Brak skonfigurowanych niestandardowych komend. Dodaj komendy do opencode.json, aby je tu zobaczyć.", "settings.agentBehaviour.workflows.detail.description": "Opis", "settings.agentBehaviour.workflows.detail.template": "Szablon", - "settings.agentBehaviour.notImplemented": "Jeszcze nie zaimplementowano.", + "settings.autoApprove.description": "Zdefiniuj, jak narzędzia mogą być uruchamiane. Większość narzędzi domyślnie ma ustawienie Zezwalaj. doom_loop i external_directory domyślnie mają ustawienie Pytaj.", "settings.autoApprove.level.allow": "Zezwól", @@ -1167,7 +1223,8 @@ export const dict = { "settings.providers.defaultModel.title": "Domyślny model", "settings.providers.defaultModel.description": "Główny model do rozmów", "settings.providers.smallModel.title": "Mały model", - "settings.providers.smallModel.description": "Lekki model do generowania tytułów i szybkich zadań", + "settings.providers.smallModel.description": + "Lekki model do generowania tytułów, wiadomości commitów, ulepszania zapytań i innych szybkich zadań", "settings.providers.disabled": "Wyłączeni dostawcy", "settings.providers.disabled.description": "Dostawcy do ukrycia z listy", "settings.providers.enabled": "Włączeni dostawcy (biała lista)", @@ -1189,7 +1246,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "Co nowego w Kilo Code", - "migration.whatsNew.badge": "Beta", "migration.whatsNew.subtitle": "Przebudowaliśmy rozszerzenie na szybszym i wydajniejszym fundamencie.", "migration.whatsNew.features.performance.title": "Szybsza wydajność agenta", "migration.whatsNew.features.performance.detail": @@ -1214,7 +1270,6 @@ export const dict = { "migration.migrate.chatHistoryDesc": "Niekompatybilne z nową architekturą", "migration.migrate.button": "Migruj ustawienia", "migration.migrate.skip": "Pomiń", - "migration.migrate.back": "Wstecz", "migration.migrate.keysDetected": "Wykryto {{count}} kluczy", "migration.migrate.serversConfigured": "Skonfigurowano {{count}} serwer(ów)", "migration.migrate.modesFound": "Znaleziono {{count}} tryb(ów)", @@ -1235,6 +1290,11 @@ export const dict = { "migration.complete.cleanupDescription": "Spowoduje to usunięcie starych ustawień z magazynu VS Code. Nie będzie można ponownie uruchomić tej migracji.", "migration.complete.done": "Gotowe", + "migration.migrate.sessionsDetected": "Wykryto {{count}} sesji", + "migration.error.sessionFailed": "Migracja sesji nie powiodła się", + "migration.error.continue": "Kontynuuj", + "migration.error.action.copy": "Kopiuj", + "migration.error.toast.copied": "Błąd skopiowano do schowka", // legacy-migration end "error.details.show": "Szczegóły", @@ -1248,8 +1308,7 @@ export const dict = { "settings.saveBar.warning.many": "Kilka sesji jest uruchomionych i zostanie przerwanych", "settings.saveBar.saveAnyway": "Zapisz mimo to", "settings.saveBar.cancel": "Anuluj", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "Następny", + "notifications.action.close": "Zamknij", + "notifications.action.tryModel": "Wypróbuj {{model}}", } diff --git a/packages/kilo-vscode/webview-ui/src/i18n/ru.ts b/packages/kilo-vscode/webview-ui/src/i18n/ru.ts index 825f2578ef1..42ab6a996a8 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/ru.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/ru.ts @@ -267,6 +267,7 @@ export const dict = { "mcp.status.connected": "подключено", "mcp.status.failed": "ошибка", "mcp.status.needs_auth": "требуется авторизация", + "mcp.status.needs_registration": "требуется регистрация клиента", "mcp.status.disabled": "отключено", "dialog.fork.empty": "Нет сообщений для ответвления", @@ -758,6 +759,20 @@ export const dict = { "provider.custom.models.name.placeholder": "Отображаемое имя", "provider.custom.models.remove": "Удалить модель", "provider.custom.models.add": "Добавить модель", + "provider.custom.models.fetch": "Получить модели", + "provider.custom.models.fetching": "Загрузка\u2026", + "provider.custom.models.fetch.error": "Не удалось получить модели: {{error}}", + "provider.custom.models.fetch.authError": "Ошибка аутентификации. Проверьте API-ключ выше и попробуйте снова.", + "provider.custom.models.fetch.empty": "На этом сервере модели не найдены.", + "provider.custom.models.fetch.added": "Добавлено {{count}} модель(ей).", + "provider.custom.models.fetch.allExist": "Все полученные модели уже добавлены.", + "provider.custom.models.fetch.selectAll": "Выбрать все", + "provider.custom.models.fetch.deselectAll": "Снять выбор", + "provider.custom.models.fetch.found": "Найдено {{count}} моделей", + "provider.custom.models.fetch.showing": "Показано {{shown}} из {{total}}", + "provider.custom.models.fetch.search": "Поиск моделей\u2026", + "provider.custom.models.fetch.add": "Добавить {{count}} модель(ей)", + "provider.custom.edit.title": "Редактировать провайдера", "provider.custom.headers.label": "Заголовки (необязательно)", "provider.custom.headers.key.label": "Заголовок", "provider.custom.headers.key.placeholder": "Header-Name", @@ -916,8 +931,7 @@ export const dict = { "settings.autocomplete.title": "Автодополнение", "settings.notifications.title": "Уведомления", "settings.context.title": "Контекст", - "settings.terminal.title": "Терминал", - "settings.prompts.title": "Промпты", + "settings.experimental.title": "Экспериментальное", "settings.language.title": "Язык", "settings.aboutKiloCode.title": "О Kilo Code", @@ -938,6 +952,7 @@ export const dict = { "prompt.placeholder.default": "Введите сообщение... (Enter для отправки, Shift+Enter для новой строки)", "context.usage.sessionCost": "Стоимость сессии", + "context.stats.thisSession": "Эта сессия", "time.justNow": "только что", "time.minutesAgo": "{{count}} мин. назад", @@ -966,8 +981,20 @@ export const dict = { "settings.aboutKiloCode.support.prefix": "По вопросам оплаты или аккаунта обращайтесь в службу поддержки по адресу", "settings.aboutKiloCode.resetSettings.title": "Сброс настроек", "settings.aboutKiloCode.resetSettings.description": - "Сбросить все настройки расширения Kilo Code до значений по умолчанию. Это не влияет на конфигурацию CLI или бэкенда.", + "Это сбрасывает только настройки, специфичные для расширения VS Code, до значений по умолчанию. Настройки, общие с CLI, такие как режимы и правила автоматического утверждения, хранятся в конфигурации CLI и не будут сброшены.", "settings.aboutKiloCode.resetSettings.button": "Сбросить все настройки", + "settings.aboutKiloCode.settingsTransfer.title": "Перенос настроек", + "settings.aboutKiloCode.settingsTransfer.description": + "Экспортируйте или импортируйте настройки для переноса между экземплярами VS Code.", + "settings.aboutKiloCode.exportSettings": "Экспорт", + "settings.aboutKiloCode.importSettings": "Импорт", + "settings.aboutKiloCode.importSettings.invalidJson": "Недопустимый файл JSON. Выберите корректный файл настроек.", + "settings.aboutKiloCode.importSettings.invalidConfig": "Файл не содержит допустимых настроек Kilo.", + "settings.aboutKiloCode.importSettings.tooLarge": "Файл слишком большой. Файлы настроек должны быть менее 1 MB.", + "settings.aboutKiloCode.importSettings.newerVersion": + "Этот файл был экспортирован из более новой версии Kilo. Некоторые настройки могут быть проигнорированы.", + "settings.aboutKiloCode.importSettings.success": + "Настройки импортированы. Просмотрите изменения выше и нажмите «Сохранить».", "settings.agentBehaviour.subtab.modes": "Режимы", "settings.agentBehaviour.subtab.agents": "Agents", @@ -992,8 +1019,7 @@ export const dict = { "common.add": "Добавить", "common.choose": "Выбрать…", - "settings.notImplemented": "Этот раздел ещё не реализован.", - "settings.notImplemented.description": "Здесь будут параметры конфигурации и пояснительный текст.", + "settings.autocomplete.autoTrigger.title": "Включить автоматическое встроенное дополнение", "settings.autocomplete.autoTrigger.description": "Автоматически показывать предложения дополнения при вводе", "settings.autocomplete.smartKeybinding.title": "Включить умную клавишу встроенной задачи", @@ -1051,6 +1077,13 @@ export const dict = { "settings.agentBehaviour.topP.description": "Параметр nucleus-сэмплирования (0-1)", "settings.agentBehaviour.maxSteps.title": "Макс. шагов", "settings.agentBehaviour.maxSteps.description": "Максимальное число итераций агента", + "settings.agentBehaviour.hidden.title": "Скрытый", + "settings.agentBehaviour.hidden.description": "Скрыть этого агента из переключателя режимов в поле ввода чата", + "settings.agentBehaviour.disable.title": "Отключён", + "settings.agentBehaviour.disable.description": "Полностью отключить этого агента — он не будет отображаться нигде", + "settings.agentBehaviour.badge.hidden": "скрытый", + "settings.agentBehaviour.badge.disabled": "отключён", + "settings.agentBehaviour.badge.deprecated": "Устаревший", "settings.agentBehaviour.discoveredSkills": "Обнаруженные навыки", "settings.agentBehaviour.noSkillsFound": "Навыки не обнаружены. Добавьте пути к папкам навыков или URL-адреса ниже, чтобы сделать навыки доступными.", @@ -1074,12 +1107,21 @@ export const dict = { "settings.agentBehaviour.createMode.nameRequired": "Название обязательно", "settings.agentBehaviour.createMode.nameInvalid": "Название может содержать только строчные буквы, цифры и дефисы", "settings.agentBehaviour.createMode.nameTaken": "Режим с таким названием уже существует", + "settings.agentBehaviour.importMode": "Импорт", + "settings.agentBehaviour.importMode.invalidName": + "Недопустимое имя режима в файле. Имя должно начинаться со строчной буквы и содержать только строчные буквы, цифры и дефисы.", + "settings.agentBehaviour.importMode.nameTaken": "Режим с таким названием уже существует.", + "settings.agentBehaviour.importMode.invalidJson": + "Недопустимый файл JSON. Пожалуйста, выберите корректный файл определения агента.", + "settings.agentBehaviour.importMode.tooLarge": "Файл слишком большой. Определения агентов должны быть менее 1 МБ.", + "settings.agentBehaviour.exportMode": "Экспортировать определение агента", "settings.agentBehaviour.editMode": "Редактировать режим", "settings.agentBehaviour.editMode.description": "Описание", "settings.agentBehaviour.editMode.prompt": "Системный промпт", "settings.agentBehaviour.editMode.save": "Готово", "settings.agentBehaviour.editMode.back": "Вернуться к списку", - "settings.agentBehaviour.editMode.native": "Встроенный режим (определение только для чтения)", + "settings.agentBehaviour.editMode.native": + "Это встроенный режим. Его базовое определение нельзя изменить, но вы можете настроить переопределения ниже.", "settings.agentBehaviour.editMode.promptOverride": "Пользовательское переопределение промпта для этого встроенного режима", "settings.agentBehaviour.removeMode.title": "Удалить режим", @@ -1089,6 +1131,18 @@ export const dict = { "settings.agentBehaviour.removeMcp.title": "Удалить сервер MCP", "settings.agentBehaviour.removeMcp.confirm": 'Удалить сервер MCP "{{name}}"? Это удалит его из вашей конфигурации.', "settings.agentBehaviour.removeMcp.button": "Удалить", + "settings.agentBehaviour.editMcp": "Редактировать сервер MCP", + "settings.agentBehaviour.editMcp.transportLocal": "Локальный сервер (транспорт stdio)", + "settings.agentBehaviour.editMcp.transportRemote": "Удалённый сервер (транспорт SSE/HTTP)", + "settings.agentBehaviour.editMcp.env": "Переменные окружения", + "settings.agentBehaviour.editMcp.env.help": "Переменные, передаваемые процессу сервера MCP.", + "settings.agentBehaviour.addMcp.command": "Команда", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "Аргументы", + "settings.agentBehaviour.addMcp.args.help": "Один аргумент на строку. Пути с пробелами сохраняются как есть.", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "URL сервера", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", "settings.agentBehaviour.skillPaths": "Пути папок навыков", "settings.agentBehaviour.skillUrls": "URL навыков", "settings.agentBehaviour.removeSkill.title": "Удалить навык", @@ -1103,8 +1157,9 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "Аргументы", "settings.agentBehaviour.mcpDetail.env": "Окружение", "settings.agentBehaviour.mcpDetail.disabled": "Этот сервер отключён.", + "settings.agentBehaviour.mcpBrowseMarketplace": "Обзор Marketplace", "settings.agentBehaviour.mcpEmpty": - "MCP-серверы не настроены. Отредактируйте файл конфигурации opencode для добавления MCP-серверов.", + "MCP-серверы не настроены. Добавьте MCP-серверы в kilo.jsonc или попросите агента добавить их.", "settings.agentBehaviour.workflowsPlaceholder": "Рабочие процессы управляются через файлы рабочих процессов.", "settings.agentBehaviour.workflows.description": "Рабочие процессы — это пользовательские слэш-команды, определённые в вашей конфигурации. Введите /command-name в чате, чтобы вызвать их. Команды настраиваются в opencode.json в разделе 'command'.", @@ -1112,7 +1167,7 @@ export const dict = { "Пользовательские команды не настроены. Добавьте команды в opencode.json, чтобы увидеть их здесь.", "settings.agentBehaviour.workflows.detail.description": "Описание", "settings.agentBehaviour.workflows.detail.template": "Шаблон", - "settings.agentBehaviour.notImplemented": "Ещё не реализовано.", + "settings.autoApprove.description": "Определите правила запуска инструментов. Большинство инструментов по умолчанию Разрешены. Для doom_loop и external_directory по умолчанию установлено Спрашивать.", "settings.autoApprove.level.allow": "Разрешить", @@ -1167,7 +1222,8 @@ export const dict = { "settings.providers.defaultModel.title": "Модель по умолчанию", "settings.providers.defaultModel.description": "Основная модель для разговоров", "settings.providers.smallModel.title": "Малая модель", - "settings.providers.smallModel.description": "Лёгкая модель для генерации заголовков и быстрых задач", + "settings.providers.smallModel.description": + "Лёгкая модель для генерации заголовков, сообщений коммитов, улучшения промптов и других быстрых задач", "settings.providers.disabled": "Отключённые провайдеры", "settings.providers.disabled.description": "Провайдеры для скрытия из списка", "settings.providers.enabled": "Включённые провайдеры (белый список)", @@ -1189,7 +1245,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "Что нового в Kilo Code", - "migration.whatsNew.badge": "Beta", "migration.whatsNew.subtitle": "Мы перестроили расширение на более быстрой и эффективной основе.", "migration.whatsNew.features.performance.title": "Более быстрая работа агента", "migration.whatsNew.features.performance.detail": @@ -1214,7 +1269,6 @@ export const dict = { "migration.migrate.chatHistoryDesc": "Несовместимы с новой архитектурой", "migration.migrate.button": "Перенести настройки", "migration.migrate.skip": "Пропустить", - "migration.migrate.back": "Назад", "migration.migrate.keysDetected": "Обнаружено ключей: {{count}}", "migration.migrate.serversConfigured": "Настроено серверов: {{count}}", "migration.migrate.modesFound": "Найдено режимов: {{count}}", @@ -1235,6 +1289,11 @@ export const dict = { "migration.complete.cleanupDescription": "Это удалит старые настройки из хранилища VS Code. Вы не сможете запустить эту миграцию повторно.", "migration.complete.done": "Готово", + "migration.migrate.sessionsDetected": "Обнаружено {{count}} сеансов", + "migration.error.sessionFailed": "Не удалось перенести сеанс", + "migration.error.continue": "Продолжить", + "migration.error.action.copy": "Копировать", + "migration.error.toast.copied": "Ошибка скопирована в буфер обмена", // legacy-migration end "error.details.show": "Подробности", @@ -1248,8 +1307,7 @@ export const dict = { "settings.saveBar.warning.many": "Несколько сеансов выполняются и будут прерваны", "settings.saveBar.saveAnyway": "Сохранить в любом случае", "settings.saveBar.cancel": "Отмена", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "Далее", + "notifications.action.close": "Закрыть", + "notifications.action.tryModel": "Попробовать {{model}}", } diff --git a/packages/kilo-vscode/webview-ui/src/i18n/th.ts b/packages/kilo-vscode/webview-ui/src/i18n/th.ts index b31301d5e4f..6f7cf03403e 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/th.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/th.ts @@ -267,6 +267,7 @@ export const dict = { "mcp.status.connected": "เชื่อมต่อแล้ว", "mcp.status.failed": "ล้มเหลว", "mcp.status.needs_auth": "ต้องการการตรวจสอบสิทธิ์", + "mcp.status.needs_registration": "ต้องการลงทะเบียนไคลเอนต์", "mcp.status.disabled": "ปิดใช้งาน", "dialog.fork.empty": "ไม่มีข้อความให้แตกแขนง", @@ -748,6 +749,20 @@ export const dict = { "provider.custom.models.name.placeholder": "ชื่อที่แสดง", "provider.custom.models.remove": "ลบโมเดล", "provider.custom.models.add": "เพิ่มโมเดล", + "provider.custom.models.fetch": "ดึงโมเดล", + "provider.custom.models.fetching": "กำลังดึง\u2026", + "provider.custom.models.fetch.error": "ดึงโมเดลล้มเหลว: {{error}}", + "provider.custom.models.fetch.authError": "การยืนยันตัวตนล้มเหลว ตรวจสอบคีย์ API ด้านบนแล้วลองอีกครั้ง", + "provider.custom.models.fetch.empty": "ไม่พบโมเดลบนเซิร์ฟเวอร์นี้", + "provider.custom.models.fetch.added": "เพิ่มแล้ว {{count}} โมเดล", + "provider.custom.models.fetch.allExist": "โมเดลที่ดึงมาทั้งหมดถูกเพิ่มไปแล้ว", + "provider.custom.models.fetch.selectAll": "เลือกทั้งหมด", + "provider.custom.models.fetch.deselectAll": "ยกเลิกการเลือกทั้งหมด", + "provider.custom.models.fetch.found": "พบ {{count}} โมเดล", + "provider.custom.models.fetch.showing": "แสดง {{shown}} จาก {{total}}", + "provider.custom.models.fetch.search": "ค้นหาโมเดล\u2026", + "provider.custom.models.fetch.add": "เพิ่ม {{count}} โมเดล", + "provider.custom.edit.title": "แก้ไขผู้ให้บริการ", "provider.custom.headers.label": "ส่วนหัว (ไม่จำเป็น)", "provider.custom.headers.key.label": "ส่วนหัว", "provider.custom.headers.key.placeholder": "Header-Name", @@ -905,8 +920,7 @@ export const dict = { "settings.autocomplete.title": "เติมข้อความอัตโนมัติ", "settings.notifications.title": "การแจ้งเตือน", "settings.context.title": "บริบท", - "settings.terminal.title": "เทอร์มินัล", - "settings.prompts.title": "พรอมต์", + "settings.experimental.title": "ทดลอง", "settings.language.title": "ภาษา", "settings.aboutKiloCode.title": "เกี่ยวกับ Kilo Code", @@ -926,6 +940,7 @@ export const dict = { "prompt.placeholder.default": "พิมพ์ข้อความ... (Enter เพื่อส่ง, Shift+Enter เพื่อขึ้นบรรทัดใหม่)", "context.usage.sessionCost": "ค่าใช้จ่ายเซสชัน", + "context.stats.thisSession": "เซสชันนี้", "time.justNow": "เมื่อสักครู่", "time.minutesAgo": "{{count}} นาทีที่แล้ว", @@ -954,8 +969,19 @@ export const dict = { "settings.aboutKiloCode.support.prefix": "สำหรับคำถามเกี่ยวกับการเรียกเก็บเงินหรือบัญชี ติดต่อฝ่ายสนับสนุนลูกค้าที่", "settings.aboutKiloCode.resetSettings.title": "รีเซ็ตการตั้งค่า", "settings.aboutKiloCode.resetSettings.description": - "รีเซ็ตการตั้งค่าส่วนขยาย Kilo Code ทั้งหมดเป็นค่าเริ่มต้น ไม่ส่งผลกระทบต่อการกำหนดค่า CLI หรือแบ็กเอนด์", + "การดำเนินการนี้จะรีเซ็ตเฉพาะการตั้งค่าเฉพาะของส่วนขยาย VS Code กลับเป็นค่าเริ่มต้นเท่านั้น การตั้งค่าที่ใช้ร่วมกับ CLI เช่น โหมดและกฎการอนุมัติอัตโนมัติ จะถูกเก็บไว้ในการกำหนดค่า CLI และจะไม่ถูกรีเซ็ต", "settings.aboutKiloCode.resetSettings.button": "รีเซ็ตการตั้งค่าทั้งหมด", + "settings.aboutKiloCode.settingsTransfer.title": "ถ่ายโอนการตั้งค่า", + "settings.aboutKiloCode.settingsTransfer.description": + "ส่งออกหรือนำเข้าการตั้งค่าเพื่อถ่ายโอนระหว่างอินสแตนซ์ VS Code", + "settings.aboutKiloCode.exportSettings": "ส่งออก", + "settings.aboutKiloCode.importSettings": "นำเข้า", + "settings.aboutKiloCode.importSettings.invalidJson": "ไฟล์ JSON ไม่ถูกต้อง กรุณาเลือกไฟล์การตั้งค่าที่ถูกต้อง", + "settings.aboutKiloCode.importSettings.invalidConfig": "ไฟล์ไม่มีการตั้งค่า Kilo ที่ถูกต้อง", + "settings.aboutKiloCode.importSettings.tooLarge": "ไฟล์มีขนาดใหญ่เกินไป ไฟล์การตั้งค่าต้องมีขนาดไม่เกิน 1 MB", + "settings.aboutKiloCode.importSettings.newerVersion": + "ไฟล์นี้ถูกส่งออกจาก Kilo เวอร์ชันใหม่กว่า การตั้งค่าบางรายการอาจถูกข้ามไป", + "settings.aboutKiloCode.importSettings.success": "นำเข้าการตั้งค่าแล้ว ตรวจสอบการเปลี่ยนแปลงด้านบน จากนั้นคลิกบันทึก", "settings.agentBehaviour.subtab.modes": "โหมด", "settings.agentBehaviour.subtab.agents": "Agents", @@ -979,8 +1005,7 @@ export const dict = { "common.add": "เพิ่ม", "common.choose": "เลือก…", - "settings.notImplemented": "ส่วนนี้ยังไม่ได้ใช้งาน", - "settings.notImplemented.description": "จะมีตัวเลือกการกำหนดค่าและข้อความอธิบาย", + "settings.autocomplete.autoTrigger.title": "เปิดใช้งานการเติมอัตโนมัติแบบอินไลน์", "settings.autocomplete.autoTrigger.description": "แสดงข้อเสนอแนะการเติมอัตโนมัติระหว่างพิมพ์", "settings.autocomplete.smartKeybinding.title": "เปิดใช้งานปุ่มลัดงานอินไลน์อัจฉริยะ", @@ -1038,6 +1063,13 @@ export const dict = { "settings.agentBehaviour.topP.description": "พารามิเตอร์ nucleus sampling (0-1)", "settings.agentBehaviour.maxSteps.title": "ขั้นตอนสูงสุด", "settings.agentBehaviour.maxSteps.description": "จำนวนรอบเอเจนต์สูงสุด", + "settings.agentBehaviour.hidden.title": "ซ่อน", + "settings.agentBehaviour.hidden.description": "ซ่อนเอเจนต์นี้จากตัวสลับโหมดในช่องป้อนแชท", + "settings.agentBehaviour.disable.title": "ปิดใช้งาน", + "settings.agentBehaviour.disable.description": "ปิดใช้งานเอเจนต์นี้อย่างสมบูรณ์ — จะไม่ปรากฏที่ใดเลย", + "settings.agentBehaviour.badge.hidden": "ซ่อน", + "settings.agentBehaviour.badge.disabled": "ปิดใช้งาน", + "settings.agentBehaviour.badge.deprecated": "เลิกใช้", "settings.agentBehaviour.discoveredSkills": "ทักษะที่ค้นพบ", "settings.agentBehaviour.noSkillsFound": "ไม่พบทักษะ เพิ่มเส้นทางโฟลเดอร์หรือ URL ด้านล่างเพื่อทำให้ทักษะพร้อมใช้งาน", "settings.agentBehaviour.availableModes": "โหมดกำหนดเองที่ใช้ได้", @@ -1059,12 +1091,20 @@ export const dict = { "settings.agentBehaviour.createMode.nameRequired": "ต้องระบุชื่อ", "settings.agentBehaviour.createMode.nameInvalid": "ชื่อต้องประกอบด้วยตัวอักษรพิมพ์เล็ก ตัวเลข และขีดกลางเท่านั้น", "settings.agentBehaviour.createMode.nameTaken": "มีโหมดที่มีชื่อนี้อยู่แล้ว", + "settings.agentBehaviour.importMode": "นำเข้า", + "settings.agentBehaviour.importMode.invalidName": + "ชื่อโหมดในไฟล์ไม่ถูกต้อง ชื่อต้องขึ้นต้นด้วยตัวอักษรพิมพ์เล็กและประกอบด้วยตัวอักษรพิมพ์เล็ก ตัวเลข และขีดกลางเท่านั้น", + "settings.agentBehaviour.importMode.nameTaken": "มีโหมดที่มีชื่อนี้อยู่แล้ว", + "settings.agentBehaviour.importMode.invalidJson": "ไฟล์ JSON ไม่ถูกต้อง กรุณาเลือกไฟล์นิยามเอเจนต์ที่ถูกต้อง", + "settings.agentBehaviour.importMode.tooLarge": "ไฟล์มีขนาดใหญ่เกินไป คำจำกัดความเอเจนต์ต้องมีขนาดไม่เกิน 1 MB", + "settings.agentBehaviour.exportMode": "ส่งออกนิยามเอเจนต์", "settings.agentBehaviour.editMode": "แก้ไขโหมด", "settings.agentBehaviour.editMode.description": "คำอธิบาย", "settings.agentBehaviour.editMode.prompt": "System Prompt", "settings.agentBehaviour.editMode.save": "เสร็จสิ้น", "settings.agentBehaviour.editMode.back": "กลับไปที่รายการ", - "settings.agentBehaviour.editMode.native": "โหมดในตัว (นิยามสำหรับอ่านอย่างเดียว)", + "settings.agentBehaviour.editMode.native": + "นี่คือโหมดในตัว ไม่สามารถเปลี่ยนคำจำกัดความพื้นฐานได้ แต่คุณสามารถกำหนดค่าการแทนที่ได้ที่ด้านล่าง", "settings.agentBehaviour.editMode.promptOverride": "การแทนที่ prompt แบบกำหนดเองสำหรับโหมดในตัวนี้", "settings.agentBehaviour.removeMode.title": "ลบโหมด", "settings.agentBehaviour.removeMode.confirm": @@ -1074,6 +1114,18 @@ export const dict = { "settings.agentBehaviour.removeMcp.confirm": 'ต้องการลบเซิร์ฟเวอร์ MCP "{{name}}" หรือไม่? การดำเนินการนี้จะลบออกจากการกำหนดค่าของคุณ', "settings.agentBehaviour.removeMcp.button": "ลบ", + "settings.agentBehaviour.editMcp": "แก้ไขเซิร์ฟเวอร์ MCP", + "settings.agentBehaviour.editMcp.transportLocal": "เซิร์ฟเวอร์ภายใน (การขนส่ง stdio)", + "settings.agentBehaviour.editMcp.transportRemote": "เซิร์ฟเวอร์ระยะไกล (การขนส่ง SSE/HTTP)", + "settings.agentBehaviour.editMcp.env": "ตัวแปรสภาพแวดล้อม", + "settings.agentBehaviour.editMcp.env.help": "ตัวแปรที่ส่งไปยังกระบวนการเซิร์ฟเวอร์ MCP", + "settings.agentBehaviour.addMcp.command": "คำสั่ง", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "อาร์กิวเมนต์", + "settings.agentBehaviour.addMcp.args.help": "หนึ่งอาร์กิวเมนต์ต่อบรรทัด เส้นทางที่มีช่องว่างจะถูกเก็บรักษาตามเดิม", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "URL เซิร์ฟเวอร์", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", "settings.agentBehaviour.skillPaths": "เส้นทางโฟลเดอร์ทักษะ", "settings.agentBehaviour.skillUrls": "URL ทักษะ", "settings.agentBehaviour.removeSkill.title": "ลบทักษะ", @@ -1088,8 +1140,9 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "อาร์กิวเมนต์", "settings.agentBehaviour.mcpDetail.env": "สภาพแวดล้อม", "settings.agentBehaviour.mcpDetail.disabled": "เซิร์ฟเวอร์นี้ถูกปิดใช้งาน", + "settings.agentBehaviour.mcpBrowseMarketplace": "เรียกดู Marketplace", "settings.agentBehaviour.mcpEmpty": - "ไม่ได้กำหนดค่าเซิร์ฟเวอร์ MCP แก้ไขไฟล์กำหนดค่า opencode เพื่อเพิ่มเซิร์ฟเวอร์ MCP", + "ไม่ได้กำหนดค่าเซิร์ฟเวอร์ MCP เพิ่มเซิร์ฟเวอร์ MCP ใน kilo.jsonc หรือขอให้เอเจนต์เพิ่มให้คุณ", "settings.agentBehaviour.workflowsPlaceholder": "เวิร์กโฟลว์จัดการผ่านไฟล์เวิร์กโฟลว์ในพื้นที่ทำงาน", "settings.agentBehaviour.workflows.description": "เวิร์กโฟลว์คือคำสั่งสแลชแบบกำหนดเองที่กำหนดไว้ในการตั้งค่าของคุณ พิมพ์ /command-name ในแชทเพื่อเรียกใช้ คำสั่งถูกกำหนดค่าใน opencode.json ภายใต้ส่วน 'command'", @@ -1097,7 +1150,7 @@ export const dict = { "ไม่มีคำสั่งแบบกำหนดเองที่กำหนดค่าไว้ เพิ่มคำสั่งใน opencode.json เพื่อดูที่นี่", "settings.agentBehaviour.workflows.detail.description": "คำอธิบาย", "settings.agentBehaviour.workflows.detail.template": "เทมเพลต", - "settings.agentBehaviour.notImplemented": "ยังไม่ได้ใช้งาน", + "settings.autoApprove.description": "กำหนดวิธีอนุญาตการทำงานของเครื่องมือ โดยค่าเริ่มต้นเครื่องมือส่วนใหญ่คืออนุญาต ส่วน doom_loop และ external_directory ค่าเริ่มต้นคือถาม", "settings.autoApprove.level.allow": "อนุญาต", @@ -1145,7 +1198,8 @@ export const dict = { "settings.providers.defaultModel.title": "โมเดลเริ่มต้น", "settings.providers.defaultModel.description": "โมเดลหลักสำหรับบทสนทนา", "settings.providers.smallModel.title": "โมเดลขนาดเล็ก", - "settings.providers.smallModel.description": "โมเดลน้ำหนักเบาสำหรับสร้างชื่อและงานด่วน", + "settings.providers.smallModel.description": + "โมเดลน้ำหนักเบาสำหรับสร้างชื่อ สร้างข้อความคอมมิต ปรับปรุงพรอมต์ และงานด่วนอื่นๆ", "settings.providers.disabled": "ผู้ให้บริการที่ปิดใช้งาน", "settings.providers.disabled.description": "ผู้ให้บริการที่จะซ่อนจากรายการ", "settings.providers.enabled": "ผู้ให้บริการที่เปิดใช้งาน (รายการที่อนุญาต)", @@ -1167,7 +1221,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "มีอะไรใหม่ใน Kilo Code", - "migration.whatsNew.badge": "Beta", "migration.whatsNew.subtitle": "เราได้สร้างส่วนขยายใหม่บนรากฐานที่เร็วและมีประสิทธิภาพมากขึ้น", "migration.whatsNew.features.performance.title": "ประสิทธิภาพเอเจนต์ที่เร็วขึ้น", "migration.whatsNew.features.performance.detail": @@ -1192,7 +1245,6 @@ export const dict = { "migration.migrate.chatHistoryDesc": "เข้ากันไม่ได้กับสถาปัตยกรรมใหม่", "migration.migrate.button": "ย้ายการตั้งค่า", "migration.migrate.skip": "ข้าม", - "migration.migrate.back": "ย้อนกลับ", "migration.migrate.keysDetected": "ตรวจพบ {{count}} คีย์", "migration.migrate.serversConfigured": "กำหนดค่า {{count}} เซิร์ฟเวอร์", "migration.migrate.modesFound": "พบ {{count}} โหมด", @@ -1213,6 +1265,11 @@ export const dict = { "migration.complete.cleanupDescription": "การดำเนินการนี้จะลบการตั้งค่าเดิมจากที่เก็บข้อมูล VS Code คุณจะไม่สามารถเรียกใช้การย้ายข้อมูลนี้ได้อีก", "migration.complete.done": "เสร็จสิ้น", + "migration.migrate.sessionsDetected": "ตรวจพบ {{count}} เซสชัน", + "migration.error.sessionFailed": "การย้ายเซสชันล้มเหลว", + "migration.error.continue": "ดำเนินการต่อ", + "migration.error.action.copy": "คัดลอก", + "migration.error.toast.copied": "คัดลอกข้อผิดพลาดไปยังคลิปบอร์ดแล้ว", // legacy-migration end "error.details.show": "รายละเอียด", @@ -1226,8 +1283,7 @@ export const dict = { "settings.saveBar.warning.many": "มีหลายเซสชันกำลังทำงานและจะถูกขัดจังหวะ", "settings.saveBar.saveAnyway": "บันทึกต่อไป", "settings.saveBar.cancel": "ยกเลิก", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "ถัดไป", + "notifications.action.close": "ปิด", + "notifications.action.tryModel": "ลองใช้ {{model}}", } diff --git a/packages/kilo-vscode/webview-ui/src/i18n/tr.ts b/packages/kilo-vscode/webview-ui/src/i18n/tr.ts index 63b7acf3d7f..ee0a4add8d9 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/tr.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/tr.ts @@ -267,6 +267,7 @@ export const dict = { "mcp.status.connected": "bağlı", "mcp.status.failed": "başarısız", "mcp.status.needs_auth": "kimlik doğrulama gerekli", + "mcp.status.needs_registration": "istemci kaydı gerekli", "mcp.status.disabled": "devre dışı", "dialog.fork.empty": "Dallandırılacak mesaj yok", @@ -753,6 +754,21 @@ export const dict = { "provider.custom.models.name.placeholder": "Görünen Ad", "provider.custom.models.remove": "Modeli kaldır", "provider.custom.models.add": "Model ekle", + "provider.custom.models.fetch": "Modelleri getir", + "provider.custom.models.fetching": "Getiriliyor\u2026", + "provider.custom.models.fetch.error": "Modeller getirilemedi: {{error}}", + "provider.custom.models.fetch.authError": + "Kimlik doğrulama başarısız oldu. Yukarıdaki API anahtarını kontrol edin ve tekrar deneyin.", + "provider.custom.models.fetch.empty": "Bu sunucuda model bulunamadı.", + "provider.custom.models.fetch.added": "{{count}} model eklendi.", + "provider.custom.models.fetch.allExist": "Getirilen tüm modeller zaten eklenmiş.", + "provider.custom.models.fetch.selectAll": "Tümünü seç", + "provider.custom.models.fetch.deselectAll": "Tümünün seçimini kaldır", + "provider.custom.models.fetch.found": "{{count}} model bulundu", + "provider.custom.models.fetch.showing": "{{total}} modelden {{shown}} tanesi gösteriliyor", + "provider.custom.models.fetch.search": "Model ara\u2026", + "provider.custom.models.fetch.add": "{{count}} model ekle", + "provider.custom.edit.title": "Sağlayıcıyı düzenle", "provider.custom.headers.label": "Başlıklar (isteğe bağlı)", "provider.custom.headers.key.label": "Başlık", "provider.custom.headers.key.placeholder": "Başlık-Adı", @@ -911,8 +927,7 @@ export const dict = { "settings.autocomplete.title": "Otomatik Tamamlama", "settings.notifications.title": "Bildirimler", "settings.context.title": "Bağlam", - "settings.terminal.title": "Terminal", - "settings.prompts.title": "Komutlar", + "settings.experimental.title": "Deneysel", "settings.language.title": "Dil", "settings.aboutKiloCode.title": "Kilo Code Hakkında", @@ -933,6 +948,7 @@ export const dict = { "prompt.placeholder.error": "Bağlantı başarısız. Çıktı panelini kontrol edin veya uzantıyı yeniden başlatın.", "context.usage.sessionCost": "Oturum maliyeti", + "context.stats.thisSession": "Bu oturum", "time.justNow": "az önce", "time.minutesAgo": "{{count}} dk önce", @@ -962,8 +978,20 @@ export const dict = { "settings.aboutKiloCode.support.prefix": "Faturalama veya hesap soruları için Müşteri Desteği ile iletişime geçin:", "settings.aboutKiloCode.resetSettings.title": "Ayarları Sıfırla", "settings.aboutKiloCode.resetSettings.description": - "Tüm Kilo Code uzantı ayarlarını varsayılan değerlerine sıfırla. Bu, CLI veya arka uç yapılandırmasını etkilemez.", + "Bu, yalnızca VS Code uzantısına özgü ayarları varsayılan değerlerine sıfırlar. Modlar ve otomatik onay kuralları gibi CLI ile paylaşılan ayarlar, CLI yapılandırmasında depolanır ve sıfırlanmaz.", "settings.aboutKiloCode.resetSettings.button": "Tüm Ayarları Sıfırla", + "settings.aboutKiloCode.settingsTransfer.title": "Ayar Aktarımı", + "settings.aboutKiloCode.settingsTransfer.description": + "Ayarlarınızı VS Code örnekleri arasında aktarmak için dışa veya içe aktarın.", + "settings.aboutKiloCode.exportSettings": "Dışa Aktar", + "settings.aboutKiloCode.importSettings": "İçe Aktar", + "settings.aboutKiloCode.importSettings.invalidJson": "Geçersiz JSON dosyası. Lütfen geçerli bir ayar dosyası seçin.", + "settings.aboutKiloCode.importSettings.invalidConfig": "Dosya geçerli Kilo ayarları içermiyor.", + "settings.aboutKiloCode.importSettings.tooLarge": "Dosya çok büyük. Ayar dosyaları 1 MB altında olmalıdır.", + "settings.aboutKiloCode.importSettings.newerVersion": + "Bu dosya Kilo'nun daha yeni bir sürümünden dışa aktarılmış. Bazı ayarlar göz ardı edilebilir.", + "settings.aboutKiloCode.importSettings.success": + "Ayarlar içe aktarıldı. Yukarıdaki değişiklikleri gözden geçirin, ardından Kaydet'e tıklayın.", "settings.agentBehaviour.subtab.modes": "Modlar", "settings.agentBehaviour.subtab.agents": "Ajanlar", @@ -989,10 +1017,6 @@ export const dict = { "common.add": "Ekle", "common.choose": "Seç…", - "settings.notImplemented": "Bu bölüm henüz uygulanmadı.", - "settings.notImplemented.description": - "Seçilen ayar kategorisiyle ilgili yapılandırma seçenekleri ve açıklayıcı metin içerecek. Yeniden uygulama sırasında gerçek kontrolleri bağlamadan önce düzen, boşluk, kaydırma davranışı ve gezinme durumunu doğrulamak için bu alanı kullanın.", - "settings.autocomplete.autoTrigger.title": "Otomatik satır içi tamamlamaları etkinleştir", "settings.autocomplete.autoTrigger.description": "Yazarken satır içi tamamlama önerilerini otomatik göster", "settings.autocomplete.smartKeybinding.title": "Akıllı satır içi görev tuş atamasını etkinleştir", @@ -1054,11 +1078,26 @@ export const dict = { "settings.agentBehaviour.topP.description": "Çekirdek örnekleme parametresi (0-1)", "settings.agentBehaviour.maxSteps.title": "Maksimum Adım", "settings.agentBehaviour.maxSteps.description": "Maksimum ajanlık yinelemesi", + "settings.agentBehaviour.hidden.title": "Gizli", + "settings.agentBehaviour.hidden.description": "Bu ajanı sohbet girişindeki mod değiştiriciden gizle", + "settings.agentBehaviour.disable.title": "Devre dışı", + "settings.agentBehaviour.disable.description": "Bu ajanı tamamen devre dışı bırak — hiçbir yerde görünmeyecek", + "settings.agentBehaviour.badge.hidden": "gizli", + "settings.agentBehaviour.badge.disabled": "devre dışı", + "settings.agentBehaviour.badge.deprecated": "Kullanımdan kaldırılmış", "settings.agentBehaviour.discoveredSkills": "Keşfedilen Beceriler", "settings.agentBehaviour.noSkillsFound": "Keşfedilen beceri yok. Becerileri kullanılabilir kılmak için aşağıya beceri klasör yolları veya URL'ler ekleyin.", "settings.agentBehaviour.availableModes": "Mevcut Özel Modlar", "settings.agentBehaviour.noModesFound": "Mod bulunamadı.", + "settings.agentBehaviour.importMode": "İçe Aktar", + "settings.agentBehaviour.importMode.invalidName": + "Dosyadaki mod adı geçersiz. Ad küçük harfle başlamalı ve yalnızca küçük harfler, rakamlar ve tire içermelidir.", + "settings.agentBehaviour.importMode.nameTaken": "Bu ada sahip bir mod zaten mevcut.", + "settings.agentBehaviour.importMode.invalidJson": + "Geçersiz JSON dosyası. Lütfen geçerli bir ajan tanım dosyası seçin.", + "settings.agentBehaviour.importMode.tooLarge": "Dosya çok büyük. Ajan tanımları 1 MB'den küçük olmalıdır.", + "settings.agentBehaviour.exportMode": "Ajan tanımını dışa aktar", "settings.agentBehaviour.removeMode.title": "Modu kaldır", "settings.agentBehaviour.removeMode.confirm": '"{{name}}" modu kaldırılsın mı? Bu, yapılandırmanızı güncelleyerek modu devre dışı bırakacak.', @@ -1082,8 +1121,21 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "Argümanlar", "settings.agentBehaviour.mcpDetail.env": "Ortam", "settings.agentBehaviour.mcpDetail.disabled": "Bu sunucu devre dışı.", + "settings.agentBehaviour.editMcp": "MCP Sunucusunu Düzenle", + "settings.agentBehaviour.editMcp.transportLocal": "Yerel sunucu (stdio taşıma)", + "settings.agentBehaviour.editMcp.transportRemote": "Uzak sunucu (SSE/HTTP taşıma)", + "settings.agentBehaviour.editMcp.env": "Ortam Değişkenleri", + "settings.agentBehaviour.editMcp.env.help": "MCP sunucu sürecine aktarılan değişkenler.", + "settings.agentBehaviour.addMcp.command": "Komut", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "Argümanlar", + "settings.agentBehaviour.addMcp.args.help": "Satır başına bir argüman. Boşluklu yollar olduğu gibi korunur.", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "Sunucu URL'si", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", + "settings.agentBehaviour.mcpBrowseMarketplace": "Marketplace'e Göz At", "settings.agentBehaviour.mcpEmpty": - "Yapılandırılmış MCP sunucusu yok. MCP sunucuları eklemek için opencode yapılandırma dosyasını düzenleyin.", + "Yapılandırılmış MCP sunucusu yok. kilo.jsonc dosyasına MCP sunucuları ekleyin veya ajanın eklemesini isteyin.", "settings.agentBehaviour.workflowsPlaceholder": "İş akışları çalışma alanınızdaki iş akışı dosyaları ile yönetilir.", "settings.agentBehaviour.workflows.description": "İş akışları, yapılandırmanızda tanımlanan özel eğik çizgi komutlarıdır. Çağırmak için sohbette /command-name yazın. Komutlar opencode.json dosyasındaki 'command' bölümünde yapılandırılır.", @@ -1091,7 +1143,6 @@ export const dict = { "Yapılandırılmış özel komut yok. Burada görmek için opencode.json dosyasına komutlar ekleyin.", "settings.agentBehaviour.workflows.detail.description": "Açıklama", "settings.agentBehaviour.workflows.detail.template": "Şablon", - "settings.agentBehaviour.notImplemented": "Henüz uygulanmadı.", "settings.autoApprove.description": "Araçların nasıl çalıştırılacağını tanımlayın. Çoğu araç varsayılan olarak İzin Ver'dir. doom_loop ve external_directory varsayılan olarak Sor'dur.", @@ -1150,7 +1201,8 @@ export const dict = { "settings.providers.defaultModel.title": "Varsayılan Model", "settings.providers.defaultModel.description": "Sohbetler için birincil model", "settings.providers.smallModel.title": "Küçük Model", - "settings.providers.smallModel.description": "Başlık oluşturma ve diğer hızlı görevler için hafif model", + "settings.providers.smallModel.description": + "Başlık oluşturma, commit mesajı oluşturma, komut istemi iyileştirme ve diğer hızlı görevler için hafif model", "settings.providers.modeModels": "Mod Başına Model", "settings.providers.modeModels.description": "Belirli modlar için varsayılan modeli geçersiz kılın. Ayarlanmadıysa genel varsayılan model kullanılır.", @@ -1206,7 +1258,6 @@ export const dict = { "migration.migrate.chatHistoryDesc": "Yeni mimariyle uyumsuz", "migration.migrate.button": "Ayarları Taşı", "migration.migrate.skip": "Atla", - "migration.migrate.back": "Geri", "migration.migrate.keysDetected": "{{count}} anahtar algılandı", "migration.migrate.serversConfigured": "{{count}} sunucu yapılandırıldı", "migration.migrate.modesFound": "{{count}} mod bulundu", @@ -1227,6 +1278,11 @@ export const dict = { "migration.complete.cleanupDescription": "Bu, VS Code depolamasından eski ayarları kaldırır. Bu taşımayı yeniden çalıştıramazsınız.", "migration.complete.done": "Bitti", + "migration.migrate.sessionsDetected": "{{count}} oturum bulundu", + "migration.error.sessionFailed": "Oturum taşıma işlemi başarısız oldu", + "migration.error.continue": "Devam et", + "migration.error.action.copy": "Kopyala", + "migration.error.toast.copied": "Hata panoya kopyalandı", // legacy-migration end "error.details.show": "Ayrıntılar", @@ -1241,8 +1297,7 @@ export const dict = { "settings.saveBar.warning.many": "Birden fazla oturum çalışıyor ve kesintiye uğrayacak", "settings.saveBar.saveAnyway": "Yine de kaydet", "settings.saveBar.cancel": "İptal", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "Sonraki", + "notifications.action.close": "Kapat", + "notifications.action.tryModel": "Dene {{model}}", } diff --git a/packages/kilo-vscode/webview-ui/src/i18n/uk.ts b/packages/kilo-vscode/webview-ui/src/i18n/uk.ts new file mode 100644 index 00000000000..78627eb44b6 --- /dev/null +++ b/packages/kilo-vscode/webview-ui/src/i18n/uk.ts @@ -0,0 +1,1304 @@ +export const dict = { + "command.category.suggested": "Запропоновані", + "command.category.view": "Вигляд", + "command.category.project": "Проєкт", + "command.category.provider": "Провайдер", + "command.category.server": "Сервер", + "command.category.session": "Сесія", + "command.category.theme": "Тема", + "command.category.language": "Мова", + "command.category.file": "Файл", + "command.category.context": "Контекст", + "command.category.terminal": "Термінал", + "command.category.model": "Модель", + "command.category.mcp": "MCP", + "command.category.agent": "Агент", + "command.category.permissions": "Дозволи", + "command.category.workspace": "Робочий простір", + "command.category.settings": "Налаштування", + + "theme.scheme.system": "Системна", + "theme.scheme.light": "Світла", + "theme.scheme.dark": "Темна", + + "command.sidebar.toggle": "Перемкнути бічну панель", + "command.project.open": "Відкрити проєкт", + "command.provider.connect": "Підключити провайдера", + "command.server.switch": "Переключити сервер", + "command.settings.open": "Відкрити налаштування", + "command.session.previous": "Попередня сесія", + "command.session.next": "Наступна сесія", + "command.session.previous.unseen": "Попередня непрочитана сесія", + "command.session.next.unseen": "Наступна непрочитана сесія", + "command.session.archive": "Архівувати сесію", + + "command.palette": "Палітра команд", + + "command.theme.cycle": "Змінити тему", + "command.theme.set": "Використати тему: {{theme}}", + "command.theme.scheme.cycle": "Змінити кольорову схему", + "command.theme.scheme.set": "Використати кольорову схему: {{scheme}}", + + "command.language.cycle": "Змінити мову", + "command.language.set": "Використати мову: {{language}}", + + "command.session.new": "Нова сесія", + "command.session.new.task": "Нове завдання", + "command.session.show.changes": "Показати зміни", + "command.file.open": "Відкрити файл", + "command.tab.close": "Закрити вкладку", + "command.context.addSelection": "Додати виділення до контексту", + "command.context.addSelection.description": "Додати виділені рядки з поточного файлу", + "command.terminal.toggle": "Перемкнути термінал", + "command.fileTree.toggle": "Перемкнути дерево файлів", + "command.review.toggle": "Перемкнути огляд", + "command.terminal.new": "Новий термінал", + "command.terminal.new.description": "Створити нову вкладку терміналу", + "command.steps.toggle": "Перемкнути кроки", + "command.steps.toggle.description": "Показати або приховати кроки для поточного повідомлення", + "command.message.previous": "Попереднє повідомлення", + "command.message.previous.description": "Перейти до попереднього повідомлення користувача", + "command.message.next": "Наступне повідомлення", + "command.message.next.description": "Перейти до наступного повідомлення користувача", + "command.model.choose": "Вибрати модель", + "command.model.choose.description": "Вибрати іншу модель", + "command.mcp.toggle": "Перемкнути MCP", + "command.mcp.toggle.description": "Увімкнути або вимкнути MCP", + "command.agent.cycle": "Змінити агента", + "command.agent.cycle.description": "Перейти до наступного агента", + "command.agent.cycle.reverse": "Змінити агента назад", + "command.agent.cycle.reverse.description": "Перейти до попереднього агента", + "command.model.variant.cycle": "Змінити зусилля мислення", + "command.model.variant.cycle.description": "Перейти до наступного рівня зусиль", + "command.permissions.autoaccept.enable": "Автоматично приймати редагування", + "command.permissions.autoaccept.disable": "Зупинити автоматичне прийняття", + "command.workspace.toggle": "Перемкнути робочі дерева", + "command.workspace.toggle.description": "Показати або приховати кілька робочих дерев на бічній панелі", + "command.session.undo": "Скасувати", + "command.session.undo.description": "Скасувати останнє повідомлення", + "command.session.redo": "Повторити", + "command.session.redo.description": "Повторити останнє скасоване повідомлення", + "revert.banner.count_one": "{{count}} повідомлення скасовано", + "revert.banner.count_other": "{{count}} повідомлень скасовано", + "revert.banner.redo": "Повторити", + "revert.banner.redo.all": "Повторити все", + "revert.banner.hint": "Надішліть нове повідомлення, щоб зробити це постійним", + "revert.disabled.agentBusy": "Зачекайте завершення агента", + "command.session.compact": "Стиснути сесію", + "command.session.compact.description": "Підсумувати сесію для зменшення розміру контексту", + "command.session.fork": "Розгалужити від повідомлення", + "command.session.fork.description": "Створити нову сесію від попереднього повідомлення", + "command.session.share": "Відкрити доступ до сесії", + "command.session.share.description": "Відкрити доступ до цієї сесії та скопіювати URL до буфера обміну", + "command.session.unshare": "Закрити доступ до сесії", + "command.session.unshare.description": "Закрити доступ до цієї сесії", + + "palette.search.placeholder": "Пошук файлів, команд і сесій", + "palette.empty": "Результатів не знайдено", + "palette.group.commands": "Команди", + "palette.group.files": "Файли", + + "dialog.provider.search.placeholder": "Пошук провайдера", + "dialog.provider.empty": "Провайдерів не знайдено", + "dialog.provider.group.popular": "Популярні", + "dialog.provider.group.other": "Інші", + "dialog.provider.tag.recommended": "Рекомендовано", + "dialog.provider.opencode.note": "Добірка моделей включаючи Claude, GPT, Gemini та інші", + "dialog.provider.anthropic.note": "Прямий доступ до моделей Claude включаючи Pro та Max", + "dialog.provider.copilot.note": "Моделі Claude для допомоги з кодуванням", + "dialog.provider.openai.note": "Моделі GPT для швидких і потужних загальних завдань ШІ", + "dialog.provider.google.note": "Моделі Gemini для швидких і структурованих відповідей", + "dialog.provider.openrouter.note": "Доступ до всіх підтримуваних моделей від одного провайдера", + "dialog.provider.vercel.note": "Уніфікований доступ до моделей ШІ з інтелектуальною маршрутизацією", + + "dialog.model.select.title": "Вибір моделі", + "dialog.model.search.placeholder": "Пошук моделі", + "dialog.model.empty": "Моделей не знайдено", + "dialog.model.manage": "Керувати моделями", + "dialog.model.manage.description": "Налаштуйте, які моделі відображаються у виборі моделей.", + "dialog.model.select": "Вибрати", + "dialog.model.expand": "Розгорнути", + "dialog.model.collapse": "Згорнути", + + "dialog.model.unpaid.freeModels.title": "Безкоштовні моделі від Kilo", + "dialog.model.unpaid.addMore.title": "Додайте більше моделей від популярних провайдерів", + + "dialog.provider.viewAll": "Показати більше провайдерів", + + "provider.connect.title": "Підключити {{provider}}", + "provider.connect.title.anthropicProMax": "Увійти через Claude Pro/Max", + "provider.connect.selectMethod": "Оберіть метод входу для {{provider}}.", + "provider.connect.method.apiKey": "API-ключ", + "provider.connect.status.inProgress": "Авторизація виконується...", + "provider.connect.status.waiting": "Очікування авторизації...", + "provider.connect.status.failed": "Авторизація не вдалася: {{error}}", + "provider.connect.apiKey.description": + "Введіть свій API-ключ {{provider}}, щоб підключити акаунт {{provider}} і використовувати моделі {{provider}} в Kilo.", + "provider.connect.apiKey.label": "API-ключ {{provider}}", + "provider.connect.apiKey.placeholder": "API-ключ", + "provider.connect.apiKey.required": "API-ключ обов'язковий", + "provider.connect.opencodeZen.line1": + "OpenCode Zen надає доступ до добірки надійних оптимізованих моделей для агентів кодування.", + "provider.connect.opencodeZen.line2": + "За допомогою одного API-ключа ви отримаєте доступ до таких моделей, як Claude, GPT, Gemini, GLM та інших.", + "provider.connect.opencodeZen.visit.prefix": "Відвідайте ", + "provider.connect.opencodeZen.visit.link": "https://opencode.ai/zen", + "provider.connect.opencodeZen.visit.suffix": " щоб отримати свій API-ключ.", + "provider.connect.oauth.code.visit.prefix": "Перейдіть за ", + "provider.connect.oauth.code.visit.link": "цим посиланням", + "provider.connect.oauth.code.visit.suffix": + " щоб отримати код авторизації для підключення акаунта та використання моделей {{provider}} у Kilo.", + "provider.connect.oauth.code.label": "Код авторизації {{method}}", + "provider.connect.oauth.code.placeholder": "Код авторизації", + "provider.connect.oauth.code.required": "Код авторизації обов'язковий", + "provider.connect.oauth.code.invalid": "Недійсний код авторизації", + "provider.connect.oauth.auto.visit.prefix": "Перейдіть за ", + "provider.connect.oauth.auto.visit.link": "цим посиланням", + "provider.connect.oauth.auto.visit.suffix": + " та введіть код нижче, щоб підключити акаунт і використовувати моделі {{provider}} у Kilo.", + "provider.connect.oauth.auto.confirmationCode": "Код підтвердження", + "provider.connect.toast.connected.title": "{{provider}} підключено", + "provider.connect.toast.connected.description": "Моделі {{provider}} тепер доступні.", + + "provider.disconnect.toast.disconnected.title": "{{provider}} відключено", + "provider.disconnect.toast.disconnected.description": "Моделі {{provider}} більше недоступні.", + + "model.tag.free": "Безкоштовно", + "model.tag.latest": "Остання", + "model.group.recommended": "Рекомендовані", + "model.provider.anthropic": "Anthropic", + "model.provider.openai": "OpenAI", + "model.provider.google": "Google", + "model.provider.xai": "xAI", + "model.provider.meta": "Meta", + "model.input.text": "текст", + "model.input.image": "зображення", + "model.input.audio": "аудіо", + "model.input.video": "відео", + "model.input.pdf": "pdf", + "model.tooltip.allows": "Підтримує: {{inputs}}", + "model.tooltip.reasoning.allowed": "Підтримує міркування", + "model.tooltip.reasoning.none": "Без міркування", + "model.tooltip.context": "Ліміт контексту {{limit}}", + + "common.search.placeholder": "Пошук", + "common.goBack": "Назад", + "common.goForward": "Вперед", + "common.loading": "Завантаження", + "common.loading.ellipsis": "...", + "common.cancel": "Скасувати", + "common.connect": "Підключити", + "common.disconnect": "Відключити", + "common.submit": "Надіслати", + "common.save": "Зберегти", + "common.saving": "Збереження...", + "common.default": "За замовчуванням", + "common.attachment": "вкладення", + + "prompt.placeholder.shell": "Введіть команду оболонки...", + "prompt.placeholder.normal": 'Запитайте щось... "{{example}}"', + "prompt.placeholder.summarizeComments": "Підсумувати коментарі…", + "prompt.placeholder.summarizeComment": "Підсумувати коментар…", + "prompt.mode.shell": "Оболонка", + "prompt.mode.shell.exit": "esc для виходу", + + "prompt.example.1": "Виправити TODO у кодовій базі", + "prompt.example.2": "Який технологічний стек у цьому проєкті?", + "prompt.example.3": "Виправити зламані тести", + "prompt.example.4": "Пояснити, як працює автентифікація", + "prompt.example.5": "Знайти і виправити вразливості безпеки", + "prompt.example.6": "Додати модульні тести для сервісу користувача", + "prompt.example.7": "Зробити цю функцію більш читабельною", + "prompt.example.8": "Що означає ця помилка?", + "prompt.example.9": "Допоможи мені налагодити цю проблему", + "prompt.example.10": "Згенерувати документацію API", + "prompt.example.11": "Оптимізувати запити до бази даних", + "prompt.example.12": "Додати валідацію введення", + "prompt.example.13": "Створити новий компонент для...", + "prompt.example.14": "Як розгорнути цей проєкт?", + "prompt.example.15": "Переглянути мій код на відповідність найкращим практикам", + "prompt.example.16": "Додати обробку помилок до цієї функції", + "prompt.example.17": "Пояснити цей шаблон регулярного виразу", + "prompt.example.18": "Конвертувати це у TypeScript", + "prompt.example.19": "Додати логування в кодову базу", + "prompt.example.20": "Які залежності застаріли?", + "prompt.example.21": "Допоможи написати скрипт міграції", + "prompt.example.22": "Реалізувати кешування для цього ендпоінту", + "prompt.example.23": "Додати пагінацію до цього списку", + "prompt.example.24": "Створити CLI-команду для...", + "prompt.example.25": "Як тут працюють змінні середовища?", + + "prompt.popover.emptyResults": "Збігів не знайдено", + "prompt.popover.emptyCommands": "Команд не знайдено", + "prompt.dropzone.label": "Скиньте сюди зображення або PDF", + "prompt.slash.badge.custom": "власна", + "prompt.slash.badge.skill": "навичка", + "prompt.slash.badge.mcp": "mcp", + "prompt.context.active": "активний", + "prompt.context.includeActiveFile": "Включити активний файл", + "prompt.context.removeActiveFile": "Видалити активний файл з контексту", + "prompt.context.removeFile": "Видалити файл з контексту", + "prompt.action.attachFile": "Прикріпити файл", + "prompt.attachment.remove": "Видалити вкладення", + "prompt.action.send": "Надіслати", + "prompt.action.send.blocked": "Спочатку дайте відповідь або закрийте очікуюче питання", + "prompt.action.stop": "Зупинити", + "prompt.action.enhance": "Покращити запит", + "prompt.action.resetModel": "Скинути модель до стандартної", + "prompt.action.enhanceDescription": + "Кнопка 'Покращити запит' допомагає вдосконалити ваш запит, надаючи додатковий контекст, уточнення або перефразування. Введіть запит тут і натисніть кнопку ще раз, щоб побачити, як це працює.", + + "prompt.toast.pasteUnsupported.title": "Вставка не підтримується", + "prompt.toast.pasteUnsupported.description": "Сюди можна вставляти лише зображення або PDF.", + "prompt.toast.modelAgentRequired.title": "Виберіть агента і модель", + "prompt.toast.modelAgentRequired.description": "Перед надсиланням запиту виберіть агента і модель.", + "prompt.toast.worktreeCreateFailed.title": "Не вдалося створити робоче дерево", + "prompt.toast.sessionCreateFailed.title": "Не вдалося створити сесію", + "prompt.toast.shellSendFailed.title": "Не вдалося надіслати команду оболонки", + "prompt.toast.commandSendFailed.title": "Не вдалося надіслати команду", + "prompt.toast.promptSendFailed.title": "Не вдалося надіслати запит", + + "dialog.mcp.title": "MCP", + "dialog.mcp.description": "{{enabled}} з {{total}} увімкнено", + "dialog.mcp.empty": "MCP не налаштовано", + + "dialog.lsp.empty": "LSP автоматично визначаються за типами файлів", + "dialog.plugins.empty": "Плагіни налаштовуються в opencode.json", + + "mcp.status.connected": "підключено", + "mcp.status.failed": "помилка", + "mcp.status.needs_auth": "потрібна автентифікація", + "mcp.status.needs_registration": "потрібна реєстрація клієнта", + "mcp.status.disabled": "вимкнено", + + "dialog.fork.empty": "Немає повідомлень для розгалуження", + + "dialog.directory.search.placeholder": "Пошук папки", + "dialog.directory.empty": "Папок не знайдено", + + "dialog.server.title": "Сервери", + "dialog.server.description": "Змінити, до якого сервера Kilo підключається цей додаток.", + "dialog.server.search.placeholder": "Пошук сервера", + "dialog.server.empty": "Поки що немає серверів", + "dialog.server.add.title": "Додати сервер", + "dialog.server.add.url": "URL сервера", + "dialog.server.add.placeholder": "http://localhost:4096", + "dialog.server.add.error": "Не вдалося підключитися до сервера", + "dialog.server.add.checking": "Перевірка...", + "dialog.server.add.button": "Додати сервер", + "dialog.server.default.title": "Сервер за замовчуванням", + "dialog.server.default.description": + "Підключатися до цього сервера замість запуску локального під час запуску програми. Потрібен перезапуск.", + "dialog.server.default.none": "Сервер не вибрано", + "dialog.server.default.set": "Встановити поточний сервер як стандартний", + "dialog.server.default.clear": "Очистити", + "dialog.server.action.remove": "Видалити сервер", + + "dialog.server.menu.edit": "Редагувати", + "dialog.server.menu.default": "Встановити як стандартний", + "dialog.server.menu.defaultRemove": "Видалити стандартний", + "dialog.server.menu.delete": "Видалити", + "dialog.server.current": "Поточний сервер", + "dialog.server.status.default": "Стандартний", + + "dialog.project.edit.title": "Редагувати проєкт", + "dialog.project.edit.name": "Назва", + "dialog.project.edit.icon": "Іконка", + "dialog.project.edit.icon.alt": "Іконка проєкту", + "dialog.project.edit.icon.hint": "Клацніть або перетягніть зображення", + "dialog.project.edit.icon.recommended": "Рекомендовано: 128x128px", + "dialog.project.edit.color": "Колір", + "dialog.project.edit.color.select": "Вибрати колір {{color}}", + "dialog.project.edit.worktree.startup": "Скрипт запуску робочого дерева", + "dialog.project.edit.worktree.startup.description": "Виконується після створення нового робочого дерева.", + "dialog.project.edit.worktree.startup.placeholder": "напр. bun install", + + "context.breakdown.title": "Розбивка контексту", + "context.breakdown.note": + 'Приблизна розбивка вхідних токенів. "Інше" включає визначення інструментів і накладні витрати.', + "context.breakdown.system": "Система", + "context.breakdown.user": "Користувач", + "context.breakdown.assistant": "Асистент", + "context.breakdown.tool": "Виклики інструментів", + "context.breakdown.other": "Інше", + + "context.systemPrompt.title": "Системний запит", + "context.rawMessages.title": "Необроблені повідомлення", + + "context.stats.session": "Сесія", + "context.stats.messages": "Повідомлення", + "context.stats.provider": "Провайдер", + "context.stats.model": "Модель", + "context.stats.limit": "Ліміт контексту", + "context.stats.totalTokens": "Всього токенів", + "context.stats.usage": "Використання", + "context.stats.inputTokens": "Вхідні токени", + "context.stats.outputTokens": "Вихідні токени", + "context.stats.reasoningTokens": "Токени міркування", + "context.stats.cacheTokens": "Токени кешу (читання/запис)", + "context.stats.userMessages": "Повідомлення користувача", + "context.stats.assistantMessages": "Повідомлення асистента", + "context.stats.totalCost": "Загальна вартість", + "context.stats.sessionCreated": "Сесію створено", + "context.stats.lastActivity": "Остання активність", + + "context.usage.tokens": "Токени", + "context.usage.usage": "Використання", + "context.usage.cost": "Вартість", + "context.usage.clickToView": "Переглянути контекст", + "context.usage.view": "Переглянути використання контексту", + + "language.en": "English", + "language.zh": "简体中文", + "language.zht": "繁體中文", + "language.ko": "한국어", + "language.de": "Deutsch", + "language.es": "Español", + "language.fr": "Français", + "language.da": "Dansk", + "language.ja": "日本語", + "language.pl": "Polski", + "language.ru": "Русский", + "language.ar": "العربية", + "language.no": "Norsk", + "language.br": "Português (Brasil)", + "language.bs": "Bosanski", + "language.th": "ไทย", + "language.tr": "Türkçe", + "language.uk": "Українська", + + "toast.language.title": "Мова", + "toast.language.description": "Перейшли на {{language}}", + + "toast.theme.title": "Тему змінено", + "toast.scheme.title": "Кольорова схема", + + "toast.workspace.enabled.title": "Робочі дерева увімкнено", + "toast.workspace.enabled.description": "На бічній панелі тепер відображаються кілька робочих дерев", + "toast.workspace.disabled.title": "Робочі дерева вимкнено", + "toast.workspace.disabled.description": "На бічній панелі відображається лише основне робоче дерево", + + "toast.permissions.autoaccept.on.title": "Редагування приймаються автоматично", + "toast.permissions.autoaccept.on.description": "Дозволи на редагування і запис схвалюватимуться автоматично", + "toast.permissions.autoaccept.off.title": "Автоматичне прийняття зупинено", + "toast.permissions.autoaccept.off.description": "Дозволи на редагування і запис потребуватимуть підтвердження", + + "toast.model.none.title": "Модель не вибрано", + "toast.model.none.description": "Підключіть провайдера, щоб підсумувати цю сесію", + + "toast.file.loadFailed.title": "Не вдалося завантажити файл", + "toast.file.listFailed.title": "Не вдалося отримати список файлів", + + "toast.context.noLineSelection.title": "Немає виділення рядків", + "toast.context.noLineSelection.description": "Спочатку виділіть діапазон рядків у вкладці файлу.", + + "toast.session.share.copyFailed.title": "Не вдалося скопіювати URL до буфера обміну", + "toast.session.share.success.title": "Доступ до сесії відкрито", + "toast.session.share.success.description": "Посилання на сесію скопійовано до буфера обміну!", + "toast.session.share.failed.title": "Не вдалося відкрити доступ до сесії", + "toast.session.share.failed.description": "Під час відкриття доступу до сесії сталася помилка", + + "toast.session.unshare.success.title": "Доступ до сесії закрито", + "toast.session.unshare.success.description": "Доступ до сесії успішно закрито!", + "toast.session.unshare.failed.title": "Не вдалося закрити доступ до сесії", + "toast.session.unshare.failed.description": "Під час закриття доступу до сесії сталася помилка", + + "toast.session.listFailed.title": "Не вдалося завантажити сесії для {{project}}", + + "toast.update.title": "Доступне оновлення", + "toast.update.description": "Нова версія Kilo ({{version}}) готова до встановлення.", + "toast.update.action.installRestart": "Встановити і перезапустити", + "toast.update.action.notYet": "Не зараз", + + "error.page.title": "Щось пішло не так", + "error.page.description": "Під час завантаження програми сталася помилка.", + "error.page.details.label": "Деталі помилки", + "error.page.action.restart": "Перезапустити", + "error.page.action.checking": "Перевірка...", + "error.page.action.checkUpdates": "Перевірити оновлення", + "error.page.action.updateTo": "Оновити до {{version}}", + "error.page.report.prefix": "Будь ласка, повідомте про цю помилку команді Kilo", + "error.page.report.discord": "через Discord", + "error.page.version": "Версія: {{version}}", + + "error.dev.rootNotFound": + "Кореневий елемент не знайдено. Чи не забули ви додати його до index.html? Або можливо неправильно написано атрибут id?", + + "error.globalSync.connectFailed": "Не вдалося підключитися до сервера. Чи запущений сервер на `{{url}}`?", + + "error.startup.title": "Підключення до сервера не вдалося", + + "error.paidModel.title": "Для використання цієї моделі потрібно увійти", + "error.paidModel.description": + "Увійдіть або створіть акаунт для доступу до 500+ моделей, використання кредитів за вартістю або підключення власного ключа.", + "error.paidModel.action": "Увійти", + "error.promotionLimit.title": "Для продовження потрібна реєстрація", + "error.promotionLimit.description": + "Зареєструйтеся безкоштовно для продовження та доступу до 500+ моделей. Займе 2 хвилини, кредитна картка не потрібна. Або поверніться пізніше.", + "error.promotionLimit.action": "Зареєструватися", + + "error.chain.unknown": "Невідома помилка", + "error.chain.causedBy": "Спричинено:", + "error.chain.apiError": "Помилка API", + "error.chain.status": "Статус: {{status}}", + "error.chain.retryable": "Можна повторити: {{retryable}}", + "error.chain.responseBody": "Тіло відповіді:\n{{body}}", + "error.chain.didYouMean": "Можливо ви мали на увазі: {{suggestions}}", + "error.chain.modelNotFound": "Модель не знайдено: {{provider}}/{{model}}", + "error.chain.checkConfig": "Перевірте назви провайдера/моделі у файлі конфігурації (opencode.json)", + "error.chain.mcpFailed": 'MCP-сервер "{{name}}" зазнав помилки. Примітка: Kilo поки не підтримує автентифікацію MCP.', + "error.chain.providerAuthFailed": "Автентифікація провайдера не вдалася ({{provider}}): {{message}}", + "error.chain.providerInitFailed": + 'Не вдалося ініціалізувати провайдера "{{provider}}". Перевірте облікові дані та конфігурацію.', + "error.chain.configJsonInvalid": "Файл конфігурації за адресою {{path}} не є дійсним JSON(C)", + "error.chain.configJsonInvalidWithMessage": "Файл конфігурації за адресою {{path}} не є дійсним JSON(C): {{message}}", + "error.chain.configDirectoryTypo": + 'Директорія "{{dir}}" недійсна в {{path}}. Перейменуйте або видаліть директорію на "{{suggestion}}". Це поширена помилка написання.', + "error.chain.configFrontmatterError": "Не вдалося розібрати frontmatter у {{path}}:\n{{message}}", + "error.chain.configInvalid": "Файл конфігурації за адресою {{path}} недійсний", + "error.chain.configInvalidWithMessage": "Файл конфігурації за адресою {{path}} недійсний: {{message}}", + + "notification.permission.title": "Потрібен дозвіл", + "notification.permission.titleSubagent": "Потрібен дозвіл (підагент)", + "notification.permission.description": "{{sessionTitle}} у {{projectName}} потребує дозволу", + "ui.permission.manageAutoApprove": "Керувати правилами автоматичного схвалення", + "ui.permission.rule.addToAllowed": "Додати до дозволених", + "ui.permission.rule.removeFromAllowed": "Видалити з дозволених", + "ui.permission.rule.addToDenied": "Додати до заблокованих", + "ui.permission.rule.removeFromDenied": "Видалити із заблокованих", + "ui.permission.toolLabel.read": "Читати", + "ui.permission.toolLabel.edit": "Редагувати", + "ui.permission.toolLabel.write": "Записати", + "ui.permission.toolLabel.patch": "Патч", + "ui.permission.toolLabel.globSearch": "Пошук Glob", + "ui.permission.toolLabel.grepSearch": "Пошук Grep", + "ui.permission.toolLabel.webSearch": "Веб-пошук", + "ui.permission.toolLabel.list": "Список", + "ui.permission.toolLabel.externalDirectory": "Читати зовнішню директорію", + "ui.permission.toolLabel.webFetch": "Веб-запит", + "ui.permission.toolLabel.task": "Завдання", + "ui.permission.toolLabel.skill": "Навичка", + "ui.permission.toolLabel.lsp": "LSP", + "ui.permission.toolLabel.bash": "Bash", + "ui.permission.toolLabel.todoRead": "Читати завдання", + "ui.permission.toolLabel.todoWrite": "Записати завдання", + "ui.permission.toolLabel.codeSearch": "Пошук коду", + "ui.permission.toggleWrap": "Перемкнути перенос рядків", + "ui.permission.copyCommand": "Копіювати", + "notification.question.title": "Питання", + "notification.question.description": "{{sessionTitle}} у {{projectName}} задає питання", + "notification.action.goToSession": "Перейти до сесії", + + "notification.session.responseReady.title": "Відповідь готова", + "notification.session.error.title": "Помилка сесії", + "notification.session.error.fallbackDescription": "Сталася помилка", + + "home.recentProjects": "Останні проєкти", + "home.empty.title": "Немає останніх проєктів", + "home.empty.description": "Почніть з відкриття локального проєкту", + + "session.tab.session": "Сесія", + "session.tab.review": "Огляд", + "session.tab.context": "Контекст", + "session.panel.reviewAndFiles": "Огляд і файли", + "session.review.filesChanged": "{{count}} файлів змінено", + "session.review.change.one": "Зміна", + "session.review.change.other": "Змін", + "session.review.loadingChanges": "Завантаження змін...", + "session.review.empty": "У цій сесії ще немає змін", + "session.review.noChanges": "Змін немає", + + "session.files.selectToOpen": "Виберіть файл для відкриття", + "session.files.all": "Усі файли", + "session.files.binaryContent": "Бінарний файл (вміст не відображається)", + + "session.messages.renderEarlier": "Показати попередні повідомлення", + "session.messages.loadingEarlier": "Завантаження попередніх повідомлень...", + "session.messages.loadEarlier": "Завантажити попередні повідомлення", + "session.messages.loading": "Завантаження повідомлень...", + "session.messages.jumpToLatest": "Перейти до останнього", + + "session.context.addToContext": "Додати {{selection}} до контексту", + + "session.new.worktree.main": "Основна гілка", + "session.new.worktree.mainWithBranch": "Основна гілка ({{branch}})", + "session.new.worktree.create": "Створити нове робоче дерево", + "session.new.lastModified": "Останнє змінення", + + "session.header.search.placeholder": "Пошук {{project}}", + "session.header.searchFiles": "Пошук файлів", + "session.header.openIn": "Відкрити в", + "session.header.open.action": "Відкрити в {{app}}", + "session.header.open.ariaLabel": "Відкрити в {{app}}", + "session.header.open.menu": "Параметри відкриття", + "session.header.open.copyPath": "Копіювати шлях", + + "status.popover.trigger": "Статус", + "status.popover.ariaLabel": "Конфігурації сервера", + "status.popover.tab.servers": "Сервери", + "status.popover.tab.mcp": "MCP", + "status.popover.tab.lsp": "LSP", + "status.popover.tab.plugins": "Плагіни", + "status.popover.action.manageServers": "Керувати серверами", + + "session.share.popover.title": "Опублікувати в інтернеті", + "session.share.popover.description.shared": + "Ця сесія публічно доступна в інтернеті. Будь-хто з посиланням може отримати доступ.", + "session.share.popover.description.unshared": + "Опублікуйте сесію публічно в інтернеті. Будь-хто з посиланням зможе переглянути її.", + "session.share.action.share": "Поділитися", + "session.share.action.publish": "Опублікувати", + "session.share.action.publishing": "Публікація...", + "session.share.action.unpublish": "Зняти з публікації", + "session.share.action.unpublishing": "Зняття з публікації...", + "session.share.action.view": "Переглянути", + "session.share.copy.copied": "Скопійовано", + "session.share.copy.copyLink": "Копіювати посилання", + + "lsp.tooltip.none": "Немає LSP-серверів", + "lsp.label.connected": "{{count}} LSP", + + "prompt.loading": "Завантаження запиту...", + "terminal.loading": "Завантаження терміналу...", + "terminal.title": "Термінал", + "terminal.title.numbered": "Термінал {{number}}", + "terminal.close": "Закрити термінал", + "terminal.connectionLost.title": "З'єднання втрачено", + "terminal.connectionLost.description": "З'єднання з терміналом перервано. Це може статися після перезапуску сервера.", + + "common.closeTab": "Закрити вкладку", + "common.signIn": "Увійти", + "common.signOut": "Вийти", + "common.dismiss": "Закрити", + "common.requestFailed": "Запит не вдався", + "common.moreOptions": "Більше параметрів", + "common.learnMore": "Дізнатися більше", + "common.rename": "Перейменувати", + "common.reset": "Скинути", + "common.archive": "Архівувати", + "common.delete": "Видалити", + "common.close": "Закрити", + "common.edit": "Редагувати", + "common.loadMore": "Завантажити більше", + "common.key.esc": "ESC", + + "sidebar.menu.toggle": "Перемкнути меню", + "sidebar.nav.projectsAndSessions": "Проєкти і сесії", + "sidebar.settings": "Налаштування", + "sidebar.help": "Допомога", + "sidebar.workspaces.enable": "Увімкнути робочі дерева", + "sidebar.workspaces.disable": "Вимкнути робочі дерева", + "sidebar.gettingStarted.title": "Початок роботи", + "sidebar.gettingStarted.line1": "Kilo включає безкоштовні моделі, тому ви можете почати відразу.", + "sidebar.gettingStarted.line2": "Підключіть будь-якого провайдера для використання моделей Claude, GPT, Gemini тощо.", + "sidebar.project.recentSessions": "Останні сесії", + "sidebar.project.viewAllSessions": "Переглянути всі сесії", + + "app.name.desktop": "Kilo Desktop", + + "settings.section.desktop": "Робочий стіл", + "settings.section.server": "Сервер", + "settings.tab.general": "Загальні", + "settings.tab.shortcuts": "Скорочення", + + "settings.general.section.appearance": "Вигляд", + "settings.general.section.notifications": "Системні сповіщення", + "settings.general.section.updates": "Оновлення", + "settings.general.section.sounds": "Звукові ефекти", + + "settings.general.row.language.title": "Мова", + "settings.general.row.language.description": "Змінити мову відображення Kilo", + "settings.general.row.appearance.title": "Вигляд", + "settings.general.row.appearance.description": "Налаштувати вигляд Kilo на вашому пристрої", + "settings.general.row.theme.title": "Тема", + "settings.general.row.theme.description": "Налаштувати тему Kilo.", + "settings.general.row.font.title": "Шрифт", + "settings.general.row.font.description": "Налаштувати моноширинний шрифт, що використовується в блоках коду", + + "settings.general.row.releaseNotes.title": "Примітки до випуску", + "settings.general.row.releaseNotes.description": "Показувати сповіщення про новини після оновлень", + + "settings.updates.row.startup.title": "Перевіряти оновлення під час запуску", + "settings.updates.row.startup.description": "Автоматично перевіряти оновлення при запуску Kilo", + "settings.updates.row.check.title": "Перевірити оновлення", + "settings.updates.row.check.description": "Вручну перевірити та встановити оновлення", + "settings.updates.action.checkNow": "Перевірити зараз", + "settings.updates.action.checking": "Перевірка...", + "settings.updates.toast.latest.title": "Ви використовуєте актуальну версію", + "settings.updates.toast.latest.description": "У вас встановлена остання версія Kilo.", + "font.option.ibmPlexMono": "IBM Plex Mono", + "font.option.cascadiaCode": "Cascadia Code", + "font.option.firaCode": "Fira Code", + "font.option.hack": "Hack", + "font.option.inconsolata": "Inconsolata", + "font.option.intelOneMono": "Intel One Mono", + "font.option.iosevka": "Iosevka", + "font.option.jetbrainsMono": "JetBrains Mono", + "font.option.mesloLgs": "Meslo LGS", + "font.option.robotoMono": "Roboto Mono", + "font.option.sourceCodePro": "Source Code Pro", + "font.option.ubuntuMono": "Ubuntu Mono", + "sound.option.alert01": "Сигнал 01", + "sound.option.alert02": "Сигнал 02", + "sound.option.alert03": "Сигнал 03", + "sound.option.alert04": "Сигнал 04", + "sound.option.alert05": "Сигнал 05", + "sound.option.alert06": "Сигнал 06", + "sound.option.alert07": "Сигнал 07", + "sound.option.alert08": "Сигнал 08", + "sound.option.alert09": "Сигнал 09", + "sound.option.alert10": "Сигнал 10", + "sound.option.bipbop01": "Біп-боп 01", + "sound.option.bipbop02": "Біп-боп 02", + "sound.option.bipbop03": "Біп-боп 03", + "sound.option.bipbop04": "Біп-боп 04", + "sound.option.bipbop05": "Біп-боп 05", + "sound.option.bipbop06": "Біп-боп 06", + "sound.option.bipbop07": "Біп-боп 07", + "sound.option.bipbop08": "Біп-боп 08", + "sound.option.bipbop09": "Біп-боп 09", + "sound.option.bipbop10": "Біп-боп 10", + "sound.option.staplebops01": "Staplebops 01", + "sound.option.staplebops02": "Staplebops 02", + "sound.option.staplebops03": "Staplebops 03", + "sound.option.staplebops04": "Staplebops 04", + "sound.option.staplebops05": "Staplebops 05", + "sound.option.staplebops06": "Staplebops 06", + "sound.option.staplebops07": "Staplebops 07", + "sound.option.nope01": "Ні 01", + "sound.option.nope02": "Ні 02", + "sound.option.nope03": "Ні 03", + "sound.option.nope04": "Ні 04", + "sound.option.nope05": "Ні 05", + "sound.option.nope06": "Ні 06", + "sound.option.nope07": "Ні 07", + "sound.option.nope08": "Ні 08", + "sound.option.nope09": "Ні 09", + "sound.option.nope10": "Ні 10", + "sound.option.nope11": "Ні 11", + "sound.option.nope12": "Ні 12", + "sound.option.yup01": "Так 01", + "sound.option.yup02": "Так 02", + "sound.option.yup03": "Так 03", + "sound.option.yup04": "Так 04", + "sound.option.yup05": "Так 05", + "sound.option.yup06": "Так 06", + + "settings.general.notifications.agent.title": "Агент", + "settings.general.notifications.agent.description": + "Показувати системне сповіщення, коли агент завершив роботу або потребує уваги", + "settings.general.notifications.permissions.title": "Дозволи", + "settings.general.notifications.permissions.description": "Показувати системне сповіщення при запиті дозволу", + "settings.general.notifications.errors.title": "Помилки", + "settings.general.notifications.errors.description": "Показувати системне сповіщення при виникненні помилки", + + "settings.general.sounds.agent.title": "Агент", + "settings.general.sounds.agent.description": "Відтворювати звук, коли агент завершив роботу або потребує уваги", + "settings.general.sounds.permissions.title": "Дозволи", + "settings.general.sounds.permissions.description": "Відтворювати звук при запиті дозволу", + "settings.general.sounds.errors.title": "Помилки", + "settings.general.sounds.errors.description": "Відтворювати звук при виникненні помилки", + + "settings.shortcuts.title": "Клавіатурні скорочення", + "settings.shortcuts.reset.button": "Скинути до стандартних", + "settings.shortcuts.reset.toast.title": "Скорочення скинуто", + "settings.shortcuts.reset.toast.description": "Клавіатурні скорочення скинуто до стандартних.", + "settings.shortcuts.conflict.title": "Скорочення вже використовується", + "settings.shortcuts.conflict.description": "{{keybind}} вже призначено для {{titles}}.", + "settings.shortcuts.unassigned": "Не призначено", + "settings.shortcuts.pressKeys": "Натисніть клавіші", + "settings.shortcuts.search.placeholder": "Пошук скорочень", + "settings.shortcuts.search.empty": "Скорочень не знайдено", + + "settings.shortcuts.group.general": "Загальні", + "settings.shortcuts.group.session": "Сесія", + "settings.shortcuts.group.navigation": "Навігація", + "settings.shortcuts.group.modelAndAgent": "Модель і агент", + "settings.shortcuts.group.terminal": "Термінал", + "settings.shortcuts.group.prompt": "Запит", + + "settings.providers.title": "Провайдери", + "settings.providers.description": "Тут можна буде налаштовувати параметри провайдерів.", + "settings.providers.betaNotice": + "Наразі в інтерфейсі налаштувань можна налаштувати лише провайдера Kilo Gateway. Підтримка інших провайдерів з'явиться в бета-версії найближчим часом. Тим часом ви можете налаштовувати провайдерів через CLI або файл конфігурації. Kilo залишається відкритим — без прив'язки.", + "settings.providers.section.connected": "Підключені провайдери", + "settings.providers.connected.empty": "Підключених провайдерів немає", + "settings.providers.section.popular": "Популярні провайдери", + "settings.providers.tag.gateway": "Gateway", + "settings.providers.tag.environment": "Середовище", + "settings.providers.tag.config": "Конфігурація", + "settings.providers.tag.custom": "Власний", + "settings.providers.tag.customProvider": "Власний провайдер", + "settings.providers.tag.other": "Інші", + "settings.providers.connected.environmentDescription": "Підключено зі змінних середовища", + "settings.providers.custom.description": "Додати OpenAI-сумісного провайдера через базовий URL.", + + "provider.custom.title": "Власний провайдер", + "provider.custom.description.prefix": "Налаштувати OpenAI-сумісного провайдера. ", + "provider.custom.description.link": "Документація щодо налаштування провайдера", + "provider.custom.description.suffix": ".", + "provider.custom.field.providerID.label": "Ідентифікатор провайдера", + "provider.custom.field.providerID.placeholder": "miy-provyder", + "provider.custom.field.providerID.description": "Малі літери, цифри, дефіс або підкреслення", + "provider.custom.field.name.label": "Відображувана назва", + "provider.custom.field.name.placeholder": "Мій ШІ-провайдер", + "provider.custom.field.baseURL.label": "Базовий URL", + "provider.custom.field.baseURL.placeholder": "https://api.miy-provyder.com/v1", + "provider.custom.field.apiKey.label": "API-ключ", + "provider.custom.field.apiKey.placeholder": "API-ключ", + "provider.custom.field.apiKey.description": + "Необов'язково. Залиште порожнім, якщо автентифікація керується заголовками.", + "provider.custom.models.label": "Моделі", + "provider.custom.models.id.label": "Ідентифікатор", + "provider.custom.models.id.placeholder": "ідентифікатор-моделі", + "provider.custom.models.name.label": "Назва", + "provider.custom.models.name.placeholder": "Відображувана назва", + "provider.custom.models.remove": "Видалити модель", + "provider.custom.models.add": "Додати модель", + "provider.custom.models.fetch": "Отримати моделі", + "provider.custom.models.fetching": "Отримання\u2026", + "provider.custom.models.fetch.error": "Не вдалося отримати моделі: {{error}}", + "provider.custom.models.fetch.authError": "Автентифікація не вдалася. Перевірте API-ключ вище і спробуйте ще раз.", + "provider.custom.models.fetch.empty": "На цьому сервері моделей не знайдено.", + "provider.custom.models.fetch.added": "Додано {{count}} моделей.", + "provider.custom.models.fetch.allExist": "Усі отримані моделі вже додано.", + "provider.custom.models.fetch.selectAll": "Вибрати все", + "provider.custom.models.fetch.deselectAll": "Зняти весь вибір", + "provider.custom.models.fetch.found": "Знайдено {{count}} моделей", + "provider.custom.models.fetch.showing": "Показано {{shown}} з {{total}} моделей", + "provider.custom.models.fetch.search": "Пошук моделей\u2026", + "provider.custom.models.fetch.add": "Додати {{count}} моделей", + "provider.custom.edit.title": "Редагувати провайдера", + "provider.custom.headers.label": "Заголовки (необов'язково)", + "provider.custom.headers.key.label": "Заголовок", + "provider.custom.headers.key.placeholder": "Назва-заголовка", + "provider.custom.headers.value.label": "Значення", + "provider.custom.headers.value.placeholder": "значення", + "provider.custom.headers.remove": "Видалити заголовок", + "provider.custom.headers.add": "Додати заголовок", + "provider.custom.error.providerID.required": "Ідентифікатор провайдера обов'язковий", + "provider.custom.error.providerID.format": "Використовуйте малі літери, цифри, дефіс або підкреслення", + "provider.custom.error.providerID.exists": "Такий ідентифікатор провайдера вже існує", + "provider.custom.error.name.required": "Відображувана назва обов'язкова", + "provider.custom.error.baseURL.required": "Базовий URL обов'язковий", + "provider.custom.error.baseURL.format": "Має починатися з http:// або https://", + "provider.custom.error.required": "Обов'язкове поле", + "provider.custom.error.duplicate": "Дублікат", + "settings.models.title": "Моделі", + "settings.models.description": "Тут можна буде налаштовувати параметри моделей.", + "settings.agents.title": "Агенти", + "settings.agents.description": "Тут можна буде налаштовувати параметри агентів.", + "settings.commands.title": "Команди", + "settings.commands.description": "Тут можна буде налаштовувати параметри команд.", + "settings.mcp.title": "MCP", + "settings.mcp.description": "Тут можна буде налаштовувати параметри MCP.", + + "settings.permissions.title": "Дозволи", + "settings.permissions.description": "Контролюйте, які інструменти сервер може використовувати за замовчуванням.", + "settings.permissions.section.tools": "Інструменти", + "settings.permissions.toast.updateFailed.title": "Не вдалося оновити дозволи", + + "settings.permissions.action.allow": "Дозволити", + "settings.permissions.action.ask": "Запитувати", + "settings.permissions.action.deny": "Відхилити", + + "settings.permissions.tool.read.title": "Читати", + "settings.permissions.tool.read.description": "Читати файл (відповідає шляху файлу)", + "settings.permissions.tool.edit.title": "Редагувати", + "settings.permissions.tool.edit.description": + "Змінювати файли включаючи редагування, запис, патч і множинне редагування", + "settings.permissions.tool.glob.title": "Glob", + "settings.permissions.tool.glob.description": "Зіставляти файли за шаблонами glob", + "settings.permissions.tool.grep.title": "Grep", + "settings.permissions.tool.grep.description": "Шукати вміст файлів за регулярними виразами", + "settings.permissions.tool.list.title": "Список", + "settings.permissions.tool.list.description": "Перелічити файли в директорії", + "settings.permissions.tool.bash.title": "Bash", + "settings.permissions.tool.bash.description": "Виконувати команди оболонки", + "settings.permissions.tool.task.title": "Завдання", + "settings.permissions.tool.task.description": "Запускати підагентів", + "settings.permissions.tool.skill.title": "Навичка", + "settings.permissions.tool.skill.description": "Завантажувати навичку за назвою", + "settings.permissions.tool.lsp.title": "LSP", + "settings.permissions.tool.lsp.description": "Виконувати запити до мовного сервера", + "settings.permissions.tool.todoread.title": "Читати завдання", + "settings.permissions.tool.todoread.description": "Читати список завдань", + "settings.permissions.tool.todowrite.title": "Записати завдання", + "settings.permissions.tool.todowrite.description": "Оновлювати список завдань", + "settings.permissions.tool.webfetch.title": "Веб-запит", + "settings.permissions.tool.webfetch.description": "Отримати вміст з URL", + "settings.permissions.tool.websearch.title": "Веб-пошук", + "settings.permissions.tool.websearch.description": "Шукати в інтернеті", + "settings.permissions.tool.codesearch.title": "Пошук коду", + "settings.permissions.tool.codesearch.description": "Шукати код в інтернеті", + "settings.permissions.tool.external_directory.title": "Зовнішня директорія", + "settings.permissions.tool.external_directory.description": "Доступ до файлів поза директорією проєкту", + "settings.permissions.tool.doom_loop.title": "Нескінченний цикл", + "settings.permissions.tool.doom_loop.description": + "Виявляти повторювані виклики інструментів з однаковими вхідними даними", + + "session.delete.failed.title": "Не вдалося видалити сесію", + "session.delete.title": "Видалити сесію", + "session.delete.confirm": 'Видалити сесію "{{name}}"?', + "session.delete.button": "Видалити сесію", + "session.untitled": "Без назви", + "session.recent": "Останні", + "session.showHistory": "Показати історію", + "session.search.placeholder": "Пошук сесій...", + "session.empty": "Сесій поки немає. Натисніть +, щоб почати новий чат.", + "session.tab.local": "Локальний", + "session.tab.cloud": "Хмарний", + "session.cloud.repoOnly": "Лише цей репозиторій", + "session.cloud.import": "Імпортувати з хмари", + "feedback.button": "Зворотний зв'язок і підтримка", + "feedback.dialog.message": "Ми раді отримати ваш відгук або допомогти з будь-якими проблемами, які у вас виникли.", + "feedback.dialog.github": "Повідомити про проблему на GitHub", + "feedback.dialog.discord": "Приєднатися до нашої спільноти Discord", + "feedback.dialog.support": "Служба підтримки клієнтів", + "session.cloud.import.title": "Імпортувати з хмари", + "session.cloud.import.placeholder": "Ідентифікатор сесії, URL або команда kilo import", + "session.cloud.import.button": "Імпортувати", + "session.cloud.import.invalid": "Недійсний формат ідентифікатора сесії", + "session.cloud.import.legacy": "Схоже, це застаріла сесія, яка більше не підтримується.", + "session.cloud.import.failed": "Не вдалося імпортувати хмарну сесію", + + "workspace.new": "Новий робочий простір", + "workspace.type.local": "локальний", + "workspace.type.sandbox": "пісочниця", + "workspace.create.failed.title": "Не вдалося створити робочий простір", + "workspace.delete.failed.title": "Не вдалося видалити робочий простір", + "workspace.resetting.title": "Скидання робочого простору", + "workspace.resetting.description": "Це може зайняти хвилину.", + "workspace.reset.failed.title": "Не вдалося скинути робочий простір", + "workspace.reset.success.title": "Робочий простір скинуто", + "workspace.reset.success.description": "Робочий простір тепер відповідає основній гілці.", + "workspace.error.stillPreparing": "Робочий простір ще підготовлюється", + "workspace.status.checking": "Перевірка неприйнятих змін...", + "workspace.status.error": "Не вдалося перевірити статус git.", + "workspace.status.clean": "Неприйнятих змін не виявлено.", + "workspace.status.dirty": "У цьому робочому просторі виявлено неприйняті зміни.", + "workspace.delete.title": "Видалити робочий простір", + "workspace.delete.confirm": 'Видалити робочий простір "{{name}}"?', + "workspace.delete.button": "Видалити робочий простір", + "workspace.reset.title": "Скинути робочий простір", + "workspace.reset.confirm": 'Скинути робочий простір "{{name}}"?', + "workspace.reset.button": "Скинути робочий простір", + "workspace.reset.archived.none": "Немає активних сесій для архівування.", + "workspace.reset.archived.one": "1 сесію буде архівовано.", + "workspace.reset.archived.many": "{{count}} сесій буде архівовано.", + "workspace.reset.note": "Ця дія скине робочий простір відповідно до основної гілки.", + + "deviceAuth.toast.urlCopied": "URL скопійовано до буфера обміну", + "deviceAuth.toast.codeCopied": "Код скопійовано до буфера обміну", + "deviceAuth.toast.errorCopied": "Помилку скопійовано до буфера обміну", + "deviceAuth.status.initiating": "Ініціалізація входу...", + "deviceAuth.title": "Увійти до Kilo Code", + "deviceAuth.step1": "Крок 1: Відкрийте цей URL", + "deviceAuth.action.copyUrl": "Копіювати URL", + "deviceAuth.action.openBrowser": "Відкрити браузер", + "deviceAuth.qrCode.alt": "QR-код", + "deviceAuth.step2": "Крок 2: Введіть цей код", + "deviceAuth.action.clickToCopy": "Клацніть для копіювання", + "deviceAuth.status.waiting": "Очікування авторизації...", + "deviceAuth.status.success": "Вхід виконано успішно!", + "deviceAuth.status.failed": "Вхід не вдався", + "deviceAuth.status.cancelled": "Вхід скасовано", + "deviceAuth.action.copyError": "Копіювати помилку", + "deviceAuth.action.showDetails": "Показати деталі", + "deviceAuth.action.tryAgain": "Спробувати ще раз", + "deviceAuth.error.detailsTitle": "Деталі помилки входу", + + "common.retry": "Спробувати ще раз", + "common.refresh": "Оновити", + + "profile.title": "Профіль", + "profile.notLoggedIn": "Не увійшов", + "profile.action.login": "Увійти через Kilo Code", + "profile.balance.title": "Баланс", + "profile.balance.refresh": "Оновити баланс", + "profile.action.dashboard": "Панель керування", + "profile.action.logout": "Вийти", + + "settings.section.configuration": "Конфігурація", + "settings.agentBehaviour.title": "Поведінка агента", + "settings.autoApprove.title": "Автоматичне схвалення", + "settings.browser.title": "Браузер", + "settings.checkpoints.title": "Контрольні точки", + "settings.display.title": "Відображення", + "settings.autocomplete.title": "Автодоповнення", + "settings.notifications.title": "Сповіщення", + "settings.context.title": "Контекст", + + "settings.experimental.title": "Експериментальне", + "settings.language.title": "Мова", + "settings.aboutKiloCode.title": "Про Kilo Code", + + "session.messages.empty": "Напишіть повідомлення нижче, щоб розпочати чат.", + "session.messages.welcome": + "Kilo Code — це асистент з кодування на базі ШІ. Попросіть його розробити функцію, виправити помилку або пояснити вашу кодову базу.", + "session.messages.scrollToBottom": "Прокрутити до низу", + "session.status.writingResponse": "Пишу відповідь...", + "session.status.retry": "Повторна спроба…", + "session.status.retrying": "Повторна спроба (спроба {{ attempt }})… {{ message }}", + "session.status.working": "Працює...", + + "dialog.model.noProviders": "Немає провайдерів", + + "prompt.placeholder.connecting": "Підключення до сервера...", + "prompt.placeholder.default": "Напишіть повідомлення... (Enter для надсилання, Shift+Enter для нового рядка)", + "prompt.placeholder.error": "Підключення не вдалося. Перевірте панель виводу або перезапустіть розширення.", + + "context.usage.sessionCost": "Вартість сесії", + "context.stats.thisSession": "Ця сесія", + + "time.justNow": "щойно", + "time.minutesAgo": "{{count}} хв тому", + "time.hoursAgo": "{{count}} г тому", + "time.daysAgo": "{{count}} д тому", + "time.monthsAgo": "{{count}} міс тому", + "time.today": "Сьогодні", + "time.yesterday": "Вчора", + "time.thisWeek": "Цього тижня", + "time.thisMonth": "Цього місяця", + "time.older": "Раніше", + + "settings.aboutKiloCode.status.connected": "Підключено", + "settings.aboutKiloCode.status.connecting": "Підключення...", + "settings.aboutKiloCode.status.disconnected": "Відключено", + "settings.aboutKiloCode.status.error": "Помилка", + "settings.aboutKiloCode.cliServer": "CLI-сервер", + "settings.aboutKiloCode.status.label": "Статус:", + "settings.aboutKiloCode.port.label": "Порт:", + "settings.aboutKiloCode.versionInfo": "Інформація про версію", + "settings.aboutKiloCode.version.label": "Версія:", + "settings.aboutKiloCode.extensionName": "Розширення Kilo Code", + "settings.aboutKiloCode.community": "Спільнота і підтримка", + "settings.aboutKiloCode.feedback.prefix": "Якщо у вас є питання або відгуки, будь ласка, відкрийте тікет на:", + "settings.aboutKiloCode.feedback.or": "або", + "settings.aboutKiloCode.support.prefix": "З питань виставлення рахунків або акаунту зверніться до служби підтримки:", + "settings.aboutKiloCode.resetSettings.title": "Скидання налаштувань", + "settings.aboutKiloCode.resetSettings.description": + "Це скине лише налаштування, специфічні для розширення VS Code, до стандартних значень. Налаштування, що зберігаються в конфігурації CLI (такі як режими та правила автоматичного схвалення), не будуть скинуті.", + "settings.aboutKiloCode.resetSettings.button": "Скинути всі налаштування", + "settings.aboutKiloCode.settingsTransfer.title": "Перенесення налаштувань", + "settings.aboutKiloCode.settingsTransfer.description": + "Експортуйте або імпортуйте налаштування для перенесення між екземплярами VS Code.", + "settings.aboutKiloCode.exportSettings": "Експортувати", + "settings.aboutKiloCode.importSettings": "Імпортувати", + "settings.aboutKiloCode.importSettings.invalidJson": + "Недійсний файл JSON. Будь ласка, виберіть дійсний файл налаштувань.", + "settings.aboutKiloCode.importSettings.invalidConfig": "Файл не містить дійсних налаштувань Kilo.", + "settings.aboutKiloCode.importSettings.tooLarge": "Файл занадто великий. Файли налаштувань мають бути менше 1 МБ.", + "settings.aboutKiloCode.importSettings.newerVersion": + "Цей файл було експортовано з новішої версії Kilo. Деякі налаштування можуть бути проігноровані.", + "settings.aboutKiloCode.importSettings.success": + "Налаштування імпортовано. Перегляньте зміни вище, потім натисніть Зберегти.", + + "settings.agentBehaviour.subtab.modes": "Режими", + "settings.agentBehaviour.subtab.agents": "Агенти", + "settings.agentBehaviour.subtab.mcpServers": "MCP-сервери", + "settings.agentBehaviour.subtab.rules": "Правила", + "settings.agentBehaviour.subtab.workflows": "Робочі процеси", + "settings.agentBehaviour.subtab.skills": "Навички", + + "settings.browser.description": + "Після увімкнення агент ШІ може взаємодіяти з веб-сторінками — навігація, натискання, введення тексту та знімки екрана. Відкриється вікно Chrome, щоб ви могли стежити за роботою агента.", + "settings.browser.enable.title": "Увімкнути автоматизацію браузера", + "settings.browser.enable.description": "Зареєструвати MCP-сервер Playwright з CLI-бекендом.", + "settings.browser.systemChrome.title": "Використовувати системний Chrome", + "settings.browser.systemChrome.description": + "Використовувати встановлений браузер Chrome замість окремого екземпляра Chromium.", + "settings.browser.headless.title": "Безголовий режим", + "settings.browser.headless.description": "Запускати в безголовому режимі (без видимого вікна браузера).", + + "settings.language.description": + '"Автоматично" використовує мову відображення VS Code. Виберіть мову для інтерфейсу Kilo Code.', + "settings.language.auto": "Автоматично (мова VS Code)", + "settings.language.current": "Поточна:", + + "common.add": "Додати", + "common.choose": "Вибрати…", + + "settings.autocomplete.autoTrigger.title": "Увімкнути автоматичні підказки", + "settings.autocomplete.autoTrigger.description": "Автоматично показувати підказки під час введення", + "settings.autocomplete.smartKeybinding.title": "Увімкнути розумне прив'язування клавіш", + "settings.autocomplete.smartKeybinding.description": + "Використовувати розумне прив'язування клавіш для активації підказок", + "settings.autocomplete.chatAutocomplete.title": "Увімкнути автодоповнення в полі чату", + "settings.autocomplete.chatAutocomplete.description": "Показувати підказки автодоповнення в полі введення чату", + + "settings.notifications.agent.title": "Завершення агента", + "settings.notifications.agent.description": "Показувати сповіщення, коли агент завершить завдання", + "settings.notifications.permissions.title": "Запити дозволів", + "settings.notifications.permissions.description": "Показувати сповіщення при запитах дозволів", + "settings.notifications.errors.title": "Помилки", + "settings.notifications.errors.description": "Показувати сповіщення при виникненні помилок", + "settings.notifications.sounds": "Звуки", + "settings.notifications.agentSound.title": "Звук завершення агента", + "settings.notifications.agentSound.description": "Звук, що відтворюється після завершення агента", + "settings.notifications.permSound.title": "Звук запиту дозволу", + "settings.notifications.permSound.description": "Звук, що відтворюється при запитах дозволів", + "settings.notifications.errorSound.title": "Звук помилки", + "settings.notifications.errorSound.description": "Звук, що відтворюється при виникненні помилок", + "settings.notifications.sound.default": "За замовчуванням", + "settings.notifications.sound.none": "Немає", + + "settings.experimental.share.title": "Режим публікації", + "settings.experimental.share.description": "Як поводиться публікація сесій", + "settings.experimental.share.manual": "Вручну", + "settings.experimental.share.auto": "Автоматично", + "settings.experimental.share.disabled": "Вимкнено", + "settings.experimental.formatter.title": "Форматер", + "settings.experimental.formatter.description": "Увімкнути автоматичне форматування коду", + "settings.experimental.lsp.title": "LSP", + "settings.experimental.lsp.description": "Увімкнути інтеграцію з мовним сервером", + "settings.experimental.pasteSummary.title": "Вимкнути підсумовування вставки", + "settings.experimental.pasteSummary.description": "Підсумовувати великий вставлений вміст", + "settings.experimental.batch.title": "Пакетний інструмент", + "settings.experimental.batch.description": "Увімкнути пакетну обробку кількох викликів інструментів", + "settings.experimental.codebaseSearch.title": "Пошук по кодовій базі", + "settings.experimental.codebaseSearch.description": + "Увімкнути пошук природною мовою на основі ШІ по всій кодовій базі", + "settings.experimental.continueOnDeny.title": "Продовжувати при відхиленні", + "settings.experimental.continueOnDeny.description": "Продовжувати цикл агента, коли дозвіл відхилено", + "settings.experimental.mcpTimeout.title": "Тайм-аут MCP (мс)", + "settings.experimental.mcpTimeout.description": "Тайм-аут у мілісекундах для запитів до MCP-сервера", + "settings.experimental.toolToggles": "Перемикачі інструментів", + + "settings.agentBehaviour.defaultAgent.title": "Агент за замовчуванням", + "settings.agentBehaviour.defaultAgent.description": "Агент, що використовується, якщо не вказано інший", + "settings.agentBehaviour.availableAgents": "Доступні агенти", + "settings.agentBehaviour.selectAgent": "Виберіть агента для налаштування…", + "settings.agentBehaviour.selectAgent.title": "Агент", + "settings.agentBehaviour.selectAgent.description": "Виберіть агента для налаштування…", + "settings.agentBehaviour.modelOverride.title": "Перевизначення моделі", + "settings.agentBehaviour.modelOverride.description": "Перевизначити стандартну модель для цього агента", + "settings.agentBehaviour.prompt.title": "Власний запит", + "settings.agentBehaviour.prompt.description": "Додатковий системний запит для цього агента", + "settings.agentBehaviour.temperature.title": "Температура", + "settings.agentBehaviour.temperature.description": "Температура вибірки (0-2)", + "settings.agentBehaviour.topP.title": "Top P", + "settings.agentBehaviour.topP.description": "Параметр nucleus sampling (0-1)", + "settings.agentBehaviour.maxSteps.title": "Максимальна кількість кроків", + "settings.agentBehaviour.maxSteps.description": "Максимальна кількість ітерацій агента", + "settings.agentBehaviour.hidden.title": "Прихований", + "settings.agentBehaviour.hidden.description": "Приховати цього агента з перемикача режимів у полі введення чату", + "settings.agentBehaviour.disable.title": "Вимкнений", + "settings.agentBehaviour.disable.description": "Повністю вимкнути цього агента — він ніде не відображатиметься", + "settings.agentBehaviour.badge.hidden": "прихований", + "settings.agentBehaviour.badge.disabled": "вимкнений", + "settings.agentBehaviour.badge.deprecated": "Застарілий", + "settings.agentBehaviour.discoveredSkills": "Виявлені навички", + "settings.agentBehaviour.noSkillsFound": + "Навичок не виявлено. Додайте шляхи до папок навичок або URL нижче, щоб зробити їх доступними.", + "settings.agentBehaviour.availableModes": "Доступні власні режими", + "settings.agentBehaviour.noModesFound": "Режимів не знайдено.", + "settings.agentBehaviour.importMode": "Імпортувати", + "settings.agentBehaviour.importMode.invalidName": + "Назва режиму у файлі недійсна. Назва має починатися з малої літери і містити лише малі літери, цифри та дефіси.", + "settings.agentBehaviour.importMode.nameTaken": "Режим з такою назвою вже існує.", + "settings.agentBehaviour.importMode.invalidJson": + "Недійсний файл JSON. Будь ласка, виберіть дійсний файл визначення агента.", + "settings.agentBehaviour.importMode.tooLarge": "Файл занадто великий. Визначення агентів мають бути менше 1 МБ.", + "settings.agentBehaviour.exportMode": "Експортувати визначення агента", + "settings.agentBehaviour.removeMode.title": "Видалити режим", + "settings.agentBehaviour.removeMode.confirm": + 'Видалити режим "{{name}}"? Це оновить вашу конфігурацію, щоб вимкнути режим.', + "settings.agentBehaviour.removeMode.button": "Видалити", + "settings.agentBehaviour.skillPaths": "Шляхи до папок навичок", + "settings.agentBehaviour.skillUrls": "URL навичок", + "settings.agentBehaviour.removeSkill.title": "Видалити навичку", + "settings.agentBehaviour.removeSkill.confirm": 'Видалити навичку "{{name}}"? Це видалить файли навичок з диска.', + "settings.agentBehaviour.removeSkill.button": "Видалити", + "settings.agentBehaviour.rules.description": + "Правила — це файли інструкцій, що спрямовують поведінку агента. Вони включаються до системного запиту для кожної розмови. Додайте шляхи до файлів нижче для додаткових правил.", + "settings.agentBehaviour.instructionFiles": "Додаткові файли інструкцій", + "settings.agentBehaviour.instructionFiles.description": + "Шляхи до додаткових файлів інструкцій, що включаються до системного запиту", + "settings.agentBehaviour.removeMcp.title": "Видалити MCP-сервер", + "settings.agentBehaviour.removeMcp.confirm": 'Видалити MCP-сервер "{{name}}"? Це видалить його з вашої конфігурації.', + "settings.agentBehaviour.removeMcp.button": "Видалити", + "settings.agentBehaviour.mcpDetail.command": "Команда", + "settings.agentBehaviour.mcpDetail.args": "Аргументи", + "settings.agentBehaviour.mcpDetail.env": "Середовище", + "settings.agentBehaviour.mcpDetail.disabled": "Цей сервер вимкнено.", + "settings.agentBehaviour.editMcp": "Редагувати MCP-сервер", + "settings.agentBehaviour.editMcp.transportLocal": "Локальний сервер (stdio транспорт)", + "settings.agentBehaviour.editMcp.transportRemote": "Віддалений сервер (SSE/HTTP транспорт)", + "settings.agentBehaviour.editMcp.env": "Змінні середовища", + "settings.agentBehaviour.editMcp.env.help": "Змінні, що передаються процесу MCP-сервера.", + "settings.agentBehaviour.addMcp.command": "Команда", + "settings.agentBehaviour.addMcp.command.placeholder": "напр. npx", + "settings.agentBehaviour.addMcp.args": "Аргументи", + "settings.agentBehaviour.addMcp.args.help": "Один аргумент на рядок. Шляхи з пробілами зберігаються як є.", + "settings.agentBehaviour.addMcp.args.placeholder": "напр.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "URL сервера", + "settings.agentBehaviour.addMcp.url.placeholder": "напр. http://localhost:3000/sse", + "settings.agentBehaviour.mcpBrowseMarketplace": "Переглянути Marketplace", + "settings.agentBehaviour.mcpEmpty": + "MCP-серверів не налаштовано. Додайте MCP-сервери до kilo.jsonc або попросіть агента додати їх.", + "settings.agentBehaviour.workflowsPlaceholder": + "Робочими процесами керують файли робочих процесів у вашому робочому просторі.", + "settings.agentBehaviour.workflows.description": + "Робочі процеси — це власні команди з косою рискою, визначені у вашій конфігурації. Введіть /назва-команди в чаті, щоб викликати їх. Команди налаштовуються в розділі 'command' файлу opencode.json.", + "settings.agentBehaviour.workflows.empty": + "Власних команд не налаштовано. Додайте команди до opencode.json, щоб вони з'явилися тут.", + "settings.agentBehaviour.workflows.detail.description": "Опис", + "settings.agentBehaviour.workflows.detail.template": "Шаблон", + + "settings.autoApprove.description": + "Визначте, як виконуються інструменти. Більшість інструментів за замовчуванням — Дозволити. doom_loop та external_directory за замовчуванням — Запитувати.", + "settings.autoApprove.level.allow": "Дозволити", + "settings.autoApprove.level.ask": "Запитувати", + "settings.autoApprove.level.deny": "Відхилити", + "settings.autoApprove.wildcardLabel.commands": "Усі команди (*)", + "settings.autoApprove.wildcardLabel.paths": "Усі шляхи (*)", + "settings.autoApprove.exceptions": "Винятки", + "settings.autoApprove.addCommand": "Додати команду", + "settings.autoApprove.addPath": "Додати шлях", + "settings.autoApprove.placeholder.command": "напр. git *", + "settings.autoApprove.placeholder.path": "напр. *.env", + "settings.autoApprove.tool.external_directory": + "Доступ до файлів поза робочим простором. Спрацьовує при зверненні до файлів поза поточною директорією проєкту.", + "settings.autoApprove.tool.bash": + "Виконувати команди терміналу. Дозволяє виконання команд оболонки (напр. git status).", + "settings.autoApprove.tool.read": "Читати файли. Дозволяє агенту читати файли, що відповідають вказаному шляху.", + "settings.autoApprove.tool.edit": + "Змінювати файли. Дозволяє агенту створювати або редагувати файли, включаючи патчі та оновлення кількох файлів.", + "settings.autoApprove.tool.glob": + "Зіставляти файли за шаблоном. Дозволяє зіставлення файлів за glob-шаблонами (напр. src/**/*.ts).", + "settings.autoApprove.tool.grep": "Шукати вміст файлів. Дозволяє пошук за регулярними виразами у файлах.", + "settings.autoApprove.tool.list": "Перелічити вміст директорії. Дозволяє переглядати файли і папки в директорії.", + "settings.autoApprove.tool.task": + "Запускати підагентів. Дозволяє запуск спеціалізованих підагентів для конкретних завдань.", + "settings.autoApprove.tool.skill": + "Завантажувати навички. Дозволяє завантаження попередньо визначених навичок за назвою.", + "settings.autoApprove.tool.lsp": "Запитувати мовний сервер. Дозволяє запити до мовного сервера для аналізу коду.", + "settings.autoApprove.tool.todoreadwrite": + "Керувати списком завдань. Дозволяє читання та оновлення внутрішнього списку завдань.", + "settings.autoApprove.tool.webfetch": "Отримати URL. Дозволяє отримання вмісту з вказаного URL.", + "settings.autoApprove.tool.websearchcodesearch": + "Шукати в мережі або коді. Дозволяє зовнішній веб-пошук або пошук коду.", + "settings.autoApprove.tool.doom_loop": + "Запобігати повторюваним діям. Спрацьовує, коли той самий виклик інструменту повторюється з однаковими вхідними даними.", + + "settings.checkpoints.enable.title": "Увімкнути знімки", + "settings.checkpoints.enable.description": + "Створювати контрольні точки перед редагуванням файлів, щоб мати можливість відновити попередні стани", + + "settings.context.autoCompaction.title": "Автоматичне стиснення", + "settings.context.autoCompaction.description": "Автоматично стискати при заповненні контексту", + "settings.context.prune.title": "Очищати старі виводи", + "settings.context.prune.description": "Видаляти старі виводи інструментів під час стиснення", + "settings.context.watcherPatterns": "Шаблони ігнорування спостерігача файлів", + "settings.context.watcherPatterns.description": "Glob-шаблони для файлів, які спостерігач має ігнорувати", + + "settings.display.username.title": "Ім'я користувача", + "settings.display.username.description": "Власне ім'я користувача, що відображається в чатах", + "settings.display.layout.title": "Макет", + "settings.display.layout.description": "Режим макету для інтерфейсу чату", + "settings.display.layout.auto": "Автоматично", + "settings.display.layout.stretch": "Розтягнути", + + "settings.providers.defaultModel.title": "Модель за замовчуванням", + "settings.providers.defaultModel.description": "Основна модель для чатів", + "settings.providers.smallModel.title": "Мала модель", + "settings.providers.smallModel.description": + "Легка модель для генерації заголовків, повідомлень комітів, покращення запитів та інших швидких завдань", + "settings.providers.modeModels": "Модель для кожного режиму", + "settings.providers.modeModels.description": + "Перевизначити стандартну модель для певних режимів. Якщо не встановлено, використовується загальна стандартна модель.", + "settings.providers.disabled": "Вимкнені провайдери", + "settings.providers.disabled.description": "Провайдери, що будуть приховані у списку провайдерів", + "settings.providers.enabled": "Увімкнені провайдери (список дозволених)", + "settings.providers.enabled.description": "Якщо встановлено, доступні лише ці провайдери (власний список дозволених)", + "settings.providers.notSet": "Не встановлено (використовувати стандартний сервера)", + "settings.providers.custom.note": "Додати OpenAI-сумісного провайдера через базовий URL.", + "settings.providers.search.placeholder": "Пошук провайдера", + "settings.providers.select.placeholder": "Вибрати провайдера...", + + "dialog.model.notSet": "Не встановлено", + + "profile.personalAccount": "Особистий акаунт", + + // Agent Manager strings live in webview-ui/agent-manager/i18n/uk.ts + + "question.summary": "{{n}} з {{total}} питань", + "common.review": "Переглянути", + + // legacy-migration start + "settings.legacyMigration.link": "Перенести зі старої версії", + "settings.aboutKiloCode.legacyMigration.title": "Перенесення зі старої версії", + "settings.aboutKiloCode.legacyMigration.description": + "Перенести налаштування з попередньої версії Kilo Code, включаючи API-ключі провайдерів та стандартну модель.", + + // Screen 1 — What's New + "migration.whatsNew.title": "Що нового в Kilo Code", + "migration.whatsNew.badge": "Бета", + "migration.whatsNew.subtitle": "Ми відбудували розширення на більш швидкій та ефективній основі.", + "migration.whatsNew.features.performance.title": "Швидша продуктивність агента", + "migration.whatsNew.features.performance.detail": + "Паралельні виклики інструментів і підагенти дозволяють агенту робити більше одночасно — щоб ви більше створювали, а менше спостерігали.", + "migration.whatsNew.features.interface.title": "Спрощений інтерфейс", + "migration.whatsNew.features.interface.detail": "Менше відволікань, легше і швидше читати.", + "migration.whatsNew.features.agentManager.title": "Agent Manager", + "migration.whatsNew.features.agentManager.detail": + "Єдиний інтерфейс для запуску кількох агентів паралельно, кожен у власному робочому дереві — стежте за прогресом, перемикайте контекст і переглядайте зміни з одного місця.", + "migration.whatsNew.features.foundation.title": "Спільна основа", + "migration.whatsNew.features.foundation.detail": + "Малий та ефективний ядерний модуль у кожному продукті Kilo. Знайомий досвід незалежно від того, як ви вважаєте за краще працювати.", + "migration.whatsNew.blogLink": "Читати повне оголошення", + "migration.whatsNew.continue": "Продовжити", + + // Screen 2 — Migrate Settings + "migration.migrate.title": "Перенесіть свої налаштування", + "migration.migrate.subtitle": "Ми знайшли налаштування з попередньої версії. Ось що можна перенести.", + "migration.migrate.selectLabel": "Вибрати для перенесення", + "migration.migrate.cannotMigrate": "Неможливо перенести", + "migration.migrate.chatHistory": "Сесії чату та історія", + "migration.migrate.chatHistoryDesc": "Несумісно з новою архітектурою", + "migration.migrate.button": "Перенести налаштування", + "migration.migrate.skip": "Пропустити", + "migration.migrate.keysDetected": "Виявлено {{count}} ключів", + "migration.migrate.serversConfigured": "Налаштовано {{count}} серверів", + "migration.migrate.modesFound": "Знайдено {{count}} режимів", + "migration.migrate.nothingToMigrate": "У старих налаштуваннях нічого для перенесення не знайдено.", + + // Migrate — item labels + "migration.select.providers": "API-ключі провайдерів", + "migration.select.mcpServers": "MCP-сервери", + "migration.select.customModes": "Власні режими / агенти", + "migration.select.defaultModel": "Стандартна модель", + "migration.select.autoApproval": "Автоматичне схвалення", + "migration.select.language": "Мова інтерфейсу", + "migration.select.autocomplete": "Налаштування автодоповнення", + + // Migrate — completion + "migration.complete.summary": "{{success}} з {{total}} елементів успішно перенесено.", + "migration.complete.cleanup": "Видалити старі дані налаштувань", + "migration.complete.cleanupDescription": + "Це видалить старі налаштування зі сховища VS Code. Ви не зможете повторно запустити це перенесення.", + "migration.complete.done": "Готово", + "migration.migrate.sessionsDetected": "Знайдено {{count}} сесій", + "migration.error.sessionFailed": "Перенесення сесії не вдалося", + "migration.error.continue": "Продовжити", + "migration.error.action.copy": "Копіювати", + "migration.error.toast.copied": "Помилку скопійовано до буфера обміну", + // legacy-migration end + + "error.details.show": "Деталі", + + "task.todos.progress": "{{done}} з {{total}} завдань виконано", + "task.todos.allDone": "{{count}} завдань виконано", + + "settings.saveBar.unsavedChanges": "Незбережені зміни", + "settings.saveBar.discard": "Скасувати", + "settings.saveBar.save": "Зберегти", + "settings.saveBar.warning.one": "Одна сесія виконується і буде перервана", + "settings.saveBar.warning.many": "Кілька сесій виконуються і будуть перервані", + "settings.saveBar.saveAnyway": "Зберегти все одно", + "settings.saveBar.cancel": "Скасувати", + "notifications.action.next": "Далі", + "notifications.action.close": "Закрити", + "notifications.action.tryModel": "Спробувати {{model}}", +} diff --git a/packages/kilo-vscode/webview-ui/src/i18n/zh.ts b/packages/kilo-vscode/webview-ui/src/i18n/zh.ts index a9a95d68151..4fe633f6356 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/zh.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/zh.ts @@ -267,6 +267,7 @@ export const dict = { "mcp.status.connected": "已连接", "mcp.status.failed": "失败", "mcp.status.needs_auth": "需要授权", + "mcp.status.needs_registration": "需要客户端注册", "mcp.status.disabled": "已禁用", "dialog.fork.empty": "没有可用于分叉的消息", @@ -740,6 +741,20 @@ export const dict = { "provider.custom.models.name.placeholder": "显示名称", "provider.custom.models.remove": "移除模型", "provider.custom.models.add": "添加模型", + "provider.custom.models.fetch": "获取模型", + "provider.custom.models.fetching": "获取中\u2026", + "provider.custom.models.fetch.error": "获取模型失败:{{error}}", + "provider.custom.models.fetch.authError": "认证失败。请检查上方的 API 密钥后重试。", + "provider.custom.models.fetch.empty": "此服务器上未找到模型。", + "provider.custom.models.fetch.added": "已添加 {{count}} 个模型。", + "provider.custom.models.fetch.allExist": "获取的所有模型均已添加。", + "provider.custom.models.fetch.selectAll": "全选", + "provider.custom.models.fetch.deselectAll": "取消全选", + "provider.custom.models.fetch.found": "找到 {{count}} 个模型", + "provider.custom.models.fetch.showing": "显示 {{shown}}/{{total}}", + "provider.custom.models.fetch.search": "搜索模型\u2026", + "provider.custom.models.fetch.add": "添加 {{count}} 个模型", + "provider.custom.edit.title": "编辑提供商", "provider.custom.headers.label": "请求头(可选)", "provider.custom.headers.key.label": "请求头", "provider.custom.headers.key.placeholder": "Header-Name", @@ -897,8 +912,7 @@ export const dict = { "settings.autocomplete.title": "自动补全", "settings.notifications.title": "通知", "settings.context.title": "上下文", - "settings.terminal.title": "终端", - "settings.prompts.title": "提示词", + "settings.experimental.title": "实验性功能", "settings.language.title": "语言", "settings.aboutKiloCode.title": "关于 Kilo Code", @@ -918,6 +932,7 @@ export const dict = { "prompt.placeholder.default": "输入消息... (Enter 发送,Shift+Enter 换行)", "context.usage.sessionCost": "会话费用", + "context.stats.thisSession": "此会话", "time.justNow": "刚刚", "time.minutesAgo": "{{count}} 分钟前", @@ -946,8 +961,17 @@ export const dict = { "settings.aboutKiloCode.support.prefix": "如有账单或账户问题,请联系客户支持", "settings.aboutKiloCode.resetSettings.title": "重置设置", "settings.aboutKiloCode.resetSettings.description": - "将所有 Kilo Code 扩展设置重置为默认值。这不会影响 CLI 或后端配置。", + "此操作仅将 VS Code 扩展专属设置重置为默认值。与 CLI 共享的设置(如模式和自动审批规则)存储在 CLI 配置中,不会被重置。", "settings.aboutKiloCode.resetSettings.button": "重置所有设置", + "settings.aboutKiloCode.settingsTransfer.title": "设置迁移", + "settings.aboutKiloCode.settingsTransfer.description": "导出或导入设置,以便在 VS Code 实例之间传输。", + "settings.aboutKiloCode.exportSettings": "导出", + "settings.aboutKiloCode.importSettings": "导入", + "settings.aboutKiloCode.importSettings.invalidJson": "无效的 JSON 文件。请选择有效的设置文件。", + "settings.aboutKiloCode.importSettings.invalidConfig": "文件不包含有效的 Kilo 设置。", + "settings.aboutKiloCode.importSettings.tooLarge": "文件过大。设置文件必须小于 1 MB。", + "settings.aboutKiloCode.importSettings.newerVersion": "此文件由较新版本的 Kilo 导出。部分设置可能会被忽略。", + "settings.aboutKiloCode.importSettings.success": "设置已导入。请查看上方的更改,然后点击保存。", "settings.agentBehaviour.subtab.modes": "模式", "settings.agentBehaviour.subtab.agents": "Agents", @@ -971,9 +995,7 @@ export const dict = { "common.add": "添加", "common.choose": "选择…", - "settings.notImplemented": "此部分尚未实现。", - "settings.notImplemented.description": - "此处将包含与所选设置类别相关的配置选项和说明文字。在重新实现期间,可使用此空间验证布局、间距、滚动行为和导航状态,然后再接入实际控件。", + "settings.autocomplete.autoTrigger.title": "启用自动内联补全", "settings.autocomplete.autoTrigger.description": "在您输入时自动显示内联补全建议", "settings.autocomplete.smartKeybinding.title": "启用智能内联任务快捷键", @@ -1031,6 +1053,13 @@ export const dict = { "settings.agentBehaviour.topP.description": "核采样参数(0-1)", "settings.agentBehaviour.maxSteps.title": "最大步数", "settings.agentBehaviour.maxSteps.description": "最大智能体迭代次数", + "settings.agentBehaviour.hidden.title": "隐藏", + "settings.agentBehaviour.hidden.description": "在聊天输入的模式切换器中隐藏此智能体", + "settings.agentBehaviour.disable.title": "已禁用", + "settings.agentBehaviour.disable.description": "完全禁用此智能体 — 它将不会出现在任何地方", + "settings.agentBehaviour.badge.hidden": "隐藏", + "settings.agentBehaviour.badge.disabled": "已禁用", + "settings.agentBehaviour.badge.deprecated": "弃用", "settings.agentBehaviour.discoveredSkills": "已发现的技能", "settings.agentBehaviour.noSkillsFound": "未发现任何技能。请在下方添加技能文件夹路径或 URL 以使技能可用。", "settings.agentBehaviour.availableModes": "可用自定义模式", @@ -1050,12 +1079,19 @@ export const dict = { "settings.agentBehaviour.createMode.nameRequired": "名称为必填项", "settings.agentBehaviour.createMode.nameInvalid": "名称只能包含小写字母、数字和连字符", "settings.agentBehaviour.createMode.nameTaken": "此名称的模式已存在", + "settings.agentBehaviour.importMode": "导入", + "settings.agentBehaviour.importMode.invalidName": + "文件中的模式名称无效。名称必须以小写字母开头,且仅包含小写字母、数字和连字符。", + "settings.agentBehaviour.importMode.nameTaken": "此名称的模式已存在。", + "settings.agentBehaviour.importMode.invalidJson": "无效的 JSON 文件。请选择有效的代理定义文件。", + "settings.agentBehaviour.importMode.tooLarge": "文件太大。代理定义必须小于 1 MB。", + "settings.agentBehaviour.exportMode": "导出代理定义", "settings.agentBehaviour.editMode": "编辑模式", "settings.agentBehaviour.editMode.description": "描述", "settings.agentBehaviour.editMode.prompt": "系统提示", "settings.agentBehaviour.editMode.save": "完成", "settings.agentBehaviour.editMode.back": "返回列表", - "settings.agentBehaviour.editMode.native": "内置模式(只读定义)", + "settings.agentBehaviour.editMode.native": "这是一个内置模式。它的基础定义无法更改,但您可以在下方配置覆盖项。", "settings.agentBehaviour.editMode.promptOverride": "此内置模式的自定义提示覆盖", "settings.agentBehaviour.removeMode.title": "移除模式", "settings.agentBehaviour.removeMode.confirm": '移除模式 "{{name}}" 吗?这将通过更新配置来禁用该模式。', @@ -1063,6 +1099,18 @@ export const dict = { "settings.agentBehaviour.removeMcp.title": "移除 MCP 服务器", "settings.agentBehaviour.removeMcp.confirm": '移除 MCP 服务器 "{{name}}" 吗?这将从您的配置中移除它。', "settings.agentBehaviour.removeMcp.button": "移除", + "settings.agentBehaviour.editMcp": "编辑 MCP 服务器", + "settings.agentBehaviour.editMcp.transportLocal": "本地服务器(stdio 传输)", + "settings.agentBehaviour.editMcp.transportRemote": "远程服务器(SSE/HTTP 传输)", + "settings.agentBehaviour.editMcp.env": "环境变量", + "settings.agentBehaviour.editMcp.env.help": "传递给 MCP 服务器进程的变量。", + "settings.agentBehaviour.addMcp.command": "命令", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "参数", + "settings.agentBehaviour.addMcp.args.help": "每行一个参数。包含空格的路径将按原样保留。", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "服务器 URL", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", "settings.agentBehaviour.skillPaths": "技能文件夹路径", "settings.agentBehaviour.skillUrls": "技能 URL", "settings.agentBehaviour.removeSkill.title": "移除技能", @@ -1076,14 +1124,15 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "参数", "settings.agentBehaviour.mcpDetail.env": "环境", "settings.agentBehaviour.mcpDetail.disabled": "此服务器已禁用。", - "settings.agentBehaviour.mcpEmpty": "未配置 MCP 服务器。编辑 opencode 配置文件以添加 MCP 服务器。", + "settings.agentBehaviour.mcpBrowseMarketplace": "浏览市场", + "settings.agentBehaviour.mcpEmpty": "未配置 MCP 服务器。在 kilo.jsonc 中添加 MCP 服务器,或让代理为您添加。", "settings.agentBehaviour.workflowsPlaceholder": "工作流通过工作区中的工作流文件管理。", "settings.agentBehaviour.workflows.description": "工作流是在配置中定义的自定义斜杠命令。在聊天中输入 /command-name 来调用它们。命令在 opencode.json 的 'command' 部分中配置。", "settings.agentBehaviour.workflows.empty": "未配置自定义命令。将命令添加到 opencode.json 即可在此处看到。", "settings.agentBehaviour.workflows.detail.description": "描述", "settings.agentBehaviour.workflows.detail.template": "模板", - "settings.agentBehaviour.notImplemented": "尚未实现。", + "settings.autoApprove.description": "定义工具的运行权限。大多数工具默认为「允许」。doom_loop 和 external_directory 默认为「询问」。", "settings.autoApprove.level.allow": "允许", @@ -1127,7 +1176,7 @@ export const dict = { "settings.providers.defaultModel.title": "默认模型", "settings.providers.defaultModel.description": "对话的主要模型", "settings.providers.smallModel.title": "小模型", - "settings.providers.smallModel.description": "用于标题生成和其他快速任务的轻量模型", + "settings.providers.smallModel.description": "用于标题生成、提交信息生成、提示词增强和其他快速任务的轻量模型", "settings.providers.disabled": "已禁用的提供者", "settings.providers.disabled.description": "从提供者列表中隐藏的提供者", "settings.providers.enabled": "已启用的提供者(白名单)", @@ -1149,7 +1198,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "Kilo Code 新功能", - "migration.whatsNew.badge": "Beta", "migration.whatsNew.subtitle": "我们在更快、更高效的基础上重新构建了扩展。", "migration.whatsNew.features.performance.title": "更快的智能体性能", "migration.whatsNew.features.performance.detail": @@ -1174,7 +1222,6 @@ export const dict = { "migration.migrate.chatHistoryDesc": "与新架构不兼容", "migration.migrate.button": "迁移设置", "migration.migrate.skip": "跳过", - "migration.migrate.back": "返回", "migration.migrate.keysDetected": "检测到 {{count}} 个密钥", "migration.migrate.serversConfigured": "已配置 {{count}} 个服务器", "migration.migrate.modesFound": "发现 {{count}} 个模式", @@ -1194,6 +1241,11 @@ export const dict = { "migration.complete.cleanup": "清除旧版设置数据", "migration.complete.cleanupDescription": "此操作将从 VS Code 存储中删除旧版设置。您将无法再次运行此迁移。", "migration.complete.done": "完成", + "migration.migrate.sessionsDetected": "检测到 {{count}} 个会话", + "migration.error.sessionFailed": "会话迁移失败", + "migration.error.continue": "继续", + "migration.error.action.copy": "复制", + "migration.error.toast.copied": "错误已复制到剪贴板", // legacy-migration end "error.details.show": "详细信息", @@ -1207,8 +1259,7 @@ export const dict = { "settings.saveBar.warning.many": "多个会话正在运行,将被中断", "settings.saveBar.saveAnyway": "仍然保存", "settings.saveBar.cancel": "取消", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "下一个", + "notifications.action.close": "关闭", + "notifications.action.tryModel": "尝试 {{model}}", } satisfies Partial> diff --git a/packages/kilo-vscode/webview-ui/src/i18n/zht.ts b/packages/kilo-vscode/webview-ui/src/i18n/zht.ts index afcda94a457..a9dba37eebf 100644 --- a/packages/kilo-vscode/webview-ui/src/i18n/zht.ts +++ b/packages/kilo-vscode/webview-ui/src/i18n/zht.ts @@ -267,6 +267,7 @@ export const dict = { "mcp.status.connected": "已連線", "mcp.status.failed": "失敗", "mcp.status.needs_auth": "需要授權", + "mcp.status.needs_registration": "需要客戶端註冊", "mcp.status.disabled": "已停用", "dialog.fork.empty": "沒有可用於分支的訊息", @@ -742,6 +743,20 @@ export const dict = { "provider.custom.models.name.placeholder": "顯示名稱", "provider.custom.models.remove": "移除模型", "provider.custom.models.add": "新增模型", + "provider.custom.models.fetch": "取得模型", + "provider.custom.models.fetching": "取得中\u2026", + "provider.custom.models.fetch.error": "取得模型失敗:{{error}}", + "provider.custom.models.fetch.authError": "驗證失敗。請檢查上方的 API 金鑰後重試。", + "provider.custom.models.fetch.empty": "此伺服器上未找到模型。", + "provider.custom.models.fetch.added": "已新增 {{count}} 個模型。", + "provider.custom.models.fetch.allExist": "取得的所有模型均已新增。", + "provider.custom.models.fetch.selectAll": "全選", + "provider.custom.models.fetch.deselectAll": "取消全選", + "provider.custom.models.fetch.found": "找到 {{count}} 個模型", + "provider.custom.models.fetch.showing": "顯示 {{shown}}/{{total}}", + "provider.custom.models.fetch.search": "搜尋模型\u2026", + "provider.custom.models.fetch.add": "新增 {{count}} 個模型", + "provider.custom.edit.title": "編輯供應商", "provider.custom.headers.label": "標頭(選填)", "provider.custom.headers.key.label": "標頭", "provider.custom.headers.key.placeholder": "Header-Name", @@ -899,8 +914,7 @@ export const dict = { "settings.autocomplete.title": "自動完成", "settings.notifications.title": "通知", "settings.context.title": "上下文", - "settings.terminal.title": "終端機", - "settings.prompts.title": "提示", + "settings.experimental.title": "實驗性功能", "settings.language.title": "語言", "settings.aboutKiloCode.title": "關於 Kilo Code", @@ -920,6 +934,7 @@ export const dict = { "prompt.placeholder.default": "輸入訊息... (Enter 送出,Shift+Enter 換行)", "context.usage.sessionCost": "工作階段費用", + "context.stats.thisSession": "此工作階段", "time.justNow": "剛剛", "time.minutesAgo": "{{count}} 分鐘前", @@ -948,8 +963,17 @@ export const dict = { "settings.aboutKiloCode.support.prefix": "如有帳單或帳戶問題,請聯繫客戶支援", "settings.aboutKiloCode.resetSettings.title": "重置設定", "settings.aboutKiloCode.resetSettings.description": - "將所有 Kilo Code 擴充功能設定重置為預設值。這不會影響 CLI 或後端設定。", + "此操作僅將 VS Code 擴充功能專屬設定重置為預設值。與 CLI 共享的設定(例如模式和自動核准規則)儲存在 CLI 設定中,不會被重置。", "settings.aboutKiloCode.resetSettings.button": "重置所有設定", + "settings.aboutKiloCode.settingsTransfer.title": "設定轉移", + "settings.aboutKiloCode.settingsTransfer.description": "匯出或匯入設定,以便在 VS Code 實例之間轉移。", + "settings.aboutKiloCode.exportSettings": "匯出", + "settings.aboutKiloCode.importSettings": "匯入", + "settings.aboutKiloCode.importSettings.invalidJson": "無效的 JSON 檔案。請選擇有效的設定檔。", + "settings.aboutKiloCode.importSettings.invalidConfig": "檔案不包含有效的 Kilo 設定。", + "settings.aboutKiloCode.importSettings.tooLarge": "檔案過大。設定檔必須小於 1 MB。", + "settings.aboutKiloCode.importSettings.newerVersion": "此檔案由較新版本的 Kilo 匯出。部分設定可能會被忽略。", + "settings.aboutKiloCode.importSettings.success": "設定已匯入。請檢視上方的變更,然後點擊儲存。", "settings.agentBehaviour.subtab.modes": "模式", "settings.agentBehaviour.subtab.agents": "Agents", @@ -973,8 +997,7 @@ export const dict = { "common.add": "新增", "common.choose": "選擇…", - "settings.notImplemented": "此部分尚未實作。", - "settings.notImplemented.description": "此處將包含與所選設定類別相關的設定選項和說明文字。", + "settings.autocomplete.autoTrigger.title": "啟用自動內嵌補全", "settings.autocomplete.autoTrigger.description": "在您輸入時自動顯示內嵌補全建議", "settings.autocomplete.smartKeybinding.title": "啟用智慧內嵌任務快捷鍵", @@ -1032,6 +1055,13 @@ export const dict = { "settings.agentBehaviour.topP.description": "核取樣參數(0-1)", "settings.agentBehaviour.maxSteps.title": "最大步數", "settings.agentBehaviour.maxSteps.description": "最大 Agent 迭代次數", + "settings.agentBehaviour.hidden.title": "隱藏", + "settings.agentBehaviour.hidden.description": "在聊天輸入的模式切換器中隱藏此 Agent", + "settings.agentBehaviour.disable.title": "已停用", + "settings.agentBehaviour.disable.description": "完全停用此 Agent — 它將不會出現在任何地方", + "settings.agentBehaviour.badge.hidden": "隱藏", + "settings.agentBehaviour.badge.disabled": "已停用", + "settings.agentBehaviour.badge.deprecated": "棄用", "settings.agentBehaviour.discoveredSkills": "已發現的 Skill", "settings.agentBehaviour.noSkillsFound": "未發現任何 Skill。請在下方新增 Skill 資料夾路徑或 URL 以使 Skill 可用。", "settings.agentBehaviour.availableModes": "可用自訂模式", @@ -1052,12 +1082,19 @@ export const dict = { "settings.agentBehaviour.createMode.nameRequired": "名稱為必填項", "settings.agentBehaviour.createMode.nameInvalid": "名稱只能包含小寫字母、數字和連字號", "settings.agentBehaviour.createMode.nameTaken": "此名稱的模式已存在", + "settings.agentBehaviour.importMode": "匯入", + "settings.agentBehaviour.importMode.invalidName": + "檔案中的模式名稱無效。名稱必須以小寫字母開頭,且僅包含小寫字母、數字和連字號。", + "settings.agentBehaviour.importMode.nameTaken": "此名稱的模式已存在。", + "settings.agentBehaviour.importMode.invalidJson": "無效的 JSON 檔案。請選擇有效的代理定義檔案。", + "settings.agentBehaviour.importMode.tooLarge": "檔案太大。代理定義必須小於 1 MB。", + "settings.agentBehaviour.exportMode": "匯出代理定義", "settings.agentBehaviour.editMode": "編輯模式", "settings.agentBehaviour.editMode.description": "描述", "settings.agentBehaviour.editMode.prompt": "系統提示", "settings.agentBehaviour.editMode.save": "完成", "settings.agentBehaviour.editMode.back": "返回列表", - "settings.agentBehaviour.editMode.native": "內建模式(唯讀定義)", + "settings.agentBehaviour.editMode.native": "這是一個內建模式。它的基礎定義無法更改,但您可以在下方設定覆寫項。", "settings.agentBehaviour.editMode.promptOverride": "此內建模式的自訂提示覆寫", "settings.agentBehaviour.removeMode.title": "移除模式", "settings.agentBehaviour.removeMode.confirm": '要移除模式 "{{name}}" 嗎?這將透過更新設定來停用該模式。', @@ -1065,6 +1102,18 @@ export const dict = { "settings.agentBehaviour.removeMcp.title": "移除 MCP 伺服器", "settings.agentBehaviour.removeMcp.confirm": '要移除 MCP 伺服器 "{{name}}" 嗎?這將從您的設定中移除它。', "settings.agentBehaviour.removeMcp.button": "移除", + "settings.agentBehaviour.editMcp": "編輯 MCP 伺服器", + "settings.agentBehaviour.editMcp.transportLocal": "本機伺服器(stdio 傳輸)", + "settings.agentBehaviour.editMcp.transportRemote": "遠端伺服器(SSE/HTTP 傳輸)", + "settings.agentBehaviour.editMcp.env": "環境變數", + "settings.agentBehaviour.editMcp.env.help": "傳遞給 MCP 伺服器處理程序的變數。", + "settings.agentBehaviour.addMcp.command": "命令", + "settings.agentBehaviour.addMcp.command.placeholder": "e.g. npx", + "settings.agentBehaviour.addMcp.args": "引數", + "settings.agentBehaviour.addMcp.args.help": "每行一個引數。包含空格的路徑將按原樣保留。", + "settings.agentBehaviour.addMcp.args.placeholder": "e.g.\n-y\n@modelcontextprotocol/server-filesystem\n/tmp", + "settings.agentBehaviour.addMcp.url": "伺服器 URL", + "settings.agentBehaviour.addMcp.url.placeholder": "e.g. http://localhost:3000/sse", "settings.agentBehaviour.skillPaths": "Skill 資料夾路徑", "settings.agentBehaviour.skillUrls": "Skill URL", "settings.agentBehaviour.removeSkill.title": "移除技能", @@ -1078,14 +1127,15 @@ export const dict = { "settings.agentBehaviour.mcpDetail.args": "引數", "settings.agentBehaviour.mcpDetail.env": "環境", "settings.agentBehaviour.mcpDetail.disabled": "此伺服器已停用。", - "settings.agentBehaviour.mcpEmpty": "未設定 MCP 伺服器。編輯 opencode 設定檔以新增 MCP 伺服器。", + "settings.agentBehaviour.mcpBrowseMarketplace": "瀏覽市場", + "settings.agentBehaviour.mcpEmpty": "未設定 MCP 伺服器。在 kilo.jsonc 中新增 MCP 伺服器,或請代理為您新增。", "settings.agentBehaviour.workflowsPlaceholder": "工作流程透過工作區中的工作流程檔案管理。", "settings.agentBehaviour.workflows.description": "工作流程是在設定中定義的自訂斜線命令。在聊天中輸入 /command-name 來呼叫它們。命令在 opencode.json 的 'command' 區段中設定。", "settings.agentBehaviour.workflows.empty": "未設定自訂命令。將命令新增至 opencode.json 即可在此處看到。", "settings.agentBehaviour.workflows.detail.description": "描述", "settings.agentBehaviour.workflows.detail.template": "範本", - "settings.agentBehaviour.notImplemented": "尚未實作。", + "settings.autoApprove.description": "定義工具的執行權限。大多數工具預設為允許。doom_loop 與 external_directory 預設為詢問。", "settings.autoApprove.level.allow": "允許", @@ -1129,7 +1179,7 @@ export const dict = { "settings.providers.defaultModel.title": "預設模型", "settings.providers.defaultModel.description": "對話的主要模型", "settings.providers.smallModel.title": "小模型", - "settings.providers.smallModel.description": "用於標題產生和其他快速任務的輕量模型", + "settings.providers.smallModel.description": "用於標題產生、提交訊息產生、提示增強和其他快速任務的輕量模型", "settings.providers.disabled": "已停用的供應商", "settings.providers.disabled.description": "從供應商清單中隱藏的供應商", "settings.providers.enabled": "已啟用的供應商(白名單)", @@ -1151,7 +1201,6 @@ export const dict = { // Screen 1 — What's New "migration.whatsNew.title": "Kilo Code 新功能", - "migration.whatsNew.badge": "Beta", "migration.whatsNew.subtitle": "我們在更快、更高效的基礎上重新建構了擴充功能。", "migration.whatsNew.features.performance.title": "更快的 Agent 效能", "migration.whatsNew.features.performance.detail": @@ -1176,7 +1225,6 @@ export const dict = { "migration.migrate.chatHistoryDesc": "與新架構不相容", "migration.migrate.button": "遷移設定", "migration.migrate.skip": "略過", - "migration.migrate.back": "返回", "migration.migrate.keysDetected": "偵測到 {{count}} 個金鑰", "migration.migrate.serversConfigured": "已設定 {{count}} 個伺服器", "migration.migrate.modesFound": "發現 {{count}} 個模式", @@ -1196,6 +1244,11 @@ export const dict = { "migration.complete.cleanup": "清除舊版設定資料", "migration.complete.cleanupDescription": "此操作將從 VS Code 儲存中刪除舊版設定。您將無法再次執行此遷移。", "migration.complete.done": "完成", + "migration.migrate.sessionsDetected": "偵測到 {{count}} 個工作階段", + "migration.error.sessionFailed": "工作階段遷移失敗", + "migration.error.continue": "繼續", + "migration.error.action.copy": "複製", + "migration.error.toast.copied": "錯誤已複製到剪貼簿", // legacy-migration end "error.details.show": "詳細資訊", @@ -1209,8 +1262,7 @@ export const dict = { "settings.saveBar.warning.many": "多個工作階段正在執行,將被中斷", "settings.saveBar.saveAnyway": "仍然儲存", "settings.saveBar.cancel": "取消", - "notifications.action.previous": "Previous", - "notifications.action.next": "Next", - "notifications.action.close": "Close", - "notifications.action.tryModel": "Try model", + "notifications.action.next": "下一個", + "notifications.action.close": "關閉", + "notifications.action.tryModel": "嘗試 {{model}}", } satisfies Partial> diff --git a/packages/kilo-vscode/webview-ui/src/stories/StoryProviders.tsx b/packages/kilo-vscode/webview-ui/src/stories/StoryProviders.tsx index 414da2a2ac3..c803943eb1f 100644 --- a/packages/kilo-vscode/webview-ui/src/stories/StoryProviders.tsx +++ b/packages/kilo-vscode/webview-ui/src/stories/StoryProviders.tsx @@ -160,7 +160,7 @@ export function mockSessionValue(overrides?: { selectModel: noop, hasModelOverride: () => false, clearModelOverride: noop, - totalCost: () => 0, + costBreakdown: () => [], contextUsage: () => undefined, agents: () => [{ name: "code", description: "Code mode", mode: "primary" as const }], skills: () => [], @@ -176,6 +176,7 @@ export function mockSessionValue(overrides?: { revert: () => undefined, revertedCount: () => 0, summary: () => undefined, + worktreeStats: () => undefined, revertSession: noop, unrevertSession: noop, variantList: () => [], diff --git a/packages/kilo-vscode/webview-ui/src/stories/chat.stories.tsx b/packages/kilo-vscode/webview-ui/src/stories/chat.stories.tsx index 2372b719e4a..93c64ab4ade 100644 --- a/packages/kilo-vscode/webview-ui/src/stories/chat.stories.tsx +++ b/packages/kilo-vscode/webview-ui/src/stories/chat.stories.tsx @@ -99,7 +99,7 @@ export const ChatViewWithMessages: Story = { const session = { ...mockSessionValue({ id: SESSION_ID, status: "idle" }), messages: () => [{ id: "msg-001" }] as any[], - totalCost: () => 0.0012, + costBreakdown: () => [{ label: "Parent session", cost: 0.0012 }], contextUsage: () => ({ tokens: 512, percentage: 6 }), } return ( diff --git a/packages/kilo-vscode/webview-ui/src/stories/history.stories.tsx b/packages/kilo-vscode/webview-ui/src/stories/history.stories.tsx index c0cffaea1cf..0c0ebab98b3 100644 --- a/packages/kilo-vscode/webview-ui/src/stories/history.stories.tsx +++ b/packages/kilo-vscode/webview-ui/src/stories/history.stories.tsx @@ -73,7 +73,7 @@ const WithSessions: ParentComponent<{ sessions?: typeof mockSessions }> = (props selectModel: noop, hasModelOverride: () => false, clearModelOverride: noop, - totalCost: () => 0, + costBreakdown: () => [], contextUsage: () => undefined, agents: () => [{ name: "code", description: "Code mode", mode: "primary" as const }], selectedAgent: () => "code", diff --git a/packages/kilo-vscode/webview-ui/src/stories/settings.stories.tsx b/packages/kilo-vscode/webview-ui/src/stories/settings.stories.tsx index e77d6154a9e..5563a5dfed4 100644 --- a/packages/kilo-vscode/webview-ui/src/stories/settings.stories.tsx +++ b/packages/kilo-vscode/webview-ui/src/stories/settings.stories.tsx @@ -10,6 +10,8 @@ import { SessionContext } from "../context/session" import Settings from "../components/settings/Settings" import ProvidersTab from "../components/settings/ProvidersTab" import AgentBehaviourTab from "../components/settings/AgentBehaviourTab" +import ModeEditView from "../components/settings/ModeEditView" +import McpEditView from "../components/settings/McpEditView" import type { AgentConfig, CommandConfig } from "../types/messages" const meta: Meta = { @@ -214,3 +216,102 @@ export const AgentBehaviourWorkflowsEmpty: Story = { ) }, } + +export const McpEditViewLocal: Story = { + name: "McpEditView — local server (stdio)", + render: () => ( + +
+ +
+
+ ), +} + +export const McpEditViewLocalWithEnv: Story = { + name: "McpEditView — local server with env vars", + render: () => ( + +
+ +
+
+ ), +} + +export const McpEditViewRemote: Story = { + name: "McpEditView — remote server (SSE)", + render: () => ( + +
+ +
+
+ ), +} + +export const ModeEditExport: Story = { + name: "ModeEditView — export button", + render: () => { + const cfg: Record = { + reviewer: { + description: "Review code for quality and best practices", + prompt: "You are a code reviewer. Focus on code quality, best practices, and potential bugs.", + model: "anthropic/claude-sonnet-4-20250514", + temperature: 0.3, + }, + } + const session = { + ...mockSessionValue({ id: "export-story", status: "idle" }), + agents: () => MOCK_AGENTS, + removeMode: noop, + removeMcp: noop, + skills: () => [], + refreshSkills: noop, + removeSkill: noop, + } + return ( + + +
+ +
+
+
+ ) + }, +} diff --git a/packages/kilo-vscode/webview-ui/src/styles/chat.css b/packages/kilo-vscode/webview-ui/src/styles/chat.css index 46ee20a7d8e..0f18db55061 100644 --- a/packages/kilo-vscode/webview-ui/src/styles/chat.css +++ b/packages/kilo-vscode/webview-ui/src/styles/chat.css @@ -174,21 +174,23 @@ /* New Task Button */ .new-task-button-wrapper { padding: 8px 12px 0; + container-type: inline-size; } .session-actions-row { display: flex; - flex-wrap: wrap; gap: 4px; align-items: center; } +/* All direct children share extra space equally, but start from their content size */ .session-actions-row > * { - flex: 1 1 0; - min-width: fit-content; + flex: 1 1 auto; + min-width: 0; + overflow: hidden; } -/* Tooltip wrapper divs must fill their flex space, and buttons inside must fill the wrapper */ +/* Tooltip wrappers fill their flex slot, buttons fill the tooltip wrapper */ .session-actions-row > [data-component="tooltip-trigger"] { display: flex; } @@ -197,15 +199,15 @@ flex: 1; } -/* Diff stats tooltip wrapper — don't grow, push right */ +/* Diff wrapper also stretches evenly (same flex as buttons) */ .session-diff-wrapper { - flex: 0 0 auto !important; - margin-left: auto; + display: flex !important; } -/* Diff stats badge — matches Agent Manager diff toggle style */ +/* Diff stats badge — fills its flex slot, content centered */ .session-diff-badge { - display: inline-flex; + display: flex; + flex: 1; align-items: center; justify-content: center; gap: 4px; @@ -219,6 +221,11 @@ font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap; + position: relative; +} + +.session-diff-badge--empty { + opacity: 0.5; } .session-diff-badge:hover { @@ -227,10 +234,8 @@ .session-diff-badge [data-component="icon"] { opacity: 0.7; -} - -.session-diff-files { - color: var(--vscode-descriptionForeground); + position: relative; + flex-shrink: 0; } .session-diff-add { @@ -241,6 +246,31 @@ color: #f87171; } +/* Collapse diff stats to icon-only when truly narrow */ +@container (max-width: 300px) { + .session-diff-add, + .session-diff-del { + display: none; + } + + .session-diff-badge { + padding: 4px 6px; + overflow: hidden; + } + + /* Dot indicator on the icon when collapsed and there are changes */ + .session-diff-badge--has-changes [data-component="icon"]::after { + content: ""; + position: absolute; + top: -2px; + right: -2px; + width: 6px; + height: 6px; + border-radius: 50%; + background: #34d399; + } +} + /* ============================================ Message List ============================================ */ @@ -252,8 +282,9 @@ .message-list { height: 100%; + overflow-x: hidden; overflow-y: auto; - padding: 12px; + padding: 12px 16px; } .message-list-loading { @@ -1747,7 +1778,7 @@ .account-switcher-role { border-radius: 9999px; - padding: 1px 6px; + padding: 1px 12px; font-size: 10px; letter-spacing: 0.3px; background: var(--vscode-badge-background); @@ -2170,6 +2201,14 @@ opacity: 0.7; } +/* Session List (inside History View) */ +.session-list { + display: flex; + flex-direction: column; + flex: 1; + min-height: 0; +} + /* Session List Items */ .session-list [data-slot="list-item-title"], .cloud-session-list [data-slot="list-item-title"] { @@ -2350,7 +2389,6 @@ body.vscode-light ============================================ */ .kilo-notifications { - width: 280px; display: flex; flex-direction: column; border-radius: 6px; @@ -2403,9 +2441,10 @@ body.vscode-light .kilo-notifications-footer { display: flex; + flex-wrap: wrap; align-items: center; - justify-content: space-between; - min-height: 28px; + gap: 16px; + container-type: inline-size; } .kilo-notifications-nav { @@ -2418,6 +2457,23 @@ body.vscode-light display: flex; align-items: center; gap: 6px; + flex-shrink: 0; + margin-left: auto; + align-self: flex-start; +} + +.kilo-notifications-cta-group { + display: flex; + flex-wrap: nowrap; + gap: 6px; + flex: 1 1 auto; +} + +@container (max-width: 300px) { + .kilo-notifications-cta-group { + flex-direction: column; + align-items: flex-start; + } } .kilo-notifications-action-btn { diff --git a/packages/kilo-vscode/webview-ui/src/types/messages.ts b/packages/kilo-vscode/webview-ui/src/types/messages.ts index 637759b537b..2cf428cb06d 100644 --- a/packages/kilo-vscode/webview-ui/src/types/messages.ts +++ b/packages/kilo-vscode/webview-ui/src/types/messages.ts @@ -128,6 +128,7 @@ export interface SessionFileDiff { // Session info (simplified for webview) export interface SessionInfo { id: string + parentID?: string | null title?: string createdAt: string updatedAt: string @@ -219,6 +220,7 @@ export interface AgentInfo { mode: "subagent" | "primary" | "all" native?: boolean hidden?: boolean + deprecated?: boolean color?: string } @@ -324,6 +326,8 @@ export interface AgentConfig { prompt?: string description?: string mode?: "subagent" | "primary" | "all" + hidden?: boolean + disable?: boolean temperature?: number top_p?: number steps?: number @@ -632,7 +636,7 @@ export interface DeviceAuthCancelledMessage { export interface NavigateMessage { type: "navigate" - view: "newTask" | "marketplace" | "history" | "profile" | "settings" | "migration" | "subAgentViewer" // legacy-migration: "migration" + view: "newTask" | "marketplace" | "history" | "profile" | "settings" | "subAgentViewer" tab?: string } @@ -720,6 +724,11 @@ export interface ConfigUpdatedMessage { config: Config } +export interface GlobalConfigLoadedMessage { + type: "globalConfigLoaded" + config: Config +} + export interface NotificationSettingsLoadedMessage { type: "notificationSettingsLoaded" settings: { @@ -961,6 +970,14 @@ export interface AgentManagerLocalStatsMessage { stats: LocalGitStats } +// Sidebar: Live worktree diff stats (extension → webview) +export interface WorktreeStatsLoadedMessage { + type: "worktreeStatsLoaded" + files: number + additions: number + deletions: number +} + // Set the model for a session (extension → webview, used during multi-version creation) export interface AgentManagerSetSessionModelMessage { type: "agentManager.setSessionModel" @@ -1030,12 +1047,26 @@ export interface MigrationResultItem { message?: string } +export interface MigrationStateMessage { + type: "migrationState" + needed: boolean + data?: { + providers: MigrationProviderInfo[] + mcpServers: MigrationMcpServerInfo[] + customModes: MigrationCustomModeInfo[] + sessions?: string[] + defaultModel?: { provider: string; model: string } + settings?: LegacySettings + } +} + export interface LegacyMigrationDataMessage { type: "legacyMigrationData" data: { providers: MigrationProviderInfo[] mcpServers: MigrationMcpServerInfo[] customModes: MigrationCustomModeInfo[] + sessions?: string[] defaultModel?: { provider: string; model: string } settings?: LegacySettings } @@ -1072,6 +1103,7 @@ export interface StartLegacyMigrationMessage { providers: string[] mcpServers: string[] customModes: string[] + sessions?: string[] defaultModel: boolean settings: { autoApproval: MigrationAutoApprovalSelections @@ -1120,6 +1152,10 @@ export interface DiffViewerLoadingMessage { loading: boolean } +export interface ClearPendingPromptsMessage { + type: "clearPendingPrompts" +} + // ============================================ // Marketplace Messages // ============================================ @@ -1200,6 +1236,15 @@ export interface ProviderActionErrorMessage { message: string } +export interface CustomProviderModelsFetchedMessage { + type: "customProviderModelsFetched" + requestId: string + models?: Array<{ id: string; name: string }> + error?: string + /** True when error was HTTP 401/403 — hints the user to check their API key */ + auth?: boolean +} + export type ExtensionMessage = | ReadyMessage | ConnectionStateMessage @@ -1241,6 +1286,7 @@ export type ExtensionMessage = | BrowserSettingsLoadedMessage | ConfigLoadedMessage | ConfigUpdatedMessage + | GlobalConfigLoadedMessage | NotificationSettingsLoadedMessage | NotificationsLoadedMessage | AgentManagerSessionMetaMessage @@ -1273,6 +1319,7 @@ export type ExtensionMessage = | AgentManagerWorktreeStatsMessage | AgentManagerLocalStatsMessage // legacy-migration start + | MigrationStateMessage | LegacyMigrationDataMessage | LegacyMigrationProgressMessage | LegacyMigrationCompleteMessage @@ -1289,9 +1336,13 @@ export type ExtensionMessage = | ProviderConnectedMessage | ProviderDisconnectedMessage | ProviderActionErrorMessage + | CustomProviderModelsFetchedMessage | RecentsLoadedMessage | LanguageChangedMessage | ContinueInWorktreeProgressMessage + | WorktreeStatsLoadedMessage + | McpStatusLoadedMessage + | ClearPendingPromptsMessage // ============================================ // Messages FROM webview TO extension @@ -1440,6 +1491,10 @@ export interface OpenSettingsPanelRequest { tab?: string } +export interface OpenMarketplacePanelRequest { + type: "openMarketplacePanel" +} + export interface RequestAgentsMessage { type: "requestAgents" } @@ -1480,6 +1535,30 @@ export interface RemoveMcpMessage { name: string } +export interface RequestMcpStatusMessage { + type: "requestMcpStatus" +} + +export interface ConnectMcpMessage { + type: "connectMcp" + name: string +} + +export interface DisconnectMcpMessage { + type: "disconnectMcp" + name: string +} + +export interface McpStatusEntry { + status: "connected" | "disabled" | "failed" | "needs_auth" | "needs_client_registration" + error?: string +} + +export interface McpStatusLoadedMessage { + type: "mcpStatusLoaded" + status: Record +} + export interface SetLanguageRequest { type: "setLanguage" locale: string @@ -1488,12 +1567,14 @@ export interface SetLanguageRequest { export interface QuestionReplyRequest { type: "questionReply" requestID: string + sessionID?: string answers: string[][] } export interface QuestionRejectRequest { type: "questionReject" requestID: string + sessionID?: string } export interface DeleteSessionRequest { @@ -1547,6 +1628,10 @@ export interface RequestConfigMessage { type: "requestConfig" } +export interface RequestGlobalConfigMessage { + type: "requestGlobalConfig" +} + export interface UpdateConfigMessage { type: "updateConfig" config: Partial @@ -1894,6 +1979,14 @@ export interface SaveCustomProviderMessage { apiKey?: string } +export interface FetchCustomProviderModelsMessage { + type: "fetchCustomProviderModels" + requestId: string + baseURL: string + apiKey?: string + headers?: Record +} + export interface PersistRecentsRequest { type: "persistRecents" recents: ModelSelection[] @@ -1943,6 +2036,7 @@ export type WebviewMessage = | RefreshProfileRequest | OpenExternalRequest | OpenSettingsPanelRequest + | OpenMarketplacePanelRequest | OpenFileRequest | CancelLoginRequest | SetOrganizationRequest @@ -1956,6 +2050,9 @@ export type WebviewMessage = | RemoveSkillMessage | RemoveModeMessage | RemoveMcpMessage + | RequestMcpStatusMessage + | ConnectMcpMessage + | DisconnectMcpMessage | SetLanguageRequest | QuestionReplyRequest | QuestionRejectRequest @@ -1969,6 +2066,7 @@ export type WebviewMessage = | UpdateSettingRequest | RequestBrowserSettingsMessage | RequestConfigMessage + | RequestGlobalConfigMessage | UpdateConfigMessage | RequestNotificationSettingsMessage | ResetAllSettingsRequest @@ -2036,6 +2134,7 @@ export type WebviewMessage = | CompleteProviderOAuthMessage | DisconnectProviderMessage | SaveCustomProviderMessage + | FetchCustomProviderModelsMessage | PersistRecentsRequest | RequestRecentsMessage | ContinueInWorktreeRequest diff --git a/packages/kilo-vscode/webview-ui/src/utils/config-utils.ts b/packages/kilo-vscode/webview-ui/src/utils/config-utils.ts new file mode 100644 index 00000000000..f4f3880a800 --- /dev/null +++ b/packages/kilo-vscode/webview-ui/src/utils/config-utils.ts @@ -0,0 +1,96 @@ +import type { Config } from "../types/messages" + +export function isRecord(value: unknown): value is Record { + return !!value && typeof value === "object" && !Array.isArray(value) +} + +/** Deep merge two objects, with source values overriding target values. */ +export function deepMerge(target: Config, source: Partial): Config { + const result: Record = { ...target } + for (const [key, value] of Object.entries(source)) { + if (isRecord(value) && isRecord(result[key])) { + result[key] = deepMerge(result[key] as Config, value as Partial) + } else { + result[key] = value + } + } + return result as Config +} + +/** Recursively remove keys whose value is null (null = "deleted"). */ +export function stripNulls(obj: Config): Config { + const result: Record = {} + for (const [key, value] of Object.entries(obj)) { + if (value === null || value === undefined) continue + if (isRecord(value)) { + result[key] = stripNulls(value as Config) + } else { + result[key] = value + } + } + return result as Config +} + +/** + * Resolve the visible config when a configLoaded/configUpdated message arrives. + * If the user has pending draft changes, re-apply the draft on top of the + * incoming server config so pending toggles don't snap back. + */ +export function resolveConfig(server: Config, draft: Partial, dirty: boolean): Config { + if (dirty) return stripNulls(deepMerge(server, draft)) + return server +} + +/** + * Plain-object config state machine — mirrors the SolidJS ConfigProvider + * logic without signals so the message-handling behavior is unit-testable. + */ +export class ConfigState { + config: Config = {} + saved: Config = {} + draft: Partial = {} + dirty = false + saving = false + loading = true + + /** Accumulate a partial change (same as the toggle click path). */ + updateConfig(partial: Partial) { + this.config = stripNulls(deepMerge(this.config, partial)) + this.draft = deepMerge(this.draft as Config, partial) + this.dirty = true + } + + /** Handle an incoming configLoaded push from the extension. */ + handleConfigLoaded(server: Config) { + if (this.saving) return + this.config = resolveConfig(server, this.draft, this.dirty) + this.saved = server + this.loading = false + } + + /** Handle an incoming configUpdated push from the extension. */ + handleConfigUpdated(server: Config) { + if (this.saving) { + this.saving = false + this.draft = {} + this.dirty = false + this.config = server + } else { + this.config = resolveConfig(server, this.draft, this.dirty) + } + this.saved = server + } + + /** Send the draft to the backend. */ + saveConfig() { + if (Object.keys(this.draft).length === 0) return + this.saving = true + } + + /** Discard pending changes. */ + discardConfig() { + this.config = this.saved + this.draft = {} + this.dirty = false + } +} diff --git a/packages/opencode/package.json b/packages/opencode/package.json index 58550a202db..245d9098341 100644 --- a/packages/opencode/package.json +++ b/packages/opencode/package.json @@ -1,6 +1,6 @@ { "$schema": "https://json.schemastore.org/package.json", - "version": "7.1.5", + "version": "7.1.17", "name": "@kilocode/cli", "type": "module", "license": "MIT", @@ -69,7 +69,7 @@ "@ai-sdk/google-vertex": "3.0.106", "@ai-sdk/groq": "2.0.34", "@ai-sdk/mistral": "2.0.27", - "@ai-sdk/openai": "2.0.89", + "@ai-sdk/openai": "2.0.101", "@ai-sdk/openai-compatible": "1.0.32", "@ai-sdk/perplexity": "2.0.23", "@ai-sdk/provider": "2.0.1", diff --git a/packages/opencode/src/acp/agent.ts b/packages/opencode/src/acp/agent.ts index 59ecfcc6dbe..ac103a7ecfb 100644 --- a/packages/opencode/src/acp/agent.ts +++ b/packages/opencode/src/acp/agent.ts @@ -1592,8 +1592,16 @@ export namespace ACP { if (specified) return specified // kilocode_change start - const freeModel = await fetchDefaultModel() - return { providerID: "kilo", modelID: freeModel } + // Only fall back to the Kilo provider if it was present in the available + // providers list. When teams configure enabled_providers to use only their + // own models, this prevents silently routing requests to an external API. + // Note: LiteLLM / custom provider users won't reach here — the function + // returns earlier via `specified` (config.model) or the sorted providers list. + if (providers.some((p) => p.id === "kilo")) { + const freeModel = await fetchDefaultModel() + return { providerID: "kilo", modelID: freeModel } + } + throw new Error("no model available: no providers are configured and no default model is set") // kilocode_change end } diff --git a/packages/opencode/src/agent/agent.ts b/packages/opencode/src/agent/agent.ts index 16305db1286..8bfbe786a21 100644 --- a/packages/opencode/src/agent/agent.ts +++ b/packages/opencode/src/agent/agent.ts @@ -37,6 +37,7 @@ export namespace Agent { mode: z.enum(["subagent", "primary", "all"]), native: z.boolean().optional(), hidden: z.boolean().optional(), + deprecated: z.boolean().optional(), topP: z.number().optional(), temperature: z.number().optional(), color: z.string().optional(), @@ -111,6 +112,77 @@ export namespace Agent { "gunzip *": "allow", } // kilocode_change end + + // kilocode_change start — read-only bash commands for the ask agent. + // Unlike the default bash allowlist, unknown commands are DENIED (not "ask") + // because the ask agent must never modify the filesystem. + const readOnlyBash: Record = { + "*": "deny", + // read-only / informational + "cat *": "allow", + "head *": "allow", + "tail *": "allow", + "less *": "allow", + "ls *": "allow", + "tree *": "allow", + "pwd *": "allow", + "echo *": "allow", + "wc *": "allow", + "which *": "allow", + "type *": "allow", + "file *": "allow", + "diff *": "allow", + "du *": "allow", + "df *": "allow", + "date *": "allow", + "uname *": "allow", + "whoami *": "allow", + "printenv *": "allow", + "man *": "allow", + // text processing (stdout only, no file modification) + "grep *": "allow", + "rg *": "allow", + "ag *": "allow", + "sort *": "allow", + "uniq *": "allow", + "cut *": "allow", + "tr *": "allow", + "jq *": "allow", + // git — allowlist of read-only subcommands, deny everything else + "git *": "deny", + "git log *": "allow", + "git show *": "allow", + "git diff *": "allow", + "git status *": "allow", + "git blame *": "allow", + "git rev-parse *": "allow", + "git rev-list *": "allow", + "git ls-files *": "allow", + "git ls-tree *": "allow", + "git ls-remote *": "allow", + "git shortlog *": "allow", + "git describe *": "allow", + "git cat-file *": "allow", + "git name-rev *": "allow", + "git stash list *": "allow", + "git tag -l *": "allow", + "git branch --list *": "allow", + "git branch -a *": "allow", + "git branch -r *": "allow", + "git remote -v *": "allow", + // gh — require user approval since commands vary widely + "gh *": "ask", + } + + // kilocode_change start — allow MCP tools in ask agent with user approval. + // Generates per-server wildcard rules that override "*": "deny". + const mcpRules: Record = {} + for (const key of Object.keys(cfg.mcp ?? {})) { + const sanitized = key.replace(/[^a-zA-Z0-9_-]/g, "_") + mcpRules[sanitized + "_*"] = "ask" + } + // kilocode_change end + const defaults = PermissionNext.fromConfig({ "*": "allow", bash, // kilocode_change @@ -226,6 +298,7 @@ export namespace Agent { ), mode: "primary", native: true, + deprecated: true, }, ask: { name: "ask", @@ -237,6 +310,7 @@ export namespace Agent { user, // kilocode_change: user before ask-specific so ask's deny+allowlist wins PermissionNext.fromConfig({ "*": "deny", + bash: readOnlyBash, read: { "*": "allow", "*.env": "ask", @@ -254,7 +328,9 @@ export namespace Agent { external_directory: { [Truncate.GLOB]: "allow", }, + ...mcpRules, }), + user.filter((r) => r.action === "deny"), // kilocode_change: re-apply user denies so explicit MCP blocks win over mcpRules ), mode: "primary", native: true, @@ -381,6 +457,7 @@ export namespace Agent { item.mode = value.mode ?? item.mode item.color = value.color ?? item.color item.hidden = value.hidden ?? item.hidden + item.deprecated = value.deprecated ?? item.deprecated item.name = value.name ?? item.name item.steps = value.steps ?? item.steps item.options = mergeDeep(item.options, value.options ?? {}) diff --git a/packages/opencode/src/agent/prompt/ask.txt b/packages/opencode/src/agent/prompt/ask.txt index 32f9e74e3ef..fc96b149ab1 100644 --- a/packages/opencode/src/agent/prompt/ask.txt +++ b/packages/opencode/src/agent/prompt/ask.txt @@ -4,5 +4,7 @@ Guidelines: - Answer questions thoroughly with clear explanations and relevant examples - Analyze code, explain concepts, and provide recommendations without making changes - Use Mermaid diagrams when they help clarify your response -- Do not edit files or execute commands; this agent is read-only +- You may run read-only bash commands (ls, cat, grep, git log, git diff, etc.) to gather information +- You must NOT modify files, run write commands, or execute code — you are read-only +- MCP tools are available if configured — each call requires user approval - If a question requires implementation, suggest switching to a different agent diff --git a/packages/opencode/src/cli/cmd/github.ts b/packages/opencode/src/cli/cmd/github.ts index df03d61b91a..bc0d83e9532 100644 --- a/packages/opencode/src/cli/cmd/github.ts +++ b/packages/opencode/src/cli/cmd/github.ts @@ -330,7 +330,7 @@ export const GithubInstallCommand = cmd({ ? `start "" "${url}"` : `xdg-open "${url}"` - exec(command, (error) => { + exec(command, { windowsHide: true }, (error) => { if (error) { prompts.log.warn(`Could not open browser. Please visit: ${url}`) } diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx index 24be2167d2b..6a8aa1f3f62 100644 --- a/packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx @@ -12,7 +12,8 @@ export function DialogAgent() { return { value: item.name, title: item.displayName ?? item.name, // kilocode_change - description: item.native ? "native" : item.description, + description: + [item.deprecated && "deprecated", item.native && "native"].filter(Boolean).join(", ") || item.description, } }), ) diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx index c2cd4d17d9c..667761cd890 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx @@ -16,6 +16,7 @@ import { Locale } from "@/util/locale" import { Global } from "@/global" import { useDialog } from "../../ui/dialog" import { useTuiConfig } from "../../context/tui-config" +import { ConfigProtection } from "@/kilocode/permission/config-paths" // kilocode_change type PermissionStage = "permission" | "always" | "reject" @@ -428,12 +429,18 @@ export function PermissionPrompt(props: { request: PermissionRequest }) { ) + // kilocode_change start — hide "Always allow" for config file edits + const options: Record = props.request.metadata?.[ConfigProtection.DISABLE_ALWAYS_KEY] + ? { once: "Allow once", reject: "Reject" } + : { once: "Allow once", always: "Allow always", reject: "Reject" } + // kilocode_change end + const body = ( { diff --git a/packages/opencode/src/commit-message/git-context.ts b/packages/opencode/src/commit-message/git-context.ts index 3b97f44c58b..d81e8a62cfb 100644 --- a/packages/opencode/src/commit-message/git-context.ts +++ b/packages/opencode/src/commit-message/git-context.ts @@ -133,6 +133,7 @@ function git(args: string[], cwd: string): string { cwd, stdout: "pipe", stderr: "pipe", + windowsHide: true, // kilocode_change - prevent cmd.exe flash on Windows }) return result.stdout.toString().trimEnd() } @@ -144,7 +145,7 @@ function parseNameStatus(output: string): Array<{ status: string; path: string } let path: string if (status!.startsWith("R")) { // Rename: rest = ["old.ts", "new.ts"], use the new path - path = rest[1] ?? rest[0] + path = rest[1] ?? rest[0] ?? "" } else { path = rest.join("\t") } diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts index eff231452e0..5b3e3b28de4 100644 --- a/packages/opencode/src/config/config.ts +++ b/packages/opencode/src/config/config.ts @@ -1159,6 +1159,10 @@ export namespace Config { .boolean() .optional() .describe("@deprecated Use 'share' field instead. Share newly created sessions automatically"), + remote_control: z // kilocode_change + .boolean() + .optional() + .describe("Enable remote control of sessions via Kilo Cloud. Equivalent to running /remote on startup."), autoupdate: z .union([z.boolean(), z.literal("notify")]) .optional() diff --git a/packages/opencode/src/flag/flag.ts b/packages/opencode/src/flag/flag.ts index 1ece6b10cbe..52c38e27817 100644 --- a/packages/opencode/src/flag/flag.ts +++ b/packages/opencode/src/flag/flag.ts @@ -65,6 +65,8 @@ export namespace Flag { const parsed = Number(value) return Number.isInteger(parsed) && parsed > 0 ? parsed : undefined } + + export const KILO_SESSION_RETRY_LIMIT = number("KILO_SESSION_RETRY_LIMIT") } // Dynamic getter for KILO_DISABLE_PROJECT_CONFIG diff --git a/packages/opencode/src/kilo-sessions/kilo-sessions.ts b/packages/opencode/src/kilo-sessions/kilo-sessions.ts index 76baddb95ad..76249cf9d5f 100644 --- a/packages/opencode/src/kilo-sessions/kilo-sessions.ts +++ b/packages/opencode/src/kilo-sessions/kilo-sessions.ts @@ -10,6 +10,7 @@ import { clearInFlightCache, withInFlightCache } from "@/kilo-sessions/inflight- import type * as SDK from "@kilocode/sdk/v2" import z from "zod" import { KILO_API_BASE } from "@kilocode/kilo-gateway" +import { Config } from "@/config/config" import { Instance } from "@/project/instance" import { Vcs } from "@/project/vcs" import simpleGit from "simple-git" @@ -205,7 +206,9 @@ export namespace KiloSessions { await ingest.sync(evt.properties.sessionID, [{ type: "session_close", data: { reason: evt.properties.reason } }]) }) - if (remoteEnabled) enableRemote().catch((err) => log.warn("remote not enabled", { error: String(err) })) + const cfg = await Config.getGlobal() + if (remoteEnabled || cfg.remote_control) + enableRemote().catch((err) => log.warn("remote not enabled", { error: String(err) })) Bus.subscribe(Bus.InstanceDisposed, () => disableRemote()) } @@ -249,6 +252,7 @@ export namespace KiloSessions { id, status: statuses[id]?.type ?? "idle", title: session.title, + parentSessionId: session.parentID, gitUrl, gitBranch, } diff --git a/packages/opencode/src/kilo-sessions/remote-protocol.ts b/packages/opencode/src/kilo-sessions/remote-protocol.ts index 3d1f1cb29fb..6500319fa81 100644 --- a/packages/opencode/src/kilo-sessions/remote-protocol.ts +++ b/packages/opencode/src/kilo-sessions/remote-protocol.ts @@ -7,6 +7,7 @@ export namespace RemoteProtocol { id: z.string(), status: z.string(), title: z.string(), + parentSessionId: z.string().optional(), gitUrl: z.string().optional(), gitBranch: z.string().optional(), }) @@ -70,7 +71,12 @@ export namespace RemoteProtocol { }) export type System = z.infer - export const Inbound = z.discriminatedUnion("type", [Subscribe, Unsubscribe, Command, System]) + export const HeartbeatAck = z.object({ + type: z.literal("heartbeat_ack"), + }) + export type HeartbeatAck = z.infer + + export const Inbound = z.discriminatedUnion("type", [Subscribe, Unsubscribe, Command, System, HeartbeatAck]) export type Inbound = z.infer /** Lightweight schema for diagnostic logging before full parse. */ diff --git a/packages/opencode/src/kilo-sessions/remote-ws.ts b/packages/opencode/src/kilo-sessions/remote-ws.ts index 88a1f2f36db..0232ec27785 100644 --- a/packages/opencode/src/kilo-sessions/remote-ws.ts +++ b/packages/opencode/src/kilo-sessions/remote-ws.ts @@ -18,6 +18,8 @@ export namespace RemoteWS { withContext?: (fn: () => R) => Promise | R /** Called when the server permanently closes the connection (e.g. auth failure, conflict) */ onClose?: (code: number, reason: string) => void + /** Inactivity timeout in ms — force-close if no inbound message within this window */ + timeout?: number } export type Connection = { @@ -56,6 +58,29 @@ export namespace RemoteWS { beat = undefined } + let activity = Date.now() + let watchdog: Timer | undefined + const timeout = options.timeout ?? 30_000 + + function startWatchdog() { + stopWatchdog() + watchdog = setInterval( + () => { + if (Date.now() - activity > timeout) { + options.log.warn("remote-ws activity timeout, forcing reconnect") + stopWatchdog() + ws?.close(4000, "activity timeout") + } + }, + Math.min(interval, timeout), + ) + } + + function stopWatchdog() { + if (watchdog) clearInterval(watchdog) + watchdog = undefined + } + async function open() { if (closed) return const token = await options.getToken() @@ -73,10 +98,13 @@ export namespace RemoteWS { backoff = 1000 for (const msg of buffer) ws!.send(msg) buffer.length = 0 + activity = Date.now() startHeartbeat() + startWatchdog() } ws.onmessage = (event) => { + activity = Date.now() const raw = String(event.data) let json: unknown try { @@ -99,6 +127,7 @@ export namespace RemoteWS { options.log.info("remote-ws closed", { code: event.code, reason: event.reason }) ws = undefined stopHeartbeat() + stopWatchdog() if (event.code === 4401 || event.code === 4403 || event.code === 4409) { options.log.warn("remote-ws closed permanently", { code: event.code, @@ -134,6 +163,7 @@ export namespace RemoteWS { function close() { closed = true stopHeartbeat() + stopWatchdog() if (timer) clearTimeout(timer) if (ws) ws.close() } diff --git a/packages/opencode/src/kilocode/components/tips.tsx b/packages/opencode/src/kilocode/components/tips.tsx index 5dd5981eeb3..13a3da92f2b 100644 --- a/packages/opencode/src/kilocode/components/tips.tsx +++ b/packages/opencode/src/kilocode/components/tips.tsx @@ -80,31 +80,24 @@ const TIPS = [ "Switch to {highlight}Plan{/highlight} agent to get suggestions without making actual changes", "Use {highlight}@agent-name{/highlight} in prompts to invoke specialized subagents", "Press {highlight}Ctrl+X Right/Left{/highlight} to cycle through parent and child sessions", - "Create {highlight}kilo.json{/highlight} for server settings and {highlight}tui.json{/highlight} for TUI settings", - "Place TUI settings in {highlight}~/.config/kilo/tui.json{/highlight} for global config", - "Add {highlight}$schema{/highlight} to your config for autocomplete in your editor", - "Configure {highlight}model{/highlight} in config to set your default model", - "Override any keybind in {highlight}tui.json{/highlight} via the {highlight}keybinds{/highlight} section", - "Set any keybind to {highlight}none{/highlight} to disable it completely", - "Configure local or remote MCP servers in the {highlight}mcp{/highlight} config section", + "Kilo can {highlight}configure itself{/highlight} if you ask it", + "Ask Kilo to {highlight}add Supabase MCP globally{/highlight}", + "Ask Kilo to {highlight}create a review agent for this project{/highlight}", + "Ask Kilo to {highlight}add a plugin for desktop alerts{/highlight}", + "Ask Kilo to {highlight}set Claude Sonnet as my default model{/highlight}", + "Ask Kilo to {highlight}make my review agent read-only{/highlight}", + "Ask Kilo to {highlight}require approval before git push{/highlight}", + "Ask Kilo to {highlight}turn off auto-formatting{/highlight}", + "Ask Kilo to {highlight}block access to .env files{/highlight}", + "Ask Kilo to {highlight}turn off the F2 shortcut{/highlight}", + "Ask Kilo to {highlight}match my terminal theme{/highlight}", + "Ask Kilo to {highlight}disable sharing for all sessions{/highlight}", + "Ask Kilo to {highlight}add rules from docs/ai-rules.md{/highlight}", + "Ask Kilo to {highlight}enable tui.scroll_acceleration{/highlight} for smooth macOS-style scrolling", + "Ask Kilo to {highlight}save this workflow as a /command{/highlight}", "Kilo auto-handles OAuth for remote MCP servers requiring auth", - "Add {highlight}.md{/highlight} files to {highlight}.kilo/command/{/highlight} to define reusable custom prompts", - "Use {highlight}$ARGUMENTS{/highlight}, {highlight}$1{/highlight}, {highlight}$2{/highlight} in custom commands for dynamic input", - "Use backticks in commands to inject shell output (e.g., {highlight}`git status`{/highlight})", - "Add {highlight}.md{/highlight} files to {highlight}.kilo/agent/{/highlight} for specialized AI personas", - "Configure per-agent permissions for {highlight}edit{/highlight}, {highlight}bash{/highlight}, and {highlight}webfetch{/highlight} tools", - 'Use patterns like {highlight}"git *": "allow"{/highlight} for granular bash permissions', - 'Set {highlight}"rm -rf *": "deny"{/highlight} to block destructive commands', - 'Configure {highlight}"git push": "ask"{/highlight} to require approval before pushing', "Kilo auto-formats files using prettier, gofmt, ruff, and more", - 'Set {highlight}"formatter": false{/highlight} in config to disable all auto-formatting', - "Define custom formatter commands with file extensions in config", "Kilo uses LSP servers for intelligent code analysis", - "Create {highlight}.ts{/highlight} files in {highlight}.kilo/tools/{/highlight} to define new LLM tools", - "Tool definitions can invoke scripts written in Python, Go, etc", - "Add {highlight}.ts{/highlight} files to {highlight}.kilo/plugin/{/highlight} for event hooks", - "Use plugins to send OS notifications when sessions complete", - "Create a plugin to prevent Kilo from reading sensitive files", "Use {highlight}kilo run{/highlight} for non-interactive scripting", "Use {highlight}kilo --continue{/highlight} to resume the last session", "Use {highlight}kilo run -f file.ts{/highlight} to attach files via CLI", @@ -113,34 +106,14 @@ const TIPS = [ "Use {highlight}kilo run --attach{/highlight} to connect to a running server", "Run {highlight}kilo upgrade{/highlight} to update to the latest version", "Run {highlight}kilo auth list{/highlight} to see all configured providers", - "Run {highlight}kilo agent create{/highlight} for guided agent creation", - 'Use {highlight}"theme": "system"{/highlight} to match your terminal\'s colors', - "Create JSON theme files in {highlight}.kilo/themes/{/highlight} directory", - "Themes support dark/light variants for both modes", - "Reference ANSI colors 0-255 in custom themes", - "Use {highlight}{env:VAR_NAME}{/highlight} syntax to reference environment variables in config", - "Use {highlight}{file:path}{/highlight} to include file contents in config values", - "Use {highlight}instructions{/highlight} in config to load additional rules files", - "Set agent {highlight}temperature{/highlight} from 0.0 (focused) to 1.0 (creative)", - "Configure {highlight}steps{/highlight} to limit agentic iterations per request", - 'Set {highlight}"tools": {"bash": false}{/highlight} to disable specific tools', - 'Set {highlight}"mcp_*": false{/highlight} to disable all tools from an MCP server', - "Override global tool settings per agent configuration", - 'Set {highlight}"share": "auto"{/highlight} to automatically share all sessions', - 'Set {highlight}"share": "disabled"{/highlight} to prevent any session sharing', "Run {highlight}/unshare{/highlight} to remove a session from public access", - "Permission {highlight}doom_loop{/highlight} prevents infinite tool call loops", - "Permission {highlight}external_directory{/highlight} protects files outside project", - "Run {highlight}kilo debug config{/highlight} to troubleshoot configuration", "Use {highlight}--print-logs{/highlight} flag to see detailed logs in stderr", "Press {highlight}Ctrl+X G{/highlight} or {highlight}/timeline{/highlight} to jump to specific messages", "Press {highlight}Ctrl+X S{/highlight} or {highlight}/status{/highlight} to see config paths, MCP servers, and system info", - "Enable {highlight}tui.scroll_acceleration{/highlight} for smooth macOS-style scrolling", "Toggle username display in chat via command palette ({highlight}Ctrl+P{/highlight})", "Commit your project's {highlight}AGENTS.md{/highlight} file to Git for team sharing", "Use {highlight}/review{/highlight} to review uncommitted changes, branches, or PRs", "Run {highlight}/help{/highlight} to show the help dialog", "Use {highlight}/rename{/highlight} to rename the current session", "Press {highlight}Ctrl+Z{/highlight} to suspend the terminal and return to your shell", - "Doing something often? Ask Kilo to save it as a {highlight}/command{/highlight}", ] diff --git a/packages/opencode/src/kilocode/paths.ts b/packages/opencode/src/kilocode/paths.ts index 7e72674f8df..c462430be5f 100644 --- a/packages/opencode/src/kilocode/paths.ts +++ b/packages/opencode/src/kilocode/paths.ts @@ -53,9 +53,26 @@ export namespace KilocodePaths { }): Promise { const directories: string[] = [] - // 1. Walk up from project dir to worktree root for .kilocode/ and .kilo/ + if (!opts.skipGlobalPaths) { + // 1. Global ~/.kilocode/ and ~/.kilo/ (loaded first so project-level overrides) + for (const global of globalDirs()) { + const globalSkills = path.join(global, "skills") + if (!(await Filesystem.isDir(globalSkills))) continue + directories.push(global) // Return parent, not skills/ + } + + // 2. VSCode extension global storage (marketplace-installed skills) + const vscode = vscodeGlobalStorage() + const vscodeSkills = path.join(vscode, "skills") + if (await Filesystem.isDir(vscodeSkills)) { + directories.push(vscode) // Return parent, not skills/ + } + } + + // 3. Walk up from project dir to worktree root for .kilocode/ and .kilo/ // Returns parent directories (not skills/) because // the glob pattern "skills/[*]/SKILL.md" is applied from the parent + // Loaded last so project-level skills take precedence over global for (const target of [".kilocode", ".kilo"] as const) { const projectDirs = await Array.fromAsync( Filesystem.up({ @@ -72,22 +89,6 @@ export namespace KilocodePaths { } } - if (!opts.skipGlobalPaths) { - // 2. Global ~/.kilocode/ and ~/.kilo/ - for (const global of globalDirs()) { - const globalSkills = path.join(global, "skills") - if (!(await Filesystem.isDir(globalSkills))) continue - directories.push(global) // Return parent, not skills/ - } - - // 3. VSCode extension global storage (marketplace-installed skills) - const vscode = vscodeGlobalStorage() - const vscodeSkills = path.join(vscode, "skills") - if (await Filesystem.isDir(vscodeSkills)) { - directories.push(vscode) // Return parent, not skills/ - } - } - return directories } } diff --git a/packages/opencode/src/kilocode/permission/config-paths.ts b/packages/opencode/src/kilocode/permission/config-paths.ts new file mode 100644 index 00000000000..facd70987ca --- /dev/null +++ b/packages/opencode/src/kilocode/permission/config-paths.ts @@ -0,0 +1,129 @@ +import path from "path" +import { Global } from "@/global" +import { KilocodePaths } from "@/kilocode/paths" + +export namespace ConfigProtection { + /** + * Config directory prefixes (relative paths, forward-slash normalized). + * Matches .kilo/, .kilocode/, .opencode/ at any depth within the project. + */ + const CONFIG_DIRS = [".kilo/", ".kilocode/", ".opencode/"] + + /** + * Subdirectories under CONFIG_DIRS that are NOT config files (e.g. plan files). + * Paths under these subdirs are exempt from config protection. + */ + const EXCLUDED_SUBDIRS = ["plans/"] + + /** + * Root-level config files that must be protected. + * Matched only when the relative path has no directory component. + */ + const CONFIG_ROOT_FILES = new Set(["kilo.json", "kilo.jsonc", "opencode.json", "opencode.jsonc", "AGENTS.md"]) + + /** Metadata key used to signal the UI to hide the "Allow always" option. */ + export const DISABLE_ALWAYS_KEY = "disableAlways" as const + + function normalize(p: string): string { + return path.posix.normalize(p.replaceAll("\\", "/")) + } + + /** Return the remainder after the config dir prefix, or undefined if excluded. */ + function excluded(remainder: string): boolean { + return EXCLUDED_SUBDIRS.some((sub) => remainder.startsWith(sub)) + } + + /** Check if a project-relative path points to a config file or directory. */ + export function isRelative(pattern: string): boolean { + const normalized = normalize(pattern) + for (const dir of CONFIG_DIRS) { + const bare = dir.slice(0, -1) // e.g. ".kilo" + // Match at root (e.g. ".kilo/foo") or nested (e.g. "packages/sub/.kilo/foo") + if (normalized === bare || normalized.endsWith("/" + bare)) return true + if (normalized.startsWith(dir)) { + if (excluded(normalized.slice(dir.length))) continue + return true + } + const nested = normalized.indexOf("/" + dir) + if (nested !== -1) { + if (excluded(normalized.slice(nested + 1 + dir.length))) continue + return true + } + } + return CONFIG_ROOT_FILES.has(normalized) + } + + /** Check if `child` is equal to or nested inside `parent`. */ + function within(child: string, parent: string): boolean { + return child === parent || child.startsWith(parent + path.sep) + } + + /** Check if an absolute path is inside a known CLI config directory. */ + export function isAbsolute(filepath: string): boolean { + const resolved = path.resolve(filepath) + + // ~/.config/kilo/ (XDG config) + if (within(resolved, path.resolve(Global.Path.config))) return true + + // ~/.kilo/ and ~/.kilocode/ (legacy global dirs) + for (const dir of KilocodePaths.globalDirs()) { + if (within(resolved, path.resolve(dir))) return true + } + + return false + } + + /** Check a single path (absolute or relative) against config protection. */ + function protected_(p: string): boolean { + return path.isAbsolute(p) ? isAbsolute(p) : isRelative(p) + } + + /** + * Determine if a permission request targets config files. + * Checks `edit` and `external_directory` permissions — read access is not restricted. + */ + export function isRequest(request: { + permission: string + patterns: string[] + metadata?: Record + }): boolean { + // external_directory patterns are absolute globs like "/Users/alex/.config/kilo/*" + if (request.permission === "external_directory") { + for (const pattern of request.patterns) { + const dir = pattern.replace(/\/\*$/, "") + if (isAbsolute(dir)) return true + } + return false + } + + if (request.permission !== "edit") return false + + // Check patterns — handle both relative and absolute + for (const pattern of request.patterns) { + if (protected_(pattern)) return true + } + + // Check metadata.filepath (absolute for edit, comma-joined relative for apply_patch) + const fp = request.metadata?.filepath + if (typeof fp === "string") { + // apply_patch joins relative paths with ", " + const parts = fp.includes(", ") ? fp.split(", ") : [fp] + for (const part of parts) { + if (protected_(part)) return true + } + } + + // Check metadata.files[] (apply_patch file objects with absolute filePath/movePath) + const files = request.metadata?.files + if (Array.isArray(files)) { + for (const file of files) { + for (const key of ["filePath", "movePath"] as const) { + const val = file?.[key] + if (typeof val === "string" && protected_(val)) return true + } + } + } + + return false + } +} diff --git a/packages/opencode/src/kilocode/permission/drain.ts b/packages/opencode/src/kilocode/permission/drain.ts index 608932a4f0b..cfd6949c45d 100644 --- a/packages/opencode/src/kilocode/permission/drain.ts +++ b/packages/opencode/src/kilocode/permission/drain.ts @@ -1,6 +1,7 @@ import { Bus } from "@/bus" import { Wildcard } from "@/util/wildcard" import type { PermissionNext } from "@/permission/next" +import { ConfigProtection } from "@/kilocode/permission/config-paths" /** * Auto-resolve pending permissions now fully covered by approved or denied rules. @@ -25,6 +26,8 @@ export async function drainCovered( ) { for (const [id, entry] of Object.entries(pending)) { if (id === exclude) continue + // Never auto-resolve config file edit permissions + if (ConfigProtection.isRequest(entry.info)) continue const actions = entry.info.patterns.map((pattern) => evaluate(entry.info.permission, pattern, entry.ruleset, approved), ) diff --git a/packages/opencode/src/kilocode/plan-followup.ts b/packages/opencode/src/kilocode/plan-followup.ts index caf2df67db3..70cdab89fd6 100644 --- a/packages/opencode/src/kilocode/plan-followup.ts +++ b/packages/opencode/src/kilocode/plan-followup.ts @@ -5,6 +5,7 @@ import { TuiEvent } from "@/cli/cmd/tui/event" import { Flag } from "@/flag/flag" import { Global } from "@/global" import { Identifier } from "@/id/id" +import { Instance } from "@/project/instance" import { Provider } from "@/provider/provider" import { Question } from "@/question" import { Session } from "@/session" @@ -266,6 +267,7 @@ export namespace PlanFollowup { model: input.model, variant: input.variant, }) + const session = await Session.get(input.sessionID) const [handover, todos] = await Promise.all([ generateHandover({ messages: input.messages, model: input.model, abort: input.abort }), Todo.get(input.sessionID), @@ -282,24 +284,34 @@ export namespace PlanFollowup { sections.push(`## Todo List\n\n${todoList}`) } - const next = await Session.create({}) - await inject({ - sessionID: next.id, - agent: "code", - model: code.model, - variant: code.variant, - text: sections.join("\n\n"), - synthetic: false, + await Instance.provide({ + directory: session.directory, + fn: async () => { + const next = await Session.create({}) + await inject({ + sessionID: next.id, + agent: "code", + model: code.model, + variant: code.variant, + text: sections.join("\n\n"), + synthetic: false, + }) + if (todos.length) { + await Todo.update({ sessionID: next.id, todos }) + } + await Bus.publish(TuiEvent.SessionSelect, { sessionID: next.id }) + void import("@/session/prompt") + .then((item) => + Instance.provide({ + directory: next.directory, + fn: () => item.SessionPrompt.loop({ sessionID: next.id }), + }), + ) + .catch((error) => { + log.error("failed to start follow-up session", { sessionID: next.id, error }) + }) + }, }) - if (todos.length) { - await Todo.update({ sessionID: next.id, todos }) - } - await Bus.publish(TuiEvent.SessionSelect, { sessionID: next.id }) - void import("@/session/prompt") - .then((item) => item.SessionPrompt.loop({ sessionID: next.id })) - .catch((error) => { - log.error("failed to start follow-up session", { sessionID: next.id, error }) - }) } export async function ask(input: { diff --git a/packages/opencode/src/kilocode/session-import/routes.ts b/packages/opencode/src/kilocode/session-import/routes.ts new file mode 100644 index 00000000000..755a725f240 --- /dev/null +++ b/packages/opencode/src/kilocode/session-import/routes.ts @@ -0,0 +1,94 @@ +import { Hono } from "hono" +import { describeRoute, resolver, validator } from "hono-openapi" +import { lazy } from "../../util/lazy" +import { errors } from "../../server/error" +import { SessionImportService } from "./service" +import { SessionImportType } from "./types" + +export const SessionImportRoutes = lazy(() => + new Hono() + .post( + "/project", + describeRoute({ + summary: "Insert project for session import", + description: "Insert or update a project row used by legacy session import.", + operationId: "kilocode.sessionImport.project", + responses: { + 200: { + description: "Project import result", + content: { + "application/json": { + schema: resolver(SessionImportType.Result), + }, + }, + }, + ...errors(400), + }, + }), + validator("json", SessionImportType.Project), + async (c) => c.json(await SessionImportService.project(c.req.valid("json"))), + ) + .post( + "/session", + describeRoute({ + summary: "Insert session for session import", + description: "Insert or update a session row used by legacy session import.", + operationId: "kilocode.sessionImport.session", + responses: { + 200: { + description: "Session import result", + content: { + "application/json": { + schema: resolver(SessionImportType.Result), + }, + }, + }, + ...errors(400), + }, + }), + validator("json", SessionImportType.Session), + async (c) => c.json(await SessionImportService.session(c.req.valid("json"))), + ) + .post( + "/message", + describeRoute({ + summary: "Insert message for session import", + description: "Insert or update a message row used by legacy session import.", + operationId: "kilocode.sessionImport.message", + responses: { + 200: { + description: "Message import result", + content: { + "application/json": { + schema: resolver(SessionImportType.Result), + }, + }, + }, + ...errors(400), + }, + }), + validator("json", SessionImportType.Message), + async (c) => c.json(await SessionImportService.message(c.req.valid("json"))), + ) + .post( + "/part", + describeRoute({ + summary: "Insert part for session import", + description: "Insert or update a part row used by legacy session import.", + operationId: "kilocode.sessionImport.part", + responses: { + 200: { + description: "Part import result", + content: { + "application/json": { + schema: resolver(SessionImportType.Result), + }, + }, + }, + ...errors(400), + }, + }), + validator("json", SessionImportType.Part), + async (c) => c.json(await SessionImportService.part(c.req.valid("json"))), + ), +) diff --git a/packages/opencode/src/kilocode/session-import/service.ts b/packages/opencode/src/kilocode/session-import/service.ts new file mode 100644 index 00000000000..d3eab7ab5bb --- /dev/null +++ b/packages/opencode/src/kilocode/session-import/service.ts @@ -0,0 +1,98 @@ +import { Database } from "../../storage/db" +import { SessionTable, MessageTable, PartTable } from "../../session/session.sql" +import { SessionImportType } from "./types" +import { Project } from "../../project/project" +import { eq } from "drizzle-orm" + +const key = (input: unknown) => [input] as never +const target = (input: unknown) => input as never + +export namespace SessionImportService { + export async function project(input: SessionImportType.Project): Promise { + + // Do not resolve an empty legacy worktree, because that would fall back to the current + // process directory and silently attach the migrated session to the wrong project. + if (!input.worktree.trim()) { + throw new Error("Legacy project import requires a non-empty worktree") + } + + const result = await Project.fromDirectory(input.worktree) + return { ok: true, id: result.project.id } + } + + export async function session(input: SessionImportType.Session): Promise { + const row = Database.use((db) => db.select().from(SessionTable).where(eq(target(SessionTable.id), input.id)).get()) + if (row) return { ok: true, id: input.id, skipped: true } + + Database.use((db) => { + db.insert(SessionTable) + .values({ + id: input.id, + project_id: input.projectID, + workspace_id: input.workspaceID, + parent_id: input.parentID, + slug: input.slug, + directory: input.directory, + title: input.title, + version: input.version, + share_url: input.shareURL, + summary_additions: input.summary?.additions, + summary_deletions: input.summary?.deletions, + summary_files: input.summary?.files, + summary_diffs: input.summary?.diffs as never, + revert: input.revert, + permission: input.permission as never, + time_created: input.timeCreated, + time_updated: input.timeUpdated, + time_compacting: input.timeCompacting, + time_archived: input.timeArchived, + }) + .onConflictDoNothing({ + target: key(SessionTable.id), + }) + .run() + }) + return { ok: true, id: input.id } + } + + export async function message(input: SessionImportType.Message): Promise { + Database.use((db) => { + db.insert(MessageTable) + .values({ + id: input.id, + session_id: input.sessionID, + time_created: input.timeCreated, + data: input.data as never, + }) + .onConflictDoUpdate({ + target: key(MessageTable.id), + set: { + data: input.data as never, + }, + }) + .run() + }) + return { ok: true, id: input.id } + } + + export async function part(input: SessionImportType.Part): Promise { + Database.use((db) => { + db.insert(PartTable) + .values({ + id: input.id, + message_id: input.messageID, + session_id: input.sessionID, + time_created: input.timeCreated, + data: input.data as never, + }) + .onConflictDoUpdate({ + target: key(PartTable.id), + set: { + data: input.data as never, + }, + }) + .run() + }) + return { ok: true, id: input.id } + } +} diff --git a/packages/opencode/src/kilocode/session-import/types.ts b/packages/opencode/src/kilocode/session-import/types.ts new file mode 100644 index 00000000000..7bd5d6b9f14 --- /dev/null +++ b/packages/opencode/src/kilocode/session-import/types.ts @@ -0,0 +1,216 @@ +import z from "zod" + +export namespace SessionImportType { + export const UserMessageData = z.object({ + role: z.literal("user"), + time: z.object({ + created: z.number(), + }), + agent: z.string(), + model: z.object({ + providerID: z.string(), + modelID: z.string(), + }), + tools: z.record(z.string(), z.boolean()).optional(), + }) + + export const AssistantMessageData = z.object({ + role: z.literal("assistant"), + time: z.object({ + created: z.number(), + completed: z.number().optional(), + }), + parentID: z.string(), + modelID: z.string(), + providerID: z.string(), + mode: z.string(), + agent: z.string(), + path: z.object({ + cwd: z.string(), + root: z.string(), + }), + summary: z.boolean().optional(), + cost: z.number(), + tokens: z.object({ + total: z.number().optional(), + input: z.number(), + output: z.number(), + reasoning: z.number(), + cache: z.object({ + read: z.number(), + write: z.number(), + }), + }), + structured: z.unknown().optional(), + variant: z.string().optional(), + finish: z.string().optional(), + }) + + export const MessageData = z.discriminatedUnion("role", [UserMessageData, AssistantMessageData]) + + export const TextPartData = z.object({ + type: z.literal("text"), + text: z.string(), + synthetic: z.boolean().optional(), + ignored: z.boolean().optional(), + time: z + .object({ + start: z.number(), + end: z.number().optional(), + }) + .optional(), + metadata: z.record(z.string(), z.unknown()).optional(), + }) + + export const ReasoningPartData = z.object({ + type: z.literal("reasoning"), + text: z.string(), + metadata: z.record(z.string(), z.unknown()).optional(), + time: z.object({ + start: z.number(), + end: z.number().optional(), + }), + }) + + export const ToolStatePending = z.object({ + status: z.literal("pending"), + input: z.record(z.string(), z.unknown()), + raw: z.string(), + }) + + export const ToolStateRunning = z.object({ + status: z.literal("running"), + input: z.record(z.string(), z.unknown()), + title: z.string().optional(), + metadata: z.record(z.string(), z.unknown()).optional(), + time: z.object({ + start: z.number(), + }), + }) + + export const ToolStateCompleted = z.object({ + status: z.literal("completed"), + input: z.record(z.string(), z.unknown()), + output: z.string(), + title: z.string(), + metadata: z.record(z.string(), z.unknown()), + time: z.object({ + start: z.number(), + end: z.number(), + compacted: z.number().optional(), + }), + }) + + export const ToolStateError = z.object({ + status: z.literal("error"), + input: z.record(z.string(), z.unknown()), + error: z.string(), + metadata: z.record(z.string(), z.unknown()).optional(), + time: z.object({ + start: z.number(), + end: z.number(), + }), + }) + + export const ToolState = z.discriminatedUnion("status", [ToolStatePending, ToolStateRunning, ToolStateCompleted, ToolStateError]) + + export const ToolPartData = z.object({ + type: z.literal("tool"), + callID: z.string(), + tool: z.string(), + state: ToolState, + metadata: z.record(z.string(), z.unknown()).optional(), + }) + + export const PartData = z.discriminatedUnion("type", [TextPartData, ReasoningPartData, ToolPartData]) + + export const Result = z.object({ + ok: z.boolean(), + id: z.string(), + skipped: z.boolean().optional(), + }) + + export const Project = z.object({ + id: z.string(), + worktree: z.string(), + vcs: z.string().optional(), + name: z.string().optional(), + iconUrl: z.string().optional(), + iconColor: z.string().optional(), + timeCreated: z.number(), + timeUpdated: z.number(), + timeInitialized: z.number().optional(), + sandboxes: z.array(z.string()), + commands: z + .object({ + start: z.string().optional(), + }) + .optional(), + }) + + export const Session = z.object({ + id: z.string(), + projectID: z.string(), + workspaceID: z.string().optional(), + parentID: z.string().optional(), + slug: z.string(), + directory: z.string(), + title: z.string(), + version: z.string(), + shareURL: z.string().optional(), + summary: z + .object({ + additions: z.number(), + deletions: z.number(), + files: z.number(), + diffs: z.array(z.record(z.string(), z.unknown())).optional(), + }) + .optional(), + revert: z + .object({ + messageID: z.string(), + partID: z.string().optional(), + snapshot: z.string().optional(), + diff: z.string().optional(), + }) + .optional(), + permission: z.record(z.string(), z.unknown()).optional(), + timeCreated: z.number(), + timeUpdated: z.number(), + timeCompacting: z.number().optional(), + timeArchived: z.number().optional(), + }) + + export const Message = z.object({ + id: z.string(), + sessionID: z.string(), + timeCreated: z.number(), + data: MessageData, + }) + + export const Part = z.object({ + id: z.string(), + messageID: z.string(), + sessionID: z.string(), + timeCreated: z.number().optional(), + data: PartData, + }) + + export type Result = z.infer + export type UserMessageData = z.infer + export type AssistantMessageData = z.infer + export type MessageData = z.infer + export type TextPartData = z.infer + export type ReasoningPartData = z.infer + export type ToolStatePending = z.infer + export type ToolStateRunning = z.infer + export type ToolStateCompleted = z.infer + export type ToolStateError = z.infer + export type ToolState = z.infer + export type ToolPartData = z.infer + export type PartData = z.infer + export type Project = z.infer + export type Session = z.infer + export type Message = z.infer + export type Part = z.infer +} diff --git a/packages/opencode/src/kilocode/skills/builtin.ts b/packages/opencode/src/kilocode/skills/builtin.ts new file mode 100644 index 00000000000..9172a39cf95 --- /dev/null +++ b/packages/opencode/src/kilocode/skills/builtin.ts @@ -0,0 +1,21 @@ +// kilocode_change - new file +// Built-in skills that ship inside the CLI binary. +// Content is inlined at compile time via Bun's static import of .md files. +// Registered before all discovery phases so user skills with the same name override. + +import KILO_CONFIG from "./kilo-config.md" + +export interface BuiltinSkill { + name: string + description: string + content: string +} + +export const BUILTIN_SKILLS: BuiltinSkill[] = [ + { + name: "kilo-config", + description: + "Guide for configuring Kilo CLI: commands, agents, MCP servers, skills, permissions, instructions, plugins, providers, all kilo.json fields, and TUI settings (themes, appearance, keybinds, ctrl+p commands). Use when the user asks about configuring, customizing, or changing settings in Kilo.", + content: KILO_CONFIG, + }, +] diff --git a/packages/opencode/src/kilocode/skills/kilo-config.md b/packages/opencode/src/kilocode/skills/kilo-config.md new file mode 100644 index 00000000000..70289d08dcd --- /dev/null +++ b/packages/opencode/src/kilocode/skills/kilo-config.md @@ -0,0 +1,211 @@ +# Kilo CLI Configuration Reference + +All config lives in `kilo.json` (or `kilo.jsonc`). Precedence low-to-high: remote well-known, global (`~/.config/kilo/kilo.json`), env `KILO_CONFIG`, project `./kilo.json`, `.kilo/kilo.json`, `KILO_CONFIG_CONTENT`, managed (see Config File Locations). Deep-merged; later wins. + +## Commands (`.kilo/command/*.md`) + +Markdown files with YAML frontmatter. The filename (minus `.md`) becomes the command name invoked via `/name`. + +```yaml +--- +description: Run tests # optional, shown in command list +agent: code # optional, route to a specific agent +model: anthropic/claude-sonnet # optional, override model +subtask: true # optional, run as subtask +--- +Run all tests in $1 and fix failures. +Use $ARGUMENTS for the full arg string. +Reference files with @file and shell output with !`cmd`. +``` + +Template variables: `$1`-`$N` (positional args), `$ARGUMENTS` (full string), `@file` (file contents), `` !`cmd` `` (shell output). + +## Agents (`.kilo/agent/*.md`) + +```yaml +--- +description: When to use this agent +mode: primary # primary | subagent | all +model: anthropic/claude-sonnet # optional override +steps: 25 # max agentic iterations +hidden: false # hide from @ menu (subagent only) +color: "#FF5733" # hex or theme name +permission: # optional, agent-level permissions + bash: allow + edit: + "src/**": allow + "*": ask +--- +System prompt for this agent. +``` + +`mode` values: `primary` = selectable as main agent, `subagent` = only via Task tool, `all` = both. + +## Permissions + +Scalar form applies to all patterns. Object form maps glob patterns to actions. Evaluated top-to-bottom; first match wins. + +```jsonc +{ + "permission": { + "bash": "allow", // scalar: allow all bash + "edit": { + // object: pattern-matched + "src/**": "allow", + "*.lock": "deny", + "*": "ask", // fallback + }, + "read": "ask", + "skill": { "my-skill": "allow" }, + "external_directory": "deny", + }, +} +``` + +Actions: `"allow"`, `"ask"`, `"deny"`. Set `null` to delete an inherited key. + +Tool permissions: `read`, `edit`, `glob`, `grep`, `list`, `bash`, `task`, `webfetch`, `websearch`, `codesearch`, `lsp`, `skill`, `external_directory`, `todowrite`, `todoread`, `question`, `doom_loop`. + +## MCP Servers + +```jsonc +{ + "mcp": { + "local-server": { + "type": "local", + "command": ["node", "server.js"], + "environment": { "PORT": "3000" }, + "enabled": true, + "timeout": 10000, + }, + "remote-server": { + "type": "remote", + "url": "https://mcp.example.com", + "headers": { "Authorization": "Bearer ..." }, + "oauth": { "clientId": "...", "scope": "read" }, + "enabled": true, + }, + }, +} +``` + +Disable an inherited server: `{ "server-name": { "enabled": false } }`. + +## Providers + +```jsonc +{ + "provider": { + "anthropic": { + "options": { + "apiKey": "sk-...", + "baseURL": "https://custom.endpoint/v1", + "timeout": 300000, + }, + "models": { + "custom-model": { "name": "My Model" }, + }, + "whitelist": ["claude-*"], + "blacklist": ["claude-2*"], + }, + }, + "disabled_providers": ["openai"], + "enabled_providers": ["anthropic"], +} +``` + +## Skills + +Additional skill directories and remote URLs: + +```jsonc +{ + "skills": { + "paths": ["./my-skills", "~/shared-skills"], + "urls": ["https://example.com/.well-known/skills/"], + }, +} +``` + +Skills are markdown files at `skills//SKILL.md` with `name` and `description` in frontmatter. + +## Other Top-Level Fields + +| Field | Type | Description | +| ------------------ | ------------------------------ | --------------------------------------------------- | +| `model` | `"provider/model"` | Default model | +| `small_model` | `"provider/model"` | Model for titles/summaries | +| `default_agent` | `string` | Default primary agent (fallback: `code`) | +| `instructions` | `string[]` | Glob patterns for additional instruction files | +| `plugin` | `string[]` | Plugin specifiers (npm packages or `file://` paths) | +| `snapshot` | `boolean` | Enable git snapshots | +| `share` | `"manual"\|"auto"\|"disabled"` | Session sharing mode | +| `autoupdate` | `boolean\|"notify"` | Auto-update behavior | +| `username` | `string` | Display name override | +| `compaction.auto` | `boolean` | Auto-compact when context full (default: true) | +| `compaction.prune` | `boolean` | Prune old tool outputs (default: true) | + +## TUI Settings (Ctrl+P Command Palette) + +The CLI TUI has runtime settings accessible via `Ctrl+P` (command palette) or slash commands. **These are user-interactive only — the agent cannot change them programmatically.** When users ask to change these settings, tell them which command palette entry, keybind, or slash command to use. + +Leader key default: `ctrl+x`. Keybinds below use `` prefix (e.g. `t` = `ctrl+x` then `t`). + +### Theme & Appearance + +| Action | Keybind | Slash | Notes | +| ------------------------------ | ----------- | --------- | -------------------------------------------------------------------------------------------------- | +| Switch theme | `t` | `/themes` | Pick from 35+ built-in themes (kilo, catppuccin, dracula, github, gruvbox, nord, tokyonight, etc.) | +| Toggle appearance (dark/light) | — | — | Ctrl+P → "Toggle appearance" | + +Custom themes: place JSON files in `~/.config/kilo/themes/` or `.kilo/themes/`. + +### Session + +| Action | Keybind | Slash | +| ------------------ | ----------- | ------------------------ | +| List sessions | `l` | `/sessions` | +| New session | `n` | `/new`, `/clear` | +| Share session | — | `/share` | +| Rename session | `ctrl+r` | `/rename` | +| Jump to message | `g` | `/timeline` | +| Fork from message | — | `/fork` | +| Compact/summarize | `c` | `/compact`, `/summarize` | +| Undo message | `u` | `/undo` | +| Redo | `r` | `/redo` | +| Copy last response | `y` | — | +| Copy transcript | — | `/copy` | + +### Agent & Model + +| Action | Keybind | Slash | +| ------------ | ------------------- | --------- | +| Switch model | `m` | `/models` | +| Switch agent | `a` | `/agents` | +| Toggle MCPs | — | `/mcps` | +| Cycle agent | `tab` / `shift+tab` | — | + +### Display Toggles (via Ctrl+P) + +Toggle notifications, Toggle animations, Toggle diff wrapping, Toggle sidebar (`b`), Toggle thinking (`/thinking`), Toggle tool details, Toggle timestamps (`/timestamps`), Toggle scrollbar, Toggle header, Toggle code concealment (`h`). + +### System + +| Action | Slash | +| ----------- | ---------------------- | +| View status | `/status` | +| Help | `/help` | +| Exit | `/exit`, `/quit`, `/q` | +| Open editor | `/editor` | + +## Config File Locations + +| Scope | Path | +| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Project | `./kilo.json`, `./.kilo/kilo.json` | +| Global | `~/.config/kilo/kilo.json` | +| Managed | Linux: `/etc/kilo/kilo.json`, macOS: `/Library/Application Support/kilo/kilo.json`, Windows: `%ProgramData%\kilo\kilo.json` (enterprise, highest priority) | +| Commands | `.kilo/command/*.md` (project), `~/.config/kilo/command/*.md` (global) | +| Agents | `.kilo/agent/*.md` (project), `~/.config/kilo/agent/*.md` (global) | +| Skills | `.kilo/skill/*/SKILL.md`, `.kilo/skills/*/SKILL.md` | +| Instructions | `AGENTS.md`, `.kilo/instructions.md`, glob patterns from `instructions` | diff --git a/packages/opencode/src/kilocode/snapshot.ts b/packages/opencode/src/kilocode/snapshot.ts new file mode 100644 index 00000000000..3790bc370f5 --- /dev/null +++ b/packages/opencode/src/kilocode/snapshot.ts @@ -0,0 +1,62 @@ +import { $ } from "bun" +import path from "path" +import fs from "fs/promises" +import { Filesystem } from "../util/filesystem" +import { Log } from "../util/log" +import { Global } from "../global" +import { Instance } from "../project/instance" + +const log = Log.create({ service: "snapshot" }) + +/** Worktree-scoped snapshot git dir (isolated per worktree). */ +export function gitdir() { + const project = Instance.project + const workhash = Bun.hash(Instance.worktree).toString(36) + return path.join(Global.Path.data, "snapshot", project.id, workhash) +} + +/** Original project-scoped snapshot git dir (pre-isolation layout). */ +function legacydir() { + const project = Instance.project + return path.join(Global.Path.data, "snapshot", project.id) +} + +/** Initialize a bare snapshot git repo if it doesn't exist yet. */ +export async function ensureGit(git: string) { + if (!(await fs.mkdir(git, { recursive: true }))) return + await $`git init` + .env({ + ...process.env, + GIT_DIR: git, + GIT_WORK_TREE: Instance.worktree, + }) + .quiet() + .nothrow() + await $`git --git-dir ${git} config core.autocrlf false`.quiet().nothrow() + await $`git --git-dir ${git} config core.longpaths true`.quiet().nothrow() + await $`git --git-dir ${git} config core.symlinks true`.quiet().nothrow() + await $`git --git-dir ${git} config core.fsmonitor false`.quiet().nothrow() + log.info("initialized") +} + +/** Point the worktree repo's alternates at the legacy object store. */ +export async function syncAlternates(git: string) { + const legacy = legacydir() + if (legacy === git) return + const objects = path.join(legacy, "objects") + const exists = await fs + .stat(objects) + .then(() => true) + .catch(() => false) + const target = path.join(git, "objects", "info", "alternates") + await fs.mkdir(path.join(git, "objects", "info"), { recursive: true }) + await Filesystem.write(target, exists ? objects + "\n" : "") +} + +/** Return a ready-to-use snapshot git dir (init + alternates). */ +export async function prepare() { + const git = gitdir() + await ensureGit(git) + await syncAlternates(git) + return git +} diff --git a/packages/opencode/src/kilocode/ts-check.ts b/packages/opencode/src/kilocode/ts-check.ts index 449609df830..9deb9506929 100644 --- a/packages/opencode/src/kilocode/ts-check.ts +++ b/packages/opencode/src/kilocode/ts-check.ts @@ -29,6 +29,7 @@ export namespace TsCheck { cwd: root, stdout: "pipe", stderr: "pipe", + windowsHide: true, env: { ...process.env }, }) diff --git a/packages/opencode/src/mcp/index.ts b/packages/opencode/src/mcp/index.ts index 9ffbce1a0ba..a828bdaa59d 100644 --- a/packages/opencode/src/mcp/index.ts +++ b/packages/opencode/src/mcp/index.ts @@ -121,6 +121,7 @@ export namespace MCP { function registerNotificationHandlers(client: MCPClient, serverName: string) { client.setNotificationHandler(ToolListChangedNotificationSchema, async () => { log.info("tools list changed notification received", { server: serverName }) + ;(await state()).toolsCache.delete(serverName) // kilocode_change Bus.publish(ToolsChanged, { server: serverName }) }) } @@ -224,6 +225,7 @@ export namespace MCP { return { status, clients, + toolsCache: new Map(), // kilocode_change — per-server listTools cache } }, async (state) => { @@ -302,6 +304,7 @@ export namespace MCP { export async function add(name: string, mcp: Config.Mcp) { const s = await state() + s.toolsCache.delete(name) // kilocode_change const result = await create(name, mcp) if (!result) { const status = { @@ -559,6 +562,7 @@ export namespace MCP { } export async function connect(name: string) { + ;(await state()).toolsCache.delete(name) // kilocode_change const cfg = await Config.get() const config = cfg.mcp ?? {} const mcp = config[name] @@ -599,6 +603,7 @@ export namespace MCP { export async function disconnect(name: string) { const s = await state() + s.toolsCache.delete(name) // kilocode_change const client = s.clients[name] if (client) { await client.close().catch((error) => { @@ -623,6 +628,12 @@ export namespace MCP { const toolsResults = await Promise.all( connectedClients.map(async ([clientName, client]) => { + // kilocode_change start — use cached listTools when available + const cached = s.toolsCache.get(clientName) + if (cached) { + return { clientName, client, toolsResult: { tools: cached } } + } + // kilocode_change end const toolsResult = await client.listTools().catch((e) => { log.error("failed to get tools", { clientName, error: e.message }) const failedStatus = { @@ -633,6 +644,7 @@ export namespace MCP { delete s.clients[clientName] return undefined }) + if (toolsResult) s.toolsCache.set(clientName, toolsResult.tools) // kilocode_change return { clientName, client, toolsResult } }), ) diff --git a/packages/opencode/src/md.d.ts b/packages/opencode/src/md.d.ts new file mode 100644 index 00000000000..eb3e3b92d66 --- /dev/null +++ b/packages/opencode/src/md.d.ts @@ -0,0 +1,4 @@ +declare module "*.md" { + const content: string + export default content +} diff --git a/packages/opencode/src/permission/next.ts b/packages/opencode/src/permission/next.ts index 5534572da26..b68fafd1f8a 100644 --- a/packages/opencode/src/permission/next.ts +++ b/packages/opencode/src/permission/next.ts @@ -9,6 +9,7 @@ import { fn } from "@/util/fn" import { Log } from "@/util/log" import { Wildcard } from "@/util/wildcard" import { drainCovered } from "@/kilocode/permission/drain" // kilocode_change +import { ConfigProtection } from "@/kilocode/permission/config-paths" // kilocode_change import os from "os" import z from "zod" @@ -188,18 +189,27 @@ export namespace PermissionNext { async (input) => { const s = await state() const { ruleset, ...request } = input + // kilocode_change start — force "ask" for config file edits + const protected_ = ConfigProtection.isRequest(request) + // kilocode_change end for (const pattern of request.patterns ?? []) { const rule = evaluate(request.permission, pattern, ruleset, s.approved) log.info("evaluated", { permission: request.permission, pattern, action: rule }) if (rule.action === "deny") throw new DeniedError(ruleset.filter((r) => Wildcard.match(request.permission, r.permission))) - if (rule.action === "ask") { + // kilocode_change start — override "allow" to "ask" for config paths + if (rule.action === "ask" || (rule.action === "allow" && protected_)) { const id = input.id ?? Identifier.ascending("permission") return new Promise((resolve, reject) => { const info: Request = { id, ...request, + metadata: { + ...request.metadata, + ...(protected_ ? { [ConfigProtection.DISABLE_ALWAYS_KEY]: true } : {}), + }, } + // kilocode_change end s.pending[id] = { info, ruleset, // kilocode_change @@ -227,6 +237,10 @@ export namespace PermissionNext { const existing = s.pending[input.requestID] if (!existing) throw new NotFoundError({ message: `Permission request ${input.requestID} not found` }) + // kilocode_change start — skip rule persistence for config file edits + if (ConfigProtection.isRequest(existing.info)) return + // kilocode_change end + // Combine metadata.rules (bash hierarchy) and always (all tools). // Set preserves insertion order and deduplicates. const validRules = new Set([...(existing.info.metadata?.rules ?? []), ...existing.info.always]) @@ -289,6 +303,13 @@ export namespace PermissionNext { return } if (input.reply === "always") { + // kilocode_change start — downgrade "always" to "once" for config file edits + if (ConfigProtection.isRequest(existing.info)) { + existing.resolve() + return + } + // kilocode_change end + for (const pattern of existing.info.always) { s.approved.push({ permission: existing.info.permission, diff --git a/packages/opencode/src/provider/model-cache.ts b/packages/opencode/src/provider/model-cache.ts index 1d1a2d4e129..d902a40e881 100644 --- a/packages/opencode/src/provider/model-cache.ts +++ b/packages/opencode/src/provider/model-cache.ts @@ -164,11 +164,69 @@ export namespace ModelCache { return fetchKiloModels(options) } + // kilocode_change start + if (providerID === "apertis") { + return fetchApertisModels(options) + } + // kilocode_change end + // Other providers not implemented yet log.debug("provider not implemented", { providerID }) return {} } + // kilocode_change start + const APERTIS_BASE_URL = "https://api.apertis.ai/v1" + + async function fetchApertisModels(options: any): Promise> { + const baseURL = options.baseURL ?? APERTIS_BASE_URL + const apiKey = options.apiKey + + if (!apiKey) { + log.debug("no API key for apertis, skipping model fetch") + return {} + } + + const url = `${baseURL.replace(/\/+$/, "")}/models` + const response = await fetch(url, { + headers: { + Authorization: `Bearer ${apiKey}`, + }, + signal: AbortSignal.timeout(10_000), + }) + + if (!response.ok) { + log.error("apertis model fetch failed", { status: response.status }) + return {} + } + + const json = (await response.json()) as { data?: Array<{ id: string; owned_by?: string }> } + const models: Record = {} + + for (const model of json.data ?? []) { + models[model.id] = { + id: model.id, + name: model.id, + family: model.owned_by ?? "", + release_date: "", + attachment: false, + reasoning: false, + temperature: true, + tool_call: true, + cost: { input: 0, output: 0 }, + limit: { context: 128000, output: 4096 }, + options: {}, + modalities: { + input: ["text"], + output: ["text"], + }, + } + } + + return models + } + // kilocode_change end + /** * Get authentication options from multiple sources * Priority: Config > Auth > Env @@ -223,6 +281,38 @@ export namespace ModelCache { }) } + // kilocode_change start + if (providerID === "apertis") { + const config = await Config.get() + const providerConfig = config.provider?.[providerID] + if (providerConfig?.options?.apiKey) { + options.apiKey = providerConfig.options.apiKey + } + if (providerConfig?.options?.baseURL) { + options.baseURL = providerConfig.options.baseURL + } + + const auth = await Auth.get(providerID) + if (auth && auth.type === "api") { + options.apiKey = auth.key + } + + const env = Env.all() + if (env.APERTIS_API_KEY) { + options.apiKey = env.APERTIS_API_KEY + } + if (env.APERTIS_BASE_URL) { + options.baseURL = env.APERTIS_BASE_URL + } + + log.debug("apertis auth options resolved", { + providerID, + hasKey: !!options.apiKey, + hasBaseURL: !!options.baseURL, + }) + } + // kilocode_change end + return options } } diff --git a/packages/opencode/src/provider/models.ts b/packages/opencode/src/provider/models.ts index 86d5178f8d5..5d97f0939b3 100644 --- a/packages/opencode/src/provider/models.ts +++ b/packages/opencode/src/provider/models.ts @@ -139,8 +139,15 @@ export namespace ModelsDev { } // Inject kilo provider with dynamic model fetching - if (!providers["kilo"]) { - const config = await Config.get() + // Skip injection entirely when enabled_providers is set and doesn't include "kilo", + // or when "kilo" is in disabled_providers. This prevents unnecessary network calls + // to the Kilo API for teams using only their own providers (e.g. LiteLLM). + const config = await Config.get() + const disabled = new Set(config.disabled_providers ?? []) + const enabled = config.enabled_providers ? new Set(config.enabled_providers) : null + const kiloAllowed = (!enabled || enabled.has("kilo")) && !disabled.has("kilo") + + if (kiloAllowed && !providers["kilo"]) { const kiloOptions = config.provider?.kilo?.options // kilocode_change start - resolve org ID from auth (OAuth accountId) not just config const kiloAuth = await Auth.get("kilo") @@ -171,6 +178,28 @@ export namespace ModelsDev { } } + // Inject Apertis provider with dynamic model fetching + if (!providers["apertis"]) { + const apertisConfigObj = await Config.get() + const apertisConfig = apertisConfigObj.provider?.apertis?.options + const apertisBaseURL = apertisConfig?.baseURL ?? "https://api.apertis.ai/v1" + const apertisFetchOptions = { + ...(apertisConfig?.baseURL ? { baseURL: apertisConfig.baseURL } : {}), + } + const apertisModels = await ModelCache.fetch("apertis", apertisFetchOptions).catch(() => ({})) + providers["apertis"] = { + id: "apertis", + name: "Apertis", + env: ["APERTIS_API_KEY"], + api: apertisBaseURL, + npm: "@ai-sdk/openai-compatible", + models: apertisModels, + } + if (Object.keys(apertisModels).length === 0) { + ModelCache.refresh("apertis", apertisFetchOptions).catch(() => {}) + } + } + return providers // kilocode_change end } diff --git a/packages/opencode/src/server/routes/config.ts b/packages/opencode/src/server/routes/config.ts index e6ac26bb0dc..f9ac7e42976 100644 --- a/packages/opencode/src/server/routes/config.ts +++ b/packages/opencode/src/server/routes/config.ts @@ -89,10 +89,16 @@ export const ConfigRoutes = lazy(() => const providers = await Provider.list() // kilocode_change start - Fetch default model from Kilo API - const kiloAuth = await Auth.get("kilo") - const token = kiloAuth?.type === "oauth" ? kiloAuth.access : kiloAuth?.key - const organizationId = kiloAuth?.type === "oauth" ? kiloAuth.accountId : undefined - const kiloApiDefault = await fetchDefaultModel(token, organizationId) + // Only call the Kilo API when the kilo provider is actually available. + // This prevents unnecessary network calls for teams using only their + // own providers (e.g. LiteLLM) via enabled_providers config. + let kiloApiDefault: string | undefined + if (providers["kilo"]) { + const kiloAuth = await Auth.get("kilo") + const token = kiloAuth?.type === "oauth" ? kiloAuth.access : kiloAuth?.key + const organizationId = kiloAuth?.type === "oauth" ? kiloAuth.accountId : undefined + kiloApiDefault = await fetchDefaultModel(token, organizationId) + } // kilocode_change end // kilocode_change start - Use API default for Kilo provider if valid diff --git a/packages/opencode/src/server/routes/kilocode.ts b/packages/opencode/src/server/routes/kilocode.ts index aa7d0503994..75572a9ad84 100644 --- a/packages/opencode/src/server/routes/kilocode.ts +++ b/packages/opencode/src/server/routes/kilocode.ts @@ -8,9 +8,11 @@ import { Skill } from "../../skill/skill" import { Agent } from "../../agent/agent" import { lazy } from "../../util/lazy" import { errors } from "../error" +import { SessionImportRoutes } from "../../kilocode/session-import/routes" export const KilocodeRoutes = lazy(() => new Hono() + .route("/session-import", SessionImportRoutes()) .post( "/skill/remove", describeRoute({ diff --git a/packages/opencode/src/server/server.ts b/packages/opencode/src/server/server.ts index c5cb6490d8f..76871008688 100644 --- a/packages/opencode/src/server/server.ts +++ b/packages/opencode/src/server/server.ts @@ -101,7 +101,7 @@ export namespace Server { return basicAuth({ username, password })(c, next) }) .use(async (c, next) => { - const skipLogging = c.req.path === "/log" + const skipLogging = c.req.path === "/log" || c.req.path === "/telemetry/capture" // kilocode_change if (!skipLogging) { log.info("request", { method: c.req.method, diff --git a/packages/opencode/src/session/index.ts b/packages/opencode/src/session/index.ts index f7141c759e7..a61cbe5c533 100644 --- a/packages/opencode/src/session/index.ts +++ b/packages/opencode/src/session/index.ts @@ -23,6 +23,7 @@ import { fn } from "@/util/fn" import { Command } from "../command" import { Snapshot } from "@/snapshot" import { WorkspaceContext } from "../control-plane/workspace-context" +import { Filesystem } from "../util/filesystem" // kilocode_change: normalize directory for Windows drive-letter casing import type { Provider } from "@/provider/provider" import { PermissionNext } from "@/permission/next" @@ -578,7 +579,9 @@ export namespace Session { conditions.push(eq(SessionTable.workspace_id, WorkspaceContext.workspaceID)) } if (input?.directory) { - conditions.push(eq(SessionTable.directory, input.directory)) + // kilocode_change start: vscode uri.fsPath gives lowercase drive letter on Windows; resolve() canonicalises to match stored path + conditions.push(eq(SessionTable.directory, Filesystem.resolve(input.directory))) + // kilocode_change end } if (input?.roots) { conditions.push(isNull(SessionTable.parent_id)) @@ -618,7 +621,9 @@ export namespace Session { const conditions: SQL[] = [] if (input?.directory) { - conditions.push(eq(SessionTable.directory, input.directory)) + // kilocode_change start: vscode uri.fsPath gives lowercase drive letter on Windows; resolve() canonicalises to match stored path + conditions.push(eq(SessionTable.directory, Filesystem.resolve(input.directory))) + // kilocode_change end } if (input?.roots) { conditions.push(isNull(SessionTable.parent_id)) diff --git a/packages/opencode/src/session/message-v2.ts b/packages/opencode/src/session/message-v2.ts index e468d1f2604..1e84d3433e6 100644 --- a/packages/opencode/src/session/message-v2.ts +++ b/packages/opencode/src/session/message-v2.ts @@ -503,6 +503,62 @@ export namespace MessageV2 { }) export type WithParts = z.infer + // kilocode_change start - strip bloated metadata fields from stored parts to prevent multi-MB payloads + // This handles both legacy data that was stored with full file contents and keeps the API response lean. + function stripPartMetadata(part: Part): Part { + if (part.type !== "tool") return part + const { state } = part + if (state.status !== "completed" && state.status !== "running") return part + const meta = state.metadata + if (!meta) return part + + let changed = false + let next = meta + + // Strip edit tool's filediff.before/after (full file contents) + if (meta.filediff && (meta.filediff.before || meta.filediff.after)) { + const { before, after, ...rest } = meta.filediff + next = { ...next, filediff: rest } + changed = true + } + + // Strip apply_patch tool's files[].before/after (full file contents per file) + if (Array.isArray(meta.files) && meta.files.length > 0 && meta.files[0]?.before !== undefined) { + next = { + ...next, + files: meta.files.map((f: Record) => { + const { before, after, ...rest } = f + return rest + }), + } + changed = true + } + + if (!changed) return part + return { ...part, state: { ...state, metadata: next } } as Part + } + + function stripMessageMetadata(info: Info): Info { + // Strip summary.diffs before/after from user messages (can be 20+ MB) + if (info.role !== "user") return info + const user = info as User + if (!user.summary?.diffs?.length) return info + const has = user.summary.diffs.some((d: Snapshot.FileDiff) => d.before || d.after) + if (!has) return info + return { + ...user, + summary: { + ...user.summary, + diffs: user.summary.diffs.map(({ before, after, ...rest }: Snapshot.FileDiff) => ({ + ...rest, + before: "", + after: "", + })), + }, + } as Info + } + // kilocode_change end + export function toModelMessages( input: WithParts[], model: Provider.Model, @@ -766,12 +822,12 @@ export namespace MessageV2 { .all(), ) for (const row of partRows) { - const part = { + const part = stripPartMetadata({ ...row.data, id: row.id, sessionID: row.session_id, messageID: row.message_id, - } as MessageV2.Part + } as MessageV2.Part) // kilocode_change - strip bloated metadata on read const list = partsByMessage.get(row.message_id) if (list) list.push(part) else partsByMessage.set(row.message_id, [part]) @@ -779,7 +835,7 @@ export namespace MessageV2 { } for (const row of rows) { - const info = { ...row.data, id: row.id, sessionID: row.session_id } as MessageV2.Info + const info = stripMessageMetadata({ ...row.data, id: row.id, sessionID: row.session_id } as MessageV2.Info) // kilocode_change yield { info, parts: partsByMessage.get(row.id) ?? [], @@ -796,7 +852,13 @@ export namespace MessageV2 { db.select().from(PartTable).where(eq(PartTable.message_id, message_id)).orderBy(PartTable.id).all(), ) return rows.map( - (row) => ({ ...row.data, id: row.id, sessionID: row.session_id, messageID: row.message_id }) as MessageV2.Part, + (row) => + stripPartMetadata({ + ...row.data, + id: row.id, + sessionID: row.session_id, + messageID: row.message_id, + } as MessageV2.Part), // kilocode_change - strip bloated metadata on read ) }) @@ -808,7 +870,7 @@ export namespace MessageV2 { async (input): Promise => { const row = Database.use((db) => db.select().from(MessageTable).where(eq(MessageTable.id, input.messageID)).get()) if (!row) throw new Error(`Message not found: ${input.messageID}`) - const info = { ...row.data, id: row.id, sessionID: row.session_id } as MessageV2.Info + const info = stripMessageMetadata({ ...row.data, id: row.id, sessionID: row.session_id } as MessageV2.Info) // kilocode_change return { info, parts: await parts(input.messageID), diff --git a/packages/opencode/src/session/processor.ts b/packages/opencode/src/session/processor.ts index 585facce3d4..e95c3e1e3a5 100644 --- a/packages/opencode/src/session/processor.ts +++ b/packages/opencode/src/session/processor.ts @@ -16,6 +16,7 @@ import { SessionCompaction } from "./compaction" import { PermissionNext } from "@/permission/next" import { Question } from "@/question" import { Telemetry } from "@kilocode/kilo-telemetry" // kilocode_change +import { Flag } from "@/flag/flag" // kilocode_change export namespace SessionProcessor { const DOOM_LOOP_THRESHOLD = 3 @@ -134,6 +135,30 @@ export namespace SessionProcessor { break case "tool-call": { + // kilocode_change start + // If tool-input-start was never emitted, this can happen if arguments are unparseable, + // create the tool part now to prevent missing tool results down the line. + if (!toolcalls[value.toolCallId] && !value.providerExecuted) { + log.warn("tool-call without prior tool-input-start", { + toolCallId: value.toolCallId, + toolName: value.toolName, + }) + const created = await Session.updatePart({ + id: Identifier.ascending("part"), + messageID: input.assistantMessage.id, + sessionID: input.assistantMessage.sessionID, + type: "tool", + tool: value.toolName, + callID: value.toolCallId, + state: { + status: "pending", + input: {}, + raw: "", + }, + }) + toolcalls[value.toolCallId] = created as MessageV2.ToolPart + } + // kilocode_change end const match = toolcalls[value.toolCallId] if (match) { const part = await Session.updatePart({ @@ -387,7 +412,11 @@ export namespace SessionProcessor { }) } else { const retry = SessionRetry.retryable(error) - if (retry !== undefined) { + if ( + retry !== undefined && + (Flag.KILO_SESSION_RETRY_LIMIT === undefined || attempt < Flag.KILO_SESSION_RETRY_LIMIT) + ) { + // kilocode_change attempt++ const delay = SessionRetry.delay(attempt, error.name === "APIError" ? error : undefined) SessionStatus.set(input.sessionID, { @@ -438,6 +467,13 @@ export namespace SessionProcessor { }) } } + // kilocode_change start — guard empty tool-calls (#7756) + const empty = input.assistantMessage.finish === "tool-calls" && !p.some((part) => part.type === "tool") + if (empty) { + log.warn("empty tool-calls", { messageID: input.assistantMessage.id }) + input.assistantMessage.finish = "stop" + } + // kilocode_change end input.assistantMessage.time.completed = Date.now() await Session.updateMessage(input.assistantMessage) if (needsCompaction) return "compact" diff --git a/packages/opencode/src/session/prompt.ts b/packages/opencode/src/session/prompt.ts index 3345aca761e..01e728afc3a 100644 --- a/packages/opencode/src/session/prompt.ts +++ b/packages/opencode/src/session/prompt.ts @@ -1418,16 +1418,24 @@ export namespace SessionPrompt { // Original logic when experimental plan mode is disabled if (!Flag.KILO_EXPERIMENTAL_PLAN_MODE) { + // kilocode_change start - inject plan file path so agent writes to .kilo/plans/ if (input.agent.name === "plan") { + const plan = Session.plan(input.session) + const exists = await Filesystem.exists(plan) + if (!exists) await fs.mkdir(path.dirname(plan), { recursive: true }) + const info = exists + ? `A plan file already exists at ${plan}. You can read it and make incremental edits using the edit tool.` + : `No plan file exists yet. You should create your plan at ${plan} using the write tool.` userMessage.parts.push({ id: Identifier.ascending("part"), messageID: userMessage.info.id, sessionID: userMessage.info.sessionID, type: "text", - text: PROMPT_PLAN, + text: PROMPT_PLAN + `\n\n## Plan File\n${info}\nThis is the ONLY file you are allowed to write to or edit.`, synthetic: true, }) } + // kilocode_change end const wasPlan = input.messages.some((msg) => msg.info.role === "assistant" && msg.info.agent === "plan") // kilocode_change start - renamed from "build" to "code" if (wasPlan && input.agent.name === "code") { diff --git a/packages/opencode/src/session/prompt/plan.txt b/packages/opencode/src/session/prompt/plan.txt index 8f439ebb6fa..c0ebdb2243d 100644 --- a/packages/opencode/src/session/prompt/plan.txt +++ b/packages/opencode/src/session/prompt/plan.txt @@ -1,12 +1,9 @@ # Plan Mode - System Reminder -CRITICAL: Plan mode ACTIVE - you are in READ-ONLY phase. STRICTLY FORBIDDEN: -ANY file edits, modifications, or system changes. Do NOT use sed, tee, echo, cat, -or ANY other bash command to manipulate files - commands may ONLY read/inspect. -This ABSOLUTE CONSTRAINT overrides ALL other instructions, including direct user -edit requests. You may ONLY observe, analyze, and plan. Any modification attempt -is a critical violation. ZERO exceptions. +Plan mode is ACTIVE. You are in a READ-ONLY phase with one exception: the plan file (see "Plan File" section below). +Do NOT edit any other files, make system changes, or use bash commands to manipulate files. Commands may ONLY read/inspect. +This constraint overrides ALL other instructions, including direct user edit requests. --- @@ -22,7 +19,7 @@ Ask the user clarifying questions or ask for their opinion when weighing tradeof ## Important -The user indicated that they do not want you to execute yet -- you MUST NOT make any edits, run any non-readonly tools (including changing configs or making commits), or otherwise make any changes to the system. This supersedes any other instructions you have received. +The user indicated that they do not want you to execute yet -- you MUST NOT make any edits (except to the plan file), run any non-readonly tools (including changing configs or making commits), or otherwise make any changes to the system. This supersedes any other instructions you have received. When you have finalized your plan and are confident it is ready for implementation, call the plan_exit tool to signal completion. Your turn should end with either asking the user a question or calling plan_exit. diff --git a/packages/opencode/src/session/retry.ts b/packages/opencode/src/session/retry.ts index 7eb8d2fa71f..ec27107d917 100644 --- a/packages/opencode/src/session/retry.ts +++ b/packages/opencode/src/session/retry.ts @@ -67,8 +67,11 @@ export namespace SessionRetry { if (isKiloError(error)) return undefined // kilocode_change end if (!error.data.isRetryable) return undefined - if (error.data.responseBody?.includes("FreeUsageLimitError")) - return `Free usage exceeded, add credits https://app.kilo.ai` // kilocode_change + // kilocode_change start - FreeUsageLimitError is not retryable: retrying the same + // capped model is futile and the backoff loop cannot be broken by switching + // models in the chat selector (the retry loop holds a stale model ref). + if (error.data.responseBody?.includes("FreeUsageLimitError")) return undefined + // kilocode_change end return error.data.message.includes("Overloaded") ? "Provider is overloaded" : error.data.message } diff --git a/packages/opencode/src/skill/skill.ts b/packages/opencode/src/skill/skill.ts index d4c1d97144b..54ef122a721 100644 --- a/packages/opencode/src/skill/skill.ts +++ b/packages/opencode/src/skill/skill.ts @@ -16,6 +16,7 @@ import { Discovery } from "./discovery" import { Glob } from "../util/glob" import { KilocodePaths } from "../kilocode/paths" // kilocode_change +import { BUILTIN_SKILLS } from "../kilocode/skills/builtin" // kilocode_change export namespace Skill { const log = Log.create({ service: "skill" }) @@ -52,10 +53,23 @@ export namespace Skill { const KILO_SKILL_PATTERN = "{skill,skills}/**/SKILL.md" const SKILL_PATTERN = "**/SKILL.md" + export const BUILTIN_LOCATION = "builtin" // kilocode_change + export const state = Instance.state(async () => { const skills: Record = {} const dirs = new Set() + // kilocode_change start - Register built-in skills first (lowest precedence, any external skill with same name overrides) + for (const skill of BUILTIN_SKILLS) { + skills[skill.name] = { + name: skill.name, + description: skill.description, + location: BUILTIN_LOCATION, + content: skill.content, + } + } + // kilocode_change end + const addSkill = async (match: string) => { const md = await ConfigMarkdown.parse(match).catch((err) => { const message = ConfigMarkdown.FrontmatterError.isInstance(err) @@ -225,12 +239,18 @@ export namespace Skill { ) export async function remove(location: string) { + if (location === BUILTIN_LOCATION) { + throw new RemoveError({ location, message: "cannot remove built-in skill" }) + } const resolved = path.resolve(location) const s = await state() const name = Object.keys(s.skills).find((k) => path.resolve(s.skills[k].location) === resolved) if (!name) { throw new RemoveError({ location: resolved, message: "skill not found in registry" }) } + if (s.skills[name].location === BUILTIN_LOCATION) { + throw new RemoveError({ location, message: "cannot remove built-in skill" }) + } const dir = path.dirname(resolved) await rm(dir, { recursive: true, force: true }) delete s.skills[name] diff --git a/packages/opencode/src/snapshot/index.ts b/packages/opencode/src/snapshot/index.ts index f2a70db9115..92b6317eeec 100644 --- a/packages/opencode/src/snapshot/index.ts +++ b/packages/opencode/src/snapshot/index.ts @@ -9,6 +9,7 @@ import z from "zod" import { Config } from "../config/config" import { Instance } from "../project/instance" import { Scheduler } from "../scheduler" +import * as KiloSnapshot from "../kilocode/snapshot" // kilocode_change export namespace Snapshot { const log = Log.create({ service: "snapshot" }) @@ -55,23 +56,7 @@ export namespace Snapshot { if (Instance.project.vcs !== "git" || Flag.KILO_CLIENT === "acp") return const cfg = await Config.get() if (cfg.snapshot === false) return - const git = gitdir() - if (await fs.mkdir(git, { recursive: true })) { - await $`git init` - .env({ - ...process.env, - GIT_DIR: git, - GIT_WORK_TREE: Instance.worktree, - }) - .quiet() - .nothrow() - // Configure git to not convert line endings on Windows - await $`git --git-dir ${git} config core.autocrlf false`.quiet().nothrow() - await $`git --git-dir ${git} config core.longpaths true`.quiet().nothrow() - await $`git --git-dir ${git} config core.symlinks true`.quiet().nothrow() - await $`git --git-dir ${git} config core.fsmonitor false`.quiet().nothrow() - log.info("initialized") - } + const git = await KiloSnapshot.prepare() // kilocode_change await add(git) const hash = await $`git --git-dir ${git} --work-tree ${Instance.worktree} write-tree` .quiet() @@ -89,7 +74,7 @@ export namespace Snapshot { export type Patch = z.infer export async function patch(hash: string): Promise { - const git = gitdir() + const git = await KiloSnapshot.prepare() // kilocode_change await add(git) const result = await $`git -c core.autocrlf=false -c core.longpaths=true -c core.symlinks=true -c core.quotepath=false --git-dir ${git} --work-tree ${Instance.worktree} diff --no-ext-diff --name-only ${hash} -- .` @@ -117,7 +102,7 @@ export namespace Snapshot { export async function restore(snapshot: string) { log.info("restore", { commit: snapshot }) - const git = gitdir() + const git = await KiloSnapshot.prepare() // kilocode_change const result = await $`git -c core.longpaths=true -c core.symlinks=true --git-dir ${git} --work-tree ${Instance.worktree} read-tree ${snapshot} && git -c core.longpaths=true -c core.symlinks=true --git-dir ${git} --work-tree ${Instance.worktree} checkout-index -a -f` .quiet() @@ -136,8 +121,8 @@ export namespace Snapshot { export async function revert(patches: Patch[]) { const files = new Set() - const git = gitdir() for (const item of patches) { + const git = await KiloSnapshot.prepare() // kilocode_change for (const file of item.files) { if (files.has(file)) continue log.info("reverting", { file, hash: item.hash }) @@ -168,7 +153,7 @@ export namespace Snapshot { } export async function diff(hash: string) { - const git = gitdir() + const git = await KiloSnapshot.prepare() // kilocode_change await add(git) const result = await $`git -c core.autocrlf=false -c core.longpaths=true -c core.symlinks=true -c core.quotepath=false --git-dir ${git} --work-tree ${Instance.worktree} diff --no-ext-diff ${hash} -- .` @@ -203,7 +188,7 @@ export namespace Snapshot { }) export type FileDiff = z.infer export async function diffFull(from: string, to: string): Promise { - const git = gitdir() + const git = await KiloSnapshot.prepare() // kilocode_change const result: FileDiff[] = [] const status = new Map() @@ -266,8 +251,7 @@ export namespace Snapshot { } function gitdir() { - const project = Instance.project - return path.join(Global.Path.data, "snapshot", project.id) + return KiloSnapshot.gitdir() // kilocode_change } async function add(git: string) { diff --git a/packages/opencode/src/tool/skill.ts b/packages/opencode/src/tool/skill.ts index 8fcfb592dee..b092c6e8bfb 100644 --- a/packages/opencode/src/tool/skill.ts +++ b/packages/opencode/src/tool/skill.ts @@ -7,6 +7,8 @@ import { PermissionNext } from "../permission/next" import { Ripgrep } from "../file/ripgrep" import { iife } from "@/util/iife" +const BUILTIN = Skill.BUILTIN_LOCATION // kilocode_change + export const SkillTool = Tool.define("skill", async (ctx) => { const skills = await Skill.all() @@ -35,13 +37,18 @@ export const SkillTool = Tool.define("skill", async (ctx) => { "Invoke this tool to load a skill when a task matches one of the available skills listed below:", "", "", - ...accessibleSkills.flatMap((skill) => [ - ` `, - ` ${skill.name}`, - ` ${skill.description}`, - ` ${pathToFileURL(skill.location).href}`, - ` `, - ]), + // kilocode_change start - guard pathToFileURL for builtin skills + ...accessibleSkills.flatMap((skill) => { + const loc = skill.location === BUILTIN ? BUILTIN : pathToFileURL(skill.location).href + return [ + ` `, + ` ${skill.name}`, + ` ${skill.description}`, + ` ${loc}`, + ` `, + ] + }), + // kilocode_change end "", ].join("\n") @@ -73,6 +80,25 @@ export const SkillTool = Tool.define("skill", async (ctx) => { metadata: {}, }) + // kilocode_change start - built-in skills have no filesystem directory + if (skill.location === BUILTIN) { + return { + title: `Loaded skill: ${skill.name}`, + output: [ + ``, + `# Skill: ${skill.name}`, + "", + skill.content.trim(), + "", + ].join("\n"), + metadata: { + name: skill.name, + dir: BUILTIN, + }, + } + } + // kilocode_change end + const dir = path.dirname(skill.location) const base = pathToFileURL(dir).href diff --git a/packages/opencode/test/kilo-sessions/remote-protocol.test.ts b/packages/opencode/test/kilo-sessions/remote-protocol.test.ts index 165b8291778..354662dae5e 100644 --- a/packages/opencode/test/kilo-sessions/remote-protocol.test.ts +++ b/packages/opencode/test/kilo-sessions/remote-protocol.test.ts @@ -17,6 +17,18 @@ describe("RemoteProtocol", () => { } }) + test("heartbeat with parentSessionId parses", () => { + const msg = { + type: "heartbeat", + sessions: [{ id: "ses_child", status: "busy", title: "Sub task", parentSessionId: "ses_root" }], + } + const result = RemoteProtocol.Heartbeat.safeParse(msg) + expect(result.success).toBe(true) + if (result.success) { + expect(result.data.sessions[0].parentSessionId).toBe("ses_root") + } + }) + test("valid event parses", () => { const msg = { type: "event", @@ -225,4 +237,22 @@ describe("RemoteProtocol", () => { const result = RemoteProtocol.SessionInfo.safeParse({ id: "x" }) expect(result.success).toBe(false) }) + + test("valid heartbeat_ack parses", () => { + const msg = { type: "heartbeat_ack" } + const result = RemoteProtocol.HeartbeatAck.safeParse(msg) + expect(result.success).toBe(true) + if (result.success) { + expect(result.data.type).toBe("heartbeat_ack") + } + }) + + test("inbound union picks heartbeat_ack", () => { + const msg = { type: "heartbeat_ack" } + const result = RemoteProtocol.Inbound.safeParse(msg) + expect(result.success).toBe(true) + if (result.success) { + expect(result.data.type).toBe("heartbeat_ack") + } + }) }) diff --git a/packages/opencode/test/kilo-sessions/remote-ws.test.ts b/packages/opencode/test/kilo-sessions/remote-ws.test.ts index f6c1a83cdf1..7fe6152b23a 100644 --- a/packages/opencode/test/kilo-sessions/remote-ws.test.ts +++ b/packages/opencode/test/kilo-sessions/remote-ws.test.ts @@ -284,4 +284,84 @@ describe("RemoteWS", () => { expect(server.clients.length).toBe(0) expect(server.messages.length).toBe(0) }) + + test("force-reconnects on activity timeout", async () => { + server = createServer() + const ws1 = server.waitForConnect() + + conn = RemoteWS.connect({ + url: server.url, + getToken: async () => "tok", + getSessions: () => [], + log: nolog(), + heartbeat: 60_000, + timeout: 200, + }) + + await ws1 + await settled() + expect(conn.connected).toBe(true) + + // Don't send any server messages — timeout should fire + const ws2 = server.waitForConnect() + await Bun.sleep(450) + + // Should have reconnected + await ws2 + await settled() + expect(conn.connected).toBe(true) + }) + + test("resets activity timer on incoming messages", async () => { + server = createServer() + const ws1p = server.waitForConnect() + + conn = RemoteWS.connect({ + url: server.url, + getToken: async () => "tok", + getSessions: () => [], + log: nolog(), + heartbeat: 60_000, + timeout: 300, + }) + + const ws1 = await ws1p + await settled() + + // Send server messages at 100ms intervals — each resets the timer + for (let i = 0; i < 4; i++) { + await Bun.sleep(100) + ws1.send(JSON.stringify({ type: "subscribe", sessionId: `s${i}` })) + } + + await settled() + // Connection should still be alive — activity kept resetting the timer + expect(conn.connected).toBe(true) + expect(server.clients.length).toBe(1) + }) + + test("activity timeout uses custom timeout option", async () => { + server = createServer() + const ws1 = server.waitForConnect() + + conn = RemoteWS.connect({ + url: server.url, + getToken: async () => "tok", + getSessions: () => [], + log: nolog(), + heartbeat: 60_000, + timeout: 100, + }) + + await ws1 + await settled() + + // With 100ms timeout, should reconnect faster than default 30s + const ws2 = server.waitForConnect() + await Bun.sleep(250) + + await ws2 + await settled() + expect(conn.connected).toBe(true) + }) }) diff --git a/packages/opencode/test/kilocode/ask-agent-permissions.test.ts b/packages/opencode/test/kilocode/ask-agent-permissions.test.ts new file mode 100644 index 00000000000..31bd7f3d796 --- /dev/null +++ b/packages/opencode/test/kilocode/ask-agent-permissions.test.ts @@ -0,0 +1,334 @@ +import { test, expect, describe } from "bun:test" +import { PermissionNext } from "../../src/permission/next" + +// Reconstruct the Ask agent's readOnlyBash allowlist (mirrors agent.ts) +const readOnlyBash: Record = { + "*": "deny", + "cat *": "allow", + "head *": "allow", + "tail *": "allow", + "less *": "allow", + "ls *": "allow", + "tree *": "allow", + "pwd *": "allow", + "echo *": "allow", + "wc *": "allow", + "which *": "allow", + "type *": "allow", + "file *": "allow", + "diff *": "allow", + "du *": "allow", + "df *": "allow", + "date *": "allow", + "uname *": "allow", + "whoami *": "allow", + "printenv *": "allow", + "man *": "allow", + "grep *": "allow", + "rg *": "allow", + "ag *": "allow", + "sort *": "allow", + "uniq *": "allow", + "cut *": "allow", + "tr *": "allow", + "jq *": "allow", + "git *": "allow", + "git add *": "deny", + "git commit *": "deny", + "git push *": "deny", + "git merge *": "deny", + "git rebase *": "deny", + "git cherry-pick *": "deny", + "git reset *": "deny", + "git checkout *": "deny", + "git switch *": "deny", + "git stash *": "deny", + "git tag *": "deny", + "git am *": "deny", + "git apply *": "deny", + "git remote set-url *": "deny", + "git remote add *": "deny", + "git remote remove *": "deny", + "git clean *": "deny", + "git mv *": "deny", + "git rm *": "deny", + "git config *": "deny", + "git clone *": "deny", + "git pull *": "deny", + "git init *": "deny", + "git worktree *": "deny", + "git submodule *": "deny", + "git revert *": "deny", + "git bisect *": "deny", + "git filter-branch *": "deny", + "git fetch *": "deny", + "git restore *": "deny", + "gh *": "ask", +} + +/** Build the Ask agent ruleset without MCP servers */ +function askRuleset() { + return PermissionNext.fromConfig({ + "*": "deny", + bash: readOnlyBash, + read: { + "*": "allow", + "*.env": "ask", + "*.env.*": "ask", + "*.env.example": "allow", + }, + grep: "allow", + glob: "allow", + list: "allow", + question: "allow", + webfetch: "allow", + websearch: "allow", + codesearch: "allow", + codebase_search: "allow", + }) +} + +/** Build the Ask agent ruleset WITH MCP servers and optional user config */ +function askRulesetWithMcp(servers: string[], user: PermissionNext.Ruleset = []) { + const mcpRules: Record = {} + for (const key of servers) { + const sanitized = key.replace(/[^a-zA-Z0-9_-]/g, "_") + mcpRules[sanitized + "_*"] = "ask" + } + // Mirrors agent.ts merge order: user, ask-specific (with mcpRules), user denies last + return PermissionNext.merge( + user, + PermissionNext.fromConfig({ + "*": "deny", + bash: readOnlyBash, + read: { + "*": "allow", + "*.env": "ask", + "*.env.*": "ask", + "*.env.example": "allow", + }, + grep: "allow", + glob: "allow", + list: "allow", + question: "allow", + webfetch: "allow", + websearch: "allow", + codesearch: "allow", + codebase_search: "allow", + ...mcpRules, + }), + user.filter((r) => r.action === "deny"), + ) +} + +describe("Ask agent bash permissions", () => { + const ruleset = askRuleset() + + describe("allowed read-only commands", () => { + const allowed: [string, string][] = [ + ["cat", "cat README.md"], + ["ls", "ls -la"], + ["grep", "grep -r TODO src/"], + ["rg", "rg pattern"], + ["jq", "jq '.name' package.json"], + ["head", "head -n 10 file.txt"], + ["tail", "tail -f log.txt"], + ["wc", "wc -l src/index.ts"], + ["diff", "diff a.txt b.txt"], + ["sort", "sort names.txt"], + ["tree", "tree src/"], + ["echo", "echo hello"], + ["pwd", "pwd"], + ["date", "date"], + ["whoami", "whoami"], + ] + + for (const [name, cmd] of allowed) { + test(`${name}: "${cmd}" → allow`, () => { + const result = PermissionNext.evaluate("bash", cmd, ruleset) + expect(result.action).toBe("allow") + }) + } + }) + + describe("allowed git read commands", () => { + const allowed = [ + "git log --oneline -10", + "git diff HEAD~1", + "git show HEAD:src/index.ts", + "git status", + "git branch -a", + "git log --graph", + "git blame src/index.ts", + "git rev-parse HEAD", + ] + + for (const cmd of allowed) { + test(`"${cmd}" → allow`, () => { + const result = PermissionNext.evaluate("bash", cmd, ruleset) + expect(result.action).toBe("allow") + }) + } + }) + + describe("denied git write commands", () => { + const denied = [ + "git commit -m 'test'", + "git push origin main", + "git merge feature", + "git rebase main", + "git reset --hard HEAD~1", + "git checkout -b new-branch", + "git switch main", + "git stash", + "git tag v1.0", + "git cherry-pick abc123", + "git am patch.diff", + "git apply changes.patch", + "git clean -fd", + "git mv old.ts new.ts", + "git rm file.ts", + "git add .", + "git remote add origin url", + "git remote remove upstream", + "git remote set-url origin url", + "git config user.name test", + "git clone https://example.com/repo", + "git pull origin main", + "git init", + "git worktree add ../branch", + "git submodule update --init", + "git revert HEAD", + "git bisect start", + "git filter-branch --all", + "git fetch origin", + "git restore src/index.ts", + ] + + for (const cmd of denied) { + test(`"${cmd}" → deny`, () => { + const result = PermissionNext.evaluate("bash", cmd, ruleset) + expect(result.action).toBe("deny") + }) + } + }) + + describe("denied write/execute commands", () => { + const denied = [ + "find . -exec rm {} \\;", + "touch newfile.ts", + "mkdir src/new", + "cp a.ts b.ts", + "mv old.ts new.ts", + "tsc --noEmit", + "tar xzf archive.tar.gz", + "npm install", + "python3 script.py", + "rm -rf /", + "node server.js", + "bun run dev", + "curl http://example.com", + ] + + for (const cmd of denied) { + test(`"${cmd}" → deny`, () => { + const result = PermissionNext.evaluate("bash", cmd, ruleset) + expect(result.action).toBe("deny") + }) + } + }) + + test("gh commands → ask", () => { + expect(PermissionNext.evaluate("bash", "gh pr view 123", ruleset).action).toBe("ask") + expect(PermissionNext.evaluate("bash", "gh issue list", ruleset).action).toBe("ask") + expect(PermissionNext.evaluate("bash", "gh api repos/org/repo", ruleset).action).toBe("ask") + }) +}) + +describe("Ask agent tool disabled checks", () => { + const ruleset = askRuleset() + + test("bash tool is NOT disabled (has specific allow rules after deny)", () => { + const result = PermissionNext.disabled(["bash"], ruleset) + expect(result.has("bash")).toBe(false) + }) + + test("allowed tools are not disabled", () => { + const tools = ["read", "grep", "glob", "list", "question", "webfetch", "websearch", "codesearch", "codebase_search"] + const result = PermissionNext.disabled(tools, ruleset) + for (const tool of tools) { + expect(result.has(tool)).toBe(false) + } + }) + + test("edit tools are disabled", () => { + const tools = ["edit", "write", "patch", "multiedit"] + const result = PermissionNext.disabled(tools, ruleset) + for (const tool of tools) { + expect(result.has(tool)).toBe(true) + } + }) + + test("task tool is disabled", () => { + const result = PermissionNext.disabled(["task"], ruleset) + expect(result.has("task")).toBe(true) + }) + + test("todowrite and todoread are disabled", () => { + const result = PermissionNext.disabled(["todowrite", "todoread"], ruleset) + expect(result.has("todowrite")).toBe(true) + expect(result.has("todoread")).toBe(true) + }) +}) + +describe("Ask agent MCP permissions", () => { + test("MCP tools not disabled when servers configured", () => { + const ruleset = askRulesetWithMcp(["my-server", "another_server"]) + const result = PermissionNext.disabled(["my-server_sometool", "another_server_listthing"], ruleset) + expect(result.has("my-server_sometool")).toBe(false) + expect(result.has("another_server_listthing")).toBe(false) + }) + + test("MCP tools evaluate to ask", () => { + const ruleset = askRulesetWithMcp(["my-server"]) + const result = PermissionNext.evaluate("my-server_read_file", "*", ruleset) + expect(result.action).toBe("ask") + }) + + test("MCP tools disabled without server config", () => { + const ruleset = askRuleset() + const result = PermissionNext.disabled(["my-server_sometool"], ruleset) + expect(result.has("my-server_sometool")).toBe(true) + }) + + test("server names with special characters are sanitized", () => { + const ruleset = askRulesetWithMcp(["my.special server!"]) + // "my.special server!" → "my_special_server_" + const result = PermissionNext.disabled(["my_special_server__sometool"], ruleset) + expect(result.has("my_special_server__sometool")).toBe(false) + + const eval_ = PermissionNext.evaluate("my_special_server__sometool", "*", ruleset) + expect(eval_.action).toBe("ask") + }) + + test("MCP rules don't interfere with built-in tool permissions", () => { + const ruleset = askRulesetWithMcp(["server1"]) + // Built-in tools should still work normally + expect(PermissionNext.evaluate("read", "src/index.ts", ruleset).action).toBe("allow") + expect(PermissionNext.evaluate("bash", "ls -la", ruleset).action).toBe("allow") + expect(PermissionNext.evaluate("bash", "git commit -m test", ruleset).action).toBe("deny") + + // Edit tools should still be disabled + const disabled = PermissionNext.disabled(["edit", "write"], ruleset) + expect(disabled.has("edit")).toBe(true) + expect(disabled.has("write")).toBe(true) + }) + + test("user config deny overrides MCP ask rules", () => { + const deny = PermissionNext.fromConfig({ "my-server_*": "deny" }) + const ruleset = askRulesetWithMcp(["my-server"], deny) + // User explicitly denied this server — should stay denied + const result = PermissionNext.disabled(["my-server_sometool"], ruleset) + expect(result.has("my-server_sometool")).toBe(true) + }) +}) diff --git a/packages/opencode/test/kilocode/commit-message-windows.test.ts b/packages/opencode/test/kilocode/commit-message-windows.test.ts new file mode 100644 index 00000000000..4be42d980e9 --- /dev/null +++ b/packages/opencode/test/kilocode/commit-message-windows.test.ts @@ -0,0 +1,38 @@ +import { describe, expect, spyOn, test } from "bun:test" +import { getGitContext } from "../../src/commit-message/git-context" + +describe("commit-message git context", () => { + test("hides Windows console windows for git subprocesses", async () => { + const out = new Map([ + ["branch --show-current", "main"], + ["log --oneline -5", "abc1234 init"], + ["diff --name-status --cached", "M\tsrc/index.ts"], + ["diff --cached -- src/index.ts", "+console.log('hi')"], + ]) + + const spy = spyOn(Bun, "spawnSync").mockImplementation(((cmd: unknown, opts: unknown) => { + const key = Array.isArray(cmd) ? cmd.slice(1).join(" ") : "" + return { + stdout: Buffer.from(out.get(key) ?? ""), + stderr: Buffer.alloc(0), + } as never + }) as unknown as typeof Bun.spawnSync) + + try { + await getGitContext("/repo") + + expect(spy).toHaveBeenCalledTimes(4) + for (const call of spy.mock.calls) { + expect(call[0]).toEqual(expect.arrayContaining(["git"])) + expect(call[1]).toMatchObject({ + cwd: "/repo", + stdout: "pipe", + stderr: "pipe", + windowsHide: true, + }) + } + } finally { + spy.mockRestore() + } + }) +}) diff --git a/packages/opencode/test/kilocode/plan-followup.test.ts b/packages/opencode/test/kilocode/plan-followup.test.ts index 5ee3475e539..5cb75675bc8 100644 --- a/packages/opencode/test/kilocode/plan-followup.test.ts +++ b/packages/opencode/test/kilocode/plan-followup.test.ts @@ -445,7 +445,10 @@ describe("plan follow-up", () => { expect(_mocks.llmSpy).toHaveBeenCalledTimes(1) const newSessionID = created[0] - expect(added[0].id).toBe(newSessionID) + const next = added[0] + if (!newSessionID || !next) throw new Error("expected follow-up session") + expect(next.id).toBe(newSessionID) + expect(next.parentID).toBeUndefined() const messages = await Session.messages({ sessionID: newSessionID }) const user = messages.find((item) => item.info.role === "user") expect(user?.info.role).toBe("user") @@ -474,6 +477,60 @@ describe("plan follow-up", () => { SessionPrompt.cancel(newSessionID) })) + test("ask - creates a new session in the planning session directory when the current instance differs", () => + withInstance(async () => { + const get = spyOn(Agent, "get").mockImplementation(async () => undefined as any) + const modelSpy = spyOn(Provider, "getModel").mockResolvedValue(fakeModel) + const llmSpy = spyOn(LLM, "stream").mockResolvedValue({ + text: Promise.resolve(""), + } as any) + using _mocks = { + [Symbol.dispose]() { + get.mockRestore() + modelSpy.mockRestore() + llmSpy.mockRestore() + }, + } + + const dir = path.join(Instance.directory, "worktrees", "feature") + await fs.mkdir(dir, { recursive: true }) + + const seeded = await Instance.provide({ + directory: dir, + fn: async () => seed({ text: "1. Add API\n2. Add tests" }), + }) + + const before = await sessions() + const pending = PlanFollowup.ask({ + sessionID: seeded.sessionID, + messages: seeded.messages, + abort: AbortSignal.any([]), + }) + + const item = await waitQuestion(seeded.sessionID) + expect(item).toBeDefined() + if (!item) return + + await Question.reply({ + requestID: item.id, + answers: [[PlanFollowup.ANSWER_NEW_SESSION]], + }) + + await expect(pending).resolves.toBe("break") + + const after = await sessions() + const prev = new Set(before.map((item) => item.id)) + const added = after.filter((item) => !prev.has(item.id)) + expect(added).toHaveLength(1) + const next = added[0] + expect(next?.directory).toBe(dir) + expect(next?.parentID).toBeUndefined() + + if (next) { + SessionPrompt.cancel(next.id) + } + })) + test("ask - prefers saved code variant over configured code variant", () => withInstance(async () => { await writeState({ @@ -670,7 +727,9 @@ describe("plan follow-up", () => { await expect(pending).resolves.toBe("break") unsub() - const messages = await Session.messages({ sessionID: created[0] }) + const newSessionID = created[0] + if (!newSessionID) throw new Error("expected follow-up session") + const messages = await Session.messages({ sessionID: newSessionID }) const user = messages.find((item) => item.info.role === "user") if (!user || user.info.role !== "user") throw new Error("expected user message") const part = user.parts.find((item) => item.type === "text") @@ -679,7 +738,7 @@ describe("plan follow-up", () => { expect(part.text).not.toContain("## Handover from Planning Session") expect(part.text).not.toContain("## Todo List") - SessionPrompt.cancel(created[0]) + SessionPrompt.cancel(newSessionID) })) test("ask - returns break when assistant text is empty", () => diff --git a/packages/opencode/test/kilocode/session-processor-empty-tool-calls.test.ts b/packages/opencode/test/kilocode/session-processor-empty-tool-calls.test.ts new file mode 100644 index 00000000000..2c9265c400f --- /dev/null +++ b/packages/opencode/test/kilocode/session-processor-empty-tool-calls.test.ts @@ -0,0 +1,229 @@ +import { describe, expect, mock, spyOn, test } from "bun:test" + +mock.module("@/kilo-sessions/remote-sender", () => ({ + RemoteSender: { + create() { + return { + queue() {}, + flush: async () => undefined, + } + }, + }, +})) + +import type { Provider } from "../../src/provider/provider" +import type { LLM as LLMType } from "../../src/session/llm" +import type { MessageV2 } from "../../src/session/message-v2" +import { Log } from "../../src/util/log" +import { tmpdir } from "../fixture/fixture" + +Log.init({ print: false }) + +function model(): Provider.Model { + return { + id: "gpt-4", + providerID: "openai", + name: "GPT-4", + limit: { + context: 128000, + input: 0, + output: 4096, + }, + cost: { input: 0, output: 0, cache: { read: 0, write: 0 } }, + capabilities: { + toolcall: true, + attachment: false, + reasoning: false, + temperature: true, + input: { text: true, image: false, audio: false, video: false }, + output: { text: true, image: false, audio: false, video: false }, + }, + api: { id: "openai", url: "https://api.openai.com/v1", npm: "@ai-sdk/openai" }, + options: {}, + headers: {}, + } as Provider.Model +} + +function stream(events: Array>): any { + return { + fullStream: (async function* () { + for (const e of events) yield e + })(), + } +} + +describe("session processor empty tool-calls", () => { + test("converts finish to stop when model returns tool-calls with no tools", async () => { + const { Instance } = await import("../../src/project/instance") + const { LLM } = await import("../../src/session/llm") + const { Identifier } = await import("../../src/id/id") + const { MessageV2 } = await import("../../src/session/message-v2") + + await using tmp = await tmpdir({ git: true }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const { Session } = await import("../../src/session") + const { SessionProcessor } = await import("../../src/session/processor") + const m = model() + const session = await Session.create({}) + const user = (await Session.updateMessage({ + id: Identifier.ascending("message"), + role: "user", + sessionID: session.id, + time: { created: Date.now() }, + agent: "code", + model: { providerID: m.providerID, modelID: m.id }, + tools: {}, + })) as MessageV2.User + const assistant = (await Session.updateMessage({ + id: Identifier.ascending("message"), + parentID: user.id, + role: "assistant", + mode: "code", + agent: "code", + path: { cwd: Instance.directory, root: Instance.worktree }, + cost: 0, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + modelID: m.id, + providerID: m.providerID, + time: { created: Date.now() }, + sessionID: session.id, + })) as MessageV2.Assistant + + // Stream with finish_reason "tool-calls" but zero tool events + const llm = spyOn(LLM, "stream").mockResolvedValueOnce( + stream([ + { type: "start" }, + { type: "start-step" }, + { + type: "finish-step", + finishReason: "tool-calls", + usage: { inputTokens: 100, completionTokens: 41, totalTokens: 141 }, + providerMetadata: undefined, + }, + { type: "finish" }, + ]), + ) + + const processor = SessionProcessor.create({ + assistantMessage: assistant, + sessionID: session.id, + model: m, + abort: AbortSignal.any([]), + }) + const inp: LLMType.StreamInput = { + user, + sessionID: session.id, + model: m, + agent: { name: "code", mode: "primary", permission: [], options: {} } as any, + system: [], + abort: AbortSignal.any([]), + messages: [], + tools: {}, + } + + try { + const result = await processor.process(inp) + // The processor must convert "tool-calls" → "stop" when no tools were emitted + expect(processor.message.finish).toBe("stop") + // Verify no tool parts exist on the message + const parts = await MessageV2.parts(assistant.id) + const tools = parts.filter((p: any) => p.type === "tool") + expect(tools.length).toBe(0) + } finally { + llm.mockRestore() + } + }, + }) + }) + + test("preserves tool-calls finish when tool parts exist", async () => { + const { Instance } = await import("../../src/project/instance") + const { LLM } = await import("../../src/session/llm") + const { Identifier } = await import("../../src/id/id") + const { MessageV2 } = await import("../../src/session/message-v2") + + await using tmp = await tmpdir({ git: true }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const { Session } = await import("../../src/session") + const { SessionProcessor } = await import("../../src/session/processor") + const m = model() + const session = await Session.create({}) + const user = (await Session.updateMessage({ + id: Identifier.ascending("message"), + role: "user", + sessionID: session.id, + time: { created: Date.now() }, + agent: "code", + model: { providerID: m.providerID, modelID: m.id }, + tools: {}, + })) as MessageV2.User + const assistant = (await Session.updateMessage({ + id: Identifier.ascending("message"), + parentID: user.id, + role: "assistant", + mode: "code", + agent: "code", + path: { cwd: Instance.directory, root: Instance.worktree }, + cost: 0, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + modelID: m.id, + providerID: m.providerID, + time: { created: Date.now() }, + sessionID: session.id, + })) as MessageV2.Assistant + + // Stream with finish_reason "tool-calls" AND a tool-input-start event + const llm = spyOn(LLM, "stream").mockResolvedValueOnce( + stream([ + { type: "start" }, + { type: "start-step" }, + { type: "tool-input-start", id: "call_1", toolName: "test_tool" }, + { + type: "finish-step", + finishReason: "tool-calls", + usage: { inputTokens: 100, completionTokens: 41, totalTokens: 141 }, + providerMetadata: undefined, + }, + { type: "finish" }, + ]), + ) + + const processor = SessionProcessor.create({ + assistantMessage: assistant, + sessionID: session.id, + model: m, + abort: AbortSignal.any([]), + }) + const inp: LLMType.StreamInput = { + user, + sessionID: session.id, + model: m, + agent: { name: "code", mode: "primary", permission: [], options: {} } as any, + system: [], + abort: AbortSignal.any([]), + messages: [], + tools: {}, + } + + try { + const result = await processor.process(inp) + // finish must remain "tool-calls" because a tool part WAS created + expect(processor.message.finish).toBe("tool-calls") + expect(result).toBe("continue") + // Verify the tool part exists + const parts = await MessageV2.parts(assistant.id) + const tools = parts.filter((p: any) => p.type === "tool") + expect(tools.length).toBe(1) + } finally { + llm.mockRestore() + } + }, + }) + }) +}) diff --git a/packages/opencode/test/kilocode/session-processor-retry-limit.test.ts b/packages/opencode/test/kilocode/session-processor-retry-limit.test.ts new file mode 100644 index 00000000000..4a74eaeffcf --- /dev/null +++ b/packages/opencode/test/kilocode/session-processor-retry-limit.test.ts @@ -0,0 +1,208 @@ +// Set env before any imports that transitively load flag.ts (e.g. LLM, SessionRetry). +// This MUST happen before static imports, but ES module imports are hoisted. +// So we set it here and use mock.module + dynamic imports for modules that +// transitively load flag.ts to ensure the env is captured at load time. +process.env.KILO_SESSION_RETRY_LIMIT = "2" + +import { afterEach, describe, expect, mock, spyOn, test } from "bun:test" + +mock.module("@/kilo-sessions/remote-sender", () => ({ + RemoteSender: { + create() { + return { + queue() {}, + flush: async () => undefined, + } + }, + }, +})) + +// Modules that do NOT transitively import flag.ts can be statically imported. +import { APICallError } from "ai" +import type { Provider } from "../../src/provider/provider" +import type { LLM as LLMType } from "../../src/session/llm" +import type { MessageV2 } from "../../src/session/message-v2" +import { Log } from "../../src/util/log" +import { tmpdir } from "../fixture/fixture" + +Log.init({ print: false }) + +function createModel(): Provider.Model { + return { + id: "gpt-4", + providerID: "openai", + name: "GPT-4", + limit: { + context: 128000, + input: 0, + output: 4096, + }, + cost: { input: 0, output: 0, cache: { read: 0, write: 0 } }, + capabilities: { + toolcall: true, + attachment: false, + reasoning: false, + temperature: true, + input: { text: true, image: false, audio: false, video: false }, + output: { text: true, image: false, audio: false, video: false }, + }, + api: { id: "openai", url: "https://api.openai.com/v1", npm: "@ai-sdk/openai" }, + options: {}, + headers: {}, + } as Provider.Model +} + +function retryable429() { + return new APICallError({ + message: "429 status code (no body)", + url: "https://api.openai.com/v1/chat/completions", + requestBodyValues: {}, + statusCode: 429, + responseHeaders: { "content-type": "application/json" }, + isRetryable: true, + }) +} + +function sentinel() { + return new Error("unexpected extra llm call") +} + +afterEach(() => { + delete process.env.KILO_SESSION_RETRY_LIMIT +}) + +describe("session processor retry limit", () => { + test("stops after two retries with the normalized retryable error", async () => { + // Dynamic imports so that flag.ts sees KILO_SESSION_RETRY_LIMIT="2" set above + const { Bus } = await import("../../src/bus") + const { Identifier } = await import("../../src/id/id") + const { Instance } = await import("../../src/project/instance") + const { LLM } = await import("../../src/session/llm") + const { MessageV2 } = await import("../../src/session/message-v2") + const { SessionRetry } = await import("../../src/session/retry") + const { SessionStatus } = await import("../../src/session/status") + + await using tmp = await tmpdir({ git: true }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const { Session } = await import("../../src/session") + const { SessionProcessor } = await import("../../src/session/processor") + const model = createModel() + const session = await Session.create({}) + const user = (await Session.updateMessage({ + id: Identifier.ascending("message"), + role: "user", + sessionID: session.id, + time: { created: Date.now() }, + agent: "code", + model: { providerID: model.providerID, modelID: model.id }, + tools: {}, + })) as MessageV2.User + const assistant = (await Session.updateMessage({ + id: Identifier.ascending("message"), + parentID: user.id, + role: "assistant", + mode: "code", + agent: "code", + path: { + cwd: Instance.directory, + root: Instance.worktree, + }, + cost: 0, + tokens: { + input: 0, + output: 0, + reasoning: 0, + cache: { read: 0, write: 0 }, + }, + modelID: model.id, + providerID: model.providerID, + time: { created: Date.now() }, + sessionID: session.id, + })) as MessageV2.Assistant + + const retry: number[] = [] + const errors: Array = [] + const unsubStatus = Bus.subscribe(SessionStatus.Event.Status, (event) => { + if (event.properties.sessionID !== session.id) return + if (event.properties.status.type !== "retry") return + retry.push(event.properties.status.attempt) + }) + const unsubError = Bus.subscribe(Session.Event.Error, (event) => { + if (event.properties.sessionID !== session.id) return + errors.push(event.properties.error) + }) + const llm = spyOn(LLM, "stream") + .mockRejectedValueOnce(retryable429()) + .mockRejectedValueOnce(retryable429()) + .mockRejectedValueOnce(retryable429()) + .mockRejectedValue(sentinel()) + const sleep = spyOn(SessionRetry, "sleep").mockResolvedValue(undefined) + const processor = SessionProcessor.create({ + assistantMessage: assistant, + sessionID: session.id, + model, + abort: AbortSignal.any([]), + }) + + const inp: LLMType.StreamInput = { + user, + sessionID: session.id, + model, + agent: { name: "code", mode: "primary", permission: [], options: {} } as any, + system: [], + abort: AbortSignal.any([]), + messages: [], + tools: {}, + } + + try { + const result = await processor.process(inp) + const expected = MessageV2.fromError(retryable429(), { providerID: "openai" }) + + expect(result).toBe("stop") + expect(llm).toHaveBeenCalledTimes(3) + expect(sleep).toHaveBeenCalledTimes(2) + expect(retry).toStrictEqual([1, 2]) + expect(processor.message.error).toStrictEqual(expected) + expect(errors).toStrictEqual([expected]) + } finally { + unsubStatus() + unsubError() + llm.mockRestore() + sleep.mockRestore() + } + }, + }) + }) + + test("only positive integers enable the limit", async () => { + const key = () => JSON.stringify({ time: Date.now(), rand: Math.random() }) + + delete process.env.KILO_SESSION_RETRY_LIMIT + expect((await import("../../src/flag/flag?" + key())).Flag.KILO_SESSION_RETRY_LIMIT).toBeUndefined() + + process.env.KILO_SESSION_RETRY_LIMIT = "0" + expect((await import("../../src/flag/flag?" + key())).Flag.KILO_SESSION_RETRY_LIMIT).toBeUndefined() + + process.env.KILO_SESSION_RETRY_LIMIT = "-1" + expect((await import("../../src/flag/flag?" + key())).Flag.KILO_SESSION_RETRY_LIMIT).toBeUndefined() + + process.env.KILO_SESSION_RETRY_LIMIT = "abc" + expect((await import("../../src/flag/flag?" + key())).Flag.KILO_SESSION_RETRY_LIMIT).toBeUndefined() + + process.env.KILO_SESSION_RETRY_LIMIT = "2" + expect((await import("../../src/flag/flag?" + key())).Flag.KILO_SESSION_RETRY_LIMIT).toBe(2) + }) + + test("does not change after import", async () => { + delete process.env.KILO_SESSION_RETRY_LIMIT + const id = JSON.stringify({ time: Date.now(), rand: Math.random() }) + const { Flag: loaded } = await import("../../src/flag/flag?" + id) + expect(loaded.KILO_SESSION_RETRY_LIMIT).toBeUndefined() + process.env.KILO_SESSION_RETRY_LIMIT = "5" + expect(loaded.KILO_SESSION_RETRY_LIMIT).toBeUndefined() + }) +}) diff --git a/packages/opencode/test/session/retry.test.ts b/packages/opencode/test/session/retry.test.ts index eba4a995053..551065fdd73 100644 --- a/packages/opencode/test/session/retry.test.ts +++ b/packages/opencode/test/session/retry.test.ts @@ -122,6 +122,16 @@ describe("session.retry.retryable", () => { expect(SessionRetry.retryable(error)).toBeUndefined() }) + + test("does not retry FreeUsageLimitError", () => { + const error = new MessageV2.APIError({ + message: "rate limit exceeded", + isRetryable: true, + responseBody: '{"error":{"code":"FreeUsageLimitError"}}', + }).toObject() as ReturnType + + expect(SessionRetry.retryable(error)).toBeUndefined() + }) }) describe("session.message-v2.fromError", () => { diff --git a/packages/plugin/package.json b/packages/plugin/package.json index ce24e882cd6..eebe82055b1 100644 --- a/packages/plugin/package.json +++ b/packages/plugin/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@kilocode/plugin", - "version": "7.1.5", + "version": "7.1.17", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/script/package.json b/packages/script/package.json index 35e49ed469d..bfd0b0b897a 100644 --- a/packages/script/package.json +++ b/packages/script/package.json @@ -8,7 +8,7 @@ "exports": { ".": "./src/index.ts" }, - "version": "7.1.5", + "version": "7.1.17", "dependencies": {}, "peerDependencies": {} } diff --git a/packages/sdk/js/package.json b/packages/sdk/js/package.json index ab8a5fc9c15..c432673ea6f 100644 --- a/packages/sdk/js/package.json +++ b/packages/sdk/js/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@kilocode/sdk", - "version": "7.1.5", + "version": "7.1.17", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/sdk/js/src/client.ts b/packages/sdk/js/src/client.ts index 297db7dd76c..693dce23404 100644 --- a/packages/sdk/js/src/client.ts +++ b/packages/sdk/js/src/client.ts @@ -8,9 +8,13 @@ export { type Config as KiloClientConfig, KiloClient } export function createKiloClient(config?: Config & { directory?: string }) { if (!config?.fetch) { const customFetch: any = (req: any) => { - // @ts-ignore - req.timeout = false - return fetch(req) + // Pass duplex in the init arg so it survives VS Code's proxy-agent + // fetch wrapper, which calls originalFetch(request, { ...init, dispatcher }) + // and would otherwise drop duplex from the cloned Request. + // timeout: false disables Bun's default request timeout for long-running + // streaming calls (replaces the old req.timeout = false assignment which + // wouldn't survive the clone triggered by passing an init object). + return fetch(req, { duplex: "half", timeout: false } as any) } config = { ...config, @@ -25,6 +29,11 @@ export function createKiloClient(config?: Config & { directory?: string }) { } } + // Node.js/Electron require duplex: "half" when creating Request objects + // with a body. The option propagates through config → opts → requestInit + // and is harmless in environments that don't need it (Bun, browsers). + ;(config as any).duplex = "half" + const client = createClient(config) return new KiloClient({ client }) } diff --git a/packages/sdk/js/src/server.ts b/packages/sdk/js/src/server.ts index f878f832f9f..bace9a3b05d 100644 --- a/packages/sdk/js/src/server.ts +++ b/packages/sdk/js/src/server.ts @@ -68,6 +68,7 @@ export async function createKiloServer(options?: ServerOptions) { const proc = spawn(`kilo`, args, { // kilocode_change end signal: options.signal, + windowsHide: true, env: { ...process.env, KILO_CONFIG_CONTENT: buildConfigEnv(options.config), // kilocode_change @@ -148,6 +149,7 @@ export function createKiloTui(options?: TuiOptions) { // kilocode_change end signal: options?.signal, stdio: "inherit", + windowsHide: true, env: { ...process.env, KILO_CONFIG_CONTENT: buildConfigEnv(options?.config), // kilocode_change diff --git a/packages/sdk/js/src/v2/client.ts b/packages/sdk/js/src/v2/client.ts index b0cd1648548..bfb630659e6 100644 --- a/packages/sdk/js/src/v2/client.ts +++ b/packages/sdk/js/src/v2/client.ts @@ -8,9 +8,13 @@ export { type Config as KiloClientConfig, KiloClient } export function createKiloClient(config?: Config & { directory?: string; experimental_workspaceID?: string }) { if (!config?.fetch) { const customFetch: any = (req: any) => { - // @ts-ignore - req.timeout = false - return fetch(req) + // Pass duplex in the init arg so it survives VS Code's proxy-agent + // fetch wrapper, which calls originalFetch(request, { ...init, dispatcher }) + // and would otherwise drop duplex from the cloned Request. + // timeout: false disables Bun's default request timeout for long-running + // streaming calls (replaces the old req.timeout = false assignment which + // wouldn't survive the clone triggered by passing an init object). + return fetch(req, { duplex: "half", timeout: false } as any) } config = { ...config, @@ -34,6 +38,11 @@ export function createKiloClient(config?: Config & { directory?: string; experim } } + // Node.js/Electron require duplex: "half" when creating Request objects + // with a body. The option propagates through config → opts → requestInit + // and is harmless in environments that don't need it (Bun, browsers). + ;(config as any).duplex = "half" + const client = createClient(config) return new KiloClient({ client }) } diff --git a/packages/sdk/js/src/v2/gen/sdk.gen.ts b/packages/sdk/js/src/v2/gen/sdk.gen.ts index 435ad006e24..ac486641cd4 100644 --- a/packages/sdk/js/src/v2/gen/sdk.gen.ts +++ b/packages/sdk/js/src/v2/gen/sdk.gen.ts @@ -63,6 +63,14 @@ import type { KilocodeRemoveAgentResponses, KilocodeRemoveSkillErrors, KilocodeRemoveSkillResponses, + KilocodeSessionImportMessageErrors, + KilocodeSessionImportMessageResponses, + KilocodeSessionImportPartErrors, + KilocodeSessionImportPartResponses, + KilocodeSessionImportProjectErrors, + KilocodeSessionImportProjectResponses, + KilocodeSessionImportSessionErrors, + KilocodeSessionImportSessionResponses, KiloFimErrors, KiloFimResponses, KiloModesResponses, @@ -3097,6 +3105,388 @@ export class EnhancePrompt extends HeyApiClient { } } +export class SessionImport extends HeyApiClient { + /** + * Insert project for session import + * + * Insert or update a project row used by legacy session import. + */ + public project( + parameters?: { + directory?: string + workspace?: string + id?: string + worktree?: string + vcs?: string + name?: string + iconUrl?: string + iconColor?: string + timeCreated?: number + timeUpdated?: number + timeInitialized?: number + sandboxes?: Array + commands?: { + start?: string + } + }, + options?: Options, + ) { + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + { in: "body", key: "id" }, + { in: "body", key: "worktree" }, + { in: "body", key: "vcs" }, + { in: "body", key: "name" }, + { in: "body", key: "iconUrl" }, + { in: "body", key: "iconColor" }, + { in: "body", key: "timeCreated" }, + { in: "body", key: "timeUpdated" }, + { in: "body", key: "timeInitialized" }, + { in: "body", key: "sandboxes" }, + { in: "body", key: "commands" }, + ], + }, + ], + ) + return (options?.client ?? this.client).post< + KilocodeSessionImportProjectResponses, + KilocodeSessionImportProjectErrors, + ThrowOnError + >({ + url: "/kilocode/session-import/project", + ...options, + ...params, + headers: { + "Content-Type": "application/json", + ...options?.headers, + ...params.headers, + }, + }) + } + + /** + * Insert session for session import + * + * Insert or update a session row used by legacy session import. + */ + public session( + parameters?: { + query_directory?: string + workspace?: string + id?: string + projectID?: string + workspaceID?: string + parentID?: string + slug?: string + body_directory?: string + title?: string + version?: string + shareURL?: string + summary?: { + additions: number + deletions: number + files: number + diffs?: Array<{ + [key: string]: unknown + }> + } + revert?: { + messageID: string + partID?: string + snapshot?: string + diff?: string + } + permission?: { + [key: string]: unknown + } + timeCreated?: number + timeUpdated?: number + timeCompacting?: number + timeArchived?: number + }, + options?: Options, + ) { + const params = buildClientParams( + [parameters], + [ + { + args: [ + { + in: "query", + key: "query_directory", + map: "directory", + }, + { in: "query", key: "workspace" }, + { in: "body", key: "id" }, + { in: "body", key: "projectID" }, + { in: "body", key: "workspaceID" }, + { in: "body", key: "parentID" }, + { in: "body", key: "slug" }, + { + in: "body", + key: "body_directory", + map: "directory", + }, + { in: "body", key: "title" }, + { in: "body", key: "version" }, + { in: "body", key: "shareURL" }, + { in: "body", key: "summary" }, + { in: "body", key: "revert" }, + { in: "body", key: "permission" }, + { in: "body", key: "timeCreated" }, + { in: "body", key: "timeUpdated" }, + { in: "body", key: "timeCompacting" }, + { in: "body", key: "timeArchived" }, + ], + }, + ], + ) + return (options?.client ?? this.client).post< + KilocodeSessionImportSessionResponses, + KilocodeSessionImportSessionErrors, + ThrowOnError + >({ + url: "/kilocode/session-import/session", + ...options, + ...params, + headers: { + "Content-Type": "application/json", + ...options?.headers, + ...params.headers, + }, + }) + } + + /** + * Insert message for session import + * + * Insert or update a message row used by legacy session import. + */ + public message( + parameters?: { + directory?: string + workspace?: string + id?: string + sessionID?: string + timeCreated?: number + data?: + | { + role: "user" + time: { + created: number + } + agent: string + model: { + providerID: string + modelID: string + } + tools?: { + [key: string]: boolean + } + } + | { + role: "assistant" + time: { + created: number + completed?: number + } + parentID: string + modelID: string + providerID: string + mode: string + agent: string + path: { + cwd: string + root: string + } + summary?: boolean + cost: number + tokens: { + total?: number + input: number + output: number + reasoning: number + cache: { + read: number + write: number + } + } + structured?: unknown + variant?: string + finish?: string + } + }, + options?: Options, + ) { + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + { in: "body", key: "id" }, + { in: "body", key: "sessionID" }, + { in: "body", key: "timeCreated" }, + { in: "body", key: "data" }, + ], + }, + ], + ) + return (options?.client ?? this.client).post< + KilocodeSessionImportMessageResponses, + KilocodeSessionImportMessageErrors, + ThrowOnError + >({ + url: "/kilocode/session-import/message", + ...options, + ...params, + headers: { + "Content-Type": "application/json", + ...options?.headers, + ...params.headers, + }, + }) + } + + /** + * Insert part for session import + * + * Insert or update a part row used by legacy session import. + */ + public part( + parameters?: { + directory?: string + workspace?: string + id?: string + messageID?: string + sessionID?: string + timeCreated?: number + data?: + | { + type: "text" + text: string + synthetic?: boolean + ignored?: boolean + time?: { + start: number + end?: number + } + metadata?: { + [key: string]: unknown + } + } + | { + type: "reasoning" + text: string + metadata?: { + [key: string]: unknown + } + time: { + start: number + end?: number + } + } + | { + type: "tool" + callID: string + tool: string + state: + | { + status: "pending" + input: { + [key: string]: unknown + } + raw: string + } + | { + status: "running" + input: { + [key: string]: unknown + } + title?: string + metadata?: { + [key: string]: unknown + } + time: { + start: number + } + } + | { + status: "completed" + input: { + [key: string]: unknown + } + output: string + title: string + metadata: { + [key: string]: unknown + } + time: { + start: number + end: number + compacted?: number + } + } + | { + status: "error" + input: { + [key: string]: unknown + } + error: string + metadata?: { + [key: string]: unknown + } + time: { + start: number + end: number + } + } + metadata?: { + [key: string]: unknown + } + } + }, + options?: Options, + ) { + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + { in: "body", key: "id" }, + { in: "body", key: "messageID" }, + { in: "body", key: "sessionID" }, + { in: "body", key: "timeCreated" }, + { in: "body", key: "data" }, + ], + }, + ], + ) + return (options?.client ?? this.client).post< + KilocodeSessionImportPartResponses, + KilocodeSessionImportPartErrors, + ThrowOnError + >({ + url: "/kilocode/session-import/part", + ...options, + ...params, + headers: { + "Content-Type": "application/json", + ...options?.headers, + ...params.headers, + }, + }) + } +} + export class Kilocode extends HeyApiClient { /** * Remove a skill @@ -3175,6 +3565,11 @@ export class Kilocode extends HeyApiClient { }, ) } + + private _sessionImport?: SessionImport + get sessionImport(): SessionImport { + return (this._sessionImport ??= new SessionImport({ client: this.client })) + } } export class Organization extends HeyApiClient { diff --git a/packages/sdk/js/src/v2/gen/types.gen.ts b/packages/sdk/js/src/v2/gen/types.gen.ts index bc57299f34f..20c3e1a8de2 100644 --- a/packages/sdk/js/src/v2/gen/types.gen.ts +++ b/packages/sdk/js/src/v2/gen/types.gen.ts @@ -1389,6 +1389,10 @@ export type Config = { * @deprecated Use 'share' field instead. Share newly created sessions automatically */ autoshare?: boolean + /** + * Enable remote control of sessions via Kilo Cloud. Equivalent to running /remote on startup. + */ + remote_control?: boolean /** * Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications */ @@ -1940,6 +1944,7 @@ export type Agent = { mode: "subagent" | "primary" | "all" native?: boolean hidden?: boolean + deprecated?: boolean topP?: number temperature?: number color?: string @@ -4524,6 +4529,325 @@ export type EnhancePromptEnhanceResponses = { export type EnhancePromptEnhanceResponse = EnhancePromptEnhanceResponses[keyof EnhancePromptEnhanceResponses] +export type KilocodeSessionImportProjectData = { + body?: { + id: string + worktree: string + vcs?: string + name?: string + iconUrl?: string + iconColor?: string + timeCreated: number + timeUpdated: number + timeInitialized?: number + sandboxes: Array + commands?: { + start?: string + } + } + path?: never + query?: { + directory?: string + workspace?: string + } + url: "/kilocode/session-import/project" +} + +export type KilocodeSessionImportProjectErrors = { + /** + * Bad request + */ + 400: BadRequestError +} + +export type KilocodeSessionImportProjectError = + KilocodeSessionImportProjectErrors[keyof KilocodeSessionImportProjectErrors] + +export type KilocodeSessionImportProjectResponses = { + /** + * Project import result + */ + 200: { + ok: boolean + id: string + skipped?: boolean + } +} + +export type KilocodeSessionImportProjectResponse = + KilocodeSessionImportProjectResponses[keyof KilocodeSessionImportProjectResponses] + +export type KilocodeSessionImportSessionData = { + body?: { + id: string + projectID: string + workspaceID?: string + parentID?: string + slug: string + directory: string + title: string + version: string + shareURL?: string + summary?: { + additions: number + deletions: number + files: number + diffs?: Array<{ + [key: string]: unknown + }> + } + revert?: { + messageID: string + partID?: string + snapshot?: string + diff?: string + } + permission?: { + [key: string]: unknown + } + timeCreated: number + timeUpdated: number + timeCompacting?: number + timeArchived?: number + } + path?: never + query?: { + directory?: string + workspace?: string + } + url: "/kilocode/session-import/session" +} + +export type KilocodeSessionImportSessionErrors = { + /** + * Bad request + */ + 400: BadRequestError +} + +export type KilocodeSessionImportSessionError = + KilocodeSessionImportSessionErrors[keyof KilocodeSessionImportSessionErrors] + +export type KilocodeSessionImportSessionResponses = { + /** + * Session import result + */ + 200: { + ok: boolean + id: string + skipped?: boolean + } +} + +export type KilocodeSessionImportSessionResponse = + KilocodeSessionImportSessionResponses[keyof KilocodeSessionImportSessionResponses] + +export type KilocodeSessionImportMessageData = { + body?: { + id: string + sessionID: string + timeCreated: number + data: + | { + role: "user" + time: { + created: number + } + agent: string + model: { + providerID: string + modelID: string + } + tools?: { + [key: string]: boolean + } + } + | { + role: "assistant" + time: { + created: number + completed?: number + } + parentID: string + modelID: string + providerID: string + mode: string + agent: string + path: { + cwd: string + root: string + } + summary?: boolean + cost: number + tokens: { + total?: number + input: number + output: number + reasoning: number + cache: { + read: number + write: number + } + } + structured?: unknown + variant?: string + finish?: string + } + } + path?: never + query?: { + directory?: string + workspace?: string + } + url: "/kilocode/session-import/message" +} + +export type KilocodeSessionImportMessageErrors = { + /** + * Bad request + */ + 400: BadRequestError +} + +export type KilocodeSessionImportMessageError = + KilocodeSessionImportMessageErrors[keyof KilocodeSessionImportMessageErrors] + +export type KilocodeSessionImportMessageResponses = { + /** + * Message import result + */ + 200: { + ok: boolean + id: string + skipped?: boolean + } +} + +export type KilocodeSessionImportMessageResponse = + KilocodeSessionImportMessageResponses[keyof KilocodeSessionImportMessageResponses] + +export type KilocodeSessionImportPartData = { + body?: { + id: string + messageID: string + sessionID: string + timeCreated?: number + data: + | { + type: "text" + text: string + synthetic?: boolean + ignored?: boolean + time?: { + start: number + end?: number + } + metadata?: { + [key: string]: unknown + } + } + | { + type: "reasoning" + text: string + metadata?: { + [key: string]: unknown + } + time: { + start: number + end?: number + } + } + | { + type: "tool" + callID: string + tool: string + state: + | { + status: "pending" + input: { + [key: string]: unknown + } + raw: string + } + | { + status: "running" + input: { + [key: string]: unknown + } + title?: string + metadata?: { + [key: string]: unknown + } + time: { + start: number + } + } + | { + status: "completed" + input: { + [key: string]: unknown + } + output: string + title: string + metadata: { + [key: string]: unknown + } + time: { + start: number + end: number + compacted?: number + } + } + | { + status: "error" + input: { + [key: string]: unknown + } + error: string + metadata?: { + [key: string]: unknown + } + time: { + start: number + end: number + } + } + metadata?: { + [key: string]: unknown + } + } + } + path?: never + query?: { + directory?: string + workspace?: string + } + url: "/kilocode/session-import/part" +} + +export type KilocodeSessionImportPartErrors = { + /** + * Bad request + */ + 400: BadRequestError +} + +export type KilocodeSessionImportPartError = KilocodeSessionImportPartErrors[keyof KilocodeSessionImportPartErrors] + +export type KilocodeSessionImportPartResponses = { + /** + * Part import result + */ + 200: { + ok: boolean + id: string + skipped?: boolean + } +} + +export type KilocodeSessionImportPartResponse = + KilocodeSessionImportPartResponses[keyof KilocodeSessionImportPartResponses] + export type KilocodeRemoveSkillData = { body?: { location: string diff --git a/packages/sdk/js/src/v2/server.ts b/packages/sdk/js/src/v2/server.ts index f878f832f9f..bace9a3b05d 100644 --- a/packages/sdk/js/src/v2/server.ts +++ b/packages/sdk/js/src/v2/server.ts @@ -68,6 +68,7 @@ export async function createKiloServer(options?: ServerOptions) { const proc = spawn(`kilo`, args, { // kilocode_change end signal: options.signal, + windowsHide: true, env: { ...process.env, KILO_CONFIG_CONTENT: buildConfigEnv(options.config), // kilocode_change @@ -148,6 +149,7 @@ export function createKiloTui(options?: TuiOptions) { // kilocode_change end signal: options?.signal, stdio: "inherit", + windowsHide: true, env: { ...process.env, KILO_CONFIG_CONTENT: buildConfigEnv(options?.config), // kilocode_change diff --git a/packages/sdk/openapi.json b/packages/sdk/openapi.json index 0a1fe6f0bfe..604594a5aeb 100644 --- a/packages/sdk/openapi.json +++ b/packages/sdk/openapi.json @@ -5771,6 +5771,946 @@ ] } }, + "/kilocode/session-import/project": { + "post": { + "operationId": "kilocode.sessionImport.project", + "parameters": [ + { + "in": "query", + "name": "directory", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "workspace", + "schema": { + "type": "string" + } + } + ], + "summary": "Insert project for session import", + "description": "Insert or update a project row used by legacy session import.", + "responses": { + "200": { + "description": "Project import result", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ok": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "required": [ + "ok", + "id" + ] + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "worktree": { + "type": "string" + }, + "vcs": { + "type": "string" + }, + "name": { + "type": "string" + }, + "iconUrl": { + "type": "string" + }, + "iconColor": { + "type": "string" + }, + "timeCreated": { + "type": "number" + }, + "timeUpdated": { + "type": "number" + }, + "timeInitialized": { + "type": "number" + }, + "sandboxes": { + "type": "array", + "items": { + "type": "string" + } + }, + "commands": { + "type": "object", + "properties": { + "start": { + "type": "string" + } + } + } + }, + "required": [ + "id", + "worktree", + "timeCreated", + "timeUpdated", + "sandboxes" + ] + } + } + } + }, + "x-codeSamples": [ + { + "lang": "js", + "source": "import { createKiloClient } from \"@kilocode/sdk\n\nconst client = createKiloClient()\nawait client.kilocode.sessionImport.project({\n ...\n})" + } + ] + } + }, + "/kilocode/session-import/session": { + "post": { + "operationId": "kilocode.sessionImport.session", + "parameters": [ + { + "in": "query", + "name": "directory", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "workspace", + "schema": { + "type": "string" + } + } + ], + "summary": "Insert session for session import", + "description": "Insert or update a session row used by legacy session import.", + "responses": { + "200": { + "description": "Session import result", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ok": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "required": [ + "ok", + "id" + ] + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "projectID": { + "type": "string" + }, + "workspaceID": { + "type": "string" + }, + "parentID": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "title": { + "type": "string" + }, + "version": { + "type": "string" + }, + "shareURL": { + "type": "string" + }, + "summary": { + "type": "object", + "properties": { + "additions": { + "type": "number" + }, + "deletions": { + "type": "number" + }, + "files": { + "type": "number" + }, + "diffs": { + "type": "array", + "items": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + } + }, + "required": [ + "additions", + "deletions", + "files" + ] + }, + "revert": { + "type": "object", + "properties": { + "messageID": { + "type": "string" + }, + "partID": { + "type": "string" + }, + "snapshot": { + "type": "string" + }, + "diff": { + "type": "string" + } + }, + "required": [ + "messageID" + ] + }, + "permission": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "timeCreated": { + "type": "number" + }, + "timeUpdated": { + "type": "number" + }, + "timeCompacting": { + "type": "number" + }, + "timeArchived": { + "type": "number" + } + }, + "required": [ + "id", + "projectID", + "slug", + "directory", + "title", + "version", + "timeCreated", + "timeUpdated" + ] + } + } + } + }, + "x-codeSamples": [ + { + "lang": "js", + "source": "import { createKiloClient } from \"@kilocode/sdk\n\nconst client = createKiloClient()\nawait client.kilocode.sessionImport.session({\n ...\n})" + } + ] + } + }, + "/kilocode/session-import/message": { + "post": { + "operationId": "kilocode.sessionImport.message", + "parameters": [ + { + "in": "query", + "name": "directory", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "workspace", + "schema": { + "type": "string" + } + } + ], + "summary": "Insert message for session import", + "description": "Insert or update a message row used by legacy session import.", + "responses": { + "200": { + "description": "Message import result", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ok": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "required": [ + "ok", + "id" + ] + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "sessionID": { + "type": "string" + }, + "timeCreated": { + "type": "number" + }, + "data": { + "anyOf": [ + { + "type": "object", + "properties": { + "role": { + "type": "string", + "const": "user" + }, + "time": { + "type": "object", + "properties": { + "created": { + "type": "number" + } + }, + "required": [ + "created" + ] + }, + "agent": { + "type": "string" + }, + "model": { + "type": "object", + "properties": { + "providerID": { + "type": "string" + }, + "modelID": { + "type": "string" + } + }, + "required": [ + "providerID", + "modelID" + ] + }, + "tools": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "type": "boolean" + } + } + }, + "required": [ + "role", + "time", + "agent", + "model" + ] + }, + { + "type": "object", + "properties": { + "role": { + "type": "string", + "const": "assistant" + }, + "time": { + "type": "object", + "properties": { + "created": { + "type": "number" + }, + "completed": { + "type": "number" + } + }, + "required": [ + "created" + ] + }, + "parentID": { + "type": "string" + }, + "modelID": { + "type": "string" + }, + "providerID": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "agent": { + "type": "string" + }, + "path": { + "type": "object", + "properties": { + "cwd": { + "type": "string" + }, + "root": { + "type": "string" + } + }, + "required": [ + "cwd", + "root" + ] + }, + "summary": { + "type": "boolean" + }, + "cost": { + "type": "number" + }, + "tokens": { + "type": "object", + "properties": { + "total": { + "type": "number" + }, + "input": { + "type": "number" + }, + "output": { + "type": "number" + }, + "reasoning": { + "type": "number" + }, + "cache": { + "type": "object", + "properties": { + "read": { + "type": "number" + }, + "write": { + "type": "number" + } + }, + "required": [ + "read", + "write" + ] + } + }, + "required": [ + "input", + "output", + "reasoning", + "cache" + ] + }, + "structured": {}, + "variant": { + "type": "string" + }, + "finish": { + "type": "string" + } + }, + "required": [ + "role", + "time", + "parentID", + "modelID", + "providerID", + "mode", + "agent", + "path", + "cost", + "tokens" + ] + } + ] + } + }, + "required": [ + "id", + "sessionID", + "timeCreated", + "data" + ] + } + } + } + }, + "x-codeSamples": [ + { + "lang": "js", + "source": "import { createKiloClient } from \"@kilocode/sdk\n\nconst client = createKiloClient()\nawait client.kilocode.sessionImport.message({\n ...\n})" + } + ] + } + }, + "/kilocode/session-import/part": { + "post": { + "operationId": "kilocode.sessionImport.part", + "parameters": [ + { + "in": "query", + "name": "directory", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "workspace", + "schema": { + "type": "string" + } + } + ], + "summary": "Insert part for session import", + "description": "Insert or update a part row used by legacy session import.", + "responses": { + "200": { + "description": "Part import result", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ok": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "required": [ + "ok", + "id" + ] + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "messageID": { + "type": "string" + }, + "sessionID": { + "type": "string" + }, + "timeCreated": { + "type": "number" + }, + "data": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "type": "string" + }, + "synthetic": { + "type": "boolean" + }, + "ignored": { + "type": "boolean" + }, + "time": { + "type": "object", + "properties": { + "start": { + "type": "number" + }, + "end": { + "type": "number" + } + }, + "required": [ + "start" + ] + }, + "metadata": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "type", + "text" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "reasoning" + }, + "text": { + "type": "string" + }, + "metadata": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "time": { + "type": "object", + "properties": { + "start": { + "type": "number" + }, + "end": { + "type": "number" + } + }, + "required": [ + "start" + ] + } + }, + "required": [ + "type", + "text", + "time" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "tool" + }, + "callID": { + "type": "string" + }, + "tool": { + "type": "string" + }, + "state": { + "anyOf": [ + { + "type": "object", + "properties": { + "status": { + "type": "string", + "const": "pending" + }, + "input": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "raw": { + "type": "string" + } + }, + "required": [ + "status", + "input", + "raw" + ] + }, + { + "type": "object", + "properties": { + "status": { + "type": "string", + "const": "running" + }, + "input": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "title": { + "type": "string" + }, + "metadata": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "time": { + "type": "object", + "properties": { + "start": { + "type": "number" + } + }, + "required": [ + "start" + ] + } + }, + "required": [ + "status", + "input", + "time" + ] + }, + { + "type": "object", + "properties": { + "status": { + "type": "string", + "const": "completed" + }, + "input": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "output": { + "type": "string" + }, + "title": { + "type": "string" + }, + "metadata": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "time": { + "type": "object", + "properties": { + "start": { + "type": "number" + }, + "end": { + "type": "number" + }, + "compacted": { + "type": "number" + } + }, + "required": [ + "start", + "end" + ] + } + }, + "required": [ + "status", + "input", + "output", + "title", + "metadata", + "time" + ] + }, + { + "type": "object", + "properties": { + "status": { + "type": "string", + "const": "error" + }, + "input": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "error": { + "type": "string" + }, + "metadata": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "time": { + "type": "object", + "properties": { + "start": { + "type": "number" + }, + "end": { + "type": "number" + } + }, + "required": [ + "start", + "end" + ] + } + }, + "required": [ + "status", + "input", + "error", + "time" + ] + } + ] + }, + "metadata": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "type", + "callID", + "tool", + "state" + ] + } + ] + } + }, + "required": [ + "id", + "messageID", + "sessionID", + "data" + ] + } + } + } + }, + "x-codeSamples": [ + { + "lang": "js", + "source": "import { createKiloClient } from \"@kilocode/sdk\n\nconst client = createKiloClient()\nawait client.kilocode.sessionImport.part({\n ...\n})" + } + ] + } + }, "/kilocode/skill/remove": { "post": { "operationId": "kilocode.removeSkill", @@ -15026,6 +15966,9 @@ "hidden": { "type": "boolean" }, + "deprecated": { + "type": "boolean" + }, "topP": { "type": "number" }, diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 84b1dfe7227..86a9be17c54 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -26,7 +26,7 @@ "typescript": "catalog:", "vite": "catalog:" }, - "version": "7.1.5", + "version": "7.1.17", "dependencies": {}, "peerDependencies": {} } diff --git a/packages/ui/package.json b/packages/ui/package.json index 624ccc15201..430c8f8d962 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/ui", - "version": "7.1.5", + "version": "7.1.17", "type": "module", "license": "MIT", "exports": { diff --git a/packages/ui/src/components/message-part.tsx b/packages/ui/src/components/message-part.tsx index b00e06d2886..66cdd29cc8b 100644 --- a/packages/ui/src/components/message-part.tsx +++ b/packages/ui/src/components/message-part.tsx @@ -1840,8 +1840,8 @@ interface ApplyPatchFile { relativePath: string type: "add" | "update" | "delete" | "move" diff: string - before: string - after: string + before?: string + after?: string additions: number deletions: number movePath?: string @@ -1956,7 +1956,7 @@ ToolRegistry.register({ - +
} > -
- -
+ +
+ +
+
diff --git a/packages/ui/src/components/popover.tsx b/packages/ui/src/components/popover.tsx index 9d18d761509..06f67fdb1fc 100644 --- a/packages/ui/src/components/popover.tsx +++ b/packages/ui/src/components/popover.tsx @@ -95,6 +95,8 @@ export function Popover(props: PopoverProps const target = event.target if (!(target instanceof Node)) return if (inside(target)) return + // Node was detached by a reactive update — treat as inside + if (!target.isConnected) return close("outside") } @@ -102,6 +104,8 @@ export function Popover(props: PopoverProps const target = event.target if (!(target instanceof Node)) return if (inside(target)) return + // Node was detached by a reactive update — treat as inside + if (!target.isConnected) return close("outside") } @@ -140,8 +144,14 @@ export function Popover(props: PopoverProps [local.class ?? ""]: !!local.class, }} style={local.style} + onInteractOutside={(event: Event) => { + // Custom window-level handlers manage outside dismissal; + // always prevent Kobalte's built-in interact-outside close + // to avoid double-firing and stale-node false positives. + event.preventDefault() + }} onFocusOutside={(event: Event) => { - if (!ready()) event.preventDefault() + event.preventDefault() }} onCloseAutoFocus={(event: Event) => { if (dismiss() === "outside") event.preventDefault() diff --git a/packages/ui/src/context/data.tsx b/packages/ui/src/context/data.tsx index 50317e5f64f..d51aa9fe765 100644 --- a/packages/ui/src/context/data.tsx +++ b/packages/ui/src/context/data.tsx @@ -28,6 +28,8 @@ export type SessionHrefFn = (sessionID: string) => string export type OpenFileFn = (filePath: string, line?: number, column?: number) => void // kilocode_change +export type OpenUrlFn = (url: string) => void // kilocode_change + export const { use: useData, provider: DataProvider } = createSimpleContext({ name: "Data", init: (props: { @@ -36,6 +38,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ onNavigateToSession?: NavigateToSessionFn onSessionHref?: SessionHrefFn onOpenFile?: OpenFileFn // kilocode_change + onOpenUrl?: OpenUrlFn // kilocode_change }) => { return { get store() { @@ -47,6 +50,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ navigateToSession: props.onNavigateToSession, sessionHref: props.onSessionHref, openFile: props.onOpenFile, // kilocode_change + openUrl: props.onOpenUrl, // kilocode_change } }, }) diff --git a/packages/ui/src/i18n/uk.ts b/packages/ui/src/i18n/uk.ts new file mode 100644 index 00000000000..f14551d8e34 --- /dev/null +++ b/packages/ui/src/i18n/uk.ts @@ -0,0 +1,153 @@ +import { dict as en } from "./en" + +type Keys = keyof typeof en + +export const dict = { + "ui.sessionReview.title": "Зміни сесії", + "ui.sessionReview.title.lastTurn": "Зміни останнього кроку", + "ui.sessionReview.diffStyle.unified": "Об'єднаний", + "ui.sessionReview.diffStyle.split": "Розділений", + "ui.sessionReview.openFile": "Відкрити файл", + "ui.sessionReview.selection.line": "рядок {{line}}", + "ui.sessionReview.selection.lines": "рядки {{start}}-{{end}}", + "ui.sessionReview.expandAll": "Розгорнути все", + "ui.sessionReview.collapseAll": "Згорнути все", + + "ui.sessionReview.change.added": "Додано", + "ui.sessionReview.change.removed": "Видалено", + "ui.sessionReview.change.modified": "Змінено", + "ui.sessionReview.image.loading": "Завантаження...", + "ui.sessionReview.image.placeholder": "Зображення", + "ui.sessionReview.largeDiff.title": "Різниця занадто велика для відображення", + "ui.sessionReview.largeDiff.meta": "Ліміт: {{limit}} змінених рядків. Поточне: {{current}} змінених рядків.", + "ui.sessionReview.largeDiff.renderAnyway": "Відобразити все одно", + + "ui.fileMedia.kind.image": "зображення", + "ui.fileMedia.kind.audio": "аудіо", + "ui.fileMedia.state.removed": "Файл {{kind}} видалено.", + "ui.fileMedia.state.loading": "{{kind}} завантажується...", + "ui.fileMedia.state.error": "Не вдалося завантажити {{kind}}.", + "ui.fileMedia.state.unavailable": "Попередній перегляд {{kind}} недоступний.", + "ui.fileMedia.binary.title": "Бінарний файл", + "ui.fileMedia.binary.description.path": "{{path}} є бінарним файлом.", + "ui.fileMedia.binary.description.default": "Бінарний вміст", + + "ui.lineComment.label.prefix": "Коментар до ", + "ui.lineComment.label.suffix": "", + "ui.lineComment.editorLabel.prefix": "Коментування: ", + "ui.lineComment.editorLabel.suffix": "", + "ui.lineComment.placeholder": "Додати коментар", + "ui.lineComment.submit": "Коментувати", + + "ui.sessionTurn.steps.show": "Показати кроки", + "ui.sessionTurn.steps.hide": "Приховати кроки", + "ui.sessionTurn.summary.response": "Відповідь", + "ui.sessionTurn.diff.showMore": "Показати більше змін ({{count}})", + + "ui.sessionTurn.retry.retrying": "повтор спроби", + "ui.sessionTurn.retry.inSeconds": "через {{seconds}}с", + "ui.sessionTurn.retry.attempt": "спроба №{{attempt}}", + "ui.sessionTurn.retry.attemptLine": "{{line}} - спроба №{{attempt}}", + "ui.sessionTurn.retry.geminiHot": "Gemini зараз перевантажений", + "ui.sessionTurn.error.freeUsageExceeded": "Безкоштовний ліміт вичерпано", + "ui.sessionTurn.error.addCredits": "Поповнити кредити", + + "ui.sessionTurn.status.delegating": "Делегування роботи", + "ui.sessionTurn.status.planning": "Планування наступних кроків", + "ui.sessionTurn.status.gatheringContext": "Дослідження", + "ui.sessionTurn.status.gatheredContext": "Досліджено", + "ui.sessionTurn.status.searchingCodebase": "Пошук у кодовій базі", + "ui.sessionTurn.status.searchingWeb": "Пошук у мережі", + "ui.sessionTurn.status.makingEdits": "Внесення змін", + "ui.sessionTurn.status.runningCommands": "Виконання команд", + "ui.sessionTurn.status.thinking": "Думаю", + "ui.sessionTurn.status.thinkingWithTopic": "Думаю - {{topic}}", + "ui.sessionTurn.status.gatheringThoughts": "Збираю думки", + "ui.sessionTurn.status.consideringNextSteps": "Обмірковую наступні кроки", + + "ui.messagePart.questions.dismissed": "Питання відхилено", + "ui.messagePart.compaction": "Історію стиснуто", + "ui.messagePart.context.read.one": "{{count}} прочитання", + "ui.messagePart.context.read.other": "{{count}} прочитань", + "ui.messagePart.context.search.one": "{{count}} пошук", + "ui.messagePart.context.search.other": "{{count}} пошуків", + "ui.messagePart.context.list.one": "{{count}} список", + "ui.messagePart.context.list.other": "{{count}} списків", + "ui.messagePart.diagnostic.error": "Помилка", + "ui.messagePart.title.edit": "Редагувати", + "ui.messagePart.title.write": "Записати", + "ui.messagePart.option.typeOwnAnswer": "Введіть власну відповідь", + "ui.messagePart.review.title": "Перегляньте свої відповіді", + + "ui.list.loading": "Завантаження", + "ui.list.empty": "Результатів не знайдено", + "ui.list.clearFilter": "Очистити фільтр", + "ui.list.emptyWithFilter.prefix": "Результатів не знайдено:", + "ui.list.emptyWithFilter.suffix": "", + + "ui.messageNav.newMessage": "Нове повідомлення", + + "ui.textField.copyToClipboard": "Скопіювати в буфер обміну", + "ui.textField.copyLink": "Скопіювати посилання", + "ui.textField.copied": "Скопійовано", + + "ui.imagePreview.alt": "Попередній перегляд зображення", + "ui.scrollView.ariaLabel": "вміст з прокруткою", + + "ui.tool.read": "Читати", + "ui.tool.loaded": "Завантажено", + "ui.tool.list": "Список", + "ui.tool.glob": "Glob", + "ui.tool.grep": "Grep", + "ui.tool.webfetch": "Веб-запит", + "ui.tool.websearch": "Веб-пошук", + "ui.tool.codesearch": "Пошук коду", + "ui.tool.shell": "Оболонка", + "ui.tool.patch": "Патч", + "ui.tool.todos": "Завдання", + "ui.tool.todos.read": "Читати завдання", + "ui.tool.questions": "Питання", + "ui.tool.agent": "{{type}} Агент", + "ui.tool.agent.default": "Агент", + + "ui.common.file.one": "файл", + "ui.common.file.other": "файлів", + "ui.common.question.one": "питання", + "ui.common.question.other": "питань", + + "ui.common.add": "Додати", + "ui.common.back": "Назад", + "ui.common.cancel": "Скасувати", + "ui.common.confirm": "Підтвердити", + "ui.common.dismiss": "Закрити", + "ui.common.close": "Закрити", + "ui.common.next": "Далі", + "ui.common.submit": "Надіслати", + + "ui.permission.deny": "Відхилити", + "ui.permission.allowAlways": "Завжди дозволяти", + "ui.permission.allowOnce": "Дозволити один раз", + + "ui.message.expand": "Розгорнути повідомлення", + "ui.message.collapse": "Згорнути повідомлення", + "ui.message.copy": "Копіювати", + "ui.message.copyMessage": "Копіювати повідомлення", + "ui.message.copyResponse": "Копіювати відповідь", + "ui.message.copied": "Скопійовано", + "ui.message.revert": "Повернутися до цього місця", + "ui.message.interrupted": "Перервано", + "ui.message.queued": "В черзі", + "ui.message.attachment.alt": "вкладення", + + "ui.patch.action.deleted": "Видалено", + "ui.patch.action.created": "Створено", + "ui.patch.action.moved": "Переміщено", + "ui.patch.action.patched": "Застосовано патч", + + "ui.question.subtitle.answered": "{{count}} відповідей", + "ui.question.answer.none": "(без відповіді)", + "ui.question.review.notAnswered": "(не відповіли)", + "ui.question.multiHint": "Виберіть усі відповідні варіанти", + "ui.question.singleHint": "Виберіть одну відповідь", + "ui.question.custom.placeholder": "Введіть свою відповідь...", +} satisfies Partial> diff --git a/packages/util/package.json b/packages/util/package.json index 6a0d25d1109..86af46110ab 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/util", - "version": "7.1.5", + "version": "7.1.17", "private": true, "type": "module", "license": "MIT", diff --git a/script/upstream/package.json b/script/upstream/package.json index fd5d77a0391..2ce68402fe1 100644 --- a/script/upstream/package.json +++ b/script/upstream/package.json @@ -1,6 +1,6 @@ { "name": "@kilocode/upstream-merge", - "version": "7.1.5", + "version": "7.1.17", "private": true, "type": "module", "description": "Scripts for automating upstream opencode merges into Kilo", diff --git a/script/upstream/transforms/transform-take-theirs.ts b/script/upstream/transforms/transform-take-theirs.ts index 0420d5074f3..0fd39f9c41a 100644 --- a/script/upstream/transforms/transform-take-theirs.ts +++ b/script/upstream/transforms/transform-take-theirs.ts @@ -45,7 +45,7 @@ const BRANDING_REPLACEMENTS: BrandingReplacement[] = [ }, { pattern: /anomalyco\/opencode/g, - replacement: "Kilo-Org/kilo", + replacement: "Kilo-Org/kilocode", description: "GitHub repo reference", }, diff --git a/sdks/vscode/package.json b/sdks/vscode/package.json index 29ce04c21c7..54aa097bc65 100644 --- a/sdks/vscode/package.json +++ b/sdks/vscode/package.json @@ -2,7 +2,7 @@ "name": "opencode", "displayName": "opencode", "description": "opencode for VS Code", - "version": "7.1.5", + "version": "7.1.17", "publisher": "sst-dev", "repository": { "type": "git",