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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/polite-results-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": minor
---

Show notifications when skills are added or removed from the project or global config
25 changes: 25 additions & 0 deletions packages/types/src/context-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// kilocode_change - new file

/**
* All discoverable configuration types that affect agent behavior.
* These are things that can be discovered from .kilocode directories.
*/
export type ContextConfigType = "skill" | "workflow" | "command" | "rule" | "mcp"

/**
* Represents a single configuration change (added or removed).
*/
export interface ContextConfigChange {
/** What kind of configType this is */
configType: ContextConfigType
/** Whether this item was added or removed */
changeType: "added" | "removed"
/** Name/identifier of the item */
name: string
/** Where was it discovered: global (~/.kilocode) or project (.kilocode) */
source: "global" | "project"
/** Optional mode for mode-specific configs (e.g., 'code', 'architect') */
mode?: string
/** Optional file path for "click to open" functionality */
filePath?: string
}
1 change: 1 addition & 0 deletions packages/types/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from "./api.js"
export * from "./auto-purge.js" // kilocode_change
export * from "./context-config.js" // kilocode_change
export * from "./cloud.js"
export * from "./codebase-index.js"
export * from "./context-management.js"
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/locales/ar/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/ca/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/cs/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/de/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/en/kilocode.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"info": {
"settings_imported": "Settings imported successfully."
},
"configDiscovery": {
"added": "Kilo Code: Added {{source}} {{configType}}: {{name}}{{modeStr}}",
"removed": "Kilo Code: Removed {{source}} {{configType}}: {{name}}{{modeStr}}"
},
"userFeedback": {
"message_update_failed": "Failed to update message",
"no_checkpoint_found": "No checkpoint found before this message",
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/locales/es/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/fr/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/hi/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/id/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/it/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/ja/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/ko/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/nl/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/pl/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/pt-BR/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/ru/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/th/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/tr/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/uk/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/vi/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/zh-CN/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/zh-TW/kilocode.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions src/services/config/ConfigChangeNotifier.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// kilocode_change - new file

import { describe, it, expect, vi, beforeEach } from "vitest"
import type { ClineProvider } from "../../core/webview/ClineProvider"
import { ConfigChangeNotifier } from "./ConfigChangeNotifier"

const { mockShowInformationMessage } = vi.hoisted(() => ({
mockShowInformationMessage: vi.fn(),
}))

vi.mock("vscode", () => ({
window: { showInformationMessage: mockShowInformationMessage },
}))

vi.mock("../../i18n", () => ({
t: vi.fn((key, vars) => `${key} ${JSON.stringify(vars)}`),
}))

describe("ConfigChangeNotifier", () => {
let mockProvider: ClineProvider
let notifier: ConfigChangeNotifier

beforeEach(() => {
vi.clearAllMocks()
mockProvider = { cwd: "/test" } as unknown as ClineProvider
notifier = new ConfigChangeNotifier(mockProvider)
})

it("should skip initial discovery without notifying", async () => {
await notifier.notifyIfChanged("skill", [{ name: "test-skill", source: "global" }])
expect(mockShowInformationMessage).not.toHaveBeenCalled()
})

it("should detect added configurations", async () => {
await notifier.notifyIfChanged("skill", [{ name: "existing-skill", source: "global" }])
await notifier.notifyIfChanged("skill", [
{ name: "existing-skill", source: "global" },
{ name: "new-skill", source: "global" },
])
expect(mockShowInformationMessage).toHaveBeenCalledTimes(1)
expect(mockShowInformationMessage).toHaveBeenCalledWith(expect.stringContaining("new-skill"))
})

it("should detect removed configurations", async () => {
await notifier.notifyIfChanged("skill", [
{ name: "existing-skill", source: "global" },
{ name: "removed-skill", source: "global" },
])
await notifier.notifyIfChanged("skill", [{ name: "existing-skill", source: "global" }])
expect(mockShowInformationMessage).toHaveBeenCalledTimes(1)
expect(mockShowInformationMessage).toHaveBeenCalledWith(expect.stringContaining("removed-skill"))
})

it("should track different config types separately", async () => {
await notifier.notifyIfChanged("skill", [{ name: "skill-a", source: "global" }])
await notifier.notifyIfChanged("workflow", [{ name: "workflow-a", source: "global" }])
await notifier.notifyIfChanged("skill", [
{ name: "skill-a", source: "global" },
{ name: "skill-b", source: "global" },
])
expect(mockShowInformationMessage).toHaveBeenCalledTimes(1)
expect(mockShowInformationMessage).toHaveBeenCalledWith(expect.stringContaining("skill-b"))
})
})
Loading