@eigenpal/docx-editor-agents 1.3.3 → 1.5.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.
@@ -278,6 +278,19 @@ interface ParagraphFormatting {
278
278
  /** List level (0-8) (w:ilvl) */
279
279
  ilvl?: number;
280
280
  };
281
+ /**
282
+ * When `numPr` was resolved from the paragraph STYLE's pPr rather than the
283
+ * paragraph's own `<w:numPr>`, this records the style-sourced value. The
284
+ * serializer omits `numPr` while it still equals this value — writing it as
285
+ * direct formatting would flip Word's indent precedence (a directly
286
+ * referenced level's indents beat the style's; a style-referenced level's
287
+ * do not) and break the document on save/reload. Cleared the moment the
288
+ * user changes the numbering (values diverge).
289
+ */
290
+ numPrFromStyle?: {
291
+ numId?: number;
292
+ ilvl?: number;
293
+ };
281
294
  /** Outline level 0-9 (w:outlineLvl) */
282
295
  outlineLevel?: number;
283
296
  /** Paragraph style ID (w:pStyle) */
@@ -483,7 +496,7 @@ interface TableCellFormatting {
483
496
  /**
484
497
  * Number format type
485
498
  */
486
- type NumberFormat = 'decimal' | 'upperRoman' | 'lowerRoman' | 'upperLetter' | 'lowerLetter' | 'ordinal' | 'cardinalText' | 'ordinalText' | 'hex' | 'chicago' | 'ideographDigital' | 'japaneseCounting' | 'aiueo' | 'iroha' | 'decimalFullWidth' | 'decimalHalfWidth' | 'japaneseLegal' | 'japaneseDigitalTenThousand' | 'decimalEnclosedCircle' | 'decimalFullWidth2' | 'aiueoFullWidth' | 'irohaFullWidth' | 'decimalZero' | 'bullet' | 'ganada' | 'chosung' | 'decimalEnclosedFullstop' | 'decimalEnclosedParen' | 'decimalEnclosedCircleChinese' | 'ideographEnclosedCircle' | 'ideographTraditional' | 'ideographZodiac' | 'ideographZodiacTraditional' | 'taiwaneseCounting' | 'ideographLegalTraditional' | 'taiwaneseCountingThousand' | 'taiwaneseDigital' | 'chineseCounting' | 'chineseLegalSimplified' | 'chineseCountingThousand' | 'koreanDigital' | 'koreanCounting' | 'koreanLegal' | 'koreanDigital2' | 'vietnameseCounting' | 'russianLower' | 'russianUpper' | 'none' | 'numberInDash' | 'hebrew1' | 'hebrew2' | 'arabicAlpha' | 'arabicAbjad' | 'hindiVowels' | 'hindiConsonants' | 'hindiNumbers' | 'hindiCounting' | 'thaiLetters' | 'thaiNumbers' | 'thaiCounting';
499
+ type NumberFormat = 'decimal' | 'upperRoman' | 'lowerRoman' | 'upperLetter' | 'lowerLetter' | 'ordinal' | 'cardinalText' | 'ordinalText' | 'hex' | 'chicago' | 'ideographDigital' | 'japaneseCounting' | 'aiueo' | 'iroha' | 'decimalFullWidth' | 'decimalHalfWidth' | 'japaneseLegal' | 'japaneseDigitalTenThousand' | 'decimalEnclosedCircle' | 'decimalFullWidth2' | 'aiueoFullWidth' | 'irohaFullWidth' | 'decimalZero' | 'decimalZero3' | 'decimalZero4' | 'decimalZero5' | 'bullet' | 'ganada' | 'chosung' | 'decimalEnclosedFullstop' | 'decimalEnclosedParen' | 'decimalEnclosedCircleChinese' | 'ideographEnclosedCircle' | 'ideographTraditional' | 'ideographZodiac' | 'ideographZodiacTraditional' | 'taiwaneseCounting' | 'ideographLegalTraditional' | 'taiwaneseCountingThousand' | 'taiwaneseDigital' | 'chineseCounting' | 'chineseLegalSimplified' | 'chineseCountingThousand' | 'koreanDigital' | 'koreanCounting' | 'koreanLegal' | 'koreanDigital2' | 'vietnameseCounting' | 'russianLower' | 'russianUpper' | 'none' | 'numberInDash' | 'hebrew1' | 'hebrew2' | 'arabicAlpha' | 'arabicAbjad' | 'hindiVowels' | 'hindiConsonants' | 'hindiNumbers' | 'hindiCounting' | 'thaiLetters' | 'thaiNumbers' | 'thaiCounting';
487
500
  /**
488
501
  * Multi-level suffix (what follows the number)
489
502
  */
@@ -2343,12 +2356,10 @@ interface ReviewChange {
2343
2356
  */
2344
2357
  paragraphIndex: number;
2345
2358
  /**
2346
- * Set when the change lives inside a footnote or endnote. Such changes are
2347
- * surfaced for discovery only accept/reject operate on the body, so an id
2348
- * that resolves *only* to a note change throws `NoteChangeNotEditableError`
2349
- * (an id also present on a body change resolves to the body change). The
2350
- * raw `id` is not namespaced across parts, so pair it with `noteId` /
2351
- * `noteType` to identify the change.
2359
+ * Set when the change lives inside a footnote or endnote. The raw `id` is not
2360
+ * namespaced across parts, so pair it with `noteId` / `noteType` to identify
2361
+ * the change, and pass the whole `ReviewChange` back to `acceptChange` /
2362
+ * `rejectChange` to resolve it inside that note.
2352
2363
  */
2353
2364
  noteId?: number;
2354
2365
  /** Which note store the change came from. Absent for body changes. */
@@ -2378,6 +2389,11 @@ interface ChangeFilter {
2378
2389
  /** Also report tracked changes inside endnote bodies. Default: false. */
2379
2390
  includeEndnotes?: boolean;
2380
2391
  }
2392
+ /**
2393
+ * Options for `acceptAll` / `rejectAll`. Opt in to also resolve tracked changes
2394
+ * inside footnote/endnote bodies; mirrors the discovery flags on {@link ChangeFilter}.
2395
+ */
2396
+ type AcceptChangesOptions = Pick<ChangeFilter, 'includeFootnotes' | 'includeEndnotes'>;
2381
2397
  interface CommentFilter {
2382
2398
  author?: string;
2383
2399
  done?: boolean;
@@ -2605,10 +2621,11 @@ declare class DocxReviewer {
2605
2621
  * parts, so the same `id` can appear on a body change and a note change. Use
2606
2622
  * `noteType` / `noteId` to disambiguate.
2607
2623
  *
2608
- * Note changes are surfaced for discovery only. `acceptChange` /
2609
- * `rejectChange` operate on the document body, so an id that resolves *only*
2610
- * to a note change throws {@link NoteChangeNotEditableError} rather than
2611
- * mutating it (an id shared with a body change resolves to the body change).
2624
+ * A returned change with `noteId`/`noteType` set can be accepted or rejected
2625
+ * by passing the whole {@link ReviewChange} back to {@link acceptChange} /
2626
+ * {@link rejectChange} (which resolves it inside its footnote/endnote), or in
2627
+ * bulk via {@link acceptAll} / {@link rejectAll} with the matching `include*`
2628
+ * option; the result persists on {@link toBuffer}.
2612
2629
  */
2613
2630
  getChanges(filter?: ChangeFilter): ReviewChange[];
2614
2631
  /** Get all comments with their replies. */
@@ -2658,42 +2675,28 @@ declare class DocxReviewer {
2658
2675
  /** Delete text as a tracked change. */
2659
2676
  proposeDeletion(options: ProposeDeletionOptions): void;
2660
2677
  /**
2661
- * Guard the body-only accept/reject path against in-note changes.
2678
+ * Accept a tracked change. Pass a revision id to accept a change in the
2679
+ * document body, or pass a {@link ReviewChange} from {@link getChanges} to
2680
+ * accept it wherever it lives — a change carrying `noteId`/`noteType` is
2681
+ * resolved inside that footnote/endnote and persists on {@link toBuffer}.
2662
2682
  *
2663
- * A tracked-change `w:id` is unique only within its part, so the same id can
2664
- * appear in the body and in a footnote/endnote. When the id resolves to a
2665
- * body change we let the body-only impl handle it (body wins; the note, if
2666
- * any, is left untouched). When the id resolves ONLY to a note change we fail
2667
- * closed with {@link NoteChangeNotEditableError} rather than mis-reporting it
2668
- * as not-found — accept/reject cannot yet mutate note bodies.
2683
+ * A bare numeric id targets the body only: a `w:id` is unique only within its
2684
+ * part, so the same id can appear on a body change and a note change. To
2685
+ * resolve a note change pass the whole {@link ReviewChange} (its
2686
+ * `noteId`/`noteType` locate it); a bare id resolves to the body change, if any.
2669
2687
  */
2670
- private assertNotNoteOnly;
2688
+ acceptChange(target: number | ReviewChange): void;
2689
+ /** Reject a tracked change. See {@link acceptChange} for body-vs-note targeting. */
2690
+ rejectChange(target: number | ReviewChange): void;
2671
2691
  /**
2672
- * Accept a tracked change by its revision ID. Operates on the document body
2673
- * only.
2674
- *
2675
- * The public `id` is a `w:id`, which is unique only within its part, so the
2676
- * same id may appear in the body and in a footnote/endnote. Resolution is
2677
- * body-first: if a body change carries this id it is accepted and any
2678
- * same-id note change is left untouched. If the id resolves *only* to a note
2679
- * change, this throws {@link NoteChangeNotEditableError} (note bodies are not
2680
- * yet mutable here). If it resolves to nothing, it throws
2681
- * {@link ChangeNotFoundError}.
2682
- */
2683
- acceptChange(id: number): void;
2684
- /**
2685
- * Reject a tracked change by its revision ID. Operates on the document body
2686
- * only.
2687
- *
2688
- * Same resolution rules as {@link acceptChange}: body-first, throws
2689
- * {@link NoteChangeNotEditableError} for a note-only id, and
2690
- * {@link ChangeNotFoundError} when the id matches nothing.
2692
+ * Accept all tracked changes in the body. Pass `{ includeFootnotes,
2693
+ * includeEndnotes }` to also accept changes inside note bodies. Returns count.
2691
2694
  */
2692
- rejectChange(id: number): void;
2693
- /** Accept all tracked changes. Returns count accepted. */
2694
- acceptAll(): number;
2695
- /** Reject all tracked changes. Returns count rejected. */
2696
- rejectAll(): number;
2695
+ acceptAll(opts?: AcceptChangesOptions): number;
2696
+ /** Reject all tracked changes. See {@link acceptAll} for the note opt-in. */
2697
+ rejectAll(opts?: AcceptChangesOptions): number;
2698
+ /** The package's note stores, passed to change ops so note changes resolve. */
2699
+ private changeNotes;
2697
2700
  /**
2698
2701
  * Apply multiple review operations in one call.
2699
2702
  * Uses the reviewer's default author. Individual failures are collected, not thrown.
package/dist/server.d.mts CHANGED
@@ -31,4 +31,4 @@
31
31
  * @packageDocumentation
32
32
  * @public
33
33
  */
34
- export { s as AgentContextSnapshot, j as AgentToolDefinition, k as AgentToolResult, D as DocxReviewer, E as EditorBridge, S as SelectionInfo, o as createReviewerBridge, n as docxAgentTools, p as executeToolCall, t as getToolDisplayName, q as getToolSchemas } from './server-BaVhdHCd.mjs';
34
+ export { s as AgentContextSnapshot, j as AgentToolDefinition, k as AgentToolResult, D as DocxReviewer, E as EditorBridge, S as SelectionInfo, o as createReviewerBridge, n as docxAgentTools, p as executeToolCall, t as getToolDisplayName, q as getToolSchemas } from './server-D1vJRNf0.mjs';
package/dist/server.d.ts CHANGED
@@ -31,4 +31,4 @@
31
31
  * @packageDocumentation
32
32
  * @public
33
33
  */
34
- export { s as AgentContextSnapshot, j as AgentToolDefinition, k as AgentToolResult, D as DocxReviewer, E as EditorBridge, S as SelectionInfo, o as createReviewerBridge, n as docxAgentTools, p as executeToolCall, t as getToolDisplayName, q as getToolSchemas } from './server-BaVhdHCd.js';
34
+ export { s as AgentContextSnapshot, j as AgentToolDefinition, k as AgentToolResult, D as DocxReviewer, E as EditorBridge, S as SelectionInfo, o as createReviewerBridge, n as docxAgentTools, p as executeToolCall, t as getToolDisplayName, q as getToolSchemas } from './server-D1vJRNf0.js';
package/dist/server.js CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunkLX3NJWKV_js=require('./chunk-LX3NJWKV.js'),chunkXUAUDUJU_js=require('./chunk-XUAUDUJU.js'),chunkRI5S75JY_js=require('./chunk-RI5S75JY.js');Object.defineProperty(exports,"DocxReviewer",{enumerable:true,get:function(){return chunkLX3NJWKV_js.a}});Object.defineProperty(exports,"createReviewerBridge",{enumerable:true,get:function(){return chunkXUAUDUJU_js.n}});Object.defineProperty(exports,"docxAgentTools",{enumerable:true,get:function(){return chunkRI5S75JY_js.a}});Object.defineProperty(exports,"executeToolCall",{enumerable:true,get:function(){return chunkRI5S75JY_js.b}});Object.defineProperty(exports,"getToolDisplayName",{enumerable:true,get:function(){return chunkRI5S75JY_js.c}});Object.defineProperty(exports,"getToolSchemas",{enumerable:true,get:function(){return chunkRI5S75JY_js.d}});
1
+ 'use strict';var chunkRYT33AHF_js=require('./chunk-RYT33AHF.js'),chunkVPUAYS3Y_js=require('./chunk-VPUAYS3Y.js'),chunkRI5S75JY_js=require('./chunk-RI5S75JY.js');Object.defineProperty(exports,"DocxReviewer",{enumerable:true,get:function(){return chunkRYT33AHF_js.a}});Object.defineProperty(exports,"createReviewerBridge",{enumerable:true,get:function(){return chunkVPUAYS3Y_js.n}});Object.defineProperty(exports,"docxAgentTools",{enumerable:true,get:function(){return chunkRI5S75JY_js.a}});Object.defineProperty(exports,"executeToolCall",{enumerable:true,get:function(){return chunkRI5S75JY_js.b}});Object.defineProperty(exports,"getToolDisplayName",{enumerable:true,get:function(){return chunkRI5S75JY_js.c}});Object.defineProperty(exports,"getToolSchemas",{enumerable:true,get:function(){return chunkRI5S75JY_js.d}});
package/dist/server.mjs CHANGED
@@ -1 +1 @@
1
- export{a as DocxReviewer}from'./chunk-NFAEIOLC.mjs';export{n as createReviewerBridge}from'./chunk-P4DRISTP.mjs';export{a as docxAgentTools,b as executeToolCall,c as getToolDisplayName,d as getToolSchemas}from'./chunk-24MVJKCP.mjs';
1
+ export{a as DocxReviewer}from'./chunk-BFGKTTP7.mjs';export{n as createReviewerBridge}from'./chunk-HSVOT6AW.mjs';export{a as docxAgentTools,b as executeToolCall,c as getToolDisplayName,d as getToolSchemas}from'./chunk-24MVJKCP.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eigenpal/docx-editor-agents",
3
- "version": "1.3.3",
3
+ "version": "1.5.0",
4
4
  "description": "Agent SDK and chat UI for the DOCX editor — framework-agnostic bridge, MCP server, AI SDK adapters, plus React UI (and Vue UI in 1.x)",
5
5
  "sideEffects": [
6
6
  "*.css"