@nervekit/tools 0.1.0
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/LICENSE +201 -0
- package/NOTICE +5 -0
- package/dist/catalog/core/filesystem.tools.d.ts +140 -0
- package/dist/catalog/core/filesystem.tools.d.ts.map +1 -0
- package/dist/catalog/core/filesystem.tools.js +221 -0
- package/dist/catalog/core/filesystem.tools.js.map +1 -0
- package/dist/catalog/core/interaction.tools.d.ts +37 -0
- package/dist/catalog/core/interaction.tools.d.ts.map +1 -0
- package/dist/catalog/core/interaction.tools.js +55 -0
- package/dist/catalog/core/interaction.tools.js.map +1 -0
- package/dist/catalog/core/python.tools.d.ts +17 -0
- package/dist/catalog/core/python.tools.d.ts.map +1 -0
- package/dist/catalog/core/python.tools.js +32 -0
- package/dist/catalog/core/python.tools.js.map +1 -0
- package/dist/catalog/core/shell.tools.d.ts +14 -0
- package/dist/catalog/core/shell.tools.d.ts.map +1 -0
- package/dist/catalog/core/shell.tools.js +22 -0
- package/dist/catalog/core/shell.tools.js.map +1 -0
- package/dist/catalog/core/web.tools.d.ts +23 -0
- package/dist/catalog/core/web.tools.d.ts.map +1 -0
- package/dist/catalog/core/web.tools.js +34 -0
- package/dist/catalog/core/web.tools.js.map +1 -0
- package/dist/catalog/descriptors.d.ts +4 -0
- package/dist/catalog/descriptors.d.ts.map +1 -0
- package/dist/catalog/descriptors.js +17 -0
- package/dist/catalog/descriptors.js.map +1 -0
- package/dist/catalog/index.d.ts +18 -0
- package/dist/catalog/index.d.ts.map +1 -0
- package/dist/catalog/index.js +44 -0
- package/dist/catalog/index.js.map +1 -0
- package/dist/catalog/orchestration/explore.tools.d.ts +20 -0
- package/dist/catalog/orchestration/explore.tools.d.ts.map +1 -0
- package/dist/catalog/orchestration/explore.tools.js +42 -0
- package/dist/catalog/orchestration/explore.tools.js.map +1 -0
- package/dist/catalog/orchestration/plan-mode.tools.d.ts +32 -0
- package/dist/catalog/orchestration/plan-mode.tools.d.ts.map +1 -0
- package/dist/catalog/orchestration/plan-mode.tools.js +43 -0
- package/dist/catalog/orchestration/plan-mode.tools.js.map +1 -0
- package/dist/catalog/orchestration/process.tools.d.ts +68 -0
- package/dist/catalog/orchestration/process.tools.d.ts.map +1 -0
- package/dist/catalog/orchestration/process.tools.js +96 -0
- package/dist/catalog/orchestration/process.tools.js.map +1 -0
- package/dist/catalog/orchestration/subagent.tools.d.ts +16 -0
- package/dist/catalog/orchestration/subagent.tools.d.ts.map +1 -0
- package/dist/catalog/orchestration/subagent.tools.js +25 -0
- package/dist/catalog/orchestration/subagent.tools.js.map +1 -0
- package/dist/catalog/orchestration/task.tools.d.ts +107 -0
- package/dist/catalog/orchestration/task.tools.d.ts.map +1 -0
- package/dist/catalog/orchestration/task.tools.js +170 -0
- package/dist/catalog/orchestration/task.tools.js.map +1 -0
- package/dist/catalog/risk.d.ts +3 -0
- package/dist/catalog/risk.d.ts.map +1 -0
- package/dist/catalog/risk.js +29 -0
- package/dist/catalog/risk.js.map +1 -0
- package/dist/catalog/types.d.ts +14 -0
- package/dist/catalog/types.d.ts.map +1 -0
- package/dist/catalog/types.js +2 -0
- package/dist/catalog/types.js.map +1 -0
- package/dist/definitions.d.ts +2 -0
- package/dist/definitions.d.ts.map +1 -0
- package/dist/definitions.js +2 -0
- package/dist/definitions.js.map +1 -0
- package/dist/execution/atomic-write.d.ts +2 -0
- package/dist/execution/atomic-write.d.ts.map +1 -0
- package/dist/execution/atomic-write.js +7 -0
- package/dist/execution/atomic-write.js.map +1 -0
- package/dist/execution/bash.d.ts +3 -0
- package/dist/execution/bash.d.ts.map +1 -0
- package/dist/execution/bash.js +133 -0
- package/dist/execution/bash.js.map +1 -0
- package/dist/execution/common/args.d.ts +2 -0
- package/dist/execution/common/args.d.ts.map +1 -0
- package/dist/execution/common/args.js +6 -0
- package/dist/execution/common/args.js.map +1 -0
- package/dist/execution/common/output-budget.d.ts +61 -0
- package/dist/execution/common/output-budget.d.ts.map +1 -0
- package/dist/execution/common/output-budget.js +140 -0
- package/dist/execution/common/output-budget.js.map +1 -0
- package/dist/execution/common/process-result.d.ts +44 -0
- package/dist/execution/common/process-result.d.ts.map +1 -0
- package/dist/execution/common/process-result.js +322 -0
- package/dist/execution/common/process-result.js.map +1 -0
- package/dist/execution/common/search-utils.d.ts +8 -0
- package/dist/execution/common/search-utils.d.ts.map +1 -0
- package/dist/execution/common/search-utils.js +110 -0
- package/dist/execution/common/search-utils.js.map +1 -0
- package/dist/execution/common/tool-error.d.ts +8 -0
- package/dist/execution/common/tool-error.d.ts.map +1 -0
- package/dist/execution/common/tool-error.js +14 -0
- package/dist/execution/common/tool-error.js.map +1 -0
- package/dist/execution/common/truncate.d.ts +27 -0
- package/dist/execution/common/truncate.d.ts.map +1 -0
- package/dist/execution/common/truncate.js +108 -0
- package/dist/execution/common/truncate.js.map +1 -0
- package/dist/execution/common.d.ts +2 -0
- package/dist/execution/common.d.ts.map +1 -0
- package/dist/execution/common.js +6 -0
- package/dist/execution/common.js.map +1 -0
- package/dist/execution/core-dispatch.d.ts +4 -0
- package/dist/execution/core-dispatch.d.ts.map +1 -0
- package/dist/execution/core-dispatch.js +58 -0
- package/dist/execution/core-dispatch.js.map +1 -0
- package/dist/execution/dispatch.d.ts +4 -0
- package/dist/execution/dispatch.d.ts.map +1 -0
- package/dist/execution/dispatch.js +54 -0
- package/dist/execution/dispatch.js.map +1 -0
- package/dist/execution/edit.d.ts +9 -0
- package/dist/execution/edit.d.ts.map +1 -0
- package/dist/execution/edit.js +175 -0
- package/dist/execution/edit.js.map +1 -0
- package/dist/execution/file-mutation-queue.d.ts +2 -0
- package/dist/execution/file-mutation-queue.d.ts.map +1 -0
- package/dist/execution/file-mutation-queue.js +19 -0
- package/dist/execution/file-mutation-queue.js.map +1 -0
- package/dist/execution/filesystem/atomic-write.d.ts +2 -0
- package/dist/execution/filesystem/atomic-write.d.ts.map +1 -0
- package/dist/execution/filesystem/atomic-write.js +7 -0
- package/dist/execution/filesystem/atomic-write.js.map +1 -0
- package/dist/execution/filesystem/edit-args.d.ts +46 -0
- package/dist/execution/filesystem/edit-args.d.ts.map +1 -0
- package/dist/execution/filesystem/edit-args.js +212 -0
- package/dist/execution/filesystem/edit-args.js.map +1 -0
- package/dist/execution/filesystem/edit-errors.d.ts +4 -0
- package/dist/execution/filesystem/edit-errors.d.ts.map +1 -0
- package/dist/execution/filesystem/edit-errors.js +8 -0
- package/dist/execution/filesystem/edit-errors.js.map +1 -0
- package/dist/execution/filesystem/edit.d.ts +4 -0
- package/dist/execution/filesystem/edit.d.ts.map +1 -0
- package/dist/execution/filesystem/edit.js +330 -0
- package/dist/execution/filesystem/edit.js.map +1 -0
- package/dist/execution/filesystem/file-mutation-queue.d.ts +2 -0
- package/dist/execution/filesystem/file-mutation-queue.d.ts.map +1 -0
- package/dist/execution/filesystem/file-mutation-queue.js +19 -0
- package/dist/execution/filesystem/file-mutation-queue.js.map +1 -0
- package/dist/execution/filesystem/find.d.ts +3 -0
- package/dist/execution/filesystem/find.d.ts.map +1 -0
- package/dist/execution/filesystem/find.js +93 -0
- package/dist/execution/filesystem/find.js.map +1 -0
- package/dist/execution/filesystem/legacy-edit.d.ts +9 -0
- package/dist/execution/filesystem/legacy-edit.d.ts.map +1 -0
- package/dist/execution/filesystem/legacy-edit.js +122 -0
- package/dist/execution/filesystem/legacy-edit.js.map +1 -0
- package/dist/execution/filesystem/list.d.ts +3 -0
- package/dist/execution/filesystem/list.d.ts.map +1 -0
- package/dist/execution/filesystem/list.js +49 -0
- package/dist/execution/filesystem/list.js.map +1 -0
- package/dist/execution/filesystem/path.d.ts +7 -0
- package/dist/execution/filesystem/path.d.ts.map +1 -0
- package/dist/execution/filesystem/path.js +69 -0
- package/dist/execution/filesystem/path.js.map +1 -0
- package/dist/execution/filesystem/read.d.ts +3 -0
- package/dist/execution/filesystem/read.d.ts.map +1 -0
- package/dist/execution/filesystem/read.js +225 -0
- package/dist/execution/filesystem/read.js.map +1 -0
- package/dist/execution/filesystem/search.d.ts +3 -0
- package/dist/execution/filesystem/search.d.ts.map +1 -0
- package/dist/execution/filesystem/search.js +149 -0
- package/dist/execution/filesystem/search.js.map +1 -0
- package/dist/execution/filesystem/smart-match.d.ts +31 -0
- package/dist/execution/filesystem/smart-match.d.ts.map +1 -0
- package/dist/execution/filesystem/smart-match.js +309 -0
- package/dist/execution/filesystem/smart-match.js.map +1 -0
- package/dist/execution/filesystem/text-editing.d.ts +9 -0
- package/dist/execution/filesystem/text-editing.d.ts.map +1 -0
- package/dist/execution/filesystem/text-editing.js +43 -0
- package/dist/execution/filesystem/text-editing.js.map +1 -0
- package/dist/execution/filesystem/write.d.ts +3 -0
- package/dist/execution/filesystem/write.d.ts.map +1 -0
- package/dist/execution/filesystem/write.js +21 -0
- package/dist/execution/filesystem/write.js.map +1 -0
- package/dist/execution/find.d.ts +3 -0
- package/dist/execution/find.d.ts.map +1 -0
- package/dist/execution/find.js +90 -0
- package/dist/execution/find.js.map +1 -0
- package/dist/execution/index.d.ts +18 -0
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +17 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/execution/list.d.ts +3 -0
- package/dist/execution/list.d.ts.map +1 -0
- package/dist/execution/list.js +46 -0
- package/dist/execution/list.js.map +1 -0
- package/dist/execution/path.d.ts +7 -0
- package/dist/execution/path.d.ts.map +1 -0
- package/dist/execution/path.js +69 -0
- package/dist/execution/path.js.map +1 -0
- package/dist/execution/python/python.d.ts +3 -0
- package/dist/execution/python/python.d.ts.map +1 -0
- package/dist/execution/python/python.js +566 -0
- package/dist/execution/python/python.js.map +1 -0
- package/dist/execution/python/runtime.d.ts +22 -0
- package/dist/execution/python/runtime.d.ts.map +1 -0
- package/dist/execution/python/runtime.js +178 -0
- package/dist/execution/python/runtime.js.map +1 -0
- package/dist/execution/read.d.ts +3 -0
- package/dist/execution/read.d.ts.map +1 -0
- package/dist/execution/read.js +97 -0
- package/dist/execution/read.js.map +1 -0
- package/dist/execution/search-utils.d.ts +8 -0
- package/dist/execution/search-utils.d.ts.map +1 -0
- package/dist/execution/search-utils.js +110 -0
- package/dist/execution/search-utils.js.map +1 -0
- package/dist/execution/search.d.ts +3 -0
- package/dist/execution/search.d.ts.map +1 -0
- package/dist/execution/search.js +131 -0
- package/dist/execution/search.js.map +1 -0
- package/dist/execution/shell/bash.d.ts +3 -0
- package/dist/execution/shell/bash.d.ts.map +1 -0
- package/dist/execution/shell/bash.js +134 -0
- package/dist/execution/shell/bash.js.map +1 -0
- package/dist/execution/truncate.d.ts +21 -0
- package/dist/execution/truncate.d.ts.map +1 -0
- package/dist/execution/truncate.js +94 -0
- package/dist/execution/truncate.js.map +1 -0
- package/dist/execution/web/web-fetch.d.ts +3 -0
- package/dist/execution/web/web-fetch.d.ts.map +1 -0
- package/dist/execution/web/web-fetch.js +132 -0
- package/dist/execution/web/web-fetch.js.map +1 -0
- package/dist/execution/web/web-search.d.ts +3 -0
- package/dist/execution/web/web-search.d.ts.map +1 -0
- package/dist/execution/web/web-search.js +59 -0
- package/dist/execution/web/web-search.js.map +1 -0
- package/dist/execution/web-fetch.d.ts +3 -0
- package/dist/execution/web-fetch.d.ts.map +1 -0
- package/dist/execution/web-fetch.js +132 -0
- package/dist/execution/web-fetch.js.map +1 -0
- package/dist/execution/web-search.d.ts +3 -0
- package/dist/execution/web-search.d.ts.map +1 -0
- package/dist/execution/web-search.js +59 -0
- package/dist/execution/web-search.js.map +1 -0
- package/dist/execution/write.d.ts +3 -0
- package/dist/execution/write.d.ts.map +1 -0
- package/dist/execution/write.js +21 -0
- package/dist/execution/write.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/safety/command-policy-git.d.ts +2 -0
- package/dist/safety/command-policy-git.d.ts.map +1 -0
- package/dist/safety/command-policy-git.js +88 -0
- package/dist/safety/command-policy-git.js.map +1 -0
- package/dist/safety/command-policy-options.d.ts +6 -0
- package/dist/safety/command-policy-options.d.ts.map +1 -0
- package/dist/safety/command-policy-options.js +112 -0
- package/dist/safety/command-policy-options.js.map +1 -0
- package/dist/safety/command-policy-packages.d.ts +4 -0
- package/dist/safety/command-policy-packages.d.ts.map +1 -0
- package/dist/safety/command-policy-packages.js +161 -0
- package/dist/safety/command-policy-packages.js.map +1 -0
- package/dist/safety/command-policy-parser.d.ts +11 -0
- package/dist/safety/command-policy-parser.d.ts.map +1 -0
- package/dist/safety/command-policy-parser.js +121 -0
- package/dist/safety/command-policy-parser.js.map +1 -0
- package/dist/safety/command-policy-wrappers.d.ts +6 -0
- package/dist/safety/command-policy-wrappers.d.ts.map +1 -0
- package/dist/safety/command-policy-wrappers.js +95 -0
- package/dist/safety/command-policy-wrappers.js.map +1 -0
- package/dist/safety/command-policy.d.ts +6 -0
- package/dist/safety/command-policy.d.ts.map +1 -0
- package/dist/safety/command-policy.js +118 -0
- package/dist/safety/command-policy.js.map +1 -0
- package/dist/types.d.ts +78 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { argumentError } from "./edit-errors.js";
|
|
2
|
+
const matchModes = new Set(["exact", "trimmed", "whitespace"]);
|
|
3
|
+
const positions = new Set(["before", "after"]);
|
|
4
|
+
export function normalizeEditArgs(args) {
|
|
5
|
+
const dryRun = booleanArg(args.dryRun, false, "dryRun");
|
|
6
|
+
rejectDeprecatedEditArgs(args);
|
|
7
|
+
const operations = [];
|
|
8
|
+
const replacements = arrayArg(args.replacements, "replacements");
|
|
9
|
+
const insertions = arrayArg(args.insertions, "insertions");
|
|
10
|
+
const lineReplacements = arrayArg(args.lineReplacements, "lineReplacements");
|
|
11
|
+
const lineInsertions = arrayArg(args.lineInsertions, "lineInsertions");
|
|
12
|
+
const patch = optionalStringArg(args.patch, "patch");
|
|
13
|
+
const hasArrayEdits = Boolean(replacements || insertions || lineReplacements || lineInsertions);
|
|
14
|
+
if (patch !== undefined && hasArrayEdits) {
|
|
15
|
+
throw argumentError("Tool argument 'patch' must not be combined with replacements, insertions, lineReplacements, or lineInsertions.", { hasPatch: true });
|
|
16
|
+
}
|
|
17
|
+
if (replacements) {
|
|
18
|
+
operations.push(...replacements.map(normalizeReplacement));
|
|
19
|
+
}
|
|
20
|
+
if (insertions) {
|
|
21
|
+
operations.push(...insertions.map(normalizeInsertion));
|
|
22
|
+
}
|
|
23
|
+
if (lineReplacements) {
|
|
24
|
+
operations.push(...lineReplacements.map(normalizeLineReplacement));
|
|
25
|
+
}
|
|
26
|
+
if (lineInsertions) {
|
|
27
|
+
operations.push(...lineInsertions.map(normalizeLineInsertion));
|
|
28
|
+
}
|
|
29
|
+
if (patch !== undefined) {
|
|
30
|
+
operations.push({
|
|
31
|
+
type: "apply_patch",
|
|
32
|
+
patch: nonEmptyStringArg(patch, "patch"),
|
|
33
|
+
source: sourceFor("patch", 0),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (operations.length === 0) {
|
|
37
|
+
throw argumentError("Provide at least one edit using replacements, insertions, lineReplacements, lineInsertions, or patch.");
|
|
38
|
+
}
|
|
39
|
+
return { dryRun, operations };
|
|
40
|
+
}
|
|
41
|
+
function rejectDeprecatedEditArgs(args) {
|
|
42
|
+
if (args.operations !== undefined) {
|
|
43
|
+
throw argumentError("Tool argument 'operations' is no longer supported; use replacements, insertions, lineReplacements, lineInsertions, or patch.");
|
|
44
|
+
}
|
|
45
|
+
if (args.oldText !== undefined || args.newText !== undefined) {
|
|
46
|
+
throw argumentError("Top-level oldText/newText are no longer supported for edit; use replacements: [{ oldText, newText }].");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function arrayArg(value, name) {
|
|
50
|
+
if (value === undefined)
|
|
51
|
+
return undefined;
|
|
52
|
+
const parsed = parseArrayValue(value);
|
|
53
|
+
if (!Array.isArray(parsed)) {
|
|
54
|
+
throw argumentError(`Tool argument '${name}' must be an array.`, {
|
|
55
|
+
source: name,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (parsed.length === 0) {
|
|
59
|
+
throw argumentError(`Tool argument '${name}' must contain at least one item.`, {
|
|
60
|
+
source: name,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return parsed;
|
|
64
|
+
}
|
|
65
|
+
function parseArrayValue(value) {
|
|
66
|
+
if (typeof value !== "string")
|
|
67
|
+
return value;
|
|
68
|
+
try {
|
|
69
|
+
return JSON.parse(value);
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function normalizeReplacement(entry, index) {
|
|
76
|
+
const label = `replacements[${index}]`;
|
|
77
|
+
const record = objectArg(entry, label);
|
|
78
|
+
assertAllowedFields(record, label, [
|
|
79
|
+
"oldText",
|
|
80
|
+
"newText",
|
|
81
|
+
"matchMode",
|
|
82
|
+
"occurrence",
|
|
83
|
+
]);
|
|
84
|
+
const operation = {
|
|
85
|
+
type: "replace_text",
|
|
86
|
+
oldText: nonEmptyStringArg(record.oldText, `${label}.oldText`),
|
|
87
|
+
newText: stringArg(record.newText, `${label}.newText`),
|
|
88
|
+
matchMode: matchModeArg(record.matchMode, `${label}.matchMode`),
|
|
89
|
+
source: sourceFor("replacements", index),
|
|
90
|
+
};
|
|
91
|
+
const occurrence = optionalPositiveIntegerArg(record.occurrence, `${label}.occurrence`);
|
|
92
|
+
return occurrence === undefined ? operation : { ...operation, occurrence };
|
|
93
|
+
}
|
|
94
|
+
function normalizeInsertion(entry, index) {
|
|
95
|
+
const label = `insertions[${index}]`;
|
|
96
|
+
const record = objectArg(entry, label);
|
|
97
|
+
assertAllowedFields(record, label, [
|
|
98
|
+
"anchor",
|
|
99
|
+
"position",
|
|
100
|
+
"text",
|
|
101
|
+
"matchMode",
|
|
102
|
+
"occurrence",
|
|
103
|
+
]);
|
|
104
|
+
const operation = {
|
|
105
|
+
type: "insert_text",
|
|
106
|
+
anchor: nonEmptyStringArg(record.anchor, `${label}.anchor`),
|
|
107
|
+
position: positionArg(record.position, `${label}.position`),
|
|
108
|
+
text: stringArg(record.text, `${label}.text`),
|
|
109
|
+
matchMode: matchModeArg(record.matchMode, `${label}.matchMode`),
|
|
110
|
+
source: sourceFor("insertions", index),
|
|
111
|
+
};
|
|
112
|
+
const occurrence = optionalPositiveIntegerArg(record.occurrence, `${label}.occurrence`);
|
|
113
|
+
return occurrence === undefined ? operation : { ...operation, occurrence };
|
|
114
|
+
}
|
|
115
|
+
function normalizeLineReplacement(entry, index) {
|
|
116
|
+
const label = `lineReplacements[${index}]`;
|
|
117
|
+
const record = objectArg(entry, label);
|
|
118
|
+
assertAllowedFields(record, label, ["startLine", "endLine", "newText"]);
|
|
119
|
+
return {
|
|
120
|
+
type: "replace_lines",
|
|
121
|
+
startLine: positiveIntegerArg(record.startLine, `${label}.startLine`),
|
|
122
|
+
endLine: positiveIntegerArg(record.endLine, `${label}.endLine`),
|
|
123
|
+
newText: stringArg(record.newText, `${label}.newText`),
|
|
124
|
+
source: sourceFor("lineReplacements", index),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function normalizeLineInsertion(entry, index) {
|
|
128
|
+
const label = `lineInsertions[${index}]`;
|
|
129
|
+
const record = objectArg(entry, label);
|
|
130
|
+
assertAllowedFields(record, label, ["line", "position", "text"]);
|
|
131
|
+
return {
|
|
132
|
+
type: "insert_lines",
|
|
133
|
+
line: positiveIntegerArg(record.line, `${label}.line`),
|
|
134
|
+
position: positionArg(record.position, `${label}.position`),
|
|
135
|
+
text: stringArg(record.text, `${label}.text`),
|
|
136
|
+
source: sourceFor("lineInsertions", index),
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function objectArg(value, label) {
|
|
140
|
+
if (!value || typeof value !== "object") {
|
|
141
|
+
throw argumentError(`${label} must be an object.`, { sourceLabel: label });
|
|
142
|
+
}
|
|
143
|
+
return value;
|
|
144
|
+
}
|
|
145
|
+
function sourceFor(key, index) {
|
|
146
|
+
return {
|
|
147
|
+
key,
|
|
148
|
+
index,
|
|
149
|
+
label: key === "patch" ? "patch" : `${key}[${index}]`,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function assertAllowedFields(record, label, allowed) {
|
|
153
|
+
const allowedSet = new Set(allowed);
|
|
154
|
+
const unexpected = Object.keys(record).filter((key) => !allowedSet.has(key));
|
|
155
|
+
if (unexpected.length === 0)
|
|
156
|
+
return;
|
|
157
|
+
throw argumentError(`${label} has unsupported field(s): ${unexpected.join(", ")}.`, { sourceLabel: label, unexpected });
|
|
158
|
+
}
|
|
159
|
+
function booleanArg(value, fallback, name) {
|
|
160
|
+
if (value === undefined)
|
|
161
|
+
return fallback;
|
|
162
|
+
if (typeof value !== "boolean") {
|
|
163
|
+
throw argumentError(`Tool argument '${name}' must be a boolean.`);
|
|
164
|
+
}
|
|
165
|
+
return value;
|
|
166
|
+
}
|
|
167
|
+
function optionalStringArg(value, name) {
|
|
168
|
+
if (value === undefined)
|
|
169
|
+
return undefined;
|
|
170
|
+
return stringArg(value, name);
|
|
171
|
+
}
|
|
172
|
+
function stringArg(value, name) {
|
|
173
|
+
if (typeof value !== "string") {
|
|
174
|
+
throw argumentError(`${name} must be a string.`);
|
|
175
|
+
}
|
|
176
|
+
return value;
|
|
177
|
+
}
|
|
178
|
+
function nonEmptyStringArg(value, name) {
|
|
179
|
+
const text = stringArg(value, name);
|
|
180
|
+
if (text.length === 0) {
|
|
181
|
+
throw argumentError(`${name} must be a non-empty string.`);
|
|
182
|
+
}
|
|
183
|
+
return text;
|
|
184
|
+
}
|
|
185
|
+
function positiveIntegerArg(value, name) {
|
|
186
|
+
if (typeof value !== "number" || !Number.isInteger(value) || value < 1) {
|
|
187
|
+
throw argumentError(`${name} must be a positive integer.`);
|
|
188
|
+
}
|
|
189
|
+
return value;
|
|
190
|
+
}
|
|
191
|
+
function optionalPositiveIntegerArg(value, name) {
|
|
192
|
+
if (value === undefined)
|
|
193
|
+
return undefined;
|
|
194
|
+
return positiveIntegerArg(value, name);
|
|
195
|
+
}
|
|
196
|
+
function positionArg(value, name) {
|
|
197
|
+
if (typeof value !== "string" || !positions.has(value)) {
|
|
198
|
+
throw argumentError(`${name} must be either "before" or "after".`);
|
|
199
|
+
}
|
|
200
|
+
return value;
|
|
201
|
+
}
|
|
202
|
+
function matchModeArg(value, name) {
|
|
203
|
+
if (value === undefined)
|
|
204
|
+
return "exact";
|
|
205
|
+
if (typeof value !== "string" || !matchModes.has(value)) {
|
|
206
|
+
throw argumentError(`${name} must be one of exact, trimmed, whitespace.`, {
|
|
207
|
+
matchMode: value,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
return value;
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=edit-args.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-args.js","sourceRoot":"","sources":["../../../src/execution/filesystem/edit-args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA8DjD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAY,CAAC,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;AAC1E,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAE/C,MAAM,UAAU,iBAAiB,CAC/B,IAA6B;IAE7B,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACxD,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAE/B,MAAM,UAAU,GAA8B,EAAE,CAAC;IACjD,MAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;IACjE,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,C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AAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACvE,MAAM,aAAa,CAAC,GAAG,IAAI,8BAA8B,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,0BAA0B,CACjC,KAAc,EACd,IAAY;IAEZ,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,OAAO,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,WAAW,CAAC,KAAc,EAAE,IAAY;IAC/C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACvD,MAAM,aAAa,CAAC,GAAG,IAAI,sCAAsC,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,KAA2B,CAAC;AACrC,CAAC;AAED,SAAS,YAAY,CAAC,KAAc,EAAE,IAAY;IAChD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,OAAO,CAAC;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAkB,CAAC,EAAE,CAAC;QACrE,MAAM,aAAa,CAAC,GAAG,IAAI,6CAA6C,EAAE;YACxE,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,KAAkB,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ToolExecutionError } from "../common/tool-error.js";
|
|
2
|
+
export declare function argumentError(message: string, details?: Record<string, unknown>): ToolExecutionError;
|
|
3
|
+
export declare function editError(code: string, message: string, details?: Record<string, unknown>, retryable?: boolean): ToolExecutionError;
|
|
4
|
+
//# sourceMappingURL=edit-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-errors.d.ts","sourceRoot":"","sources":["../../../src/execution/filesystem/edit-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACpC,kBAAkB,CAEpB;AAED,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACrC,SAAS,UAAQ,GAChB,kBAAkB,CAEpB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ToolExecutionError } from "../common/tool-error.js";
|
|
2
|
+
export function argumentError(message, details = {}) {
|
|
3
|
+
return editError("EDIT_ARGUMENT_INVALID", message, details, true);
|
|
4
|
+
}
|
|
5
|
+
export function editError(code, message, details = {}, retryable = false) {
|
|
6
|
+
return new ToolExecutionError(code, message, details, retryable);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=edit-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-errors.js","sourceRoot":"","sources":["../../../src/execution/filesystem/edit-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,UAAU,aAAa,CAC3B,OAAe,EACf,UAAmC,EAAE;IAErC,OAAO,SAAS,CAAC,uBAAuB,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,SAAS,CACvB,IAAY,EACZ,OAAe,EACf,UAAmC,EAAE,EACrC,SAAS,GAAG,KAAK;IAEjB,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ToolExecutionContext, ToolExecutionResult } from "../../types.js";
|
|
2
|
+
export { normalizeEditArgs } from "./edit-args.js";
|
|
3
|
+
export declare function executeEdit(args: Record<string, unknown>, context: ToolExecutionContext): Promise<ToolExecutionResult>;
|
|
4
|
+
//# sourceMappingURL=edit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../src/execution/filesystem/edit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAqBhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAuBnD,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAuD9B"}
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { applyPatch, parsePatch } from "diff";
|
|
3
|
+
import { writeTextFileAtomically } from "./atomic-write.js";
|
|
4
|
+
import { normalizeEditArgs, } from "./edit-args.js";
|
|
5
|
+
import { argumentError, editError } from "./edit-errors.js";
|
|
6
|
+
import { withFileMutationQueue } from "./file-mutation-queue.js";
|
|
7
|
+
import { resolveToolPath } from "./path.js";
|
|
8
|
+
import { resolveTextMatch } from "./smart-match.js";
|
|
9
|
+
import { detectLineEnding, firstChangedLine, generateDiffString, normalizeLineEndings, restoreLineEndings, } from "./text-editing.js";
|
|
10
|
+
export { normalizeEditArgs } from "./edit-args.js";
|
|
11
|
+
export async function executeEdit(args, context) {
|
|
12
|
+
const path = resolveToolPath(context.cwd, args.path);
|
|
13
|
+
const normalized = normalizeEditArgs(args);
|
|
14
|
+
return withFileMutationQueue(path, async () => {
|
|
15
|
+
const raw = await readFile(path, "utf8");
|
|
16
|
+
if (raw.includes("\0")) {
|
|
17
|
+
throw editError("EDIT_BINARY_FILE", `edit cannot edit ${path} because it appears to be a binary file.`, { path });
|
|
18
|
+
}
|
|
19
|
+
const bom = raw.startsWith("\uFEFF") ? "\uFEFF" : "";
|
|
20
|
+
const withoutBom = bom ? raw.slice(1) : raw;
|
|
21
|
+
const lineEnding = detectLineEnding(withoutBom);
|
|
22
|
+
const content = normalizeLineEndings(withoutBom);
|
|
23
|
+
const { updated, operationDetails } = resolveEditOperations(content, normalized.operations, path);
|
|
24
|
+
if (updated === content) {
|
|
25
|
+
throw editError("EDIT_NO_CHANGE", `edit would not change ${path}.`, {
|
|
26
|
+
path,
|
|
27
|
+
operationCount: normalized.operations.length,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
if (!normalized.dryRun) {
|
|
31
|
+
const restored = bom + restoreLineEndings(updated, lineEnding);
|
|
32
|
+
await writeTextFileAtomically(path, restored);
|
|
33
|
+
}
|
|
34
|
+
const contentMessage = normalized.dryRun
|
|
35
|
+
? `Previewed edit with ${normalized.operations.length} operation(s); no file was written.`
|
|
36
|
+
: `Edited file with ${normalized.operations.length} operation(s).`;
|
|
37
|
+
return {
|
|
38
|
+
path,
|
|
39
|
+
content: contentMessage,
|
|
40
|
+
contentBlocks: [{ type: "text", text: contentMessage }],
|
|
41
|
+
details: {
|
|
42
|
+
diff: generateDiffString(content, updated),
|
|
43
|
+
firstChangedLine: firstChangedLine(content, updated),
|
|
44
|
+
lineEnding,
|
|
45
|
+
bom: Boolean(bom),
|
|
46
|
+
dryRun: normalized.dryRun,
|
|
47
|
+
operationCount: normalized.operations.length,
|
|
48
|
+
operations: operationDetails,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function resolveEditOperations(content, operations, path) {
|
|
54
|
+
if (operations.length === 1 && operations[0]?.type === "apply_patch") {
|
|
55
|
+
const updated = applySingleFilePatch(content, operations[0].patch, path);
|
|
56
|
+
return {
|
|
57
|
+
updated,
|
|
58
|
+
operationDetails: [
|
|
59
|
+
{
|
|
60
|
+
index: 0,
|
|
61
|
+
type: "apply_patch",
|
|
62
|
+
source: operations[0].source.key,
|
|
63
|
+
sourceIndex: operations[0].source.index,
|
|
64
|
+
matchedBy: "patch",
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (operations.some((operation) => operation.type === "apply_patch")) {
|
|
70
|
+
throw editError("EDIT_ARGUMENT_INVALID", "patch must not be combined with replacements, insertions, lineReplacements, or lineInsertions.", { operationTypes: operations.map((operation) => operation.type) }, true);
|
|
71
|
+
}
|
|
72
|
+
const resolved = operations.map((operation, index) => resolveOperation(content, operation, index, path));
|
|
73
|
+
const ordered = [...resolved].sort((a, b) => a.start - b.start || a.end - b.end);
|
|
74
|
+
rejectOverlappingOperations(ordered, path);
|
|
75
|
+
let updated = content;
|
|
76
|
+
for (const operation of [...ordered].reverse()) {
|
|
77
|
+
updated = `${updated.slice(0, operation.start)}${operation.newText}${updated.slice(operation.end)}`;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
updated,
|
|
81
|
+
operationDetails: resolved.map((operation) => operation.details),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function resolveOperation(content, operation, index, path) {
|
|
85
|
+
switch (operation.type) {
|
|
86
|
+
case "replace_text": {
|
|
87
|
+
const match = resolveTextMatch({
|
|
88
|
+
content,
|
|
89
|
+
needle: operation.oldText,
|
|
90
|
+
matchMode: operation.matchMode,
|
|
91
|
+
occurrence: operation.occurrence,
|
|
92
|
+
operationIndex: index,
|
|
93
|
+
operationType: operation.type,
|
|
94
|
+
fieldName: "oldText",
|
|
95
|
+
fieldLabel: `${operation.source.label}.oldText`,
|
|
96
|
+
path,
|
|
97
|
+
});
|
|
98
|
+
return {
|
|
99
|
+
index,
|
|
100
|
+
type: operation.type,
|
|
101
|
+
source: operation.source,
|
|
102
|
+
start: match.selected.start,
|
|
103
|
+
end: match.selected.end,
|
|
104
|
+
newText: normalizeLineEndings(operation.newText),
|
|
105
|
+
details: {
|
|
106
|
+
index,
|
|
107
|
+
type: operation.type,
|
|
108
|
+
source: operation.source.key,
|
|
109
|
+
sourceIndex: operation.source.index,
|
|
110
|
+
matchMode: operation.matchMode,
|
|
111
|
+
occurrence: operation.occurrence,
|
|
112
|
+
matchCount: match.matches.length,
|
|
113
|
+
startLine: match.selected.startLine,
|
|
114
|
+
endLine: match.selected.endLine,
|
|
115
|
+
matchedBy: match.matchedBy,
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
case "insert_text": {
|
|
120
|
+
const match = resolveTextMatch({
|
|
121
|
+
content,
|
|
122
|
+
needle: operation.anchor,
|
|
123
|
+
matchMode: operation.matchMode,
|
|
124
|
+
occurrence: operation.occurrence,
|
|
125
|
+
operationIndex: index,
|
|
126
|
+
operationType: operation.type,
|
|
127
|
+
fieldName: "anchor",
|
|
128
|
+
fieldLabel: `${operation.source.label}.anchor`,
|
|
129
|
+
path,
|
|
130
|
+
});
|
|
131
|
+
const offset = operation.position === "before"
|
|
132
|
+
? match.selected.start
|
|
133
|
+
: match.selected.end;
|
|
134
|
+
return {
|
|
135
|
+
index,
|
|
136
|
+
type: operation.type,
|
|
137
|
+
source: operation.source,
|
|
138
|
+
start: offset,
|
|
139
|
+
end: offset,
|
|
140
|
+
newText: normalizeLineEndings(operation.text),
|
|
141
|
+
details: {
|
|
142
|
+
index,
|
|
143
|
+
type: operation.type,
|
|
144
|
+
source: operation.source.key,
|
|
145
|
+
sourceIndex: operation.source.index,
|
|
146
|
+
matchMode: operation.matchMode,
|
|
147
|
+
occurrence: operation.occurrence,
|
|
148
|
+
matchCount: match.matches.length,
|
|
149
|
+
startLine: match.selected.startLine,
|
|
150
|
+
endLine: match.selected.endLine,
|
|
151
|
+
matchedBy: match.matchedBy,
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
case "replace_lines": {
|
|
156
|
+
const range = lineRange(content, operation.startLine, operation.endLine, {
|
|
157
|
+
operationIndex: index,
|
|
158
|
+
sourceLabel: operation.source.label,
|
|
159
|
+
path,
|
|
160
|
+
});
|
|
161
|
+
return {
|
|
162
|
+
index,
|
|
163
|
+
type: operation.type,
|
|
164
|
+
source: operation.source,
|
|
165
|
+
start: range.start,
|
|
166
|
+
end: range.end,
|
|
167
|
+
newText: normalizeLineEndings(operation.newText),
|
|
168
|
+
details: {
|
|
169
|
+
index,
|
|
170
|
+
type: operation.type,
|
|
171
|
+
source: operation.source.key,
|
|
172
|
+
sourceIndex: operation.source.index,
|
|
173
|
+
startLine: operation.startLine,
|
|
174
|
+
endLine: operation.endLine,
|
|
175
|
+
matchedBy: "line_range",
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
case "insert_lines": {
|
|
180
|
+
const offset = lineInsertOffset(content, operation.line, operation.position, {
|
|
181
|
+
operationIndex: index,
|
|
182
|
+
sourceLabel: operation.source.label,
|
|
183
|
+
path,
|
|
184
|
+
});
|
|
185
|
+
return {
|
|
186
|
+
index,
|
|
187
|
+
type: operation.type,
|
|
188
|
+
source: operation.source,
|
|
189
|
+
start: offset,
|
|
190
|
+
end: offset,
|
|
191
|
+
newText: normalizeLineEndings(operation.text),
|
|
192
|
+
details: {
|
|
193
|
+
index,
|
|
194
|
+
type: operation.type,
|
|
195
|
+
source: operation.source.key,
|
|
196
|
+
sourceIndex: operation.source.index,
|
|
197
|
+
startLine: operation.line,
|
|
198
|
+
endLine: operation.line,
|
|
199
|
+
matchedBy: "line_insert",
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
case "apply_patch":
|
|
204
|
+
throw argumentError("patch must be the only edit operation.", {
|
|
205
|
+
operationIndex: index,
|
|
206
|
+
source: operation.source.key,
|
|
207
|
+
sourceIndex: operation.source.index,
|
|
208
|
+
path,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
function applySingleFilePatch(content, patch, path) {
|
|
213
|
+
const normalizedPatch = normalizeLineEndings(patch);
|
|
214
|
+
let parsed;
|
|
215
|
+
try {
|
|
216
|
+
parsed = parsePatch(normalizedPatch);
|
|
217
|
+
}
|
|
218
|
+
catch (error) {
|
|
219
|
+
throw editError("EDIT_PATCH_INVALID", `edit apply_patch could not parse patch for ${path}: ${error instanceof Error ? error.message : String(error)}`, { path }, true);
|
|
220
|
+
}
|
|
221
|
+
if (parsed.length !== 1) {
|
|
222
|
+
throw editError("EDIT_PATCH_INVALID", `edit apply_patch for ${path} must contain exactly one file patch; found ${parsed.length}.`, { path, patchCount: parsed.length }, true);
|
|
223
|
+
}
|
|
224
|
+
const patchIndex = parsed[0];
|
|
225
|
+
if (!patchIndex || patchIndex.hunks.length === 0) {
|
|
226
|
+
throw editError("EDIT_PATCH_INVALID", `edit apply_patch for ${path} must contain at least one hunk.`, { path }, true);
|
|
227
|
+
}
|
|
228
|
+
if (patchIndex.oldFileName === "/dev/null" ||
|
|
229
|
+
patchIndex.newFileName === "/dev/null") {
|
|
230
|
+
throw editError("EDIT_PATCH_INVALID", `edit apply_patch for ${path} cannot create or delete files. Use write or an explicit destructive workflow instead.`, {
|
|
231
|
+
path,
|
|
232
|
+
oldFileName: patchIndex.oldFileName,
|
|
233
|
+
newFileName: patchIndex.newFileName,
|
|
234
|
+
}, true);
|
|
235
|
+
}
|
|
236
|
+
const patched = applyPatch(content, patchIndex, {
|
|
237
|
+
fuzzFactor: 0,
|
|
238
|
+
autoConvertLineEndings: false,
|
|
239
|
+
});
|
|
240
|
+
if (patched === false) {
|
|
241
|
+
throw editError("EDIT_PATCH_APPLY_FAILED", `edit apply_patch could not apply cleanly to ${path}. Refresh the file and regenerate the patch with current context.`, { path }, true);
|
|
242
|
+
}
|
|
243
|
+
return patched;
|
|
244
|
+
}
|
|
245
|
+
function rejectOverlappingOperations(ordered, path) {
|
|
246
|
+
for (let i = 1; i < ordered.length; i += 1) {
|
|
247
|
+
const previous = ordered[i - 1];
|
|
248
|
+
const current = ordered[i];
|
|
249
|
+
if (!previous || !current)
|
|
250
|
+
continue;
|
|
251
|
+
if (previous.start === previous.end &&
|
|
252
|
+
current.start === current.end &&
|
|
253
|
+
previous.start === current.start) {
|
|
254
|
+
throw editError("EDIT_OVERLAP", `${current.source.label} inserts at the same offset as ${previous.source.label} in ${path}; merge same-location inserts into one operation.`, {
|
|
255
|
+
path,
|
|
256
|
+
previousIndex: previous.index,
|
|
257
|
+
currentIndex: current.index,
|
|
258
|
+
previousSource: previous.source,
|
|
259
|
+
currentSource: current.source,
|
|
260
|
+
offset: current.start,
|
|
261
|
+
}, true);
|
|
262
|
+
}
|
|
263
|
+
if (current.start < previous.end) {
|
|
264
|
+
throw editError("EDIT_OVERLAP", `${current.source.label} overlaps ${previous.source.label} in ${path}; merge overlapping changes into one operation.`, {
|
|
265
|
+
path,
|
|
266
|
+
previousIndex: previous.index,
|
|
267
|
+
currentIndex: current.index,
|
|
268
|
+
previousSource: previous.source,
|
|
269
|
+
currentSource: current.source,
|
|
270
|
+
previousRange: { start: previous.start, end: previous.end },
|
|
271
|
+
currentRange: { start: current.start, end: current.end },
|
|
272
|
+
}, true);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function lineRange(content, startLine, endLine, context) {
|
|
277
|
+
const lines = contentLineRanges(content);
|
|
278
|
+
if (startLine > endLine) {
|
|
279
|
+
throw argumentError(`${context.sourceLabel}.endLine must be greater than or equal to startLine.`, {
|
|
280
|
+
operationIndex: context.operationIndex,
|
|
281
|
+
sourceLabel: context.sourceLabel,
|
|
282
|
+
startLine,
|
|
283
|
+
endLine,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
const start = lines[startLine - 1];
|
|
287
|
+
const end = lines[endLine - 1];
|
|
288
|
+
if (!start || !end) {
|
|
289
|
+
throw argumentError(`${context.sourceLabel} range ${startLine}-${endLine} is outside ${context.path}, which has ${lines.length} line(s).`, {
|
|
290
|
+
operationIndex: context.operationIndex,
|
|
291
|
+
sourceLabel: context.sourceLabel,
|
|
292
|
+
path: context.path,
|
|
293
|
+
startLine,
|
|
294
|
+
endLine,
|
|
295
|
+
lineCount: lines.length,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
return { start: start.start, end: end.endWithNewline };
|
|
299
|
+
}
|
|
300
|
+
function lineInsertOffset(content, line, position, context) {
|
|
301
|
+
const lines = contentLineRanges(content);
|
|
302
|
+
const target = lines[line - 1];
|
|
303
|
+
if (!target) {
|
|
304
|
+
throw argumentError(`${context.sourceLabel} line ${line} is outside ${context.path}, which has ${lines.length} line(s).`, {
|
|
305
|
+
operationIndex: context.operationIndex,
|
|
306
|
+
sourceLabel: context.sourceLabel,
|
|
307
|
+
path: context.path,
|
|
308
|
+
line,
|
|
309
|
+
lineCount: lines.length,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
return position === "before" ? target.start : target.endWithNewline;
|
|
313
|
+
}
|
|
314
|
+
function contentLineRanges(content) {
|
|
315
|
+
if (content.length === 0)
|
|
316
|
+
return [];
|
|
317
|
+
const ranges = [];
|
|
318
|
+
let start = 0;
|
|
319
|
+
for (let index = 0; index < content.length; index += 1) {
|
|
320
|
+
if (content[index] !== "\n")
|
|
321
|
+
continue;
|
|
322
|
+
ranges.push({ start, end: index, endWithNewline: index + 1 });
|
|
323
|
+
start = index + 1;
|
|
324
|
+
}
|
|
325
|
+
if (start < content.length) {
|
|
326
|
+
ranges.push({ start, end: content.length, endWithNewline: content.length });
|
|
327
|
+
}
|
|
328
|
+
return ranges;
|
|
329
|
+
}
|
|
330
|
+
//# sourceMappingURL=edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/execution/filesystem/edit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAA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AAG,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC;QAC9D,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;IACpB,CAAC;IACD,IAAI,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-mutation-queue.d.ts","sourceRoot":"","sources":["../../../src/execution/filesystem/file-mutation-queue.ts"],"names":[],"mappings":"AAEA,wBAAsB,qBAAqB,CAAC,CAAC,EAC3C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACrB,OAAO,CAAC,CAAC,CAAC,CAoBZ"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const queues = new Map();
|
|
2
|
+
export async function withFileMutationQueue(path, task) {
|
|
3
|
+
const previous = queues.get(path) ?? Promise.resolve();
|
|
4
|
+
let release;
|
|
5
|
+
const current = new Promise((resolve) => {
|
|
6
|
+
release = resolve;
|
|
7
|
+
});
|
|
8
|
+
queues.set(path, previous.then(() => current, () => current));
|
|
9
|
+
await previous.catch(() => undefined);
|
|
10
|
+
try {
|
|
11
|
+
return await task();
|
|
12
|
+
}
|
|
13
|
+
finally {
|
|
14
|
+
release();
|
|
15
|
+
if (queues.get(path) === current)
|
|
16
|
+
queues.delete(path);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=file-mutation-queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-mutation-queue.js","sourceRoot":"","sources":["../../../src/execution/filesystem/file-mutation-queue.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,IAAI,GAAG,EAAyB,CAAC;AAEhD,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,IAAY,EACZ,IAAsB;IAEtB,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IACvD,IAAI,OAAoB,CAAC;IACzB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QAC5C,OAAO,GAAG,OAAO,CAAC;IACpB,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,GAAG,CACR,IAAI,EACJ,QAAQ,CAAC,IAAI,CACX,GAAG,EAAE,CAAC,OAAO,EACb,GAAG,EAAE,CAAC,OAAO,CACd,CACF,CAAC;IACF,MAAM,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACtC,IAAI,CAAC;QACH,OAAO,MAAM,IAAI,EAAE,CAAC;IACtB,CAAC;YAAS,CAAC;QACT,OAAO,EAAE,CAAC;QACV,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,OAAO;YAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../src/execution/filesystem/find.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAgBhF,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CA0B9B"}
|