@adeu/core 1.17.1 → 1.18.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/dist/index.d.cts CHANGED
@@ -186,10 +186,49 @@ declare class RedlineEngine {
186
186
  skipped_details: string[];
187
187
  constructor(doc: DocumentObject, author?: string);
188
188
  private _check_punctuation_warning;
189
+ /**
190
+ * Best-effort "did you mean" hint for a failed target. The common loop trap
191
+ * (observed in the field) is an anchored regex like `^\( x \)$` against a
192
+ * mid-document string: ^/$ bind to the whole full_text, so it never matches
193
+ * even though the literal `( x )` is present. We strip regex anchoring/escapes
194
+ * and probe full_text for a literal occurrence; if found, we tell the model
195
+ * the exact literal that WOULD match so it drops the anchors instead of
196
+ * escalating the regex further.
197
+ */
198
+ private _nearest_match_hint;
189
199
  private _build_edit_context_previews;
190
200
  private _scan_existing_ids;
191
201
  private _get_heading_path_and_page;
192
202
  accept_all_revisions(): void;
203
+ /**
204
+ * Revert every tracked change, returning the document to the state it had
205
+ * before any revision was proposed. The exact inverse of
206
+ * accept_all_revisions:
207
+ *
208
+ * - <w:ins> -> removed together with all of its content (the proposed
209
+ * insertion never existed); an inserted row (<w:ins> in
210
+ * <w:trPr>) drops the whole row.
211
+ * - <w:del> -> unwrapped, restoring the original text (<w:delText> becomes
212
+ * <w:t> again); a row-deletion mark in <w:trPr> is removed so
213
+ * the row survives.
214
+ * - paragraph-mark <w:del> in pPr/rPr -> removed, undoing a proposed merge.
215
+ *
216
+ * Comments are annotations, not revisions, so standalone comments are left in
217
+ * place; only anchors stranded inside a rejected insertion are cleaned up.
218
+ *
219
+ * Insertions are reverted before deletions are restored so a deletion nested
220
+ * inside a foreign author's insertion is removed wholesale with the insertion
221
+ * — the contingent text disappears rather than being promoted to committed
222
+ * body text.
223
+ *
224
+ * Known limitation: tracked paragraph STRUCTURE changes (a split recorded as a
225
+ * pilcrow <w:ins>, or a merge recorded as a pilcrow <w:del>) are reverted only
226
+ * to the extent of dropping/keeping the mark; the original paragraph boundary
227
+ * is not reconstructed, because the merge protocol coalesces paragraphs
228
+ * destructively at edit time. Reverting run-level insertions/deletions (the
229
+ * common case) is exact. This limitation is shared with the Python engine.
230
+ */
231
+ reject_all_revisions(): void;
193
232
  private _getNextId;
194
233
  private _create_track_change_tag;
195
234
  private _set_text_content;
@@ -268,7 +307,7 @@ declare class RedlineEngine {
268
307
  private _anchor_reply_comment;
269
308
  private _clean_wrapping_comments;
270
309
  private _delete_comments_in_element;
271
- validate_edits(edits: any[]): string[];
310
+ validate_edits(edits: any[], index_offset?: number): string[];
272
311
  validate_review_actions(actions: any[]): string[];
273
312
  process_batch(changes: DocumentChange[], dry_run?: boolean): any;
274
313
  private _process_batch_internal;
@@ -276,6 +315,15 @@ declare class RedlineEngine {
276
315
  apply_review_actions(actions: any[]): [number, number];
277
316
  private _apply_table_edit;
278
317
  private _pre_resolve_heuristic_edit;
318
+ /**
319
+ * Split a <w:ins> so that everything up to and INCLUDING split_after stays in
320
+ * a left <w:ins>, new_elem is placed between, and the remainder moves to a
321
+ * right <w:ins> — all at the grandparent level. Used when revising another
322
+ * author's pending insertion: the <w:del> stays nested in their <w:ins> while
323
+ * our replacement <w:ins> lands as a sibling, so we never nest <w:ins> in
324
+ * <w:ins>.
325
+ */
326
+ private _insert_and_split_ins;
279
327
  private _apply_single_edit_indexed;
280
328
  }
281
329
 
package/dist/index.d.ts CHANGED
@@ -186,10 +186,49 @@ declare class RedlineEngine {
186
186
  skipped_details: string[];
187
187
  constructor(doc: DocumentObject, author?: string);
188
188
  private _check_punctuation_warning;
189
+ /**
190
+ * Best-effort "did you mean" hint for a failed target. The common loop trap
191
+ * (observed in the field) is an anchored regex like `^\( x \)$` against a
192
+ * mid-document string: ^/$ bind to the whole full_text, so it never matches
193
+ * even though the literal `( x )` is present. We strip regex anchoring/escapes
194
+ * and probe full_text for a literal occurrence; if found, we tell the model
195
+ * the exact literal that WOULD match so it drops the anchors instead of
196
+ * escalating the regex further.
197
+ */
198
+ private _nearest_match_hint;
189
199
  private _build_edit_context_previews;
190
200
  private _scan_existing_ids;
191
201
  private _get_heading_path_and_page;
192
202
  accept_all_revisions(): void;
203
+ /**
204
+ * Revert every tracked change, returning the document to the state it had
205
+ * before any revision was proposed. The exact inverse of
206
+ * accept_all_revisions:
207
+ *
208
+ * - <w:ins> -> removed together with all of its content (the proposed
209
+ * insertion never existed); an inserted row (<w:ins> in
210
+ * <w:trPr>) drops the whole row.
211
+ * - <w:del> -> unwrapped, restoring the original text (<w:delText> becomes
212
+ * <w:t> again); a row-deletion mark in <w:trPr> is removed so
213
+ * the row survives.
214
+ * - paragraph-mark <w:del> in pPr/rPr -> removed, undoing a proposed merge.
215
+ *
216
+ * Comments are annotations, not revisions, so standalone comments are left in
217
+ * place; only anchors stranded inside a rejected insertion are cleaned up.
218
+ *
219
+ * Insertions are reverted before deletions are restored so a deletion nested
220
+ * inside a foreign author's insertion is removed wholesale with the insertion
221
+ * — the contingent text disappears rather than being promoted to committed
222
+ * body text.
223
+ *
224
+ * Known limitation: tracked paragraph STRUCTURE changes (a split recorded as a
225
+ * pilcrow <w:ins>, or a merge recorded as a pilcrow <w:del>) are reverted only
226
+ * to the extent of dropping/keeping the mark; the original paragraph boundary
227
+ * is not reconstructed, because the merge protocol coalesces paragraphs
228
+ * destructively at edit time. Reverting run-level insertions/deletions (the
229
+ * common case) is exact. This limitation is shared with the Python engine.
230
+ */
231
+ reject_all_revisions(): void;
193
232
  private _getNextId;
194
233
  private _create_track_change_tag;
195
234
  private _set_text_content;
@@ -268,7 +307,7 @@ declare class RedlineEngine {
268
307
  private _anchor_reply_comment;
269
308
  private _clean_wrapping_comments;
270
309
  private _delete_comments_in_element;
271
- validate_edits(edits: any[]): string[];
310
+ validate_edits(edits: any[], index_offset?: number): string[];
272
311
  validate_review_actions(actions: any[]): string[];
273
312
  process_batch(changes: DocumentChange[], dry_run?: boolean): any;
274
313
  private _process_batch_internal;
@@ -276,6 +315,15 @@ declare class RedlineEngine {
276
315
  apply_review_actions(actions: any[]): [number, number];
277
316
  private _apply_table_edit;
278
317
  private _pre_resolve_heuristic_edit;
318
+ /**
319
+ * Split a <w:ins> so that everything up to and INCLUDING split_after stays in
320
+ * a left <w:ins>, new_elem is placed between, and the remainder moves to a
321
+ * right <w:ins> — all at the grandparent level. Used when revising another
322
+ * author's pending insertion: the <w:del> stays nested in their <w:ins> while
323
+ * our replacement <w:ins> lands as a sibling, so we never nest <w:ins> in
324
+ * <w:ins>.
325
+ */
326
+ private _insert_and_split_ins;
279
327
  private _apply_single_edit_indexed;
280
328
  }
281
329