@eigenpal/docx-js-editor 0.0.6 → 0.0.8

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.
Files changed (47) hide show
  1. package/README.md +26 -2
  2. package/dist/{chunk-FXILBPZI.cjs → chunk-7O7MPYI7.cjs} +6 -6
  3. package/dist/chunk-AZFSFU4G.js +58 -0
  4. package/dist/{chunk-AOL255XD.js → chunk-B2GPMRIP.js} +2 -2
  5. package/dist/chunk-CEBRVCHO.js +11 -0
  6. package/dist/chunk-CWWSDDRF.cjs +11 -0
  7. package/dist/{chunk-D2GERZ7M.cjs → chunk-EKU3VR4Y.cjs} +2 -2
  8. package/dist/chunk-NZ7XUW4I.cjs +1 -0
  9. package/dist/{chunk-H2UMX5CK.js → chunk-VMT4DN2Q.js} +6 -6
  10. package/dist/chunk-W2TDS3UO.js +1 -0
  11. package/dist/chunk-WWGV3HB2.cjs +58 -0
  12. package/dist/{colorResolver-DrNkos_H.d.ts → colorResolver-CTmPdBGz.d.cts} +27 -7
  13. package/dist/{colorResolver-WsUxFs5p.d.cts → colorResolver-DGxlMbv2.d.ts} +27 -7
  14. package/dist/core-plugins.cjs +1 -1
  15. package/dist/core-plugins.d.cts +3 -3
  16. package/dist/core-plugins.d.ts +3 -3
  17. package/dist/core-plugins.js +1 -1
  18. package/dist/headless.cjs +2 -2
  19. package/dist/headless.d.cts +4 -4
  20. package/dist/headless.d.ts +4 -4
  21. package/dist/headless.js +1 -1
  22. package/dist/index.cjs +26 -27
  23. package/dist/index.css +1 -1
  24. package/dist/index.d.cts +118 -109
  25. package/dist/index.d.ts +118 -109
  26. package/dist/index.js +26 -27
  27. package/dist/mcp-cli.js +21 -20
  28. package/dist/mcp.cjs +3 -3
  29. package/dist/mcp.d.cts +1 -1
  30. package/dist/mcp.d.ts +1 -1
  31. package/dist/mcp.js +2 -2
  32. package/dist/{registry-BWDZlJx6.d.cts → registry-C73dM_1E.d.cts} +1 -1
  33. package/dist/{registry-DifIQR1O.d.ts → registry-Djkwny4j.d.ts} +1 -1
  34. package/dist/selectionRects-5TGQE33Q.cjs +1 -0
  35. package/dist/selectionRects-JSPKYXPU.js +1 -0
  36. package/dist/styles.css +1 -1
  37. package/dist/{types-XVRXTi4o.d.ts → types-Do_Q8vaT.d.cts} +5 -1
  38. package/dist/{types-XVRXTi4o.d.cts → types-Do_Q8vaT.d.ts} +5 -1
  39. package/package.json +10 -5
  40. package/dist/chunk-2CFVFSUH.js +0 -57
  41. package/dist/chunk-BBGDBZJY.cjs +0 -1
  42. package/dist/chunk-DQHQWQHL.cjs +0 -11
  43. package/dist/chunk-HGOIKOKZ.js +0 -1
  44. package/dist/chunk-I2C6ENCR.js +0 -11
  45. package/dist/chunk-TL3YTVN2.cjs +0 -57
  46. package/dist/selectionRects-M7QY6HKR.cjs +0 -1
  47. package/dist/selectionRects-O6YQMMCP.js +0 -1
@@ -1,4 +1,24 @@
1
- import { h as Document, T as TextFormatting, a6 as StyleInfo, k as AgentContext, g as Position, Y as Range, U as ParagraphFormatting, j as AgentCommand, a2 as SelectionContext, D as DocumentBody, a1 as SectionProperties, al as ColorValue, ab as Theme, am as ThemeColorSlot } from './types-XVRXTi4o.cjs';
1
+ import { h as Document, T as TextFormatting, a6 as StyleInfo, k as AgentContext, g as Position, Y as Range, U as ParagraphFormatting, j as AgentCommand, a2 as SelectionContext, D as DocumentBody, a1 as SectionProperties, al as ColorValue, ab as Theme, am as ThemeColorSlot } from './types-Do_Q8vaT.js';
2
+
3
+ /**
4
+ * Flexible input types for DOCX documents.
5
+ *
6
+ * Accepts any common binary format so consumers don't need to manually
7
+ * convert before passing data to the editor or parser.
8
+ */
9
+ /**
10
+ * Any binary representation of a DOCX file that the editor can consume.
11
+ *
12
+ * - `ArrayBuffer` — from `FileReader.readAsArrayBuffer()` or `fetch().arrayBuffer()`
13
+ * - `Uint8Array` — from Node.js `fs.readFile()` or streaming APIs
14
+ * - `Blob` — from drag-and-drop or `<input type="file">`
15
+ * - `File` — subclass of Blob, from `<input type="file">`
16
+ */
17
+ type DocxInput = ArrayBuffer | Uint8Array | Blob | File;
18
+ /**
19
+ * Normalize any {@link DocxInput} into an `ArrayBuffer` for internal use.
20
+ */
21
+ declare function toArrayBuffer(input: DocxInput): Promise<ArrayBuffer>;
2
22
 
3
23
  /**
4
24
  * DocumentAgent - High-level fluent API for programmatic document manipulation
@@ -94,12 +114,12 @@ declare class DocumentAgent {
94
114
  */
95
115
  constructor(source: Document | ArrayBuffer);
96
116
  /**
97
- * Create a DocumentAgent from an ArrayBuffer (async)
117
+ * Create a DocumentAgent from a DOCX buffer (async)
98
118
  *
99
- * @param buffer - DOCX file as ArrayBuffer
119
+ * @param buffer - DOCX file as ArrayBuffer, Uint8Array, Blob, or File
100
120
  * @returns Promise resolving to DocumentAgent
101
121
  */
