@ansonlai/docx-redline-js 0.9.0 → 0.10.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/ARCHITECTURE.md +679 -669
- package/CHANGELOG.md +32 -1
- package/README.md +29 -6
- package/core/word-xml.js +160 -118
- package/dist/docx-redline-js.esm.js +171 -51
- package/dist/docx-redline-js.esm.js.map +4 -4
- package/dist/docx-redline-js.esm.min.js +93 -93
- package/dist/docx-redline-js.esm.min.js.map +4 -4
- package/dist/docx-redline.bundle.cjs +171 -51
- package/dist/docx-redline.bundle.cjs.map +4 -4
- package/dist/docx-redline.bundle.js +171 -51
- package/dist/docx-redline.bundle.js.map +4 -4
- package/docs/AGENT_KNOWLEDGE_BASE.md +30 -4
- package/docs/SKILL_AUTHORING.md +5 -1
- package/docs/TESTING.md +4 -0
- package/docs/schemas/document-operations.schema.json +1 -1
- package/engine/oxml-engine.js +748 -736
- package/index.d.ts +6 -1
- package/index.js +2 -0
- package/node/cli.js +993 -992
- package/package.json +1 -1
- package/pipeline/markdown-processor.js +5 -2
- package/services/comment-replies.js +1 -1
- package/services/document-operation-applier.js +1 -0
- package/services/document-operation-contract.js +1 -0
- package/services/document-operation-mutations.js +3358 -3346
- package/services/inspection-comparison.js +82 -0
- package/services/operation-preflight.js +42 -33
- package/services/revision-fidelity-verifier.js +5 -19
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type OoxmlSourceType = 'package' | 'document' | 'fragment';
|
|
2
2
|
export type RedlineStatus = 'ok' | 'no-op' | 'partial' | 'error';
|
|
3
|
-
export type ExistingRevisionsPolicy = 'merge-same-author' | 'slice-cross-author' | 'reject-input' | 'accept-all-first' | 'accept-all-first-keep-normalized';
|
|
3
|
+
export type ExistingRevisionsPolicy = 'auto' | 'merge-same-author' | 'slice-cross-author' | 'reject-input' | 'accept-all-first' | 'accept-all-first-keep-normalized';
|
|
4
4
|
export type RevisionView = 'accepted' | 'rejected';
|
|
5
5
|
|
|
6
6
|
export interface RevisionTextSegment {
|
|
@@ -372,6 +372,11 @@ export function inspectDocumentParts(parts: { documentXml: string; commentsXml?:
|
|
|
372
372
|
export function buildRevisionTokenFraming(options: { scope: string; entries?: unknown }): { framing: Uint8Array; scope: string; version: number; coveredParts: string[] };
|
|
373
373
|
export function computeRevisionToken(options: { scope: string; entries?: unknown; digestFn?: (bytes: Uint8Array) => Promise<string> }): Promise<RevisionToken>;
|
|
374
374
|
export function computeRevisionTokenSync(options: { scope: string; entries?: unknown; digestFn: (bytes: Uint8Array) => string }): RevisionToken;
|
|
375
|
+
/** Compare two inspections by visible text, table position, list label, review segments and comments (ids, dates and run boundaries ignored). */
|
|
376
|
+
export function compareDocumentInspections(expected: { paragraphs: unknown[]; comments?: unknown[] }, actual: { paragraphs: unknown[]; comments?: unknown[] }): { matches: boolean; differences: Array<{ path: string; expected: unknown; actual: unknown }> };
|
|
377
|
+
export function inspectionReviewShape(inspection: { paragraphs: unknown[]; comments?: unknown[] }): { paragraphs: unknown[]; comments: string[] };
|
|
378
|
+
/** Resolve `existingRevisions: 'auto'` for one target node; other policies are returned unchanged. */
|
|
379
|
+
export function resolveExistingRevisionsPolicy(policy: ExistingRevisionsPolicy | null | undefined, node: unknown, author: string): ExistingRevisionsPolicy | null | undefined;
|
|
375
380
|
export function computeDocumentPartsRevisionToken(parts: unknown, options?: { digestFn?: (bytes: Uint8Array) => Promise<string> }): Promise<RevisionToken>;
|
|
376
381
|
export function validateRevisionToken(token: unknown): { valid: boolean; error?: { code: string; message: string } };
|
|
377
382
|
export function areRevisionTokensEqual(a: string, b: string): boolean;
|
package/index.js
CHANGED
|
@@ -284,6 +284,8 @@ export {
|
|
|
284
284
|
} from './pipeline/ingestion-export.js';
|
|
285
285
|
export { extractCanonicalParagraphText, readCanonicalRunText, isNodeVisibleInRevisionView, extractParagraphRevisionSegments } from './core/paragraph-text.js';
|
|
286
286
|
export { inspectDocumentParts } from './services/document-inspection.js';
|
|
287
|
+
export { compareDocumentInspections, inspectionReviewShape } from './services/inspection-comparison.js';
|
|
288
|
+
export { resolveExistingRevisionsPolicy } from './core/word-xml.js';
|
|
287
289
|
export {
|
|
288
290
|
buildRevisionTokenFraming,
|
|
289
291
|
computeRevisionToken,
|