@eigenpal/docx-js-editor 0.0.4 → 0.0.6

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 (49) hide show
  1. package/README.md +69 -132
  2. package/dist/chunk-2CFVFSUH.js +57 -0
  3. package/dist/{chunk-BQWGTYDH.js → chunk-AOL255XD.js} +1 -1
  4. package/dist/chunk-BBGDBZJY.cjs +1 -0
  5. package/dist/{chunk-EUHVOGCB.cjs → chunk-D2GERZ7M.cjs} +2 -2
  6. package/dist/chunk-DQHQWQHL.cjs +11 -0
  7. package/dist/chunk-FXILBPZI.cjs +9 -0
  8. package/dist/chunk-H2UMX5CK.js +9 -0
  9. package/dist/chunk-HGOIKOKZ.js +1 -0
  10. package/dist/chunk-I2C6ENCR.js +11 -0
  11. package/dist/chunk-TL3YTVN2.cjs +57 -0
  12. package/dist/{colorResolver-Yakhydrt.d.ts → colorResolver-DrNkos_H.d.ts} +1 -32
  13. package/dist/{colorResolver-C-tITrbI.d.cts → colorResolver-WsUxFs5p.d.cts} +1 -32
  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 +43 -43
  23. package/dist/index.css +1 -1
  24. package/dist/index.d.cts +174 -363
  25. package/dist/index.d.ts +174 -363
  26. package/dist/index.js +43 -43
  27. package/dist/mcp-cli.js +20 -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 +1 -1
  32. package/dist/{registry-DeeU0bQB.d.cts → registry-BWDZlJx6.d.cts} +1 -1
  33. package/dist/{registry-D3zhko7n.d.ts → registry-DifIQR1O.d.ts} +1 -1
  34. package/dist/selectionRects-M7QY6HKR.cjs +1 -0
  35. package/dist/selectionRects-O6YQMMCP.js +1 -0
  36. package/dist/styles.css +1 -1
  37. package/dist/{types-BJXChtaM.d.cts → types-XVRXTi4o.d.cts} +509 -336
  38. package/dist/{types-BJXChtaM.d.ts → types-XVRXTi4o.d.ts} +509 -336
  39. package/package.json +2 -2
  40. package/dist/chunk-6HBUJFBB.js +0 -1
  41. package/dist/chunk-CCXUC6LX.js +0 -9
  42. package/dist/chunk-DWFWDKAH.cjs +0 -9
  43. package/dist/chunk-FFPSMP4Q.cjs +0 -11
  44. package/dist/chunk-NI5OFVY2.js +0 -57
  45. package/dist/chunk-QB7IFLG2.cjs +0 -1
  46. package/dist/chunk-RGYAPHXT.cjs +0 -57
  47. package/dist/chunk-ZMWEAP5S.js +0 -11
  48. package/dist/selectionRects-2VAWY4ZQ.cjs +0 -1
  49. package/dist/selectionRects-ONIZYUUI.js +0 -1
@@ -1,6 +1,6 @@
1
- import { C as CorePlugin } from './types-BJXChtaM.cjs';
2
- export { b as CommandHandler, o as CommandResult, aD as ExtractCommand, J as JsonSchema, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, aE 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, aF as TypedCommandHandler, ac as ZodSchemaLike, ak as isZodSchema } from './types-BJXChtaM.cjs';
3
- export { P as PluginRegistry, c as createPluginRegistrar, p as default, p as pluginRegistry, r as registerPlugins } from './registry-DeeU0bQB.cjs';
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';
4
4
 
5
5
  /**
6
6
  * Docxtemplater Plugin
@@ -1,6 +1,6 @@
1
- import { C as CorePlugin } from './types-BJXChtaM.js';
2
- export { b as CommandHandler, o as CommandResult, aD as ExtractCommand, J as JsonSchema, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, aE 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, aF as TypedCommandHandler, ac as ZodSchemaLike, ak as isZodSchema } from './types-BJXChtaM.js';
3
- export { P as PluginRegistry, c as createPluginRegistrar, p as default, p as pluginRegistry, r as registerPlugins } from './registry-D3zhko7n.js';
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';
4
4
 
5
5
  /**
6
6
  * Docxtemplater Plugin
@@ -1 +1 @@
1
- export{x as docxtemplaterPlugin,w as isZodSchema}from'./chunk-BQWGTYDH.js';import'./chunk-ZMWEAP5S.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-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';
package/dist/headless.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkDWFWDKAH_cjs=require('./chunk-DWFWDKAH.cjs'),chunkEUHVOGCB_cjs=require('./chunk-EUHVOGCB.cjs'),chunkRGYAPHXT_cjs=require('./chunk-RGYAPHXT.cjs'),chunkFFPSMP4Q_cjs=require('./chunk-FFPSMP4Q.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 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(`
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 chunkDWFWDKAH_cjs.P}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.y}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.l}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.F}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.E}});Object.defineProperty(exports,"buildSelectionContextFromContext",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.C}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.m}});Object.defineProperty(exports,"comparePositions",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.M}});Object.defineProperty(exports,"createAgent",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.z}});Object.defineProperty(exports,"createAgentFromDocument",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.A}});Object.defineProperty(exports,"createCollapsedRange",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.J}});Object.defineProperty(exports,"createCommand",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.Q}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.I}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.H}});Object.defineProperty(exports,"createRange",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.K}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.i}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.h}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.j}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.y}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.p}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.r}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.x}});Object.defineProperty(exports,"getActionDescription",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.O}});Object.defineProperty(exports,"getActionLabel",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.N}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.B}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.f}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.D}});Object.defineProperty(exports,"getSelectionFormattingSummary",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.G}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.u}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.d}});Object.defineProperty(exports,"isPositionInRange",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.L}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.e}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.k}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.g}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.q}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.o}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.t}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.b}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.c}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.s}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunkDWFWDKAH_cjs.n}});Object.defineProperty(exports,"createTemplateProcessor",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.v}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.m}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.i}});Object.defineProperty(exports,"getMissingVariables",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.s}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.q}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.g}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.w}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.j}});Object.defineProperty(exports,"previewTemplate",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.t}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.n}});Object.defineProperty(exports,"processTemplateAdvanced",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.u}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.p}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.o}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.h}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkEUHVOGCB_cjs.r}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkRGYAPHXT_cjs.e}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkRGYAPHXT_cjs.d}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunkRGYAPHXT_cjs.b}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunkRGYAPHXT_cjs.c}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunkRGYAPHXT_cjs.a}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkFFPSMP4Q_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 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;
@@ -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-C-tITrbI.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-BJXChtaM.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-BJXChtaM.cjs';
4
- export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-DeeU0bQB.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-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';
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-Yakhydrt.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-BJXChtaM.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-BJXChtaM.js';
4
- export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-D3zhko7n.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-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';
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-CCXUC6LX.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-BQWGTYDH.js';export{e as createDocx,d as repackDocx,b as serializeDocumentBody,c as serializeDocx,a as serializeSectionProperties}from'./chunk-NI5OFVY2.js';export{l as parseDocx}from'./chunk-ZMWEAP5S.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-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(`
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};