docxodus 6.0.0 → 6.2.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/session.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import type { AnchorTargetRef, CharSpan, CrossBlockMatch, DocumentAnnotation, DocxodusWasmExports, DocxSessionProjection, DocxSessionSettings, EditResult, FormatOp, GrepOptions, ReplaceOptions, TemplatePlaceholder, TextMatch } from "./types.js";
1
+ import type { AnchorInfo, AnchorTargetRef, AnnotationUpdate, BlockMetadata, BulkEditResult, CharSpan, CrossBlockMatch, DiffEntry, DocumentAnnotation, DocxodusWasmExports, DocxSessionProjection, DocxSessionSettings, EditResult, EditSummary, FillOptions, FormatOp, GrepOptions, ListMembership, ReplaceOptions, SectionInfo, TemplatePlaceholder, TextMatch } from "./types.js";
2
+ import { DiffFormat, ProjectionDepth } from "./types.js";
2
3
  /**
3
4
  * Stateful in-memory DOCX editing session keyed by markdown-projection anchor ids.
4
5
  * Mirror of the .NET `DocxSession` surface. See
@@ -14,8 +15,45 @@ export declare class DocxSession {
14
15
  /** @internal */
15
16
  constructor(handle: number, wasm: DocxodusWasmExports["DocxSessionBridge"]);
16
17
  project(): DocxSessionProjection;
18
+ /**
19
+ * Project a slice of the document keyed off an anchor — useful for showing
20
+ * one section to an LLM at a time without paying the cost of projecting the
21
+ * whole document.
22
+ *
23
+ * - `ProjectionDepth.SelfOnly` — just the addressed block (one paragraph,
24
+ * row, etc.).
25
+ * - `ProjectionDepth.Subtree` — the block + descendants (e.g. a table with
26
+ * all its rows/cells, but no following content).
27
+ * - `ProjectionDepth.SubtreeAndFollowingSiblings` (default) — for headings
28
+ * this returns the whole section (heading + content up to the next same-
29
+ * or-higher heading); for non-headings it behaves like `Subtree`.
30
+ *
31
+ * @see docs/architecture/docx_mutation_api.md
32
+ */
33
+ projectAnchor(anchorId: string, depth?: ProjectionDepth): DocxSessionProjection;
17
34
  replaceText(anchorId: string, markdown: string): EditResult;
18
35
  deleteBlock(anchorId: string): EditResult;
36
+ /**
37
+ * Delete every top-level block-level sibling between `fromAnchorId` (inclusive)
38
+ * and `toAnchorIdExclusive` (exclusive). Both anchors must share a direct
39
+ * parent and live in the same package part. Returns a single `EditResult`
40
+ * whose `removed` lists every anchor that was deleted.
41
+ *
42
+ * Records ONE undo snapshot — `undo()` restores the entire range.
43
+ *
44
+ * @see docs/architecture/docx_mutation_api.md#deleterange
45
+ */
46
+ deleteRange(fromAnchorId: string, toAnchorIdExclusive: string): EditResult;
47
+ /**
48
+ * Delete a heading and everything below it up to (but not including) the next
49
+ * heading at the same or higher level. The heading anchor must have `kind === "h"`.
50
+ *
51
+ * If the target is the last heading in its parent, the section extends to the
52
+ * end of the parent (heading + everything after).
53
+ *
54
+ * @see docs/architecture/docx_mutation_api.md#deletesection
55
+ */
56
+ deleteSection(headingAnchorId: string): EditResult;
19
57
  insertParagraph(anchorId: string, position: "before" | "after", markdown: string): EditResult;
20
58
  splitParagraph(anchorId: string, characterOffset: number): EditResult;
21
59
  mergeParagraphs(firstAnchorId: string, secondAnchorId: string): EditResult;
@@ -87,6 +125,48 @@ export declare class DocxSession {
87
125
  * each get a different value) don't collide.
88
126
  */
89
127
  replaceMatch(match: TextMatch, replace: string): EditResult;