102
- static fromBuffer(buffer: ArrayBuffer): Promise<DocumentAgent>;
122
+ static fromBuffer(buffer: DocxInput): Promise<DocumentAgent>;
103
123
  /**
104
124
  * Create a DocumentAgent from a Document object
105
125
  *
@@ -598,12 +618,12 @@ interface ParseOptions {
598
618
  /**
599
619
  * Parse a DOCX file into a complete Document model
600
620
  *
601
- * @param buffer - DOCX file as ArrayBuffer
621
+ * @param input - DOCX file as ArrayBuffer, Uint8Array, Blob, or File
602
622
  * @param options - Parsing options
603
623
  * @returns Promise resolving to Document
604
624
  * @throws Error if parsing fails
605
625
  */
606
- declare function parseDocx(buffer: ArrayBuffer, options?: ParseOptions): Promise<Document>;
626
+ declare function parseDocx(input: DocxInput, options?: ParseOptions): Promise<Document>;
607
627
 
608
628
  /**
609
629
  * Document Serializer - Serialize complete document.xml
@@ -1003,4 +1023,4 @@ declare function blendColors(color1: ColorValue | undefined | null, color2: Colo
1003
1023
  */
1004
1024
  declare function colorsEqual(color1: ColorValue | undefined | null, color2: ColorValue | undefined | null, theme: Theme | null | undefined): boolean;
1005
1025
 
1006
- export { resolveColor as $, type AgentContextOptions as A, getDocumentSummary as B, type CreateEmptyDocumentOptions as C, DocumentAgent as D, type ExtendedSelectionContext as E, type FormattedTextSegment as F, getMissingVariables as G, getSelectionFormattingSummary as H, type InsertHyperlinkOptions as I, getTemplateTags as J, halfPointsToPixels as K, isBlack as L, isWhite as M, lightenColor as N, parseColorString as O, type ProcessTemplateOptions as P, parseDocx as Q, pixelsToEmu as R, type SelectionContextOptions$1 as S, type TemplateError as T, pixelsToTwips as U, pointsToPixels as V, previewTemplate as W, processTemplate as X, processTemplateAdvanced as Y, processTemplateAsBlob as Z, processTemplateDetailed as _, type FormattingSummary as a, resolveHighlightColor as a0, resolveShadingColor as a1, serializeDocumentBody as a2, serializeDocument as a3, serializeSectionProperties as a4, twipsToEmu as a5, twipsToPixels as a6, validateTemplate as a7, type InsertImageOptions as b, type InsertTableOptions as c, type InsertTextOptions as d, type ProcessTemplateResult as e, type SelectionContextOptions as f, blendColors as g, buildExtendedSelectionContext as h, buildSelectionContext as i, buildSelectionContext$1 as j, colorsEqual as k, createAgent as l, createAgentFromDocument as m, createDocumentWithText as n, createEmptyDocument as o, createRgbColor as p, createTemplateProcessor as q, createThemeColor as r, darkenColor as s, emuToPixels as t, emuToTwips as u, executeCommand as v, executeCommands as w, formatPx as x, getAgentContext as y, getContrastingColor as z };
1026
+ export { resolveColor as $, type AgentContextOptions as A, getDocumentSummary as B, type CreateEmptyDocumentOptions as C, DocumentAgent as D, type ExtendedSelectionContext as E, type FormattedTextSegment as F, getMissingVariables as G, getSelectionFormattingSummary as H, type InsertHyperlinkOptions as I, getTemplateTags as J, halfPointsToPixels as K, isBlack as L, isWhite as M, lightenColor as N, parseColorString as O, type ProcessTemplateOptions as P, parseDocx as Q, pixelsToEmu as R, type SelectionContextOptions$1 as S, type TemplateError as T, pixelsToTwips as U, pointsToPixels as V, previewTemplate as W, processTemplate as X, processTemplateAdvanced as Y, processTemplateAsBlob as Z, processTemplateDetailed as _, type FormattingSummary as a, resolveHighlightColor as a0, resolveShadingColor as a1, serializeDocumentBody as a2, serializeDocument as a3, serializeSectionProperties as a4, twipsToEmu as a5, twipsToPixels as a6, validateTemplate as a7, type DocxInput as a8, toArrayBuffer as a9, type InsertImageOptions as b, type InsertTableOptions as c, type InsertTextOptions as d, type ProcessTemplateResult as e, type SelectionContextOptions as f, blendColors as g, buildExtendedSelectionContext as h, buildSelectionContext as i, buildSelectionContext$1 as j, colorsEqual as k, createAgent as l, createAgentFromDocument as m, createDocumentWithText as n, createEmptyDocument as o, createRgbColor as p, createTemplateProcessor as q, createThemeColor as r, darkenColor as s, emuToPixels as t, emuToTwips as u, executeCommand as v, executeCommands as w, formatPx as x, getAgentContext as y, getContrastingColor as z };
@@ -1 +1 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkD2GERZ7M_cjs=require('./chunk-D2GERZ7M.cjs');require('./chunk-DQHQWQHL.cjs');var chunkXVFMG77A_cjs=require('./chunk-XVFMG77A.cjs');require('./chunk-RTESADL3.cjs');Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.x}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.w}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.d}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.b}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.c}});
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkEKU3VR4Y_cjs=require('./chunk-EKU3VR4Y.cjs');require('./chunk-CWWSDDRF.cjs');var chunkXVFMG77A_cjs=require('./chunk-XVFMG77A.cjs');require('./chunk-RTESADL3.cjs');Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.x}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.w}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.d}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.b}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.c}});
@@ -1,6 +1,6 @@
1
- import { C as CorePlugin } from './types-XVRXTi4o.cjs';
2
- export { b as CommandHandler, o as CommandResult, aF as ExtractCommand, J as JsonSchema, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, aG as McpToolExample, N as McpToolHandler, O as McpToolResult, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, M as ToolDefinition, N as ToolHandler, O as ToolResult, aH as TypedCommandHandler, ac as ZodSchemaLike, ak as isZodSchema } from './types-XVRXTi4o.cjs';
3
- export { P as PluginRegistry, c as createPluginRegistrar, p as default, p as pluginRegistry, r as registerPlugins } from './registry-BWDZlJx6.cjs';
1
+ import { C as CorePlugin } from './types-Do_Q8vaT.cjs';
2
+ export { b as CommandHandler, o as CommandResult, aE as ExtractCommand, J as JsonSchema, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, aF as McpToolExample, N as McpToolHandler, O as McpToolResult, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, M as ToolDefinition, N as ToolHandler, O as ToolResult, aG as TypedCommandHandler, ac as ZodSchemaLike, ak as isZodSchema } from './types-Do_Q8vaT.cjs';
3
+ export { P as PluginRegistry, c as createPluginRegistrar, p as default, p as pluginRegistry, r as registerPlugins } from './registry-C73dM_1E.cjs';
4
4
 
