@kenkaiiii/ggcoder 4.3.175 → 4.3.177
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/system-prompt.d.ts.map +1 -1
- package/dist/system-prompt.js +1 -0
- package/dist/system-prompt.js.map +1 -1
- package/dist/tools/edit-diff.d.ts +61 -0
- package/dist/tools/edit-diff.d.ts.map +1 -1
- package/dist/tools/edit-diff.js +206 -0
- package/dist/tools/edit-diff.js.map +1 -1
- package/dist/tools/edit-diff.test.js +155 -1
- package/dist/tools/edit-diff.test.js.map +1 -1
- package/dist/tools/edit.d.ts +2 -0
- package/dist/tools/edit.d.ts.map +1 -1
- package/dist/tools/edit.js +166 -43
- package/dist/tools/edit.js.map +1 -1
- package/dist/tools/edit.test.js +314 -3
- package/dist/tools/edit.test.js.map +1 -1
- package/dist/tools/prompt-hints.js +2 -2
- package/dist/tools/prompt-hints.js.map +1 -1
- package/dist/ui/App.d.ts.map +1 -1
- package/dist/ui/App.js +10 -0
- package/dist/ui/App.js.map +1 -1
- package/package.json +4 -4
package/dist/tools/edit.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { resolvePath, rejectSymlink } from "./path-utils.js";
|
|
4
|
-
import { fuzzyFindText, countOccurrences, generateDiff, findClosestSnippet } from "./edit-diff.js";
|
|
4
|
+
import { fuzzyFindText, countOccurrences, generateDiff, findClosestSnippet, findOccurrenceLines, stripLeadingBlankLine, applyDotdotdots, applyMissingLeadingWhitespace, } from "./edit-diff.js";
|
|
5
5
|
import { localOperations } from "./operations.js";
|
|
6
6
|
import { assertFresh, recordWrite } from "./read-tracker.js";
|
|
7
7
|
const EditItem = z.object({
|
|
8
8
|
old_text: z.string().describe("The exact text to find and replace"),
|
|
9
9
|
new_text: z.string().describe("The replacement text"),
|
|
10
|
+
replace_all: z
|
|
11
|
+
.boolean()
|
|
12
|
+
.optional()
|
|
13
|
+
.describe("Replace every occurrence of old_text instead of requiring a unique match. " +
|
|
14
|
+
"Use for renames or repeated tokens. Defaults to false."),
|
|
10
15
|
});
|
|
11
16
|
// Some models (Opus 4.6, GLM-5.1) occasionally send `edits` as a JSON string
|
|
12
17
|
// instead of a real array, which trips Zod and makes the model fall back to
|
|
@@ -26,19 +31,44 @@ const EditParams = z.object({
|
|
|
26
31
|
file_path: z.string().describe("The file path to edit"),
|
|
27
32
|
edits: z
|
|
28
33
|
.preprocess(coerceStringifiedEdits, z.array(EditItem).min(1))
|
|
29
|
-
.describe("One or more edits applied in order. Each edit operates on the result of the previous one.
|
|
30
|
-
|
|
34
|
+
.describe("One or more edits applied in order. Each edit operates on the result of the previous one."),
|
|
35
|
+
atomic: z
|
|
36
|
+
.boolean()
|
|
37
|
+
.optional()
|
|
38
|
+
.describe("If true, fail the whole batch when any edit fails — no changes written. " +
|
|
39
|
+
"Default false: partial-apply, keep every successful edit and report failures " +
|
|
40
|
+
"for retry. Use atomic only when later edits depend on earlier ones in a way " +
|
|
41
|
+
"where a half-applied state would be worse than nothing."),
|
|
31
42
|
});
|
|
43
|
+
function tryMatch(working, old, next, replaceAll) {
|
|
44
|
+
if (old.length === 0)
|
|
45
|
+
return { ok: false, reason: "not_found" };
|
|
46
|
+
if (replaceAll && working.includes(old)) {
|
|
47
|
+
return { ok: true, newWorking: working.split(old).join(next) };
|
|
48
|
+
}
|
|
49
|
+
const occurrences = countOccurrences(working, old);
|
|
50
|
+
if (occurrences === 0)
|
|
51
|
+
return { ok: false, reason: "not_found" };
|
|
52
|
+
if (occurrences > 1)
|
|
53
|
+
return { ok: false, reason: "ambiguous", occurrences };
|
|
54
|
+
const match = fuzzyFindText(working, old);
|
|
55
|
+
if (!match.found)
|
|
56
|
+
return { ok: false, reason: "not_found" };
|
|
57
|
+
return {
|
|
58
|
+
ok: true,
|
|
59
|
+
newWorking: working.slice(0, match.index) + next + working.slice(match.index + match.matchLength),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
32
62
|
export function createEditTool(cwd, readFiles, ops = localOperations, planModeRef) {
|
|
33
63
|
return {
|
|
34
64
|
name: "edit",
|
|
35
|
-
description: "Replace
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
65
|
+
description: "Replace text in a file via { old_text, new_text } edits applied sequentially. Read the file first. " +
|
|
66
|
+
"Each old_text must uniquely match exactly one location — set replace_all: true to swap every occurrence (renames). " +
|
|
67
|
+
"For long blocks, a line containing only `...` in BOTH old_text and new_text elides a middle preserved verbatim. " +
|
|
68
|
+
"Partial-apply by default: failed edits are listed for retry, successful ones are still written — " +
|
|
69
|
+
"re-issue ONLY the listed failures, not the whole batch. Returns a unified diff.",
|
|
40
70
|
parameters: EditParams,
|
|
41
|
-
async execute({ file_path, edits }) {
|
|
71
|
+
async execute({ file_path, edits, atomic = false }) {
|
|
42
72
|
if (planModeRef?.current) {
|
|
43
73
|
return "Error: edit is restricted in plan mode. Use read-only tools to explore the codebase, then write your plan to .gg/plans/.";
|
|
44
74
|
}
|
|
@@ -50,55 +80,148 @@ export function createEditTool(cwd, readFiles, ops = localOperations, planModeRe
|
|
|
50
80
|
const originalNormalized = hasCRLF ? original.replace(/\r\n/g, "\n") : original;
|
|
51
81
|
let working = originalNormalized;
|
|
52
82
|
const fileName = path.basename(resolved);
|
|
53
|
-
const
|
|
83
|
+
const outcomes = new Array(edits.length);
|
|
54
84
|
for (let i = 0; i < edits.length; i++) {
|
|
55
|
-
const { old_text, new_text } = edits[i];
|
|
85
|
+
const { old_text, new_text, replace_all } = edits[i];
|
|
56
86
|
const normalizedOld = hasCRLF ? old_text.replace(/\r\n/g, "\n") : old_text;
|
|
57
87
|
const normalizedNew = hasCRLF ? new_text.replace(/\r\n/g, "\n") : new_text;
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
errors.push(`old_text not found in ${fileName}${label}. ` +
|
|
64
|
-
"Text must match verbatim — do not paraphrase. Re-read the file if unsure." +
|
|
65
|
-
hintLine);
|
|
88
|
+
const replaceAll = replace_all ?? false;
|
|
89
|
+
// Reject no-op edits before they consume a write or silently "succeed"
|
|
90
|
+
// — usually the model paraphrased the new_text to be identical to old.
|
|
91
|
+
if (normalizedOld === normalizedNew) {
|
|
92
|
+
outcomes[i] = { ok: false, failure: { reason: "noop" } };
|
|
66
93
|
continue;
|
|
67
94
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
95
|
+
// Aider's full fallback ladder, run only when the primary match
|
|
96
|
+
// returns "not_found". Ambiguous matches deliberately don't fall
|
|
97
|
+
// through — the model needs to add context, not paraphrase further.
|
|
98
|
+
// Order mirrors aider/coders/editblock_coder.py:
|
|
99
|
+
// 1. exact + smart-quote/dash fuzzy (in tryMatch)
|
|
100
|
+
// 2. indent-flex (model omitted/shortened leading whitespace)
|
|
101
|
+
// 3. drop leading blank line, retry 1+2
|
|
102
|
+
// 4. dotdotdots (`...` elision with preserved middle)
|
|
103
|
+
let result = tryMatch(working, normalizedOld, normalizedNew, replaceAll);
|
|
104
|
+
const tryFallbacks = (oldText) => {
|
|
105
|
+
const flexed = applyMissingLeadingWhitespace(working, oldText, normalizedNew);
|
|
106
|
+
if (flexed !== null)
|
|
107
|
+
return flexed;
|
|
108
|
+
// Re-run primary matcher on the stripped variant as a cheap retry.
|
|
109
|
+
const exact = tryMatch(working, oldText, normalizedNew, replaceAll);
|
|
110
|
+
if (exact.ok)
|
|
111
|
+
return exact.newWorking;
|
|
112
|
+
return null;
|
|
113
|
+
};
|
|
114
|
+
if (!result.ok && result.reason === "not_found") {
|
|
115
|
+
const indentFlexed = applyMissingLeadingWhitespace(working, normalizedOld, normalizedNew);
|
|
116
|
+
if (indentFlexed !== null) {
|
|
117
|
+
result = { ok: true, newWorking: indentFlexed };
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (!result.ok && result.reason === "not_found") {
|
|
121
|
+
const stripped = stripLeadingBlankLine(normalizedOld);
|
|
122
|
+
if (stripped !== null) {
|
|
123
|
+
const candidate = tryFallbacks(stripped);
|
|
124
|
+
if (candidate !== null)
|
|
125
|
+
result = { ok: true, newWorking: candidate };
|
|
126
|
+
}
|
|
72
127
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
128
|
+
if (!result.ok && result.reason === "not_found") {
|
|
129
|
+
const elided = applyDotdotdots(working, normalizedOld, normalizedNew);
|
|
130
|
+
if (elided !== null)
|
|
131
|
+
result = { ok: true, newWorking: elided };
|
|
132
|
+
}
|
|
133
|
+
if (result.ok) {
|
|
134
|
+
working = result.newWorking;
|
|
135
|
+
outcomes[i] = { ok: true };
|
|
76
136
|
continue;
|
|
77
137
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
138
|
+
if (result.reason === "not_found") {
|
|
139
|
+
// Capture the closest-match snippet eagerly against the current
|
|
140
|
+
// working buffer; we'll decide whether to render it post-loop based
|
|
141
|
+
// on whether other edits in this batch succeeded.
|
|
142
|
+
outcomes[i] = {
|
|
143
|
+
ok: false,
|
|
144
|
+
failure: {
|
|
145
|
+
reason: "not_found",
|
|
146
|
+
closestSnippet: findClosestSnippet(working, normalizedOld),
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
const occurrences = result.occurrences ?? 0;
|
|
152
|
+
const matches = findOccurrenceLines(working, normalizedOld);
|
|
153
|
+
const matchLines = matches.map((m) => ` line ${m.line}: ${m.preview}`).join("\n");
|
|
154
|
+
const more = occurrences > matches.length ? `\n …and ${occurrences - matches.length} more` : "";
|
|
155
|
+
outcomes[i] = {
|
|
156
|
+
ok: false,
|
|
157
|
+
failure: { reason: "ambiguous", occurrences, matchLines, more },
|
|
158
|
+
};
|
|
159
|
+
}
|
|
82
160
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
161
|
+
const failures = outcomes
|
|
162
|
+
.map((o, i) => (o.ok || !o.failure ? null : { index: i, failure: o.failure }))
|
|
163
|
+
.filter((x) => x !== null);
|
|
164
|
+
const successCount = outcomes.length - failures.length;
|
|
165
|
+
// Closest-match snippets only get suppressed when successes will ACTUALLY
|
|
166
|
+
// be persisted (partial-apply with at least one win). In atomic mode we
|
|
167
|
+
// throw before writing, so the model retries against an unchanged file
|
|
168
|
+
// and the snippet is its only guidance — keep it.
|
|
169
|
+
const willPersistSuccesses = successCount > 0 && !atomic;
|
|
170
|
+
const formatFailureMessage = (f) => {
|
|
171
|
+
if (f.reason === "noop") {
|
|
172
|
+
return `old_text and new_text are identical in ${fileName} — this edit would be a no-op. Either fix new_text or drop this edit.`;
|
|
173
|
+
}
|
|
174
|
+
if (f.reason === "ambiguous") {
|
|
175
|
+
return (`old_text found ${f.occurrences} times in ${fileName}. ` +
|
|
176
|
+
"Include more surrounding context to make the match unique, " +
|
|
177
|
+
"or set replace_all: true to swap every occurrence.\n" +
|
|
178
|
+
"Matches at:\n" +
|
|
179
|
+
f.matchLines +
|
|
180
|
+
f.more);
|
|
181
|
+
}
|
|
182
|
+
const base = `old_text not found in ${fileName}. ` +
|
|
183
|
+
"Text must match verbatim — do not paraphrase. Re-read the file if unsure.";
|
|
184
|
+
if (willPersistSuccesses || !f.closestSnippet)
|
|
185
|
+
return base;
|
|
186
|
+
return `${base}\nClosest match in file:\n${f.closestSnippet}`;
|
|
187
|
+
};
|
|
188
|
+
const formatFailures = () => {
|
|
189
|
+
if (failures.length === 1 && edits.length === 1) {
|
|
190
|
+
return formatFailureMessage(failures[0].failure);
|
|
191
|
+
}
|
|
192
|
+
return failures
|
|
193
|
+
.map((f) => `[edit ${f.index + 1}/${edits.length}] ${formatFailureMessage(f.failure)}`)
|
|
194
|
+
.join("\n\n");
|
|
195
|
+
};
|
|
196
|
+
// Atomic-mode failure, OR partial-mode failure where literally nothing
|
|
197
|
+
// succeeded. Either way nothing should be written and we throw to make
|
|
198
|
+
// the model retry the whole batch.
|
|
199
|
+
if (failures.length > 0 && (atomic || successCount === 0)) {
|
|
200
|
+
const header = atomic && failures.length > 0
|
|
201
|
+
? `${failures.length} of ${edits.length} edit${edits.length === 1 ? "" : "s"} failed; no changes written (atomic).\n\n`
|
|
202
|
+
: edits.length > 1
|
|
203
|
+
? `${failures.length} of ${edits.length} edits failed; no changes written.\n\n`
|
|
204
|
+
: "";
|
|
205
|
+
throw new Error(header + formatFailures());
|
|
89
206
|
}
|
|
90
207
|
const finalContent = hasCRLF ? working.replace(/\n/g, "\r\n") : working;
|
|
91
208
|
await ops.writeFile(resolved, finalContent);
|
|
92
209
|
await recordWrite(readFiles, resolved, finalContent, ops);
|
|
93
210
|
const relPath = path.relative(cwd, resolved);
|
|
94
211
|
const diff = generateDiff(originalNormalized, working, relPath);
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
content: summary,
|
|
100
|
-
|
|
101
|
-
|
|
212
|
+
if (failures.length === 0) {
|
|
213
|
+
const summary = edits.length > 1
|
|
214
|
+
? `Successfully applied ${edits.length} edits to ${relPath}.`
|
|
215
|
+
: `Successfully replaced text in ${relPath}.`;
|
|
216
|
+
return { content: summary, details: { diff } };
|
|
217
|
+
}
|
|
218
|
+
// Partial success — the loud header is deliberate: the model has to know
|
|
219
|
+
// that work was saved AND that only the listed edits need to be retried.
|
|
220
|
+
const noun = failures.length === 1 ? "edit" : "edits";
|
|
221
|
+
const content = `Applied ${successCount} of ${edits.length} edits to ${relPath}.\n` +
|
|
222
|
+
`${failures.length} ${noun} skipped — re-issue ONLY these (the rest are already done, do not redo them):\n\n` +
|
|
223
|
+
formatFailures();
|
|
224
|
+
return { content, details: { diff } };
|
|
102
225
|
},
|
|
103
226
|
};
|
|
104
227
|
}
|
package/dist/tools/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.js","sourceRoot":"","sources":["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