128
+ /**
129
+ * Helper for {@link fillPlaceholders} `coalesceWhitespaceAroundEmptyFill` path —
130
+ * mirrors the .NET `ReplaceMatchCoalescingNeighbors` rules. Inspects the chars
131
+ * immediately surrounding the match via `match.contextBefore` / `contextAfter`
132
+ * (so the option requires `contextChars >= 1`, the default) and expands the
133
+ * deletion span to absorb whitespace / leading-space-before-punctuation /
134
+ * matched-brackets where the patterns match. Falls back to literal-delete
135
+ * when no neighbor pattern applies.
136
+ *
137
+ * Note: with `boundary: ContextBoundary.Bracket`, neighbor brackets are not
138
+ * captured in context, so the bracket-coalesce rule won't fire on the JS side.
139
+ * The .NET implementation reads flat text directly and handles that case;
140
+ * callers who care should leave `boundary` at the default `Char`.
141
+ */
142
+ private replaceMatchCoalescingNeighbors;
143
+ /**
144
+ * Replace the bracketed portion of a `TextMatch` with `newInner`, preserving any
145
+ * prefix or suffix outside the brackets. Designed for `findPlaceholders` matches
146
+ * like `$[___]` where the regex `\$?\[…\]` captures a leading `$`:
147
+ * `replaceInner(match, "0.20")` yields `$0.20`, not `0.20`.
148
+ *
149
+ * Returns `MalformedMarkdown` if the match text does not contain balanced brackets.
150
+ */
151
+ replaceInner(match: TextMatch, newInner: string): EditResult;
152
+ /**
153
+ * Picker-driven template fill. For every placeholder matching `options.kinds`,
154
+ * calls `picker`; if the picker returns a non-null string, the placeholder is
155
+ * replaced (with optional `$`-prefix preservation). Iterates until no more
156
+ * placeholders match (or `maxPasses` is reached, or a pass makes zero changes)
157
+ * — handles nested brackets that surface only after the inner ones are stripped.
158
+ *
159
+ * The TypeScript implementation mirrors the .NET `DocxSession.FillPlaceholders`
160
+ * exactly.
161
+ *
162
+ * The picker is invoked synchronously by this loop on the JS side (it does
163
+ * NOT run inside the WASM module). Async pickers are not supported: returning
164
+ * a `Promise` will cause a `TypeError` at runtime inside the `$`-prefix
165
+ * preservation branch (`Promise.startsWith is not a function`). For async
166
+ * data, pre-build a lookup map before calling and have the picker read from
167
+ * it synchronously.
168
+ */
169
+ fillPlaceholders(picker: (p: TemplatePlaceholder) => string | null | undefined, options?: FillOptions): BulkEditResult;
90
170
  /**
91
171
  * Enumerate template placeholders in the document. Thin classifier over
92
172
  * {@link grep}: distinguishes `[___]` value blanks (`blank_fill`),
@@ -98,7 +178,33 @@ export declare class DocxSession {
98
178
  *
99
179
  * @see docs/architecture/docx_mutation_api.md#findplaceholders
100
180
  */
101
- findPlaceholders(kinds?: number, scope?: number): TemplatePlaceholder[];
181
+ findPlaceholders(kinds?: number, scope?: number, contextChars?: number, boundary?: number): TemplatePlaceholder[];
182
+ /**
183
+ * Returns a snapshot of edit-state introspection signals — placeholder counts,
184
+ * underscore-run leftovers, footnote/comment counts. Useful for "am I done?"
185
+ * verification at the end of an edit pipeline.
186
+ */
187
+ getEditSummary(): EditSummary;
188
+ /**
189
+ * Discoverability alias for {@link findPlaceholders}. Same return shape.
190
+ */
191
+ remainingPlaceholders(kinds?: number): TemplatePlaceholder[];
192
+ /**
193
+ * Diff the document's current projection against the projection captured at
194
+ * session construction time.
195
+ *
196
+ * Requires `captureInitialProjection: true` in {@link DocxSessionSettings}
197
+ * (the default). Throws if not enabled.
198
+ *
199
+ * The return type depends on `format`:
200
+ * - `DiffFormat.Json` (default) — structured anchor-keyed `DiffEntry[]`.
201
+ * - `DiffFormat.Unified` — `patch(1)`-compatible unified-diff text;
202
+ * empty string when nothing has changed.
203
+ * - `DiffFormat.SideBySide` — two-column human-review text
204
+ * (`diff -y` style).
205
+ */
206
+ getDiff(format?: typeof DiffFormat.Json): DiffEntry[];
207
+ getDiff(format: typeof DiffFormat.Unified | typeof DiffFormat.SideBySide): string;
102
208
  /**
103
209
  * Resolves an annotation's range to the block-level markdown anchors covering
104
210
  * it, in document order. The bridge between Docxodus' read-side annotation API
@@ -129,12 +235,56 @@ export declare class DocxSession {
129
235
  * names that didn't come from the annotation system.
130
236
  */
