dsh-better-edit 0.8.2 → 1.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.
Files changed (79) hide show
  1. package/CHANGELOG.md +173 -99
  2. package/README.md +61 -33
  3. package/README.zh.md +20 -17
  4. package/cordis.patch.yml +1 -1
  5. package/lib/constants.js +19 -4
  6. package/lib/contract.js +136 -79
  7. package/lib/domain-errors.js +570 -0
  8. package/lib/edit-diff.js +33 -7
  9. package/lib/file-encoding-state.js +27 -7
  10. package/lib/file-view.js +305 -82
  11. package/lib/fs-bridge.js +23 -7
  12. package/lib/guidance/materialize.js +7 -7
  13. package/lib/guidance/resolve.js +13 -8
  14. package/lib/hash-store.js +404 -278
  15. package/lib/hashline/anchor-pipeline.js +586 -378
  16. package/lib/hashline/hash-assign.js +21 -22
  17. package/lib/hashline/hash.js +6 -6
  18. package/lib/hashline/index.js +1 -1
  19. package/lib/hashline/resolve.js +1 -1
  20. package/lib/hashline/served-guard.js +181 -0
  21. package/lib/index.js +37 -11
  22. package/lib/mutation/engine.js +392 -96
  23. package/lib/mutation.js +22 -130
  24. package/lib/noop-guard.js +20 -9
  25. package/lib/prompts.js +20 -18
  26. package/lib/read-and-serve.js +44 -20
  27. package/lib/sandbox.js +1 -1
  28. package/lib/session-view.js +57 -43
  29. package/lib/snapshot-store/index.js +97 -0
  30. package/lib/snapshot-store/lineage-store.js +400 -0
  31. package/lib/snapshot-store/migrate.js +80 -0
  32. package/lib/snapshot-store/pairing.js +412 -0
  33. package/lib/snapshot-store/txn.js +63 -0
  34. package/lib/snapshot-store/vacuum.js +243 -0
  35. package/lib/store-lifecycle.js +13 -1
  36. package/lib/store-retry.js +34 -0
  37. package/lib/tool-edit.js +90 -44
  38. package/lib/tool-read.js +29 -1
  39. package/lib/tool-str-replace-editor.js +26 -18
  40. package/lib/tool-undo.js +25 -8
  41. package/lib/types/constants.d.ts +5 -2
  42. package/lib/types/contract.d.ts +76 -71
  43. package/lib/types/domain-errors.d.ts +410 -0
  44. package/lib/types/edit-response.d.ts +1 -1
  45. package/lib/types/file-encoding-state.d.ts +1 -0
  46. package/lib/types/file-view.d.ts +35 -6
  47. package/lib/types/guidance/materialize.d.ts +2 -2
  48. package/lib/types/guidance/resolve.d.ts +14 -2
  49. package/lib/types/hash-store.d.ts +38 -19
  50. package/lib/types/hashline/anchor-pipeline.d.ts +117 -36
  51. package/lib/types/hashline/hash-assign.d.ts +5 -5
  52. package/lib/types/hashline/hash.d.ts +1 -1
  53. package/lib/types/hashline/index.d.ts +2 -2
  54. package/lib/types/hashline/served-guard.d.ts +100 -0
  55. package/lib/types/index.d.ts +3 -3
  56. package/lib/types/mutation/engine.d.ts +49 -30
  57. package/lib/types/mutation.d.ts +1 -39
  58. package/lib/types/noop-guard.d.ts +4 -4
  59. package/lib/types/prompts.d.ts +1 -1
  60. package/lib/types/read-and-serve.d.ts +6 -0
  61. package/lib/types/sandbox.d.ts +1 -1
  62. package/lib/types/session-view.d.ts +38 -9
  63. package/lib/types/snapshot-store/index.d.ts +28 -0
  64. package/lib/types/snapshot-store/lineage-store.d.ts +96 -0
  65. package/lib/types/snapshot-store/migrate.d.ts +16 -0
  66. package/lib/types/snapshot-store/pairing.d.ts +99 -0
  67. package/lib/types/snapshot-store/txn.d.ts +12 -0
  68. package/lib/types/snapshot-store/vacuum.d.ts +79 -0
  69. package/lib/types/store-lifecycle.d.ts +0 -1
  70. package/lib/types/store-retry.d.ts +6 -0
  71. package/lib/types/tool-edit.d.ts +2 -2
  72. package/lib/types/tool-str-replace-editor.d.ts +2 -2
  73. package/lib/types/utils.d.ts +5 -6
  74. package/lib/types/workspace-context.d.ts +10 -1
  75. package/lib/undo-edit.js +27 -11
  76. package/lib/utils.js +12 -12
  77. package/lib/workspace-context.js +27 -9
  78. package/lib/write-hook.js +13 -4
  79. package/package.json +28 -30
