Skip to content

Commit 7bdd67b

Browse files
committed
remove kilocode change markers
1 parent e7cdab9 commit 7bdd67b

File tree

4 files changed

+0
-15
lines changed

4 files changed

+0
-15
lines changed

webview-ui/src/utils/__tests__/command-validation-quote-protection.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// kilocode_change new file
2-
31
// npx vitest src/utils/__tests__/command-validation-quote-protection.spec.ts
42

53
import {

webview-ui/src/utils/__tests__/command-validation.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ describe("Command Validation", () => {
110110
])
111111
})
112112

113-
// kilocode_change start allowed newlines within quotes
114113
it("preserves newlines within quotes", () => {
115114
// Newlines inside quoted strings should be preserved as part of the command
116115
// Using template literal to create actual newline
@@ -120,7 +119,6 @@ git status`
120119
// The newlines inside quotes are preserved, so we get two commands
121120
expect(parseCommand(commandWithNewlineInQuotes)).toEqual(['echo "Hello\nWorld"', "git status"])
122121
})
123-
// kilocode_change end
124122

125123
it("handles quoted strings on single line", () => {
126124
// When quotes are on the same line, they are preserved
@@ -1084,7 +1082,6 @@ describe("Unified Command Decision Functions", () => {
10841082
expect(getCommandDecision("dangerous", allowed, denied)).toBe("ask_user")
10851083
expect(getCommandDecision("npm install && dangerous", allowed, denied)).toBe("ask_user")
10861084
})
1087-
// kilocode_change start
10881085
// Real-world regression: multi-line git commit message in quotes should be treated as a single command
10891086
describe("real-world: multi-line git commit message", () => {
10901087
it("auto-approves when commit message is single-line", () => {
@@ -1121,7 +1118,6 @@ describe("Unified Command Decision Functions", () => {
11211118
expect(parsed[0]).toContain("- point b")
11221119
})
11231120
})
1124-
// kilocode_change end
11251121
})
11261122

11271123
describe("CommandValidator Integration Tests", () => {

webview-ui/src/utils/command-validation-quote-protection.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// kilocode_change new file
2-
31
/**
42
* Placeholders used to protect newlines within quoted strings during command parsing.
53
* These constants are used by the protectNewlinesInQuotes function to temporarily replace

webview-ui/src/utils/command-validation.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { parse } from "shell-quote"
2-
// kilocode_change start
32
import {
43
protectNewlinesInQuotes,
54
NEWLINE_PLACEHOLDER,
65
CARRIAGE_RETURN_PLACEHOLDER,
76
} from "./command-validation-quote-protection"
8-
// kilocode_change end
97

108
type ShellToken = string | { op: string } | { command: string }
119

@@ -129,7 +127,6 @@ export function containsDangerousSubstitution(source: string): boolean {
129127
)
130128
}
131129

132-
// kilocode_change start added exception for quoted newlines
133130
/**
134131
* Split a command string into individual sub-commands by
135132
* chaining operators (&&, ||, ;, |, or &) and newlines.
@@ -145,15 +142,13 @@ export function containsDangerousSubstitution(source: string): boolean {
145142
export function parseCommand(command: string): string[] {
146143
if (!command?.trim()) return []
147144

148-
// kilocode_change start
149145
// First, protect newlines inside quoted strings by replacing them with placeholders
150146
// This prevents splitting multi-line quoted strings (e.g., git commit -m "multi\nline")
151147
const protectedCommand = protectNewlinesInQuotes(command, NEWLINE_PLACEHOLDER, CARRIAGE_RETURN_PLACEHOLDER)
152148

153149
// Split by newlines (handle different line ending formats)
154150
// This regex splits on \r\n (Windows), \n (Unix), or \r (old Mac)
155151
const lines = protectedCommand.split(/\r\n|\r|\n/)
156-
// kilocode_change end
157152
const allCommands: string[] = []
158153

159154
for (const line of lines) {
@@ -165,14 +160,12 @@ export function parseCommand(command: string): string[] {
165160
allCommands.push(...lineCommands)
166161
}
167162

168-
// kilocode_change start
169163
// Restore newlines and carriage returns in quoted strings
170164
return allCommands.map((cmd) =>
171165
cmd
172166
.replace(new RegExp(NEWLINE_PLACEHOLDER, "g"), "\n")
173167
.replace(new RegExp(CARRIAGE_RETURN_PLACEHOLDER, "g"), "\r"),
174168
)
175-
// kilocode_change end
176169
}
177170

178171
/**

0 commit comments

Comments
 (0)