131
237
  findByBookmark(bookmarkName: string): AnchorTargetRef[];
238
+ /**
239
+ * Look up a single anchor's preview info — `{ id, kind, scope, textPreview }`.
240
+ * Returns null when the anchor id is unknown.
241
+ *
242
+ * For iterating many anchors at once, prefer reading `textPreview` directly
243
+ * off the {@link MarkdownProjection.anchorIndex} entries (cheaper — no extra
244
+ * WASM round trip), or use {@link getAnchorInfos} for batched lookups.
245
+ */
246
+ getAnchorInfo(anchorId: string): AnchorInfo | null;
247
+ /**
248
+ * Bulk variant of {@link getAnchorInfo}: takes an array of anchor ids,
249
+ * returns a record where each unknown id maps to `null`.
250
+ */
251
+ getAnchorInfos(anchorIds: readonly string[]): Record<string, AnchorInfo | null>;
252
+ /**
253
+ * Resolve block-level metadata (style id+name, outline level, list membership,
254
+ * formatting probe) for an anchor. Returns null when the anchor doesn't exist.
255
+ */
256
+ getBlockMetadata(anchorId: string): BlockMetadata | null;
257
+ /**
258
+ * Bulk variant of {@link getBlockMetadata}. Unknown ids map to null;
259
+ * duplicates are deduped.
260
+ */
261
+ getBlockMetadatas(anchorIds: readonly string[]): Record<string, BlockMetadata | null>;
262
+ /**
263
+ * Resolve the numbering facts for a list-item paragraph; returns null when
264
+ * the anchor has no w:numPr.
265
+ */
266
+ getListMembership(anchorId: string): ListMembership | null;
267
+ /**
268
+ * Resolve page-layout info for the w:sectPr that governs an anchor.
269
+ * Returns null for anchors outside the body part.
270
+ */
271
+ getSectionInfo(anchorId: string): SectionInfo | null;
132
272
  /**
133
273
  * Enumerates every annotation persisted in the document. Lets an agent prime
134
274
  * itself with "here are the labeled regions you can target" before committing
135
275
  * to a specific id.
136
276
  */
137
277
  listAnnotations(): DocumentAnnotation[];
278
+ /**
279
+ * Annotate a range inside `anchorId`. When `span` is `null`/`undefined`
280
+ * the annotation wraps every inline run of the block. When
281
+ * `annotation.id` is `undefined`, a 16-char hex id is auto-generated and
282
+ * returned in `EditResult.annotationId`.
283
+ */
284
+ addAnnotation(anchorId: string, span: CharSpan | null, annotation: DocumentAnnotation): EditResult;
285
+ removeAnnotation(annotationId: string): EditResult;
286
+ updateAnnotation(annotationId: string, update: AnnotationUpdate): EditResult;
287
+ moveAnnotation(annotationId: string, newAnchorId: string, newSpan: CharSpan | null): EditResult;
138
288
  undo(): boolean;
139
289
  redo(): boolean;
140
290
  save(): Uint8Array;