package/lib/contract.js CHANGED
@@ -2,14 +2,15 @@
2
2
  * One module owns the request shapes for the hashline tools — edit,
3
3
  * read, undo_last_edit — plus their validation. Field sets are
4
4
  * declared once here; every tool validates through these asserts, and the
5
- * [E_BAD_PAYLOAD] vocabulary is shared instead of re-implemented per tool.
5
+ * E_BAD_PAYLOAD vocabulary is shared instead of re-implemented per tool.
6
6
  *
7
- * Contract now mirrors upstream ADR-0007: {path: string|null, edits: [[remove_from,remove_to,replacement_text],...]} tuple payload
8
- * (plus object-form {remove_from, remove_to, replacement_text} per #64), single-file, atomic. batch_edit is removed.
7
+ * Contract mirrors upstream ADR-0015: {file: string|null, edits: [{anchor_from, anchor_to, replace_with},...]} named-object payload
8
+ * (plus legacy tuple items and legacy key spellings folded pre-validation), single-file, atomic. batch_edit is removed.
9
9
  * @module dsh-better-edit/contract
10
10
  */
11
11
  import { EDITS_MAX_ITEMS } from "./constants.js";
12
- import { isRec, normalizeFilePath, rejectUnknownFields, CodedError } from "./utils.js";
12
+ import { isRec, normalizeFilePath, rejectUnknownFields } from "./utils.js";
13
+ import { DomainError } from "./domain-errors.js";
13
14
  // ---- normalized marker -----------------------------------------------------
14
15
  export const normalizedEdit = Symbol("normalizedEdit");
15
16
  export function isNormalizedEdit(input) {
@@ -18,57 +19,81 @@ export function isNormalizedEdit(input) {
18
19
  export function itemFromTuple(value) {
19
20
  if (!Array.isArray(value) || value.length !== 3)
20
21
  return undefined;
21
- const [remove_from, remove_to, replacement_text] = value;
22
- if (typeof remove_from !== "string" ||
23
- typeof remove_to !== "string" ||
24
- typeof replacement_text !== "string")
22
+ const [anchor_from, anchor_to, replace_with] = value;
23
+ if (typeof anchor_from !== "string" ||
24
+ typeof anchor_to !== "string" ||
25
+ typeof replace_with !== "string")
25
26
  return undefined;
26
- return { remove_from, remove_to, replacement_text };
27
+ return { anchor_from, anchor_to, replace_with };
27
28
  }
28
29
  /**
29
- * Accept both the tuple form (["a", "b", "c"]) and the object form
30
- * ({ remove_from, remove_to, replacement_text }) per edits entry (#64).
31
- * Missing/mistyped fields and unknown fields still return undefined so the
32
- * caller rejects with E_BAD_PAYLOAD.
30
+ * Accept the named-object form ({ anchor_from, anchor_to, replace_with }),
31
+ * the legacy tuple form ([a, b, t]), and the legacy-key form
32
+ * (legacy spelling) per edits entry — all fold
33
+ * to the named triple. Mixed old/new keys, extra keys, and 2-/4-position
34
+ * tuples still return undefined so the caller rejects with E_BAD_PAYLOAD.
33
35
  */
34
36
  export function itemFromEntry(value) {
35
37
  if (Array.isArray(value))
36
38
  return itemFromTuple(value);
37
39
  if (isRec(value)) {
38
40
  const rec = value;
39
- const { remove_from, remove_to, replacement_text } = rec;
40
- if (typeof remove_from !== "string" ||
41
- typeof remove_to !== "string" ||
42
- typeof replacement_text !== "string")
41
+ const keys = new Set(Object.keys(rec));
42
+ const useLegacy = keys.size === LEGACY_ITEM_KS.size && [...LEGACY_ITEM_KS].every((k) => keys.has(k));
43
+ const useNamed = keys.size === ITEM_KS.size && [...ITEM_KS].every((k) => keys.has(k));
44
+ if (!useNamed && !useLegacy)
43
45
  return undefined;
44
- if (Object.keys(rec).some((k) => !EDIT_ITEM_KS.has(k)))
46
+ const from = useNamed ? rec.anchor_from : rec.remove_from;
47
+ const to = useNamed ? rec.anchor_to : rec.remove_to;
48
+ const text = useNamed ? rec.replace_with : rec.replacement_text;
49
+ if (typeof from !== "string" || typeof to !== "string" || typeof text !== "string")
45
50
  return undefined;
46
- return { remove_from, remove_to, replacement_text };
51
+ return { anchor_from: from, anchor_to: to, replace_with: text };
47
52
  }
48
53
  return undefined;
49
54
  }
55
+ const ROOT_INPUT_KS = new Set([
56
+ "file",
57
+ "file_path",
58
+ "path",
59
+ "edits",
60
+ "mode",
61
+ "sandbox_permissions",
62
+ "justification",
63
+ ]);
50
64
  export function editRequestFrom(input) {
51
- if (!isRec(input) || !("path" in input) || !("edits" in input))
65
+ if (!isRec(input))
52
66
  return undefined;
53
67
  const rec = input;
54
- // handle file_path alias before checking
55
- if (typeof rec.path !== "string" && typeof rec.file_path === "string") {
56
- // alias will be normalized by normalizeFilePath before editRequestFrom in normReq path,
57
- // but handle here for direct calls
68
+ for (const key of Object.keys(rec)) {
69
+ if (!ROOT_INPUT_KS.has(key))
70
+ return undefined;
58
71
  }
59
- const { path, edits } = rec;
60
- // Gemma-4 tool-call bleed (#55): the model may wrap the path in <|>, │, |,
61
- // quotes, or backticks after seeing │ separators. Strip wrappers iteratively.
62
- let effectivePath = path;
63
- if (typeof effectivePath === "string") {
64
- const sanitized = sanitizePath(effectivePath);
72
+ const { file, file_path, path, edits, mode } = rec;
73
+ // file preferred; legacy path/file_path fold (sanitized). null stays null:
74
+ // the undocumented anchor-inference seam (resolveNullPath) still resolves it.
75
+ let effectiveFile;
76
+ if (file !== undefined)
77
+ effectiveFile = file;
78
+ else if (path !== undefined)
79
+ effectiveFile = path;
80
+ else if (file_path !== undefined)
81
+ effectiveFile = file_path;
82
+ else
83
+ return undefined;
84
+ let effectivePath;
85
+ if (typeof effectiveFile === "string") {
86
+ const sanitized = sanitizePath(effectiveFile);
65
87
  if (sanitized === null)
66
88
  return undefined;
67
89
  effectivePath = sanitized;
68
90
  }
69
- if (effectivePath !== null &&
70
- (typeof effectivePath !== "string" || effectivePath.length === 0))
91
+ else if (effectiveFile === null) {
92
+ effectivePath = null;
93
+ }
94
+ else {
71
95
  return undefined;
96
+ }
72
97
  if (!Array.isArray(edits) || edits.length === 0)
73
98
  return undefined;
74
99
  const items = [];
@@ -78,7 +103,13 @@ export function editRequestFrom(input) {
78
103
  return undefined;
79
104
  items.push(normalized);
80
105
  }
81
- return { path: effectivePath, edits: items };
106
+ let effectiveMode = "general";
107
+ if (mode !== undefined) {
108
+ if (mode !== "general" && mode !== "literal")
109
+ return undefined;
110
+ effectiveMode = mode;
111
+ }
112
+ return { file: effectivePath, edits: items, mode: effectiveMode };
82
113
  }
83
114
  /**
84
115
  * Strip Gemma-4 tool-call bleed wrappers from a path string: `<|>`, `\u2502`, `|`
@@ -120,13 +151,12 @@ export function sanitizePath(value) {
120
151
  }
121
152
  return cleaned.length > 0 ? cleaned : null;
122
153
  }
123
- export const EDIT_TUPLE_HINT = "Edit must be called with exactly one payload. Use the canonical payload " +
124
- '{"path": path, "edits": [[remove_from, remove_to, replacement_text], ...]}: ' +
125
- "path is a non-empty string (or null to infer from anchors), each item is " +
126
- "either a fixed 3-position array [remove_from, remove_to, replacement_text] " +
127
- "or an object {remove_from, remove_to, replacement_text} (mixed batches allowed) " +
128
- "of two inclusive bare-3-char anchors and the full " +
129
- "replacement (an empty string deletes the range).";
154
+ export const EDIT_PAYLOAD_HINT = "Edit must be called with exactly one payload. Use the canonical payload " +
155
+ '{"file": file, "edits": [{ "anchor_from": anchor_from, "anchor_to": anchor_to, "replace_with": replace_with }, ...], "mode"?: "general" | "literal"}: ' +
156
+ '"file" is the text file to edit (a non-empty string, never a directory); each item names ' +
157
+ "two inclusive bare-3-char anchors and the full replacement " +
158
+ '(an empty string deletes the range); optional "mode" is "general" (default, reproduced served rows are refused) or "literal" (declared literal content). ' +
159
+ "Legacy tuple items and legacy key spellings still fold; do not mix old and new key spellings.";
130
160
  function describeReceived(input) {
131
161
  if (input === undefined)
132
162
  return "Received no arguments.";
@@ -139,9 +169,10 @@ function describeReceived(input) {
139
169
  return `Received: ${preview}`;
140
170
  }
141
171
  // ---- filed sets (declared once) ---------------------------------------------
142
- const EDIT_KS = new Set(["path", "edits", "sandbox_permissions", "justification"]);
143
- const READ_KS = new Set(["path", "offset", "limit", "encoding"]);
144
- const EDIT_ITEM_KS = new Set(["remove_from", "remove_to", "replacement_text"]);
172
+ const EDIT_KS = new Set(["file", "edits", "mode", "sandbox_permissions", "justification"]);
173
+ const READ_KS = new Set(["path", "offset", "limit", "encoding", "windows"]);
174
+ const ITEM_KS = new Set(["anchor_from", "anchor_to", "replace_with"]);
175
+ const LEGACY_ITEM_KS = new Set(["remove_from", "remove_to", "replacement_text"]);
145
176
  // ---- normalization -----------------------------------------------------------
146
177
  /**
147
178
  * Normalize `file_path` → `path` alias on the request record and tuple edits → objects.
@@ -160,7 +191,11 @@ export function normalizeRequest(input) {
160
191
  const valid = editRequestFrom(record);
161
192
  if (!valid)
162
193
  return record;
163
- const normalized = { path: valid.path, edits: valid.edits };
194
+ const normalized = {
195
+ file: valid.file,
196
+ edits: valid.edits,
197
+ mode: valid.mode,
198
+ };
164
199
  // preserve non-standard fields like sandbox_permissions/justification for later reject check? but we strip to valid fields and re-add them?
165
200
  for (const k of ["sandbox_permissions", "justification"]) {
166
201
  if (k in record)
@@ -174,67 +209,89 @@ export const normReq = normalizeRequest;
174
209
  export function prepareEditArguments(args) {
175
210
  const valid = editRequestFrom(args);
176
211
  if (valid) {
177
- return { path: valid.path, edits: args.edits };
212
+ // F10.1: preserve mode like normalizeRequest — the two normalizers agree.
213
+ // prepareEditArguments returns schema-ready folded objects (named triple).
214
+ return { file: valid.file, edits: valid.edits, mode: valid.mode };
178
215
  }
179
- throw new CodedError("E_BAD_PAYLOAD", `[MODEL] [E_BAD_PAYLOAD] ${EDIT_TUPLE_HINT} ${describeReceived(args)}`);
216
+ throw new DomainError("E_BAD_PAYLOAD", {
217
+ message: `${EDIT_PAYLOAD_HINT} ${describeReceived(args)}`,
218
+ });
180
219
  }
181
220
  // ---- assertions ---------------------------------------------------------------
182
221
  export function assertEditRequest(request) {
183
222
  if (!isNormalizedEdit(request)) {
184
- throw new CodedError("E_BAD_PAYLOAD", "[MODEL] [E_BAD_PAYLOAD] Edit request must be exactly { path, edits: [[remove_from, remove_to, replacement_text], ...] } or { path, edits: [{remove_from, remove_to, replacement_text}, ...] } (mixed batches allowed).");
223
+ throw new DomainError("E_BAD_PAYLOAD", {
224
+ message: 'Edit request must be exactly { file, edits: [{ anchor_from, anchor_to, replace_with }, ...], mode?: "general" | "literal" }. ' +
225
+ EDIT_PAYLOAD_HINT,
226
+ });
185
227
  }
186
228
  rejectUnknownFields(request, EDIT_KS, "Edit request");
187
229
  const req = request;
188
- if (req.path !== null && (typeof req.path !== "string" || req.path.length === 0)) {
189
- throw new CodedError("E_BAD_PAYLOAD", "[MODEL] [E_BAD_PAYLOAD] Edit request path must be a non-empty string or null.");
230
+ if (req.file !== null && (typeof req.file !== "string" || req.file.length === 0)) {
231
+ throw new DomainError("E_BAD_PAYLOAD", {
232
+ message: "Edit request file must be a non-empty string or null.",
233
+ });
234
+ }
235
+ if (req.mode !== undefined && req.mode !== "general" && req.mode !== "literal") {
236
+ throw new DomainError("E_BAD_PAYLOAD", {
237
+ message: 'Edit request "mode" must be "general" or "literal" (absent means "general"). Reproduced served rows are refused unless mode is "literal".',
238
+ });
190
239
  }
191
240
  if (!Array.isArray(req.edits) || req.edits.length === 0) {
192
- throw new CodedError("E_BAD_PAYLOAD", '[MODEL] [E_BAD_PAYLOAD] Edit request requires a non-empty "edits" array.');
241
+ throw new DomainError("E_BAD_PAYLOAD", {
242
+ message: 'Edit request requires a non-empty "edits" array.',
243
+ });
193
244
  }
194
245
  if (req.edits.length > EDITS_MAX_ITEMS) {
195
- throw new CodedError("E_BAD_PAYLOAD", `[MODEL] [E_BAD_PAYLOAD] edit accepts at most ${EDITS_MAX_ITEMS} edits; got ${req.edits.length}. Split the batch.`);
246
+ throw new DomainError("E_BAD_PAYLOAD", {
247
+ message: `edit accepts at most ${EDITS_MAX_ITEMS} edits; got ${req.edits.length}. Split the batch.`,
248
+ });
196
249
  }
197
250
  for (let index = 0; index < req.edits.length; index++) {
198
251
  const item = req.edits[index];
199
- if (typeof item.remove_from !== "string" ||
200
- typeof item.remove_to !== "string" ||
201
- typeof item.replacement_text !== "string") {
202
- throw new CodedError("E_BAD_PAYLOAD", `[MODEL] [E_BAD_PAYLOAD] Edit request edits[${index}] must be a three-position array [remove_from, remove_to, replacement_text] or an object {remove_from, remove_to, replacement_text}.`);
252
+ if (typeof item.anchor_from !== "string" ||
253
+ typeof item.anchor_to !== "string" ||
254
+ typeof item.replace_with !== "string") {
255
+ throw new DomainError("E_BAD_PAYLOAD", {
256
+ message: `Edit request edits[${index}] must be { anchor_from, anchor_to, replace_with }: two bare 3-char anchors and the replacement text.`,
257
+ });
203
258
  }
204
259
  }
205
260
  }
206
- // legacy — now always fails with new shape message (batch_edit removed)
207
- export function assertBatchEditRequest(_request) {
208
- throw new CodedError("E_BAD_PAYLOAD", "[MODEL] [E_BAD_PAYLOAD] batch_edit has been removed. Use edit with { path, edits: [[remove_from, remove_to, replacement_text], ...] }.");
209
- }
210
261
  export function assertReadRequest(request) {
211
262
  if (!isRec(request))
212
- throw new CodedError("E_BAD_PAYLOAD", "[MODEL] [E_BAD_PAYLOAD] Read request must be an object.");
263
+ throw new DomainError("E_BAD_PAYLOAD", { message: "Read request must be an object." });
213
264
  rejectUnknownFields(request, READ_KS, "Read request");
214
265
  if (typeof request.path !== "string" || request.path.length === 0) {
215
- throw new CodedError("E_BAD_PAYLOAD", '[MODEL] [E_BAD_PAYLOAD] Read request requires a non-empty "path" string.');
266
+ throw new DomainError("E_BAD_PAYLOAD", {
267
+ message: 'Read request requires a non-empty "path" string.',
268
+ });
216
269
  }
217
270
  }
218
271
  export function assertUndoRequest(request) {
219
272
  if (!isRec(request))
220
- throw new CodedError("E_BAD_PAYLOAD", "[MODEL] [E_BAD_PAYLOAD] undo_last_edit request must be an object.");
273
+ throw new DomainError("E_BAD_PAYLOAD", {
274
+ message: "undo_last_edit request must be an object.",
275
+ });
221
276
  normalizeFilePath(request);
222
277
  if (typeof request.path !== "string" || request.path.length === 0) {
223
- throw new CodedError("E_BAD_PAYLOAD", '[MODEL] [E_BAD_PAYLOAD] undo_last_edit request requires a non-empty "path" string.');
278
+ throw new DomainError("E_BAD_PAYLOAD", {
279
+ message: 'undo_last_edit request requires a non-empty "path" string.',
280
+ });
224
281
  }
225
282
  }
226
283
  // ---- shared JSON Schema literals (co-located with field sets) ---------------
227
- export const replacementTextSchema = {
284
+ export const replaceWithSchema = {
228
285
  type: "string",
229
- description: 'Complete replacement for the range; use "" to delete',
286
+ description: 'Bare file content for the range; use "" to delete',
230
287
  };
231
- export const removeFromSchema = {
288
+ export const anchorFromSchema = {
232
289
  type: "string",
233
- description: "First line to remove (inclusive)",
290
+ description: "Bare 3-char hash anchor of the first range line (inclusive)",
234
291
  };
235
- export const removeToSchema = {
292
+ export const anchorToSchema = {
236
293
  type: "string",
237
- description: "Last line to remove (inclusive)",
294
+ description: "Bare 3-char hash anchor of the last range line (inclusive)",
238
295
  };
239
296
  export const pathSchema = {
240
297
  type: "string",
@@ -248,21 +305,21 @@ export const editPathSchema = {
248
305
  };
249
306
  export const editTupleSchema = {
250
307
  type: "array",
251
- prefixItems: [removeFromSchema, removeToSchema, replacementTextSchema],
308
+ prefixItems: [anchorFromSchema, anchorToSchema, replaceWithSchema],
252
309
  minItems: 3,
253
310
  maxItems: 3,
254
- description: "[remove_from, remove_to, replacement_text]",
311
+ description: "[anchor_from, anchor_to, replace_with] (legacy tuple form)",
255
312
  };
256
313
  export const editObjectSchema = {
257
314
  type: "object",
258
315
  additionalProperties: false,
259
- required: ["remove_from", "remove_to", "replacement_text"],
316
+ required: ["anchor_from", "anchor_to", "replace_with"],
260
317
  properties: {
261
- remove_from: removeFromSchema,
262
- remove_to: removeToSchema,
263
- replacement_text: replacementTextSchema,
318
+ anchor_from: anchorFromSchema,
319
+ anchor_to: anchorToSchema,
320
+ replace_with: replaceWithSchema,
264
321
  },
265
- description: "{remove_from, remove_to, replacement_text}",
322
+ description: "{anchor_from, anchor_to, replace_with}",
266
323
  };
267
324
  export const editItemSchema = {
268
325
  anyOf: [editTupleSchema, editObjectSchema],
@@ -271,12 +328,12 @@ export const editItemSchema = {
271
328
  export const editToolSchema = {
272
329
  type: "object",
273
330
  additionalProperties: false,
274
- required: ["path", "edits"],
331
+ required: ["file", "edits"],
275
332
  properties: {
276
- path: editPathSchema,
333
+ file: editPathSchema,
277
334
  edits: {
278
335
  type: "array",
279
- description: "Ordered list of edit entries — each entry is either a tuple [remove_from, remove_to, replacement_text] or an object {remove_from, remove_to, replacement_text} (mixed batches allowed)",
336
+ description: "Ordered list of edit entries — each entry is a named object {anchor_from, anchor_to, replace_with} (legacy tuples still fold pre-validation)",
280
337
  minItems: 1,
281
338
  maxItems: EDITS_MAX_ITEMS,
282
339
  items: editItemSchema,