Skip to content

Commit d51bfe4

Browse files
authored
Merge branch 'Kilo-Org:main' into virtual-quota-provider
2 parents a1adf0c + b2393eb commit d51bfe4

File tree

15 files changed

+138
-53
lines changed

15 files changed

+138
-53
lines changed

.changeset/forty-laws-argue.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/grumpy-snails-walk.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"kilo-code": patch
3+
---
4+
5+
Improve native tool calling consistency

.changeset/tender-news-sin.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
## [v4.110.0]
44

5-
- [#3104](https://github.com/Kilo-Org/kilocode/pull/3104) [`3008656`](https://github.com/Kilo-Org/kilocode/commit/30086567e31d8e774c89412afcdc96e3c46d57a0) Thanks [@markijbema](https://github.com/markijbema)! - Support multiline quoted strings within Auto-approved commands (especially useful for git commit)
6-
75
### Patch Changes
86

97
- [#3249](https://github.com/Kilo-Org/kilocode/pull/3249) [`ccee64c`](https://github.com/Kilo-Org/kilocode/commit/ccee64cf1676f51a6b9dae49aad994d9f834b3e8) Thanks [@chrarnoldus](https://github.com/chrarnoldus)! - Remove credit status bar until we can retrieve the up to date balance from the proxy response.

cli/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @kilocode/cli
22

3+
## 0.0.10
4+
5+
### Patch Changes
6+
7+
- [#3260](https://github.com/Kilo-Org/kilocode/pull/3260) [`0f71526`](https://github.com/Kilo-Org/kilocode/commit/0f715267745a0458caa396736551b4b3bb374259) Thanks [@catrielmuller](https://github.com/catrielmuller)! - Improved stability of the approval menu, preventing it from showing when you don't expect it
8+
9+
- [#3262](https://github.com/Kilo-Org/kilocode/pull/3262) [`e6b62d4`](https://github.com/Kilo-Org/kilocode/commit/e6b62d45597aba9f08015fac9ced1c34ae779998) Thanks [@catrielmuller](https://github.com/catrielmuller)! - 'Added /clear command'
10+
311
## 0.0.9
412

513
### Patch Changes

cli/package.dist.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kilocode/cli",
3-
"version": "0.0.9",
3+
"version": "0.0.10",
44
"description": "Terminal User Interface for Kilo Code",
55
"type": "module",
66
"main": "index.js",

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kilocode/cli",
3-
"version": "0.0.9",
3+
"version": "0.0.10",
44
"description": "Terminal User Interface for Kilo Code",
55
"type": "module",
66
"main": "dist/index.js",
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
export function markdownFormattingSection(): string {
1+
import { ToolUseStyle } from "../../../../packages/types/src/kilocode/native-function-calling"
2+
3+
export function markdownFormattingSection(
4+
toolUseStyle: ToolUseStyle, // kilocode_change
5+
): string {
26
return `====
37
48
MARKDOWN RULES
59
6-
ALL responses MUST show ANY \`language construct\` OR filename reference as clickable, exactly as [\`filename OR language.declaration()\`](relative/file/path.ext:line); line is required for \`syntax\` and optional for filename links. This applies to ALL markdown responses and ALSO those in <attempt_completion>`
10+
ALL responses MUST show ANY \`language construct\` OR filename reference as clickable, exactly as [\`filename OR language.declaration()\`](relative/file/path.ext:line); line is required for \`syntax\` and optional for filename links. This applies to ALL markdown responses and ALSO those in ${toolUseStyle === "json" ? "attempt_completion" : "<attempt_completion>" /*kilocode_change*/}`
711
}

src/core/prompts/sections/modes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ${allModes
3838

3939
// kilocode_change: toolUseStyle
4040
modesContent += `
41-
If the user asks you to create or edit a new mode for this project, you should read the instructions${toolUseStyle !== "json" ? " by using the fetch_instructions tool, like this:\n<fetch_instructions>\n<task>create_mode</task>\n</fetch_instructions>" : "."}`
41+
If the user asks you to create or edit a new mode for this project, you should read the instructions by using the fetch_instructions tool${toolUseStyle !== "json" ? ", like this:\n<fetch_instructions>\n<task>create_mode</task>\n</fetch_instructions>" : "."}`
4242

4343
return modesContent
4444
}

src/core/prompts/sections/rules.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { CodeIndexManager } from "../../../services/code-index/manager"
55
import { getFastApplyEditingInstructions } from "../tools/edit-file"
66
import { type ClineProviderState } from "../../webview/ClineProvider"
77
import { getFastApplyModelType, isFastApplyAvailable } from "../../tools/editFileTool"
8+
import { ToolUseStyle } from "../../../../packages/types/src/kilocode/native-function-calling"
89
// kilocode_change end
910

1011
function getEditingInstructions(diffStrategy?: DiffStrategy): string {
@@ -57,6 +58,7 @@ export function getRulesSection(
5758
diffStrategy?: DiffStrategy,
5859
codeIndexManager?: CodeIndexManager,
5960
clineProviderState?: ClineProviderState, // kilocode_change
61+
toolUseStyle?: ToolUseStyle, // kilocode_change
6062
): string {
6163
const isCodebaseSearchAvailable =
6264
codeIndexManager &&
@@ -70,12 +72,15 @@ export function getRulesSection(
7072

7173
const kiloCodeUseMorph = isFastApplyAvailable(clineProviderState)
7274

73-
return `====
75+
let rulesContent = ""
76+
rulesContent += `====
7477
7578
RULES
7679
7780
- The project base directory is: ${cwd.toPosix()}
78-
- All file paths must be relative to this directory. However, commands may change directories in terminals, so respect working directory specified by the response to <execute_command>.
81+
`
82+
rulesContent += `- All file paths must be relative to this directory. However, commands may change directories in terminals, so respect working directory specified by the response to ${toolUseStyle === "json" ? '"execute_command"' : "<execute_command>" /*kilocode_change*/}.`
83+
rulesContent += `
7984
- You cannot \`cd\` into a different directory to complete a task. You are stuck operating from '${cwd.toPosix()}', so be sure to pass in the correct 'path' parameter when using tools that require a path.
8085
- Do not use the ~ character or $HOME to refer to the home directory.
8186
- Before using the execute_command tool, you must first think about the SYSTEM INFORMATION context provided to understand the user's environment and tailor your commands to ensure they are compatible with their system. You must also consider if the command you need to run should be executed in a specific directory outside of the current working directory '${cwd.toPosix()}', and if so prepend with \`cd\`'ing into that directory && then executing the command (as one command since you are stuck operating from '${cwd.toPosix()}'). For example, if you needed to run \`npm install\` in a project outside of '${cwd.toPosix()}', you would need to prepend with a \`cd\` i.e. pseudocode for this would be \`cd (path to project) && (command, in this case npm install)\`.
@@ -106,4 +111,5 @@ ${kiloCodeUseMorph ? getFastApplyEditingInstructions(getFastApplyModelType(cline
106111
? " Then if you want to test your work, you might use browser_action to launch the site, wait for the user's response confirming the site was launched along with a screenshot, then perhaps e.g., click a button to test functionality if needed, wait for the user's response confirming the button was clicked along with a screenshot of the new state, before finally closing the browser."
107112
: ""
108113
}`
114+
return rulesContent
109115
}

0 commit comments

Comments
 (0)