5
5
  /**
6
6
  * Docxtemplater Plugin
@@ -1,6 +1,6 @@
1
- import { C as CorePlugin } from './types-XVRXTi4o.js';
2
- export { b as CommandHandler, o as CommandResult, aF as ExtractCommand, J as JsonSchema, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, aG as McpToolExample, N as McpToolHandler, O as McpToolResult, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, M as ToolDefinition, N as ToolHandler, O as ToolResult, aH as TypedCommandHandler, ac as ZodSchemaLike, ak as isZodSchema } from './types-XVRXTi4o.js';
3
- export { P as PluginRegistry, c as createPluginRegistrar, p as default, p as pluginRegistry, r as registerPlugins } from './registry-DifIQR1O.js';
1
+ import { C as CorePlugin } from './types-Do_Q8vaT.js';
2
+ export { b as CommandHandler, o as CommandResult, aE as ExtractCommand, J as JsonSchema, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, aF as McpToolExample, N as McpToolHandler, O as McpToolResult, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, M as ToolDefinition, N as ToolHandler, O as ToolResult, aG as TypedCommandHandler, ac as ZodSchemaLike, ak as isZodSchema } from './types-Do_Q8vaT.js';
3
+ export { P as PluginRegistry, c as createPluginRegistrar, p as default, p as pluginRegistry, r as registerPlugins } from './registry-Djkwny4j.js';
4
4
 
5
5
  /**
6
6
  * Docxtemplater Plugin
@@ -1 +1 @@
1
- export{x as docxtemplaterPlugin,w as isZodSchema}from'./chunk-AOL255XD.js';import'./chunk-I2C6ENCR.js';export{a as PluginRegistry,d as createPluginRegistrar,b as default,b as pluginRegistry,c as registerPlugins}from'./chunk-QHWHCIUW.js';import'./chunk-3IYNTJO5.js';
1
+ export{x as docxtemplaterPlugin,w as isZodSchema}from'./chunk-B2GPMRIP.js';import'./chunk-CEBRVCHO.js';export{a as PluginRegistry,d as createPluginRegistrar,b as default,b as pluginRegistry,c as registerPlugins}from'./chunk-QHWHCIUW.js';import'./chunk-3IYNTJO5.js';
package/dist/headless.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkFXILBPZI_cjs=require('./chunk-FXILBPZI.cjs'),chunkD2GERZ7M_cjs=require('./chunk-D2GERZ7M.cjs'),chunkTL3YTVN2_cjs=require('./chunk-TL3YTVN2.cjs'),chunkDQHQWQHL_cjs=require('./chunk-DQHQWQHL.cjs'),chunkFOU7PS3K_cjs=require('./chunk-FOU7PS3K.cjs'),chunkXVFMG77A_cjs=require('./chunk-XVFMG77A.cjs');require('./chunk-RTESADL3.cjs');function p(n){let e=[];for(let t of n.content)t.type==="run"?e.push(c(t)):t.type==="hyperlink"&&e.push(g(t));return e.join("")}function c(n){return n.content.filter(e=>e.type==="text").map(e=>e.text).join("")}function g(n){let e=[];for(let t of n.children)t.type==="run"&&e.push(c(t));return e.join("")}function x(n){let e=[];for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&e.push(p(r));return e.join(" ")}function Me(n){let e=[];for(let t of n.content)t.type==="paragraph"?e.push(p(t)):t.type==="table"&&e.push(x(t));return e.join(`
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunk7O7MPYI7_cjs=require('./chunk-7O7MPYI7.cjs'),chunkEKU3VR4Y_cjs=require('./chunk-EKU3VR4Y.cjs'),chunkWWGV3HB2_cjs=require('./chunk-WWGV3HB2.cjs'),chunkCWWSDDRF_cjs=require('./chunk-CWWSDDRF.cjs'),chunkFOU7PS3K_cjs=require('./chunk-FOU7PS3K.cjs'),chunkXVFMG77A_cjs=require('./chunk-XVFMG77A.cjs');require('./chunk-RTESADL3.cjs');function p(n){let e=[];for(let t of n.content)t.type==="run"?e.push(c(t)):t.type==="hyperlink"&&e.push(g(t));return e.join("")}function c(n){return n.content.filter(e=>e.type==="text").map(e=>e.text).join("")}function g(n){let e=[];for(let t of n.children)t.type==="run"&&e.push(c(t));return e.join("")}function x(n){let e=[];for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&e.push(p(r));return e.join(" ")}function Me(n){let e=[];for(let t of n.content)t.type==="paragraph"?e.push(p(t)):t.type==="table"&&e.push(x(t));return e.join(`
2
2
  `)}function f(n){return n.split(/\s+/).filter(t=>t.length>0).length}function je(n,e=true){return e?n.length:n.replace(/\s/g,"").length}function We(n){let e=0;for(let t of n.content)t.type==="paragraph"?e+=f(p(t)):t.type==="table"&&(e+=ze(t));return e}function ze(n){let e=0;for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&(e+=f(p(r)));return e}function Ne(n){let e=0;for(let t of n.content)t.type==="paragraph"?e+=p(t).length:t.type==="table"&&(e+=qe(t));return e}function qe(n){let e=0;for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&(e+=p(r).length);return e}function Ze(n,e,t){let o=[],r=0,i=n[e.paragraphIndex];if(i){let s=p(i).slice(0,e.offset);o.unshift(s),r+=s.length;}for(let l=e.paragraphIndex-1;l>=0&&r<t;l--){let s=n[l];if(!s)continue;let u=p(s);o.unshift(u),r+=u.length;}let a=o.join(`
3
3
  `);return a.length>t?"..."+a.slice(-t):a}function _e(n,e,t){let o=[],r=0,i=n[e.paragraphIndex];if(i){let s=p(i).slice(e.offset);o.push(s),r+=s.length;}for(let l=e.paragraphIndex+1;l<n.length&&r<t;l++){let s=n[l];if(!s)continue;let u=p(s);o.push(u),r+=u.length;}let a=o.join(`
4
- `);return a.length>t?a.slice(0,t)+"...":a}function Je(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o),i=t+r.length;if(e>=t&&e<i)return o.formatting||{};t=i;}else if(o.type==="hyperlink"){let r=g(o),i=t+r.length;if(e>=t&&e<i){for(let a of o.children)if(a.type==="run")return a.formatting||{}}t=i;}return {}}function Ue(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return true;t=a;}return false}function Ge(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return o;t=a;}}function Ke(n){return n?n.toLowerCase().includes("heading"):false}function Qe(n){if(!n)return;let e=n.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}function Xe(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="run"){for(let o of t.content)if(o.type==="drawing")return true}}return false}function Ye(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="hyperlink")return true}return false}function $e(n){return n.content.some(e=>e.type==="table")}function y(n){return n.content.filter(e=>e.type==="paragraph")}function et(n,e){return y(n)[e]}function tt(n,e){let t=0;for(let o=0;o<n.content.length;o++)if(n.content[o].type==="paragraph"){if(t===e)return o;t++;}return -1}var ot="0.0.2";Object.defineProperty(exports,"DEFAULT_AI_ACTIONS",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.P}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.y}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.l}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.F}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.E}});Object.defineProperty(exports,"buildSelectionContextFromContext",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.C}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.m}});Object.defineProperty(exports,"comparePositions",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.M}});Object.defineProperty(exports,"createAgent",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.z}});Object.defineProperty(exports,"createAgentFromDocument",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.A}});Object.defineProperty(exports,"createCollapsedRange",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.J}});Object.defineProperty(exports,"createCommand",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.Q}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.I}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.H}});Object.defineProperty(exports,"createRange",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.K}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.i}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.h}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.j}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.y}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.p}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.r}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.x}});Object.defineProperty(exports,"getActionDescription",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.O}});Object.defineProperty(exports,"getActionLabel",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.N}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.B}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.f}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.D}});Object.defineProperty(exports,"getSelectionFormattingSummary",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.G}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.u}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.d}});Object.defineProperty(exports,"isPositionInRange",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.L}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.e}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.k}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.g}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.q}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.o}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.t}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.b}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.c}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.s}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunkFXILBPZI_cjs.n}});Object.defineProperty(exports,"createTemplateProcessor",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.v}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.m}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.i}});Object.defineProperty(exports,"getMissingVariables",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.s}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.q}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.g}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.w}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.j}});Object.defineProperty(exports,"previewTemplate",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.t}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.n}});Object.defineProperty(exports,"processTemplateAdvanced",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.u}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.p}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.o}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.h}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkD2GERZ7M_cjs.r}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkTL3YTVN2_cjs.e}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkTL3YTVN2_cjs.d}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunkTL3YTVN2_cjs.b}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunkTL3YTVN2_cjs.c}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunkTL3YTVN2_cjs.a}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkDQHQWQHL_cjs.l}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkFOU7PS3K_cjs.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkFOU7PS3K_cjs.b}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.d}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.c}});exports.VERSION=ot;exports.countCharacters=je;exports.countWords=f;exports.getBlockIndexForParagraph=tt;exports.getBodyCharacterCount=Ne;exports.getBodyText=Me;exports.getBodyWordCount=We;exports.getFormattingAtPosition=Je;exports.getHyperlinkAtPosition=Ge;exports.getHyperlinkText=g;exports.getParagraphAtIndex=et;exports.getParagraphText=p;exports.getParagraphs=y;exports.getRunText=c;exports.getTableText=x;exports.getTextAfter=_e;exports.getTextBefore=Ze;exports.hasHyperlinks=Ye;exports.hasImages=Xe;exports.hasTables=$e;exports.isHeadingStyle=Ke;exports.isPositionInHyperlink=Ue;exports.parseHeadingLevel=Qe;
4
+ `);return a.length>t?a.slice(0,t)+"...":a}function Je(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o),i=t+r.length;if(e>=t&&e<i)return o.formatting||{};t=i;}else if(o.type==="hyperlink"){let r=g(o),i=t+r.length;if(e>=t&&e<i){for(let a of o.children)if(a.type==="run")return a.formatting||{}}t=i;}return {}}function Ue(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return true;t=a;}return false}function Ge(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return o;t=a;}}function Ke(n){return n?n.toLowerCase().includes("heading"):false}function Qe(n){if(!n)return;let e=n.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}function Xe(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="run"){for(let o of t.content)if(o.type==="drawing")return true}}return false}function Ye(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="hyperlink")return true}return false}function $e(n){return n.content.some(e=>e.type==="table")}function y(n){return n.content.filter(e=>e.type==="paragraph")}function et(n,e){return y(n)[e]}function tt(n,e){let t=0;for(let o=0;o<n.content.length;o++)if(n.content[o].type==="paragraph"){if(t===e)return o;t++;}return -1}var ot="0.0.2";Object.defineProperty(exports,"DEFAULT_AI_ACTIONS",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.P}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.y}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.l}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.F}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.E}});Object.defineProperty(exports,"buildSelectionContextFromContext",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.C}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.m}});Object.defineProperty(exports,"comparePositions",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.M}});Object.defineProperty(exports,"createAgent",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.z}});Object.defineProperty(exports,"createAgentFromDocument",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.A}});Object.defineProperty(exports,"createCollapsedRange",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.J}});Object.defineProperty(exports,"createCommand",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.Q}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.I}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.H}});Object.defineProperty(exports,"createRange",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.K}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.i}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.h}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.j}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.y}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.p}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.r}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.x}});Object.defineProperty(exports,"getActionDescription",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.O}});Object.defineProperty(exports,"getActionLabel",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.N}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.B}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.f}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.D}});Object.defineProperty(exports,"getSelectionFormattingSummary",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.G}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.u}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.d}});Object.defineProperty(exports,"isPositionInRange",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.L}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.e}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.k}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.g}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.q}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.o}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.t}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.b}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.c}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.s}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.n}});Object.defineProperty(exports,"createTemplateProcessor",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.v}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.m}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.i}});Object.defineProperty(exports,"getMissingVariables",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.s}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.q}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.g}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.w}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.j}});Object.defineProperty(exports,"previewTemplate",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.t}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.n}});Object.defineProperty(exports,"processTemplateAdvanced",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.u}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.p}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.o}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.h}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.r}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkWWGV3HB2_cjs.e}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkWWGV3HB2_cjs.d}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunkWWGV3HB2_cjs.b}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunkWWGV3HB2_cjs.c}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunkWWGV3HB2_cjs.a}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkCWWSDDRF_cjs.n}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkFOU7PS3K_cjs.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkFOU7PS3K_cjs.b}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.d}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.c}});exports.VERSION=ot;exports.countCharacters=je;exports.countWords=f;exports.getBlockIndexForParagraph=tt;exports.getBodyCharacterCount=Ne;exports.getBodyText=Me;exports.getBodyWordCount=We;exports.getFormattingAtPosition=Je;exports.getHyperlinkAtPosition=Ge;exports.getHyperlinkText=g;exports.getParagraphAtIndex=et;exports.getParagraphText=p;exports.getParagraphs=y;exports.getRunText=c;exports.getTableText=x;exports.getTextAfter=_e;exports.getTextBefore=Ze;exports.hasHyperlinks=Ye;exports.hasImages=Xe;exports.hasTables=$e;exports.isHeadingStyle=Ke;exports.isPositionInHyperlink=Ue;exports.parseHeadingLevel=Qe;
@@ -1,7 +1,7 @@
1
- export { A as AgentContextOptions, S as ContextSelectionOptions, C as CreateEmptyDocumentOptions, D as DocumentAgent, E as ExtendedSelectionContext, F as FormattedTextSegment, a as FormattingSummary, I as InsertHyperlinkOptions, b as InsertImageOptions, c as InsertTableOptions, d as InsertTextOptions, P as ProcessTemplateOptions, e as ProcessTemplateResult, f as SelectionContextOptions, T as TemplateError, g as blendColors, h as buildExtendedSelectionContext, i as buildSelectionContext, j as buildSelectionContextFromContext, k as colorsEqual, l as createAgent, m as createAgentFromDocument, n as createDocumentWithText, o as createEmptyDocument, p as createRgbColor, q as createTemplateProcessor, r as createThemeColor, s as darkenColor, D as default, t as emuToPixels, u as emuToTwips, v as executeCommand, w as executeCommands, x as formatPx, y as getAgentContext, z as getContrastingColor, B as getDocumentSummary, G as getMissingVariables, H as getSelectionFormattingSummary, J as getTemplateTags, K as halfPointsToPixels, L as isBlack, M as isWhite, N as lightenColor, O as parseColorString, Q as parseDocx, R as pixelsToEmu, U as pixelsToTwips, V as pointsToPixels, W as previewTemplate, X as processTemplate, Y as processTemplateAdvanced, Z as processTemplateAsBlob, _ as processTemplateDetailed, $ as resolveColor, a0 as resolveHighlightColor, a1 as resolveShadingColor, a2 as serializeDocumentBody, a3 as serializeDocx, a4 as serializeSectionProperties, a5 as twipsToEmu, a6 as twipsToPixels, a7 as validateTemplate } from './colorResolver-WsUxFs5p.cjs';
2
- import { D as DocumentBody, e as Paragraph, T as TextFormatting, H as Hyperlink, R as Run, f as Table, g as Position, h as Document } from './types-XVRXTi4o.cjs';
3
- export { A as AIAction, i as AIActionRequest, j as AgentCommand, k as AgentContext, l as AgentResponse, m as ApplyStyleCommand, n as ApplyVariablesCommand, B as BlockContent, b as CommandHandler, o as CommandResult, C as CorePlugin, p as DEFAULT_AI_ACTIONS, q as DeleteTextCommand, r as DocxPackage, E as Endnote, F as Footnote, s as FormatParagraphCommand, t as FormatTextCommand, I as Image, u as InsertHyperlinkCommand, v as InsertImageCommand, w as InsertTableCommand, x as InsertTextCommand, J as JsonSchema, L as ListLevel, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, N as McpToolHandler, O as McpToolResult, Q as NumberingDefinitions, S as ParagraphContext, U as ParagraphFormatting, V as ParagraphOutline, C as Plugin, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, Y as Range, Z as Relationship, _ as ReplaceTextCommand, $ as RunContent, a0 as SectionInfo, a1 as SectionProperties, a2 as SelectionContext, a3 as SetVariableCommand, a4 as Style, a5 as StyleDefinitions, a6 as StyleInfo, a7 as SuggestedAction, a8 as TableCell, a9 as TableRow, aa as TextContent, ab as Theme, M as ToolDefinition, N as ToolHandler, O as ToolResult, ac as ZodSchemaLike, ad as comparePositions, ae as createCollapsedRange, af as createCommand, ag as createRange, ah as getActionDescription, ai as getActionLabel, aj as isPositionInRange, ak as isZodSchema } from './types-XVRXTi4o.cjs';
4
- export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-BWDZlJx6.cjs';
1
+ export { A as AgentContextOptions, S as ContextSelectionOptions, C as CreateEmptyDocumentOptions, D as DocumentAgent, E as ExtendedSelectionContext, F as FormattedTextSegment, a as FormattingSummary, I as InsertHyperlinkOptions, b as InsertImageOptions, c as InsertTableOptions, d as InsertTextOptions, P as ProcessTemplateOptions, e as ProcessTemplateResult, f as SelectionContextOptions, T as TemplateError, g as blendColors, h as buildExtendedSelectionContext, i as buildSelectionContext, j as buildSelectionContextFromContext, k as colorsEqual, l as createAgent, m as createAgentFromDocument, n as createDocumentWithText, o as createEmptyDocument, p as createRgbColor, q as createTemplateProcessor, r as createThemeColor, s as darkenColor, D as default, t as emuToPixels, u as emuToTwips, v as executeCommand, w as executeCommands, x as formatPx, y as getAgentContext, z as getContrastingColor, B as getDocumentSummary, G as getMissingVariables, H as getSelectionFormattingSummary, J as getTemplateTags, K as halfPointsToPixels, L as isBlack, M as isWhite, N as lightenColor, O as parseColorString, Q as parseDocx, R as pixelsToEmu, U as pixelsToTwips, V as pointsToPixels, W as previewTemplate, X as processTemplate, Y as processTemplateAdvanced, Z as processTemplateAsBlob, _ as processTemplateDetailed, $ as resolveColor, a0 as resolveHighlightColor, a1 as resolveShadingColor, a2 as serializeDocumentBody, a3 as serializeDocx, a4 as serializeSectionProperties, a5 as twipsToEmu, a6 as twipsToPixels, a7 as validateTemplate } from './colorResolver-CTmPdBGz.cjs';
2
+ import { D as DocumentBody, e as Paragraph, T as TextFormatting, H as Hyperlink, R as Run, f as Table, g as Position, h as Document } from './types-Do_Q8vaT.cjs';
3
+ export { A as AIAction, i as AIActionRequest, j as AgentCommand, k as AgentContext, l as AgentResponse, m as ApplyStyleCommand, n as ApplyVariablesCommand, B as BlockContent, b as CommandHandler, o as CommandResult, C as CorePlugin, p as DEFAULT_AI_ACTIONS, q as DeleteTextCommand, r as DocxPackage, E as Endnote, F as Footnote, s as FormatParagraphCommand, t as FormatTextCommand, I as Image, u as InsertHyperlinkCommand, v as InsertImageCommand, w as InsertTableCommand, x as InsertTextCommand, J as JsonSchema, L as ListLevel, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, N as McpToolHandler, O as McpToolResult, Q as NumberingDefinitions, S as ParagraphContext, U as ParagraphFormatting, V as ParagraphOutline, C as Plugin, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, Y as Range, Z as Relationship, _ as ReplaceTextCommand, $ as RunContent, a0 as SectionInfo, a1 as SectionProperties, a2 as SelectionContext, a3 as SetVariableCommand, a4 as Style, a5 as StyleDefinitions, a6 as StyleInfo, a7 as SuggestedAction, a8 as TableCell, a9 as TableRow, aa as TextContent, ab as Theme, M as ToolDefinition, N as ToolHandler, O as ToolResult, ac as ZodSchemaLike, ad as comparePositions, ae as createCollapsedRange, af as createCommand, ag as createRange, ah as getActionDescription, ai as getActionLabel, aj as isPositionInRange, ak as isZodSchema } from './types-Do_Q8vaT.cjs';
4
+ export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-C73dM_1E.cjs';
5
5
 
6
6
  /**
7
7
  * Shared Text Utilities for Agent Module
@@ -1,7 +1,7 @@
1
- export { A as AgentContextOptions, S as ContextSelectionOptions, C as CreateEmptyDocumentOptions, D as DocumentAgent, E as ExtendedSelectionContext, F as FormattedTextSegment, a as FormattingSummary, I as InsertHyperlinkOptions, b as InsertImageOptions, c as InsertTableOptions, d as InsertTextOptions, P as ProcessTemplateOptions, e as ProcessTemplateResult, f as SelectionContextOptions, T as TemplateError, g as blendColors, h as buildExtendedSelectionContext, i as buildSelectionContext, j as buildSelectionContextFromContext, k as colorsEqual, l as createAgent, m as createAgentFromDocument, n as createDocumentWithText, o as createEmptyDocument, p as createRgbColor, q as createTemplateProcessor, r as createThemeColor, s as darkenColor, D as default, t as emuToPixels, u as emuToTwips, v as executeCommand, w as executeCommands, x as formatPx, y as getAgentContext, z as getContrastingColor, B as getDocumentSummary, G as getMissingVariables, H as getSelectionFormattingSummary, J as getTemplateTags, K as halfPointsToPixels, L as isBlack, M as isWhite, N as lightenColor, O as parseColorString, Q as parseDocx, R as pixelsToEmu, U as pixelsToTwips, V as pointsToPixels, W as previewTemplate, X as processTemplate, Y as processTemplateAdvanced, Z as processTemplateAsBlob, _ as processTemplateDetailed, $ as resolveColor, a0 as resolveHighlightColor, a1 as resolveShadingColor, a2 as serializeDocumentBody, a3 as serializeDocx, a4 as serializeSectionProperties, a5 as twipsToEmu, a6 as twipsToPixels, a7 as validateTemplate } from './colorResolver-DrNkos_H.js';
2
- import { D as DocumentBody, e as Paragraph, T as TextFormatting, H as Hyperlink, R as Run, f as Table, g as Position, h as Document } from './types-XVRXTi4o.js';
3
- export { A as AIAction, i as AIActionRequest, j as AgentCommand, k as AgentContext, l as AgentResponse, m as ApplyStyleCommand, n as ApplyVariablesCommand, B as BlockContent, b as CommandHandler, o as CommandResult, C as CorePlugin, p as DEFAULT_AI_ACTIONS, q as DeleteTextCommand, r as DocxPackage, E as Endnote, F as Footnote, s as FormatParagraphCommand, t as FormatTextCommand, I as Image, u as InsertHyperlinkCommand, v as InsertImageCommand, w as InsertTableCommand, x as InsertTextCommand, J as JsonSchema, L as ListLevel, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, N as McpToolHandler, O as McpToolResult, Q as NumberingDefinitions, S as ParagraphContext, U as ParagraphFormatting, V as ParagraphOutline, C as Plugin, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, Y as Range, Z as Relationship, _ as ReplaceTextCommand, $ as RunContent, a0 as SectionInfo, a1 as SectionProperties, a2 as SelectionContext, a3 as SetVariableCommand, a4 as Style, a5 as StyleDefinitions, a6 as StyleInfo, a7 as SuggestedAction, a8 as TableCell, a9 as TableRow, aa as TextContent, ab as Theme, M as ToolDefinition, N as ToolHandler, O as ToolResult, ac as ZodSchemaLike, ad as comparePositions, ae as createCollapsedRange, af as createCommand, ag as createRange, ah as getActionDescription, ai as getActionLabel, aj as isPositionInRange, ak as isZodSchema } from './types-XVRXTi4o.js';
4
- export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-DifIQR1O.js';
1
+ export { A as AgentContextOptions, S as ContextSelectionOptions, C as CreateEmptyDocumentOptions, D as DocumentAgent, E as ExtendedSelectionContext, F as FormattedTextSegment, a as FormattingSummary, I as InsertHyperlinkOptions, b as InsertImageOptions, c as InsertTableOptions, d as InsertTextOptions, P as ProcessTemplateOptions, e as ProcessTemplateResult, f as SelectionContextOptions, T as TemplateError, g as blendColors, h as buildExtendedSelectionContext, i as buildSelectionContext, j as buildSelectionContextFromContext, k as colorsEqual, l as createAgent, m as createAgentFromDocument, n as createDocumentWithText, o as createEmptyDocument, p as createRgbColor, q as createTemplateProcessor, r as createThemeColor, s as darkenColor, D as default, t as emuToPixels, u as emuToTwips, v as executeCommand, w as executeCommands, x as formatPx, y as getAgentContext, z as getContrastingColor, B as getDocumentSummary, G as getMissingVariables, H as getSelectionFormattingSummary, J as getTemplateTags, K as halfPointsToPixels, L as isBlack, M as isWhite, N as lightenColor, O as parseColorString, Q as parseDocx, R as pixelsToEmu, U as pixelsToTwips, V as pointsToPixels, W as previewTemplate, X as processTemplate, Y as processTemplateAdvanced, Z as processTemplateAsBlob, _ as processTemplateDetailed, $ as resolveColor, a0 as resolveHighlightColor, a1 as resolveShadingColor, a2 as serializeDocumentBody, a3 as serializeDocx, a4 as serializeSectionProperties, a5 as twipsToEmu, a6 as twipsToPixels, a7 as validateTemplate } from './colorResolver-DGxlMbv2.js';
2
+ import { D as DocumentBody, e as Paragraph, T as TextFormatting, H as Hyperlink, R as Run, f as Table, g as Position, h as Document } from './types-Do_Q8vaT.js';
3
+ export { A as AIAction, i as AIActionRequest, j as AgentCommand, k as AgentContext, l as AgentResponse, m as ApplyStyleCommand, n as ApplyVariablesCommand, B as BlockContent, b as CommandHandler, o as CommandResult, C as CorePlugin, p as DEFAULT_AI_ACTIONS, q as DeleteTextCommand, r as DocxPackage, E as Endnote, F as Footnote, s as FormatParagraphCommand, t as FormatTextCommand, I as Image, u as InsertHyperlinkCommand, v as InsertImageCommand, w as InsertTableCommand, x as InsertTextCommand, J as JsonSchema, L as ListLevel, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, N as McpToolHandler, O as McpToolResult, Q as NumberingDefinitions, S as ParagraphContext, U as ParagraphFormatting, V as ParagraphOutline, C as Plugin, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, Y as Range, Z as Relationship, _ as ReplaceTextCommand, $ as RunContent, a0 as SectionInfo, a1 as SectionProperties, a2 as SelectionContext, a3 as SetVariableCommand, a4 as Style, a5 as StyleDefinitions, a6 as StyleInfo, a7 as SuggestedAction, a8 as TableCell, a9 as TableRow, aa as TextContent, ab as Theme, M as ToolDefinition, N as ToolHandler, O as ToolResult, ac as ZodSchemaLike, ad as comparePositions, ae as createCollapsedRange, af as createCommand, ag as createRange, ah as getActionDescription, ai as getActionLabel, aj as isPositionInRange, ak as isZodSchema } from './types-Do_Q8vaT.js';
4
+ export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-Djkwny4j.js';
5
5
 
6
6
  /**
7
7
  * Shared Text Utilities for Agent Module
package/dist/headless.js CHANGED
@@ -1,4 +1,4 @@
1
- export{P as DEFAULT_AI_ACTIONS,y as DocumentAgent,l as blendColors,F as buildExtendedSelectionContext,E as buildSelectionContext,C as buildSelectionContextFromContext,m as colorsEqual,M as comparePositions,z as createAgent,A as createAgentFromDocument,J as createCollapsedRange,Q as createCommand,I as createDocumentWithText,H as createEmptyDocument,K as createRange,i as createRgbColor,h as createThemeColor,j as darkenColor,y as default,p as emuToPixels,r as emuToTwips,x as formatPx,O as getActionDescription,N as getActionLabel,B as getAgentContext,f as getContrastingColor,D as getDocumentSummary,G as getSelectionFormattingSummary,u as halfPointsToPixels,d as isBlack,L as isPositionInRange,e as isWhite,k as lightenColor,g as parseColorString,q as pixelsToEmu,o as pixelsToTwips,t as pointsToPixels,a as resolveColor,b as resolveHighlightColor,c as resolveShadingColor,s as twipsToEmu,n as twipsToPixels}from'./chunk-H2UMX5CK.js';export{v as createTemplateProcessor,a as detectVariables,b as detectVariablesDetailed,c as detectVariablesInBody,d as detectVariablesInParagraph,m as documentHasVariables,e as extractVariablesFromText,i as formatVariable,s as getMissingVariables,q as getTemplateTags,f as hasTemplateVariables,g as isValidVariableName,w as isZodSchema,j as parseVariable,t as previewTemplate,n as processTemplate,u as processTemplateAdvanced,p as processTemplateAsBlob,o as processTemplateDetailed,l as removeVariables,k as replaceVariables,h as sanitizeVariableName,r as validateTemplate}from'./chunk-AOL255XD.js';export{e as createDocx,d as repackDocx,b as serializeDocumentBody,c as serializeDocx,a as serializeSectionProperties}from'./chunk-2CFVFSUH.js';export{l as parseDocx}from'./chunk-I2C6ENCR.js';export{a as executeCommand,b as executeCommands}from'./chunk-AQ35GWDV.js';export{a as PluginRegistry,d as createPluginRegistrar,b as pluginRegistry,c as registerPlugins}from'./chunk-QHWHCIUW.js';import'./chunk-3IYNTJO5.js';function p(n){let e=[];for(let t of n.content)t.type==="run"?e.push(c(t)):t.type==="hyperlink"&&e.push(g(t));return e.join("")}function c(n){return n.content.filter(e=>e.type==="text").map(e=>e.text).join("")}function g(n){let e=[];for(let t of n.children)t.type==="run"&&e.push(c(t));return e.join("")}function x(n){let e=[];for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&e.push(p(r));return e.join(" ")}function Me(n){let e=[];for(let t of n.content)t.type==="paragraph"?e.push(p(t)):t.type==="table"&&e.push(x(t));return e.join(`
1
+ export{P as DEFAULT_AI_ACTIONS,y as DocumentAgent,l as blendColors,F as buildExtendedSelectionContext,E as buildSelectionContext,C as buildSelectionContextFromContext,m as colorsEqual,M as comparePositions,z as createAgent,A as createAgentFromDocument,J as createCollapsedRange,Q as createCommand,I as createDocumentWithText,H as createEmptyDocument,K as createRange,i as createRgbColor,h as createThemeColor,j as darkenColor,y as default,p as emuToPixels,r as emuToTwips,x as formatPx,O as getActionDescription,N as getActionLabel,B as getAgentContext,f as getContrastingColor,D as getDocumentSummary,G as getSelectionFormattingSummary,u as halfPointsToPixels,d as isBlack,L as isPositionInRange,e as isWhite,k as lightenColor,g as parseColorString,q as pixelsToEmu,o as pixelsToTwips,t as pointsToPixels,a as resolveColor,b as resolveHighlightColor,c as resolveShadingColor,s as twipsToEmu,n as twipsToPixels}from'./chunk-VMT4DN2Q.js';export{v as createTemplateProcessor,a as detectVariables,b as detectVariablesDetailed,c as detectVariablesInBody,d as detectVariablesInParagraph,m as documentHasVariables,e as extractVariablesFromText,i as formatVariable,s as getMissingVariables,q as getTemplateTags,f as hasTemplateVariables,g as isValidVariableName,w as isZodSchema,j as parseVariable,t as previewTemplate,n as processTemplate,u as processTemplateAdvanced,p as processTemplateAsBlob,o as processTemplateDetailed,l as removeVariables,k as replaceVariables,h as sanitizeVariableName,r as validateTemplate}from'./chunk-B2GPMRIP.js';export{e as createDocx,d as repackDocx,b as serializeDocumentBody,c as serializeDocx,a as serializeSectionProperties}from'./chunk-AZFSFU4G.js';export{n as parseDocx}from'./chunk-CEBRVCHO.js';export{a as executeCommand,b as executeCommands}from'./chunk-AQ35GWDV.js';export{a as PluginRegistry,d as createPluginRegistrar,b as pluginRegistry,c as registerPlugins}from'./chunk-QHWHCIUW.js';import'./chunk-3IYNTJO5.js';function p(n){let e=[];for(let t of n.content)t.type==="run"?e.push(c(t)):t.type==="hyperlink"&&e.push(g(t));return e.join("")}function c(n){return n.content.filter(e=>e.type==="text").map(e=>e.text).join("")}function g(n){let e=[];for(let t of n.children)t.type==="run"&&e.push(c(t));return e.join("")}function x(n){let e=[];for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&e.push(p(r));return e.join(" ")}function Me(n){let e=[];for(let t of n.content)t.type==="paragraph"?e.push(p(t)):t.type==="table"&&e.push(x(t));return e.join(`
2
2
  `)}function f(n){return n.split(/\s+/).filter(t=>t.length>0).length}function je(n,e=true){return e?n.length:n.replace(/\s/g,"").length}function We(n){let e=0;for(let t of n.content)t.type==="paragraph"?e+=f(p(t)):t.type==="table"&&(e+=ze(t));return e}function ze(n){let e=0;for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&(e+=f(p(r)));return e}function Ne(n){let e=0;for(let t of n.content)t.type==="paragraph"?e+=p(t).length:t.type==="table"&&(e+=qe(t));return e}function qe(n){let e=0;for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&(e+=p(r).length);return e}function Ze(n,e,t){let o=[],r=0,i=n[e.paragraphIndex];if(i){let s=p(i).slice(0,e.offset);o.unshift(s),r+=s.length;}for(let l=e.paragraphIndex-1;l>=0&&r<t;l--){let s=n[l];if(!s)continue;let u=p(s);o.unshift(u),r+=u.length;}let a=o.join(`
3
3
  `);return a.length>t?"..."+a.slice(-t):a}function _e(n,e,t){let o=[],r=0,i=n[e.paragraphIndex];if(i){let s=p(i).slice(e.offset);o.push(s),r+=s.length;}for(let l=e.paragraphIndex+1;l<n.length&&r<t;l++){let s=n[l];if(!s)continue;let u=p(s);o.push(u),r+=u.length;}let a=o.join(`
4
4
  `);return a.length>t?a.slice(0,t)+"...":a}function Je(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o),i=t+r.length;if(e>=t&&e<i)return o.formatting||{};t=i;}else if(o.type==="hyperlink"){let r=g(o),i=t+r.length;if(e>=t&&e<i){for(let a of o.children)if(a.type==="run")return a.formatting||{}}t=i;}return {}}function Ue(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return true;t=a;}return false}function Ge(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return o;t=a;}}function Ke(n){return n?n.toLowerCase().includes("heading"):false}function Qe(n){if(!n)return;let e=n.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}function Xe(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="run"){for(let o of t.content)if(o.type==="drawing")return true}}return false}function Ye(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="hyperlink")return true}return false}function $e(n){return n.content.some(e=>e.type==="table")}function y(n){return n.content.filter(e=>e.type==="paragraph")}function et(n,e){return y(n)[e]}function tt(n,e){let t=0;for(let o=0;o<n.content.length;o++)if(n.content[o].type==="paragraph"){if(t===e)return o;t++;}return -1}var ot="0.0.2";export{ot as VERSION,je as countCharacters,f as countWords,tt as getBlockIndexForParagraph,Ne as getBodyCharacterCount,Me as getBodyText,We as getBodyWordCount,Je as getFormattingAtPosition,Ge as getHyperlinkAtPosition,g as getHyperlinkText,et as getParagraphAtIndex,p as getParagraphText,y as getParagraphs,c as getRunText,x as getTableText,_e as getTextAfter,Ze as getTextBefore,Ye as hasHyperlinks,Xe as hasImages,$e as hasTables,Ke as isHeadingStyle,Ue as isPositionInHyperlink,Qe as parseHeadingLevel};