@@ -147,6 +297,6 @@ export declare class DocxSession {
147
297
  * {@link DocxSession.close} (or it is disposed).
148
298
  */
149
299
  export declare function openDocxSession(bytes: Uint8Array, wasmExports: DocxodusWasmExports, settings?: DocxSessionSettings): DocxSession;
150
- export type { AnchorRef, AnchorTargetRef, BlockSlice, CharSpan, CrossBlockMatch, DocumentAnnotation, DocxSessionProjection, DocxSessionSettings, EditError, EditErrorCode, EditResult, FormatOp, GrepOptions, MarkdownPatch, PlaceholderKind, ReplaceOptions, RunFormatting, RunFragment, TemplatePlaceholder, TextMatch } from "./types.js";
151
- export { PlaceholderKinds } from "./types.js";
300
+ export type { AnchorInfo, AnchorRef, AnchorTargetRef, BlockSlice, CharSpan, CrossBlockMatch, DocumentAnnotation, DocxSessionProjection, DocxSessionSettings, EditError, EditErrorCode, EditResult, FormatOp, GrepOptions, MarkdownPatch, PlaceholderKind, ReplaceOptions, RunFormatting, RunFragment, TemplatePlaceholder, TextMatch } from "./types.js";
301
+ export { ContextBoundary, PlaceholderKinds } from "./types.js";
152
302
  //# sourceMappingURL=session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,eAAe,EACf,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,SAAS,EACV,MAAM,YAAY,CAAC;AAGpB;;;;;;;;GAQG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA2C;IAEhE,gBAAgB;gBACJ,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,CAAC,mBAAmB,CAAC;IAO1E,OAAO,IAAI,qBAAqB;IAMhC,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU;IAI3D,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU;IAMzC,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU;IAI7F,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,UAAU;IAIrE,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,cAA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AAE,aAAa,EAAE,WAAW,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACzV,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
package/dist/session.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft. All rights reserved.
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
- import { PlaceholderKinds } from "./types.js";
3
+ import { ContextBoundary, DiffFormat, PlaceholderKinds, ProjectionDepth } from "./types.js";
4
4
  /**
5
5
  * Stateful in-memory DOCX editing session keyed by markdown-projection anchor ids.
6
6
  * Mirror of the .NET `DocxSession` surface. See
@@ -26,6 +26,24 @@ export class DocxSession {
26
26
  project() {
27
27
  return JSON.parse(this.wasm.Project(this.handle));
28
28
  }
29
+ /**
30
+ * Project a slice of the document keyed off an anchor — useful for showing
31
+ * one section to an LLM at a time without paying the cost of projecting the
32
+ * whole document.
33
+ *
34
+ * - `ProjectionDepth.SelfOnly` — just the addressed block (one paragraph,
35
+ * row, etc.).
36
+ * - `ProjectionDepth.Subtree` — the block + descendants (e.g. a table with
37
+ * all its rows/cells, but no following content).
38
+ * - `ProjectionDepth.SubtreeAndFollowingSiblings` (default) — for headings
39
+ * this returns the whole section (heading + content up to the next same-
40
+ * or-higher heading); for non-headings it behaves like `Subtree`.
41
+ *
42
+ * @see docs/architecture/docx_mutation_api.md
43
+ */
44
+ projectAnchor(anchorId, depth = ProjectionDepth.SubtreeAndFollowingSiblings) {
45
+ return JSON.parse(this.wasm.ProjectAnchor(this.handle, anchorId, depth));
46
+ }
29
47
  // ─── Tier A: text CRUD ───────────────────────────────────────────────
30
48
  replaceText(anchorId, markdown) {
31
49
  return JSON.parse(this.wasm.ReplaceText(this.handle, anchorId, markdown));
@@ -33,6 +51,31 @@ export class DocxSession {
33
51
  deleteBlock(anchorId) {
34
52
  return JSON.parse(this.wasm.DeleteBlock(this.handle, anchorId));
35
53
  }
54
+ /**
55
+ * Delete every top-level block-level sibling between `fromAnchorId` (inclusive)
56
+ * and `toAnchorIdExclusive` (exclusive). Both anchors must share a direct
57
+ * parent and live in the same package part. Returns a single `EditResult`
58
+ * whose `removed` lists every anchor that was deleted.
59
+ *
60
+ * Records ONE undo snapshot — `undo()` restores the entire range.
61
+ *
62
+ * @see docs/architecture/docx_mutation_api.md#deleterange
63
+ */
64
+ deleteRange(fromAnchorId, toAnchorIdExclusive) {
65
+ return JSON.parse(this.wasm.DeleteRange(this.handle, fromAnchorId, toAnchorIdExclusive));
66
+ }
67
+ /**
68
+ * Delete a heading and everything below it up to (but not including) the next
69
+ * heading at the same or higher level. The heading anchor must have `kind === "h"`.
70
+ *
71
+ * If the target is the last heading in its parent, the section extends to the
72
+ * end of the parent (heading + everything after).
73
+ *
74
+ * @see docs/architecture/docx_mutation_api.md#deletesection
75
+ */
76
+ deleteSection(headingAnchorId) {
77
+ return JSON.parse(this.wasm.DeleteSection(this.handle, headingAnchorId));
78
+ }
36
79
  // ─── Tier B: structural ──────────────────────────────────────────────
37
80
  insertParagraph(anchorId, position, markdown) {
38
81
  return JSON.parse(this.wasm.InsertParagraph(this.handle, anchorId, position, markdown));
@@ -133,6 +176,150 @@ export class DocxSession {
133
176
  replaceMatch(match, replace) {
134
177
  return JSON.parse(this.wasm.ReplaceTextAtSpan(this.handle, match.enclosingAnchor.id, match.span.start, match.span.length, replace));
135
178
  }
179
+ /**
180
+ * Helper for {@link fillPlaceholders} `coalesceWhitespaceAroundEmptyFill` path —
181
+ * mirrors the .NET `ReplaceMatchCoalescingNeighbors` rules. Inspects the chars
182
+ * immediately surrounding the match via `match.contextBefore` / `contextAfter`
183
+ * (so the option requires `contextChars >= 1`, the default) and expands the
184
+ * deletion span to absorb whitespace / leading-space-before-punctuation /
185
+ * matched-brackets where the patterns match. Falls back to literal-delete
186
+ * when no neighbor pattern applies.
187
+ *
188
+ * Note: with `boundary: ContextBoundary.Bracket`, neighbor brackets are not
189
+ * captured in context, so the bracket-coalesce rule won't fire on the JS side.
190
+ * The .NET implementation reads flat text directly and handles that case;
191
+ * callers who care should leave `boundary` at the default `Char`.
192
+ */
193
+ replaceMatchCoalescingNeighbors(match) {
194
+ // Fold NBSP / narrow NBSP / thin space to ASCII space so e.g. an NBSP on
195
+ // either side still gets treated as whitespace by the rules below.
196
+ const fold = (c) => {
197
+ if (c === " " || c === " " || c === " ")
198
+ return " ";
199
+ return c;
200
+ };
201
+ const l = fold(match.contextBefore.length > 0 ? match.contextBefore[match.contextBefore.length - 1] : undefined);
202
+ const r = fold(match.contextAfter.length > 0 ? match.contextAfter[0] : undefined);
203
+ const isSpace = (c) => c === " " || c === "\t";
204
+ const isClauseTerm = (c) => c === "." || c === "," || c === ";" || c === ":" || c === "!" || c === "?";
205
+ const isOpen = (c) => c === "(" || c === "[" || c === "{";
206
+ const isClose = (c) => c === ")" || c === "]" || c === "}";
207
+ let extendLeft = 0;
208
+ let extendRight = 0;
209
+ if (isSpace(l) && isSpace(r)) {
210
+ extendRight = 1;
211
+ }
212
+ else if (isSpace(l) && isClauseTerm(r)) {
213
+ extendLeft = 1;
214
+ }
215
+ else if (isOpen(l) && isClose(r)) {
216
+ extendLeft = 1;
217
+ extendRight = 1;
218
+ }
219
+ if (extendLeft === 0 && extendRight === 0) {
220
+ return this.replaceMatch(match, "");
221
+ }
222
+ return JSON.parse(this.wasm.ReplaceTextAtSpan(this.handle, match.enclosingAnchor.id, match.span.start - extendLeft, match.span.length + extendLeft + extendRight, ""));
223
+ }
224
+ /**
225
+ * Replace the bracketed portion of a `TextMatch` with `newInner`, preserving any
226
+ * prefix or suffix outside the brackets. Designed for `findPlaceholders` matches
227
+ * like `$[___]` where the regex `\$?\[…\]` captures a leading `$`:
228
+ * `replaceInner(match, "0.20")` yields `$0.20`, not `0.20`.
229
+ *
230
+ * Returns `MalformedMarkdown` if the match text does not contain balanced brackets.
231
+ */
232
+ replaceInner(match, newInner) {
233
+ return JSON.parse(this.wasm.ReplaceInner(this.handle, match.text, match.enclosingAnchor.id, match.span.start, match.span.length, newInner));
234
+ }
235
+ /**
236
+ * Picker-driven template fill. For every placeholder matching `options.kinds`,
237
+ * calls `picker`; if the picker returns a non-null string, the placeholder is
238
+ * replaced (with optional `$`-prefix preservation). Iterates until no more
239
+ * placeholders match (or `maxPasses` is reached, or a pass makes zero changes)
240
+ * — handles nested brackets that surface only after the inner ones are stripped.
241
+ *
242
+ * The TypeScript implementation mirrors the .NET `DocxSession.FillPlaceholders`
243
+ * exactly.
244
+ *
245
+ * The picker is invoked synchronously by this loop on the JS side (it does
246
+ * NOT run inside the WASM module). Async pickers are not supported: returning
247
+ * a `Promise` will cause a `TypeError` at runtime inside the `$`-prefix
248
+ * preservation branch (`Promise.startsWith is not a function`). For async
249
+ * data, pre-build a lookup map before calling and have the picker read from
250
+ * it synchronously.
251
+ */
252
+ fillPlaceholders(picker, options) {
253
+ const opts = options ?? {};
254
+ // Default Kinds = All so the picker is invoked for every kind the doc contains.
255
+ // Callers that want to ignore AlternativeClause matches should narrow this to
256
+ // `PlaceholderKinds.BlankFill | PlaceholderKinds.Instruction`.
257
+ const kinds = opts.kinds ?? PlaceholderKinds.All;
258
+ const scope = opts.scope ?? 1; // Body
259
+ const maxPasses = opts.maxPasses ?? 8;
260
+ const preserveDollarPrefix = opts.preserveDollarPrefix ?? true;
261
+ const contextChars = opts.contextChars ?? 80;
262
+ const boundary = opts.boundary ?? ContextBoundary.Char;
263
+ const coalesceEmpty = opts.coalesceWhitespaceAroundEmptyFill ?? false;
264
+ if (maxPasses <= 0) {
265
+ throw new RangeError("FillOptions.maxPasses must be > 0");
266
+ }
267
+ let filled = 0;
268
+ let workPasses = 0;
269
+ const errors = [];
270
+ const unfilled = [];
271
+ const seenSkipKeys = new Set();
272
+ for (let pass = 1; pass <= maxPasses; pass++) {
273
+ const placeholders = this.findPlaceholders(kinds, scope, contextChars, boundary)
274
+ .sort((a, b) => {
275
+ const cmp = b.match.enclosingAnchor.id.localeCompare(a.match.enclosingAnchor.id);
276
+ if (cmp !== 0)
277
+ return cmp;
278
+ return b.match.span.start - a.match.span.start;
279
+ });
280
+ if (placeholders.length === 0)
281
+ break;
282
+ let passChanges = 0;
283
+ for (const p of placeholders) {
284
+ const pick = picker(p);
285
+ if (pick == null) {
286
+ const key = `${p.match.enclosingAnchor.id}:${p.match.span.start}:${p.match.span.length}`;
287
+ if (!seenSkipKeys.has(key)) {
288
+ seenSkipKeys.add(key);
289
+ unfilled.push(p);
290
+ }
291
+ continue;
292
+ }
293
+ let replacement = pick;
294
+ if (preserveDollarPrefix && p.match.text.startsWith("$") && !replacement.startsWith("$")) {
295
+ replacement = "$" + replacement;
296
+ }
297
+ const r = coalesceEmpty && replacement.length === 0
298
+ ? this.replaceMatchCoalescingNeighbors(p.match)
299
+ : this.replaceMatch(p.match, replacement);
300
+ if (r.success) {
301
+ filled++;
302
+ passChanges++;
303
+ }
304
+ else if (r.error) {
305
+ errors.push(r.error);
306
+ }
307
+ }
308
+ if (passChanges > 0)
309
+ workPasses = pass;
310
+ if (passChanges === 0)
311
+ break;
312
+ }
313
+ const stillPresent = this.findPlaceholders(kinds, scope).length;
314
+ return {
315
+ filled,
316
+ skipped: unfilled.length,
317
+ stillPresent,
318
+ passes: workPasses,
319
+ unfilled,
320
+ errors,
321
+ };
322
+ }
136
323
  /**
137
324
  * Enumerate template placeholders in the document. Thin classifier over
138
325
  * {@link grep}: distinguishes `[___]` value blanks (`blank_fill`),
@@ -144,8 +331,29 @@ export class DocxSession {
144
331
  *
145
332
  * @see docs/architecture/docx_mutation_api.md#findplaceholders
146
333
  */
147
- findPlaceholders(kinds = PlaceholderKinds.All, scope = 1) {
148
- return JSON.parse(this.wasm.FindPlaceholders(this.handle, kinds, scope));
334
+ findPlaceholders(kinds = PlaceholderKinds.All, scope = 1, contextChars = 80, boundary = ContextBoundary.Char) {
335
+ return JSON.parse(this.wasm.FindPlaceholders(this.handle, kinds, scope, contextChars, boundary));
336
+ }
337
+ /**
338
+ * Returns a snapshot of edit-state introspection signals — placeholder counts,
339
+ * underscore-run leftovers, footnote/comment counts. Useful for "am I done?"
340
+ * verification at the end of an edit pipeline.
341
+ */
342
+ getEditSummary() {
343
+ return JSON.parse(this.wasm.GetEditSummary(this.handle));
344
+ }
345
+ /**
346
+ * Discoverability alias for {@link findPlaceholders}. Same return shape.
347
+ */
348
+ remainingPlaceholders(kinds = PlaceholderKinds.All) {
349
+ return JSON.parse(this.wasm.RemainingPlaceholders(this.handle, kinds));
350
+ }
351
+ getDiff(format = DiffFormat.Json) {
352
+ const raw = this.wasm.GetDiff(this.handle, format);
353
+ if (format === DiffFormat.Json) {
354
+ return JSON.parse(raw);
355
+ }
356
+ return raw;
149
357
  }
150
358
  // ─── Annotation-based anchor discovery (#132) ────────────────────────
151
359
  /**
@@ -184,6 +392,58 @@ export class DocxSession {
184
392
  findByBookmark(bookmarkName) {
185
393
  return JSON.parse(this.wasm.FindByBookmark(this.handle, bookmarkName));
186
394
  }
395
+ /**
396
+ * Look up a single anchor's preview info — `{ id, kind, scope, textPreview }`.
397
+ * Returns null when the anchor id is unknown.
398
+ *
399
+ * For iterating many anchors at once, prefer reading `textPreview` directly
400
+ * off the {@link MarkdownProjection.anchorIndex} entries (cheaper — no extra
401
+ * WASM round trip), or use {@link getAnchorInfos} for batched lookups.
402
+ */
403
+ getAnchorInfo(anchorId) {
404
+ const raw = this.wasm.GetAnchorInfo(this.handle, anchorId);
405
+ return JSON.parse(raw);
406
+ }
407
+ /**
408
+ * Bulk variant of {@link getAnchorInfo}: takes an array of anchor ids,
409
+ * returns a record where each unknown id maps to `null`.
410
+ */
411
+ getAnchorInfos(anchorIds) {
412
+ const raw = this.wasm.GetAnchorInfos(this.handle, JSON.stringify(anchorIds));
413
+ return JSON.parse(raw);
414
+ }
415
+ /**
416
+ * Resolve block-level metadata (style id+name, outline level, list membership,
417
+ * formatting probe) for an anchor. Returns null when the anchor doesn't exist.
418
+ */
419
+ getBlockMetadata(anchorId) {
420
+ const raw = this.wasm.GetBlockMetadata(this.handle, anchorId);
421
+ return JSON.parse(raw);
422
+ }
423
+ /**
424
+ * Bulk variant of {@link getBlockMetadata}. Unknown ids map to null;
425
+ * duplicates are deduped.
426
+ */
427
+ getBlockMetadatas(anchorIds) {
428
+ const raw = this.wasm.GetBlockMetadatas(this.handle, JSON.stringify(anchorIds));
429
+ return JSON.parse(raw);
430
+ }
431
+ /**
432
+ * Resolve the numbering facts for a list-item paragraph; returns null when
433
+ * the anchor has no w:numPr.
434
+ */
435
+ getListMembership(anchorId) {
436
+ const raw = this.wasm.GetListMembership(this.handle, anchorId);
437
+ return JSON.parse(raw);
438
+ }
439
+ /**
440
+ * Resolve page-layout info for the w:sectPr that governs an anchor.
441
+ * Returns null for anchors outside the body part.
442
+ */
443
+ getSectionInfo(anchorId) {
444
+ const raw = this.wasm.GetSectionInfo(this.handle, anchorId);
445
+ return JSON.parse(raw);
446
+ }
187
447
  /**
188
448
  * Enumerates every annotation persisted in the document. Lets an agent prime
189
449
  * itself with "here are the labeled regions you can target" before committing
@@ -192,6 +452,27 @@ export class DocxSession {
192
452
  listAnnotations() {
193
453
  return JSON.parse(this.wasm.ListAnnotations(this.handle));
194
454
  }
455
+ // ─── Annotation write surface ────────────────────────────────────────
456
+ /**
457
+ * Annotate a range inside `anchorId`. When `span` is `null`/`undefined`
458
+ * the annotation wraps every inline run of the block. When
459
+ * `annotation.id` is `undefined`, a 16-char hex id is auto-generated and
460
+ * returned in `EditResult.annotationId`.
461
+ */
462
+ addAnnotation(anchorId, span, annotation) {
463
+ const spanJson = span ? JSON.stringify(span) : "";
464
+ return JSON.parse(this.wasm.AddAnnotation(this.handle, anchorId, spanJson, JSON.stringify(annotation)));
465
+ }
466
+ removeAnnotation(annotationId) {
467
+ return JSON.parse(this.wasm.SessionRemoveAnnotation(this.handle, annotationId));
468
+ }
469
+ updateAnnotation(annotationId, update) {
470
+ return JSON.parse(this.wasm.UpdateAnnotation(this.handle, annotationId, JSON.stringify(update)));
471
+ }
472
+ moveAnnotation(annotationId, newAnchorId, newSpan) {
473
+ const spanJson = newSpan ? JSON.stringify(newSpan) : "";
474
+ return JSON.parse(this.wasm.MoveAnnotation(this.handle, annotationId, newAnchorId, spanJson));
475
+ }
195
476
  // ─── Lifecycle ───────────────────────────────────────────────────────
196
477
  undo() {
197
478
  return this.wasm.Undo(this.handle);
@@ -220,5 +501,5 @@ export function openDocxSession(bytes, wasmExports, settings) {
220
501
  const handle = bridge.OpenSession(bytes, settings ? JSON.stringify(settings) : "");
221
502
  return new DocxSession(handle, bridge);
222
503
  }
223
- export { PlaceholderKinds } from "./types.js";
504
+ export { ContextBoundary, PlaceholderKinds } from "./types.js";
224
505
  //# sourceMappingURL=session.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,qGAAqG;AAkBrG,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,OAAO,WAAW;IAItB,gBAAgB;IAChB,YAAY,MAAc,EAAE,IAA8C;QAiF1E,wEAAwE;QAE/D,QAAG,GAAG;YACb,MAAM,EAAE,CAAC,QAAgB,EAAU,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC;YAChF,SAAS,EAAE,CAAC,QAAgB,EAAE,QAA4B,EAAE,GAAW,EAAc,EAAE,CACrF,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAe;YACxF,UAAU,EAAE,CAAC,QAAgB,EAAE,GAAW,EAAc,EAAE,CACxD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAe;SAChF,CAAC;QAx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