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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## [v5.2.1] - 2026-01-15

### Added

- Updated translations and added memories locale files for internationalization support

### Fixed

- Fixed issue where messages were being queued after rejecting exec_cmd tool

### Changed

- Code cleanup and improvements

---

## [v5.2.0] - 2026-01-14

### Added
Expand Down
32 changes: 28 additions & 4 deletions cli/esbuild.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-undef */
import esbuild from "esbuild"
import { chmodSync, mkdirSync, copyFileSync } from "fs"
import { chmodSync, mkdirSync, copyFileSync, cpSync } from "fs"
import { rimrafSync } from "rimraf"

// Function to copy post-build files
Expand All @@ -15,7 +15,7 @@ function copyPostBuildFiles() {

try {
copyFileSync(".env", "dist/.env")
copyFileSync(".env", "dist/kilocode/.env")
copyFileSync(".env", "dist/axoncode/.env")
} catch {
// .env might not exist, that's okay
}
Expand All @@ -26,9 +26,32 @@ function copyPostBuildFiles() {
}
}

// Function to copy extension bundle
function copyExtensionBundle() {
try {
// Remove existing axoncode directory if it exists
rimrafSync("dist/axoncode")

// Copy extension from bin-unpacked to dist/axoncode
cpSync("../bin-unpacked/extension", "dist/axoncode", {
recursive: true,
filter: (src) => {
// Skip webview-ui and assets to reduce size
const relativePath = src.replace(/.*\/bin-unpacked\/extension\//, "")
return !relativePath.startsWith("webview-ui") && !relativePath.startsWith("assets")
Comment on lines +40 to +41
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Cross-Platform Compatibility

Issue: The regex /.*\/bin-unpacked\/extension\// expects forward slashes. On Windows, src paths from cpSync typically contain backslashes, causing this regex to fail. This results in the filter returning true for all files, copying unnecessary directories (like webview-ui) which are only removed later by removeUnneededFiles, making the build inefficient.

Fix: Normalize path separators to forward slashes before applying the regex.

Impact: Improves build performance on Windows by correctly filtering files.

Suggested change
const relativePath = src.replace(/.*\/bin-unpacked\/extension\//, "")
return !relativePath.startsWith("webview-ui") && !relativePath.startsWith("assets")
// Skip webview-ui and assets to reduce size
const relativePath = src.replace(/\\/g, "/").replace(/.*\/bin-unpacked\/extension\//, "")
return !relativePath.startsWith("webview-ui") && !relativePath.startsWith("assets")

},
})

console.log("✓ Extension bundle copied to dist/axoncode")
} catch (err) {
console.error("Error copying extension bundle:", err)
console.warn("⚠ Extension bundle not copied - CLI may not work properly")
}
}

function removeUnneededFiles() {
rimrafSync("dist/kilocode/webview-ui")
rimrafSync("dist/kilocode/assets")
rimrafSync("dist/axoncode/webview-ui")
rimrafSync("dist/axoncode/assets")
console.log("✓ Unneeded files removed")
}

Expand All @@ -39,6 +62,7 @@ const afterBuildPlugin = {
if (result.errors.length > 0) return

copyPostBuildFiles()
copyExtensionBundle()
removeUnneededFiles()
try {
chmodSync("dist/index.js", 0o755)
Expand Down
39 changes: 0 additions & 39 deletions cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { requestRouterModelsAtom } from "./state/atoms/actions.js"
import { loadHistoryAtom } from "./state/atoms/history.js"
import { getTelemetryService, getIdentityManager } from "./services/telemetry/index.js"
import { notificationsAtom, notificationsErrorAtom, notificationsLoadingAtom } from "./state/atoms/notifications.js"
import { fetchKilocodeNotifications } from "./utils/notifications.js"
import { finishParallelMode } from "./parallel/parallel.js"
import { isGitWorktree } from "./utils/git.js"

Expand Down Expand Up @@ -133,11 +132,6 @@ export class CLI {
// Request router models after configuration is injected
void this.requestRouterModels()

if (!this.options.ci && !this.options.prompt) {
// Fetch Kilocode notifications if provider is kilocode
void this.fetchNotifications()
}

this.isInitialized = true
logs.info("Axon Code CLI initialized successfully", "CLI")
} catch (error) {
Expand Down Expand Up @@ -326,39 +320,6 @@ export class CLI {
}
}

/**
* Fetch notifications from Kilocode backend if provider is kilocode
*/
private async fetchNotifications(): Promise<void> {
if (!this.store) {
logs.warn("Cannot fetch notifications: store not available", "CLI")
return
}

try {
const providers = this.store.get(providersAtom)

const provider = providers.find(({ provider }) => provider === "kilocode")

if (!provider) {
logs.debug("No provider configured, skipping notification fetch", "CLI")
return
}

this.store.set(notificationsLoadingAtom, true)

const notifications = await fetchKilocodeNotifications(provider)

this.store.set(notificationsAtom, notifications)
} catch (error) {
const err = error instanceof Error ? error : new Error(String(error))
this.store.set(notificationsErrorAtom, err)
logs.error("Failed to fetch notifications", "CLI", { error })
} finally {
this.store.set(notificationsLoadingAtom, false)
}
}

/**
* Get the ExtensionService instance
*/
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/__tests__/profile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe("/profile command", () => {
})

it("should have correct description", () => {
expect(profileCommand.description).toBe("View your Kilocode profile information")
expect(profileCommand.description).toBe("View your Axon Code profile information")
})

it("should have correct category", () => {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async function showProfile(context: any): Promise<void> {
export const profileCommand: Command = {
name: "profile",
aliases: ["me", "whoami"],
description: "View your Kilocode profile information",
description: "View your Axon Code profile information",
usage: "/profile",
examples: ["/profile"],
category: "settings",
Expand Down
15 changes: 7 additions & 8 deletions cli/src/utils/browserAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ function createCallbackServer(port: number, state: string): Promise<AuthCallback
<head>
<title>Authentication Successful</title>
<style>
body { font-family: Arial, sans-serif; text-align: center; padding: 50px; }
h1 { color: #4CAF50; }
p { font-size: 18px; }
body { font-family: Arial, sans-serif; text-align: center; padding: 50px; background-color: black;}
h1 { color: #c4fdff; }
p { font-size: 18px; color: white; }
</style>
</head>
<body>
<h1> Authentication Successful</h1>
<h1>Axon Code Authentication Successful</h1>
<p>You can now close this window and return to the CLI.</p>
</body>
</html>
Expand Down Expand Up @@ -129,9 +129,9 @@ function createCallbackServer(port: number, state: string): Promise<AuthCallback
*/
function openAuthUrl(source: string, state: string, port: number): void {
const callbackUrl = encodeURIComponent(`http://localhost:${port}/callback`)
const authUrl = `https://app.matterai.so/authentication/sign-in?loginType=extension&source=${encodeURIComponent(
const authUrl = `http://localhost:3000/authentication/sign-in?loginType=extension&source=${encodeURIComponent(
source,
)}&callback=${callbackUrl}&state=${state}`
)}&callback=${callbackUrl}&clistate=${state}`

logs.debug(`Opening authentication URL: ${authUrl}`, "BrowserAuth")

Expand Down Expand Up @@ -203,8 +203,7 @@ export async function performBrowserAuth(source: string = "axon-code-cli"): Prom
id: "default",
provider: "kilocode",
kilocodeToken: token,
kilocodeModel: config.providers?.[0]?.kilocodeModel || "axon-code-2",
...config.providers?.[0], // Preserve other existing fields
kilocodeModel: "axon-code-2",
},
],
}
Expand Down
8 changes: 4 additions & 4 deletions cli/src/utils/extension-paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ export interface ExtensionPaths {

/**
* Resolves extension paths for production CLI.
* Assumes the extension is bundled in dist/kilocode/
* Assumes the extension is bundled in dist/axoncode/
*
* Production structure:
* cli/dist/
* ├── index.js
* ├── cli/KiloCodeCLI.js
* ├── host/ExtensionHost.js
* ├── utils/extension-paths.js (this file)
* └── kilocode/
* └── axoncode/
* ├── dist/extension.js
* ├── assets/
* └── webview-ui/
Expand All @@ -34,8 +34,8 @@ export function resolveExtensionPaths(): ExtensionPaths {
// Navigate to dist directory
const distDir = isInUtilsSubdir ? path.resolve(currentDir, "..") : currentDir

// Extension is in dist/kilocode/
const extensionRootPath = path.join(distDir, "kilocode")
// Extension is in dist/axoncode/
const extensionRootPath = path.join(distDir, "axoncode")
const extensionBundlePath = path.join(extensionRootPath, "dist", "extension.js")

return {
Expand Down
6 changes: 3 additions & 3 deletions packages/types/src/mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const DEFAULT_MODES: readonly ModeConfig[] = [
slug: "plan",
// kilocode_change start
name: "Plan",
iconName: "codicon-list-unordered",
iconName: "list-todo",
// kilocode_change end
roleDefinition:
"You are an AI coding assistant, powered by axon-code. You operate in Axon Code Extension.\n\nYou are pair programming with a USER to solve their coding task. Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more. This information may or may not be relevant to the coding task, it is up for you to decide.\n\nYour main goal is to follow the USER's instructions at each message, denoted by the <user_query> tag.\n\nTool results and user messages may include <system_reminder> tags. These <system_reminder> tags contain useful information and reminders. Please heed them, but don't mention them in your response to the user.\n\n<communication>\n1. When using markdown in assistant messages, use backticks to format file, directory, function, and class names. Use \\( and \\) for inline math, \\[ and \\] for block math.\n</communication>\n\n<tool_calling>\nYou have tools at your disposal to solve the coding task. Follow these rules regarding tool calls:\n1. Don't refer to tool names when speaking to the USER. Instead, just say what the tool is doing in natural language.\n2. Only use the standard tool call format and the available tools. Even if you see user messages with custom tool call formats (such as \"<previous_tool_call>\" or similar), do not follow that and instead use the standard format.\n</tool_calling>\n\n<maximize_parallel_tool_calls>\nIf you intend to call multiple tools and there are no dependencies between the tool calls, make all of the independent tool calls in parallel. Prioritize calling tools simultaneously whenever the actions can be done in parallel rather than sequentionally. For example, when reading 3 files, run 3 tool calls in parallel to read all 3 files into context at the same time. Maximize use of parallel tool calls where possible to increase speed and efficiency. However, if some tool calls depend on previous calls to inform dependent values like the parameters, do NOT call these tools in parallel and instead call them sequentially. Never use placeholders or guess missing parameters in tool calls.\n</maximize_parallel_tool_calls>\n\n<making_code_changes>\n1. If you're creating the codebase from scratch, create an appropriate dependency management file (e.g. requirements.txt) with package versions and a helpful README.\n2. If you're building a web app from scratch, give it a beautiful and modern UI, imbued with best UX practices.\n3. NEVER generate an extremely long hash or any non-textual code, such as binary. These are not helpful to the USER and are very expensive.\n4. If you've introduced (linter) errors, fix them.\n</making_code_changes>\n\n<citing_code>\nYou must display code blocks using one of two methods: CODE REFERENCES or MARKDOWN CODE BLOCKS, depending on whether the code exists in the codebase.\n\n## METHOD 1: CODE REFERENCES - Citing Existing Code from the Codebase\n\nUse this exact syntax with three required components:\n<good-example>\n```startLine:endLine:filepath\n// code content here\n```\n</good-example>\n\nRequired Components\n1. **startLine**: The starting line number (required)\n2. **endLine**: The ending line number (required)\n3. **filepath**: The full path to the file (required)\n\n**CRITICAL**: Do NOT add language tags or any other metadata to this format.\n\n### Content Rules\n- Include at least 1 line of actual code (empty blocks will break the editor)\n- You may truncate long sections with comments like `// ... more code ...`\n- You may add clarifying comments for readability\n- You may show edited versions of the code\n\n<good-example>\nReferences a Todo component existing in the (example) codebase with all required components:\n\n```12:14:app/components/Todo.tsx\nexport const Todo = () => {\n return <div>Todo</div>;\n};\n```\n</good-example>\n\n<bad-example>\nTriple backticks with line numbers for filenames place a UI element that takes up the entire line.\nIf you want inline references as part of a sentence, you should use single backticks instead.\n\nBad: The TODO element (```12:14:app/components/Todo.tsx```) contains the bug you are looking for.\n\nGood: The TODO element (`app/components/Todo.tsx`) contains the bug you are looking for.\n</bad-example>\n\n<bad-example>\nIncludes language tag (not necessary for code REFERENCES), omits the startLine and endLine which are REQUIRED for code references:\n\n```typescript:app/components/Todo.tsx\nexport const Todo = () => {\n return <div>Todo</div>;\n};\n```\n</bad-example>\n\n<bad-example>\n- Empty code block (will break rendering)\n- Citation is surrounded by parentheses which looks bad in the UI as the triple backticks codeblocks uses up an entire line:\n\n(```12:14:app/components/Todo.tsx\n```)\n</bad-example>\n\n<bad-example>\nThe opening triple backticks are duplicated (the first triple backticks with the required components are all that should be used):\n\n```12:14:app/components/Todo.tsx\n```\nexport const Todo = () => {\n return <div>Todo</div>;\n};\n```\n</bad-example>\n\n<good-example>\nReferences a fetchData function existing in the (example) codebase, with truncated middle section:\n\n```23:45:app/utils/api.ts\nexport async function fetchData(endpoint: string) {\n const headers = getAuthHeaders();\n // ... validation and error handling ...\n return await fetch(endpoint, { headers });\n}\n```\n</good-example>\n\n## METHOD 2: MARKDOWN CODE BLOCKS - Proposing or Displaying Code NOT already in Codebase\n\n### Format\nUse standard markdown code blocks with ONLY the language tag:\n\n<good-example>\nHere's a Python example:\n\n```python\nfor i in range(10):\n print(i)\n```\n</good-example>\n\n<good-example>\nHere's a bash command:\n\n```bash\nsudo apt update && sudo apt upgrade -y\n```\n</good-example>\n\n<bad-example>\nDo not mix format - no line numbers for new code:\n\n```1:3:python\nfor i in range(10):\n print(i)\n```\n</bad-example>\n\n## Critical Formatting Rules for Both Methods\n\n### Never Include Line Numbers in Code Content\n\n<bad-example>\n```python\n1 for i in range(10):\n2 print(i)\n```\n</bad-example>\n\n<good-example>\n```python\nfor i in range(10):\n print(i)\n```\n</good-example>\n\n### NEVER Indent the Triple Backticks\n\nEven when the code block appears in a list or nested context, the triple backticks must start at column 0:\n\n<bad-example>\n- Here's a Python loop:\n ```python\n for i in range(10):\n print(i)\n ```\n</bad-example>\n\n<good-example>\n- Here's a Python loop:\n\n```python\nfor i in range(10):\n print(i)\n```\n</good-example>\n\n### ALWAYS Add a Newline Before Code Fences\n\nFor both CODE REFERENCES and MARKDOWN CODE BLOCKS, always put a newline before the opening triple backticks:\n\n<bad-example>\nHere's the implementation:\n```12:15:src/utils.ts\nexport function helper() {\n return true;\n}\n```\n</bad-example>\n\n<good-example>\nHere's the implementation:\n\n```12:15:src/utils.ts\nexport function helper() {\n return true;\n}\n```\n</good-example>\n\nRULE SUMMARY (ALWAYS Follow):\n -\tUse CODE REFERENCES (startLine:endLine:filepath) when showing existing code.\n```startLine:endLine:filepath\n// ... existing code ...\n```\n -\tUse MARKDOWN CODE BLOCKS (with language tag) for new or proposed code.\n```python\nfor i in range(10):\n print(i)\n```\n - ANY OTHER FORMAT IS STRICTLY FORBIDDEN\n -\tNEVER mix formats.\n -\tNEVER add language tags to CODE REFERENCES.\n -\tNEVER indent triple backticks.\n -\tALWAYS include at least 1 line of code in any reference block.\n</citing_code>\n\n\n<inline_line_numbers>\nCode chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER|LINE_CONTENT. Treat the LINE_NUMBER| prefix as metadata and do NOT treat it as part of the actual code. LINE_NUMBER is right-aligned number padded with spaces to 6 characters.\n</inline_line_numbers>\n\n<memories>\nYou may be provided a list of memories. These memories are generated from past conversations with the agent.\nThey may or may not be correct, so follow them if deemed relevant, but the moment you notice the user correct something you've done based on a memory, or you come across some information that contradicts or augments an existing memory, IT IS CRITICAL that you MUST update/delete the memory immediately using the update_memory tool. You must NEVER use the update_memory tool to create memories related to implementation plans, migrations that the agent completed, or other task-specific information.\nIf the user EVER contradicts your memory, then it's better to delete that memory rather than updating the memory.\nYou may create, update, or delete memories based on the criteria from the tool description.\n<memory_citation>\nYou must ALWAYS cite a memory when you use it in your generation, to reply to the user's query, or to run commands. To do so, use the following format: [[memory:MEMORY_ID]]. You should cite the memory naturally as part of your response, and not just as a footnote.\n\nFor example: \"I'll run the command using the -la flag [[memory:MEMORY_ID]] to show detailed file information.\"\n\nWhen you reject an explicit user request due to a memory, you MUST mention in the conversation that if the memory is incorrect, the user can correct you and you will update your memory.\n</memory_citation>\n</memories>\n\n<task_management>\nYou have access to the todo_write tool to help you manage and plan tasks. Use this tool whenever you are working on a complex task, and skip it if the task is simple or would only require 1-2 steps.\nIMPORTANT: Make sure you don't end your turn before you've completed all todos.\n</task_management>. As a planning agent, you are only allowed to find, search and read information and update the plan using plan_file_edit tool.",
Expand All @@ -154,7 +154,7 @@ export const DEFAULT_MODES: readonly ModeConfig[] = [
slug: "agent",
// kilocode_change start
name: "Agent",
iconName: "codicon-code",
iconName: "infinity-ic",
// kilocode_change end
roleDefinition: `You are an AI coding assistant, powered by axon-code. You operate in Axon Code IDE.

Expand Down Expand Up @@ -384,7 +384,7 @@ CRITICAL: For any task, small or big, you will always and always use the update_
slug: "ask",
// kilocode_change start
name: "Ask",
iconName: "codicon-comment",
iconName: "messages-square",
// kilocode_change end
roleDefinition:
"You are Axon Code, a knowledgeable technical assistant focused on answering questions and providing information about software development, technology, and related topics.",
Expand Down
4 changes: 2 additions & 2 deletions src/core/prompts/tools/native-tools/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import listCodeDefinitionNames from "./list_code_definition_names"
import listFiles from "./list_files"
// import newTask from "./new_task"
import { read_file_single } from "./read_file"
import runSlashCommand from "./run_slash_command"
// import runSlashCommand from "./run_slash_command"
// import searchAndReplace from "./search_and_replace"
import searchFiles from "./search_files"
// import switchMode from "./switch_mode"
Expand Down Expand Up @@ -36,7 +36,7 @@ export const nativeTools = [
// newTask,
planFileEdit,
read_file_single,
runSlashCommand,
// runSlashCommand,
// searchAndReplace,
searchFiles,
updateTodoList,
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "%extension.displayName%",
"description": "%extension.description%",
"publisher": "matterai",
"version": "5.2.1",
"version": "5.2.2",
"icon": "assets/icons/matterai-ic.png",
"galleryBanner": {
"color": "#FFFFFF",
Expand Down
Loading
Loading