@adeu/core 1.27.0 → 1.28.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.cjs +563 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -1
- package/dist/index.d.ts +54 -1
- package/dist/index.js +563 -65
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/diff.ts +236 -3
- package/src/engine.atomic.test.ts +5 -1
- package/src/engine.batch.test.ts +16 -6
- package/src/engine.ts +323 -52
- package/src/ingest.test.ts +3 -1
- package/src/ingest.ts +16 -3
- package/src/mapper.ts +74 -9
- package/src/repro_qa_mcp_issues_2026_07_20.test.ts +224 -0
- package/src/repro_qa_report_v9.test.ts +392 -0
- package/src/sanitize/core.ts +11 -0
- package/src/sanitize/report.ts +9 -7
- package/src/sanitize/transforms.ts +39 -0
- package/src/utils/docx.ts +87 -0
package/dist/index.d.cts
CHANGED
|
@@ -128,6 +128,23 @@ declare class DocumentMapper {
|
|
|
128
128
|
* characters are excluded.
|
|
129
129
|
*/
|
|
130
130
|
private _find_plain_projection_matches;
|
|
131
|
+
/**
|
|
132
|
+
* True when no run-backed span overlaps [start, start+length): the range
|
|
133
|
+
* covers only virtual projection text — meta bubbles (change/comment
|
|
134
|
+
* headers, timestamps), style markers, list prefixes. Such text does not
|
|
135
|
+
* exist in the document, so it can neither satisfy a match nor count
|
|
136
|
+
* toward ambiguity (QA 2026-07-19 ADEU-QA-002 C): an edit targeting "4"
|
|
137
|
+
* used to be rejected as "appears 8 times" because a comment bubble's
|
|
138
|
+
* timestamp matched.
|
|
139
|
+
*
|
|
140
|
+
* Anchor tokens ({#Bookmark}, {#cell:paraId}) are the exception: they are
|
|
141
|
+
* deliberate virtual TARGETING surfaces (empty-cell writes, bookmark
|
|
142
|
+
* anchors) and must stay matchable.
|
|
143
|
+
*/
|
|
144
|
+
range_is_virtual_only(start: number, length: number): boolean;
|
|
145
|
+
/** Filters find_all_match_indices output down to matches that touch at
|
|
146
|
+
* least one run-backed span. See range_is_virtual_only. */
|
|
147
|
+
drop_virtual_only_matches(matches: [number, number][]): [number, number][];
|
|
131
148
|
find_match_index(target_text: string, is_regex?: boolean): [number, number];
|
|
132
149
|
find_all_match_indices(target_text: string, is_regex?: boolean): [number, number][];
|
|
133
150
|
find_target_runs(target_text: string): Run[];
|
|
@@ -386,6 +403,7 @@ declare class RedlineEngine {
|
|
|
386
403
|
*
|
|
387
404
|
* Does NOT attach comments; callers handle that.
|
|
388
405
|
*/
|
|
406
|
+
private _clone_pPr_scrubbing_headings;
|
|
389
407
|
private _track_insert_multiline;
|
|
390
408
|
/**
|
|
391
409
|
* Builds a single tracked-insert wrapper (<w:ins>) containing one or more
|
|
@@ -451,7 +469,42 @@ declare class RedlineEngine {
|
|
|
451
469
|
process_batch(changes: DocumentChange[], dry_run?: boolean): any;
|
|
452
470
|
private _process_batch_internal;
|
|
453
471
|
apply_edits(edits: any[], page_offsets?: number[]): [number, number];
|
|
454
|
-
|
|
472
|
+
/**
|
|
473
|
+
* True when the paragraph still carries visible content (w:t text, w:tab,
|
|
474
|
+
* w:br) that is NOT wrapped in a tracked deletion — i.e. the paragraph
|
|
475
|
+
* would render non-empty in the accepted document.
|
|
476
|
+
*/
|
|
477
|
+
private _paragraph_has_visible_content;
|
|
478
|
+
/**
|
|
479
|
+
* All contiguous same-author w:ins/w:del siblings that form one logical
|
|
480
|
+
* modification block with `node` (a replacement's del+ins pair). Mirrors
|
|
481
|
+
* the Python engine's _get_paired_nodes: comment range markers and
|
|
482
|
+
* rPr/pPr are transparent; a different author or any other element breaks
|
|
483
|
+
* the group.
|
|
484
|
+
*/
|
|
485
|
+
private _get_paired_nodes;
|
|
486
|
+
/**
|
|
487
|
+
* All revision ids that resolve as ONE unit with `target_id`: the ids of
|
|
488
|
+
* every contiguous same-author w:ins/w:del sibling of its elements (a
|
|
489
|
+
* replacement's del+ins pair), plus the id itself.
|
|
490
|
+
*/
|
|
491
|
+
private _resolution_group_ids;
|
|
492
|
+
/**
|
|
493
|
+
* Document-aware validation (QA 2026-07-19 ADEU-QA-004): a replacement's
|
|
494
|
+
* del+ins pair carries two distinct ids but resolves as one unit, so a
|
|
495
|
+
* batch that accepts one side and rejects the other is contradictory.
|
|
496
|
+
* Rejecting it up front — before any action mutates the document — keeps
|
|
497
|
+
* the batch transactional.
|
|
498
|
+
*/
|
|
499
|
+
validate_action_pairing(actions: any[]): string[];
|
|
500
|
+
/**
|
|
501
|
+
* Returns [applied, skipped, already_resolved]. `applied` counts actions
|
|
502
|
+
* that caused an observable state transition; an action naming an id an
|
|
503
|
+
* earlier action of this batch already resolved (via its replacement pair)
|
|
504
|
+
* is counted in `already_resolved` instead — never as applied
|
|
505
|
+
* (QA 2026-07-19 ADEU-QA-004).
|
|
506
|
+
*/
|
|
507
|
+
apply_review_actions(actions: any[]): [number, number, number];
|
|
455
508
|
private _apply_table_edit;
|
|
456
509
|
private _pre_resolve_heuristic_edit;
|
|
457
510
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -128,6 +128,23 @@ declare class DocumentMapper {
|
|
|
128
128
|
* characters are excluded.
|
|
129
129
|
*/
|
|
130
130
|
private _find_plain_projection_matches;
|
|
131
|
+
/**
|
|
132
|
+
* True when no run-backed span overlaps [start, start+length): the range
|
|
133
|
+
* covers only virtual projection text — meta bubbles (change/comment
|
|
134
|
+
* headers, timestamps), style markers, list prefixes. Such text does not
|
|
135
|
+
* exist in the document, so it can neither satisfy a match nor count
|
|
136
|
+
* toward ambiguity (QA 2026-07-19 ADEU-QA-002 C): an edit targeting "4"
|
|
137
|
+
* used to be rejected as "appears 8 times" because a comment bubble's
|
|
138
|
+
* timestamp matched.
|
|
139
|
+
*
|
|
140
|
+
* Anchor tokens ({#Bookmark}, {#cell:paraId}) are the exception: they are
|
|
141
|
+
* deliberate virtual TARGETING surfaces (empty-cell writes, bookmark
|
|
142
|
+
* anchors) and must stay matchable.
|
|
143
|
+
*/
|
|
144
|
+
range_is_virtual_only(start: number, length: number): boolean;
|
|
145
|
+
/** Filters find_all_match_indices output down to matches that touch at
|
|
146
|
+
* least one run-backed span. See range_is_virtual_only. */
|
|
147
|
+
drop_virtual_only_matches(matches: [number, number][]): [number, number][];
|
|
131
148
|
find_match_index(target_text: string, is_regex?: boolean): [number, number];
|
|
132
149
|
find_all_match_indices(target_text: string, is_regex?: boolean): [number, number][];
|
|
133
150
|
find_target_runs(target_text: string): Run[];
|
|
@@ -386,6 +403,7 @@ declare class RedlineEngine {
|
|
|
386
403
|
*
|
|
387
404
|
* Does NOT attach comments; callers handle that.
|
|
388
405
|
*/
|
|
406
|
+
private _clone_pPr_scrubbing_headings;
|
|
389
407
|
private _track_insert_multiline;
|
|
390
408
|
/**
|
|
391
409
|
* Builds a single tracked-insert wrapper (<w:ins>) containing one or more
|
|
@@ -451,7 +469,42 @@ declare class RedlineEngine {
|
|
|
451
469
|
process_batch(changes: DocumentChange[], dry_run?: boolean): any;
|
|
452
470
|
private _process_batch_internal;
|
|
453
471
|
apply_edits(edits: any[], page_offsets?: number[]): [number, number];
|
|
454
|
-
|
|
472
|
+
/**
|
|
473
|
+
* True when the paragraph still carries visible content (w:t text, w:tab,
|
|
474
|
+
* w:br) that is NOT wrapped in a tracked deletion — i.e. the paragraph
|
|
475
|
+
* would render non-empty in the accepted document.
|
|
476
|
+
*/
|
|
477
|
+
private _paragraph_has_visible_content;
|
|
478
|
+
/**
|
|
479
|
+
* All contiguous same-author w:ins/w:del siblings that form one logical
|
|
480
|
+
* modification block with `node` (a replacement's del+ins pair). Mirrors
|
|
481
|
+
* the Python engine's _get_paired_nodes: comment range markers and
|
|
482
|
+
* rPr/pPr are transparent; a different author or any other element breaks
|
|
483
|
+
* the group.
|
|
484
|
+
*/
|
|
485
|
+
private _get_paired_nodes;
|
|
486
|
+
/**
|
|
487
|
+
* All revision ids that resolve as ONE unit with `target_id`: the ids of
|
|
488
|
+
* every contiguous same-author w:ins/w:del sibling of its elements (a
|
|
489
|
+
* replacement's del+ins pair), plus the id itself.
|
|
490
|
+
*/
|
|
491
|
+
private _resolution_group_ids;
|
|
492
|
+
/**
|
|
493
|
+
* Document-aware validation (QA 2026-07-19 ADEU-QA-004): a replacement's
|
|
494
|
+
* del+ins pair carries two distinct ids but resolves as one unit, so a
|
|
495
|
+
* batch that accepts one side and rejects the other is contradictory.
|
|
496
|
+
* Rejecting it up front — before any action mutates the document — keeps
|
|
497
|
+
* the batch transactional.
|
|
498
|
+
*/
|
|
499
|
+
validate_action_pairing(actions: any[]): string[];
|
|
500
|
+
/**
|
|
501
|
+
* Returns [applied, skipped, already_resolved]. `applied` counts actions
|
|
502
|
+
* that caused an observable state transition; an action naming an id an
|
|
503
|
+
* earlier action of this batch already resolved (via its replacement pair)
|
|
504
|
+
* is counted in `already_resolved` instead — never as applied
|
|
505
|
+
* (QA 2026-07-19 ADEU-QA-004).
|
|
506
|
+
*/
|
|
507
|
+
apply_review_actions(actions: any[]): [number, number, number];
|
|
455
508
|
private _apply_table_edit;
|
|
456
509
|
private _pre_resolve_heuristic_edit;
|
|
457
510
|
/**
|