@ansonlai/docx-redline-js 0.5.4 → 0.6.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/AGENTS.md +78 -697
- package/ARCHITECTURE.md +13 -1
- package/CHANGELOG.md +5 -0
- package/README.md +140 -30
- package/core/paragraph-targeting.js +14 -2
- package/dist/docx-redline-js.esm.js +113 -33
- package/dist/docx-redline-js.esm.js.map +3 -3
- package/dist/docx-redline-js.esm.min.js +75 -75
- package/dist/docx-redline-js.esm.min.js.map +4 -4
- package/docs/AGENT_FAST_START.md +59 -0
- package/docs/AGENT_KNOWLEDGE_BASE.md +868 -0
- package/docs/TESTING.md +20 -1
- package/docs/schemas/document-operations.schema.json +5 -1
- package/docs/validation-reports/2026-09-12-agent-protocol-rollout.md +82 -0
- package/engine/oxml-engine.js +80 -13
- package/engine/run-builders.js +5 -15
- package/index.d.ts +17 -1
- package/node/cli.js +111 -27
- package/node/docx-document.js +120 -69
- package/node/index.d.ts +6 -2
- package/package.json +10 -3
- package/scripts/generate-cross-author-slicing-fixtures.ps1 +25 -25
- package/services/batch-operation-orchestrator.js +215 -120
- package/services/document-inspection.js +5 -3
- package/services/document-operation-applier.js +52 -34
- package/services/document-operation-contract.js +10 -6
- package/services/document-operation-mutations.js +51 -5
- package/services/document-operation-session.js +4 -0
- package/services/error-recovery.js +174 -0
- package/services/operation-batch-compiler.js +394 -0
- package/services/operation-preflight.js +91 -72
- package/services/standalone-operation-runner.d.ts +17 -1
- package/docs/plans/2026-09-05-structural-revisions-and-fidelity-oracles.md +0 -1669
- package/docs/plans/2026-09-08-cross-author-revision-slicing.md +0 -1399
- package/docs/plans/completed/2026-03-01-release-0.1.4-design.md +0 -33
- package/docs/plans/completed/2026-03-01-release-0.1.4.md +0 -110
- package/docs/plans/completed/2026-05-31-architectural changes.md +0 -593
- package/docs/plans/completed/2026-08-02-reliability-improvements.md +0 -1155
- package/docs/plans/completed/2026-08-30-reliability-testing-improvements.md +0 -488
- package/docs/plans/completed/2026-09-01-performance-and-complexity-reduction.md +0 -669
- package/docs/plans/completed/2026-09-03-agent-friendly-document-workflows.md +0 -427
- package/docs/plans/completed/2026-09-04-comment-anchor-and-cli-reliability.md +0 -519
- package/docs/plans/completed/PERFORMANCE-CONSOLIDATION.md +0 -69
- package/docs/plans/completed/structural-revision-capability-matrix.md +0 -115
- package/docs/test-comparison-dashboard.html +0 -4338
- package/docs/validation-reports/2026-08-30-phase-1-word-visual-preflight.md +0 -22
- package/docs/validation-reports/2026-08-30-phase-2-word-visual-preflight.md +0 -24
- package/docs/validation-reports/2026-08-30-phase-3-coverage.md +0 -73
- package/docs/validation-reports/2026-09-02-multilevel-bullets-visual-review.md +0 -82
- package/docs/validation-reports/2026-09-02-multimodal-visual-samples.md +0 -114
- package/docs/validation-reports/2026-09-02-visual-failures-preflight.md +0 -79
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Agent Fast Start
|
|
2
|
+
|
|
3
|
+
Use this page for ordinary `.docx` edits. For source changes or unusual Word structures, follow the links at the end.
|
|
4
|
+
|
|
5
|
+
## Structured agent tool
|
|
6
|
+
|
|
7
|
+
If your host provides a document-session wrapper:
|
|
8
|
+
|
|
9
|
+
1. Inspect/search once with enough surrounding context to draft the change.
|
|
10
|
+
2. Apply using the returned revision-bound target handle. Send either the
|
|
11
|
+
complete desired paragraph or exact replacements supported by that wrapper.
|
|
12
|
+
3. Treat only `ok: true` as complete. A failed handle must be refreshed by
|
|
13
|
+
inspection; never reuse it against a changed document.
|
|
14
|
+
|
|
15
|
+
The repository's `examples/agent-session-wrapper.mjs` demonstrates this pattern.
|
|
16
|
+
It is a development sample, not a package API.
|
|
17
|
+
|
|
18
|
+
## CLI fallback
|
|
19
|
+
|
|
20
|
+
1. Extract only the relevant clause or range:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
docx-redline extract contract.docx --search "termination"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
2. Copy `exactText` with `paragraphId` or `fingerprint`. Serialize the final
|
|
27
|
+
operation array directly to stdin, then apply once:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
node emit-operations.mjs | docx-redline apply contract.docx --operations - --profile agent --output reviewed.docx
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`emit-operations.mjs` should use `JSON.stringify`; do not interpolate legal
|
|
34
|
+
text through shell quoting. `modified` is the complete desired accepted-view
|
|
35
|
+
paragraph, not only the inserted words.
|
|
36
|
+
|
|
37
|
+
The `agent` profile is explicit and reproducible. It uses atomic rollback,
|
|
38
|
+
strict targets, validation, tracked changes, `merge-same-author`, and nonzero
|
|
39
|
+
exit codes for incomplete work. The result reports `effectiveOptions`.
|
|
40
|
+
|
|
41
|
+
## Batch and result rules
|
|
42
|
+
|
|
43
|
+
- Strong inspected targets are bound to the batch-start document. Independent
|
|
44
|
+
edits do not need bottom-up sorting around earlier paragraph splits.
|
|
45
|
+
- Consolidate multiple desired texts for the same source paragraph. Follow an
|
|
46
|
+
explicit capture dependency for non-unique content created earlier in a batch.
|
|
47
|
+
- Require `completion: true`, `written: true`, a non-null `outputPath`, and no
|
|
48
|
+
per-operation error. The source is not overwritten unless `--in-place` is
|
|
49
|
+
explicit.
|
|
50
|
+
- On failure, follow `error.recovery.action`. Never retry unchanged arguments.
|
|
51
|
+
- `retryPlan.base: "original"` means correct and replay the complete batch.
|
|
52
|
+
`base: "output"` means keep committed progressive work and retry only the
|
|
53
|
+
reported failed or unattempted indexes.
|
|
54
|
+
- Never accept/reject revisions or remove comments without user authorization.
|
|
55
|
+
`slice-cross-author` is the history-preserving option for a surgical edit
|
|
56
|
+
inside another reviewer's pending insertion.
|
|
57
|
+
|
|
58
|
+
Advanced operations and recovery: [Agent Knowledge Base](AGENT_KNOWLEDGE_BASE.md); canonical contract: [document-operations.schema.json](schemas/document-operations.schema.json)
|
|
59
|
+
Wrapper design: [README](../README.md#example-agent-session-wrapper-development-only)
|